[antlr-interest] java.g forks

Anton Safonov anton.safonov at refactorit.com
Mon Jan 3 03:11:59 PST 2005

In RefactorIT we used Studman's one, but then eventually fixed a number 
of issues to actually parse real life code.
Will try to extract those fixes from my notes and post it here sometime 
next week!


Jeremy Rayner wrote:

>Hi there antlr-interest folk,
>  First a bit of background... I'm currently working on the new groovy grammar
>( http://groovy.codehaus.org ) and we're looking to replace the
>existing hand-rolled
>grammar with a more complete form.
>  I'm currently looking at the 'java.g' file and it's many cousins, trying to
>establish the best basis upon which to build the groovy grammar.
>  We have an initial proposal of features added to an early 1.3 grammar,
>but I feel that moving to a stable 1.5 grammar early on would be of benefit
>to all. (Save the later pain...)
>  I have noted the excellent work done by Terence, Matt Quail, 
>Michael Stahl and Michael Studman. It does appear that there are
>currently three live versions of the grammar, with only taste and
>functionality between them.
>  Terence very kindly pointed me at this analysis of the two 1.5 grammars
>by Andy Tripp...
>  http://www.antlr.org/pipermail/antlr-interest/2004-October/009742.html
>  The vibe I am getting is that Michael Studman's work will become the trunk 
>revision of the java.g file.
>  It was all getting a little confusing, so I've tried to put the
>current state of
>java.g into diagrammatical form.
>  http://groovy.javanicus.com/java-g.png
>I guess I've got three questions
>1) Is it generally accepted that Michael Studman's grammar will become core, or
>is Michael Stahl's grammar that little bit more tasteful (and flexible)
>2) Will the Java1.3 grammar continue, or will a firm decision be made soon; 
>that you have one true java.g file again.
>3) Do you like my pretty diagram :-)
>Nice to meet you all,
>P.S. As a footnote, I tried to create a Java1.5 language recognizer
>myself using
>Metsker's bpwj API and the preview JLSv3 spec last month (
>http://tinyurl.com/46ugp )
>It is amazing how much of the syntax chapter of the JLS is no longer
>instead it appears that since JLSv2 the syntax in chapter18 is a mix
>of implementable
>grammar and exposition grammar.  I've lodged a few specific issues
>with their feedback
>forms, I hope Sun takes the time to ensure that JLSv3 chapter 18 is
>complete + correct.

More information about the antlr-interest mailing list