Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java library for code analysis

Is there any Java library, that can help in building AST from the specified java source file and vice versa (generate code from the ASTree object)? I need something like this, but with an API, allowing to access the generated tree programmatically.

like image 486
George Avatar asked Oct 14 '22 05:10

George


1 Answers

Everything's already available within the Eclipse core. Here's a page with a small example of how to use org.eclipse.jdt.core.dom.ASTParser to create your desired AST datastructure.

like image 192
Frank Avatar answered Oct 18 '22 23:10

Frank