[antlr-interest] Bug in java grammar 1.18 (again)

John P N Pybus john-yahoo at pybus.org
Fri Jan 25 10:04:12 PST 2002


Sorry, yahoogroups seems to have striped the message from my previous post.  
I won't send the attachment again, but here's what I was trying to say:

On Friday 18 Jan 2002 9:54 am, you (Sander Mägi) wrote:
> Hi
>
> Sending it again - maybe some of you grammar experts could advise - I am
> just a plain java guy myself and am very lost with grammars - just would
> like this to work.
>
> Anyway - I think here is the part that needs changes:
>
> Can someone help?
>
> ...
> // (new Outer()).super()  (create enclosing instance) (SM: but does not
> work for 'holder.outer.super();')
>
>     | primaryExpression DOT! "super"! lp3:LPAREN^
>     | {#lp3.setType(SUPER_CTOR_CALL);#lp3.setText("super");} argList
>     | RPAREN! SEMI!
>
> ...

Indeed, it should be "postfixExpression DOT super", to allow multipart outer
expressions.  This runs into the problem that postfixExpression itself
matches id.id.super().

I've reworked the primaryExpression, and postfixExpression rules to try and
fix that, and your attached example now parses.  I haven't yet had time to
fully test my changes, but I'm posting a new version of java.g for people to
try out.

Let me know if you find any problems with it.

Yours

John Pybus

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list