[antlr-interest] question concerning ANTLR java grammar (again)

Claudius Heitz c0123 at web.de
Tue Sep 13 08:50:12 PDT 2005


Hi,

Thanks for the answer.

> The ANTLR grammar is a parser for the java language not a full java
> front end (it lacks symbol tables, type-checking etc). 
> 
> You can use it to build a full front end that will catch this kind of error
> during it's type resolution/checking/binding phase.

I think, the expression   "java.lang.String;"
is probably already recognizable as a syntactic error.

But I suppose that it's much easier to recognize it with a full java front end.

So is there a free available full front end for the java language which does type resolution/checking/binding?

Thanks in advance!

Regards
Claudius


"Micheal J" <open.zone at virgin.net> schrieb am 10.09.05 14:07:17:
> 
> > Hi,
> > 
> > I used the current java grammar 
> > (http://www.antlr.org/grammar/1109874324096/ja> va1.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?
> 
> No.
> 
> > If yes, is it already known?
> 
> Yes. The ANTLR grammar is a parser for the java language not a full java
> front end (it lacks symbol tables, type-checking etc). 
> 
> You can use it to build a full front end that will catch this kind of error
> during it's type resolution/checking/binding phase.
> 
> Micheal
> 


______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193



More information about the antlr-interest mailing list