Puma Reference Manual Puma: Puma::CT_ClassDef Class Reference



Puma::CT_ClassDef Class Reference

Tree node representing a class definition. More...

#include <Puma/CTree.h>

Inherits Puma::CT_Decl, and Puma::CSemObject.

Inherited by Puma::CT_UnionDef.

List of all members.

Public Member Functions

 CT_ClassDef (CTree *k, CTree *n, CTree *b=(CTree *) 0)
 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_SimpleNameName () const
 Get the name of the class.
CT_MembListMembers () const
 Get the member declarations list.
CT_BaseSpecListBaseClasses () const
 Get the base class specifiers list.
CT_ObjDeclObjDecl () const
 Get the object declaration node containing the class definition.
CSemObjectSemObject () const
 Get the semantic information about the declared class.
void Members (CTree *m)
 Set the member declarations list.
void BaseClasses (CTree *bc)
 Set the base class specifiers list.
void ObjDecl (CTree *od)
 Set the object declaration containing the class definition.
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 class definition.

Example:

 class X : Y { int x; } 

Constructor & Destructor Documentation

Puma::CT_ClassDef::CT_ClassDef ( CTree k,
CTree n,
CTree b = (CTree*)0 
) [inline]

Constructor.

Parameters:
k The keyword 'class' or 'struct'.
n The name of the class.
b The base class list.

Member Function Documentation

void Puma::CT_ClassDef::BaseClasses ( CTree bc  )  [inline]

Set the base class specifiers list.

CT_BaseSpecList* Puma::CT_ClassDef::BaseClasses (  )  const [inline]

Get the base class specifiers list.

void Puma::CT_ClassDef::Members ( CTree m  )  [inline]

Set the member declarations list.

CT_MembList* Puma::CT_ClassDef::Members (  )  const [inline]

Get the member declarations list.

CT_SimpleName* Puma::CT_ClassDef::Name (  )  const [inline]

Get the name of the class.

static const char* Puma::CT_ClassDef::NodeId (  )  [static]

Get the identifier for this node type.

Can be compared with NodeName().

Reimplemented in Puma::CT_UnionDef.

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

Get the name of the node.

Can be compared with NodeId().

Implements Puma::CTree.

Reimplemented in Puma::CT_UnionDef.

void Puma::CT_ClassDef::ObjDecl ( CTree od  )  [inline]

Set the object declaration containing the class definition.

CT_ObjDecl* Puma::CT_ClassDef::ObjDecl (  )  const [inline]

Get the object declaration node containing the class definition.

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

Replace a son.

Parameters:
old_son The son to replace.
new_son The new son.
CSemObject* Puma::CT_ClassDef::SemObject (  )  const [inline, virtual]

Get the semantic information about the declared class.

Reimplemented from Puma::CTree.

CTree* Puma::CT_ClassDef::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.

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

Get the number of sons.

Implements Puma::CTree.




Puma Reference Manual. Created on 11 Sep 2009.