[antlr-interest] question concerning ANTLR java grammar (again)
Alexey Demakov
demakov at ispras.ru
Tue Sep 13 08:55:20 PDT 2005
We're developing such Java front end, but semantics checking is not yet available.
It's open-source: https://sourceforge.net/project/showfiles.php?group_id=120633&package_id=156476
Regards,
Alexey
-----
Alexey Demakov
TreeDL: Tree Description Language: http://treedl.sourceforge.net
RedVerst Group: http://www.unitesk.com
----- Original Message -----
From: "Claudius Heitz" <c0123 at web.de>
To: <antlr-interest at antlr.org>
Sent: Tuesday, September 13, 2005 7:50 PM
Subject: RE: [antlr-interest] question concerning ANTLR java grammar (again)
>
> 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