[antlr-interest] Walking TreeParser question
Nico
nico123 at adinet.com.uy
Thu Sep 18 20:38:01 PDT 2003
Hi all:
I will use the Antlr to parse a source code and to get some metrics.
I will read source, to create the AST with parser and walk it with the TreeParser.
(as seen in the java.g and java.g.tree example)
TreeParser has the same structure to the one that were used to create the AST.
My question is:
How do I iterate recursively in the tree (or call it several times) ?
(The java tree parser example walks it once)
For example, If I want to count the number of classes, one pass is enough.
But if want to get the number of overridden methods in a sub class, I need to walk the
tree more than once.
Is my question clear?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20030919/9c76bf93/attachment.html
More information about the antlr-interest
mailing list