GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER- VIII EXAMINATION — SUMMER 2020
--- Content provided by FirstRanker.com ---
Subject Code: 2170701 Date:26/10/2020Subject Name: COMPILER DESIGN
Time: 10:30 AM TO 01:00 PM Total Marks: 70
Instructions:
- Attempt all questions.
- Make suitable assumptions wherever necessary.
- Figures to the right indicate full marks.
--- Content provided by FirstRanker.com ---
MARKS
Q.1 (a) Write a brief note on input buffering techniques. 03
(b) Explain with suitable example what is bootstrapping? 04
--- Content provided by FirstRanker.com ---
(c) Explain different phases of compiler. 07Q.2 (a) Explain panic mode recovery strategy. 03
(b) Check whether the following grammar is ambiguous or not. 04
S -> (S)S
S -> e
--- Content provided by FirstRanker.com ---
(c) Construct a DFA for a given regular expression (010+00)*(10)* 07OR
(c) Construct DFA accepting the strings of binary digits which are even numbers. 07
Q.3 (a) Define the following terms: 03
1) Handle 2) Handle pruning 3) Left Factoring
--- Content provided by FirstRanker.com ---
(b) Explain shift reduce parsing technique in brief. 04(c) Construct an LL(1) parsing table for the following grammar: 07
S -> aBDh
B -> cC
C -> bC|e
--- Content provided by FirstRanker.com ---
D -> EFE -> g|e
F -> f|e
OR
Q.3 (a) What is a symbol table? Discuss any two data structures suitable for it. 03
--- Content provided by FirstRanker.com ---
(b) Eliminate left recursion from following grammar. 04S -> Aa|b
A -> Ac|Sd|f
(c) Construct an SLR Parsing table for the following grammar. 07
E -> E+T|T
--- Content provided by FirstRanker.com ---
T -> T*F|FF -> (E)
F -> id
Q.4 (a) Explain Control Stack. 03
--- Content provided by FirstRanker.com ---
(b) What do you mean by dangling references? 04(c) Translate the expression - (a + b) * (c + d) + (a +b +c) into 07
1. Quadruples
2. Triples
3. Indirect triples.
--- Content provided by FirstRanker.com ---
ORQ.4 (a) Translate the arithmetic expression a * - (b + c) into 03
1. Syntax Tree
2. Postfix Notation
3. Three Address code
--- Content provided by FirstRanker.com ---
(b) Write three address code for 04a := a + a * b + a * b * c - a * b + a * b
(c) What is the use of a symbol table? How the identifiers are stored in the symbol table? 07
Q.5 (a) Explain parameter passing techniques for procedure. 03
(b) List the different conflicts that occur in Bottom up parsing and give examples for that. 04
--- Content provided by FirstRanker.com ---
(c) Explain various code optimization techniques. 07OR
Q.5 (a) Draw a DAG for expression: a + a * (b - c) + (b - c) * d. 03
(b) Compare inherited attributes vs. synthesized attributes. 04
(c) Write the generic issues in the design of code generators. 07
--- Content provided by FirstRanker.com ---
This download link is referred from the post: GTU BE 2020 Summer Question Papers || Gujarat Technological University
--- Content provided by FirstRanker.com ---