SRM University, Katankulathur - 603203 Software Enginring
SRM University, Katankulathur - 603203 Software Enginring
SOFTWARE ENGINRING
Principles of Compiler Design Sub_code : CS0352
Class : VI SEM SWE
PART-A Answer all 10x2 = 20 marks Max :100 marks
11) (a) With a neat block diagram ,explain the various phases of a compiler in detail. Assuming
an expression,give the output of each phase. (16)
OR
(b) (i) Give a minimized DFA for the following expression (a|b)*abb. (10)
(ii) Draw the transition diagrams for an identifier and an unsigned number (6)
12) (a) (i) Give an algorithm for finding FIRST and FOLLOW positions for a given
nonterminal. (4)
(ii) Consider the grammar
E TE'
E' --> +TE' |
T --> FT'
T' --> *FT' |
F --> (E) | id
Construct a predictive parsing table for the grammar given.
Verify whether the input string id + id * id is accepted by the grammar or not. (12)
OR
13) (a) (i) Explain about different types of three address statements. (8)
(ii) What are the methods of translating boolean expressions. Give an example (8)
OR
(b) (i) What is backpatching? Explain with an example. (8)
Explain procedure calls with an example. (8)
14) (a) (i) Construct a DAG for the following basic block (6)
d := b*c
e := a + b
b := b*c
a:= e - d
(ii) Explain in detail about primary structure preserving transformations
on basic blocks. (10)
(OR)
(b) (i)Explain in detail about a simple code generator with the appropriate algorithm (8)
(ii)Explain in detail about run-time storage management (8)
(OR)
(b) (i) Explain in detail storage allocation strategies (10)
(ii)Write short notes on parameter passing (6)
--------------------------------------------------------------------------------------------------