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

FunctionDec. More...

#include <function-dec.hh>

Inheritance diagram for ast::FunctionDec:
Collaboration diagram for ast::FunctionDec:

Public Member Functions

std::list< bool > escapes_get () const
 Return the list of the escapes.
Ctor & dtor.
 FunctionDec (const Location &location, const misc::symbol &name, VarDecs *formals, NameTy *result, Exp *body)
 Construct a FunctionDec node.
virtual ~FunctionDec ()
 Destroy a FunctionDec 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 VarDecsformals_get () const
 Return formal arguments.
VarDecsformals_get ()
 Return formal arguments.
const NameTyresult_get () const
 Return result type.
NameTyresult_get ()
 Return result type.
const Expbody_get () const
 Return instructions.
Expbody_get ()
 Return instructions.
void body_set (Exp *)
 Set instructions.
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

VarDecsformals_
 Formal arguments.
NameTyresult_
 Result type.
Expbody_
 Instructions.
misc::symbol name_
 Name of the defined entity.
Location location_
 Scanner position information.

Detailed Description

Constructor & Destructor Documentation

ast::FunctionDec::FunctionDec ( const Location location,
const misc::symbol name,
VarDecs formals,
NameTy result,
Exp body 
)

Construct a FunctionDec node.

ast::FunctionDec::~FunctionDec ( )
virtual

Destroy a FunctionDec node.

References body_, formals_, and result_.

Member Function Documentation

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

Accept a const visitor v.

Implements ast::Dec.

Reimplemented in ast::MethodDec.

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

Accept a non-const visitor v.

Implements ast::Dec.

Reimplemented in ast::MethodDec.

Exp * ast::FunctionDec::body_get ( )
inline

Return instructions.

References body_.

void ast::FunctionDec::body_set ( Exp body)
inline

Set instructions.

References body_.

std::list<bool> ast::FunctionDec::escapes_get ( ) const
inline

Return the list of the escapes.

Referenced by translate::Translator::visit_function_dec_header().

const VarDecs & ast::FunctionDec::formals_get ( ) const
inline
VarDecs & ast::FunctionDec::formals_get ( )
inline

Return formal arguments.

References formals_.

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::FunctionDec::result_get ( ) const
inline
NameTy * ast::FunctionDec::result_get ( )
inline

Return result type.

References result_.

Member Data Documentation

Exp* ast::FunctionDec::body_
protected

Instructions.

Referenced by body_get(), body_set(), and ~FunctionDec().

VarDecs* ast::FunctionDec::formals_
protected

Formal arguments.

Referenced by formals_get(), and ~FunctionDec().

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::FunctionDec::result_
protected

Result type.

Referenced by result_get(), and ~FunctionDec().


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