[Soot-list] Accessing AST

mbatch at cs.mcgill.ca mbatch at cs.mcgill.ca
Tue Jan 30 17:53:23 EST 2007


On Tue, January 30, 2007 5:19 pm, David A Weiser wrote:
> Is there a way to traverse the AST of Java with SOOT?

Are you talking about Java source?

You could always use a SableCC generated lexer/parser. Java grammars are
available on the website, too, so it is as simple as writing a single
printer adapter class.

The other option is to look at the code of the Soot decompiler (DAVA). It
has a slightly-nonconformist AST, with respect to the rest of Soot. Might
have what you are looking for.

Finally, if you specify Java source as input to Soot, it uses a
Java-to-Jimple parser, which has an internal AST representation. You can
poke around in the code in the package "soot.javaToJimple.jj".. but I'm
not sure how complicated and/or thorough it is.

Michael





More information about the Soot-list mailing list