Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Creating AST from source code in java

843810Feb 12 2010 — edited Oct 22 2010
Hi,

Anyone know how to use the new Java Compiler API (or Tree API) to generate a AST from source-code that I can walk and i count no of IF or FOR in given java source file.

i have found threads relating to this but i need more information as i need to count no of IF statements in file.


Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 19 2010
Added on Feb 12 2010
3 comments
2,936 views