PUMA Library Reference Manual
Puma::CTree Class Referenceabstract

#include <Puma/CTree.h>

+ Inheritance diagram for Puma::CTree:

Description

Base class for all C/C++ syntax tree classes.

The syntax tree is the result of the syntactic analysis of the input source code representing its syntactic structure according to the accepted grammar (see class Syntax).

Objects of this class and classes derived from this class are created by the tree builder component of Puma during the parse process. A syntax tree shall be destroyed using the tree builder that has created it by calling its method Builder::destroy(CTree*) with the root node of the syntax tree as its argument.

The navigation in the syntax tree is done using the methods CTree::Parent(), CTree::Sons(), and CTree::Son(int) const. In a syntax tree "sons" are understood as the syntactic child nodes of a syntax tree node, whereas "daughters" are understood are their semantic child nodes.

Another way to traverse a syntax tree is to implement an own tree visitor based on class Puma::CVisitor. This is recommended especially for larger syntax trees.

A syntax tree node can be identified by comparing its node name with the node identifier of the expected syntax tree node:

if (node->NodeName() == Puma::CT_BinaryExpr::NodeId()) ...

Based on the syntax tree further semantic analyses can be performed. Semantic information, like scope, value, type, and object information, is linked into the syntax tree. It can be accessed using the methods CTree::SemScope(), CTree::SemValue(), and CTree::SemObject(). Some nodes provide short-cuts to the semantic type and value information by implementing the methods CTree::Type() and CTree::Value().

The information of the syntax tree can be used to perform high-level transformations of the source code (see class ManipCommander).

Public Member Functions

virtual ~CTree ()
 Destructor. More...
 
virtual int Sons () const =0
 Get the number of sons. More...
 
virtual CTreeSon (int n) const
 Get the n-th son. More...
 
virtual const char * NodeName () const =0
 Get the node name (node identifier). More...
 
virtual Tokentoken () const
 Get the first token of the syntactic construct represented by this sub-tree. More...
 
virtual Tokenend_token () const
 Get the last token of the syntactic construct represented by this sub-tree. More...
 
virtual CT_Tokentoken_node () const
 Get the CT_Token node of the first token of the syntactic construct represented by this sub-tree. More...
 
virtual CT_Tokenend_token_node () const
 Get the CT_Token node of the last token of the syntactic construct represented by this sub-tree. More...
 
virtual void ReplaceSon (CTree *old_son, CTree *new_son)
 Replace a son. More...
 
virtual CTreeParent () const
 Get the parent node. More...
 
virtual CTypeInfoType () const
 Get the semantic type of the node. More...
 
virtual CExprValueValue () const
 Get the calculated value of the expression. More...
 
virtual CSemScopeSemScope () const
 Get the scope opened by the node. More...
 
virtual CSemValueSemValue () const
 Get the semantic value of the node. More...
 
virtual CSemObjectSemObject () const
 Get the semantic information of the node. More...
 
virtual CT_SimpleNameIsSimpleName ()
 Get a pointer to CT_SimpleName if the current node represents a name. More...
 
virtual CT_StringIsString ()
 Get a pointer to CT_String if the current node represents a string. More...
 
virtual CT_DeclaratorIsDeclarator ()
 Get a pointer to CT_Declarator if the current node represents a declarator. More...
 
virtual CT_StatementIsStatement ()
 Get a pointer to CT_Statement if the current node represents a statement. More...
 
virtual CT_ExpressionIsExpression ()
 Get a pointer to CT_Expression if the current node represents a expression. More...
 
virtual CT_DeclIsDeclaration ()
 Get a pointer to CT_Decl if the current node represents a declaration. More...
 
virtual CT_CallIsCall ()
 Get a pointer to CT_Call if the current node represents a call expression. More...
 
virtual CT_ListIsList ()
 Get a pointer to CT_List if the current node represents a list. More...
 
virtual CT_DelayedParseIsDelayedParse ()
 Get a pointer to CT_DelayedParse if the current node represents a delayed code fragment. More...
 
bool HasValueNull () const
 Return true if the tree has the constant value 0. More...
 

Static Public Attributes

static int alloc
 
static int release
 

Protected Member Functions

CTreeSon (CTree *const *sons, int len, int n) const
 Get the n-th son from given sons array. More...
 
int Sons (CTree *const *sons, int len) const
 Get the number of sons in the given sons array. More...
 
void ReplaceSon (CTree **sons, int len, CTree *old_son, CTree *new_son)
 Replace a son. More...
 
