Your pareser rules are all starting with upper case letters and they should start with lower case.
Jim On Sep 20, 2009, at 3:45 AM, Artem Golubev <[email protected]> wrote: > I just can't get how I can left-refactor the following grammar. > Please, help. > Currently I get "(211): ebnf.g:1:8: [fatal] rule Tokens has non-LL > (*) decision due to recursive rule invocations reachable from alts > 8,9. Resolve by left-factoring or using syntactic predicates or > using backtrack=true option." error with it. > > grammar ebnf; > > options { > output = AST; > language = CSharp2; > } > > tokens { > OPENBRACKET = '('; > CLOSEBRACKET = ')'; > ONEORMOREKEYWORD= '+'; > ANYKEYWORD = '*'; > OPTIONALKEYWORD = '?'; > ORKEYWORD = '|'; > } > > /*------------------------------------------------------------------ > * PARSER RULES > *------------------------------------------------------------------*/ > OrList : List (ORKEYWORD List)*; > > List : (Mutliplication)+; > > Mutliplication : Atom ( ONEORMOREKEYWORD | OPTIONALKEYWORD | > ANYKEYWORD )?; > > Atom : IDENTIFIER | Group; > > Group : OPENBRACKET OrList CLOSEBRACKET; > > /*------------------------------------------------------------------ > * LEXER RULES > *------------------------------------------------------------------*/ > > IDENTIFIER : (DIGIT)+ ; > > WHITESPACE : ( '\t' | ' ' | '\r' | '\n' )+ { $channel = HIDDEN; } ; > > fragment DIGIT : '0'..'9' ; > > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address 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 -~----------~----~----~----~------~----~------~--~---
