Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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>

Inheritance diagram for numeric::expression_parser::ASTPrinter:
Inheritance graph
[legend]

Public Member Functions

 ASTPrinter ()
 
void visit (ArithmeticASTExpression const &) override
 
void visit (ArithmeticASTAndClause const &) override
 
void visit (ArithmeticASTOrClause const &) override
 
void visit (ArithmeticASTFunction const &) override
 
void visit (ArithmeticASTTerm const &) override
 
void visit (ArithmeticASTFactor const &) override
 
void visit (ArithmeticASTValue const &) override
 
void visit (ArithmeticASTRestTerm const &) override
 
void visit (ArithmeticASTRestAndClause const &) override
 
void visit (ArithmeticASTRestOrClause const &) override
 
void visit (ArithmeticASTRestExpression const &) override
 
void visit (ArithmeticASTNode const &) override
 
std::string ast_string (ArithmeticASTNode const &node)
 
void pretty (bool setting)
 
- Public Member Functions inherited from numeric::expression_parser::ASTVisitor
 ~ASTVisitor () override
 Automatically generated virtual destructor for class deriving directly from VirtualBase. More...
 
- Public Member Functions inherited from utility::VirtualBase
 VirtualBase ()=default
 Default constructor. More...
 
virtual ~VirtualBase ()=default
 The virtual destructor is one of the main reasons for the VirtualBase class. More...
 
 VirtualBase (VirtualBase const &)=default
 
 VirtualBase (VirtualBase &&)=default
 
VirtualBaseoperator= (VirtualBase const &)=default
 
VirtualBaseoperator= (VirtualBase &&)=default
 

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_
 

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
void numeric::expression_parser::ASTPrinter::pretty ( bool  setting)

References pretty_.

void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTExpression const &  node)
overridevirtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTAndClause const &  node)
overridevirtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTOrClause const &  node)
overridevirtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTFunction const &  node)
overridevirtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTTerm const &  node)
overridevirtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTFactor const &  node)
overridevirtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTValue const &  node)
overridevirtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTRestTerm const &  node)
overridevirtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTRestAndClause const &  node)
overridevirtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTRestOrClause const &  node)
overridevirtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTRestExpression const &  node)
overridevirtual
void numeric::expression_parser::ASTPrinter::visit ( ArithmeticASTNode const &  node)
overridevirtual

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: