CS606-MidTerm-Sadaf_Awan.pdf

Verified academic study resource for CS606 (Compiler Design & Construction) under the Computer Science at Virtual University of Pakistan. This PDF document (Midterm Solved Past Paper & Revision File) covers Mid-Term Exam Scope (Lectures 1 to 22) spanning approximately 240 pages across 4 curriculum modules, and is indexed for student examination review with instant in-browser preview and 100% free direct download.

Course
CS606 – Compiler Design & Construction
Faculty
Computer Science
Format
PDF
Type
Midterm
Coverage
Mid-Term Exam Scope (Lectures 1 to 22)
Tags
MIDTERM

Focus on core definitions and repeated MCQs from Lectures 1–22. Remember that scoring in the First Half builds your safety buffer toward the mandatory 20% Two-Half passing rule in CS606.

What this file covers — CS606 syllabus roadmap

  1. Core Architecture, Syntax & Primitive Data Structures — Lectures 1 to 6 (Pages 1 to 65). 15% Objective Marks (8–10 MCQs)
  2. Conditional Branching, Loops & Logical Control Flow — Lectures 7 to 12 (Pages 66 to 140). 18% Exam Marks (MCQs + 2-Mark Short Questions)
  3. Memory Management, Pointers, Arrays & Functions — Lectures 13 to 18 (Pages 141 to 215). 22% Exam Marks (High Yield for Midterms)
  4. Midterm Consolidation, Strings & Algorithm Synthesis — Lectures 19 to 22 (Pages 216 to 280). Midterm Exam Culmination (Lectures 1–22 Scope)

Frequently asked questions

Where can I download CS606-MidTerm-Sadaf_Awan.pdf for free?

You can preview and download "CS606-MidTerm-Sadaf_Awan.pdf" (CS606 PDF, ~240 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs606-midterm-sadaf-awan-pdf) with 100% free high-speed downloads and zero registration requirements.

What syllabus chapters and lectures are covered in this CS606 file?

This document covers Mid-Term Exam Scope (Lectures 1 to 22) across 4 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22), featuring comprehensive definitions, solved objective questions, and examiner marking rubrics.

What is the passing criteria for CS606 under the VU 20% Two-Half Rule?

Under official Virtual University regulations, students must score at least 20% in the First Half (Quizzes, Assignments, GDBs, and Midterm combined) AND independently at least 20% in the Final-Term examination paper. Scoring under 20% in the final exam results in an automatic F grade regardless of earlier marks.

Are CS606 solved past papers and handouts verified for 2026 exams?

Yes. All CS606 materials on MIHORA VU—including Moaaz, Waqar Siddhu, and team archives—are reviewed against the current VU syllabus to help students prepare for 2026 Midterm, Final-Term, and online quiz examinations.

Inside this file

                                         CS606
                                     Midterm MCQ
                                     By Sadaf Awan
                                         BSCS

1: An ----- does not need to examine the entire stack for a handle, the state symbol on the top
of the stack contains all the information it needs
LR parser
RL parser
BU parser
None of the giv

2: Yacc contains built-in support for handling ambiguous grammars resulting in shift-reduce
conflicts. By default these conflicts are solved by performing the ________.
Shift action
Reduce action
Shift and reduce actions
De-allocation of memory

3: S --> A | xb
A --> aAb | x
This grammar contains a reduce-reduce conflict
True
False

4: S --> a | B
B --> Bb | E
The non-terminal _______ is left recursive.
B
A
E
None of the given

5: When generating a lexical analyzer from a ________ description, the item sets (states) are
constructed by two types of “moves”: character moves and e moves.
Character
Grammar
 Token (Page 18)
 Sentence

6: Left factoring is enough to make a grammar LL(1).
True

False

7: S --> A B
A --> e | aA
B --> e | bB
FIRST(S) contains ___ elements.
3
4
5
6

7: Grammars with LL(1) conflicts can be made LL(1) by applying left-factoring,
substitution, and left-recursion removal. Left-factoring takes care of ________conflicts.
FIRST/FIRST
FIRST/SECOND
SECOND/FIRST
None of the given

8: Alternative of the backtrack in parser is Look ahead symbol in _________ .
Input (Page 46)
Output
Input and Output
None of the given

9: Typical compilation means programs written in high-level languages to low-level
____________.
Object code (page 2)
 Byted code
