Generating a AST from source-code

Hi,Anyone know how to use the new Java Compiler API to generate a AST from source-code that I can walk?http://java.sun.com/javase/6/docs/api/javax/tools/JavaCompiler.htmlThanks,Gili
[216 byte] By [cowwoca] at [2007-11-27 4:00:43]
# 1
http://forum.java.sun.com/thread.jspa?threadID=5148150
ejpa at 2007-7-12 9:05:20 > top of Java-index,Developer Tools,Java Compiler...
# 2

At first glance it looks like I need to use the experimental "Java Tree API" released in Java6: http://java.sun.com/javase/6/docs/jdk/api/javac/tree/index.html

Specifically, it looks like one uses JavacTask.parse() to return a collection of Trees and somehow uses them to walk the source-code. I will investigate this further and report back here if I figure this out :)

Gili

cowwoca at 2007-7-12 9:05:20 > top of Java-index,Developer Tools,Java Compiler...