Compiler Design
CSE · Quiz · Fall 25
Paper 5 of 5By H@DY_222 (2)Switch
Paper 5 of 5
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Daffodil International University
Faculty of Science & Information Technology
Department of Computer Engineering
Course Code: CSE 331 ; Course Title: Compiler Design
Time: 1 hour
25/10/2025
Marks: 15
Sl. | Question | Marks
1. | Consider this code written in C:
Int x = 0, y = 0, z = 30;
X = x*z+25;
Y = 5+ x;
a) Show how the code goes through different phases of the compiler till code optimization | 04
2. | Design a regular expression for
a) Language that only accepts strings that start with b, can contain a or b, then might contain ab, if it contains ab it can be repeated up to k times, where k is finite, and the string at the end contains a. | 02
b) Language that describes variables for C:
Can contain " " or "Letters", then can contain "_", "Letters" or "Numbers". Use regular definitions for Letters and Numbers and describe these definitions. | 02
3. | Draw the Transition Diagram and Table for the regular expression in 2(a) | 02
4. | Define the Finite Automata described by question 3.
a) Explain if it is a DFA or NFA | 01
b) If it is a NFA, use subset construction method to derive the DFA transition table | 04