[antlr-interest] Debugging tree parser antlr 2.7.5

Xue Yong Zhi zhixueyong at hotmail.com
Mon Jan 22 08:44:18 PST 2007

> <AST>:0:0: unexpected end of subtree
> How do I debug this? I have added    genHashLines = true;      to both 
> the regular parser as well as the tree parser, however I still get 
> <AST>:0:0
> How can I pinpoint the exact location where the problem is?

The default AST node does not store line information. You can try to 
replace it with the follwoing:

Then in your parser, call this:

Btw, println is helpful for debugging, as always:)
AST ast = parser.getAST();

More information about the antlr-interest mailing list