Gujarat Technological UniversitySummer 2025 examination

GTU 3170701 Compiler Design (CD) Summer 2025 Solved Paper & Solutions

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
25 step by step solutions on this page

16 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
Compare and contrast compilers and interpreters.

Also asked in Winter 2025 Q2a

(b)
4 marksAsked in 3 of 7 papers
Give the significance of left factoring and explain with an example.

Also asked in Winter 2025 Q2b, Winter 2024 Q3b

(c)
7 marksAsked in 5 of 7 papers

Explain phases of compiler in context of front end and back end with example. Give the significance of both.

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

Q.2

14 Marks
(a)
3 marks
Define following terms.
1)Lexeme
2)Handle pruning
3)Viable prefixes
(b)
4 marksSame type asked in 4 of 7 papers

Write regular expression over {a,b}

1The set of all strings which starts and ends with different symbols
2The set of all strings having even number of “a”
3The set of all strings having odd number of “b”
4The set of all strings having at least two times “a”

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

(c)
7 marks
Construct LL(1) parsing table for the following Grammar:
S -> aABb
A-> c | ε
B-> d | ε
(c)
7 marksSame type asked in 3 of 7 papers

Construct NFA for following regular expression using Thompson’s construction and then convert it into DFA. ab(a|b)*ab*.

Also asked in Summer 2026 Q2c, Summer 2023 Q2c OR

Q.3

14 Marks
(a)
3 marks
Differentiate between parse tree and syntax tree
(b)
4 marksAsked in 3 of 7 papers
What is inherited attribute? Explain with suitable example.

Also asked in Summer 2026 Q4a, Winter 2023 Q3b

(c)
7 marksAsked in 2 of 7 papers
Check whether the following grammar is SLR or not
S -> AaAb | BbBa
A -> ε
B -> ε

Also asked in Summer 2023 Q3c OR

(a)
3 marks
Compare and contrast SLR and LALR.
(b)
4 marksAsked in 2 of 7 papers
Write down the algorithm for partitioning of basic blocks.

Also asked in Winter 2023 Q5b

(c)
7 marksAsked in 2 of 7 papers
Explain operator grammar. Generate precedence function table for the
following grammar.
E -> EAE | id
A -> + | *

Also asked in Summer 2026 Q3c OR

Q.4

14 Marks
(a)
3 marks
What is sentinel? Explain with an example.
(b)
4 marksAsked in 6 of 7 papers
Explain Error Recovery Strategies in brief.

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

(c)
7 marksAsked in 4 of 7 papers

Explain quadruples, triple and indirect triple form of three address code with example.

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

(a)
3 marksSame type asked in 2 of 7 papers
Draw a DAG for expression: a + a * (b – c) + (b – c) * d.

Also asked in Summer 2023 Q5a OR

(b)
4 marksAsked in 5 of 7 papers
Explain various parameter passing methods.

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

(c)
7 marksAsked in 3 of 7 papers

Write syntax directed definition for simple desk calculator. Using this definition, draw annotated parse tree for 7*9+6 n.

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

Q.5

14 Marks
(a)
3 marksAsked in 2 of 7 papers
What do you mean by dangling references?

Also asked in Summer 2023 Q4a OR

(b)
4 marks

Which are the different conflicts occurs during constructing LR parsing table? Explain in detail.

(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 2026 Q2c OR

(a)
3 marksAsked in 4 of 7 papers
Differentiate top down and bottom up parser.

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

(b)
4 marksAsked in 4 of 7 papers
Write a short note on symbol table.

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

(c)
7 marksAsked in 4 of 7 papers
What is peephole optimization? Explain with example.

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

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 and step-by-step solutions for Compiler Design (CD) (Summer 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.

ViewDownload PDF