GATE 2015 CS – Question 18
Which one of the following is TRUE at any valid state in shift-reduce parsing?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) The stack contains only a set of viable prefixes
Explanation
In a shift-reduce parser the stack at any valid state holds a viable prefix of a right sentential form, built up from smaller viable prefixes, so the stack contains only viable prefixes. The other options place them in a fixed position or deny that the stack holds them.