Unicode
Both Object Code and byte code

10: In PASCAL ___________ represent the inequality test.
:
:=
=
<>
None of the given

11: LR parsing ______________ a string to the start symbol by inverting productions.
Reduces (Page 63)
Shifts
Adds
None of the given

12: In parser the two LL stand(s) for ____________ .
Left-to-right scan of input
left-most derivation
All of the given (Page 47)
None of the given

13: Parser always gives a tree like structure as output
True (Page 37)
False

14: Lexer and scanner are two different phases of compiler
True
False (Page 12)

15: In compilation process Hierarchical analysis is also called-----------
Parsing
Syntax analysis click here 4 details
Both Parsing and Syntax analysis
None of given

16: Ambiguity can easily be handled by Top-down Parser Select correct option:
True Click here 4 details
False

17: Front-end of a two pass compiler is consists of Scanner.
True (Page 5)
False

18: LL(1) parsing is called non-predictive parsing.
True Click here 4 details
False

19: In predictive parsing table the rows are ____________________ .
Non-terminals (Page 54)
Terminals
Both non-terminal and terminals
None of the given

20: In LL1() parsing algorithm _________ contains a sequence of grammar symbols.
Stack (Page 55)
Link list
Array
None

21: Consider the grammar
A --> B C D
B --> h B | epsilon
C --> C g | g | C h | i
D --> A B | epsilon
First of C is _______________ .
h
g, I
g, h, I, $
g

22: AST summarizes the grammatical structure with the details of derivations.
True
False (Page 8)

23: Left factoring is enough to make LL1 grammar
True
False (Rep)

24: A grammar is LR if a ------ shift reduce-reduce parser can recognize handles when they
appear on the top of stack.
left-to-reverse
left-to-rise
left-to-right Click here for detail
None of the given

25: Reduction of a handle to the ------- on the left hand side of the grammar rule is a step
along the reverse of a right most derivation.
Terminal
Non-terminal

26: The regular expressions a*|b* and (a|b)* describe the _____set of strings.
Same
Different
Onto

27: Yacc contains built-in support for handling ambiguous grammars resulting in _______
conflicts.
Shift-reduce
Shift-Shift
Shift-second
None of the given

28: A lexical analyzer generator automatically constructs a _____ that recognizes tokens.
FA (Page 18)

PDA
DP
None of the given

29: The following two items A -> P • Q B -> P • Q can co-exist in an ______ item set.
LR
LS
LT
PR

30: LR parsers can handle ________________ grammars.
Left-recursive (Page 63)
file-recursive
End-recursive
Start-recursive

31: _____ convert the reloadable machine code into absolute machine code by linking
library and reloadable object files.
Assembler
Loader/link-editor
Compiler
Preprocessor

32: One of the core tasks of compiler is to generate fast and compact executable code.
True (Page 2)
False

33: Compilers are sometimes classified as.
Single pass
Multi pass
Load and go
All of the given

34: Which of the statement is true about Regular Languages?
Regular Languages are the most popular for specifying tokens.
Regular Languages are based on simple and useful theory.
Regular Languages are easy to understand.
All of the given (Page 15)

35: The transition graph for an NFA that recognizes the language ( a | b)*abb will have
following set of states.
{0}
{0,1}
{0,1,2}
{0,1,2,3}

36: Functions of Lexical analyzer are?
Removing white space
Removing constants, identifiers and keywords
Removing comments
All of the given
37: Flex is an automated tool that is used to get the minimized DFA (scanner).
True
False (Page 26)

38: We use ----- to mark the bottom of the stack and also the right end of the input when
considering the Stack implementation of Shift-Reduce Parsing.
1. Epsilon
2. #
3. $ Click here for detail
4. None of the given

39: When generating a lexical analyzer from a token description, the item sets (states) are
constructed by two types of “moves”: character moves and ____ moves.
1. E Click here for detail
2. #
3. @
4. none of given

40: Bottom-up parsers handle a _________________ class of grammars.
1. Large (Page 42)
2. small
3. medium
4. none of the given

41: Parser takes tokens from scanner and tries to generate _______________ .
Binary Search tree
Parse tree
Syntax tree (Page 8)
None of the given

42: In Flex specification file different sections are separated by _________________ .
 %% (Page 26)
 &&
##
\\

More CS606 files

All CS606 files · Midterm Prep 2026 · MCQs Bank