[antlr-interest] errors reported in console

Java Developer javadev111 at gmail.com
Tue Mar 17 05:05:41 PDT 2009


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090317/0a9cb947/attachment.html 


More information about the antlr-interest mailing list