Skip to content
Official PYQ · 2013

GATE CS 2013 Q40 — Parsing (LL, LR)

Explain with AI

Consider the following two sets of LR(1)\textsf{LR(1)} items of an LR(1)\textsf{LR(1)} grammar.X→c.X,c∕dX→c.X,$X→.cX,c∕dX→.cX,$X→.d,c∕dX→.d,$\begin{array}{l|l} X \rightarrow c.X, c∕d &X → c.X, \$\\ X \rightarrow .cX, c∕ d& X → .cX, \$\\ X \rightarrow .d, c∕ d & X → .d, \$ \end{array}Which of the following statements related to merging of the two sets in the corresponding LALR\textsf{LALR} parser is/are FALSE?

  1. Cannot be merged since look aheads are different.
  2. Can be merged but will result in S-R\textsf{S-R} conflict.
  3. Can be merged but will result in R-R\textsf{R-R} conflict.
  4. Cannot be merged since goto\textsf{goto} on cc will lead to two different sets.
Choose one option
View answer

Answer: D

Worked explanation not available yet.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Parsing (LL, LR) questions