Compiler Design
CSE · Quiz · Fall 25
Paper 2 of 5By Fahim Faysal Khan (579)Switch
Paper 2 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
Department of Computer Science & Engineering
Quiz-01, Semester : Fall 2025
Course Code: CSE331, Course Title: Compiler Design
Time: 20 minutes | Marks: 15
[The figures in the right margin indicate the full marks.]
1. | float finalV (float u, float a, int time)
{
float vf;
time = 40;
vf = a * time + u ; /* this is third statement*/
return vf <0 ? - vf : vf;
}
a) | Divide the above C++ program into appropriate lexemes. | [5]
b) | Describe first three phases of a compiler for the third statement of the given function. | [5]
2. | a) | Write regular expression for the following languages- | [5]
| i. | All strings of 0's and 1's that contain at most two 0's.
| ii. | All strings of 1's and 0's with an even number of 1's
| iii. | All string of lowercase English letters that contain the five vowels in order.