[antlr-interest] Line information and AST

mzukowski at yci.com mzukowski at yci.com
Wed May 21 07:44:02 PDT 2003


You will have to preserve line info, which doesn't happen by default.  Look
at the gcc grammar www.codetransform.com/gcc.html for an example of how to
do that.  Specifically at the TNode.java and its initialize() methods which
take the line number out of the Token or AST it is being initialized from.

Monty

-----Original Message-----
From: zhangcharles [mailto:zhangcharles at yahoo.com] 
Sent: Tuesday, May 20, 2003 6:59 PM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Line information and AST


Hi, ANLTR experts, how do I get the line information when walking a 
syntax tree, taking Java grammar as an exmaple? Thanks.

Charles


 

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


 

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




More information about the antlr-interest mailing list