Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Sathyabama: Register Number

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 3

Register Number

SATHYABAMA
INSTITUTE OF SCIENCE AND TECHNOLOGY
(Deemed to be University U/S 3 of UGC Act,1956)

Course & Branch :B.E/B.Tech - CSE/IT


Title of the Paper :Compiler Design Max. Marks :100
Sub. Code :SCS1303(2015) Time : 3 Hours
Date :26/05/2018 Session :AN
______________________________________________________________________________________________________________________

(NOTE: Assume relevant data, if found missing)


PART - A (10 x 2 = 20)
Answer ALL the Questions
1. Write the various properties of regular expression.
2. Explain about LEX tool.
3. Consider the grammar E - > E + E|E - E|E * E|(E)|a, check
whether the grammar is ambiguous or not.
4. Define Handle pruning.
5. Write a semantic action for declaration statements.
6. Define inherited translation.
7. Write the algorithm to convert three address statements in to
basic block.
8. Consider the following program fragment
for (i = 1; i < = 200; i + +)
{
a = 5;
b = 10;
c = a + b;}
Perform code motion
9. Consider the following statement
A = b + c, Produce assembly code.

10. What is dead code elimination?

PART - B (5 x 16 = 80)
Answer ALL the Questions

11. Convert the following regular expression in to a DFA


(a|b)*abb (a|b)*
(or)
12. Consider the following statement
a = b + c*60.0,
How the above statement executed by the compiler to produce
object code. Explain clearly the output of each and every phase of
the compiler.

13. Construct top down parsing table for the grammar


S - > (L) |a
L - > L, S|S
Parse the following string
(or)
14. Explain in detail about operator presence parsing algorithm with
the help of operator precedence function and OPRT.

15. Write the various semantic actions used for implementing


desktop calculator.
(or)
16. Give the postfix notation for the following.
(a) (a + b)*(c + d)
(b) if a then if c-d then a + c else a*c else a + b
(c) a/((b + c)*(d + e))
17. Explain in detail about various loop optimizations with neat
example.
(or)
18. Consider quick sort procedure. Convert the above procedure in to
an IC and then basic block.

19. Consider any three address statement. How three address


statements is converted in to an assembly code using code
generation algorithm with an example.
(or)
20. Discuss the various requirements, design issues and
implementation for designing your own compiler.

You might also like