Compilers
Notes on compiler construction
Notes on compiler construction, based on Carson Gross's lectures building a compiler for CatScript. These chapters cover language design, lexical analysis, regular expressions, parsing, and a full tour of the compiler pipeline.
- CatScript Overview A small statically-typed programming language
- Tokenization Turning source code into tokens
- Regular Expressions A primer on regex for compiler construction
- Parse Trees and Context-Free Grammars From tokens to tree structures
- Parse Trees & Abstract Syntax Trees Visitor pattern, expression problem, and AST design
- Recursive Descent Parsing Turning a list of tokens into a parse tree
- Actual Parsing Left associativity, the loop trick, and unary expressions
- Parsing Expressions Primary expressions, list literals, ambiguity, and index expressions
- Parsing Statements Print, var, for, while, if, and assignment statements
- CatScript Compiler - A Tour Based on Crafting Interpreters and work by Carson Gross