[antlr-interest] line numbers in tree parser

Joan Pujol joanpujol at gmail.com
Sat Nov 6 12:08:05 PST 2004


You have to extend the CommonAST class to YourASTClass and overwrite
the methods setLine and setColum. Because if you look at code of
CommonAST you will see that is empty for this methods.

Cheers,



On Wed, 03 Nov 2004 00:35:43 -0000, hero_onethousand
<ebell at edgeofreality.com> wrote:
> 
> 
> I apologize in advance if this topic has been discussed, but I had no
> luck searching the archive.
> 
> I am using a tree parser to perform semantic checks/transformations
> and I need to get line numbers to report errors. In the parser I can
> use the lexer's shared input state or the line number stored in a
> token, but neither of these apply when walking the AST in the tree
> parser. AST nodes do not store line numbers like tokens do.
> 
> I am looking for the path of least resistence. My current plan is to
> make some minor alterations to CommonAST and the ASTFactory so the
> current line number is always copied into the AST.
> 
> Evan A. Bell
> Game Programmer
> www.edgeofreality.com
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 


-- 
Joan Jesús Pujol Espinar


 
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