[antlr-interest] Why won't this match...

alan brown listbrownie at gmail.com
Sun Feb 24 07:40:01 PST 2008


It must be something obvious but why won't this language parse the word
'wibble'?  I would expect the lexer to be unable to match the input to
BIG_TOKEN but successfully match to LITTLE_TOKEN followed by SEMI_TOKEN.  If
I change the BIG_TOKEN definition to 'wobble' then all is well but I don't
know why this is failing.

Any help is appreciated

root                       : tokenizer2 | tokenizer1 ;

tokenizer1              : BIG_TOKEN ;
tokenizer2             : LITTLE_TOKEN SEMI_TOKEN ;

BIG_TOKEN           : 'wibbled' ;
LITTLE_TOKEN     : 'wi';
SEMI_TOKEN            : 'bble' ;

Thanks,
alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080224/57782b20/attachment.html 


More information about the antlr-interest mailing list