IFUAsmRun.mesa
Copyright c 1985 by Xerox Corporation. All rights reserved.
Last Edited by Curry, January 28, 1986 4:44:49 pm PST
DIRECTORY
CD,
CDFrame,
CDIO,
Commander,
CommandTool,
IFUPW,
IFUPWControl,
IFUAsm,
IO,
Rope;
IFUAsmRun: CEDAR PROGRAM
IMPORTS CDFrame, CDIO, Commander, CommandTool, IFUAsm, IFUPW, IFUPWControl, Rope =
BEGIN OPEN IFUAsm;
design: CD.Design;
RunCT: Commander.CommandProc = {
nofArgs:  INT    ← CommandTool.NumArgs[cmd];
top:   CDFrame.Frame ← Complete;
expand:  BOOL    ← FALSE;
build:   LIST OF Rope.ROPE;
write:   LIST OF Rope.ROPELIST[ -- default list of saved shells
"IFUAsmLeftColumn",
"IFUAsmDataColumnCore",
"IFUAsmDataColumn",
"IFUAsmRightColumn"];
list:   LIST OF Rope.ROPE;
comlist:  LIST OF Rope.ROPE ← CommandTool.ParseToList[cmd].list;
design  ← IFUPW.GetDesign[IFUAsm.RefDesign[]];
FOR list ← comlist, list.rest WHILE list#NIL DO
Next: PROC RETURNS[next: Rope.ROPE] =
{IF list.rest=NIL THEN ERROR; list ← list.rest; next ← list.first};
SELECT list.first.Fetch[0] FROM
'- => SELECT list.first.Fetch[1] FROM
'R, 'r  => IF NOT CDFrame.ReadShellFrame[top, Next[]].done THEN ERROR;
'W, 'w => write  ← CONS[Next[], write];
'B, 'b  => build  ← CONS[Next[], build];
'E, 'e  => expand ← TRUE;
ENDCASE;
ENDCASE => build  ← CONS[list.first, build];
ENDLOOP;
IF build.rest # NIL OR build.first=NIL THEN ERROR;
top   ← IFUPWControl.BuildFrame[top,  build.first, design].new;
FOR list: LIST OF Rope.ROPE ← write, list.rest WHILE list#NIL DO
top  ← CDFrame.WriteShellFrame[top,  list.first ].new ENDLOOP;
IF expand THEN {
IFUPWControl.IncludeRecursiveInDesign[design]; -- make it real
[ ] ← CDIO.WriteDesign[design, build.first]};
IFUPW.AssembleFrame[design, top, NIL, build.first]};
Commander.Register  [proc:   RunCT, key: "IFUAsmRun"];
END.