///////////////////////////////////////////////////////////////////////////
| 143 | |
| 144 | //////////////////////////////////////////////////////////////////////////////// |
| 145 | void Eval::evaluatePostfixExpression(const std::string& e, Variant& v) const { |
| 146 | // Reduce e to a vector of tokens. |
| 147 | Lexer l(e); |
| 148 | std::vector<std::pair<std::string, Lexer::Type>> tokens; |
| 149 | std::string token; |
| 150 | Lexer::Type type; |
| 151 | while (l.token(token, type)) tokens.emplace_back(token, type); |
| 152 | |
| 153 | if (_debug) Context::getContext().debug("[1;37;42mFILTER[0m Postfix " + dump(tokens)); |
| 154 | |
| 155 | // Call the postfix evaluator. |
| 156 | evaluatePostfixStack(tokens, v); |
| 157 | } |
| 158 | |
| 159 | //////////////////////////////////////////////////////////////////////////////// |
| 160 | void Eval::compileExpression(const std::vector<std::pair<std::string, Lexer::Type>>& precompiled) { |