Table of contents

  1. Introduction


A compiler takes a program as input and produces an executable (e.g. assembly code code or bytecode).

A compiler generally has five phases:

  1. Lexical analysis
  2. Parsing
  3. Semantic analysis (e.g. types and scope rules)
  4. Optimization
  5. Code generation (translation)

These notes cover the five phases.