-- File ParserError.mesa -- March 1, 1980 1:51 PM DIRECTORY ParserInputDefs: FROM "ParserInputDefs" USING [Identify], OutputDefs: FROM "OutputDefs" USING [SendMessage], ParserErrorDefs: FROM "ParserErrorDefs" USING [ErrorType]; ParserError: PROGRAM IMPORTS ParserInputDefs, OutputDefs EXPORTS ParserErrorDefs = BEGIN errorCounts: ARRAY ParserErrorDefs.ErrorType[FIRST[ParserErrorDefs.ErrorType].. LAST[ParserErrorDefs.ErrorType]] OF CARDINAL; ParserAbort: PUBLIC ERROR = CODE; InitError: PUBLIC PROCEDURE RETURNS [BOOLEAN] = BEGIN errorCounts _ ALL[0]; RETURN[TRUE]; END; FinishError: PUBLIC PROCEDURE RETURNS [BOOLEAN] = BEGIN RETURN[TRUE]; END; Report: PUBLIC PROCEDURE [message: STRING, error: ParserErrorDefs.ErrorType] = BEGIN OPEN OutputDefs; IF error = Advisory THEN SendMessage[Advisory, "Warning: ", FALSE]; SendMessage[error, message]; ParserInputDefs.Identify[]; errorCounts[error] _ errorCounts[error] + 1; IF error = FatalInternal THEN -- horrors, abort BEGIN SendMessage[FatalInternal, "Aborting, please wait"]; ERROR ParserAbort; END; END; ErrorSummary: PUBLIC PROCEDURE RETURNS [ARRAY ParserErrorDefs.ErrorType[FIRST[ParserErrorDefs.ErrorType].. LAST[ParserErrorDefs.ErrorType]] OF CARDINAL] = BEGIN RETURN[errorCounts]; END; END. (670)\159v11V64b11B216b12B22b1B1b9B96b11B72b6B111i8I18i8I145i13I51i13I67b12B