GenOpNames.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Russ Atkinson (RRA) July 15, 1985 9:10:07 pm PDT
DIRECTORY
AMBridge,
AMMiniModel,
AMTypes,
BasicTime,
FS,
IO,
Rope,
UserCredentials USING [Get];
GenOpNames: CEDAR PROGRAM
IMPORTS AMBridge, AMMiniModel, AMTypes, BasicTime, FS, IO, UserCredentials
= BEGIN
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
TV: TYPE = AMTypes.TV;
Type: TYPE = AMTypes.Type;
Gen: PROC = TRUSTED {
iFace: Type = AMMiniModel.AcquireIRType["DragOpsCross.bcd"];
instX: NAT ← AMTypes.NameToIndex[iFace, "Inst"];
eVal: TV ← AMTypes.IndexToDefaultInitialValue[iFace, instX];
eType: Type ← AMTypes.UnderType[AMTypes.TVToType[eVal]];
each: TV ← AMTypes.First[eType];
st: STREAM = FS.StreamOpen["DragOps.names", create];
pos: NAT ← 3;
IO.PutRope[st, "-- DragOps.names\n"];
IO.PutF[st, " -- %g: %g\n", [rope[UserCredentials.Get[].name]], [time[BasicTime.Now[]]]];
IO.PutF[st, " -- from DragOpsCross.bcd of %g\n\n",
[time[FS.FileInfo["DragOpsCross.bcd"].created]]];
WHILE each # NIL DO
name: ROPENIL;
val: CARDINAL ← AMBridge.TVToCardinal[each];
name ← AMTypes.TVToName[each ! AMTypes.Error => CONTINUE];
IF name = NIL THEN name ← IO.PutFR["dX%b", [cardinal[val]]];
pos ← pos + 1;
IF pos = 4
THEN {pos ← 0; IO.PutRope[st, "\n"]};
IO.PutF[st, " %9g %4bB", [rope[name]], [cardinal[val]]];
each ← AMTypes.Next[each];
ENDLOOP;
IO.PutRope[st, "\n "];
IO.Close[st];
};
Gen[];
END.