AST
A tree of objects that represents the structure of source code, built by the parser and used by every later compiler phase.
In more detail
AST stands for abstract syntax tree. Each node is one piece of syntax, such as a function declaration whose children are its parameters and body. The checker walks this tree to apply type rules, and the emitter walks it to print JavaScript.
Related terms
- parser — A program or compiler phase that reads text and builds a structured form from it, such as a syntax tree or a typed object.
- compiler pipeline — The ordered stages the TypeScript compiler runs: scan and parse into a syntax tree, bind names, check types, then emit JavaScript.
- emitter — The last compiler phase, which writes the JavaScript output and optional declaration files from the checked syntax tree.
Taught in
- The Compiler Pipeline: tsc, AST And Code Emission — Production TypeScript