[antlr-interest] tree walking errors to line/col

Bryan Ewbank ewbank at gmail.com
Wed May 3 02:26:17 PDT 2006


I'm not sure about "best"... What we've done is to capture file/line
as we tokenize the input, then keep that info on the nodes generated
from the tokens.  For generated nodes, we just chase the
"getFirstChild" - by construction, we guarantee that there's a token
with file/line somewhere down there.

On 5/2/06, David Parfitt <diparfitt at gmail.com> wrote:
> Hello -
>   I've been working on a hobby compiler for a couple weeks now and I have a
> general Antlr/compiler question.
>
> I was wondering what the best approach to linking errors found during tree
> walking (generated from code in actions) to lines and columns in the source
> file?
>
> Thanks -
> Dave
>
>
>


More information about the antlr-interest mailing list