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

Discussion

State whether the following is true or false.
An LR parser can begin producing output before it has read the entire input.

  • A.True only at large scales
  • B.False only at small scales
  • C.True
  • D.False

Answer: C

Correct answer: True

LR parsing is incremental: actions run as reductions occur, so a translator can emit code, build tree fragments or write output long before the end of the input is reached. This is what makes single-pass compilation possible and why an LR parser can be used on a stream.

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

Post your comment

Please log in or register to post a comment.