Thanks for the response. I am new to ANTLR (book is on its way). The problem is that all of these rules are top-level rules, and thus > considered equal candidates for token generation. Since CODE completely > contains SECOND, there is no possible way for a SECOND token to be generated > -- it will always come out as a CODE instead (since in the event of a tie > for longest-match, rules listed first win). > > To get the behaviour you probably intended, you need to change FIRST, > SECOND, and THIRD to be fragment rules instead of top-level rules. >
Could you refer me to a link explaining fragment rules versus top-level rules (I find the Wiki pages confusing)? A keyword search on google did not help. --~--~---------~--~----~------------~-------~--~----~ 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
