[antlr-interest] question concerning ANTLR java grammar

Claudius Heitz claudius at heitz.info
Fri Sep 9 13:29:41 PDT 2005


Hi,

I used the current java grammar (http://www.antlr.org/grammar/1109874324096/java1.5.zip) and noticed that it accepts code that isn't allowed in Java.

I show it on a small example:

public class E {
	public static void main(String[] args) {
		java.lang.String;
		new ChildOfInner();
	}
}

The wrong thing on that is the expression: java.lang.String;

Eclipse tells: "Syntax error.  Insert "AssignmentOperator ArrayInitializer" to complete expression"

Because Eclipse doesn't accept it,  I suppose this isn't legal java code.
But the ANTLR java grammar accepts it as an expression.

Is this a bug?
If yes, is it already known?


Thanks for answering!

Regards
Claudius


______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!		
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130



More information about the antlr-interest mailing list