Computer Science EngineeringHard

A shift-reduce conflict in an LR parser means that in some state the parser

  1. A. has an empty stack
  2. B. cannot decide between shifting the next token and reducing by a production
  3. C. finds two different reductions possible
  4. D. reads an unknown token

Correct answer: B. cannot decide between shifting the next token and reducing by a production

The state contains both a completed item (reduce) and an item with the dot before a terminal (shift) for the same lookahead.

More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions

Exams that ask this topic