MakeDo.Mesa
Last Edited by: Spreitzer, April 8, 1985 4:23:45 pm PST
Carl Hauser, April 11, 1985 3:34:27 pm PST
DIRECTORY BasicTime, Commander, IO, List, RedBlackTree, Rope, TimeStamp;
MakeDo: CEDAR DEFINITIONS =
BEGIN
Warning: SIGNAL [message: ROPE];
Error: ERROR [message: ROPE];
ROPE: TYPE = Rope.ROPE;
RopeList: TYPE = LIST OF ROPE;
Stamp: TYPE = TimeStamp.Stamp;
Table: TYPE = RedBlackTree.Table;
PropList: TYPE = List.AList;
Ensure: PROC [ch: Commander.Handle, what, otherModifiable: RopeList, guessBoundary, dontDo, assumeAllInconsistent: BOOL] RETURNS [nFailed, nSucceeded, nSteps: NAT, failedSteps: CommandList, cmds: ROPE];
Ensure that given derived files are up-to-date; recursively explores sources.
IF dontDo, THEN don't actually execute the commands to bring things up-to-date, only return them in cmds ELSE cmds is returned empty.
Explain: PROC [ch: Commander.Handle, what: RopeList];
Explain why given files rederived or not.
currentCommanderHandle: Commander.Handle;
The current command; NIL if none.
GetNode: PROC [name: ROPE] RETURNS [node: Node];
NodeList: TYPE = LIST OF Node;
Node: TYPE = REF NodeRep; NodeRep: TYPE;
PublicPartsOfNode: PROC [n: Node] RETURNS [name: ROPE, producer: Command, derivedCmds, consumers: CommandList, props: PropList];
SetProps: PROC [node: Node, props: PropList];
SetLatest: PROC [node: Node, latest: BasicTime.GMT];
Needed: PROC [node: Node] RETURNS [BOOL];
Exists: PROC [n: Node, u: UpdateTimeProc ← NIL] RETURNS [exists: BOOL];
= {exists ← Latest[n, u] # BasicTime.nullGMT}
Latest: PROC [n: Node, u: UpdateTimeProc ← NIL] RETURNS [t: BasicTime.GMT];
= {
IF n.timeValid THEN RETURN [n.latest];
(IF u = NIL THEN n.producer.class.UpdateTime ELSE u)[n];
IF NOT n.timeValid THEN ERROR;
RETURN [n.latest]};
CommandList: TYPE = LIST OF Command;
Command: TYPE = REF CommandRep; CommandRep: TYPE;
PublicPartsOfCommand: PROC [c: Command] RETURNS [cmd: ROPE, makes, from: NodeList, foundData: REF ANY, needsToBeDone, failed: BOOL];
Finder: TYPE = RECORD [finderProc: FinderProc, finderData: REF ANYNIL];
FinderProc: TYPE = PROC [resultName: ROPE, finderData: REF ANY] RETURNS [found: BOOLEAN, sought: Node, makes, from, why: NodeList, cmd: ROPE, class: CommandClass, foundData: REF ANY];
CommandClass: TYPE = REF CommandClassRep;
CommandClassRep: TYPE = RECORD [
NotCurrent: NotCurrentProc,
Rederive: RederiveProc,
UpdateTime: UpdateTimeProc,
Explain: ExplainProc,
classData: REF ANYNIL];
AddFinder: PROC [finder: Finder, end: End];
End: TYPE = {front, back};
NotCurrentProc: TYPE = PROC [c: Command] RETURNS [notCurrent: BOOLEAN];
RederiveProc: TYPE = PROC [c: Command] RETURNS [from: NodeList, cmd: ROPE];
UpdateTimeProc: TYPE = PROC [n: Node];
ExplainProc: TYPE = PROC [c: Command, to: IO.STREAM];
FileTime: UpdateTimeProc;
Log: PROC [fmt: ROPE, v1, v2, v3, v4, v5: IO.Value ← [null[]]];
END.