Professional Documents
Culture Documents
(x+y)*(y+z)+(x+y+z) (3)
int i, j;
return i>j?i:j;
} (2)
(2)
S
Q5. Write short notes on:
(a) Optimization of basic block (3)
(b) Semantic errors and its recovery (3)
Section B : Attempt any two questions out of three. Each question carries 10marks. [20 Marks]
Q6. (a) What is bootstrapping and how it is done on more than one machine? Describe various compiler writing
tools? (4)
(b) Explain the difference between the One-buffer scheme and the Two-buffer scheme? (2)
(c) Show the following grammar is ambiguous.
S (4)
(6)
(4)
Q8. (a) What is meant by ambiguous grammar? How ambiguity is avoided? (3)
(b) Discuss the following parameter passing techniques with suitable examples:
(i) Call by value
(ii) Call by reference
(c) Construct the SLR(1) parsing table for the following grammar:
S AA
A aA | b (4)
Section - C : Compulsory question [16 Marks]
Q9. (a) Construct LALR parsing table for the following grammar:
Parse the input string bdc using the table generated by you. (6)
(6)
(c) What are the criteria for achieving machine-dependent optimization and machine-independent
optimization? (4)
********