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

Discussion

A top down parser builds the parse tree

  • A.starting at the root and working toward the leaves
  • B.starting at the leaves and working toward the root of the tree
  • C.starting at the deepest nesting level and working outward
  • D.in whatever order the input tokens happen to arrive in

Answer: A

Correct answer: starting at the root and working toward the leaves

A top down parser begins with the start symbol and repeatedly expands nonterminals until the leaves match the input, which is why it is also called predictive: it must guess which production to apply before seeing what that production will derive. Bottom up parsing works the other way, from the leaves inward.

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

Post your comment

Please log in or register to post a comment.