I am looking for an open source library in Java for parsing and building SQL-like expressions.
for example to evaluate validity of expressions like:
"(a = x or y ) and (b != z)"
in addition I want to have an API for building or extending expressions. something like:
Expression exp = new Expression(); exp.addCondition("a",{"x","y"},Operator.OR);
It’s not very complicated to implement such a library, but aren’t we develop in Java to enjoy collaborative development?
I’m pretty sure you can have ANTLR do this for you.
The grammatic looks very simple ( from here ) 😛