[antlr-interest] Navigate through the parsed Tree

Lucaz lucazd at gmail.com
Fri Jul 11 10:17:19 PDT 2008


Hello, I am very new with ANTRL and I would like to try something simple:
I am using ANTRLWork and the Java 1.5 grammar file (
http://www.antlr.org/grammar/1152141644268/Java.g).
My question is; how can I access the parsed tree?.

I tried getTree(), but it returns null. The adapter (getAdapter()) works but
I don't understand what should I pass to its methods (like
getParent(Object)).
(I've checked the docs here ->
http://www.antlr.org/api/Java/interfaceorg_1_1antlr_1_1runtime_1_1tree_1_1_tree_adaptor.html#01954069ab7d2c2eb78d328572110725
)

I tried these options also: output=AST; ASTLabelType=CommonTree;

Thanks a lot for this awesome tool!,
Lucaz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080711/644f2af6/attachment-0001.html 


More information about the antlr-interest mailing list