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

Discussion

A hand written scanner is sometimes preferred when

  • A.the language has unusual rules that patterns express awkwardly
  • B.the language has more than a hundred distinct token types
  • C.the compiler must be written in a purely functional language
  • D.the source alphabet contains fewer than sixty four characters

Answer: A

Correct answer: the language has unusual rules that patterns express awkwardly

Hand writing is chosen where the lexical structure does not fit the regular expression model comfortably - significant indentation, nested comments, string interpolation, or context-dependent rules such as Fortran’s insignificant blanks. Writing the awkward parts directly is often clearer than forcing them into patterns with elaborate actions and start conditions.

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

Post your comment

Please log in or register to post a comment.