RGPV Computer Science (Semester 7)
Compiler Design
December 2015
Total marks: --
Total time: --
INSTRUCTIONS
(1) Assume appropriate data and state your reasons
(2) Marks are given to the right of every question
(3) Draw neat diagrams wherever necessary


1(a) Write the advantage of multipass compiler over single pass compiler.
2 M
1(b) What is BOOT strapping?Also explain cross compiler.
2 M
1(c) What are the various components of a lexical specification file? Illustrate with an example.
3 M
Solve any one question from Q.1(d) & Q.1(e)
1(d) What is LEX? Describe auxiliary definitions and translation rules for LEX with suitable example.
7 M
1(e) Discuss the various phases of compiler with the help of neat labelled diagram.
7 M

2(a) What is syntax analysis? What are its primary functions?
2 M
2(b) How do you classify the different parsing technique?
2 M
2(c) How does an operator precedence parser work? Use a preconstructed operator precedence table to guide the parsing of an input 'a+b-20' using operator precedence parser.
3 M
Solve any one question from Q.2(d) & Q.2(e)
2(d) What is a translation scheme? How is it different from a syntax directed definition? Illustrate the order of execution of semantic actions in a translation scheme.
7 M
2(e) Describe the SLR(1) method of constructing the LR Parsing table from a given grammar. Illustrate with an example.
7 M

3(a) What is symbol table? How is it used in compilers?
2 M
3(b) What is an activation record? With the diagram show the important fields in an activation record
2 M
3(c) What are the procedure calling and returning sequences? Explain the sequence of actions in each of them.
3 M
Solve any one question from Q.3(d) & Q.3(e)
3(d) What is run time environment? What are the important elements of run time environment? How is it controlled in a program that is complied?
7 M
3(e) Explain various storage allocation strategies.
7 M

4(a) Describe the back patching technique.
2 M
4(b) Draw DAG for the given block:
a=b+c
b=a-d
c=b+c
d=a-d
2 M
4(c) Translate following expression to quadruple and triple -(X-Y)/(Z*c)-(X+Y-Z)
3 M
Solve any one question from Q.4(d) & Q.4(e)
4(d) Explain briefly
i)Peephole optimization
ii)Register allocation
iii)Three address code
7 M
4(e) Write down the three address code for the following switch statement:-
Switch(i+j)
(i+j)
{
case1:x:=y-z
case2:a:=b+c
case 3:i=j+k
}
7 M

5(a) What is loop optimization?
2 M
5(b) Explain any two data flow properties used by target code generator for producing efficient code.
2 M
5(c) What is an iterative approach ti solving the data flow equations? When do we need it? Give an example in context of computing available expression data flow property.
3 M
Solve any one question from Q.5(d) & Q.5(e)
5(d) What are induction variables? How does the strength reduction on induction variable help in improving loop optimization? Illustrate with an example.
7 M
5(e) What is global data flow analysis? What is its use in code optimization.
7 M



More question papers from Compiler Design
SPONSORED ADVERTISEMENTS