PUMA Library Reference Manual
Puma::CPrintVisitor Class Reference

#include <Puma/CPrintVisitor.h>

+ Inheritance diagram for Puma::CPrintVisitor:

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.

Public Member Functions

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

Constructor & Destructor Documentation

◆ CPrintVisitor()

Puma::CPrintVisitor::CPrintVisitor ( )

Constructor.

◆ ~CPrintVisitor()

Puma::CPrintVisitor::~CPrintVisitor ( )

Destructor.

Member Function Documentation

◆ configure()

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

Configure the visitor.

Parameters
configThe configuration options.

◆ print()

void Puma::CPrintVisitor::print ( CTree tree,
std::ostream &  os 
)

Start printing the given tree on the given output stream.

Parameters
treeThe syntax tree to print.
osThe output stream.

◆ setPrintLoc()

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.