Bug 598 : Update ANTLR grammars to support Java 1.5 syntax
Last modified: 2010-03-15 14:31




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P3
Severity:
normal

 

Reporter:
fry
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2007-07-16 07:30
We can't currently support the syntax changes in Java 1.5+ because the
grammar for the preprocessor needs to be updated.

The grammar is called pde.g, and is an extension of the java.g grammar
found in app/antlr/java. Anyone who has the chops to update the java.g
grammar from 1.3 to 1.5 would be greatly appreciated. In addition then, the
grammar for pde.g needs to be updated to make sure it still works.

This is a time consuming/mind-bending process, and has been put off since
the new Java syntax features are not a priority, and using
ArrayList<Integer> is way slower than just dealing with an int array... and
speed is important for interactive graphics.
Additional Comment #1 From fry 2007-07-16 07:30
*** Bug 459 has been marked as a duplicate of this bug. ***
Additional Comment #2 From h3 2008-01-29 17:36
Some direction and a list of what syntax changes would be helpful. Got
some links?

Elaborate on the statement "Updated to make sure it still works"? Do you
really mean "adapt the new pde.g with 1.5 syntax including backwards
compatibility for previous versions of pde.g.." or..?
Additional Comment #3 From Classiclll 2008-07-26 00:22
[Request]
grammar "import static xxx" support will make it easy to handle a static method
correction(class).
Additional Comment #4 From tobi 2009-09-02 08:34
There are grammar files for Java 1.5 [1] and Java 1.6 [2] linked at
http://www.antlr.org/grammar/list; would they be of any help?

--
[1] http://www.antlr.org/grammar/1152141644268/Java.g
[2] http://openjdk.java.net/projects/compiler-grammar/antlrworks/Java.g
Additional Comment #5 From fry 2009-09-02 08:38
Those are the starting point, the major work comes from porting the
Processing extensions to those new grammars and ANTLR v3 syntax. One of
those 1.5/1.6 grammars will replace the java.g file in the source, it's the
pde.g file (the extensions to java.g) that is most of the work.

The once that's finished, the emitter code needs to be updated so that we
can re-create java source after it's been run through the grammar.
Additional Comment #6 From fry 2009-11-01 17:39
*** Bug 1366 has been marked as a duplicate of this bug. ***
Additional Comment #7 From MrFeinberg 2010-03-12 12:54
I've now checked in changes that implement type arguments and type
parameters (a.k.a. "generics"), enhanced for loop, varargs, and static
import. Pending some testing, maybe this one is "fixed"?
Additional Comment #8 From fry 2010-03-13 05:22
yep, let's update the status when testing is done.
Additional Comment #9 From fry 2010-03-15 14:31
fixed by jdf for revision 0180.