编程语言
首页 > 编程语言> > java-我可以将Eclipse JDT / AST用于其他编程语言吗?

java-我可以将Eclipse JDT / AST用于其他编程语言吗?

作者:互联网

我可以将AST / JDT用于其他语言吗?例如,为使用某种AST技术的C#编写自己的解析器?

解决方法:

如果您查看文章“ Eclipse JDT – Abstract Syntax Tree (AST) and the Java Model – Tutorial”,则JDT及其AST是为Java量身定制的.

The Eclipse Java Development Tools (JDT) provide APIs to access and manipulate Java source code.
The AST is a detailed tree representation of Java source code. The AST defines API to modify, create, read and delete source code.
The package for AST is org.eclipse.jdt.core.dom in the Eclipse org.eclipse.jdt.core plugin.

存在其他用于other languages的AST,并且可以使用XText来生成自己的AST

alt text http://www.eclipse.org/Xtext/images/screenshot-title.png

但是jdt包中的一个专门针对Java.
可以通过ASTView进行查看

另请参阅Exploring Eclipse’s ASTParser文章,作为日食AST操作的面向Java方面的另一个说明.

标签:eclipse-jdt,eclipse-plugin,java
来源: https://codeday.me/bug/20191107/2002152.html