<p>Could you provide an example of accessing the Eclipse Abstract Syntax Tree programmatically for a given piece of code?</p>

<p>eg getting the AST for:</p>

<hr>

<h2>Class1.java</h2>

<pre><code>package parseable;

public class Class1 {

/**
 * @param args
 */
public static void main(String[] args) {
    System.out.println("Hello world!");
}
</code></pre>

<p>}</p>

It is not an
exact
answer, that may give you a place where to start:
As said in this
question
,
A full example is available in this
eclipse corner article
, also more details in the
eclipse help
. And in the slide 59 of
this presentation
, you see how to apply a change to your source code.