ExpertFindPadStack.mesa
Christophe Cuenod May 10, 1988 3:50:51 pm PDT
Reads a .lib file and lists all the part pins with a given PadStack
DIRECTORY
Commander USING [CommandProc, Register],
ExpertLibRead USING [LibEntry, LibTable, ReadLibFile],
IO USING [card, GetCard, GetTokenRope, int, PutF, RIS, rope, STREAM],
Rope USING [ROPE],
IntHashTable USING [EachPairAction, Pairs];
ExpertFindPadStack:
CEDAR
PROGRAM
IMPORTS Commander, ExpertLibRead, IO, IntHashTable =
BEGIN
ROPE: TYPE = Rope.ROPE;
ExpertFindPadStackProc: Commander.CommandProc =
BEGIN
PrintGivenPadStack: IntHashTable.EachPairAction ~ {
libEntry: ExpertLibRead.LibEntry ← NARROW[value];
FOR i :
NAT
IN [0..libEntry.size)
DO
IF libEntry[i].padStack = padStack
THEN {
IO.PutF[cmd.out, "Part: %g\tPin %g \tPadStack %g", IO.card[key], IO.int[i+1], IO.int[libEntry[i].padStack]];
IO.PutF[cmd.out, "\t%g\t%g\n", IO.rope[libEntry.partName], IO.rope[libEntry.partNumber]];
};
ENDLOOP;
};
padStack: CARD;
libTable: ExpertLibRead.LibTable;
stream: IO.STREAM ← IO.RIS[cmd.commandLine];
inputName: ROPE ← IO.GetTokenRope[stream].token;
padStack ← IO.GetCard[stream];
IO.PutF[cmd.out, "Reading %g\n", IO.rope[inputName]];
libTable ← ExpertLibRead.ReadLibFile[inputName];
[] ← IntHashTable.Pairs[libTable, PrintGivenPadStack];
END;
Commander.Register[
key: "ExpertFindPadStack", proc: ExpertFindPadStackProc, doc: "Read an Expert .lib file and lists all the part pins with a given PadStack"];
END.