Utilisateur
- Lexical Analysis
- Syntax Analysis
- Code Generation
- Optimisation
The lexer converts lexemes(words) in the source code into tokens. It scans letter by letter & any irrelevant elements e.g. white spaces, comments are removed
Tokens are then analysed according to the grammar of the programming language to build a syntax tree (parse tree). Syntax errors are detected in this stage
Traverses through the syntax tree to generate object code that can be executed by the computer
It aims to reduce the execution time of the program
- Spotting and removing redundant code
- Removing subroutines that have never been called
- Removing variables and constants that have never been referenced
- Only creates one table
- Doesn't store duplicate entries
- Uses indexing instead of hashing