Question:

Which one of the following derivations does a top-down parser use while parsing an input string? The input is assumed to be scanned from left to right.

Show Hint

Top-down parsing corresponds to leftmost derivation, while bottom-up parsing corresponds to rightmost derivation in reverse.
Updated On: Feb 8, 2026
  • Leftmost derivation
  • Leftmost derivation traced out in reverse
  • Rightmost derivation
  • Rightmost derivation traced out in reverse
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: Understanding top-down parsing.
Top-down parsers begin parsing from the start symbol and try to generate the input string by expanding non-terminals.
Step 2: Direction of derivation.
In top-down parsing, the leftmost non-terminal is always expanded first, while the input is scanned from left to right.
Step 3: Distinguishing from bottom-up parsing.
Bottom-up parsers construct a rightmost derivation in reverse, which is not the case here.
Step 4: Final conclusion.
Hence, a top-down parser uses a leftmost derivation.
Was this answer helpful?
0
0