FOR portIndex:
CARDINAL
IN [0 .. length)
DO
job: Job ←
NEW [JobRep ← [
exec: NIL,
rootName: NIL,
from: stream,
log: viewerLog,
type: Other]];
any: REF ANY;
bits: [0 .. 16);
terminator: ROPE;
ports[portIndex].firstWord ← stream.GetCard[];
ports[portIndex].wordCount ← stream.GetCard[];
ports[portIndex].name ← stream.GetRopeLiteral[];
[any, terminator] ← ParseExpression[job, TRUE];
IF NOT terminator.Equal["!!"] THEN ERROR;
WITH any
SELECT
FROM
sti: SignalTypeInvocation => ports[portIndex].type ← sti.st;
rope: ROPE => {sti: SignalTypeInvocation ← InstantiateSignalType[job, 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;
ENDLOOP;