[antlr-interest] Re: Is antlr the right tool for this job?

lgcraymer lgc at mail1.jpl.nasa.gov
Mon Aug 23 00:56:42 PDT 2004


Two alternatives:  Either
1.) subclass ASTFactory and override create(AST) and create(Token) to
copy line and column info.

2.) use a custom AST class subclassed from CommonAST with
initialize(AST) and initialize(Token) overridden to copy the line and
column info.

--Loring


--- In antlr-interest at yahoogroups.com, William Bland <wjb at a...> wrote:
> First off, thanks very much to Loring and David for their replies, and
> to everyone who has contributed to Antlr to make it such a great tool!
> 
> I've managed to do everything I wanted to do (generating documentation
> from Java source code) and it's been much, much easier than with any of
> the other approaches I've tried.
> 
> There's just one minor niggle:  When I'm looking at an AST, to generate
> documentation from it, it would sometimes be useful to get the line and
> column where the code fragment starts in the source file.  From the AST
> JavaDoc, it looked to me like getLine() and getColumn() would do the
> trick, but they appear to always return zero.  Any ideas?
> 
> Thanks again,
> 		Bill.
> -- 
> Dr. William Bland                          www.abstractnonsense.com
> Now listening to Nothing (Media player is not running)



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list