void ReplaceSon (CTree *&son, CTree *old_son, CTree *new_son)
 Replace a son if it equals the given son. More...
 
void AddSon (CTree *&son, CTree *new_son)
 Add a new son. More...
 
void SetParent (const CTree *parent)
 Set the parent tree node. More...
 
void SetParent (CTree *node, const CTree *parent)
 Set the parent tree node of the given tree node. More...
 
 CTree ()
 Default constructor. More...
 

Constructor & Destructor Documentation

Puma::CTree::CTree ( )
inlineprotected

Default constructor.

virtual Puma::CTree::~CTree ( )
inlinevirtual

Destructor.

Member Function Documentation

void Puma::CTree::AddSon ( CTree *&  son,
CTree new_son 
)
protected

Add a new son.

Parameters
sonThe actual son.
new_sonThe new son, overwrites the actual son.
virtual Token* Puma::CTree::end_token ( ) const
virtual

Get the last token of the syntactic construct represented by this sub-tree.

Returns
The token or NULL.

Reimplemented in Puma::CT_Token.

virtual CT_Token* Puma::CTree::end_token_node ( ) const
virtual

Get the CT_Token node of the last token of the syntactic construct represented by this sub-tree.

Returns
The token node or NULL.

Reimplemented in Puma::CT_Token.

bool Puma::CTree::HasValueNull ( ) const

Return true if the tree has the constant value 0.

Returns
True if constant value is 0.
virtual CT_Call* Puma::CTree::IsCall ( )
inlinevirtual

Get a pointer to CT_Call if the current node represents a call expression.

Returns
The CT_Call pointer or NULL.

Reimplemented in Puma::CT_Call.

virtual CT_Decl* Puma::CTree::IsDeclaration ( )
inlinevirtual

Get a pointer to CT_Decl if the current node represents a declaration.

Returns
The CT_Decl pointer or NULL.

Reimplemented in Puma::CT_Decl.

virtual CT_Declarator* Puma::CTree::IsDeclarator ( )
inlinevirtual

Get a pointer to CT_Declarator if the current node represents a declarator.

Returns
The CT_Declarator pointer or NULL.

Reimplemented in Puma::CT_Declarator.

virtual CT_DelayedParse* Puma::CTree::IsDelayedParse ( )
inlinevirtual

Get a pointer to CT_DelayedParse if the current node represents a delayed code fragment.

Returns
The CT_DelayedParse pointer or NULL.

Reimplemented in Puma::CT_DelayedParse.

virtual CT_Expression* Puma::CTree::IsExpression ( )
inlinevirtual

Get a pointer to CT_Expression if the current node represents a expression.

Returns
The CT_Expression pointer or NULL.

Reimplemented in Puma::CT_Expression.

virtual CT_List* Puma::CTree::IsList ( )
inlinevirtual

Get a pointer to CT_List if the current node represents a list.

Returns
The CT_List pointer or NULL.

Reimplemented in Puma::CT_List.

virtual CT_SimpleName* Puma::CTree::IsSimpleName ( )
inlinevirtual

Get a pointer to CT_SimpleName if the current node represents a name.

Returns
The CT_SimpleName node or NULL.

Reimplemented in Puma::CT_SimpleName.

virtual CT_Statement* Puma::CTree::IsStatement ( )
inlinevirtual

Get a pointer to CT_Statement if the current node represents a statement.

Returns
The CT_Statement pointer or NULL.

Reimplemented in Puma::CT_Statement.

virtual CT_String* Puma::CTree::IsString ( )
inlinevirtual

Get a pointer to CT_String if the current node represents a string.

Returns
The CT_String node or NULL.

Reimplemented in Puma::CT_String.

virtual const char* Puma::CTree::NodeName ( ) const
pure virtual

Get the node name (node identifier).

