![]() |
Rosetta
2019.07
|
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 () override | |
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 |
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... | |
![]() | |
~ASTVisitor () override | |
Automatically generated virtual destructor for class deriving directly from ReferenceCount. More... | |
![]() | |
ReferenceCount () | |
Default constructor. More... | |
virtual | ~ReferenceCount () |
Private Attributes | |
ExpressionCOP | last_constructed_expression_ |
ExpressionCOP | semi_constructed_expression_ |
Additional Inherited Members | |
![]() | |
typedef platform::Size | Size |
typedef platform::Size | size_type |
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.
|
default |
|
overridedefault |
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().
|
overridevirtual |
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().
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTAndClause::children_begin(), numeric::expression_parser::ArithmeticASTAndClause::children_end(), last_constructed_expression_, semi_constructed_expression_, utility::to_string(), and utility_exit_with_message.
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTOrClause::children_begin(), numeric::expression_parser::ArithmeticASTOrClause::children_end(), last_constructed_expression_, semi_constructed_expression_, utility::to_string(), and utility_exit_with_message.
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References DRRAFTER::args, 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.
|
overridevirtual |
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.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
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.
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTRestAndClause::children_begin(), numeric::expression_parser::ArithmeticASTRestAndClause::children_end(), last_constructed_expression_, numeric::expression_parser::PLUS_SYMBOL, numeric::expression_parser::ArithmeticASTRestAndClause::rest_and_clause_token(), semi_constructed_expression_, numeric::expression_parser::SUBTRACT_SYMBOL, utility::to_string(), numeric::expression_parser::token_type_name(), and utility_exit_with_message.
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::AND_SYMBOL, numeric::expression_parser::ArithmeticASTRestOrClause::children_begin(), numeric::expression_parser::ArithmeticASTRestOrClause::children_end(), last_constructed_expression_, numeric::expression_parser::ArithmeticASTRestOrClause::rest_or_clause_token(), semi_constructed_expression_, utility::to_string(), numeric::expression_parser::token_type_name(), and utility_exit_with_message.
|
overridevirtual |
Implements numeric::expression_parser::ASTVisitor.
References numeric::expression_parser::ArithmeticASTRestExpression::children_begin(), numeric::expression_parser::ArithmeticASTRestExpression::children_end(), last_constructed_expression_, numeric::expression_parser::OR_SYMBOL, numeric::expression_parser::ArithmeticASTRestExpression::rest_expression_token(), semi_constructed_expression_, utility::to_string(), numeric::expression_parser::token_type_name(), and utility_exit_with_message.
|
overridevirtual |
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().