Machine-translated by Google. Questions are authored in English.
Top

Discussion

A bottom-up parser constructs the parse tree

  • A.from the root downward, predicting which production applies
  • B.by first building every possible subtree and then selecting one
  • C.without building a tree at all, since none is ever required
  • D.from the leaves upward, reducing right sides to their left sides

Answer: D

Reductions replace a matched right side by its nonterminal, building the tree upward. The sequence of reductions traced backward gives a rightmost derivation of the input string. This correspondence is what justifies calling the method a rightmost parse.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.