-
Which one of the following is TRUE at any valid state in shift – reduce parsing?
-
- Viable prefixes appear only at the bottom of the stack and not inside
- Viable prefixes appear only at the top of the stack and not inside
- The stack contains only a set of viable prefixes
- The stack never contains viable prefixes
- Viable prefixes appear only at the bottom of the stack and not inside
Correct Option: B
Viable prefixes appear only at the top of the stack and not inside is valid in shift reduce parsing, because we will write the shift reduce parsing program for every variable such that if any variable contain more than one possibility, it will choose the correct production.