<> <> <<>> <> 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.STREAM _ IO.RIS[cmd.commandLine]; inputName: ROPE _ IO.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.