A shift-reduce parser suffers from

2014

A shift-reduce parser suffers from

  1. A.

    shift reduce conflict only

  2. B.

    reduce reduce conflict only

  3. C.

    both shift reduce conflict and reduce reduce conflict

  4. D.

    shift handle and reduce handle conflicts

Attempted by 101 students.

Show answer & explanation

Correct answer: C

Shift-reduce parsers are bottom-up parsing methods that utilize a stack to process input symbols.

These parsers can encounter ambiguity where they must decide between shifting the next symbol or reducing a handle, known as shift-reduce conflict.

Furthermore, ambiguity can arise when multiple reduction rules apply to the same stack content, causing reduce-reduce conflict.

Consequently, both shift-reduce and reduce-reduce conflicts are potential issues in shift-reduce parsing strategies.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor