I am still working on this. Searching for solutions that could make the IDENT rule and FUNCTION_DECL work together.Could anybody help me with these? Thanks.
On Wed, Jan 14, 2009 at 10:54 AM, chain one <[email protected]> wrote: > I know where the problem isThere is another rule named IDENT: > > IDENT > > : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')* > ; > > seems this rule conflicts with the FUNCTION_DECL rule. > > On Wed, Jan 14, 2009 at 10:09 AM, chain one <[email protected]> wrote: > >> Seems it still doesn't work.I am still working on this. >> I learned a lot from your rely. Thanks Gavin. >> >> On Wed, Jan 14, 2009 at 4:21 AM, Gavin Lambert <[email protected]>wrote: >> >>> At 00:29 14/01/2009, chain one wrote: >>> >>>> I tried the lexer rule you gave me. But following error comes out: >>>> >>>> Alternative 155: after matching input such as >>>> 'F''U''N''C''T''I''O''N''F''U''N''C''T''I''O''N''F''U''N''C''T''I''O''N''E''N''D''_''F''U''N''C''T''I''O''N'{'0'..'9', >>>> 'A'..'Z', '_', >>>> 'a'..'z'}'F''U''N''C''T''I''O''N''E''N''D''_''F''U''N''C''T''I''O''N'{'0'..'9', >>>> 'A'..'Z', '_', 'a'..'z'}'F''U''N''C''T''I''O'{'\u0000'..'/', ':'..'@', 'N', >>>> '['..'^', '`', '{'..'\uFFFF'} decision cannot predict what comes next due >>>> to >>>> recursion overflow to FUNCTION_DECL from FUNCTION_DECL >>>> >>> >>> Hmm. Well, another variation (that it might like better) would be: >>> >>> FUNCTION_DECL >>> : 'FUNCTION' { $channel = HIDDEN; } >>> (FUNCTION_DECL | ~'E' | 'E' (~'N' | 'N' (~'D' | 'D' >>> (~'_' | '_' (~'F' | 'F' (~'U' | 'U' (~'N' | 'N' >>> (~'C' | 'C' (~'T' | 'T' (~'I' | 'I' (~'O' | 'O' >>> (~'N' | 'N' ~SEMI))))))))))))* >>> 'END_FUNCTION' SEMI >>> ; >>> >>> Another thing that might help is to change the embedded reference to >>> FUNCTION_DECL to ('FUNCTION') => FUNCTION_DECL; ie: >>> >>> FUNCTION_DECL >>> : 'FUNCTION' { $channel = HIDDEN; } >>> ('FUNCTION') => FUNCTION_DECL | ~'E' | 'E' (~'N' | 'N' >>> (~'D' | 'D' (~'_' | '_' (~'F' | 'F' (~'U' | 'U' >>> (~'N' | 'N' (~'C' | 'C' (~'T' | 'T' (~'I' | 'I' >>> (~'O' | 'O' (~'N' | 'N' ~SEMI))))))))))))* >>> 'END_FUNCTION' SEMI >>> ; >>> >>> >> > --~--~---------~--~----~------------~-------~--~----~ 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
