![]() |
Rosetta
2021.16
|
Traverse the AST and print it to standard out. More...
#include <Arithmetic.hh>

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 | |
| VirtualBase & | operator= (VirtualBase const &)=default |
| VirtualBase & | operator= (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_ |
Traverse the AST and print it to standard out.
| numeric::expression_parser::ASTPrinter::ASTPrinter | ( | ) |
BEGIN VISITORS ///// Traverse the AST and print it to standard out
| std::string numeric::expression_parser::ASTPrinter::ast_string | ( | ArithmeticASTNode const & | node | ) |
References ostrstream_, and numeric::expression_parser::ArithmeticASTNode::visit().
|
private |
References indentation_level_.
Referenced by visit().
|
private |
References ostrstream_, and pretty_.
Referenced by visit().
|
private |
References indentation_level_.
Referenced by visit().
|
private |
References test.T200_Scoring::ii, indentation_level_, ostrstream_, and pretty_.
Referenced by visit().
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTExpression::children_begin(), numeric::expression_parser::ArithmeticASTExpression::children_end(), decrement_indentation(), finish_indented_line(), increment_indentation(), indent_line(), last_dispatch_to_unknown_type_, and ostrstream_.
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTAndClause::children_begin(), numeric::expression_parser::ArithmeticASTAndClause::children_end(), decrement_indentation(), finish_indented_line(), increment_indentation(), indent_line(), last_dispatch_to_unknown_type_, and ostrstream_.
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTOrClause::children_begin(), numeric::expression_parser::ArithmeticASTOrClause::children_end(), decrement_indentation(), finish_indented_line(), increment_indentation(), indent_line(), last_dispatch_to_unknown_type_, and ostrstream_.
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTFunction::children_begin(), numeric::expression_parser::ArithmeticASTFunction::children_end(), decrement_indentation(), finish_indented_line(), numeric::expression_parser::ArithmeticASTFunction::function(), increment_indentation(), indent_line(), last_dispatch_to_unknown_type_, and ostrstream_.
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTTerm::children_begin(), numeric::expression_parser::ArithmeticASTTerm::children_end(), decrement_indentation(), finish_indented_line(), increment_indentation(), indent_line(), last_dispatch_to_unknown_type_, and ostrstream_.
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTFactor::child(), decrement_indentation(), finish_indented_line(), increment_indentation(), indent_line(), last_dispatch_to_unknown_type_, numeric::expression_parser::NOT_SYMBOL, numeric::expression_parser::ArithmeticASTFactor::not_token(), and ostrstream_.
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References indent_line(), numeric::expression_parser::ArithmeticASTValue::is_literal(), last_dispatch_to_unknown_type_, numeric::expression_parser::ArithmeticASTValue::literal_value(), ostrstream_, and numeric::expression_parser::ArithmeticASTValue::variable_name().
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTRestTerm::children_begin(), numeric::expression_parser::ArithmeticASTRestTerm::children_end(), decrement_indentation(), finish_indented_line(), increment_indentation(), indent_line(), last_dispatch_to_unknown_type_, ostrstream_, numeric::expression_parser::ArithmeticASTRestTerm::rest_term_token(), and numeric::expression_parser::token_type_name().
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTRestAndClause::children_begin(), numeric::expression_parser::ArithmeticASTRestAndClause::children_end(), decrement_indentation(), finish_indented_line(), increment_indentation(), indent_line(), last_dispatch_to_unknown_type_, ostrstream_, numeric::expression_parser::ArithmeticASTRestAndClause::rest_and_clause_token(), and numeric::expression_parser::token_type_name().
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTRestOrClause::children_begin(), numeric::expression_parser::ArithmeticASTRestOrClause::children_end(), decrement_indentation(), finish_indented_line(), increment_indentation(), indent_line(), last_dispatch_to_unknown_type_, ostrstream_, numeric::expression_parser::ArithmeticASTRestOrClause::rest_or_clause_token(), and numeric::expression_parser::token_type_name().
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTRestExpression::children_begin(), numeric::expression_parser::ArithmeticASTRestExpression::children_end(), decrement_indentation(), finish_indented_line(), increment_indentation(), indent_line(), last_dispatch_to_unknown_type_, ostrstream_, numeric::expression_parser::ArithmeticASTRestExpression::rest_expression_token(), and numeric::expression_parser::token_type_name().
|
overridevirtual |
|
private |
Referenced by decrement_indentation(), increment_indentation(), and indent_line().
|
mutableprivate |
Referenced by visit().
|
private |
Referenced by ast_string(), finish_indented_line(), indent_line(), and visit().
|
private |
Referenced by finish_indented_line(), indent_line(), and pretty().
1.8.7