[antlr-interest] Problem when parsing numerics

Jim Idle jimi at temporal-wave.com
Tue Feb 17 09:25:49 PST 2009


Thomas Woelfle wrote:
> Hi,
>
> I've been running into a strange problem using ANTLR 3.1.1. I don't know 
> wether it is a bug in my grammar or a bug in ANTLR.
> In the language that has to be parsed following lines are legal strings:
>
> 1.
> 1.5.
>
> There is a rule where a numeric is followed by a dot.
>   
Please look in the FAQ/examples:

http://www.antlr.org/wiki/display/ANTLR3/Lexer+grammar+for+floating+point%2C+dot%2C+range%2C+time+specs

You should be able to simplify the grammar here to just what you need.

Jim


More information about the antlr-interest mailing list