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

Method declaration. More...

#include <method-dec.hh>

Inheritance diagram for ast::MethodDec:
Collaboration diagram for ast::MethodDec:

Public Member Functions

std::list< bool > escapes_get () const
 Return the list of the escapes.
Ctor & dtor.
 MethodDec (const Location &location, const misc::symbol &name, VarDecs *formals, NameTy *result, Exp *body)
 Construct a MethodDec node.
virtual ~MethodDec ()
 Destroy a MethodDec 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

Method declaration.

A method declaration is not a function in the strict sense of object-oriented programming. Inheritance is used as a factoring tool here.

Constructor & Destructor Documentation

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

Construct a MethodDec node.

ast::MethodDec::~MethodDec ( )
virtual

Destroy a MethodDec node.

Member Function Documentation

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

Accept a const visitor v.

Reimplemented from ast::FunctionDec.

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

Accept a non-const visitor v.

Reimplemented from ast::FunctionDec.

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

Return instructions.

References ast::FunctionDec::body_.

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

Set instructions.

References ast::FunctionDec::body_.

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

Return the list of the escapes.

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

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

Return formal arguments.

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

Return result type.

References ast::FunctionDec::result_.

Member Data Documentation

Exp* ast::FunctionDec::body_
protectedinherited
VarDecs* ast::FunctionDec::formals_
protectedinherited
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_
protectedinherited

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