[antlr-interest] Java 1.5 grammar updated

Diane Nkonyereza nkodidi at hotmail.com
Tue Apr 8 09:54:12 PDT 2008


That's strange. I can't compile such a file, I get error : 'class' or 'interface' expected.

Diane.



Date: Tue, 8 Apr 2008 12:43:30 -0400
From: swatt at infobal.com
To: nkodidi at hotmail.com
CC: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Java 1.5 grammar updated






  


This is the same as the grammar rule in the Java spec at:
http://java.sun.com/docs/books/jls/second_edition/html/syntax.doc.html



I was surprised by this, and being curious, I just successfully
compiled a Java source file containing only a single semicolon. It
seems a bit  pointless to me, but it is valid Java! 



All the best

Stuart





Diane Nkonyereza wrote:

  Hi all,

  

I have a question on the latest Java grammar. The question is related
to the typeDeclaration rule.

  

- What is the ';' in the typeDeclaration Rule? Can someone please gives
me an example of when the ';' could be an option or is it possible to
just have ';' in java file and compile it successfully?

   

  typeDeclaration
    :   classOrInterfaceDeclaration
    |   ';'
    ;
Regards,

Diane.

  

  

> To: antlr-interest at antlr.org

> From: parrt at cs.usfca.edu

> Date: Wed, 19 Mar 2008 18:24:45 -0600

> Subject: [antlr-interest] Java 1.5 grammar updated

> 

> Hi, thanks to John Ridgway, we have a major set of fixes to Java.g

> 

> http://www.antlr.org/grammar/1152141644268/Java.g

> 

> Parses JDK 1.5 source he says.

> 

> Terence

  

  Get fish-slapping on Messenger Play now!

--
  

This message was scanned by ESVA and is believed to be clean.
  

  Click
here to report this message as spam.




_________________________________________________________________
Get Hotmail on your mobile. Text MSN to 63463 now!
http://mobile.uk.msn.com/pc/mail.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080408/354d787c/attachment.html 


More information about the antlr-interest mailing list