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

Discussion

Converting a grammar so that a top down parser can use it may

  • A.always leave the grammar both smaller and rather simpler to read
  • B.remove the need for semantic analysis altogether
  • C.change the parse tree shape and hence the semantic actions needed
  • D.change the language that the grammar generates

Answer: C

Left recursion removal and factoring preserve the language but not the tree. Any actions written against the original productions must be rewritten for the transformed ones. This is one reason some authors prefer to write the parser by hand instead.

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

Post your comment

Please log in or register to post a comment.