Implemented in Puma::CT_AnyCondition, Puma::CT_AnyExtension, Puma::CT_AnyList, Puma::CT_Any, Puma::CT_UsingDecl, Puma::CT_AccessDecl, Puma::CT_BaseSpec, Puma::CT_AccessSpec, Puma::CT_BaseSpecList, Puma::CT_MembInit, Puma::CT_MembInitList, Puma::CT_MembList, Puma::CT_UnionDef, Puma::CT_ClassDef, Puma::CT_Condition, Puma::CT_ForStmt, Puma::CT_DoStmt, Puma::CT_WhileStmt, Puma::CT_ReturnStmt, Puma::CT_GotoStmt, Puma::CT_ContinueStmt, Puma::CT_BreakStmt, Puma::CT_IfElseStmt, Puma::CT_IfStmt, Puma::CT_SwitchStmt, Puma::CT_DeclStmt, Puma::CT_ExprStmt, Puma::CT_CaseStmt, Puma::CT_TryStmt, Puma::CT_DefaultStmt, Puma::CT_LabelStmt, Puma::CT_BitFieldDeclarator, Puma::CT_MembPtrDeclarator, Puma::CT_PtrDeclarator, Puma::CT_RefDeclarator, Puma::CT_FctDeclarator, Puma::CT_ArrayDeclarator, Puma::CT_ArrayDelimiter, Puma::CT_BracedDeclarator, Puma::CT_InitDeclarator, Puma::CT_UsingDirective, Puma::CT_NamespaceAliasDef, Puma::CT_NamespaceDef, Puma::CT_ArgNameList, Puma::CT_ArgDeclSeq, Puma::CT_ArgDeclList, Puma::CT_ArgDecl, Puma::CT_LinkageSpec, Puma::CT_Handler, Puma::CT_AsmDef, Puma::CT_FctDef, Puma::CT_Enumerator, Puma::CT_EnumDef, Puma::CT_TypeParamDecl, Puma::CT_NonTypeParamDecl, Puma::CT_TemplateDecl, Puma::CT_ObjDecl, Puma::CT_Program, Puma::CT_ExceptionSpec, Puma::CT_EnumSpec, Puma::CT_UnionSpec, Puma::CT_ClassSpec, Puma::CT_NamedType, Puma::CT_PrimDeclSpec, Puma::CT_DesignatorSeq, Puma::CT_MembDesignator, Puma::CT_IndexDesignator, Puma::CT_OffsetofExpr, Puma::CT_TypeTraitExpr, Puma::CT_AlignofExpr, Puma::CT_SizeofExpr, Puma::CT_TypeidExpr, Puma::CT_ImplicitCast, Puma::CT_DynamicCast, Puma::CT_ReintCast, Puma::CT_ConstCast, Puma::CT_StaticCast, Puma::CT_CastExpr, Puma::CT_CallExpr, Puma::CT_IndexExpr, Puma::CT_ThrowExpr, Puma::CT_ConstructExpr, Puma::CT_CmpdLiteral, Puma::CT_IfThenExpr, Puma::CT_NewExpr, Puma::CT_DeleteExpr, Puma::CT_DerefExpr, Puma::CT_AddrExpr, Puma::CT_PostfixExpr, Puma::CT_UnaryExpr, Puma::CT_MembRefExpr, Puma::CT_MembPtrExpr, Puma::CT_BinaryExpr, Puma::CT_RootQualName, Puma::CT_QualName, Puma::CT_ConversionName, Puma::CT_OperatorName, Puma::CT_TemplateName, Puma::CT_DestructorName, Puma::CT_PrivateName, Puma::CT_SimpleName, Puma::CT_BracedExpr, Puma::CT_Bool, Puma::CT_Float, Puma::CT_WideCharacter, Puma::CT_Character, Puma::CT_Integer, Puma::CT_WideString, Puma::CT_String, Puma::CT_ImplicitCall, Puma::CT_Call, Puma::CT_Expression, Puma::CT_ExtensionList, Puma::CT_TemplateArgList, Puma::CT_TemplateParamList, Puma::CT_HandlerSeq, Puma::CT_CmpdStmt, Puma::CT_DeclSpecSeq, Puma::CT_DeclList, Puma::CT_EnumeratorList, Puma::CT_DeclaratorList, Puma::CT_ExprList, Puma::CT_GnuCaseStmt, Puma::CT_Token, Puma::CT_Error, Puma::CT_GnuLocalLabelStmt, Puma::CT_GnuTypeof, Puma::CT_GnuStatementExpr, Puma::CT_GnuAttribute, Puma::CT_GnuAsmClobbers, Puma::CT_GnuAsmOperands, Puma::CT_DelayedParseConstInit, Puma::CT_DelayedParseSkippedFctBody, Puma::CT_GnuAsmOperand, Puma::CT_DelayedParseFctBody, Puma::CT_DelayedParsePureSpec, Puma::CT_DelayedParseCtorInit, Puma::CT_DelayedParseFctTryBlock, Puma::CT_DelayedParseParamInit, Puma::CT_GnuAsmDef, Puma::CT_DelayedParse, Puma::Builder::Container, Puma::CT_GnuAsmSpec, Puma::CT_StaticAssert, and Puma::CT_AsmBlock.

