You are on page 1of 2



Session: 2015-2016

Course: B.Tech
Branch: IT
Subject Name: Compiler Design

Year & Semester: III & VI

Section: I, J
Subject Code: NCS-603

Note: Attempt all questions:

1. Differentiate between Syntax- directed definitions and Translation schemes, with the help of an
2. What are synthesized and inherited attributes?
3. Write SDD for construction of syntax trees for arithmetic expressions.
4. Write quadruples, triples and indirected triples for the expression:
-(a b) * (c + d) (a+ b+ c)
5. Translate the following program into quadruples:
While A < c and B < D do
if A = 1 then C: = C+1
else while A <=D do A := A +2
6. How bottom up evaluation of S-attributed definitions is performed, illustrate with an example.
7. Write short notes on
Annotated parse tree
Lattributed definitions
Postfix notation
Quadruples, triples and indirect triples
Three address code and types of three address statements
Syntax trees
8. Let synthesized attribute val give the value of the binary number generated by S in the following
grammar. For example, on input 101.101 S.val = 5.625
S L.L| L
L LB | B
B 0 |1
Give SDTS to determine S.val
9. What are the benefits of using a machine independent intermediate form?
10. Give syntax directed translation into three address code for the following:
Assignment statements for arithmetic expressions
Boolean expressions ( flow of control)
Procedure calls


Array references in arithmetic expressions

Case statements

11. Compare between the different methods for implementation of the three address codes.
12. Translate the following into three address code
A[I, J] = B[I, J] + C[A[K, L]] + D[I+J]
Assume bpw = 4.
13. What are the various storage management techniques available? What are their importance in
compiler design.
14. What are the various types of errors that may appear in compilation process? Explain the
function of Error Handling phase of a compiler.
15. Discuss the following parameter passing techniques with suitable example.
(a) Call by value
(b) Call by reference
(c) Call by name
16. For the construct a > b or c > d and e > f
The annotated parse tree
Three address code
(iii) Stack implementation
17. Construct three address code A = -B * (C + D). also generate its quadruple representation
18. In C the for statement has the following form
For (e1; e2; e3) stmt
Construct a SDTS to translate into three address code
19. Discuss Error Detection and Recovery in
LR parsers
LL(1) Parsers
(iii) OP Parsers
20. Discuss different methods of error detection (e.g. panic mode etc.)
21. Discuss the data structures used for symbol table management.
22. Explain the procedure for dynamic storage allocation.