0% found this document useful (0 votes)
12 views1 page

MidTerm Question Compiler

The document outlines the mid-term examination for the B.Sc. in Computer Science and Engineering program at the World University of Bangladesh, focusing on Compiler Design. It includes a set of questions that cover topics such as the definition of a compiler, parse trees, finite state automata, and the essential phases of compiler development. Students are required to answer three questions, with specific questions marked as mandatory.

Uploaded by

mahedi.hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

MidTerm Question Compiler

The document outlines the mid-term examination for the B.Sc. in Computer Science and Engineering program at the World University of Bangladesh, focusing on Compiler Design. It includes a set of questions that cover topics such as the definition of a compiler, parse trees, finite state automata, and the essential phases of compiler development. Students are required to answer three questions, with specific questions marked as mandatory.

Uploaded by

mahedi.hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

World University of Bangladesh (WUB)

Department of Computer Science & Engineering


Mid-term Examination
Program: [Link]. in CSE, Batch: 60A
Course Title: Compiler Design, Course Code: CSE 905(CSE 06132120)

Time: 1.0 Hour Marks: 15


Answer any three of the following questions. Answering CO marked questions are
mandatory.

1. (a) While working on a new program with your friend, you mention that the 2
software you're using is a compiler. Curious, your friend asks why it is called a
compiler. Now, explain it to your friend.
(b) Write down the parse tree for the given expression- id1:= id2 + id3*id4. 3

2. (a) You are known about finite state automaton that can be used for pattern 2
recognition. Define the finite state automaton with example.
(b) You know that finite state automaton is used to find the tokens in a compiler, 3
So, for making a lexical analyzer the following state table is given to you.

Draw the state diagram for a finite state automaton using the state table.

3. Suppose you need to develop a compiler for a specific programming language. 5


State the essential phases that your compiler should include. Describe how
your compiler will implement these phases, providing an example to illustrate
the process. (CO1)

4 (a) Write the corresponding regular expression for the following statement - {mo, 3
moo, mooo……….} and for a variable of C language.
(b) 2

Find the state table for the given nondeterministic finite state automaton.

You might also like