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

Discussion

A language in which keywords are not reserved is harder to scan because

  • A.a word may be a keyword or an identifier depending on its context
  • B.such languages cannot be described by regular expressions at all
  • C.the scanner must then be written by hand rather than generated
  • D.the symbol table cannot hold both keywords and identifiers

Answer: A

Early Fortran allowed IF as a variable name. Deciding the token then requires context that the scanner does not have, which is why nearly all modern languages reserve their keywords. Reserving them costs a few identifiers and removes an entire class of difficulty.

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

Post your comment

Please log in or register to post a comment.