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


Which is a better way of explaining it in fact ;-) as it probably explains the left factoring requirements better.

Jim


--Loring


From: Nikolay Ognyanov <[email protected]>
To: Jim Idle <[email protected]>
Cc: [email protected]
Sent: Wednesday, August 12, 2009 3:28:16 PM
Subject: Re: [antlr-interest] Why and how exactly does ANTLR manage to fail on non recursive grammar for finite language?
By definition a grammar is ambiguous if there is more than 1 way to derive at least one statement.
This is not the case here. There is only 1 way to derive the offending statement

PREFIX_1 PREFIX_2 SUFFIX SUFFIX

And it would take the procedure for expr2 just about 3 tokens lookahead to figure out what is the
right thing to do. The question is why ANTLR does not do this?

Regards
Nikolay





--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

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

Reply via email to