virtual CTree* Puma::CTree::Parent ( ) const
inlinevirtual

Get the parent node.

Returns
The parent node or NULL.
void Puma::CTree::ReplaceSon ( CTree **  sons,
int  len,
CTree old_son,
CTree new_son 
)
protected

Replace a son.

Parameters
sonsThe sons array.
lenLength of the sons array.
old_sonThe son to replace.
new_sonThe new son.
void Puma::CTree::ReplaceSon ( CTree *&  son,
CTree old_son,
CTree new_son 
)
protected

Replace a son if it equals the given son.

Parameters
sonThe actual son.
old_sonThe son to replace, must match the actual son.
new_sonThe new son, overwrites the actual son.
virtual void Puma::CTree::ReplaceSon ( CTree old_son,
CTree new_son 
)
inlinevirtual

Replace a son.

Parameters
old_sonThe son to replace.
new_sonThe son with which to replace.

Reimplemented in Puma::CT_AnyCondition, Puma::CT_AnyExtension, Puma::CT_Any, Puma::CT_UsingDecl, Puma::CT_AccessDecl, Puma::CT_BaseSpec, Puma::CT_AccessSpec, Puma::CT_MembInit, Puma::CT_ClassDef, Puma::CT_Condition, Puma::CT_ForStmt, Puma::CT_DoStmt, Puma::CT_WhileStmt, Puma::CT_ReturnStmt, Puma::CT_GotoStmt, Puma::CT_ContinueStmt, Puma::CT_BreakStmt, Puma::CT_IfElseStmt, Puma::CT_IfStmt, Puma::CT_SwitchStmt, Puma::CT_DeclStmt, Puma::CT_ExprStmt, Puma::CT_CaseStmt, Puma::CT_TryStmt, Puma::CT_DefaultStmt, Puma::CT_LabelStmt, Puma::CT_BitFieldDeclarator, Puma::CT_MembPtrDeclarator, Puma::CT_PtrDeclarator, Puma::CT_RefDeclarator, Puma::CT_FctDeclarator, Puma::CT_ArrayDeclarator, Puma::CT_ArrayDelimiter, Puma::CT_BracedDeclarator, Puma::CT_InitDeclarator, Puma::CT_UsingDirective, Puma::CT_NamespaceAliasDef, Puma::CT_NamespaceDef, Puma::CT_ArgDecl, Puma::CT_LinkageSpec, Puma::CT_Handler, Puma::CT_AsmDef, Puma::CT_FctDef, Puma::CT_Enumerator, Puma::CT_EnumDef, Puma::CT_TypeParamDecl, Puma::CT_NonTypeParamDecl, Puma::CT_TemplateDecl, Puma::CT_ObjDecl, Puma::CT_ExceptionSpec, Puma::CT_ClassSpec, Puma::CT_NamedType, Puma::CT_PrimDeclSpec, Puma::CT_MembDesignator, Puma::CT_IndexDesignator, Puma::CT_OffsetofExpr, Puma::CT_TypeTraitExpr, Puma::CT_AlignofExpr, Puma::CT_SizeofExpr, Puma::CT_TypeidExpr, Puma::CT_ImplicitCast, Puma::CT_StaticCast, Puma::CT_CastExpr, Puma::CT_CallExpr, Puma::CT_IndexExpr, Puma::CT_ThrowExpr, Puma::CT_ConstructExpr, Puma::CT_CmpdLiteral, Puma::CT_IfThenExpr, Puma::CT_NewExpr, Puma::CT_DeleteExpr, Puma::CT_UnaryExpr, Puma::CT_MembPtrExpr, Puma::CT_BinaryExpr, Puma::CT_BracedExpr, Puma::CT_Bool, Puma::CT_Float, Puma::CT_Character, Puma::CT_Integer, Puma::CT_ImplicitCall, Puma::CT_List, Puma::CT_GnuCaseStmt, Puma::CT_GnuTypeof, Puma::CT_GnuStatementExpr, Puma::CT_GnuAsmOperand, Puma::CT_GnuAsmDef, Puma::CT_DelayedParse, Puma::CT_GnuAsmSpec, Puma::CT_StaticAssert, and Puma::CT_AsmBlock.

virtual CSemValue* Puma::CTree::SemValue ( ) const
inlinevirtual
void Puma::CTree::SetParent ( const CTree parent)
inlineprotected

