[antlr-interest] Line and Column information lost during AST creation

Xue Yong Zhi zhixueyong at hotmail.com
Wed Jan 3 10:39:43 PST 2007


You need to replace the default AST class with the one like this:
http://xruby.googlecode.com/svn/trunk/src/com/xruby/compiler/parser/ASTWithLineNumber.java

Then call setASTNodeClass in your parser to use your AST class, e.g.
setASTNodeClass("com.xruby.compiler.parser.ASTWithLineNumber");

Christophe Boutter wrote:
> My problem is that during the AST creation in the parser all information
> about lines and columns of the lexer Token is lost. But I need this
> informations badly. Why is that?
> 


-- 
Xue Yong Zhi
http://seclib.blogspot.com



More information about the antlr-interest mailing list