Java EBNF?
Asked Answered
P

3

6

Does anyone know of an accurate source for an (E)BNF for the Java language? Preferably, it would be from an authorative source, e.g. Sun.

Thanks.

Probability answered 9/12, 2008 at 13:55 Comment(0)
C
3

First google result :)
Though I can't speak for how up-to-date it might be.

Callus answered 9/12, 2008 at 13:59 Comment(1)
That's for Java 1.2, so it doesn't have generics, assertions, enhanced for-loops, etc.Orel
A
5

i believe the 3rd edition is the latest:

JLS 3rd edition

Almsman answered 9/12, 2008 at 17:28 Comment(0)
C
3

First google result :)
Though I can't speak for how up-to-date it might be.

Callus answered 9/12, 2008 at 13:59 Comment(1)
That's for Java 1.2, so it doesn't have generics, assertions, enhanced for-loops, etc.Orel
P
1

I'm not sure what you want the spec for, but you may be interested to know that:

  • the parser in Javac is hand written. No parser generated tools.
  • there exists a number of repositories for popular parser generators grammars. Here is JavaCC and ANTLR.
Paderewski answered 9/12, 2008 at 14:27 Comment(1)
Both links are dead now.Reckford

© 2022 - 2024 — McMap. All rights reserved.