Skip to content
Official PYQ · 2008

GATE CS 2008 Q11 — Parsing (LL, LR)

Explain with AI

Which of the following describes a handle (as applicable to LR-parsing) appropriately?

Choose one option
View worked solution

Answer: D

In bottom-up (LR) parsing, a handle of a right-sentential form γ\gamma is a production A→βA \rightarrow \beta and a position in γ\gamma where the substring β\beta may be found and replaced by AA to obtain the previous right-sentential form in a rightmost derivation.

Thus, a handle is characterized by two components:

  1. The specific production pp (A→βA \rightarrow \beta) that will be used for the immediate next reduction step.
  2. The exact position in the current sentential form where the right-hand side (β\beta) of this production is located.

Therefore, Option D is the most accurate description of a handle.

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

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