Rosetta Utilities  2014.35
Public Member Functions | Private Member Functions | Private Attributes | List of all members
numeric::expression_parser::ASTPrinter Class Reference

Traverse the AST and print it to standard out. More...

#include <Arithmetic.hh>

Public Member Functions

 ASTPrinter ()
 
virtual void visit (ArithmeticASTExpression const &)
 
virtual void visit (ArithmeticASTFunction const &)
 
virtual void visit (ArithmeticASTTerm const &)
 
virtual void visit (ArithmeticASTFactor const &)
 
virtual void visit (ArithmeticASTValue const &)
 
virtual void visit (ArithmeticASTRestTerm const &)
 
virtual void visit (ArithmeticASTRestExpression const &)
 
virtual void visit (ArithmeticASTNode const &)
 
std::string ast_string (ArithmeticASTNode const &node)
 
void pretty (bool setting)
 
- Public Member Functions inherited from numeric::expression_parser::ASTVisitor
virtual ~ASTVisitor ()
 Automatically generated virtual destructor for class deriving directly from ReferenceCount. More...
 
- Public Member Functions inherited from utility::pointer::ReferenceCount
void ctor ()
 
virtual ~ReferenceCount ()
 Destructor. More...
 
Size ref_count () const
 Reference count. More...
 

Private Member Functions

void increment_indentation ()
 
void decrement_indentation ()
 
void indent_line ()
 
void finish_indented_line ()
 

Private Attributes

bool pretty_
 
Size indentation_level_
 
std::ostringstream ostrstream_
 
bool last_dispatch_to_unknown_type_
 

Additional Inherited Members

- Public Types inherited from utility::pointer::ReferenceCount
typedef platform::Size Size
 
typedef platform::Size size_type
 
- Protected Member Functions inherited from utility::pointer::ReferenceCount
 ReferenceCount ()
 Default constructor. More...
 
 ReferenceCount (ReferenceCount const &)
 Copy constructor. More...
 
ReferenceCountoperator= (ReferenceCount const &)
 Copy assignment. More...
 

Detailed Description

Traverse the AST and print it to standard out.

Constructor & Destructor Documentation

numeric::expression_parser::ASTPrinter::ASTPrinter ( )

BEGIN VISITORS ///// Traverse the AST and print it to standard out

Member Function Documentation

std::string numeric::expression_parser::ASTPrinter::ast_string ( ArithmeticASTNode const &  node)
void numeric::expression_parser::ASTPrinter::decrement_indentation ( )
private

References indentation_level_.

Referenced by visit().

void numeric::expression_parser::ASTPrinter::finish_indented_line ( )
private

References ostrstream_, and pretty_.

Referenced by visit().

void numeric::expression_parser::ASTPrinter::increment_indentation ( )
private

References indentation_level_.

Referenced by visit().

void numeric::expression_parser::ASTPrinter::indent_line ( )
private

References indentation_level_, ostrstream_, and pretty_.

Referenced by visit().

void numeric::expression_parser::ASTPrinter::pretty ( bool  setting)

References pretty_.

void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTExpression const &  node)
virtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTFunction const &  node)
virtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTTerm const &  node)
virtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTFactor const &  node)
virtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTValue const &  node)
virtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTRestTerm const &  node)
virtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTRestExpression const &  node)
virtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTNode const &  node)
virtual

Member Data Documentation

Size numeric::expression_parser::ASTPrinter::indentation_level_
private
bool numeric::expression_parser::ASTPrinter::last_dispatch_to_unknown_type_
mutableprivate

Referenced by visit().

std::ostringstream numeric::expression_parser::ASTPrinter::ostrstream_
private
bool numeric::expression_parser::ASTPrinter::pretty_
private

The documentation for this class was generated from the following files: