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

Discussion

A scanner generator combines the patterns for all tokens into

  • A.a context free grammar covering all the token definitions
  • B.a table of string comparisons applied to each candidate lexeme
  • C.a single automaton with an accepting state marked per pattern
  • D.one separate automaton per token, each run in turn on the input

Answer: C

Merging the patterns into one machine means the input is scanned once rather than once per token. The accepting state reached identifies which pattern matched, and rule order breaks any tie. One pass over the input therefore suffices no matter how many tokens are defined.

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

Post your comment

Please log in or register to post a comment.