[antlr-interest] How to walk AST tree

Alexander Ga"ngel alexander at gaengel.de
Fri Mar 21 02:46:44 PDT 2008


you can use a Tree Grammar

En Example is in the Wiki 
http://www.antlr.org/wiki/display/ANTLR3/Expression+evaluator

or you interface the AST directly: 
http://www.antlr.org/wiki/display/ANTLR3/Interfacing+AST+with+Java

Alexander

ytriffy schrieb:
> Hi, all.
> I need to walk ast tree that was produced for java 5 source code.
> And basicly I need to get method names and variable names from it(and 
> maybe imports).
> So what I/m trying to do is to get this structure:
> 0                                classname
> 1 variables array   methods array   imports array
> I'm not very familiar with ast api. What is the most simple way to do 
> this?
>


More information about the antlr-interest mailing list