WITH iType: iSeb[iSei]
SELECT
FROM
enumerated => {
tCtx: CTXIndex;
sei ← MakeNonCtxSe[SERecord.cons.enumerated.SIZE];
tCtx ←
IF iType.valueCtx
IN StandardContext
THEN iType.valueCtx
ELSE CopyIncludedValues[iType.unpainted, iType.valueCtx, mdi, sei];
seb[sei].typeInfo ← enumerated[
ordered: iType.ordered,
machineDep: iType.machineDep,
unpainted: iType.unpainted,
sparse: iType.sparse,
valueCtx: tCtx,
empty: iType.empty,
nValues: iType.nValues];
CacheType[mdi, iSei, sei]};
record => {
tCtx: CTXIndex =
IF iType.fieldCtx
IN StandardContext
THEN iType.fieldCtx
ELSE MapCtx[mdi, iType.fieldCtx];
WITH iType
SELECT
FROM
notLinked => {
sei ← MakeNonCtxSe[SERecord.cons.record.notLinked.SIZE];
CacheType[mdi, iSei, sei];
seb[sei].typeInfo ← record[
machineDep: iType.machineDep,
painted: iType.painted,
argument: iType.argument,
hints: iType.hints,
fieldCtx: tCtx,
length: iType.length,
monitored: iType.monitored,
linkPart: notLinked[]]};
linked => {
sei ← MakeNonCtxSe[SERecord.cons.record.linked.SIZE];
CacheType[mdi, iSei, sei];
tSei1 ← CopyIncludedSymbol[linkType, mdi];
seb[sei].typeInfo ← record[
machineDep: iType.machineDep,
painted: iType.painted,
argument: iType.argument,
hints: iType.hints,
fieldCtx: tCtx,
length: iType.length,
monitored: iType.monitored,
linkPart: linked[linkType: tSei1]]};
ENDCASE;
IF ~iType.painted
OR (iType.hints.refField
AND iType.hints.unifield)
THEN
CopyContext[tCtx, iType.fieldCtx, mdi, unit]};
ref => {
sei ← MakeNonCtxSe[SERecord.cons.ref.SIZE];
CacheType[mdi, iSei, sei];
tSei1 ← CopyIncludedSymbol[iType.refType, mdi];
seb[sei].typeInfo ← ref[
refType: tSei1,
counted: iType.counted,
var: iType.var,
readOnly: iType.readOnly,
ordered: iType.ordered,
list: iType.list,
basing: iType.basing]};
array => {
sei ← MakeNonCtxSe[SERecord.cons.array.SIZE];
CacheType[mdi, iSei, sei];
tSei1 ← CopyIncludedSymbol[iType.indexType, mdi];
tSei2 ← CopyIncludedSymbol[iType.componentType, mdi];
seb[sei].typeInfo ← array[
packed: iType.packed,
indexType: tSei1,
componentType: tSei2]};
arraydesc => {
sei ← MakeNonCtxSe[SERecord.cons.arraydesc.SIZE];
CacheType[mdi, iSei, sei];
tSei1 ← CopyIncludedSymbol[iType.describedType, mdi];
seb[sei].typeInfo ← arraydesc[
readOnly: iType.readOnly, var: iType.var,
describedType: tSei1]};
transfer => {
-- do not use cache (in case of importing)
argSei1, argSei2: CSEIndex;
sei ← MakeNonCtxSe[SERecord.cons.transfer.SIZE];
argSei1 ← CopyArgs[iType.typeIn, mdi, FALSE];
argSei2 ← CopyArgs[iType.typeOut, mdi, FALSE];
seb[sei].typeInfo ← transfer[
mode: iType.mode, safe: iType.safe,
typeIn: argSei1, typeOut: argSei2]};
definition => {
sei ← MakeNonCtxSe[SERecord.cons.definition.SIZE];
seb[sei].typeInfo ← definition[
nGfi: iType.nGfi,
named: iType.named,
defCtx: MapCtx[mdi, iType.defCtx]]};
union => {
tag: ISEIndex;
tCtx: CTXIndex;
sei ← MakeNonCtxSe[SERecord.cons.union.SIZE];
CacheType[mdi, iSei, sei];
tCtx ← MapCtx[mdi, iType.caseCtx];
tag ← CopyCtxSe[iType.tagSei, MapHti[iSeb[iType.tagSei].hash], CTXNull, mdi];
seb[sei].typeInfo ← union[
caseCtx: tCtx,
machineDep: iType.machineDep,
overlaid: iType.overlaid,
controlled: iType.controlled,
tagSei: tag,
hints: iType.hints]};
sequence => {
tag: ISEIndex;
sei ← MakeNonCtxSe[SERecord.cons.sequence.SIZE];
CacheType[mdi, iSei, sei];
tSei1 ← CopyIncludedSymbol[iType.componentType, mdi];
tag ← CopyCtxSe[iType.tagSei, MapHti[iSeb[iType.tagSei].hash], CTXNull, mdi];
seb[sei].typeInfo ← sequence[
packed: iType.packed,
controlled: iType.controlled,
machineDep: iType.machineDep,
tagSei: tag,
componentType: tSei1]};
relative => {
tSei3: SEIndex;
sei ← MakeNonCtxSe[SERecord.cons.relative.SIZE];
CacheType[mdi, iSei, sei];
tSei1 ← CopyIncludedSymbol[iType.baseType, mdi];
tSei2 ← CopyIncludedSymbol[iType.offsetType, mdi];
tSei3 ←
IF iType.resultType = iType.offsetType
THEN tSei2
ELSE CopyIncludedSymbol[iType.resultType, mdi];
seb[sei].typeInfo ← relative[
baseType: tSei1,
offsetType: tSei2,
resultType: tSei3]};
opaque => {
sei ← MakeNonCtxSe[SERecord.cons.opaque.SIZE];
CacheType[mdi, iSei, sei];
tSei1 ← CopyIncludedSymbol[iType.id, mdi];
seb[sei].typeInfo ← opaque[
lengthKnown: iType.lengthKnown,
length: iType.length,
id: LOOPHOLE[tSei1]]};
zone => {
sei ← MakeNonCtxSe[SERecord.cons.zone.SIZE];
seb[sei].typeInfo ← zone[mds: iType.mds, counted: iType.counted];
CacheType[mdi, iSei, sei]};
subrange => {
sei ← MakeNonCtxSe[SERecord.cons.subrange.SIZE];
tSei1 ← CopyIncludedSymbol[iType.rangeType, mdi];
seb[sei].typeInfo ← subrange[
filled: iType.filled,
empty: iType.empty,
rangeType: tSei1,
origin: iType.origin,
range: iType.range];
CacheType[mdi, iSei, sei]};
long => {
sei ← MakeNonCtxSe[SERecord.cons.long.SIZE];
CacheType[mdi, iSei, sei];
tSei1 ← CopyIncludedSymbol[iType.rangeType, mdi];
seb[sei].typeInfo ← long[rangeType: tSei1]};
real => {
sei ← MakeNonCtxSe[SERecord.cons.real.SIZE];
CacheType[mdi, iSei, sei];
tSei1 ← CopyIncludedSymbol[iType.rangeType, mdi];
seb[sei].typeInfo ← real[rangeType: tSei1]};
any => {
sei ← MakeNonCtxSe[SERecord.cons.any.SIZE]; seb[sei].typeInfo ← any[];
CacheType[mdi, iSei, sei]};
ENDCASE => ERROR;