Gujarat Technological UniversitySummer 2023 Examination

GTU 3170701 Compiler Design (CD) Summer 2023 Paper Solution & PDF

B.E. · Computer Engineering · Semester 7 · Subject Code: 3170701
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 lexemes, patterns and tokens
3 Marks
(b)
Write a regular definition for:
1The language of all strings containing at least one 0 and at least one 1.
2The language of all strings that do not end with 01.
3The language of all strings containing 0’s and 1’s both are even.
4The language of all strings which are starting with 1 and ending with 0.
4 Marks
(c)
Explain phases of compilers with suitable example.
7 Marks

Question 2

14 MarksMedium
(a)
Differentiate ambiguous and unambiguous grammar.
3 Marks
(b)
Write a short note on input buffering techniques.
4 Marks
(c)

Construct a DFA for a given regular expression using syntax tree with firstpos, lastpos and followpos function. (a|b)*a

7 Marks
OR OPTION
(c)

Construct the NFA for following regular expression using Thompson’s construction. Apply subset construction method to convert into DFA. (a+b)*abb#

7 Marks

Question 3

14 MarksMedium
(a)
Give the translation scheme that convert infix to postfix notation.
3 Marks
(b)
Define: Left Recursive Grammar. Check Following grammar is left
recursive or not, if yes, remove left recursive from it.
A → ABd / Aa / a
B → Be / b
4 Marks
(c)
Construct an SLR Parsing table for the following grammar.
S → Aa | bAc | bBa
A → d
B → d
7 Marks
OR OPTION
(a)
Explain shift reduce parsing technique in brief.
3 Marks
(b)
Differentiate top down parsing and bottom up parsing.
4 Marks
(c)
Show that the following grammar
S → AaAb | BbBa
A → ϵ
B → ϵ
is LL(1) but not SLR(1).
7 Marks

Question 4

14 MarksMedium
(a)
Write a short note on activation record.
3 Marks
(b)
Explain Symbol table management in brief.
4 Marks
(c)
List and explain various storage allocation strategies.
7 Marks
OR OPTION
(a)
What do you mean by dangling references?
3 Marks
(b)
Explain Error Recovery Strategies in Compiler in brief.
4 Marks
(c)

Write three address code for a = b*-c + b*-c

7 Marks

Question 5

14 MarksMedium
(a)

Translate the arithmetic expression (a + b) * (c + d) into

1Syntax tree
2Postfix notation
3 Marks
(b)
Compare: Static v/s Dynamic Memory Allocation
4 Marks
(c)
Explain various code optimization techniques.
7 Marks
OR OPTION
(a)
Construct a DAG for the following expression:

a = b*-c + b*-c

3 Marks
(b)
Explain various parameter passing methods.
4 Marks
(c)
Explain various issues in design of 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) (Summer 2023, 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