SaffronErrorHandling.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
James Rauen, June 18, 1988 1:40:38 pm PDT
Last edited by: James Rauen June 20, 1988 8:57:52 am PDT
SaffronErrorHandling:
CEDAR
DEFINITIONS ~
BEGIN
The Message signal (for debugging only) prints a message on the output stream. Warning and Error signals print a message; Error also terminates the compilation after the current phase completes. FatalError is like Error, except that it immediately terminates the compilation. InternalError is used to report internal Saffron errors. It immediately terminates the compilation. All of these signals are handled by the driver (SaffronDriver.mesa).
Message: SIGNAL[message: Rope.ROPE];
Warning: SIGNAL[position: INT, reason: Rope.ROPE];
Error: SIGNAL[position: INT, reason: Rope.ROPE];
FatalError: ERROR[position: INT, reason: Rope.ROPE];
InternalError: ERROR[reason: Rope.ROPE];
An alternative which avoids explicitly signalling.
SignalMessage:
PROC[message: Rope.
ROPE] ~
INLINE {
SIGNAL Message[message]; };
SignalWarning:
PROC[position:
INT, reason: Rope.
ROPE] ~
INLINE {
SIGNAL Warning[position, reason]; };
SignalError:
PROC[position:
INT, reason: Rope.
ROPE] ~
INLINE {
SIGNAL Error[position, reason]; };
ErrorFatalError:
PROC[position:
INT, reason: Rope.
ROPE] ~
INLINE {
ERROR FatalError[position, reason]; };
ErrorInternalError:
PROC[reason: Rope.
ROPE] ~
INLINE {
ERROR InternalError[reason]; };
These procedures are called by the driver to report errors.
ReportMessage: PROC[stream: IO.STREAM, count: INT, message: Rope.ROPE];
ReportWarning: PROC[stream: IO.STREAM, count: INT, position: INT, reason: Rope.ROPE];
ReportError: PROC[stream: IO.STREAM, count: INT, position: INT, reason: Rope.ROPE];
ReportFatalError: PROC[stream: IO.STREAM, count: INT, position: INT, reason: Rope.ROPE];
ReportInternalError: PROC[stream: IO.STREAM, reason: Rope.ROPE];
END.