The GATE Grind

GATE 2019 CS – Question 13

Compiler Design · Parsing and Syntax Analysis · 1 mark · Multiple choice

Which one of the following kinds of derivation is used by LR parsers?

  1. Leftmost
  2. Leftmost in reverse
  3. Rightmost
  4. Rightmost in reverse

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) Rightmost in reverse

Explanation

An LR parser scans the input left to right and constructs a rightmost derivation in reverse, reducing handles.