![]() |
Rosetta Utilities
2014.16.56682
|
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... | |
| ReferenceCount & | operator= (ReferenceCount const &) |
| Copy assignment. More... | |
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 indentation_level_, ostrstream_, and pretty_.
Referenced by visit().
|
virtual |
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_.
|
virtual |
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_.
|
virtual |
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_.
|
virtual |
|
virtual |
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().
|
virtual |
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().
|
virtual |
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().
|
virtual |
|
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