Skip to content

Vol 11: Compilers and Formal Languages ​

This volume turns source text into tokens, syntax trees, IR, and machine code while preserving meaning. Every pass needs preconditions and a verifier; otherwise optimization merely produces the wrong answer faster.

Prerequisites ​

  • Be able to write functions and recursive code and use stacks, trees, and graphs. Volume 1 and Volume 2 cover these foundations.
  • Sets, relations, and basic proofs from Math A help with the theory. Target code and ABI lessons also use the machine model from Volume 3.

Coverage ​

Chapters 1–4 move from grammars and automata to computability and complexity. Chapters 5–8 follow compilation through scanning, parsing, names and types, intermediate representations, optimization, and code generation.

Chapter 1 ​

Chapter 2 ​

Chapter 3 ​

Chapter 4 ​

Chapter 5 ​

Chapter 6 ​

Chapter 7 ​

Chapter 8 ​

Outcomes ​

  • Define a grammar and recognizer for a small language, distinguishing regular, context-free, and decidable problems.
  • Trace source positions, scopes, and types from a character stream into an AST and IR.
  • Explain why an optimization preserves program meaning and how the target ABI and register constraints affect generated code.

How to use this map ​

For the theory, start at Chapter 1 and read in order. To build a small language, you can begin with the scanner and expression parser in Chapters 5–6, then revisit the theory they use. Keep inputs, outputs, and error locations visible at each stage. Use a correct, simple implementation as a reference, then check the optimized version against it.

Built with VitePress | Software Systems Atlas