CS8602 Compiler Design UNIT 2 MCQ
CS8602 Compiler Design UNIT 2 MCQ
CS8602 Compiler Design UNIT 2 MCQ
com
ChettinadTech Dept of CSE
1. The construction of the canonical collection of the sets of LR (1) items are similar to the
construction of the canonical collection of the sets of LR (0) items. Which is an exception?
A. Closure and goto operations work a little bit different
B. Closure and goto operations work similarly
C. Closure and additive operations work a little bit different
D. Closure and associatively operations work a little bit different
Answer: (A)
Answer: (D)
3. When ß (in the LR(1) item A -> ß.a,a) is not empty, the look-ahead _________
A. Will be affecting
B. Does not have any affect
C. Shift will take place
D. Reduction will take place
Answer: (B)
https://play.google.com/store/apps/details?id=com.sss.edubuzz360
www.edubuzz360.com
ChettinadTech Dept of CSE
Answer: (C)
5. If a state does not know whether it will make a shift operation or reduction for a terminal is called
_________
A. Shift/reduce conflict
B. Reduce /shift conflict
C. Shift conflict
D. Reduce conflict
Answer: (A)
Answer: (C)
https://play.google.com/store/apps/details?id=com.sss.edubuzz360
www.edubuzz360.com
ChettinadTech Dept of CSE
Answer: (B)
Answer: (A)
Answer: (B)
10. A grammar that produces more than one parse tree for some sentence is called __________
A. Ambiguous
B. Unambiguous
C. Regular
D. None of the mentioned
Answer: (A)
Answer: (B)
https://play.google.com/store/apps/details?id=com.sss.edubuzz360
www.edubuzz360.com
ChettinadTech Dept of CSE
Answer: (C)
Answer: (C)
14. What is the maximum number of reduce moves that can be taken by a bottom-up parser for a
grammar with no epsilon- and unit-production to parse a string with n tokens?
A. n/2
B. n-1
C. 2n-1
D. 2^n
Answer: (B)
S→F⎪H
F→p⎪c
H→d⎪c
https://play.google.com/store/apps/details?id=com.sss.edubuzz360
www.edubuzz360.com
ChettinadTech Dept of CSE
A. Only S1
B. Only S2
C. Both S1 & S2
D. None of the mentioned
Answer: (D)
Answer: (A)
17. Which of the following derivations does a top-down parser use while parsing an input string?
A. Leftmost derivation
B. Leftmost derivation in reverse
C. Rightmost derivation
D. Rightmost derivation in reverse
Answer: (A)
Answer: (C)
https://play.google.com/store/apps/details?id=com.sss.edubuzz360
www.edubuzz360.com
ChettinadTech Dept of CSE
19. Which of the following system software resides in the main memory?
A. Text Editor
B. Assembler
C. Linker
D. Loader
Answer: (D)
A. Type 0 language
B. Type 1 language
C. Type 2 language
D. Type 3 language
Answer: (C)
A. sub-terminals
B. half-terminals
C. non-terminals
D. terminals
Answer: (D)
22. Which phenomenon happens when the non-terminal on the left side is repeated as the first symbol
on the right side?
A. Left-most derivation
B. Left recursion
C. Left factoring
D. Left parsing
https://play.google.com/store/apps/details?id=com.sss.edubuzz360
www.edubuzz360.com
ChettinadTech Dept of CSE
Answer: (B)
23. In which derivation the right-most non-terminal symbol is replaced at each step?
C. Rightmost
D. Right non-terminal
Answer: (C)
24. In which derivation the leftmost non-terminal symbol is replaced at each step?
A. Left recursion
B. Left non-terminal
C. Left pushdown
D. Leftmost
Answer: (D)
A. End symbol
B. Start symbol
C. Non-terminal symbol
D. Terminal symbol
Answer: (A)
https://play.google.com/store/apps/details?id=com.sss.edubuzz360