antlr4 - Getting token start character position relative to the beginning of file -


is there reliable way antlr4 api token start character position relative beginning of file, not line? after doing research way found use custom implementation of intstream, not treat '\n' line terminators, perhaps i'm missing easier way? i'm using visitor api if matters.

the application i'm working on parses source files , provides insertion coordinates application uses provided coordinates insert additional code. more convenient if application got symbol position in file, rather line:positioninline pair.

you can use of following, depending on whether have token or terminalnode.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -