Gujarat Technological UniversityWinter 2025 Examination

GTU 2170701 Compiler Design (CD) Winter 2025 Paper Solution & PDF

B.E. · Computer Engineering · Semester 7 · Subject Code: 2170701
Download Official GTU PDF
Share:
Total Marks70 MarksExternal theory exam
Passing Marks23 Marks33% minimum cutoff
Exam Duration2.5 Hours10:30 AM – 1:00 PM
Paper Structure5 QuestionsWith internal OR choices
Jump toQ1Q2Q3Q4Q5

Question 1

14 MarksMedium
(a)
Define compiler, interpreter and assembler.
3 Marks
(b)
Explain error recovery strategies in brief.
4 Marks
(c)
Discuss phases of compiler in detail.
7 Marks

Question 2

14 MarksMedium
(a)

Write a regular expression to match a date in the format DD/MM/YYYY, allowing valid days 01–31 and months 01–12.

3 Marks
(b)
Explain the difference between NFA and DFA with example.
4 Marks
(c)
Explain subset construction method to construct DFA with example.
7 Marks
OR OPTION
(c)
Explain input buffering techniques in detail.
7 Marks

Question 3

14 MarksMedium
(a)
Explain S-Attributed Definitions and L-Attributed Definitions.
3 Marks
(b)
Find out FIRST and FOLLOW for the following grammar.
S-> 1AB | ε
A-> 1AC | 0C
B-> 0S
C->
4 Marks
(c)
Construct a SLR parsing table for following grammar.
S -> aAb | bB
A -> Aa | ϵ
B -> Bb |ϵ
7 Marks
OR OPTION
(a)
Give the difference between top down parsing and bottom up parsing.
3 Marks
(b)
Check the following grammar is operator or not. Justify your answer.
E -> EOE
E -> id
O -> * | + | -
4 Marks
(c)
Check whether the given grammar is LL (1) or not?
S -> aAC | bB
A -> Abc | Abd | e
B -> f | g
C -> h |i
7 Marks

Question 4

14 MarksMedium
(a)
Create syntax tree for the following:

(x+y)*(z-w)/(u+v)

3 Marks
(b)
Write a short note on activation records.
4 Marks
(c)

Describe Quadruples, Triples and Indirect Triples form of three address code with a suitable example.

7 Marks
OR OPTION
(a)
Create three address code for the following:

(a+b)*(c+d)+(a+b+c)

3 Marks
(b)
Write a short note on symbol table management.
4 Marks
(c)
Discuss various storage allocation strategies in detail.
7 Marks

Question 5

14 MarksMedium
(a)
Explain Flow Graph with suitable example.
3 Marks
(b)
Explain common sub expression removal technique with example.
4 Marks
(c)
Explain peephole optimization techniques with example.
7 Marks
OR OPTION
(a)
Explain DAG with suitable example.
3 Marks
(b)
Explain strength reduction technique with example.
4 Marks
(c)
Explain issues in the design of a code generator.
7 Marks
College Exam Groups

Studying for Compiler Design?

Circulate this solved paper with KaTeX formulas and 1-click AI step solvers to your batchmates on WhatsApp or Telegram.

About this Examination Paper & Attribution

Official Gujarat Technological University (GTU) examination paper and step-by-step solutions for Compiler Design (CD) (Winter 2025, B.E. · Computer Engineering, Sem 7). Features complete 70-mark regular & remedial examination pattern, official marking distribution across all 5 questions, and direct 1-click official PDF download.

Transcribed for student exam preparation from Gujarat Technological University official examination archives. Questions, syllabus guidelines, and curriculum marking schemes remain the intellectual property of Gujarat Technological University.

Download PDF