Gujarat Technological UniversitySummer 2026 examination

GTU 3170701 Compiler Design (CD) Summer 2026 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 2:30 PM – 5: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.

17 of 25 questions on this paper were also asked in other years. 3 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 marksAsked in 2 of 7 papers
List the cousins of compiler and explain cross-compiler.

Also asked in Summer 2024 Q1c

(b)
4 marksAsked in 4 of 7 papers
Explain Indirect Left Recursion with proper example.

Also asked in Winter 2024 Q2b, Summer 2024 Q3b OR, Winter 2023 Q2b

(c)
7 marks

Describe the role of the symbol table in relation to the six phases of a compiler.

Q.2

14 Marks
(a)
3 marksAsked in 4 of 7 papers
Explain input buffering methods.

Also asked in Winter 2024 Q1b, Summer 2024 Q1b, Summer 2023 Q2b

(b)
4 marksSame type asked in 4 of 7 papers
Write the regular expression R over {0,1} or {a,b}:
1)The set of all strings with even number of a’s followed by an odd number of b’s.
2)The set of all strings that consist of alternating 0’s and 1’s

Also asked in Summer 2025 Q2b, Winter 2023 Q2a, Summer 2023 Q1b

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

Draw NFA from regular expression using Thomson’s construction and convert it into DFA. (a | b)* a b b.

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

(c)
7 marksAsked in 2 of 7 papers
Implement the following grammar using Recursive Descent Parser.
S -> Aa | bAc | bBa
A -> d
B -> d

Also asked in Summer 2025 Q5c

Q.3

14 Marks
(a)
3 marksAsked in 4 of 7 papers
What is an ambiguous grammar?
Show that S → if E then S | if E then S else S | other is an ambiguous
grammar.

Also asked in Winter 2025 Q3b, Winter 2024 Q3b OR, Summer 2023 Q2a

(b)
4 marksAsked in 4 of 7 papers
Explain Shift-Reduce parser with proper example.

Also asked in Summer 2024 Q4c OR, Winter 2023 Q3a, Summer 2023 Q3a OR

(c)
7 marksSame type asked in 2 of 7 papers
Generate canonical parsing table for following augmented grammar.
S’->S
S->CC
C->Cc/d.

Also asked in Winter 2024 Q3c OR

(a)
3 marksAsked in 4 of 7 papers
Differentiate Top Down Parsing and Bottom up parsing.

Also asked in Summer 2025 Q5a OR, Winter 2024 Q3a, Summer 2023 Q3b OR

(b)
4 marks
Generate LR(0) Item set for
S → AA
A → aA | b
(c)
7 marksAsked in 2 of 7 papers
Explain rules to satisfy operator grammar. Generate precedence function table
for following grammar.
E -> ESE | id
S -> + | *

Also asked in Summer 2025 Q3c OR

Q.4

14 Marks
(a)
3 marksAsked in 3 of 7 papers
What is inherited attribute? Explain with suitable example.

Also asked in Summer 2025 Q3b, Winter 2023 Q3b

(b)
4 marksAsked in 6 of 7 papers
Explain error recovery strategies.

Also asked in Winter 2025 Q4c, Summer 2025 Q4b, Winter 2024 Q4c, Summer 2024 Q2b, Summer 2023 Q4b OR

(c)
7 marksAsked in 4 of 7 papers

Translate following arithmetic expression

  • ( a * b ) + ( c + d ) - ( a + b + c + d ) into
1Quadruples 2. Triple
3Indirect Triple

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

(a)
3 marksAsked in 6 of 7 papers
Write a short note on activation record.

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

(b)
4 marksAsked in 4 of 7 papers
Explain Peephole Optimization.

Also asked in Winter 2025 Q4a OR, Summer 2025 Q5c OR, Winter 2024 Q5c

(c)
7 marksAsked in 3 of 7 papers

Give syntax directed definition for simple desk calculator. Also show annotated parse tree for 6*5+7n.

Also asked in Summer 2025 Q4c OR, Winter 2023 Q3c OR

Q.5

14 Marks
(a)
3 marks

Explain copy propagation and dead code elimination with respect to loop optimization.

(b)
4 marks
Define a following:
1Basic block
2Constant folding
3Viable Prefix
(c)
7 marksAsked in 5 of 7 papers
Describe code generator design issues.

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

(a)
3 marksAsked in 3 of 7 papers
Compare: Static v/s Dynamic Memory Allocation

Also asked in Winter 2024 Q5a OR, Summer 2023 Q5b

(b)
4 marksAsked in 5 of 7 papers
Explain parameter passing techniques for procedure.

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

(c)
7 marks

What is DAG? What are its advantages in context of optimization? How does it help in eliminating common sub expression?

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) (Summer 2026, 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