This project has moved. For the latest updates, please go here.

Unary minus constant

May 13, 2015 at 8:27 AM
While using of unary minus operation for constant like "-101 > 50", evaluator throws exception like:
101][-][50][>
Formula Evaluator Exception: System.InvalidOperationException: Stack empty.
at System.ThrowHelper.ThrowInvalidOperationException (ExceptionResource resource) [0x0000b] in <filename unknown>:0
at System.Collections.Generic.Stack`1[System.Linq.Expressions.Expression].Pop () [0x0000b] in <filename unknown>:0
at ExpressionEvaluator.Operators.OpFuncServiceProviders.BinaryOperatorFunc (ExpressionEvaluator.Operators.OpFuncArgs args) [0x00003] in <>
at ExpressionEvaluator.Parser.BuildTree (System.Linq.Expressions.Expression scopeParam, Boolean isCall) [0x001f8] in <>
at ExpressionEvaluator.ExpressionCompiler.BuildTree (System.Linq.Expressions.Expression scopeParam, Boolean isCall) [0x00001] in <>
at ExpressionEvaluator.CompiledExpression.ScopeCompile () [0x00026] in <>
at Nielsen.HHTMobile.FormulaEvaluator.GetExpressionResult (System.String formula) [0x00029] in <>
Formula Evaluator: expression result =
--Rule(12) with order (12) - validation error

How can one evaluate expression with unary negative constant?
Developer
May 14, 2015 at 5:23 AM
Edited May 14, 2015 at 5:29 AM
Hi,

It seems like you still are on the main branch, or using the pre-2.x version.

Please switch to the ANTLRParser branch or download a version 2.x DLL
May 14, 2015 at 7:12 AM
Thank you, Rupert!

I believe you mean ExpressionEvaluator 2.0.2.0, because download section does not lists branches.

Best Regards