This content has been marked as final. Show 3 replies
Why is this different than you other post?
And you do realize that this is not an easy task right? The actual code isn't necessarily all that difficult but you must understand the tools you are using in the first place.
Anybody have a sample program to generate Abstract Syntax Tree from java source code
Pls post here .
Thanks in Advance
There are several ways to do that:
and descend manually.
Iterable<? extends CompilationUnitTree> treeList = javacTaskImpl.parse()
class MyTreeScanner extends TreeScanner<Void, Void>
and override the visit* Methods.
CompilationUnitTree.accept(new MyTreeScanner(), null);
3. Use Eclpse AST parser. I not tried that yet. There has to be some in JDT, because several Plugins use AST.
Edited by: 804562 on 22.10.2010 15:20