|Java 2.0 Grammar Problems firstname.lastname@example.org (Michael Schoettner) (2001-02-12)|
|Re: Java 2.0 Grammar Problems C.vanReeuwijk@twi.tudelft.nl (Kees van Reeuwijk) (2001-02-15)|
|Re: Java 2.0 Grammar Problems email@example.com (Thomas Maslen) (2001-02-17)|
|Re: Java 2.0 Grammar Problems C.vanReeuwijk@twi.tudelft.nl (Kees van Reeuwijk) (2001-02-23)|
|Re: Java 2.0 Grammar Problems firstname.lastname@example.org (Peter Bertelsen) (2001-02-25)|
|Re: Java 2.0 Grammar Problems Dr_Feriozi@prodigy.net (2001-03-01)|
|From:||Kees van Reeuwijk <C.vanReeuwijk@twi.tudelft.nl>|
|Date:||15 Feb 2001 00:44:01 -0500|
|Organization:||Delft University of Technology|
|Posted-Date:||15 Feb 2001 00:44:01 EST|
On 12 Feb 2001 01:10:22 -0500, "Michael Schoettner"
>we are currently investigating the Java 2.0 grammer of the Java Language
>Specification (second edition) for an own Java compiler. We are faced with
>problems in some productions (an example is shown below). Does anybody have
>experience with the Java 2.0 grammer? Alternative grammers in EBNF for Java
>2.0 would also be an option. A short e-mail would be great. Many thanks in
>advance for your efforts.
I prefer to reply to this newsgroup, since other people may be
The grammar in the appendix of JLS2 indeed has problems. The ambiguity
you showed in your message is an example, and there are other issues. If
someone is interested I can post the bug reports I sent to Sun about
I never received official confirmation, but I unofficially Sun agrees
that the appendix is, uhm, less than perfect.
My Spar/Java compiler, Timber, contains a yacc grammar for Java plus a
number language extensions. Apart from the extensions, the compiler very
closely follows the Java language, so it might be just what you are
looking for; see <http://www.pds.twi.tudelft.nl/timber>.
Alternatively, you may want to use the grammar from the 1st edition of
the JLS, which is very good, and take the grammar for the language
extensions of JLS2 from the body of the text.
Return to the
Search the comp.compilers archives again.