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

Discussion

A lexeme longer than the whole buffer causes

  • A.a failure that the scanner must detect and report to the user
  • B.the automatic doubling of the buffer size by the scanner
  • C.the parser to be invoked before the lexeme is complete
  • D.no difficulty at all

Answer: A

Correct answer: a failure that the scanner must detect and report to the user

With a two-half buffer the scanner can hold a lexeme up to one buffer length; a longer one would require overwriting the half containing its own beginning. The scanner must therefore detect the condition and report it rather than silently truncating. In practice the buffer is made large enough that only a pathological string literal could reach the limit.

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

Post your comment

Please log in or register to post a comment.