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

#include <Puma/PreTreeNodes.h>

+ Inheritance diagram for Puma::PreInclSemNode:

Description

Preprocessor semantic tree node for the #include directive containing the unit to include.

Public Member Functions

 PreInclSemNode (Unit *unit, bool guarded)
 Constructor.
 
void accept (PreVisitor &v)
 Part of the tree visitor pattern.
 
Unit * unit () const
 Get the token unit of the included file.
 
bool guarded () const
 Check if the inclusion was not done due to an include guard.
 
- 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 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.
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ PreInclSemNode()

Puma::PreInclSemNode::PreInclSemNode ( Unit *  unit,
bool  guarded 
)
inline

Constructor.

Parameters
unitThe unit containing the tokens of the include file.
guardedTrue if the inclusion was not done due to an include guard.

Member Function Documentation

◆ accept()

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

Part of the tree visitor pattern.

Calls the node visiting functions suitable for this node type.

Parameters
vThe visitor object on which to call the visiting functions.

Implements Puma::PreTree.

◆ guarded()

bool Puma::PreInclSemNode::guarded ( ) const
inline

Check if the inclusion was not done due to an include guard.

◆ unit()

Unit * Puma::PreInclSemNode::unit ( ) const
inline

Get the token unit of the included file.