[antlr-interest] FEN grammar
Bart Kiers
bkiers at gmail.com
Sun Aug 28 13:49:18 PDT 2011
Hi Jonne,
*On Sun, Aug 28, 2011 at 10:26 PM, Jonne Zutt <jonne.zutt.ml at gmail.com>
wrote:
*
>
> *...
>
>
> pieces
> : ('p'|'P' | 'n'|'N' | 'b'|'B' | 'r'|'R' | 'q'|'Q' | 'k'|'K' |
> '1'..'8')+;
> *
In parser rules, you _can_ use "literal tokens", but it's best to refrain
from doing this: create separate lexer rules for them. And the `..` (range
operator) is only valid inside lexer rules. So the rules `enPassant` and
`pieces` are not doing what you think they are.
Change those things and try your grammar again.
Regards,
Bart.
More information about the antlr-interest
mailing list