Set the parent tree node.

Parameters
parentThe new parent tree node.
void Puma::CTree::SetParent ( CTree node,
const CTree parent 
)
inlineprotected

Set the parent tree node of the given tree node.

Parameters
nodeThe tree node.
parentThe new parent.
CTree* Puma::CTree::Son ( CTree *const *  sons,
int  len,
int  n 
) const
protected

Get the n-th son from given sons array.

Skips empty (NULL) array items.

Parameters
sonsThe sons array.
lenLength of the sons array.
nIndex of the son.
Returns
The n-th son or NULL.
virtual CTree* Puma::CTree::Son ( int  n) const
inlinevirtual

Get the n-th son.

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

Reimplemented in Puma::CT_AnyCondition, Puma::CT_AnyExtension, Puma::CT_Any, Puma::CT_UsingDecl, Puma::CT_AccessDecl, Puma::CT_BaseSpec, Puma::CT_AccessSpec, Puma::CT_MembInit, Puma::CT_ClassDef, Puma::CT_Condition, Puma::CT_ForStmt, Puma::CT_DoStmt, Puma::CT_WhileStmt, Puma::CT_ReturnStmt, Puma::CT_GotoStmt, Puma::CT_ContinueStmt, Puma::CT_BreakStmt, Puma::CT_IfElseStmt, Puma::CT_IfStmt, Puma::CT_SwitchStmt, Puma::CT_DeclStmt, Puma::CT_ExprStmt, Puma::CT_CaseStmt, Puma::CT_TryStmt, Puma::CT_DefaultStmt, Puma::CT_LabelStmt, Puma::CT_BitFieldDeclarator, Puma::CT_MembPtrDeclarator, Puma::CT_PtrDeclarator, Puma::CT_RefDeclarator, Puma::CT_FctDeclarator, Puma::CT_ArrayDeclarator, Puma::CT_ArrayDelimiter, Puma::CT_BracedDeclarator, Puma::CT_InitDeclarator, Puma::CT_UsingDirective, Puma::CT_NamespaceAliasDef, Puma::CT_NamespaceDef, Puma::CT_ArgDecl, Puma::CT_LinkageSpec, Puma::CT_Handler, Puma::CT_AsmDef, Puma::CT_FctDef, Puma::CT_Enumerator, Puma::CT_EnumDef, Puma::CT_TypeParamDecl, Puma::CT_NonTypeParamDecl, Puma::CT_TemplateDecl, Puma::CT_ObjDecl, Puma::CT_ExceptionSpec, Puma::CT_ClassSpec, Puma::CT_NamedType, Puma::CT_PrimDeclSpec, Puma::CT_MembDesignator, Puma::CT_IndexDesignator, Puma::CT_OffsetofExpr, Puma::CT_TypeTraitExpr, Puma::CT_AlignofExpr, Puma::CT_SizeofExpr, Puma::CT_TypeidExpr, Puma::CT_ImplicitCast, Puma::CT_StaticCast, Puma::CT_CastExpr, Puma::CT_CallExpr, Puma::CT_IndexExpr, Puma::CT_ThrowExpr, Puma::CT_ConstructExpr, Puma::CT_CmpdLiteral, Puma::CT_IfThenExpr, Puma::CT_NewExpr, Puma::CT_DeleteExpr, Puma::CT_UnaryExpr, Puma::CT_MembPtrExpr, Puma::CT_BinaryExpr, Puma::CT_PrivateName, Puma::CT_BracedExpr, Puma::CT_Bool, Puma::CT_Float, Puma::CT_Character, Puma::CT_Integer, Puma::CT_ImplicitCall, Puma::CT_List, Puma::CT_GnuCaseStmt, Puma::CT_GnuTypeof, Puma::CT_GnuStatementExpr, Puma::CT_GnuAsmOperand, Puma::CT_GnuAsmDef, Puma::CT_DelayedParse, Puma::CT_GnuAsmSpec, Puma::CT_StaticAssert, and Puma::CT_AsmBlock.

int Puma::CTree::Sons ( CTree *const *  sons,
int  len 
) const
protected

Get the number of sons in the given sons array.

Skips empty (NULL) array items.

Parameters
sonsThe sons array.
lenLength of the sons array.
virtual int Puma::CTree::Sons ( ) const
pure virtual

Get the number of sons.

