Nikolay Ognyanov wrote:
Clearly, this is ambiguous because you follow expr2 with SUFFIX in the expr1 rule. When parsing expr2 as part of expr1, the paths of taking PREFIX_2 the using SUFFIX in expr1 and taking PREFIX_2 then SUFFIX in expr2 followed by SUFFIX in expr1 are ambiguous as written.Hi everybody, Please have a look at a toy grammar for language consisting of 2 statements : You say you know how to fix it, but perhaps you do not if you cannot see the ambiguity here. Because expr2 is a stand alone path from expr, there is no way to know how to disambiguate when called from expr1. Basically, you need to left factor these rules properly: expr : PREFIX_1 PREFIX_2 SUFFIX SUFFIX? | PREFIX_2 SUFFIX? ; Jim --~--~---------~--~----~------------~-------~--~----~ 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
