DIRECTORY Commander USING [CommandProc, Register], ExpertPCBRead USING [Part, PCBTable, ReadPCBFile], ExpertKeepRead USING [KeepRefDes, RefDesTable, ReadKeepFile], IO USING [GetTokenRope, int, card, PutF, RIS, rope, STREAM], Rope USING [Cat, ROPE], SymTab USING [EachPairAction, Pairs]; ReadPCBAndKeep: CEDAR PROGRAM IMPORTS Commander, ExpertKeepRead, ExpertPCBRead, IO, SymTab, Rope = BEGIN ROPE: TYPE = Rope.ROPE; ReadPCBAndKeepProc: Commander.CommandProc = BEGIN PrintOneLine: SymTab.EachPairAction ~ { part: ExpertPCBRead.Part _ NARROW[val]; IF ExpertKeepRead.KeepRefDes[keepTable, key] THEN { 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]]; }; }; pcbFile, keepFile: ROPE; pCBTable: ExpertPCBRead.PCBTable; keepTable: ExpertKeepRead.RefDesTable; stream: IO.STREAM _ IO.RIS[cmd.commandLine]; inputName: ROPE _ IO.GetTokenRope[stream].token; pcbFile _ Rope.Cat[inputName, ".pcb"]; keepFile _ Rope.Cat[inputName, ".keep"]; IO.PutF[cmd.out, "Reading %g\n", IO.rope[pcbFile]]; pCBTable _ ExpertPCBRead.ReadPCBFile[pcbFile]; IO.PutF[cmd.out, "Reading %g\n", IO.rope[keepFile]]; keepTable _ ExpertKeepRead.ReadKeepFile[keepFile]; [] _ SymTab.Pairs[pCBTable, PrintOneLine]; END; Commander.Register[ key: "ReadPCBAndKeep", proc: ReadPCBAndKeepProc, doc: "Test of some Expert.. modules"]; END. šFile: ReadPCBAndKeep.mesa Christophe Cuenod February 1, 1988 3:42:58 pm PST Reads a .pcb file and a Keep file and output the results on the screen Κk–i(firstHeadersAfterPage) {1} .cvx .def (firstPageNumber) {1} .cvx .def (oneSidedFormat) {.false} .cvx .def– "Cedar" style˜– "Cedar" stylešΟnœ™Icodešœ1™1—J™Iunit™FšΟk ˜ Kšœ žœ˜(Kšœžœ˜2Kšœžœ)˜=Kšžœžœ!žœžœ˜