[antlr-interest] Printing the AST

Amrinder Singh asingh05 at vt.edu
Fri Jul 7 18:18:08 PDT 2006


I try to print the tree in the list ofrmat using the function  
"r.tree.toStringTree()" where r is of type MyParser.compilationUnit_return and 
we run the statement "r =  g.compilationUnit();". However, all it prints is a 
list of nulls.
tree: (null (null null (null null) (null null (null null null) null (null null 
null null null) (null (null (null (null (null null null) null) (null (null 
null))))))))
How can I print the tree with the symbols?

Amrinder




More information about the antlr-interest mailing list