[antlr-interest] [Antlr 3] lexer problem

Sven Efftinge sven at efftinge.de
Tue May 15 01:27:53 PDT 2007


Hi,

I faced the following behaviour.
For the grammar

start 	:	FLOAT ('.' 'foo')?;

FLOAT 	:	'0'..'9'+ ('.' '0'..'9'+)?;

the input '47.foo' results in a MismatchedTokenException(-1!=4).
I'd expected that the lexer matches FLOAT '.' 'foo'.
However the input 47.42.foo is parsed as expected.
Do I miss something?

I've rewritten the grammar so that everything works fine, but I would  
like to understand why my first approach didn't work.

thanks,
Sven

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070515/2ec435c9/attachment.html 


More information about the antlr-interest mailing list