Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q631: What does LR stand for in LR Parsing?
- A: Left Recursion
- B: Left-to-right Rightmost derivation
- C: Left Rewrite
- D: Logic Rewrite
View Answer
B
Q632: Bottom-up parsing is also called ______.
- A: Top-down parsing
- B: LL parsing
- C: LR parsing
- D: Recursive descent parsing
View Answer
C
Q633: Which type of grammars can LR parsers handle that top-down parsers cannot?
- A: Right-recursive grammars
- B: Left-recursive grammars
- C: Context-free grammars
- D: Context-sensitive grammars
View Answer
B
Q634: In bottom-up parsing, derivation is built in ______.
- A: Leftmost order
- B: Forward direction
- C: Reverse order
- D: Top-down fashion
View Answer
C
Q635: The process of reducing a string to the start symbol in bottom-up parsing is called ______.
- A: Expansion
- B: Reduction
- C: Shifting
- D: Derivation
View Answer
B
Q636: Bottom-up parsing traces ______ derivation in reverse.
- A: Rightmost
- B: Leftmost
- C: Centermost
- D: None of these
View Answer
A
Q637: What does the 'Shift' action do in shift-reduce parsing?
- A: Adds non-terminal
- B: Deletes a terminal
- C: Moves ► to the right
- D: Adds production rule
View Answer
C
Q638: What happens during a 'Reduce' action in bottom-up parsing?
- A: Parser rewrites the input
- B: Parser shifts input
- C: Parser applies inverse production
- D: Parser reads next token
View Answer
C
Q639: Which of the following is TRUE about LR parsing?
- A: It constructs a leftmost derivation
- B: It reads tokens right to left
- C: It constructs a rightmost derivation
- D: It uses recursive calls
View Answer
C
Q640: The symbol ► in bottom-up parsing indicates ______.
- A: End of input
- B: Start of derivation
- C: Current parsing position
- D: Error indicator
View Answer
C