Implemented in Puma::CT_AnyCondition, Puma::CT_AnyExtension, Puma::CT_Any, Puma::CT_UsingDecl, Puma::CT_AccessDecl, Puma::CT_BaseSpec, Puma::CT_AccessSpec, Puma::CT_MembInit, Puma::CT_ClassDef, Puma::CT_Condition, Puma::CT_ForStmt, Puma::CT_DoStmt, Puma::CT_WhileStmt, Puma::CT_ReturnStmt, Puma::CT_GotoStmt, Puma::CT_ContinueStmt, Puma::CT_BreakStmt, Puma::CT_IfElseStmt, Puma::CT_IfStmt, Puma::CT_SwitchStmt, Puma::CT_DeclStmt, Puma::CT_ExprStmt, Puma::CT_CaseStmt, Puma::CT_TryStmt, Puma::CT_DefaultStmt, Puma::CT_LabelStmt, Puma::CT_BitFieldDeclarator, Puma::CT_MembPtrDeclarator, Puma::CT_PtrDeclarator, Puma::CT_RefDeclarator, Puma::CT_FctDeclarator, Puma::CT_ArrayDeclarator, Puma::CT_ArrayDelimiter, Puma::CT_BracedDeclarator, Puma::CT_InitDeclarator, Puma::CT_UsingDirective, Puma::CT_NamespaceAliasDef, Puma::CT_NamespaceDef, Puma::CT_ArgDecl, Puma::CT_LinkageSpec, Puma::CT_Handler, Puma::CT_AsmDef, Puma::CT_FctDef, Puma::CT_Enumerator, Puma::CT_EnumDef, Puma::CT_TypeParamDecl, Puma::CT_NonTypeParamDecl, Puma::CT_TemplateDecl, Puma::CT_ObjDecl, Puma::CT_ExceptionSpec, Puma::CT_ClassSpec, Puma::CT_NamedType, Puma::CT_PrimDeclSpec, Puma::CT_MembDesignator, Puma::CT_IndexDesignator, Puma::CT_OffsetofExpr, Puma::CT_TypeTraitExpr, Puma::CT_AlignofExpr, Puma::CT_SizeofExpr, Puma::CT_TypeidExpr, Puma::CT_ImplicitCast, Puma::CT_StaticCast, Puma::CT_CastExpr, Puma::CT_CallExpr, Puma::CT_IndexExpr, Puma::CT_ThrowExpr, Puma::CT_ConstructExpr, Puma::CT_CmpdLiteral, Puma::CT_IfThenExpr, Puma::CT_NewExpr, Puma::CT_DeleteExpr, Puma::CT_UnaryExpr, Puma::CT_MembPtrExpr, Puma::CT_BinaryExpr, Puma::CT_PrivateName, Puma::CT_BracedExpr, Puma::CT_Bool, Puma::CT_Float, Puma::CT_Character, Puma::CT_Integer, Puma::CT_ImplicitCall, Puma::CT_Expression, Puma::CT_List, Puma::CT_GnuCaseStmt, Puma::CT_Token, Puma::CT_Error, Puma::CT_GnuLocalLabelStmt, Puma::CT_GnuTypeof, Puma::CT_GnuStatementExpr, Puma::CT_GnuAsmOperand, Puma::CT_GnuAsmDef, Puma::CT_DelayedParse, Puma::CT_GnuAsmSpec, Puma::CT_StaticAssert, and Puma::CT_AsmBlock.

virtual Token* Puma::CTree::token ( ) const
virtual

Get the first token of the syntactic construct represented by this sub-tree.

Returns
The token or NULL.

Reimplemented in Puma::CT_Token.

virtual CT_Token* Puma::CTree::token_node ( ) const
virtual

Get the CT_Token node of the first token of the syntactic construct represented by this sub-tree.

Returns
The token node or NULL.

Reimplemented in Puma::CT_Token.

virtual CTypeInfo* Puma::CTree::Type ( ) const
inlinevirtual
virtual CExprValue* Puma::CTree::Value ( ) const
inlinevirtual

Get the calculated value of the expression.

Returns
The value object or NULL.

Reimplemented in Puma::CT_AnyExtension, Puma::CT_ArrayDeclarator, Puma::CT_ArgDecl, Puma::CT_DesignatorSeq, Puma::CT_QualName, Puma::CT_SimpleName, Puma::CT_String, Puma::CT_Expression, and Puma::CT_ExprList.

Member Data Documentation

int Puma::CTree::alloc
static
int Puma::CTree::release
static