Closed sunzhiran closed 6 years ago
EvalEx does support Reverse Polish Notation, I'm not completely sure but that might actually be a valid expression. For example, 1 + (1 2)/
is also a valid expression.
But I have too little experience with RPN and the parser of EvalEx to be completely sure about that.
I added a syntax check for this to the shunting yard method. (See commit 4aaa75f20864f91b70ea59d010c1f5a6b05b0363) EvalEx works with RPN internally when an expression is evaluated. For this, it uses a shunting yard algorithm to transform a normal expression to RPN notation. But the above expression is not even a RPN.
expression = new Expression("1 1+2/"); the result is 1.5;but this expression is not legal