[antlr-interest] generating runtime error messages with ANTLR

Carter Cheng carter_cheng at yahoo.com
Tue Feb 19 09:29:09 PST 2008


Thanks for this.

Regards,

Carter.
--- Mark Volkmann <r.mark.volkmann at gmail.com> wrote:

> On Feb 17, 2008 8:37 AM, Carter Cheng
> <carter_cheng at yahoo.com> wrote:
> > Hi everyone,
> >
> > I have been trying to build a compiler using ANTLR
> > 3.0.1 to handle most of the frontend work. I am
> > curious if there is a canonical method for passing
> > line count, character position information
> downstream
> > to other phases of the compiler which can be then
> used
> > for error reporting either in the type check phase
> > after the AST is constructed or at runtime.
> >
> > Is there some canonical method for capturing this
> > information in the AST which can then be used to
> > generate error reports?
> 
> The default AST tree node class CommonTree has
> methods to get that
> information. The getLine method works as expected,
> but it seems that
> getCharPositionWithinLine always returns zero. Is
> that a known bug?
> 
> -- 
> R. Mark Volkmann
> Object Computing, Inc.
> 



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping


More information about the antlr-interest mailing list