Puma Reference Manual Puma::CT_FctDef Class Reference



Puma::CT_FctDef Class Reference

Tree node representing a function definition. More...

#include <Puma/CTree.h>

Inheritance diagram for Puma::CT_FctDef:
Inheritance graph

List of all members.

Public Member Functions

 CT_FctDef (CTree *dss, CTree *d, CTree *t, CTree *ci, CTree *as, CTree *b, CTree *hs)
 Constructor.
const char * NodeName () const
 Get the name of the node.
int Sons () const
 Get the number of sons.
CTreeSon (int n) const
 Get the n-th son.
CT_DeclSpecSeqDeclSpecs () const
 Get the declaration specifier sequence.
CTreeDeclarator () const
 Get the function declarator.
CT_TokenTryKey () const
 Get the 'try' keyword of the function try-block.
CTreeCtorInit () const
 Get the constructor initializer list.
CT_ArgDeclSeqArgDeclSeq () const
 Get the K&R argument declaration sequence.
CT_CmpdStmtBody () const
 Get the function body.
CT_HandlerSeqHandlers () const
 Get the exception handler sequence of a function try-block.
CSemObjectSemObject () const
 Get the semantic information about the function.
void CtorInit (CTree *i)
 Set the constructor initializer list.
void Body (CTree *b)
 Set the function body.
void Handlers (CTree *h)
 Set the exception handler sequence of a function try-block.
void FctTryBlock (CTree *t, CTree *c, CTree *b, CTree *h)
 Set the function try-block.
void ReplaceSon (CTree *old_son, CTree *new_son)
 Replace a son.

Static Public Member Functions

static const char * NodeId ()
 Get the identifier for this node type.

Detailed Description

Tree node representing a function definition.

Example:

 int mul(int x, int y) {
   return x*y;
 }

Constructor & Destructor Documentation

Puma::CT_FctDef::CT_FctDef ( CTree dss,
CTree d,
CTree t,
CTree ci,
CTree as,
CTree b,
CTree hs 
) [inline]

Constructor.

Parameters:
dssThe declaration specifier sequence.
dThe function declarator.
tOptional keyword 'try' for a function try-block.
ciOptional constructor initializer list.
asOptional K&R argument declaration list.
bThe function body.
hsException handler sequence for a function try-block.

Member Function Documentation

Get the K&R argument declaration sequence.

CT_CmpdStmt* Puma::CT_FctDef::Body ( ) const [inline]

Get the function body.

void Puma::CT_FctDef::Body ( CTree b) [inline]

Set the function body.

Parameters:
bThe function body.
CTree* Puma::CT_FctDef::CtorInit ( ) const [inline]

Get the constructor initializer list.

void Puma::CT_FctDef::CtorInit ( CTree i) [inline]

Set the constructor initializer list.

Parameters:
iThe initializer list.
CTree* Puma::CT_FctDef::Declarator ( ) const [inline]

Get the function declarator.

Get the declaration specifier sequence.

void Puma::CT_FctDef::FctTryBlock ( CTree t,
CTree c,
CTree b,
CTree h 
) [inline]

Set the function try-block.

Parameters:
tThe keyword 'try'.
cOptional constructor initializer list.
bThe function body.
hThe exception handler sequence.

Get the exception handler sequence of a function try-block.

void Puma::CT_FctDef::Handlers ( CTree h) [inline]

Set the exception handler sequence of a function try-block.

Parameters:
hThe handlers.
static const char* Puma::CT_FctDef::NodeId ( ) [static]

Get the identifier for this node type.

Can be compared with NodeName().

const char* Puma::CT_FctDef::NodeName ( ) const [inline, virtual]

Get the name of the node.

Can be compared with NodeId().

Implements Puma::CTree.

void Puma::CT_FctDef::ReplaceSon ( CTree old_son,
CTree new_son 
) [inline, virtual]

Replace a son.

Parameters:
old_sonThe son to replace.
new_sonThe new son.

Reimplemented from Puma::CTree.

CSemObject* Puma::CT_FctDef::SemObject ( ) const [inline, virtual]

Get the semantic information about the function.

Reimplemented from Puma::CTree.

CTree* Puma::CT_FctDef::Son ( int  n) const [inline, virtual]

Get the n-th son.

Parameters:
nThe index of the son.
Returns:
The n-th son or NULL.

Reimplemented from Puma::CTree.

int Puma::CT_FctDef::Sons ( ) const [inline, virtual]

Get the number of sons.

Implements Puma::CTree.

CT_Token* Puma::CT_FctDef::TryKey ( ) const [inline]

Get the 'try' keyword of the function try-block.