Parser that allows expressions of an as-yet unnamed Java-like language
to be parsed to create functors.
The langauge is a subset of a Java 1.5 grammar, whose BNF form is
available here. While it is an incomplete subset
of the Java expression syntax, what's already implemented is enough
to be interesting. You can do basic arithmetic (with all standard
Number implementations, including BigDecimal and BigInteger),
relational comparisons, shifts, boolean expressions, conditionals,
call constructors and methods, reference member variables, cast
values, test instanceof, and reference class constants (including
enumerated values when run on Java 1.5). Essentially, the grammar
allows anything that can be typed on the right side of a Java
assignment statement.
The following expression syntax is not implemented in the current release.
- arrays
- numeric coercion (arithmetic and relational operands must cast if necessary)
- Nested class constructor calls (ie, the rarely used "foo.new bar()" syntax)
- assignments or assignment forms (i.e.: +=, -=, etc)
- pre- or post- increment or decrements
- anonymous class creation
|