Important Questions of Compiler Design

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Important Questions of Compiler Design

1. What is Compiler? Explain in detail the various phases of compiler with an example.
2. What is Cross Compiler? Give an Example
3. Write an Algorithm to construct Operator precedence parsing Table.
4. How is stack storage allocation strategy different from heap allocation strategy?
Describe them & mentioning their merits & demerits.
5. Explain Various Code Optimization techniques in details with example.
6. Construct Predictive Parser for following Grammar.
E E+T / T
T T*F / F
F (E) / id
7. Construct SLR Parsing Table for following Grammar
S CC
C cC /d
8. Write Three Address Code for following code:
if a < b then
while c > d do
x=x–y
else
do
p=p+q
while (e < = f)
9. Write Three Address Code for following code:
If [ (a < b) and ((c > d) or (a > d) ) ] then
z=x+y*z;
else
z = z + 1;
10. Construct a DAG for the following basic block & optimize it.
S1 = 4 x I
S2 = addr(A) – 4
S3 = S2[S1]
S4 = 4 x I
S5 = addr(B) – 4
S6 = S5[S4]
S7 = S3 x S6
S8 = PROD + S7
PROD = S8
S9 = I + 1
I = S9
If I <= 20 goto 1

You might also like