[antlr-interest] Token position 0, -1

Bart Kiers bkiers at gmail.com
Fri Jul 6 03:58:46 PDT 2012


On Fri, Jul 6, 2012 at 11:47 AM, Ale Strooisma <alestrooisma at gmx.net> wrote:

> Hello,
>
> if I try to get the position of a token in the file with getLine and
> getCharPositionInLine, many of my tokens give the coördinates 0, -1,
> which obviously is wrong. Why is this the case, and how can I fix it?
>

Hi Ale,

Are the tokens that return -1 imaginary tokens? These (imaginary) tokens
don't have a real position in the input after all.

Regards,

Bart.


More information about the antlr-interest mailing list