Link Details

Link 75268 thumbnail
User 111696 avatar

By bloid
via today.java.net
Published: Apr 11 2008 / 13:43

Have you ever thought of how tools like Checkstyle or FindBugs perform a static code analysis, or how Integrated Development Environments (IDEs) like NetBeans or Eclipse execute quick code fixes or find the exact references of a field declared in your code? In many cases, IDEs have their own APIs to parse the source code and generate a standard tree structure, called an Abstract Syntax Tree (AST) or "parse tree," which can be used for deeper analysis of the source elements. The good news is that it is now possible to accomplish the said tasks plus a lot more with the help of three new APIs introduced in Java as part of the Java Standard Edition 6 release. The APIs that might be of interest to developers of Java applications that need to perform source code analysis are the Java Compiler API (JSR 199), the Pluggable Annotation Processing API (JSR 269), and the Compiler Tree API.
  • 16
  • 0
  • 1646
  • 438

Comments

Add your comment
User 254930 avatar

dzonereader replied ago:

1 votes Vote down Vote up Reply

It is only good for visiting parse trees, JDT still rocks when you want to manipulate AST.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.