01: Structure of a Compiler

1. Lexical Analysis

Divides program text into “words” or “tokens”.

2. Parsing

Understands the structure of the program.

3. Semantic analysis

Compilers perform limited semantic analysis to catch inconsistencies.

4. Optimization

Automatically modify programs so that they run faster and use less memory (or power, network, database and etc.).

5. Code Gen

A translation into another language.