OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
|
#include <evaluator.hpp>
Public Types | |
typedef bool | result_type |
Public Member Functions | |
template<typename ErrorHandler > | |
StackEvaluator (ErrorHandler &error_handler_) | |
double | result () |
void | registerFunction (std::string name, client::function::type callback) |
void | registerFunctions (std::map< std::string, client::function::type > functions) |
void | registerVariables (std::map< std::string, double > variableDictionary) |
bool | operator() (ast::nil) |
bool | operator() (unsigned int x) |
bool | operator() (double x) |
bool | operator() (bool x) |
bool | operator() (ast::quoted_string const &x) |
bool | operator() (ast::identifier const &x) |
bool | operator() (ast::operation const &x) |
bool | operator() (ast::unary const &x) |
bool | operator() (ast::function_call const &x) |
bool | operator() (ast::expression const &x) |
Private Attributes | |
boost::function< void(int tag, std::string const &what)> | error_handler |
std::map< std::string, double > | variableDictionary_ |
std::map< std::string, client::function::type > | functions_ |
client::function::arguments_t | evaluation_stack_ |
Definition at line 27 of file evaluator.hpp.
typedef bool client::code_gen::StackEvaluator::result_type |
Definition at line 29 of file evaluator.hpp.
|
inline |
Definition at line 32 of file evaluator.hpp.
References PyOpal::PyPolynomialPatch::function().
bool client::code_gen::StackEvaluator::operator() | ( | ast::expression const & | x | ) |
Definition at line 131 of file evaluator.cpp.
References client::ast::expression::first, and client::ast::expression::rest.
bool client::code_gen::StackEvaluator::operator() | ( | ast::function_call const & | x | ) |
Definition at line 101 of file evaluator.cpp.
References arg(), client::ast::function_call::args, endl(), evaluation_stack_, client::ast::function_call::function_name, functions_, and client::ast::identifier::name.
bool client::code_gen::StackEvaluator::operator() | ( | ast::identifier const & | x | ) |
Definition at line 35 of file evaluator.cpp.
References endl(), evaluation_stack_, client::ast::identifier::name, and variableDictionary_.
|
inline |
Definition at line 67 of file evaluator.hpp.
bool client::code_gen::StackEvaluator::operator() | ( | ast::operation const & | x | ) |
Definition at line 48 of file evaluator.cpp.
References evaluation_stack_, client::ast::op_and, client::ast::op_divide, client::ast::op_equal, client::ast::op_greater, client::ast::op_greater_equal, client::ast::op_less, client::ast::op_less_equal, client::ast::op_minus, client::ast::op_not_equal, client::ast::op_or, client::ast::op_plus, client::ast::op_times, client::ast::operation::operand_, and client::ast::operation::operator_.
bool client::code_gen::StackEvaluator::operator() | ( | ast::quoted_string const & | x | ) |
Definition at line 29 of file evaluator.cpp.
References evaluation_stack_, and client::ast::quoted_string::value.
bool client::code_gen::StackEvaluator::operator() | ( | ast::unary const & | x | ) |
Definition at line 81 of file evaluator.cpp.
References evaluation_stack_, client::ast::op_negative, client::ast::op_not, client::ast::op_positive, client::ast::unary::operand_, and client::ast::unary::operator_.
bool client::code_gen::StackEvaluator::operator() | ( | bool | x | ) |
Definition at line 23 of file evaluator.cpp.
References evaluation_stack_.
bool client::code_gen::StackEvaluator::operator() | ( | double | x | ) |
Definition at line 17 of file evaluator.cpp.
References evaluation_stack_.
bool client::code_gen::StackEvaluator::operator() | ( | unsigned int | x | ) |
Definition at line 11 of file evaluator.cpp.
References evaluation_stack_.
|
inline |
Definition at line 51 of file evaluator.hpp.
References functions_, and name.
|
inline |
Definition at line 56 of file evaluator.hpp.
References functions_.
Referenced by Expression::evaluate().
|
inline |
Definition at line 61 of file evaluator.hpp.
References variableDictionary_.
Referenced by Expression::evaluate().
|
inline |
Definition at line 43 of file evaluator.hpp.
References evaluation_stack_, and result().
Referenced by Expression::evaluate(), and result().
|
private |
Definition at line 80 of file evaluator.hpp.
|
private |
Definition at line 86 of file evaluator.hpp.
Referenced by operator()(), and result().
|
private |
Definition at line 83 of file evaluator.hpp.
Referenced by operator()(), registerFunction(), and registerFunctions().
|
private |
Definition at line 82 of file evaluator.hpp.
Referenced by operator()(), and registerVariables().