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

Solve any one question fromQ.1(a,b),c and Q.2(a,b,c)
1(a) Discuss the action taken by every phase of compiler on following string A=B*C+D/E
6 M
1(b) For the following grammar:
S -> Aa | bAc | Bc | bBa
A -> d
i) Compute First & Follow set
ii) Construct LR (1) parsing table
8 M
1(c) Explain following terms with suitable examples (any 2)
i) S - Attributed Grammar
ii) L - Attributed Grammar
iii) Type Expression
6 M

2(a) Explain following strorage allocation schemes with proper examples:
i) Stack Storage Allocations
ii) Static Storage Allocation
iii) Heap Storage Allocation
6 M
2(b) Generate SLR parsing table for the given grammar and parse the string id1+ id2+ id3 * id4
E →E+T/T
T→T * F/F
8 M
2(c) What is mean by 'Syntax Directed Definitions'? Give syntax directed definition for any example arithmetic expression.
6 M

Solve any one question fromQ.3(a,b,c) and Q.4(a,b,c)
3(a) Explain following optimizations with examples:
i) Common sub expression elimination
ii) Strength reduction
iii) Code movement
iv) Variable propagation
8 M
3(b) Compare Quadruples and Triples. Generate indirect triples for following: a = b * c - d - e
6 M
3(c) What is Register Allocations and Assignment problem?
4 M

4(a) What is the code optimization? Differentiate among local, global and loop optimization.
6 M
4(b) What is DAG? Explain its use in code generation. Generate DAG for T1 = A + B
T2 = C +D
T3 = E - T2
T4 = T1 - T3
6 M
4(c) Explain with example:
i) Basic blocks and flow graph
ii) Peephole optimization
6 M

Solve any one question fromQ.5(a,b,c) and Q.6(a,b,c)
5(a) Write a note on importance of source language data representation.
6 M
5(b) Explain the row major and column major representation of arrays.
6 M
5(c) Explain type checking with respect to context handling.
4 M

6(a) Explain structure of a functional compiler. Discuss various issues related to compilation of functional languages.
6 M
6(b) Wriet short note on Java CC.
6 M
6(c) What is lazy evaluation in functional languages?
4 M

Solve any one question fromQ.7(a,b,c) and Q.8(a,b,c)
7(a) Write short note on Nvindia CUDA compiler.
6 M
7(b) What is interpreter? Explain JVM as an example of interpreter.
4 M
7(c) How tuple space can be implemented on distributed memory systems.
6 M

8(a) Explain following points for parallel Object Oriented languages: Object location, object migration, object replication
6 M
8(b) Write short notes:
i) Tuple spaces
ii) XML VM
iii) JIT
6 M
8(c) Discuss issues related tom parallel compiler. Explain with respect to NVCC.
4 M

More question papers from Principles of Modern Compiler Design