The EOF won't fix the ambiguity, but it will make ANTLR parse all of
PREFIX_1 PREFIX_2 SUFFIX SUFFIX
instead of just parsing
PREFIX_1 PREFIX_2 SUFFIX
(as per the "disabling" message) and then "mysteriously" dropping the second 
SUFFIX on the floor.

--Loring



----- Original Message ----
> From: Sam Barnett-Cormack <[email protected]>
> To: Loring Craymer <[email protected]>
> Cc: Nikolay Ognyanov <[email protected]>; Jim Idle 
> <[email protected]>; [email protected]
> Sent: Wednesday, August 12, 2009 3:49:48 PM
> Subject: Re: [antlr-interest] Why and how exactly does ANTLR manage to fail 
> on non recursive grammar for finite language?
> 
> Loring Craymer wrote:
> > Not true; your example can be interpreted either as
> > 
> > (expr1:  PREFIX_1 (expr2:  PREFIX_2 SUFFIX) SUFFIX )
> > 
> > or as
> > 
> > (expr1:  PREFIX_1 (expr2:  PREFIX_2) SUFFIX) SUFFIX
> > 
> > with the extra SUFFIX belonging to something else
> 
> So, hazarding a guess, would it be okay if expr was EOF-terminated?
> 
> -- Sam Barnett-Cormack


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to