1.2.2 (e) – Applications Generation – Stages of compilation

(1) Lexical Analysis

  1. All comments and white space is removed.
  2. Code is turned into tokens.
  3. Symbol table created.

(2) Syntactic Analysis

  1. Checks syntax.
  2. Syntax tree is created using the symbol tree.

(3) Code Generation

  1. Syntax tree is converted into object code.

(4) Code Optimisation

  1. Removes unneeded code to make sure it runs as fast as possible, such as unused functions or variables.