CreateRootContextRib:
PUBLIC PROC [ta:
TA.TargetArchitecture]
RETURNS [rootContextRib: ContextRibNode, top, bottom: TypeGraphNodeNode] =
BEGIN
ws: BYTE ← ta.wordSize;
is: BYTE ← ta.integerSize;
lis: BYTE ← ta.longIntegerSize;
lc: LocalContextNode ← CreateEmptyContext[NIL, TRUE];
fl: FieldListNode ← CreateEmptyFieldList[];
AddBaseType[lc,fl, "ATOM", NEW[PT.AtomTGNBody]];
AddBaseType[lc,fl, "BOOL", NEW[PT.ElementTGNBody ← [base[boolean[]]]]];
AddBaseType[lc,fl, "BOOLEAN", NEW[PT.ElementTGNBody ← [base[boolean[]]]]];
AddBaseType[lc,fl, "CHAR", NEW[PT.ElementTGNBody ← [base[character[]]]]];
AddBaseType[lc,fl, "CHARACTER", NEW[PT.ElementTGNBody ← [base[character[]]]]];
AddBaseType[lc,fl, "CONDITION", NEW[PT.ConditionTGNBody]];
AddBaseType[lc,fl, "MONITORLOCK", NEW[PT.MonitorlockTGNBody]];
AddBaseType[lc,fl, "STRING", NEW[PT.StringTGNBody]];
AddBaseType[lc,fl, "REAL", NEW[PT.RealTGNBody ← [5, 8, 20]]];
Name Signed? nBits nUnusedBits
AddIntegerBaseType[lc, fl, "CARDINAL", FALSE, lis, 0];
AddIntegerBaseType[lc, fl, "CARD16", FALSE, 16, 0];
AddIntegerBaseType[lc, fl, "CARD32", FALSE, 32, 0];
AddIntegerBaseType[lc, fl, "CARD64", FALSE, 64, 0];
AddIntegerBaseType[lc, fl, "CARD", ? ? ?];
AddIntegerBaseType[lc, fl, "DCARD", ? ? ?];
AddIntegerBaseType[lc, fl, "NAT", FALSE, is-1, 1];
AddIntegerBaseType[lc, fl, "NATURAL", FALSE, is-1, 1];
AddIntegerBaseType[lc, fl, "NAT15", FALSE, 15, 1];
AddIntegerBaseType[lc, fl, "NAT31", FALSE, 31, 1];
AddIntegerBaseType[lc, fl, "NAT63", FALSE, 63, 1];
AddIntegerBaseType[lc, fl, "INT", TRUE, lis-1, 0];
AddIntegerBaseType[lc, fl, "INTEGER", TRUE, is-1, 0];
AddIntegerBaseType[lc, fl, "INT16", TRUE, 15, 0];
AddIntegerBaseType[lc, fl, "INT32", TRUE, 31, 0];
AddIntegerBaseType[lc, fl, "INT64", TRUE, 63, 0];
AddIntegerBaseType[lc, fl, "DINT", ? ? ?];
AddIntegerBaseType[lc, fl, "BIT", FALSE, 1, 0];
AddIntegerBaseType[lc, fl, "BYTE", FALSE, 8, 0];
AddIntegerBaseType[lc, fl, "WORD", FALSE, ws, 0];
BEGIN
ffl: FrozenFieldListNode ← FreezeFieldList[fl];
block: TypeGraphNodeNode ← CreateBlockTGN[lc, ffl].tgn;
[lc, top] ← CreateTopTGN[lc];
[lc, bottom] ← CreateBottomTGN[lc];
rootContextRib ← FreezeLocalContext[lc, block];
END;
END;