Which of the following describes a handle (as applicable to LR-parsing) appropriately?
View worked solution
Answer: D
In bottom-up (LR) parsing, a handle of a right-sentential form is a production and a position in where the substring may be found and replaced by to obtain the previous right-sentential form in a rightmost derivation.
Thus, a handle is characterized by two components:
- The specific production () that will be used for the immediate next reduction step.
- The exact position in the current sentential form where the right-hand side () 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.
