Harry
Harry

Reputation: 3937

JavaParser: Where is the Java grammar definition?

Where can I get the BNF-style Java 1.8 grammar that JavaParser is actually using to parse Java code?

There's a java_1_8.jj file in JavaParser's codebase automatically generated by javacc, but no sight of the grammar file used to generate this .jj file.

Upvotes: 0

Views: 339

Answers (1)

Seki
Seki

Reputation: 11465

There's a java_1_8.jj file in JavaParser's codebase automatically generated by javacc, but no sight of the grammar file used to generate this .jj file.

java_1_8.jjis the grammar file, while it is not in the BNF style you expected. It is not generated, but it is used to generate the parser java files.

Upvotes: 2

Related Questions