void report(type, fatal, group, set, i1,i2,i3,i4,i5,i6,i7,i8,i9,i10)

- report an error message int type; int fatal; P_Group group; P_Set set; int i1,i2,i3,i4,i5,i6,i7,i8,i9,i10;

void fatal_report()

- report and exit

If an error occurs report() is called with the error type type and the appropriate error-message is printed on standard error output. If the error is fatal, fatal equals TRUE and the fatal error is remembered. On encountering a fatal error, the number of errors is increased. An error can introduce more errors on the same line, so the number of errors is increased only when the linenumber is not the same as the linenumber of the previous error. The maximum number of errors to be printed is MAXERRORS (see ``types.h''), which is 60. Note that this can be less than the actual number of printed errors. Errors occurring on the same line are only counted once.

The additional information such as the name of the attribute, the name of the element, etc. are stored in i1, ..., i10, group and set

The format of the error-message is as follows. First the line containing the error is printed. Underneath this line, a line containing an `^' is printed. The `^' indicates the last character read by the parser. Note that the error might have occurred earlier. Next the error-message itself is printed, preceded by the current filename and line number.

fatal_report() checks whether a fatal error has occurred and if so, prints an error-message and exits. fatal_report() is called at various places in the program, to stop processing.

report.c report.h