MUST KNOW Flashcards
(13 cards)
A.0
0
A.1
A
A.A
A
A.(not A)
0
A+0
A
A+1
1
A+A
A
A+(not A)
1
5 stages of compilation
- Lexical analysis
- Syntax analysis
- Semantic analysis
- Code generation
5 code optimisation
What happens in lexical analysis
Comments and spaces are removed
Constants keywords and identifiers are replaced by tokens
A symbol table is created containing the addresses of all variables labels and subroutines
What happens in syntax analysis
Tokens are checked against the assemblers rules of syntax
Parsing happens
What is parsing
Systematically breaking down tokens into their component parts to see if they use the correct syntax
What happens in semantic analysis
Variables are checked to ensure they are off the correct data type and they have been properly declared and used
Operations are checked h to ensure they are legal for the data type used