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

Discussion

Recognising the longest possible lexeme at each point is called

  • A.the longest match rule
  • B.the first match rule that scanner generators normally apply
  • C.backtracking over the input to find alternative parses
  • D.the priority rule used to break ties between token patterns

Answer: A

Without this rule the scanner would return a bare less than sign rather than the two character comparison operator at the start of an inequality. The scanner therefore continues while a longer lexeme remains possible and retreats to the last accepting position when it fails.

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

Post your comment

Please log in or register to post a comment.