B
Brian Gideon
All,
I'm looking for an expression evaluator to use in .NET and I was hoping
someone could point me to a free library. Google's not playing nice on
this one. I wrote my own, but if there is another out there that
performs better or has more features I'd probably use it instead. Here
are my requirements.
1) It must be free with source code available
2) It must be secure. In other words, none of this dynamic compilation
or JScript eval stuff.
3) It must be extensible. I want to be able to register custom
functions and constants.
4) It must support conditional logic. For example, the input "1=0"
should evaluate to false and "IF(x != 0, y / x, 0)" would evaluate to
y/x when x is nonzero or 0 otherwise.
5) It must use standard operator precedence and associativity rules.
You might be surprised how many of them don't.
6) I don't care if it uses shift-reduce parsing, infix-to-postfix,
compiler-compiler, etc. as long it works and is fast.
7) It must indicate the position in the input string where a syntax or
parse error occurs. For example, the input "(1+2) 3+4" should report a
missing operator at position 5 and "(1+2) 3+4)" should report an
unbalanced parenthesis in the last position.
Any leads would be great!
Brian
I'm looking for an expression evaluator to use in .NET and I was hoping
someone could point me to a free library. Google's not playing nice on
this one. I wrote my own, but if there is another out there that
performs better or has more features I'd probably use it instead. Here
are my requirements.
1) It must be free with source code available
2) It must be secure. In other words, none of this dynamic compilation
or JScript eval stuff.
3) It must be extensible. I want to be able to register custom
functions and constants.
4) It must support conditional logic. For example, the input "1=0"
should evaluate to false and "IF(x != 0, y / x, 0)" would evaluate to
y/x when x is nonzero or 0 otherwise.
5) It must use standard operator precedence and associativity rules.
You might be surprised how many of them don't.
6) I don't care if it uses shift-reduce parsing, infix-to-postfix,
compiler-compiler, etc. as long it works and is fast.
7) It must indicate the position in the input string where a syntax or
parse error occurs. For example, the input "(1+2) 3+4" should report a
missing operator at position 5 and "(1+2) 3+4)" should report an
unbalanced parenthesis in the last position.
Any leads would be great!
Brian