Question discussion

A bottom-up (shift–reduce) parser constructs the parse tree by tracing, in reverse, which type of derivation?

1751Medium DSSSB TGT Computer Science 0 replies 2 views
0

A bottom-up (shift–reduce) parser constructs the parse tree by tracing, in reverse, which type of derivation?

  • ALeftmost derivation
  • BRandom derivation
  • CRightmost derivation
  • DDerivation by the longest production
Correct answer: C

Explanation

Bottom-up parsers reduce handles and thereby trace a rightmost derivation in reverse, while top-down parsers follow a leftmost derivation.

Discussion 0

Nobody has replied yet. Start the discussion!