[antlr-interest] Antlr v3 -- Lexing '..' and '1.'

Terence Parr parrt at cs.usfca.edu
Thu Jul 27 18:42:34 PDT 2006


On Jul 27, 2006, at 6:09 PM, John B. Brodie wrote:

> Greetings!
>
> I am trying to construct a lexer under Antlr v3 that will recognize a
> RANGE (e.g. '..') operator, FLOAT (e.g. 1.) numbers, and some other  
> stuff.

Hi. Nice analysis.  My intended solution was simply to allow you to  
emit more than one token per lexer rule. :)  So, when you are in  
FLOAT and see a following '.' then just emit INT DOT DOT with three  
emit() calls.  ANTLR will know you have emitted a token and will not  
auto-emit. :)

Ter



More information about the antlr-interest mailing list