Professional Documents
Culture Documents
(Recognized by UGC 2(f) & 12(B), An ISO 9001:2015 Certified Institution, Approved by AICTE New Delhi & Permanently Affiliated to JNTUA Anantapuranu)
UNIT-I
a) Show the sequence output of each phase of a compiler for the following code
5
5 segment: int x = 5, y = 10,z; z = x+ y*5; printf(“%d”, z); 5. 1 2
5
b) Write a LEX program for a C programming language. (Reg- 2018)
8 Explain about Input buffering scheme for scanning the source program 1 2 10
Construct SLR parsing table and transition diagram for the given grammar below:
E→ E+T
E→ T
7 T→ T*F 2 3 10
T→ F
F→ (E)
F→ id
Construct LALR parsing table for the given grammar below:
S→L=R
S→R
8 2 3 10
L→*R
L→ID
R→L
a) Construct SLR (or) LR(0) items and parsing table for the given Ambiguous
grammar below: 5
9 2 3
E→ E+E| E*E| (E)| id 5
b) Explain about Dangling-else ambiguity.
What is meant by Ambiguity? How do you eliminate the ambiguity in the grammar 5
10 2 2
using both left recursive and left factoring methods? Explain with examples. 5
UNIT-III
a) With the help of SDDs, discuss the generation of three address code for if-else
statements. 5
2 3 2
b) What do you mean by type checking? Discuss the method used for type 5
checking in a compiler. (Reg- 2019)
2 Describe about the access of non-local names in stack storage. (Reg- 2019) 4 2 10
a) Describe about symbol table organization for non block structured language. 5
3 b) Explain how to allocate stack space for function call statement execution. 4 2
5
(Supply- 2018)
Explain about all the Storage allocation strategies in run time storage
7 4 2 10
environment
What is an Ordered and Unordered symbol table? Which data structures are
8 4 2 10
used to implement a symbol table in an efficient way? Give reasons.
Explain about the directed acyclic graph representation of basic blocks and its use
2 5 2 10
with suitable examples. (Reg- 2019)
a) What is direct acyclic graph? Explain how this is useful for dataflow analysis.
5
5 b) Describe the following: 5 2
5
(i) Common sub expression. (ii) Induction variable elimination. (Reg- 2018)