[ivy]<Satterthwaite>Mimosa>RCMap.mesa!2

InternalRCMap.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Rovner On 22-Jul-81 9:43:28
Russ Atkinson (RRA) January 31, 1985 12:48:07 pm PST
Satterthwaite June 16, 1986 12:09:17 pm PDT
RCMap: DEFINITIONS = {
TYPES
Base: TYPE = LONG BASE POINTER;
Limit: CARDINAL = 40000B; -- plenty ?
Object: TYPE = RECORD [
map: SELECT type: * FROM
Note: the null, ref, controlLink, oneRef, and simple variants must be 1 word long
null => [],
ref => [],
controlLink => [],
oneRef => [ offset: [0..componentLength) ← 0],
simple => [
length: [0..simpleLength] ← 0,
refs: PACKED ARRAY [0..simpleLength) OF BOOL ← ALL[FALSE]],
nonVariant => [
complete: BOOL ← FALSE,
nComponents: [0..componentLength/2) ← 0,
components: ARRAY [0..0) OF RCField],
variant => [
NOTE the specified RCMap for each variant includes all common parts
complete: BOOL ← FALSE,
nVariants: [0..componentLength/2) ← 0,
fdTag: FieldDescriptor ← [],
variants: ARRAY [0..0) OF Index -- indexed by tag value
],
array => [
unitsPerElement: [0..componentLength) ← 0,
nElements: CARDINAL ← 0,
rcmi: Index ← nullIndex
],
sequence => [
unitsPerElement: [0..componentLength) ← 0,
fdLength: FieldDescriptor ← [], -- actual number of elements is stored here
commonPart: Index ← nullIndex,
dataOffset: CARDINAL ← 0, -- actual data begins here
rcmi: Index ← nullIndex
],
ENDCASE];
RCField: TYPE = RECORD [
describes an RC field in a record
wordOffset: CARDINAL ← 0 | TRASH,
rcmi: Index ← nullIndex | TRASH
];
FieldDescriptor: TYPE = RECORD [
wordOffset: INTEGER ← 0,
bitFirst: [0..15] ← 0, -- 4 bits
bitCount: [1..32] ← 1, -- 5 bits
fill: [0..177B] ← 0 -- 7 bits
];
Index: TYPE = Base RELATIVE POINTER [0..Limit) TO Object;
VIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO Object.variant;
NVIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO Object.nonVariant;
AIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO Object.array;
SeqIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO Object.sequence;
SimpIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO Object.simple;
OneRefIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO Object.oneRef;
NullIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO Object.null;
RefIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO Object.ref;
ControlLinkIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO Object.controlLink;
CONSTANTS
componentMaxIndex: CARDINAL = CARDINAL.LAST/16;
leave room for Object.type in length word
componentLength: CARDINAL = componentMaxIndex+1;
simpleMaxIndex: CARDINAL = 7; -- 4 bits for Object.type, 4 for length, 8 BOOLEANs
simpleLength: CARDINAL = simpleMaxIndex+1;
invalidIndex: Index = Index.LAST; -- guaranteed to be an invalid Index
nullIndex: NullIndex = LOOPHOLE[0]; -- always at index 0 in the Base
refIndex: RefIndex = LOOPHOLE[1]; -- always at index 1 in the Base
controlLinkIndex: ControlLinkIndex = LOOPHOLE[2]; -- always at index 2 in the Base
}.