Java Source Code AST
Jump to navigation
Jump to search
A Java Source Code AST is a source code AST for Java code items (in a Java PL).
- Context:
- It can be generated by a Java Source Code AST Decoder.
- …
- Example(s):
- a Java 15 Eclipse AST.
- a Labeled Java AST, such as
https://code2seq.org
. - …
- Counter-Example(s):
- See: Java Parser, JavaParser.
References
2020
https://code2seq.org
- QUOTE: ...
Input: Java Source Code | Output: AST |
2019
- "JavaParser: Java Code Generation."
- QUOTE: ... In its simplest form, the JavaParser library allows you to interact with Java source code as a Java object representation in a Java environment. More formally, we refer to this object representation as an Abstract Syntax Tree (AST). Also, it has the ability to manipulate the underlying structure of the source code. This can then be written to a file, providing developers with the facility to build their own code generating software. ...
2017
- (Vogel at al., 2017) ⇒ Lars Vogel, Simon Scholz, and Fabian Pfaff. (2019). “Eclipse JDT - Abstract Syntax Tree (AST) and the Java Model." Tutorial.
- QUOTE: ... This tutorial ... also explains the Abstract Syntax Tree (AST) and the Java model in Eclipse. ...
The AST is a detailed tree representation of the Java source code. The AST defines an API to modify, create, read and delete source code. The main package for the AST is the
org.eclipse.jdt.core.dom
package and is located in theorg.eclipse.jdt.core plug-in
. Each Java source element is represented as a subclass of the ASTNode class. Each specific AST node provides specific information about the object it represents. …
- QUOTE: ... This tutorial ... also explains the Abstract Syntax Tree (AST) and the Java model in Eclipse. ...
2009
- https://dev.to/karataev/comment/amj6
- QUOTE: As far as I know, the only way to parse Java source-code into an AST (Abstract Syntax Tree) is to use the Java Compiler Tree API:
com.sun.source.tree
- I have two questions:
- What JDKs support com.sun.source.tree?
- Is there a portable replacement that works for all JDKs?
- I have two questions:
- QUOTE: As far as I know, the only way to parse Java source-code into an AST (Abstract Syntax Tree) is to use the Java Compiler Tree API: