Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q531: What data structure is used in non-recursive predictive parsing?
- A: Array
- B: Tree
- C: Queue
- D: Stack
View Answer
D
Q532: The predictive parser uses an explicit _______ to keep track of pending non-terminals.
- A: stack
- B: table
- C: tree
- D: queue
View Answer
A
Q533: The parsing table M is indexed using which combination?
- A: Terminal and expression
- B: Production and stack
- C: Non-terminal and terminal
- D: Symbol and pointer
View Answer
C
Q534: What is the start symbol in the expression grammar discussed?
- A: F
- B: T
- C: E
- D: E'
View Answer
C
Q535: How does the parser know it has successfully completed parsing?
- A: When input buffer is full
- B: When stack is empty
- C: When input symbol and top of stack are both $
- D: When all productions are used
View Answer
C
Q536: Which of the following is a terminal in the predictive parsing table?
- A: T'
- B: E'
- C: +
- D: F
View Answer
C
Q537: Which grammar rule corresponds to multiplication operation?
- A: T' → * F T'
- B: F → ( E )
- C: T → F T'
- D: E' → + T E'
View Answer
A
Q538: The parser consults the parsing table when the top of the stack is a _______.
- A: terminal
- B: non-terminal
- C: operator
- D: value
View Answer
B
Q539: A parsing table entry M[X, a] = error implies ________.
- A: production found
- B: stack is cleared
- C: no error
- D: recovery is needed
View Answer
D
Q540: The operator * is handled in which function during parsing?
- A: Eprime::isPresent()
- B: Tprime::isPresent()
- C: Term::isPresent()
- D: Factor::isPresent()
View Answer
B