Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Abstract Syntax Tree Programmatic Access

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

eg getting the AST for:


Class1.java

package parseable;

public class Class1 {

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

}

like image 362
hawkeye Avatar asked Sep 13 '26 20:09

hawkeye


1 Answers

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.

like image 56
VonC Avatar answered Sep 15 '26 09:09

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!