SPPU Computer Engineering (Semester 7)
Principles of Modern Compiler Design
May 2017
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 from Q.1(a,b) & Q.2(a,b)
1(a) Write down the regular expression for the following
i) Comment in C.
ii) Floating point number.
4 M
1(b) Write a Syntax directed translation scheme for Boolean Expression.
6 M

2(a) Consider the statement:
The maximum dimensions of X are [d1, d2] and of Y are [d3, d4]. Generate three address code.
4 M
2(b) What are synthesized and inherited attributes? What are Marker Non terminal symbols? Give example.
6 M

Solve any one question from Q.3(a,b) & Q.4(a,b)
3(a) Write a short note on I/P buffering used in Lexical Analyzer.
4 M
3(b) Check whether the following grammar LL(1) or not.
6 M

4(a) What is need of Scemantic Analysis? Explain the position of Type Checker with diagram.
4 M
4(b) Show that the following grammar is not SLR (1)
S→Aa Ab|B b Ba
6 M

Solve any one question from Q.5(a,b,c) & Q.6(a,b,c)
5(a) Write a note on application of Directed Acyclic Graph (DAG) in code generation.
6 M
5(b) Write an algorithm for copy propogation.
6 M
5(c) Write a short note on Data flow equations and iterative data flow analysis.
6 M

6(a) Describe in detail about a simple code generator with the appropriate algortihm.
6 M
6(b) Discuss about the following:
i) Dead-code Elimination and
ii) Code motion.
6 M
6(c) Show the steps involved on generating the code for the expression: (x+y)/(p+q)
6 M

Solve any one question from Q.7(a,b,c) & Q.8(a,b,c)
7(a) Discuss source language issues related to Object Oriented languages.
6 M
7(b) Explain code generation for corntrol flow statements.
6 M
7(c) Explain Polymorphic typing with respect to Functional languages.
4 M

8(a) Explain following related to Haskell program.
i) Offside rule.
ii) Lists.
6 M
8(b) Explain following with respect to Functional languages.
Referential transparency.
ii) Lazy evaluation.
6 M
8(c) What is activation record? Explain possible structure of an activation record?
4 M

Solve any one question from Q.9(a,b,c) & Q.10(a,b,c)
9(a) Discuss the issues in Tuple Space implementation.
6 M
9(b) Write short notes on
i) JIT
ii) nmake
6 M
9(c) Explain following shared variable models.
i) Locks
4 M

10(a) Explain cross compilation using XMLVM.
6 M
10(b) Discuss following with respect to Parallel object oriented languages.
i) Object location
ii) Object migration
6 M
10(c) What is interpreter? Explain JVM interpreter.
4 M

More question papers from Principles of Modern Compiler Design