[antlr-interest] Lexer question

Micheal J open.zone at virgin.net
Thu Jul 27 08:20:30 PDT 2006


Hi,

> Tomy,
> 
> I would try something like this:
> 
> In the Lexer:
> 
> INTEGER: ('0'..'9')+;
> 
> In the parser:
> 
> integer: INTEGER;
> double: INTEGER '.'  (INTEGER)?;

This allows whitespace around the '.' such as "1 .0" and "1. 0" and "1
.     0"

You really want the lexer to break your input alphabet into tokens.


Micheal

-----------------------
The best way to contact me is via the list/forum. My time is very limited.



More information about the antlr-interest mailing list