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

Discussion

A table driven scanner stores

  • A.the complete source program in memory before the scanning begins
  • B.each token produced along with the line on which it appeared
  • C.the grammar productions used by the parser during reduction
  • D.the transition function of the automaton as a two dimensional array

Answer: D

Correct answer: the transition function of the automaton as a two dimensional array

A table-driven scanner keeps the automaton as a table indexed by current state and input character, whose entry is the next state. The driver is then a short loop: look up, move, repeat. The approach separates the automaton from the code that runs it, which is why generated scanners take this form and why table compression matters.

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

Post your comment

Please log in or register to post a comment.