LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ast::VarDec Class Reference

VarDec. More...

#include <var-dec.hh>

Inheritance diagram for ast::VarDec:
Collaboration diagram for ast::VarDec:

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 NameTytype_name_get () const
 Return optional type of the declared variable.
NameTytype_name_get ()
 Return optional type of the declared variable.
const Expinit_get () const
 Return the initial value (expression) assigned to the variable.
Expinit_get ()
 Return the initial value (expression) assigned to the variable.
Accessors.
const misc::symbolname_get () const
 Return name of the defined entity.
void name_set (const misc::symbol &)
 Set name of the defined entity.
Accessors.
const Locationlocation_get () const
 Return scanner position information.
void location_set (const Location &)
 Set scanner position information.

Protected Attributes

NameTytype_name_
 Optional type of the declared variable.
Expinit_
 The initial value (expression) assigned to the variable.
misc::symbol name_
 Name of the defined entity.
Location location_
 Scanner position information.

Detailed Description

Constructor & Destructor Documentation

ast::VarDec::VarDec ( const Location location,
const misc::symbol name,
NameTy type_name,
Exp init 
)

Construct a VarDec node.

ast::VarDec::~VarDec ( )
virtual

Destroy a VarDec node.

References init_, and type_name_.

Member Function Documentation

void ast::VarDec::accept ( ConstVisitor v) const
overridevirtual

Accept a const visitor v.

Implements ast::Dec.

void ast::VarDec::accept ( Visitor v)
overridevirtual

Accept a non-const visitor v.

Implements ast::Dec.

const Exp * ast::VarDec::init_get ( ) const
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()().

Exp * ast::VarDec::init_get ( )
inline

Return the initial value (expression) assigned to the variable.

References init_.

const Location & ast::Ast::location_get ( ) const
inlineinherited
void ast::Ast::location_set ( const Location location)
inlineinherited

Set scanner position information.

References ast::Ast::location_.

void ast::Dec::name_set ( const misc::symbol name)
inlineinherited

Set name of the defined entity.

References ast::Dec::name_.

const NameTy * ast::VarDec::type_name_get ( ) const
inline

Return optional type of the declared variable.

References type_name_.

Referenced by object::DesugarVisitor::operator()(), and astclone::Cloner::operator()().

NameTy * ast::VarDec::type_name_get ( )
inline

Return optional type of the declared variable.

References type_name_.

Member Data Documentation

Exp* ast::VarDec::init_
protected

The initial value (expression) assigned to the variable.

Referenced by init_get(), and ~VarDec().

Location ast::Ast::location_
protectedinherited
misc::symbol ast::Dec::name_
protectedinherited

Name of the defined entity.

Referenced by ast::Dec::name_get(), and ast::Dec::name_set().

NameTy* ast::VarDec::type_name_
protected

Optional type of the declared variable.

Referenced by type_name_get(), and ~VarDec().


The documentation for this class was generated from the following files: