![]() |
Rosetta Utilities
2014.16.56682
|
Class to traverse the abstract syntax tree produced by the parsing of a properly-formed string in the Arithmetic expression language. Produces an Expression tree capable of performing arithmetic. Connects the "variable" nodes in this tree to the owning WrapperOptEMultifunc so that their values can be retrieved during expression evaluation inside the WrapperOptEMultifunc functor. More...
#include <Arithmetic.hh>
Public Member Functions | |
| ExpressionCreator () | |
| ~ExpressionCreator () | |
| 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 &) |
| ExpressionCOP | create_expression_tree (ArithmeticASTExpression const &) |
| virtual ExpressionCOP | handle_variable_expression (ArithmeticASTValue const &) |
| Factory method to be implemented by derived classes which may wish to handle variable expressions in a specific manner. More... | |
| virtual ExpressionCOP | handle_function_expression (FunctionTokenCOP function, utility::vector1< ExpressionCOP > const &args) |
| Factory method to be implemented by derived classes which may wish to handle function expressions in a specific manner. More... | |
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 Attributes | |
| ExpressionCOP | last_constructed_expression_ |
| ExpressionCOP | semi_constructed_expression_ |
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... | |
Class to traverse the abstract syntax tree produced by the parsing of a properly-formed string in the Arithmetic expression language. Produces an Expression tree capable of performing arithmetic. Connects the "variable" nodes in this tree to the owning WrapperOptEMultifunc so that their values can be retrieved during expression evaluation inside the WrapperOptEMultifunc functor.
| numeric::expression_parser::ExpressionCreator::ExpressionCreator | ( | ) |
| numeric::expression_parser::ExpressionCreator::~ExpressionCreator | ( | ) |
| ExpressionCOP numeric::expression_parser::ExpressionCreator::create_expression_tree | ( | ArithmeticASTExpression const & | expr | ) |
|
virtual |
Factory method to be implemented by derived classes which may wish to handle function expressions in a specific manner.
Reimplemented in numeric::expression_parser::BooleanExpressionCreator.
References utility::to_string(), and utility_exit_with_message.
Referenced by numeric::expression_parser::BooleanExpressionCreator::handle_function_expression(), and visit().
|
virtual |
Factory method to be implemented by derived classes which may wish to handle variable expressions in a specific manner.
Factory method to be implemented by derived classes which may wish to handle variable expressions differently.
Reimplemented in numeric::expression_parser::SimpleExpressionCreator.
References utility_exit_with_message.
Referenced by visit().
|
virtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTExpression::children_begin(), numeric::expression_parser::ArithmeticASTExpression::children_end(), last_constructed_expression_, semi_constructed_expression_, utility::to_string(), and utility_exit_with_message.
Referenced by create_expression_tree().
|
virtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTFunction::children_begin(), numeric::expression_parser::ArithmeticASTFunction::children_end(), numeric::expression_parser::ArithmeticASTFunction::function(), handle_function_expression(), last_constructed_expression_, utility::to_string(), and utility_exit_with_message.
|
virtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTTerm::children_begin(), numeric::expression_parser::ArithmeticASTTerm::children_end(), last_constructed_expression_, semi_constructed_expression_, utility::to_string(), and utility_exit_with_message.
|
virtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTFactor::child().
|
virtual |
|
virtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTRestTerm::children_begin(), numeric::expression_parser::ArithmeticASTRestTerm::children_end(), numeric::expression_parser::DIVIDE_SYMBOL, last_constructed_expression_, numeric::expression_parser::MULTIPLY_SYMBOL, numeric::expression_parser::ArithmeticASTRestTerm::rest_term_token(), semi_constructed_expression_, utility::to_string(), numeric::expression_parser::token_type_name(), and utility_exit_with_message.
|
virtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTRestExpression::children_begin(), numeric::expression_parser::ArithmeticASTRestExpression::children_end(), last_constructed_expression_, numeric::expression_parser::PLUS_SYMBOL, numeric::expression_parser::ArithmeticASTRestExpression::rest_expression_token(), semi_constructed_expression_, numeric::expression_parser::SUBTRACT_SYMBOL, utility::to_string(), numeric::expression_parser::token_type_name(), and utility_exit_with_message.
|
virtual |
Implements numeric::expression_parser::ASTVisitor.
References utility_exit_with_message.
|
private |
Created inside a traversal of the AST – return expression trees using this variable, and keep living trees alive by storing them on the stack during the AST recursive traversal.
Referenced by create_expression_tree(), and visit().
|
private |
Referenced by create_expression_tree(), and visit().
1.8.7