Order PDF of any content from our website with a little minor Fee to donate for hard work. Online MCQs are fully free but PDF books are paid. For details: contact whatsapp +923028700085 Important notes based PDF Books are available in very little price, starting from 500/-PKR; Order Now: contact whatsapp +923028700085

VU Past Papers – CS606 Compiler Construction (Solved MCQs, Lectures 1–22)

Q1: Typical compilation means programs written in high-level languages to low-level ___.
(A) Object code
(B) Byte code
(C) Unicode
(D) Object Code and Byte code
Answer: (A) Object code (PG #06)

Q2: In compilation process, Hierarchical analysis is also called ___.
(A) Parsing
(B) Syntax
(C) Parsing and Syntax analysis
(D) None of given
Answer: (C) Parsing and Syntax analysis

Q3: IR (Intermediate Representation) stores the value of its operand in ___.
(A) Registers
(B) Memory
(C) Hard disk
(D) None Of given
Answer: (A) Registers

Q4: A lexeme is a sequence of characters in the source program that is matched by the pattern for a ___.
(A) Linker
(B) Token
(C) Control flow
(D) None of given
Answer: (B) Token

Q5: Parsers take ___ as input from lexical analyzer.
(A) Linker
(B) Token
(C) Instructions
(D) None of the given
Answer: (B) Token

Q6: What kind of abstract machine can recognize strings in a regular set?
(A) DFA
(B) NFA
(C) PDA
(D) None of the given
Answer: (A) DFA

Q7: In multi-pass compiler, during the first pass it gathers information about ___.
(A) Declaration
(B) Bindings
(C) Static information
(D) None of the given
Answer: (A) Declaration

Q8: In DFA minimization, we construct one ___ for each group of states from the initial DFA.
(A) State
(B) NFA
(C) PDA
(D) None of given
Answer: (A) State (PG #30)

Q9: ___ (Lexical Analyzer generator) is written in Java.
(A) Flex
(B) JLex
(C) Complex
(D) None of given
Answer: (B) JLex

Q10: In Flex specification file, different sections are separated by ___.
(A) %%
(B) &&
(C) ##
(D) None of given
Answer: (A) %%

Q11: Recursive parsing is done for LL(1) grammar.
(A) Decent
(B) Ascent
(C) Forward
(D) None of the given
Answer: (A) Decent

Q12: Alternative of the backtrack in parser is Look ahead symbol in ___.
(A) Input
(B) Output
(C) Input and Output
(D) None of the given
Answer: (A) Input

Q13: Parser takes tokens from scanner and tries to generate ___.
(A) Binary Search tree
(B) Parse tree
(C) Binary Search tree and Parse tree
(D) None of the given
Answer: (B) Parse tree

Q14: In predictive parsing table, the rows represents ___.
(A) Terminals
(B) Both non-terminal and terminals
(C) Non-terminals
(D) None of the given
Answer: (C) Non-terminals (PG #62)

Q15: In LL(1) parsing algorithm, ___ contains a sequence of grammar symbols.
(A) Stack
(B) Link List
(C) Array
(D) None of the given
Answer: (A) Stack (PG #62)

Q17: First of C is ___.
(A) g, i
(B) g
(C) h, i
(D) None of the given
Answer: (A) g, i

Q18: Bottom-up parsing uses only ___ kinds of actions.
(A) Two
(B) Three
(C) Four
(D) Five
Answer: (A) Two (Shift and Reduce)

Q19: The shift action ___ a terminal on the stack.
(A) Pushes
(B) Pops
(C) Both push and pops
(D) None of the given
Answer: (A) Pushes

Q20: Reduce action ___ zero or more symbols from the stack.
(A) Pushes
(B) Pops
(C) Both push and pops
(D) None of the given
Answer: (B) Pops

Q21: In compilers, linear analysis is also called ___.
(A) Lexical analysis
(B) Scanning
(C) Lexical analysis and scanning
(D) None of the given
Answer: (C) Lexical analysis and scanning

Q22: Back End of two-pass compiler uses ___ algorithm.
(A) O(n)
(B) O(n log n)
(C) –
(D) None of the given
Answer: (B) O(n log n)

Q23: The Back End of a compiler consists of ___.
(A) Instruction selection
(B) Register allocation
(C) Instruction scheduling
(D) All of the given
Answer: (D) All of the given

Q24: In Back End module of compiler, optimal register allocation uses ___.
(A) O(log n)
(B) O(n log n)
(C) NP-Complete
(D) None of the given
Answer: (C) NP-Complete

Q25: ___ is a regular expression for the set of all strings over the alphabet {a} that has an even number of a’s.
(A) (aa)*
(B) (aa)a
(C) aa
a
(D) a*(aa)
Answer: (A) (aa)*

Q26: ___ algorithm is used in DFA minimization.
(A) James’s
(B) Robert’s
(C) Hopcroft’s
(D) None of given
Answer: (C) Hopcroft’s (PG #25)

Q27: ___ is an important component of semantic analysis.
(A) Code checking
(B) Type checking
(C) Flush checking
(D) None of the given
Answer: (B) Type checking (PG #39)

Q28: First of B is ___.
(A) h, i
(B) h, £
(C) g
(D) None of the given
Answer: (B) h, £

Q29: First of D is ___.
(A) h, g
(B) h
(C) –
(D) None of the given
Answer: (A) h, g

Q30: Parsers never shift into an error state.
(A) LS
(B) LT
(C) LR
(D) LP
Answer: (C) LR

Q31: In ___, certain checks are performed to ensure that components of a program fit together meaningfully.
(A) Linear analysis
(B) Hierarchical analysis
(C) Semantic analysis
(D) None of given
Answer: (C) Semantic analysis

Q32: ___ reads the input character and produces sequence of tokens as output.
(A) Lexical analyzer
(B) Parser
(C) Symbol table
(D) None of the given
Answer: (A) Lexical analyzer

Q33: The regular expression ___ denotes the set of all strings of a’s and b’s of length two.
(A) a*
(B) (a* | b*)*
(C) (ab)*
(D) (a|b)(a|b)
Answer: (D) (a|b)(a|b)

Q34: ___ of a two-pass compiler consists of Instruction selection, Register allocation, and Instruction scheduling.
(A) Backend
(B) Frontend
(C) Start
(D) None of the given
Answer: (A) Backend (PG #9)

Q35: ___ is evaluated to yield a value.
(A) Command
(B) Expression
(C) Declaration
(D) None of the given
Answer: (B) Expression

Q36: Bottom-up parsers handle a ___ class of grammar.
(A) Large
(B) Small
(C) Medium
(D) None of the given
Answer: (A) Large

Contents Copyrights Reserved By T4Tutorials