Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

GATE | GATE-CS-2015 (Set 1) | Question 23

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Which one of the following is True at any valid state in shift-reduce parsing?
(A) Viable prefixes appear only at the bottom of the stack and not inside
(B) Viable prefixes appear only at the top of the stack and not inside
(C) The stack contains only a set of viable prefixes
(D) The stack never contains viable prefixes


Answer: (C)

Explanation: The prefixes of right sentential forms that can appear on the stack of a shift-reduce parser are called viable prefixes.

By definition, a viable prefix is a prefix of a right sentential form that does not continue past the right end of the rightmost handle of that sentential form.
Source http://cse.iitkgp.ac.in/~bivasm/notes/scribe/11CS30001.pdf



Quiz of this Question

My Personal Notes arrow_drop_up
Last Updated : 07 Sep, 2021
Like Article
Save Article
Similar Reads