447 views
S - >aSb | c

Give viable prefix for this with details of how to find viable prefix? for string - - aacbb

Viable prefix is found with respect to a string as we need to know the contents of the stack at each shift - reduce step which is possible only if we know the string in addition to the grammar given.
Updated

First of all we have to know a few points regarding viable prefix :

a) Viable prefixes w.r.t a string to be parsed are those which  appear in the stack during the process of reduction.

b) And secondly this should be a prefix of some right sentential form

STACK                     INPUT                      ACTION

$aacbb Shift$a                        acbb                            Shift

$aa cbb Shift$aac                    bb                                Reduce

$aaS bb Shift$aaSb                  b                                  Reduce