B.E-B.E Computer Engineering PRINCIPLES OF COMPILER DESIGN (Karunya University, Coimbatore-2012)
Saturday, 24 August 2013 01:47anudouglas
Karunya University
(Karunya Institute of Technology and Sciences)
(Declared as Deemed to be University under Sec.3 of the UGC Act, 1956)
End Semester Examination – November/ December - 2012
Subject Title: PRINCIPLES OF COMPILER DESIGN Time: 3 hours
Subject Code: 09CS214 Maximum Marks: 100
Answer ALL questions
PART – A (10 x 1 = 10 MARKS)1. Define Compiler.
2. List any two cousins of a Compiler.
3. “baan” is a subsequence of the string “banana”. (True/ False)?
4. Write the regular expression for a sequence of binary numbers.
5. The rightmost derivation is known as ____________.
6. When is a grammar said to be left recursive?
7. In a syntax directed definition if all attributes are synthesized, what is the name of the syntax directed definition?
8. List the various static checks.
9. Give an example for a dangling reference.
10. Define induction variables.
PART – B (5 x 3 = 15 MARKS)
11. Explain about Assembler with an example.
12. E à E + E | E * E |(E) | id. Write the leftmost derivation and rightmost derivation for the sentence (id*id)+id.
13. Write the algorithm to find the FIRST of nono-terminals.
14. What is an Activation record?
15. Draw the DAG for the statement a=(a*b+c)-(a*b+c).
PART – C (5 x 15 = 75 MARKS)
16. Describe the various phases of a compiler in detail. trace the output of each phase for the program segment, position = initial + rate *60, where rate is a real data type.
(OR)
17. Explain the Compiler construction tools.
18. Convert the regular expression (a|b)*abb into NFA. Then convert the respective NFA to DFA and minimize it.
(OR)
19. Write the algorithm to convert a regular expression to a DFA and explain this with an example.
20. Construct the predictive parsing table for the grammar and parse the statement:
not (true or false)
Productions:
EE or T | T
TT and F | F
Fnot F| (E) |true|false
(OR)
[P.T.O]
21. Write an algorithm to construct an SLR parsing table with all subroutines.
22. Translate a=b*-c+b*-c into three address statements, quadruples, triples and postfix form.
(OR)
23. Explain the concept of Type Systems in detail.
24. Explain about the various storage allocation strategies.
(OR)
25. Discuss with an example about the optimization of basic blocks.
Earning: ₹ 5.35/- |