A top-down parser generates

2016

A top-down parser generates

Answer: C. Leftmost derivationTop-down parsers begin parsing from the start symbol of the grammar. They construct the parse tree by expanding non-terminals, always choosing to expand the…

  1. A.

    Rightmost Derivation

  2. B.

    Rightmost derivation in reverse

  3. C.

    Leftmost derivation

  4. D.

    Leftmost derivation in reverse

Attempted by 453 students.

Show answer & explanation

Correct answer: C

Top-down parsers begin parsing from the start symbol of the grammar.

They construct the parse tree by expanding non-terminals, always choosing to expand the leftmost non-terminal first.

This specific order of expansion ensures that top-down parsers generate a leftmost derivation.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…