GATE CS 2015, set 1 · Question 18 · Compiler Design · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Which one of the following is TRUE at any valid state in shift-reduce parsing?

  1. (A) Viable prefixes appear only at the bottom of the stack and not inside
  2. (B) Viable prefixes appear only at the top of the stack and not inside
  3. (C) The stack contains only a set of viable prefixes
  4. (D) The stack never contains viable prefixes
Answer

Answer (C)

Answer from the official GATE CS 2015 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes