<> <> <<>> <> DIRECTORY Commander USING [CommandProc, Register], ExpertLibRead USING [LibEntry, LibTable, ReadLibFile], IO USING [GetCard, GetTokenRope, int, PutF, RIS, rope, STREAM], Rope USING [ROPE], IntHashTable USING [Fetch]; ExpertDescribePart: CEDAR PROGRAM IMPORTS Commander, ExpertLibRead, IO, IntHashTable = BEGIN ROPE: TYPE = Rope.ROPE; ExpertDescribePartProc: Commander.CommandProc = BEGIN entry: CARD; libEntry: ExpertLibRead.LibEntry; libTable: ExpertLibRead.LibTable; stream: IO.STREAM _ IO.RIS[cmd.commandLine]; inputName: ROPE _ IO.GetTokenRope[stream].token; entry _ IO.GetCard[stream]; IO.PutF[cmd.out, "Reading %g\n", IO.rope[inputName]]; libTable _ ExpertLibRead.ReadLibFile[inputName]; libEntry _ NARROW[IntHashTable.Fetch[libTable, entry].value]; FOR i : NAT IN [0..libEntry.size) DO IO.PutF[cmd.out, "\nPin %g \tPadStack %g", IO.int[i+1], IO.int[libEntry[i].padStack]]; ENDLOOP; IO.PutF[cmd.out, "\n\n%g %g\n", IO.rope[libEntry.partName], IO.rope[libEntry.partNumber]]; END; Commander.Register[ key: "ExpertDescribePart", proc: ExpertDescribePartProc, doc: "Read an Expert .lib file"]; END.