Puma Reference Manual | Puma: Puma::PreTreeComposite Class Reference |
Base class for all C preprocessor syntax tree composite nodes. More...
#include <Puma/PreTreeComposite.h>
Inherits Puma::PreTree.
Inherited by Puma::PreAssertDirective, Puma::PreConditionalGroup, Puma::PreDefineConstantDirective, Puma::PreDefineFunctionDirective, Puma::PreDirectiveGroups, Puma::PreElifDirective, Puma::PreElifPart, Puma::PreElseDirective, Puma::PreElsePart, Puma::PreEndifDirective, Puma::PreErrorDirective, Puma::PreIdentifierList, Puma::PreIfdefDirective, Puma::PreIfDirective, Puma::PreIfndefDirective, Puma::PreIncludeDirective, Puma::PreProgram, Puma::PreTokenList, Puma::PreTokenListPart, Puma::PreUnassertDirective, Puma::PreUndefDirective, and Puma::PreWarningDirective.
Public Member Functions | |
virtual | ~PreTreeComposite () |
Destructor. | |
virtual void | accept (PreVisitor &)=0 |
Part of the tree visitor pattern. | |
virtual void | add_son (PreTree *s) |
Add a son (syntactic child node). | |
virtual void | replace_son (int n, PreTree *new_s) |
Replace the n-th son. | |
virtual PreTree * | son (int n) const |
Get the n-th son. | |
virtual int | sons () const |
Get the number of sons. | |
virtual void | add_daughter (PreTree *d) |
Add a daughter (semantic child node). | |
virtual void | replace_daughter (int n, PreTree *new_d) |
Replace the n-th daughter. | |
virtual PreTree * | daughter (int n) const |
Get the n-th daughter. | |
virtual int | daughters () const |
Get the number of daughters. | |
virtual Token * | startToken () const |
Get the first token of the syntactic construct represented by the sub-tree. | |
virtual Token * | endToken () const |
Get the last token of the syntactic construct represented by the sub-tree. | |
Static Public Attributes | |
static const int | DYNAMIC = -1 |
Dynamic number of sons and daughters. | |
Protected Member Functions | |
PreTreeComposite (int s, int d) | |
Constructor. |
Base class for all C preprocessor syntax tree composite nodes.
Puma::PreTreeComposite::PreTreeComposite | ( | int | s, | |
int | d | |||
) | [protected] |
Constructor.
s | Number of sons (syntactic child nodes). | |
d | Number of daughters (semantic child nodes). |
virtual Puma::PreTreeComposite::~PreTreeComposite | ( | ) | [virtual] |
Destructor.
virtual void Puma::PreTreeComposite::accept | ( | PreVisitor & | ) | [pure virtual] |
Part of the tree visitor pattern.
Calls the node visiting function suitable for the actual node type.
Implements Puma::PreTree.
Implemented in Puma::PreProgram, Puma::PreDirectiveGroups, Puma::PreConditionalGroup, Puma::PreElsePart, Puma::PreElifPart, Puma::PreIfDirective, Puma::PreIfdefDirective, Puma::PreIfndefDirective, Puma::PreElifDirective, Puma::PreElseDirective, Puma::PreEndifDirective, Puma::PreIncludeDirective, Puma::PreAssertDirective, Puma::PreUnassertDirective, Puma::PreDefineFunctionDirective, Puma::PreDefineConstantDirective, Puma::PreUndefDirective, Puma::PreWarningDirective, Puma::PreErrorDirective, Puma::PreIdentifierList, Puma::PreTokenList, and Puma::PreTokenListPart.
virtual void Puma::PreTreeComposite::add_daughter | ( | PreTree * | d | ) | [virtual] |
Add a daughter (semantic child node).
d | The daughter to add. |
virtual void Puma::PreTreeComposite::add_son | ( | PreTree * | s | ) | [virtual] |
Add a son (syntactic child node).
s | The son to add. |
virtual PreTree* Puma::PreTreeComposite::daughter | ( | int | n | ) | const [virtual] |
virtual int Puma::PreTreeComposite::daughters | ( | ) | const [virtual] |
Get the number of daughters.
Reimplemented from Puma::PreTree.
virtual Token* Puma::PreTreeComposite::endToken | ( | ) | const [virtual] |
Get the last token of the syntactic construct represented by the sub-tree.
Reimplemented from Puma::PreTree.
virtual void Puma::PreTreeComposite::replace_daughter | ( | int | n, | |
PreTree * | new_d | |||
) | [virtual] |
Replace the n-th daughter.
n | The index of the daughter. | |
new_d | The new daughter. |
virtual void Puma::PreTreeComposite::replace_son | ( | int | n, | |
PreTree * | new_s | |||
) | [virtual] |
Replace the n-th son.
n | The index of the son to replace. | |
new_s | The new son. |
virtual PreTree* Puma::PreTreeComposite::son | ( | int | n | ) | const [virtual] |
virtual int Puma::PreTreeComposite::sons | ( | ) | const [virtual] |
Get the number of sons.
Reimplemented from Puma::PreTree.
virtual Token* Puma::PreTreeComposite::startToken | ( | ) | const [virtual] |
Get the first token of the syntactic construct represented by the sub-tree.
Reimplemented from Puma::PreTree.
const int Puma::PreTreeComposite::DYNAMIC = -1 [static] |
Dynamic number of sons and daughters.