Skip to content
Official PYQ · 1987

GATE CS 1987 Q1-xiv — Parsing (LL, LR)

Explain with AI

An operator precedence parser is a

Choose one option
View worked solution

Answer: A

An operator precedence parser is a special type of shift-reduce parser, which belongs to the class of bottom-up parsers.

Key points about operator precedence parsing:

  • It is used for a subclass of grammars called operator grammars, where no production has ϵ\epsilon on the right-hand side, and no two non-terminals are adjacent.
  • It works by identifying the "handle" (the substring to be reduced) using precedence relations (⋖\lessdot, ≐\doteq, ⋗\gtrdot) between adjacent terminals in the input.
  • Like all shift-reduce parsers, it builds the parse tree from the bottom (leaves/tokens) up to the top (start symbol).

Thus, it is a bottom-up parser, making Option A the correct choice.

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

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