This page explains the ClosureCompiler AST, the JSDT core DOM AST and its Bindings to the Eclipse IDE, including
- History of JSDT parsing from 1.0 to 2.0
- Parsing with Closure Compiler and generation of its AST: the ParseTree
- Conversion of the AST from the CC ParseTree to the jsdt.core.dom.AST (aka DOM Model) .
- Binding of the DOM model, to provide outline, content assist, indexing, etc.
See also: JSDT/Architecture.
JSDT parsing from 1.0 to 2.0
Starting from Eclipse Oxygen, JSDT 2.0 uses Closure Compiler for parsing. After parsing, a converter transforms the CC's ParseTree into the jsdt.core.dom.AST. Then, bindings are used to consume the DOM model to provide content assist, code completion, etc.
In the past, we changed parser/compiler toolchain twice:
Anyway, most of the documentation is in the code, and we suggest you take a look at the followings:
- Closure Compiler source on GitHub: https://github.com/google/closure-compiler
- Adding closure compiler for JSDT parsing: https://git.eclipse.org/r/#/c/92404/
This part is about the bindings needed to show the model in the outline, to provide content assist, indexing etc.
- to create outline, look at this class/references
- to provide content assist, look at these class/references:
- to understand how indexing works, look at these references.
See commit https://git.eclipse.org/r/#/c/57504/ (M.Istria) to see the new outline