• Post Reply Bookmark Topic Watch Topic
  • New Topic

1.5 (tiger) grammar  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I maintain a system that reverse engineers Java source code to create a UML model. The arrival of 1.5 has given me some new work to do obviously. What I'm trying to find ideally is a BNF grammar for the new Java 1.5 featuresand most specifically enums.

I'm having a hard time getting an accurate definition of what you can do with enums in Java 1.5. I reckon I have Generics sorted and the other stuff is pretty easy to deal with but enums are a new data type.

Do Sun publish a BNF for Java? Where can I find it? Has it been updated for 1.5 yet?

Thanks for your time.
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Do Sun publish a BNF for Java

No. Someone probably will (I think there's a sourceforge project that does this). But then Tiger is beta, so you might just have to wait a while.
 
Bradley Smith
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the problem. I haven't got time to wait.
Maybe I'll check out the sourceforge projecy on this. I may even be able to contribute something.

Cheers.
Brad.
 
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do Sun publish a BNF for Java

Not a BNF, no, but the JLS does contain a grammar (two, really) in another notation (defined here) which could probably be converted to BNF without too much trouble. For the new language constructs, JSR 201 gives links to draft specs - the one for enum is here. Of course since it's a draft there may be some errors or other changes to be made. But hopefully this will give you something to work with...
[ June 21, 2004: Message edited by: Jim Yingst ]
 
Bradley Smith
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks Jim. Can;t believe I couldn;t find that. I know where to look in future and the docs you linked me to will help no end.

Regards
Brad
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!