Quick Summary -
LEXICAL ANALYSIS -
Comments / White space removed
Remaining code turned into a series of tokens
Symbol table is created to keep track of variables and subroutines
SYNTAX ANALYSIS -
Abstract syntax tree built from tokens produced in the previous stages
Errors generated if any tokens break the rules of the language
CODE GENERATION -
Abstract tree code -> Object Code
Object code is the machine code produced before the final step is run
CODE OPTIMISATION -
Tweaks the code so it will run quickly and use as little memory as possible
1ST PHASE LEXICAL ANALYSIS -
2ND PHASE SYNTAX ANALYSIS -
3RD AND 4TH PHASE CODE GENERATION / OPTIMISATION -