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

Discussion

An alternative to listing keywords as separate patterns is to

  • A.forbid the use of keywords anywhere within the source program
  • B.let the parser rather than the scanner distinguish all the keywords
  • C.define a separate automaton for each keyword in the language
  • D.recognise all words as identifiers and consult a reserved word table

Answer: D

Installing keywords in the symbol table before scanning begins lets one identifier pattern handle everything. A lookup after each word decides whether it is a keyword or a plain identifier, which keeps the automaton small.

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

Post your comment

Please log in or register to post a comment.