简体   繁体   English

用于代码分析的Java库

[英]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)? 是否有任何Java库可以帮助从指定的java源文件构建AST ,反之亦然(从ASTree对象生成代码)? I need something like this , but with an API, allowing to access the generated tree programmatically. 我需要像这样 ,但有一个API,允许以编程方式访问生成的树。

Everything's already available within the Eclipse core. Eclipse核心中已经提供了所有内容。 Here's a page with a small example of how to use org.eclipse.jdt.core.dom.ASTParser to create your desired AST datastructure. 这是一个页面,其中包含一个如何使用org.eclipse.jdt.core.dom.ASTParser创建所需AST数据结构的小示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM