LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
#include <var-dec.hh>
Public Member Functions | |
Ctor & dtor. | |
VarDec (const Location &location, const misc::symbol &name, NameTy *type_name, Exp *init) | |
Construct a VarDec node. | |
virtual | ~VarDec () |
Destroy a VarDec node. | |
Visitors entry point. | |
virtual void | accept (ConstVisitor &v) const override |
Accept a const visitor v. | |
virtual void | accept (Visitor &v) override |
Accept a non-const visitor v. | |
Accessors. | |
const NameTy * | type_name_get () const |
Return optional type of the declared variable. | |
NameTy * | type_name_get () |
Return optional type of the declared variable. | |
const Exp * | init_get () const |
Return the initial value (expression) assigned to the variable. | |
Exp * | init_get () |
Return the initial value (expression) assigned to the variable. | |
Accessors. | |
const misc::symbol & | name_get () const |
Return name of the defined entity. | |
void | name_set (const misc::symbol &) |
Set name of the defined entity. | |
Accessors. | |
const Location & | location_get () const |
Return scanner position information. | |
void | location_set (const Location &) |
Set scanner position information. |
Protected Attributes | |
NameTy * | type_name_ |
Optional type of the declared variable. | |
Exp * | init_ |
The initial value (expression) assigned to the variable. | |
misc::symbol | name_ |
Name of the defined entity. | |
Location | location_ |
Scanner position information. |
ast::VarDec::VarDec | ( | const Location & | location, |
const misc::symbol & | name, | ||
NameTy * | type_name, | ||
Exp * | init | ||
) |
Construct a VarDec node.
|
virtual |
Destroy a VarDec node.
References init_, and type_name_.
|
overridevirtual |
Accept a const visitor v.
Implements ast::Dec.
|
overridevirtual |
Accept a non-const visitor v.
Implements ast::Dec.
|
inline |
Return the initial value (expression) assigned to the variable.
References init_.
Referenced by object::DesugarVisitor::operator()(), astclone::Cloner::operator()(), object::TypeChecker::operator()(), and translate::Translator::operator()().
|
inline |
Return the initial value (expression) assigned to the variable.
References init_.
|
inlineinherited |
Return scanner position information.
References ast::Ast::location_.
Referenced by type::TypeChecker::error(), object::DesugarVisitor::operator()(), astclone::Cloner::operator()(), ast::DecsList::push_back(), ast::DecsList::push_front(), and type::TypeChecker::type_mismatch().
|
inlineinherited |
Set scanner position information.
References ast::Ast::location_.
|
inlineinherited |
Return name of the defined entity.
References ast::Dec::name_.
Referenced by type::Attribute::name_get(), object::DesugarVisitor::operator()(), astclone::Cloner::operator()(), object::TypeChecker::operator()(), overload::Binder::visit_dec_header(), object::TypeChecker::visit_dec_header(), and translate::Translator::visit_function_dec_header().
|
inlineinherited |
Set name of the defined entity.
References ast::Dec::name_.
|
inline |
Return optional type of the declared variable.
References type_name_.
Referenced by object::DesugarVisitor::operator()(), and astclone::Cloner::operator()().
|
inline |
Return optional type of the declared variable.
References type_name_.
|
protected |
The initial value (expression) assigned to the variable.
Referenced by init_get(), and ~VarDec().
|
protectedinherited |
Scanner position information.
Referenced by ast::Ast::location_get(), ast::Ast::location_set(), ast::DecsList::push_back(), and ast::DecsList::push_front().
|
protectedinherited |
Name of the defined entity.
Referenced by ast::Dec::name_get(), and ast::Dec::name_set().
|
protected |
Optional type of the declared variable.
Referenced by type_name_get(), and ~VarDec().