# Download GTU B.Tech 2020 Summer 8th Sem 2170701 Compiler Design Question Paper

Download GTU (Gujarat Technological University Ahmedabad) B.Tech/BE (Bachelor of Technology/ Bachelor of Engineering) 2020 Summer 8th Sem 2170701 Compiler Design Previous Question Paper

Seat No.: ________
Enrolment No.___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER? VIII EXAMINATION ? SUMMER 2020
Subject Code: 2170701 Date:26/10/2020
Subject Name: COMPILER DESIGN
Time: 10:30 AM TO 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.

2. Make suitable assumptions wherever necessary.

3. Figures to the right indicate full marks.

MARKS
Q.1
(a) Write a brief note on input buffering techniques.
03

(b) Explain with suitable example what is bootstrapping?
04

(c) Explain different phases of compiler.
07

Q.2
(a) Explain panic mode recovery strategy.
03

(b) Check whether the following grammar is ambiguous or not.
04
S (S) S
S

(c) Construct a DFA for a given regular expression (010+00)*(10)*
07

OR

(c) Construct DFA accepting the strings of binary digits which are even
07
numbers.
Q.3
(a) Define the following terms:
03
1) Handle 2) Handle pruning 3) Left Factoring

(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|
D EF
E g |
F f |

OR

Q.3
(a) What is a symbol table? Discuss any two data structures suitable for
03
it.

(b) Eliminate left recursion from following grammar.
04
S Aa | b
A Ac | Sd | f

(c) Construct an SLR Parsing table for the following grammar.
07
E E + T|T
T T * F|F
F (E)
F id

P.T.O

1

Q.4
(a) Explain Control Stack.
03

(b) What do you mean by dangling references?
04

(c) Translate the expression ? (a + b) * (c + d) + (a +b +c) into
07
2. Triples
3. Indirect triples.

OR

Q.4
(a) Translate the arithmetic expression a * - (b + c) into
03
1. Syntax Tree
2. Postfix Notation

(b) Write three address code for
04
a := 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
07
the symbol table?
Q.5
(a) Explain parameter passing techniques for procedure.
03

(b) List the different conflicts that occur in Bottom up parsing and give
04
examples for that.

(c) Explain various code optimization techniques.
07

OR
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

*************
2