This question comes up about 2 or 3 times a month, and people seem to
have difficulty locating the prior emails that show how to do it. This
is a common thing to have to lex, but the usual solutions don't account
for range checking, partially formed input and so on. More than 50% of
writing a grammar is concerned with catching errors, but most examples
assume a perfect input and that the user will work out the error
processing.

The same requirement arises as part of the JavaFX project at Sun. The
compiler part of JavaFX is open source, and the front end uses ANTLR
3.1; so I have published this part of the lexer on the WIki in the
examples section at:

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

Hopefully, being in the Wiki and in innumerable past posts to the group
will mean that the question won't keep cropping up on the group. I will
alst

Cheers,

Jim
_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org:8080/mailman/listinfo/antlr-dev

Reply via email to