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

Discussion

Deterministic parsing methods are preferred in compilers because

  • A.they detect semantic as well as syntactic errors
  • B.they parse in time linear in the length of the input
  • C.they can handle every context free grammar without restriction
  • D.they require no lookahead token to make their decisions

Answer: B

Linear time matters when compiling large programs. The price is that the grammar must fall in a restricted class, which language designers accommodate deliberately. Language syntax is shaped in part by what parsers can handle efficiently.

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

Post your comment

Please log in or register to post a comment.