DIRECTORY Asserting, AssertingIO, FS, IO, Rope, RoseCreate, RoseTranslateTypes, RoseTranslateInsides, RoseTypes; RopePorts: CEDAR PROGRAM IMPORTS AssertingIO, FS, IO, RoseTranslateInsides EXPORTS RoseCreate = BEGIN OPEN RoseTypes, RoseTranslateTypes, RoseTranslateInsides; PortsFromROPE: PUBLIC PROC [asRope: ROPE] RETURNS [ports: Ports] = {ports _ PortsFromStream[IO.RIS[asRope]]}; PortsFromFile: PUBLIC PROC [fileName: ROPE] RETURNS [ports: Ports] = {ports _ PortsFromStream[FS.StreamOpen[fileName]]}; PortsFromStream: PUBLIC PROC [stream: STREAM] RETURNS [ports: Ports] = BEGIN length: CARDINAL _ stream.GetCard[]; ports _ NEW [PortsRep[length]]; FOR portIndex: CARDINAL IN [0 .. length) DO job: Job _ NEW [JobRep _ [ exec: NIL, rootName: NIL, from: NIL, log: viewerLog, type: Other]]; any: REF ANY; bits: [0 .. 16); typeAsRope: ROPE; ports[portIndex].firstWord _ stream.GetCard[]; ports[portIndex].wordCount _ stream.GetCard[]; ports[portIndex].name _ stream.GetRopeLiteral[]; typeAsRope _ stream.GetRopeLiteral[]; job.from _ IO.RIS[typeAsRope]; any _ ParseExpression[job]; WITH any SELECT FROM sti: SignalTypeInvocation => ports[portIndex].type _ sti.st; id: ID => {sti: SignalTypeInvocation _ InstantiateSignalType[job, id.rope, NIL]; ports[portIndex].type _ sti.st}; ENDCASE => ERROR; bits _ stream.GetCard[]; ports[portIndex].input _ (bits MOD 2) >= 1; ports[portIndex].output _ (bits MOD 4) >= 2; ports[portIndex].XPhobic _ (bits MOD 8) >= 4; ports[portIndex].special _ (bits MOD 16) >= 8; ports[portIndex].other _ AssertingIO.Read[stream]; ENDLOOP; [] _ stream.SkipWhitespace[flushComments: FALSE]; IF NOT stream.EndOf[] THEN ERROR; END; END. PRopePorts.Mesa last edited by Spreitzer September 6, 1984 3:35:43 pm PDT ΚT– "cedar" style˜Icode™K™9K˜KšΟk œœœH˜pK˜šΠbx œœ˜Kšœœœ˜1Kšœ ˜—K˜Kšœœ5˜?K˜š Οn œœœ œœ˜BKšœœœ ˜*—K˜š Ÿ œœœ œœ˜DKšœœ˜3—K˜š Ÿœœœ œœ˜FKš˜Kšœœ˜$Kšœœ˜šœ œœ˜+šœ œ ˜Kšœœ˜ Kšœ œ˜Kšœœ˜ Kšœ˜K˜—Kšœœœ˜ K˜Kšœ œ˜Kšœ.˜.Kšœ.˜.Kšœ0˜0Kšœ%˜%Kšœ œœ ˜Kšœ˜šœœ˜Kšœ<˜