[antlr-interest] Preserve source code comments

Terence Parr parrt at cs.usfca.edu
Fri Oct 19 10:45:21 PDT 2012


I Think that the individual tokens let you get the token index with getTokenIndex. First, you find the real token of interest such as the start or end of a statement. Then, you ask the token stream for the hidden tokens to the left or right. v4 makes this a bit easier; not sure which one you are using.

T
On Oct 18, 2012, at 7:52 PM, Juancarlo Añez wrote:

> Terrence,
> 
> This is what hidden channels are for :)
>> 
>> http://www.antlr.org/wiki/pages/viewpage.action?pageId=557063
>> 
> 
> That would work.
> 
> How do I recover the current token index? Mmm. this.input.index() ?
> 
> -- 
> Juancarlo *Añez*
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list