Puma Reference Manual Puma: Puma::CT_FctDef Class Reference



Puma::CT_FctDef Class Reference

#include <Puma/CTree.h>

Inheritance diagram for Puma::CT_FctDef:

Inheritance graph

List of all members.


Detailed Description

Tree node representing a function definition.

Example:

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

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 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.

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:
dss The declaration specifier sequence.
d The function declarator.
t Optional keyword 'try' for a function try-block.
ci Optional constructor initializer list.
as Optional K&R argument declaration list.
b The function body.
hs Exception handler sequence for a function try-block.


Member Function Documentation

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.

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

Get the number of sons.

Implements Puma::CTree.

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

Get the n-th son.

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

Reimplemented from Puma::CTree.

CT_DeclSpecSeq* Puma::CT_FctDef::DeclSpecs (  )  const [inline]

Get the declaration specifier sequence.

CTree* Puma::CT_FctDef::Declarator (  )  const [inline]

Get the function declarator.

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

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

CTree* Puma::CT_FctDef::CtorInit (  )  const [inline]

Get the constructor initializer list.

CT_ArgDeclSeq* Puma::CT_FctDef::ArgDeclSeq (  )  const [inline]

Get the K&R argument declaration sequence.

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

Get the function body.

CT_HandlerSeq* Puma::CT_FctDef::Handlers (  )  const [inline]

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

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

Get the semantic information about the function.

Reimplemented from Puma::CTree.

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

Set the constructor initializer list.

Parameters:
i The initializer list.

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

Set the function body.

Parameters:
b The function body.

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

Set the function try-block.

Parameters:
t The keyword 'try'.
c Optional constructor initializer list.
b The function body.
h The exception handler sequence.

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

Replace a son.

Parameters:
old_son The son to replace.
new_son The new son.

Reimplemented from Puma::CTree.




Puma Reference Manual. Created on 5 Nov 2008.