#include <TreeEval.hpp>
Collaboration diagram for Ionflux::Tools::TreeEval:

Public Member Functions | |
| TreeEval () | |
| Constructor. | |
| virtual | ~TreeEval () |
| Destructor. | |
Static Public Member Functions | |
| static bool | parseTreeExpr (const std::string &treeExpr, std::vector< TreeExprElement > &elements) |
| Parse tree expression. | |
| static bool | eval (Tree *tree, std::vector< TreeExprElement > &elements, Node &result, bool createPath) |
| Evaluate tree expression. | |
Static Public Attributes | |
| static const TokenType | TT_OPERATOR |
| Token type: Operators. | |
| static const TokenType | TT_TREEPATH_NP |
| Token type: Tree path (excluding parentheses). | |
| static const TokenType | TT_PAR_LEFT |
| Token type: Parenthesis (left). | |
| static const TokenType | TT_PAR_RIGHT |
| Token type: Parenthesis (right). | |
Static Protected Member Functions | |
| static bool | calculate (DataEntry &op1, DataEntry &result, const std::string &op) |
| Perform calculation. | |
| static bool | calculate (DataEntry &op1, DataEntry &op2, DataEntry &result, const std::string &op) |
| Perform calculation. | |
| static bool | unwindOpStack (std::stack< TreeExprElement > &ops, std::stack< TreeExprElement > &values, Tree &temps, bool unwindPar=false) |
| Unwind operator stack. | |
Evaluates expressions in which tree paths are used as variables.
|
|
Constructor. Construct new TreeEval object. |
|
|
Destructor. Destruct TreeEval object. |
|
||||||||||||||||||||
|
Perform calculation. Performs a calculation using the specified binary operator.
|
|
||||||||||||||||
|
Perform calculation. Performs a calculation using the specified unary operator.
|
|
||||||||||||||||||||
|
Evaluate tree expression.
Evaluates a tree expression for a specified tree and a set of tree expression elements. Pass
|
|
||||||||||||
|
Parse tree expression. Parse a tree expression into tree expression elements.
|
|
||||||||||||||||||||
|
Unwind operator stack. Unwinds an operator stack by processing the topmost element, or all operators until either the stack is empty or a left parenthesis is found. The result of the operation is put on top of the value stack.
|
|
|
Initial value: {
TokenType::USERTYPE_ID + 201, "+-*/=<>&|!~%^", false, 0}
|
|
|
Initial value: {
TokenType::USERTYPE_ID + 203, "(", false, 1}
|
|
|
Initial value: {
TokenType::USERTYPE_ID + 204, ")", false, 1}
|
|
|
Initial value: {
TokenType::USERTYPE_ID + 202, ".[]", false, 0}
|
1.4.6