SaffronErrorHandlingImpl.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
James Rauen, June 18, 1988 1:46:26 pm PDT
DIRECTORY
IO USING [int, PutF, rope, STREAM],
Rope USING [ROPE],
SaffronErrorHandling USING [];
SaffronErrorHandlingImpl:
CEDAR
PROGRAM
IMPORTS IO
EXPORTS SaffronErrorHandling
~ BEGIN
Message: PUBLIC SIGNAL[message: Rope.ROPE] ~ CODE;
Warning: PUBLIC SIGNAL[position: INT, reason: Rope.ROPE] ~ CODE;
Error: PUBLIC SIGNAL[position: INT, reason: Rope.ROPE] ~ CODE;
FatalError: PUBLIC ERROR[position: INT, reason: Rope.ROPE] ~ CODE;
InternalError: PUBLIC ERROR[reason: Rope.ROPE] ~ CODE;
ReportMessage:
PUBLIC
PROC[stream:
IO.
STREAM, count:
INT, message: Rope.
ROPE] ~
BEGIN
IO.PutF[stream, "Message #%g: %g\n", IO.int[count], IO.rope[message]]
END;
ReportWarning:
PUBLIC
PROC[stream:
IO.
STREAM, count:
INT, position:
INT, reason: Rope.
ROPE] ~
BEGIN
IO.PutF[stream, "Warning #%g at %g: %g\n", IO.int[count], IO.int[position], IO.rope[reason]]
END;
ReportError:
PUBLIC
PROC[stream:
IO.
STREAM, count:
INT, position:
INT, reason: Rope.
ROPE] ~
BEGIN
IO.PutF[stream, "Error #%g at %g: %g\n", IO.int[count], IO.int[position], IO.rope[reason]]
END;
ReportFatalError:
PUBLIC
PROC[stream:
IO.
STREAM, count:
INT, position:
INT, reason: Rope.
ROPE] ~
BEGIN
IO.PutF[stream, "Error #%g at %g: %g\n", IO.int[count], IO.int[position], IO.rope[reason]]
END;
ReportInternalError:
PUBLIC
PROC[stream:
IO.
STREAM, reason: Rope.
ROPE] ~
BEGIN
IO.PutF[stream, "Internal Error: %g\n", IO.rope[reason]]
END;
END.