[antlr-interest] Convert token position from line+column (index in line) to absolute source indexes

Gabriel Petrovay gabriel.petrovay at 28msec.com
Tue Mar 17 07:54:30 PDT 2009


Hi all,

Does anybody have any idea, a working solution or an example of how could I
convert the token positions from (line, column) pair to absolute indexes in
the input stream (indexStart, indexEnd)

Or, are there any ways to do this from the lexer without hacking it (change
the Java code generation). I am thinking about helper clases/functions to do
this or if I can some tell the Lexer to use some extended token
(MyCommonToken) that somehow (I don't know yet how) adds this functionality.

Thanks!

Regards,
Gabriel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090317/71db8109/attachment.html 


More information about the antlr-interest mailing list