<<>> <> <> <> <> <> <> <> <<>> <> DIRECTORY Ascii, Commander, IO, MakeDoBasics, RefTab, Rope; MakeDoBasic2Impl: CEDAR PROGRAM IMPORTS Ascii, RefTab EXPORTS MakeDoBasics <> <> = BEGIN OPEN MakeDoBasics; UnknownRegistration: ERROR = CODE; ROPE: TYPE ~ Rope.ROPE; registrationTable: RefTab.Ref ~ RefTab.Create[]; MakeDoReporter: ROPE ~ "MakeDo.Reporter"; currentReporter: MakeDoBasics.Reporter _ NIL; DestroyAuxBox: PUBLIC PROC = { IF currentReporter = NIL THEN SelectReporter[]; currentReporter.destroyAuxBox[]; }; AuxBoxDestroyed: PUBLIC PROC RETURNS [BOOL] = { IF currentReporter = NIL THEN SelectReporter[]; RETURN [currentReporter.auxBoxDestroyed[]]; }; Buffer: PUBLIC PROC [e: Execution] = { IF currentReporter = NIL THEN SelectReporter[]; currentReporter.buffer[e]; }; Msg: PUBLIC PROC [ch: Commander.Handle, format: ROPE, v1, v2, v3, v4, v5: IO.Value _ [null[]]] = { IF currentReporter = NIL THEN SelectReporter[]; currentReporter.msg[ch, format, v1, v2, v3, v4, v5]; }; Flush: PUBLIC PROC [e: Execution, long, abandon: BOOL, asRope: ROPE] = { IF currentReporter = NIL THEN SelectReporter[]; currentReporter.flush[e, long, abandon, asRope]; }; RegisterReporter: PUBLIC PROC [key: ATOM, reporter: Reporter] = { IF NOT registrationTable.Store[key, reporter] THEN ERROR; currentReporter _ reporter; --thus order of starting is important }; Upper: PROC [old: CHAR] RETURNS [new: CHAR] ~ { RETURN [Ascii.Upper[old]]; }; SelectReporter: PROC ~ { ERROR UnknownRegistration; << <> reporterTypeRope: ROPE ~ Rope.Translate[ base: UserProfile.Token[MakeDoReporter, MakeDoBasics.defaultReporter], translator: Upper]; reporterType: ATOM ~ Convert.AtomFromRope[reporterTypeRope]; val: RefTab.Val; found: BOOL; [found: found, val: val] _ registrationTable.Fetch[reporterType]; IF NOT found THEN ERROR UnknownRegistration; currentReporter _ NARROW[val]; >> }; END.