Gujarat Technological UniversityWinter 2023 examination

GTU 3170701 Compiler Design (CD) Winter 2023 Question Paper & PDF

B.E. · Computer Engineering · Semester 7 · Subject code 3170701
Download official PDFView PDF here
Share with your class
Total
70 marks
To pass
23 marks (33%)
Duration
2.5 Hours 10:30 AM – 1:00 PM
Questions
5 with internal choice
No solutions on this paper yetNeed them for your exam? Ask once. Papers that students ask for are solved first, and we aim to add them within 24 hours.

14 of 25 questions on this paper were also asked in other years. 2 more are types of question GTU sets again with new data. Each is marked below with the years it appeared.See all 39 repeated 3170701 questions, most asked first

Q.1

14 Marks
(a)
3 marks

Explain the role of linker, loader and preprocessor in the process of compilation.

(b)
4 marks

Define lexeme, token and pattern. Identify the tokens from the following program segment void change (int c, int d) { int m; m = c; c= d; d = m; }

(c)
7 marksAsked in 5 of 7 papers
Explain the phases of compiler with an example.

Also asked in Winter 2025 Q1c, Summer 2025 Q1c, Winter 2024 Q1c, Summer 2023 Q1c

Q.2

14 Marks
(a)
3 marksSame type asked in 4 of 7 papers

Find the Regular Expression corresponding to given statement subset of {0,1}*

1)The Language of all strings containing exactly three 1’s
2)The Language of all strings begins or ends with 00
3)The Language of all strings that contain at least three 1’s

Also asked in Summer 2026 Q2b, Summer 2025 Q2b, Summer 2023 Q1b

(b)
4 marksAsked in 4 of 7 papers
What is Left Recursion? Give an example for eliminating the same

Also asked in Summer 2026 Q1b, Winter 2024 Q2b, Summer 2024 Q3b OR

(c)
7 marksSame type asked in 5 of 7 papers

Draw DFA for the following regular expression without construction of NFA. ( a | b) * a (a | b)#

Also asked in Winter 2025 Q2c OR, Winter 2024 Q2c OR, Summer 2024 Q2c, Summer 2023 Q2c

(c)
7 marksAsked in 3 of 7 papers
Explain recursive-descent parsing with suitable example.

Also asked in Winter 2025 Q2c, Summer 2024 Q4c

Q.3

14 Marks
(a)
3 marksAsked in 4 of 7 papers

Explain the stack implementation of shift reduce parser with the help of example.

Also asked in Summer 2026 Q3b, Summer 2024 Q4c OR, Summer 2023 Q3a OR

(b)
4 marksAsked in 3 of 7 papers
What is inherited attribute? Explain with suitable example.

Also asked in Summer 2026 Q4a, Summer 2025 Q3b

(c)
7 marksAsked in 2 of 7 papers
Check the following grammar is SLR(1) or not
S → Aa | bAc | Bc | bBa
A → d
B → d

Also asked in Summer 2023 Q3c

(a)
3 marks
Define the following terms:
1)LL(1) Grammar
2)Ambiguous Grammar
3)Operator Grammar
(b)
4 marks
Find out FIRST & FOLLOW set for all the Nonterminals
S-> 1AB | ϵ
A-> 1AC | 0C
B-> 0S
C->
(c)
7 marksAsked in 3 of 7 papers

Write a syntax directed definition for desk calculator. Using this definition draw annotated parse tree for 6*3+5n

Also asked in Summer 2026 Q4c OR, Summer 2025 Q4c OR

Q.4

14 Marks
(a)
3 marksAsked in 6 of 7 papers
Explain Activation Record

Also asked in Summer 2026 Q4a OR, Winter 2025 Q4b OR, Winter 2024 Q5b OR, Summer 2024 Q5a, Summer 2023 Q4a

(b)
4 marks
Explain panic mode and phrase level error recovery techniques.
(c)
7 marksAsked in 4 of 7 papers
Explain quadruple, triple and indirect triple with suitable example.

Also asked in Summer 2026 Q4c, Summer 2025 Q4c, Winter 2024 Q4c OR

(a)
3 marksAsked in 3 of 7 papers
Explain flow graph with suitable example.

Also asked in Winter 2025 Q5a OR, Winter 2024 Q4a

(b)
4 marks
Explain dynamic storage allocation techniques.
(c)
7 marks

Explain syntax directed definition to produce three address codes for flow of control statements with suitable example.

Q.5

14 Marks
(a)
3 marks
Draw the parse tree and derive the left most derivation using the following
grammar for the input string: (a + a) * (a * a).
E → E + T | T
T → T * F | F
F → ( E ) | a
(b)
4 marksAsked in 2 of 7 papers
Write down the algorithm for partitioning of basic blocks.

Also asked in Summer 2025 Q3b OR

(c)
7 marksAsked in 4 of 7 papers
Explain any four code optimization techniques with suitable example.

Also asked in Winter 2024 Q5c OR, Summer 2024 Q5c, Summer 2023 Q5c

(a)
3 marksAsked in 3 of 7 papers
Explain code scheduling constraints.

Also asked in Winter 2025 Q5b OR, Summer 2024 Q5b OR

(b)
4 marks
Write short note on LEX.
(c)
7 marksAsked in 5 of 7 papers
Explain the generic issues in the design of code generators.

Also asked in Summer 2026 Q5c, Winter 2025 Q5c, Summer 2024 Q5c OR, Summer 2023 Q5c OR

More Compiler Design papers

Questions repeat across sessions. Working through two or three papers shows you which topics GTU asks most.

Preparing with friends?

Send this paper to your class group. Every question has its own link.

About this paper

Official Gujarat Technological University (GTU) examination paper for Compiler Design (CD) (Winter 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.

ViewDownload PDF