Eval: Added method for providing a precompiled expression

This commit is contained in:
Paul Beckingham
2015-06-22 00:20:03 -04:00
parent ad18d13c29
commit 9db73962da
2 changed files with 20 additions and 0 deletions

View File

@@ -196,6 +196,25 @@ void Eval::compileExpression (const std::string& e)
context.debug ("FILTER Postfix " + dump (_compiled));
}
////////////////////////////////////////////////////////////////////////////////
void Eval::compileExpression (
const std::vector <std::pair <std::string, Lexer::Type>>& precompiled)
{
_compiled = precompiled;
// Parse for syntax checking and operator replacement.
if (_debug)
context.debug ("FILTER Infix " + dump (_compiled));
infixParse (_compiled);
if (_debug)
context.debug ("FILTER Infix parsed " + dump (_compiled));
// Convert infix --> postfix.
infixToPostfix (_compiled);
if (_debug)
context.debug ("FILTER Postfix " + dump (_compiled));
}
////////////////////////////////////////////////////////////////////////////////
void Eval::evaluateCompiledExpression (Variant& v)
{