[antlr-interest] Capturing Line numbers

Vijay K. Ganesan vijay at mindspring.com
Sat Jan 28 08:53:19 PST 2006


I'm using antlr to parse java-like source code and build an AST. 
I'd like to invoke getLine() on the AST nodes to return the line number corresponding to the AST root's token. Currently it returns 0 always. I believe I need to create my own AST class that extends BaseAST/CommonAST?? Could someone please provide an example of how to go about doing this?
Thanks a lot.

Vijay


More information about the antlr-interest mailing list