File: ReadPCB.mesa
Christophe Cuenod January 29, 1988 1:48:16 pm PST
Reads a .pcb file and output the results on the screen
DIRECTORY
Commander USING [CommandProc, Register],
ExpertPCBRead USING [Part, PCBTable, ReadPCBFile],
IO USING [GetTokenRope, int, card, PutF, RIS, rope, STREAM],
Rope USING [ROPE],
SymTab USING [EachPairAction, Pairs];
ReadPCB: CEDAR PROGRAM
IMPORTS Commander, ExpertPCBRead, IO, SymTab =
BEGIN
ROPE: TYPE = Rope.ROPE;
ReadPCBProc: Commander.CommandProc = BEGIN
PrintOneLine: SymTab.EachPairAction ~ {
part: ExpertPCBRead.Part ← NARROW[val];
IO.PutF[cmd.out, "%g \torient: %g \tx: %g \ty: %g \tLibrary: %g\n", IO.rope[key], IO.int[part.orientation], IO.int[part.x], IO.int[part.y], IO.card[part.libraryEntry]];
};
pCBTable: ExpertPCBRead.PCBTable;
stream: IO.STREAMIO.RIS[cmd.commandLine];
inputName: ROPEIO.GetTokenRope[stream].token;
IO.PutF[cmd.out, "Reading %g\n", IO.rope[inputName]];
pCBTable ← ExpertPCBRead.ReadPCBFile[inputName];
[] ← SymTab.Pairs[pCBTable, PrintOneLine];
END;
Commander.Register[
key: "ReadPCB", proc: ReadPCBProc, doc: "Read an Expert .pcb file"];
END.