











































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concepts of intermediate code and data structures in the context of code generation. It covers three-address code, P-code, and their respective implementations. The document also explains the process of translating P-code into three-address code and vice versa. Additionally, it touches upon the generation of code for address calculations and control statements.
Typology: Summaries
1 / 83
This page cannot be seen from the preview
Don't miss anything!












































































8.2 Basic Code Generation Techniques
8.2.1 Intermediate Code or Target Code as a Synthesized Attribute
8.2.3 Generation of Target Code from Intermediate Code
< -- top of stack 3 X Address of x T1=x+ < -- top of stack T Addrss of x
X=t < -- top of stack T < -- top of stack 4 T T2=t1+ < -- top of stack T
If we want to eliminate the extra temporaries, then a more sophisticated scheme than pure macro expansion must be used. T2 + X, t1 + 4 X 3
8.3 Code Generation of Data Structure References
8.3.1 Address Calculations