Looking for a standalone Java source code parser

Alex Buckley alex.buckley at oracle.com
Mon Oct 20 18:55:45 UTC 2014


On 10/20/2014 12:13 AM, Ben Evans wrote:
> There is certainly a BNF grammar for Java 5 out there somewhere. A tool
> like ANTLR should be able to produce a parser for you from that.

ANTLR 4 ships with a grammar for Java 7, and has an experimental grammar 
for Java 8. There was some work this summer between Oracle and Terence 
Parr to improve ANTLR's Java 8 grammar and integrate the resulting 
parser into javac - see the compiler-grammar-dev list.

Alex



More information about the discuss mailing list