PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::PreTreeToken Class Reference

#include <Puma/PreTreeToken.h>

+ Inheritance diagram for Puma::PreTreeToken:

Description

Preprocessor syntax tree leaf class representing a token.

Public Member Functions

 PreTreeToken (Token *token)
 Constructor.
 
void accept (PreVisitor &v)
 Part of the tree visitor pattern.
 
TokenstartToken () const
 Get the first token of the syntactic construct represented by the sub-tree.
 
TokenendToken () const
 Get the last token of the syntactic construct represented by the sub-tree.
 
Tokentoken () const
 Get the token represented by this node.
 
- Public Member Functions inherited from Puma::PreTree
virtual ~PreTree ()
 Destructor.
 
virtual bool isLeaf () const
 Check if the node is a leaf, i.e.
 
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 PreTreeson (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 PreTreedaughter (int n) const
 Get the n-th daughter.
 
virtual int daughters () const
 Get the number of daughters.
 

Additional Inherited Members

- Protected Member Functions inherited from Puma::PreTree
 PreTree ()
 Constructor.
 

Constructor & Destructor Documentation

◆ PreTreeToken()

Puma::PreTreeToken::PreTreeToken ( Token * token)
inline

Constructor.

Parameters
tokenThe preprocessor token.

Member Function Documentation

◆ accept()

void Puma::PreTreeToken::accept ( PreVisitor & v)
inlinevirtual

Part of the tree visitor pattern.

Calls the node visiting function for PreTreeToken nodes.

Implements Puma::PreTree.

◆ endToken()

Token * Puma::PreTreeToken::endToken ( ) const
inlinevirtual

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

Reimplemented from Puma::PreTree.

◆ startToken()

Token * Puma::PreTreeToken::startToken ( ) const
inlinevirtual

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

Reimplemented from Puma::PreTree.

◆ token()

Token * Puma::PreTreeToken::token ( ) const
inline

Get the token represented by this node.