- Type
- Midterm past paper
- Course
- CS606 Compiler Construction
- Size
- PDF 36 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2 of 3. Download the file for all 3 pages.
- The duration of this examination is 90 Mins.
- This examination is closed book, closed notes, closed neighbors.
Q4. Some of the examination consists of multiple-choice questions. Choose only one choice as your answer.
**WARNING: Please note that Virtual University takes serious action against unfair means. Anyone found involved in cheating will get an `F` grade in this course.
Q1. Total Questions: 4
Marks : 20
Given the following grammar and input string "bool id , id , id" 1. Decl 2. Type 3. IdList Type IdList
bool | int
IdList , id
| float
| id
a. show the leftmost derivation of the input string b. show the parse tree of the input string c. create a new equivalent grammar that has left recursion removed d. show the parse tree for the above input string on the new grammar
Q2. Find the First and Follow sets for the following grammars:
Marks : 10
1. Exp 2. ExpTail 3. Var 4. VarTail
Q3. – Exp | (Exp) | Var ExpTail
– Exp | id VarTail (Exp) |
Marks : 15
Consider the following grammar of lists. Note that there are four different terminals: "(", ")", "a", and "," 1. S 2. 3. 4. 5. A�
a
( A ) S A , S
a) Show that the grammar is not LL(1) hint: you should be able to do this by computing some of the FIRST sets b) Rewrite the grammar so that it is suitable for recursive decent parsing c) If you were going to build a table driven top-down parser for this grammar from (b), how big would the table be? (how many entries would it have)
Q4. Marks : 10
Use the subset construction to create a DFA that is equivalent to the following NFA that uses the alphabet a,b. Show your work. Note: The states with '*' are final states.
Related CS606 files
All CS606 files →- CS606 Midterm Current Paper Objective Solved 2023 by Prince Alvi Midterm PDF 3.6 MB
- CS606 Midterm Solved Papers with References by Waqar Siddhu Midterm ZIP 3.9 MB
- CS606 Midterm Notes Midterm PDF 438 KB
- CS606 Midterm Short Notes Midterm ZIP 340 KB
- CS606 Official Handouts Official handout PDF 1.4 MB Free
- CS606 Quiz 3 by VU Topper RM Quiz PDF 158 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.