Well, there is nothing else that the extra SUFFIX can belong to according to the grammar so this is not derivation/parsing of the statement per the grammar.
Regards Nikolay 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 > > --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 > > > -- *Nikolay Ognyanov, PhD* Chief Technology Officer *TravelStoreMaker.com Inc.* <http://www.travelstoremaker.com/> Phone: +359 2 933 3832 Fax: +359 2 983 6475 --~--~---------~--~----~------------~-------~--~----~ 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
