tags:

views:

22

answers:

1

Hi,

I am interested in the current byte position in the stream when parsing something using Antlr 3.
I have seen there is a similar question but there was no real answer there. That is why I am trying again.
I am not interested in token index, byte position in a line etc...
Could you someone tell me that? It is obvious that some code has to be written/overridden. Does someone have specific code to write? I use C#.

A: 

if your parser is parser = new myParser(tokenStream); then
bytepos=((CommonToken)parser.TokenStream.LT(1)).StartIndex;

Aftershock