Puma Reference Manual Puma::CPrintVisitor Class Reference



Puma::CPrintVisitor Class Reference

Tree visitor for printing the C/C++ syntax tree. More...

#include <Puma/CPrintVisitor.h>

Inheritance diagram for Puma::CPrintVisitor:
Inheritance graph

Public Member Functions

 CPrintVisitor ()
 Constructor.
 ~CPrintVisitor ()
 Destructor.
void configure (Config &config)
 Configure the visitor.
void print (CTree *tree, ostream &os)
 Start printing the given tree on the given output stream.
void setPrintLoc (bool enable, int len=20)
 Set printing the token location.

Additional Inherited Members

- Private Member Functions inherited from Puma::CVisitor
 CVisitor ()
 Constructor.
virtual ~CVisitor ()
 Destructor.
void abort (bool v=true)
 Set the aborted state.
void prune (bool v=true)
 Set the pruned state (don't visit the sub-tree).
bool aborted () const
 Check if the node visiting is aborted.
bool pruned () const
 Check if the visiting the sub-tree is aborted.
void visit (CTree *node)
 Visit the given syntax tree node.
virtual void pre_visit (CTree *node)
 Apply actions before the given node is visited.
virtual void post_visit (CTree *node)
 Apply actions after the given node is visited.

Detailed Description

Tree visitor for printing the C/C++ syntax tree.

Prints the indented tree structure supplemented with type information, calculated constant values, implicit casts, and resolved function calls.

Constructor & Destructor Documentation

Puma::CPrintVisitor::CPrintVisitor ( )

Constructor.

Puma::CPrintVisitor::~CPrintVisitor ( )

Destructor.

Member Function Documentation

void Puma::CPrintVisitor::configure ( Config config)

Configure the visitor.

Parameters
configThe configuration options.
void Puma::CPrintVisitor::print ( CTree tree,
ostream &  os 
)

Start printing the given tree on the given output stream.

Parameters
treeThe syntax tree to print.
osThe output stream.
void Puma::CPrintVisitor::setPrintLoc ( bool  enable,
int  len = 20 
)

Set printing the token location.

Parameters
enableEnable/disable printing the location.
lenThe length of the location prefix.



Puma Reference Manual. Created on Thu Mar 13 2014.