Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

BNF representation of the java 1.5 langauge?

Thread view: 
Tom Forsmo - 24 Oct 2006 14:48 GMT
Does anybody know if there is an BNF or similar description of the java
language available out there? I am looking to improve my java
development environment (Emacs with Jdee), and I thought a good solution
to improving it is by adding support for real-time syntax parsing of the
code.

So any hints?

tom
djthomp - 24 Oct 2006 15:02 GMT
> Does anybody know if there is an BNF or similar description of the java
> language available out there? I am looking to improve my java
[quoted text clipped - 3 lines]
>
> So any hints?

You might try
http://java.sun.com/docs/books/jls/third_edition/html/syntax.html
Oliver Wong - 24 Oct 2006 16:08 GMT
> Does anybody know if there is an BNF or similar description of the java
> language available out there? I am looking to improve my java development
> environment (Emacs with Jdee), and I thought a good solution to improving
> it is by adding support for real-time syntax parsing of the code.
>
> So any hints?

Yes, these BNF descriptions are typically refered to as "grammars", so
googling for "java grammar" gives me about 5 different BNF-like
representations of the Java language. I don't know which format you/emacs
prefers. http://cobase-www.cs.ucla.edu/pub/javacc/ is in JavaCC format, for
example.

   - Oliver
mouser - 24 Oct 2006 20:39 GMT
> Yes, these BNF descriptions are typically refered to as "grammars", so
> googling for "java grammar" gives me about 5 different BNF-like
> representations of the Java language.

And I'd like to thank you VERY much for pointing ME in the proper direction.
I've just started in the last month or two trying to learn Java
programming; and it's quite a steep learning curve! I've looked at a lot of
books that tell me what to do WITH the language, (and some are more useful
than others), but I hadn't until now encountered a book or tutorial that
could tell me what Java IS.  (Yes, I DO have the Sun documentation handy,
but there's such a LOT of that, one hardly knows where to start...)

Again, thanks for the tipoff!
Oliver Wong - 24 Oct 2006 21:07 GMT
>> Yes, these BNF descriptions are typically refered to as "grammars", so
>> googling for "java grammar" gives me about 5 different BNF-like
[quoted text clipped - 9 lines]
> could tell me what Java IS.  (Yes, I DO have the Sun documentation handy,
> but there's such a LOT of that, one hardly knows where to start...)

   You're welcome, but if you can learn programming languages by reading
their grammars, then... wow! Usually when I want to learn a new language
(right now I'm trying to learn Haskell), I'd google for "Haskell Tutorials"
or "Learn Haskell" or something similar.

   - Oliver
mouser - 24 Oct 2006 22:58 GMT
>     You're welcome, but if you can learn programming languages by reading
> their grammars, then... wow!

No, I don't intend for the grammar to be my sole instruction source. I've
got all the Java tutorials (including the ones in the Sun documentation)
and a pair of programming books (Ivor Horton's BEGINNING JAVA2 and a link
to THINKING IN JAVA). But the grammar is a good supplement to the how-to
books and tutorials.

Doubtless, I would have found it EVENTUALLY in the Sun documentation
package, but your note was a handy shortcut.
Vitaly - 26 Oct 2006 15:51 GMT
At
http://www.antlr.org/
you will find the Java grammar ready for use.

> Does anybody know if there is an BNF or similar description of the java
> language available out there? I am looking to improve my java development
[quoted text clipped - 4 lines]
>
> tom


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.