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

Discussion

A grammar that is ambiguous can be LL(1)

  • A.only when the grammar has fewer than ten productions
  • B.never, since a conflict must appear somewhere in the table
  • C.always, provided the ambiguity is resolved by rule order
  • D.only when the ambiguity concerns epsilon productions

Answer: B

Two parse trees for one sentence means two applicable productions at some point. That is precisely a table conflict, so ambiguity and the LL(1) property are incompatible. Removing the ambiguity is therefore the first task when a conflict appears.

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

Post your comment

Please log in or register to post a comment.