MicroListingImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Willie-sue, February 24, 1986 5:31:19 pm PST
taken from MicList.bcpl
DIRECTORY
IO,
Rope,
MicroDefs,
MicroGlobalVars,
MicroOps;
MicroListingImpl: CEDAR PROGRAM
IMPORTS
IO, Rope,
MicroDefs, MicroGlobalVars, MicroOps
EXPORTS
MicroOps
= BEGIN OPEN MicroGlobalVars, MicroDefs;
ROPE: TYPE = Rope.ROPE;
ListLocation: PUBLIC PROC[symIndex: INTEGER, inc: INTEGER] = {
Write location
IF listingFileRec = NIL OR listingFileRec.strm = NIL THEN RETURN;
IF symIndex # 0 THEN {
name: ROPE = MicroOps.GetSymbol[symIndex].name;
FOR i: INT IN [0.. name.Length[]) DO
listingFileRec.strm.PutChar[name.Fetch[i]];
ENDLOOP;
IF inc > 0 THEN listingFileRec.strm.PutChar['+];
};
IF inc # 0 THEN listingFileRec.strm.PutF[NIL, IO.int[inc]];
};
ReportError: PUBLIC PROC[msg: ROPE, abort: BOOL] = {
reportStrm.PutRope[msg];
IF errorFileRec # NIL AND errorFileRec.strm # NIL THEN errorFileRec.strm.PutRope[msg];
MicroOps.PrintStatement[reportStrm];
IF abort THEN {
IF errorCount = 0 THEN errorCount ← 1;
ERROR MicroDefs.Error["**** Fatal error, abort\n"];
};
IF (errorCount ← errorCount + 1) > errmax THEN
ERROR MicroDefs.Error["**** Too many errors, abort\n"];
};
ListWord: PUBLIC PROC[acw, listBuf: WordSeq, mem: Memory,
 location: INTEGER, options: WORD] = {
Produce expanded listing of word
};
END.