lexical scanner
The first compiler phase, which reads source text character by character and groups it into tokens such as keywords, names and symbols.
In more detail
The course calls this phase the Scanner. Its tokens are handed to the parser, which builds the syntax tree. The scanner knows nothing about types; it only recognises the pieces of the language.
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.
- AST — A tree of objects that represents the structure of source code, built by the parser and used by every later compiler phase.
Taught in
- The Compiler Pipeline: tsc, AST And Code Emission — Production TypeScript