ATTENTION! Error messages. The tests directory contains examples of error messages. Make sure your output is identical to those. The output of your program will be compared to expected output using diff, and if it returns a nonzero value, your program fails that test. There are many tests which were not disclosed to you, and if your program fails them all, you will have a hard time proving that your program works just fine, but outputs a slightly different error message. I want to give you a fair grade, so pretty please, with sugar on top, check the format of your error messages and save your time (and mine). -- A.K.
The tokens from the scanner are parser. If the source program is syntactically correct, the compiler outputs nothing. On the other hand, when your compiler discovers a syntactical error it issues an error message and exits. It does not continue processing the input. The parser outputs an error message for the first (and only) error it discovers.
Expected output consists of error messages only. Avoid printing extraneous messages as they can affect your grade. All messages have format:
filename: lineno: errormessagewhere filename is the name of the input file, lineno is the line on which the error was detected, and errormessage is the error message. Error message from scanner can be
unterminated stringor
Illegal character (c)where c is the illegal character. Error message from parser can be
syntax error near YYTEXTwhere YYTEXT is the text corresponding to the token which causes the error. See some examples in the test directory. No more errors can be detected at this point.