本文介绍了寻找表达式评估器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找简单条件表达式的求值器。 表达式应包括变量(只读),字符串,数字和一些基本运算符。
I'm looking for an evaluator for simple condition expressions. Expressions should include variables (read only), strings, numbers and some basic operators.
例如。表达式如下:
${a} == "Peter" && ( ${b} == null || ${c} > 10 )到目前为止我实现了一个相当神奇的解析器,它返回一个我可以评估的AST,但我无法相信我是第一个解决这个问题的人。
So far i implemented a rather "magical" parser that returns an AST that i can evaluate, but i can't believe that i'm the first one to solve that problem.
什么我可以使用现有的代码吗?
What existing code could i use instead?
推荐答案SPEL(Spring Expression Lang)怎么样; static.springsource/spring/docs/3.0.x/reference/ expressions.html
What about SPEL (Spring Expression Lang); static.springsource/spring/docs/3.0.x/reference/expressions.html
更多推荐
寻找表达式评估器
发布评论