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

Discussion

In a leftmost derivation, the nonterminal replaced at each step is

  • A.the leftmost nonterminal in the current sentential form
  • B.the rightmost nonterminal in the current sentential form
  • C.chosen arbitrarily from the nonterminals present at that step
  • D.always the start symbol of the grammar being used

Answer: A

Correct answer: the leftmost nonterminal in the current sentential form

Fixing the order removes the freedom that makes derivations differ without meaning anything. A leftmost derivation always expands the leftmost nonterminal, a rightmost derivation the rightmost, and each corresponds one-to-one with a parse tree - which is why ambiguity is defined on trees rather than on derivations.

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

Post your comment

Please log in or register to post a comment.