boolean expression parser in java

后端 未结 5 776
北恋
北恋 2020-11-27 21:30

Are there any java libraries or techniques to parsing boolean expressions piecemeal?

What I mean is given an expression like this:

T &

5条回答
  •  北海茫月
    2020-11-27 22:21

    Check out BeanShell. It has expression parsing that accepts Java-like syntax.

    EDIT: Unless you're trying to actually parse T && F literally, though you could do this in BeanShell using the literals true and false.

提交回复
热议问题