If a runaway comment is encountered, the driver should print an appropriate error message, noting where the comment started. The scanner should leave the file pointer pointing to the end of file character. Then, when the driver calls the scanner again, the scanner will return the end of file token, and the driver will terminate as it usually would upon receiving this token.
If a runaway string is encountered, the driver should indicate where the string started and give an appropriate error message. The file pointer should be left pointing at the end of line character that terminated the runaway string.
For other scanning errors, the scanner should leave the file pointer pointing to first character after the character examined by the dispatcher.