Professional Documents
Culture Documents
[COMPILER CONSTRUCTION]
[KAMPALA UNIVERSITY]
[BSCIT]
COMPILER
CONSTRUCTION
1st LECTURE
LECTURE PROGRAMS
22rd /09/2022 29th /09/ 2022 06th /10/2022 13th /10/2022 20th /10/2022 27th /10/2022
3rd /NOV/2022 10th /NOV/ 2022 17th /NOV/2022 24th /NOV/2022 1st /DEC/2022 8th /DEC2022
An example: a[index]=4+2
• An example: a[index]=4+2
– Constant folding performed directly on annotated tree.
Assign-expression
subscript-expression additive-expression
integer integer
t = 4 + 2
a[index]=t
t= 6
a[index]=t
a[index]=6
Code generation phase
(The Code Generate)
• An example: a[index]=4+2
– Code sequence in a hypothetical assembly
language
A possible code sequence
END