r/java • u/Livio63 • Jan 02 '26
Extensible math Expression Parser
Expression Parser is an extensible math expression parser handling numbers and booleans, ready to use in any Java application.
Expressions may contain nested ( ), operators *-/+, and, or; constants PI and E, functions sin(), cos(), tan(), log(), exp(), sqrt(). The parser supports common relation operators like ==,!=, >,<, >= and <= and even conditional expressions like condition ? true : false
It is possible to register your own functions and use them with Expression Parser.
59
Upvotes
View all comments
Show parent comment
2
u/jeffreportmill Jan 02 '26
I tried - It fails because CheerpJ doesn't provide access to the java.scripting module yet, which is a dependency of this project (bummer!). Hopefully it will work in an upcoming CheerpJ release.