Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q791: Item [E → E + • (E), $/+] means the parser is about to parse symbol _______.
- A: (
- B: +
- C: int
- D: )$
View Answer
A
Q792: What is the purpose of the look-ahead symbol in LR(1) items?
- A: Decide when to reduce
- B: Indicate shift
- C: End input
- D: Start parsing
View Answer
A
Q793: Which item indicates a completed production?
- A: [E → int•, $]
- B: [E → •int, $]
- C: [S → •E, $]
- D: [E → E + • (E), $/+]
View Answer
A
Q794: In LR parsing, moving the dot past a symbol means a _______ operation.
- A: shift
- B: reduce
- C: accept
- D: error
View Answer
A
Q795: The augmented grammar G' contains which start production?
- A: S' → S
- B: S → E
- C: E → int
- D: S' → E
View Answer
A
Q796: The construction of LR(1) sets stops when _______.
- A: no new states are added
- B: accept state reached
- C: error occurs
- D: all states are processed
View Answer
A
Q797: Which sets contain items with the dot at the end?
- A: I1
- B: I0
- C: I2
- D: I3
View Answer
A
Q798: I4 = goto(I3, '(') results in items with the dot before which symbol?
- A: E
- B: int
- C: +
- D: )$
View Answer
A
Q799: The symbol '+' in the production E → E + (E) is a _______.
- A: terminal
- B: non-terminal
- C: epsilon
- D: look-ahead
View Answer
A
Q800: Closure uses look-ahead symbols derived from the _______ of remaining input after the dot.
- A: FIRST set
- B: FOLLOW set
- C: LAST set
- D: EMPTY set
View Answer
A