You know what, ANTLR can do it after all! With expr alternatives EOF terminated it still issues the warning but then parses correctly
prefix_1 prefix_w suffix suffix as (expr(expr1(prefix expr2 (prefix_2 suffix) suffix)EOF)) even though the expr2 option "PREFIX2 SUFFIX" was allegedly disabled. As Alice says - this is becoming "curiosuer and curiosier" :). Regards Nikolay Loring Craymer wrote: > 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 > > > -- *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
