I need to evaluate a boolean expression. The purpose is to filter a set of tagged items. Tag can be any name (let's say, like Java identifier).
For example:
foo OR (bar AND !baz)
This would be true for items tagged:
- foo fee
- foo bar boo
- bar
I don't know in advance which names will be needed. I've checked JEXL but it has JexlContext, which is basically a Map which needs to be filled prior to evaluation.
I need some library which calls a callback function to decide whether an identifier is true or false. Or any other mechanism to allow identifiers unknown prior to evaluation.
It has to be free as in beer (it's for a Maven plugin), so Jep is out of question.
What can I use?