PrefillSymbols:
PUBLIC
PROC = {
OPEN dataPtr;
tSei: CSEIndex;
rSei: RecordSEIndex;
tCtx: CTXIndex;
sei, seChain: ISEIndex;
outerChain: ISEIndex;
NextOuterSe:
PROC
RETURNS [next: ISEIndex] = {
IF outerChain = ISENull THEN ERROR;
next ← outerChain; outerChain ← NextSe[outerChain]; RETURN};
idNAT: ISEIndex;
(dataPtr.table).AddNotify[P1Notify];
tSei ← MakeBasicType[codeANY, TRUE, WordLength]; -- guaranteed position
outerCtx ← NewCtx[lZ];
outerChain ← ctxb[outerCtx].seList ← MakeSeChain[outerCtx, nOuterSymbols, FALSE];
make some constants
{tC0 ← MakeTreeLiteral[0]; tC1 ← MakeTreeLiteral[1]};
idANY ← NextOuterSe[];
FillNamedType[idANY, "UNSPECIFIED"L, tSei];
IF tSei # typeANY THEN ERROR;
idINT ← NextOuterSe[]; typeINT ← MakeBasicType[codeINT,
TRUE, WordLength];
FillNamedType[idINT, "INTEGER"L, typeINT];
idCHAR ← NextOuterSe[]; typeCHAR ← MakeBasicType[codeCHAR,
TRUE, ByteLength];
FillNamedType[idCHAR, "CHARACTER"L, typeCHAR];
idBOOL ← NextOuterSe[];
typeBOOL ← MakeNonCtxSe[SERecord.cons.enumerated.SIZE];
tCtx ← NewCtx[lZ];
seb[typeBOOL] ← [mark3:
TRUE, mark4:
TRUE,
body: cons[enumerated[
ordered: TRUE, machineDep: TRUE, sparse: FALSE, unpainted: FALSE,
valueCtx: tCtx, empty: FALSE, nValues: 2]]];
ctxb[tCtx].seList ← seChain ← MakeSeChain[tCtx, 2, FALSE];
FillConstant[seChain, "FALSE"L, idBOOL, 0]; seChain ← NextSe[seChain];
FillConstant[seChain, "TRUE"L, idBOOL, 1];
FillNamedType[idBOOL, "BOOLEAN"L, typeBOOL];
idCARDINAL ← NextOuterSe[];
typeCARDINAL ← MakeSubrangeType[0, 177777b, FALSE];
FillNamedType[idCARDINAL, "CARDINAL"L, typeCARDINAL];
FillNamedType[NextOuterSe[], "WORD"L, typeCARDINAL];
idREAL ← NextOuterSe[];
typeREAL ← MakeNonCtxSe[SERecord.cons.real.SIZE];
seb[typeREAL] ← [mark3:TRUE, mark4:TRUE, body:cons[real[rangeType:idINT]]];
FillNamedType[idREAL, "REAL"L, typeREAL];
idNAT ← sei ← NextOuterSe[];
-- NAT
FillNamedType[sei, "NAT"L, MakeSubrangeType[0, 77777b, FALSE]];
idTEXT ← NextOuterSe[];
rSei ← MakeRecordType[nBits:2*WordLength, default:TRUE];
seb[rSei].hints.variant ← TRUE;
tCtx ← seb[rSei].fieldCtx; ctxb[tCtx].seList ← seChain ← MakeSeChain[tCtx, 2, FALSE];
FillVariable[seChain, "length"L, idNAT, [wd:0, bd:0], WordLength];
EnterExtension[seChain, default, tC0];
seChain ← NextSe[seChain];
BEGIN
tag: ISEIndex = MakeSeChain[CTXNull, 1, FALSE];
seqSei: CSEIndex = MakeNonCtxSe[SERecord.cons.sequence.SIZE];
FillVariable[tag, "maxLength"L, idNAT, [wd:1, bd:0], WordLength];
seb[tag].immutable ← TRUE;
seb[seqSei] ← [mark3:
TRUE, mark4:
TRUE,
body: cons[sequence[
packed: TRUE, machineDep: TRUE,
controlled: TRUE, tagSei: tag,
componentType: idCHAR]]];
FillVariable[seChain, "text"L, seqSei, [wd:1, bd:0], WordLength];
END;
FillNamedType[idTEXT, "TEXT"L, rSei];
idSTRING ← NextOuterSe[];
sei ← NextOuterSe[];
-- StringBody
typeStringBody ← rSei ← MakeRecordType[nBits:2*WordLength, default:TRUE];
seb[rSei].hints.assignable ← seb[rSei].hints.voidable ← TRUE; -- compatibility
tCtx ← seb[rSei].fieldCtx; ctxb[tCtx].seList ← seChain ← MakeSeChain[tCtx, 3, FALSE];
FillVariable[seChain, "length"L, idCARDINAL, [wd:0, bd:0], WordLength];
EnterExtension[seChain, default, tC0];
seChain ← NextSe[seChain];
FillVariable[seChain, "maxlength"L, idCARDINAL, [wd:1, bd:0], WordLength];
seb[seChain].immutable ← TRUE;
seChain ← NextSe[seChain];
tSei ← MakeNonCtxSe[SERecord.cons.array.SIZE];
seb[tSei] ← [mark3:
TRUE, mark4:
TRUE,
body: cons[array[
packed: TRUE,
indexType: MakeSubrangeType[0, 0, TRUE],
componentType: idCHAR]]];
FillVariable[seChain, "text"L, tSei, [wd:2, bd:0], 0];
FillNamedType[sei, "StringBody"L, rSei]; typeSTRING ← MakeRefType[sei];
FillNamedType[idSTRING, "STRING"L, typeSTRING];
idLOCK ← NextOuterSe[];
rSei ← MakeRecordType[nBits:WordLength, default:TRUE];
tCtx ← seb[rSei].fieldCtx; ctxb[tCtx].seList ← seChain ← MakeSeChain[tCtx, 1, FALSE];
FillVariable[seChain,
NIL, idANY, [wd:0, bd:0], WordLength];
EnterExtension[seChain, default, MakeTreeLiteral[100000b]];
FillNamedType[idLOCK, "MONITORLOCK"L, rSei]; typeLOCK ← rSei;
sei ← NextOuterSe[];
-- CONDITION
rSei ← MakeRecordType[nBits:2*WordLength, default:TRUE];
typeCONDITION ← rSei;
tCtx ← seb[rSei].fieldCtx; ctxb[tCtx].seList ← seChain ← MakeSeChain[tCtx, 2, FALSE];
FillVariable[seChain, "timeout"L, idCARDINAL, [wd:1, bd:0], WordLength];
EnterExtension[seChain, default, tC0];
seChain ← NextSe[seChain];
FillVariable[seChain,
NIL, idANY, [wd:0, bd:0], WordLength];
EnterExtension[seChain, default, tC0];
FillNamedType[sei, "CONDITION"L, rSei]; typeCONDITION ← rSei;
sei ← NextOuterSe[];
-- MDSZone
tSei ← MakeNonCtxSe[SERecord.cons.zone.SIZE];
seb[tSei] ← [mark3:TRUE, mark4:TRUE, body:cons[zone[counted:FALSE, mds:TRUE]]];
FillNamedType[sei, "MDSZone"L, tSei];
idATOM ← sei ← NextOuterSe[];
typeAtomRecord ← tSei ← MakeNonCtxSe[SERecord.cons.opaque.SIZE];
seb[tSei] ← [mark3:
TRUE, mark4:
TRUE,
body: cons[opaque[
id: NextSe[sei],
length: 0, lengthKnown: FALSE]]];
tSei ← MakeRefType[refType: tSei, counted: TRUE];
typeATOM ← MakeLongType[tSei];
FillNamedType[idATOM, "ATOM"L, typeATOM];
seAnon ← NextOuterSe[];
FillVariable[seAnon, "?"L, typeANY, [wd:0, bd:0], WordLength];
FillConstant[NextOuterSe[], "TRUE"L, idBOOL, 1]; -- TRUE
FillConstant[NextOuterSe[], "FALSE"L, idBOOL, 0]; -- FALSE
idUNWIND ← NextOuterSe[];
tSei ← MakeNonCtxSe[SERecord.cons.transfer.SIZE];
seb[tSei] ← [mark3:
TRUE, mark4:
TRUE,
body: cons[transfer[
mode: error, safe: FALSE,
typeIn: RecordSENull, typeOut: RecordSENull]]];
FillXferConstant[idUNWIND, "UNWIND"L, tSei, 1];
FillXferConstant[NextOuterSe[], "ABORTED"L, tSei, 2];
IF outerChain # ISENull THEN ERROR;
REF ANY
tSei ← MakeNonCtxSe[SERecord.cons.any.SIZE];
seb[tSei] ← [mark3: TRUE, mark4: TRUE, body: cons[any[]]];
typeRefANY ← MakeLongType[MakeRefType[refType: tSei, counted: TRUE]];
LIST OF REF ANY
rSei ← MakeRecordType[nBits: 2*(2*WordLength), refField: TRUE, default: TRUE];
typeListANY ← MakeLongType[MakeRefType[refType: rSei, counted: TRUE, list: TRUE]];
seb[rSei].painted ← FALSE;
seb[rSei].hints.comparable ← seb[rSei].hints.assignable ← TRUE;
seb[rSei].hints.refField ← TRUE;
tCtx ← seb[rSei].fieldCtx; ctxb[tCtx].seList ← seChain ← MakeSeChain[tCtx, 2, FALSE];
FillVariable[seChain, "first"L, typeRefANY, [wd:0, bd:0], 2*WordLength];
seChain ← NextSe[seChain];
FillVariable[seChain, "rest"L, typeListANY, [wd:2, bd:0], 2*WordLength];
predeclared types added for Cedar
outerChain ← ctxb[outerCtx].seList ← MakeSeChain[outerCtx, nExtraSymbols, TRUE];
FillNamedType[NextOuterSe[], "BOOL"L, idBOOL];
FillNamedType[NextOuterSe[], "CHAR"L, idCHAR];
sei ← NextOuterSe[];
-- INT
tSei ← MakeLongType[idINT];
FillNamedType[sei, "INT"L, tSei];
SetSeLink[sei, idANY];
IF outerChain # ISENull THEN ERROR;
(dataPtr.table).DropNotify[P1Notify]};