For the moment, we only need to know that the type of string table entries is Symbol . The default action simply copies the string to stdout . Your final scanner should have no default actions. For example, you must handle errors such as an EOF occurring in the middle of a string or comment, as well as string constants that are too long. You must make some provision for graceful termination if a fatal error occurs.
Core dumps are unacceptable.
Your scanner should attempt to do the best possible job of error recovery and print out good descriptive diagnostic error messages. The goal of error recovery is to return a token sequence as close to the user's intent as possible after an error occurs, and to continue to find as many errors as possible on one compilation. This feature will aid the rest of the compiler in printing useful error messages. All errors will be passed along to the parser, which is better equipped to handle them. When an invalid character is encountered, that character and any invalid characters that follow should be gathered together into a string until the lexer finds a character that can begin a new token.