#include <ExpressionTreeWalker.hpp>
Inherits ExpressionParserTokenTypes.

Public Member Functions | |
| void | setUtilities (class UAPUtilities *_utilities) |
Sets the UAPUtilities object to use to resolve parameters. | |
| void | setContext (class UAPNode *_context=NULL) |
Sets the UAPNode object to use to resolve attributes of an element. | |
| void | setMathConstants (const std::map< std::string, double > &_mathConstants) |
| Sets the map of mathematical constants to use during evaluation. | |
| double | evaluate (ANTLR_USE_NAMESPACE(antlr) RefAST _t) |
| Evaluates an expression to a double-precision constant. | |
| double | evaluate_function (ANTLR_USE_NAMESPACE(antlr) RefAST _t) |
| Evaluates a function call to a double-precision constant. | |
| std::string | subs_params (ANTLR_USE_NAMESPACE(antlr) RefAST _t) |
| Substitutes the corresponding values for any named parameters and/or AML paths in the expression. | |
| void | twConst (ANTLR_USE_NAMESPACE(antlr) RefAST _t) |
| Substitutes the corresponding value for any named parameter. | |
| std::string | amlPath (ANTLR_USE_NAMESPACE(antlr) RefAST _t) |
| Evaluates an AML path to an arithmetic expression that can be further evaluated. | |
(You can use this standalone, but you should really only use this class with the Universal Accelerator Parser library). Reads a TokenStream and invokes the appropriate methods in this class.
Once you instantiate the tree walker, you must call the methods setContext (with or without an argument), and setUtilities with an instance of UAPUtilities.
The evaluate method evaluates an expression.
Definition at line 49 of file ExpressionTreeWalker.hpp.
| std::string ExpressionTreeWalker::amlPath | ( | ANTLR_USE_NAMESPACE(antlr) RefAST | _t | ) |
Evaluates an AML path to an arithmetic expression that can be further evaluated.
Definition at line 792 of file ExpressionTreeWalker.cpp.
| double ExpressionTreeWalker::evaluate | ( | ANTLR_USE_NAMESPACE(antlr) RefAST | _t | ) |
Evaluates an expression to a double-precision constant.
Definition at line 23 of file ExpressionTreeWalker.cpp.
| double ExpressionTreeWalker::evaluate_function | ( | ANTLR_USE_NAMESPACE(antlr) RefAST | _t | ) |
Evaluates a function call to a double-precision constant.
Definition at line 220 of file ExpressionTreeWalker.cpp.
| void ExpressionTreeWalker::setContext | ( | class UAPNode * | _context = NULL |
) | [inline] |
Sets the UAPNode object to use to resolve attributes of an element.
| _context | the UAPNode object |
Definition at line 77 of file ExpressionTreeWalker.hpp.
| void ExpressionTreeWalker::setMathConstants | ( | const std::map< std::string, double > & | _mathConstants | ) | [inline] |
Sets the map of mathematical constants to use during evaluation.
| _mathConstants | the map of <string, double> pairs of mathematical constants. |
Definition at line 84 of file ExpressionTreeWalker.hpp.
| void ExpressionTreeWalker::setUtilities | ( | class UAPUtilities * | _utilities | ) | [inline] |
Sets the UAPUtilities object to use to resolve parameters.
| _utilities | the UAPUtilities object |
Definition at line 69 of file ExpressionTreeWalker.hpp.
| std::string ExpressionTreeWalker::subs_params | ( | ANTLR_USE_NAMESPACE(antlr) RefAST | _t | ) |
Substitutes the corresponding values for any named parameters and/or AML paths in the expression.
Definition at line 501 of file ExpressionTreeWalker.cpp.
| void ExpressionTreeWalker::twConst | ( | ANTLR_USE_NAMESPACE(antlr) RefAST | _t | ) |
Substitutes the corresponding value for any named parameter.
Definition at line 731 of file ExpressionTreeWalker.cpp.
1.5.7