Stages of comilation Flashcards
1
Q
What are the 4 stages of compilation?
A
- Lexical analysis
- Syntax analysis
- Code generation
- Code optimisation
2
Q
What is lexical analysis?
A
- All white space removed
- Remaining code is turned into tokens
- Symbol table is created
3
Q
What is Syntax analysis?
A
- Syntax of program is checked against the rules
- Abstract syntax tree created
- If any code breaks the syntax rules errors generated
4
Q
What is code generation?
A
- Syntax tree converted into object code
5
Q
What is code optimisation?
A
- Code optimised to run as fast as possible
- Involves removing redundant code