MakeDoFinders.Mesa
Last Edited by: Spreitzer, September 6, 1985 11:46:06 am PDT
DIRECTORY Basics, IO, MakeDo, MakeDoPrivate, PrincOpsUtils, Process, RedBlackTree, Rope, ViewerClasses, ViewerIO;
MakeDoFinders:
CEDAR
MONITOR
EXPORTS MakeDo, MakeDoPrivate
=
INVARIANT
finders lists Finders.
BEGIN OPEN MakeDo, MakeDoPrivate;
NodeRep: PUBLIC TYPE = MakeDoPrivate.NodeRep;
ActionRep: PUBLIC TYPE = MakeDoPrivate.ActionRep;
finders: LIST OF Finder ← NIL;
AddFinder:
PUBLIC
ENTRY
PROC [finder: Finder, end: End] =
BEGIN ENABLE UNWIND => {};
SELECT end
FROM
front => finders ← CONS[finder, finders];
back => {fl:
LIST
OF Finder;
IF finders = NIL THEN {finders ← LIST[finder]; RETURN};
FOR fl ← finders, fl.rest WHILE fl.rest # NIL DO NULL ENDLOOP;
fl.rest ← LIST[finder]};
ENDCASE => ERROR;
END;
EnumerateFinders:
PUBLIC
ENTRY
PROC [to:
PROC [Finder]] = {
ENABLE UNWIND => {};
x: BOOL ← FALSE;
x ← x;
FOR fl:
LIST
OF Finder ← finders, fl.rest
WHILE fl #
NIL
DO
to[fl.first];
ENDLOOP;
x ← x;
};
END.