SELECT kind
FROM
null => RETURN [RCMap.nullIndex];
ref => RETURN [RCMap.refIndex];
controlLink => RETURN [RCMap.controlLinkIndex];
oneRef => {
rp ¬ uz.NEW[RCMap.Object ¬ [oneRef[offset: getNext[]]]];
};
simple => {
code: CARD16 ¬ getNext[];
len: CARD16 ¬ 0;
rpp: LONG POINTER TO RCMap.Object.simple ¬ uz.NEW[RCMap.Object.simple ¬ [simple[]]];
needs more work here
rp ¬ rpp;
};
linked => {
first: INT ¬ getNext[];
rest: RCMap.Index ¬ inner[];
rpp: LONG POINTER TO RCMap.Object.linked ¬ uz.NEW[RCMap.Object.linked ¬ [linked[first: first, rest: rest]]];
rp ¬ rpp;
};
nonVariant => {
n: NAT ¬ getNext[];
rpp: LONG POINTER TO RCMap.Object.nonVariant ¬ uz.NEW[RCMap.Object.nonVariant[n]];
FOR i:
NAT
IN [0..n)
DO
offset: INT ¬ getNext[];
index: RCMap.Index ¬ inner[];
rpp[i] ¬ [offset, index];
ENDLOOP;
rp ¬ rpp;
};
variant => {
tagOffset: INT ¬ getNext[];
tagCount: INT ¬ getNext[];
n: NAT ¬ getNext[];
rpp: LONG POINTER TO RCMap.Object.variant ¬ uz.NEW[RCMap.Object.variant[n]];
rpp.fdTag ¬ [bitOffset: tagOffset, bitCount: tagCount];
FOR i:
NAT
IN [0..n)
DO
index: RCMap.Index ¬ inner[];
rpp[i] ¬ index;
ENDLOOP;
rp ¬ rpp;
};
array => {
unitsPerElement: INT ¬ getNext[];
nElements: INT ¬ getNext[];
index: RCMap.Index ¬ inner[];
rpp:
LONG
POINTER
TO RCMap.Object.array
¬ uz.NEW[RCMap.Object.array ¬ [array[
unitsPerElement: unitsPerElement,
nElements: nElements,
rcmi: index]]];
rp ¬ rpp;
};
array => {
offset: INT ¬ getNext[];
unitsPerElement: INT ¬ getNext[];
tagOffset: INT ¬ getNext[];
tagCount: INT ¬ getNext[];
common: RCMap.Index ¬ inner[];
dataOffset: INT ¬ getNext[];
index: RCMap.Index ¬ inner[];
rpp:
LONG
POINTER
TO RCMap.Object.sequence
¬ uz.NEW[RCMap.Object.sequence ¬ [sequence[
offset: offset,
unitsPerElement: unitsPerElement,
fdLength: [tagOffset, tagCount],
commonPart: common,
dataOffset: dataOffset,
rcmi: index]]];
rp ¬ rpp;
};
ENDCASE;