[antlr-interest] Manipulating lexer text output

Gavin Lambert antlr at mirality.co.nz
Tue Apr 3 14:00:10 PDT 2007


At 06:54 4/04/2007, Jim Idle wrote:
 >Yeah - this has come up a lot and really the solution at the 
moment
 >is to do this in the parser. However you could at least do this 
in
 >the STRING rule with a call to a small function that removed 
this stuff
 >and then emit the token with the result as the text.

That'd still require double-parsing the input though (once via 
ANTLR's normal processing, and once after the fact to resolve 
escape sequences).  Which makes it no better than doing it outside 
ANTLR entirely.



More information about the antlr-interest mailing list