Professional Documents
Culture Documents
Ans: A
Q9. The regular expression (0|1)*00 will accept all strings
(A) Divisible by 2
(B) Divisible by 4
(C) Divisible by 2 with minimum length 2
(D) Divisible by 4 with minimum length 2
Ans: D
Q10. A regular expression for accepting strings with exactly one 1 more than 0’s is
(A) 0*1
(B) (0|1)*1(0|1)*
(C) (0|1)*1(0|1)*|1(0|1)*
(D) Not possible
Ans: D
Q11. Finite automata is an implementation of
(A) Regular expression
(B) Any grammar
(C) Part of a regular expression
(D) None of the other options
Ans: A
Q12. A DFA cannot have
(A) Epsilon transitions
(B) An isolated state
(C) More than one transition from a state on same inout
(D) All of the other options
Ans: D
Q13. Number of possible epsilon transitions from a state in an NFA is
(A) One
(B) At most one
(C) Many
(D) Zero
Ans: C
Q14. Between NFA and DFA which one is easier to implement
(A) NFA
(B) DFA
(C) Equal effort needed
(D) Cannot be said definitely
Ans: B
Q15. Between NFA and DFA which one is more powerful
(A) NFA
(B) DFA
(C) Equally powerful
(D) Cannot be said definitely
Ans: C
Ans: A
Q5. Which of the following conflicts is not possible in shift-reduce parsing
(A) Reduce-reduce conflict
(B) Shift-reduce conflict
(C) Shift-shift conflict
(D) None of the other options
Ans: C
Q6. In Operator Precedence parsing handle is
(A) Before <·
(B) After ·>
(C) Between <· and ·>
(D) None of the other options
Ans: C
Q7. For the grammar rule B → abbS | bS, Firstop(B) equals
(A) {a}
(B) {a, b}
(C) {a, b, S}
(D) {S}
Ans: C
Q8. By considering the rule B → abbS, which of the precedence relations between a and b can be
inferred?
(A) a ≐ b only
(B) a ≐ b and b ≐ b
(C) b ≐ a and a ≐ b
(D) b ≐ a and b ≐ b
Ans: B
Q9. The final set of elements in Firstop+ and Lastop+ are
(A) Terminals
(B) Nonterminals
(C) Both terminals and nonterminals
(D) Neither terminals nor nonterminals
Ans: A
Q10. An operator-precedence parser is a
(A) Shift-reduce parser
(B) Bottom-up parser
(C) Parser constructing derivation in the reverse
(D) All of the other options
Ans: D
Q10. Construction of parsing table in which strategies do not need the Follow set?
(A) SLR and Canonical LR
(B) Canonical LR and LALR
(C) SLR and LALR
(D) None of the given options
Ans: B
Ans: D
Q10. Annotated parse tree means
(A) Parse tree with attributes
(B) Code generated
(C) Correct parse tree
(D) None of the given options
Ans: A