File: ReadPin.mesa
Christophe Cuenod February 2, 1988 1:56:12 pm PST
Reads a .pinlist file and output the results on the screen
DIRECTORY
Commander USING [CommandProc, Register],
ExpertPinRead USING [PinTable, PinInfoList, ReadPinFile],
IO USING [GetTokenRope, int, PutF, RIS, rope, STREAM],
Rope USING [ROPE],
SymTab USING [EachPairAction, Pairs];
ReadPin:
CEDAR
PROGRAM
IMPORTS Commander, ExpertPinRead, IO, SymTab =
BEGIN
ROPE: TYPE = Rope.ROPE;
ReadPinProc: Commander.CommandProc =
BEGIN
PrintOneLine: SymTab.EachPairAction ~ {
pinInfoList: ExpertPinRead.PinInfoList ← NARROW[val];
IF pinInfoList.rest =
NIL
THEN {
IO.PutF[cmd.out, "%g \t%g \tpin %g \tpage %g\n", IO.rope[key], IO.rope[pinInfoList.first.refDes], IO.int[pinInfoList.first.pinNumber], IO.int[pinInfoList.first.pageNumber]];
};
};
pinTable: ExpertPinRead.PinTable;
stream: IO.STREAM ← IO.RIS[cmd.commandLine];
inputName: ROPE ← IO.GetTokenRope[stream].token;
IO.PutF[cmd.out, "Reading %g\n", IO.rope[inputName]];
pinTable ← ExpertPinRead.ReadPinFile[inputName];
[] ← SymTab.Pairs[pinTable, PrintOneLine];
END;
Commander.Register[
key: "ReadPin", proc: ReadPinProc, doc: "Read an Expert .pcb file"];
END.