Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. Which one of the following is TRUE at any valid state in shift – reduce parsing?
    1. Viable prefixes appear only at the bottom of the stack and not inside
    2. Viable prefixes appear only at the top of the stack and not inside
    3. The stack contains only a set of viable prefixes
    4. The stack never contains viable prefixes
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.



Your comments will be displayed only after manual approval.