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

Discussion

Operator precedence parsing is a bottom up method restricted to grammars in which

  • A.no nonterminal appears on the right side of any production
  • B.no rule places two nonterminals next to one another on its right
  • C.every rule carries at most two symbols to the right of the arrow
  • D.all operators in the language share a single precedence level

Answer: B

Because the parse is driven entirely by relations tabulated between pairs of terminals, a pair of nonterminals standing side by side offers the table nothing to look up. Arithmetic expression grammars happen to obey the restriction, which is what made the method attractive before generators were widely available.

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

Post your comment

Please log in or register to post a comment.