ANTLR doesn't appreciate the uppercase 'D' of 'DataPath'. Uppercase means a token. Turning 'DataPath' to 'dataPath' makes ANTLR happy.
c. On Wed, Mar 11, 2009 at 6:17 PM, Stevenson, Todd (GE Healthcare, consultant) <[email protected]> wrote: > This grammar will not compile. I can't figure out why not. It generates > the error: > > reference to undefined rule: keypath > > even though it exists. Help! > > Thanks. > > ------------------------------------------------------------------------------------------------------------------------ > grammar cepath; > > options { > output=AST; > ASTLabelType=CommonTree; > } > > > > start > : cpath EOF > ; > > cpath > : KEY keypath > | DataPath > ; > > DataPath > : CODE keypath > ; > > keypath > : SEP CODE > | SEP DOMAIN > ; > > // $<lex > > KEY : 'key'; > CODE : 'code'; > DOMAIN : 'domain'; > > SEP : '.'; > WS : ( '\r' | '\n')+ {skip();}; > > // $> > > > > 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 -~----------~----~----~----~------~----~------~--~---
