寻找表达式评估器

编程入门 行业动态 更新时间:2024-10-07 22:28:51
本文介绍了寻找表达式评估器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在寻找简单条件表达式的求值器。 表达式应包括变量(只读),字符串,数字和一些基本运算符。

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

更多推荐

寻找表达式评估器

本文发布于:2023-11-28 18:46:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643548.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表达式

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!