SymbolSegment.mesa
Copyright Ó 1985, 1986, 1987, 1988, 1991 by Xerox Corporation. All rights reserved.
Satterthwaite, June 10, 1986 3:03:34 pm PDT
Russ Atkinson (RRA) March 1, 1988 6:16:35 pm PST
DIRECTORY
Literals USING [ltTag, ltType, stTag, stType],
MobDefs USING [VersionStamp],
SmallCards,
Symbols USING [ISEIndex, CTXIndex, ExtensionType, seTag, seType, htTag, htType, ssType, ctxType, mdType, bodyType],
Table USING [Base, IndexRep, Selector],
Tree USING [Link, treeTag, treeType];
SymbolSegment: DEFINITIONS = {
OPEN SmallCards;
VersionID: CARDINAL = 08140;
Base: TYPE = Table.Base;
symbol table extensions
ExtRecord: TYPE = MACHINE DEPENDENT RECORD [
type (0: 0..15): Symbols.ExtensionType[$value..$default],
pad (0: 16..31): CARD16 ¬ 0,
sei (0: 32..63): Symbols.ISEIndex, -- the key
tree (0: 64..95): Tree.Link];
ExtIndex: TYPE = Base RELATIVE LONG POINTER TO ExtRecord;
ExtFirst: ExtIndex = LOOPHOLE[Table.IndexRep[tag: 0, highBits:0, lowBits:0]];
ExtNull: ExtIndex = LOOPHOLE[Table.IndexRep[tag: 0]];
allocation codes
treeType: Table.Selector = Tree.treeType;
seType: Table.Selector = Symbols.seType;
htType: Table.Selector = Symbols.htType;
ssType: Table.Selector = Symbols.ssType;
ctxType: Table.Selector = Symbols.ctxType;
mdType: Table.Selector = Symbols.mdType;
bodyType: Table.Selector = Symbols.bodyType;
ltType: Table.Selector = Literals.ltType;
stType: Table.Selector = Literals.stType;
extType: Table.Selector = 9;
atType: Table.Selector = 10;  -- atom and typeId table
constType: Table.Selector = 11;
Tables: TYPE = Table.Selector[treeType..constType];
biases: ARRAY Tables OF CARD = [
LOOPHOLE[Table.IndexRep[Tree.treeTag, 0, 0]], -- 0 treeType
LOOPHOLE[Table.IndexRep[Symbols.seTag, 0, 0]], -- 1 seType
LOOPHOLE[Table.IndexRep[Symbols.htTag, 0, 0]], -- 2 htType
LOOPHOLE[Table.IndexRep[0, 0, 0]],  -- 3 ssType
LOOPHOLE[Table.IndexRep[0, 0, 0]],  -- 4 ctxType
LOOPHOLE[Table.IndexRep[0, 0, 0]],  -- 5 mdType
LOOPHOLE[Table.IndexRep[0, 0, 0]],  -- 6 bodyType
LOOPHOLE[Table.IndexRep[Literals.ltTag, 0, 0]], -- 7 ltType
LOOPHOLE[Table.IndexRep[Literals.stTag, 0, 0]], -- 8 stType
LOOPHOLE[Table.IndexRep[0, 0, 0]],  -- 9 extType
LOOPHOLE[Table.IndexRep[0, 0, 0]],  -- 10 atType
LOOPHOLE[Table.IndexRep[0, 0, 0]]];  -- 11 constType
symbol segment headers
WordOffset: TYPE = CARD;
BlockDescriptor: TYPE = MACHINE DEPENDENT RECORD [offset: WordOffset, size: CARD];
STHeader: TYPE = MACHINE DEPENDENT RECORD [
versionIdent: CARD,
version: MobDefs.VersionStamp,
creator: MobDefs.VersionStamp,
sourceVersion: MobDefs.VersionStamp,
definitionsFile: BOOL,
extended: BOOL,
pad1: Card14 ¬ 0,
pad2: Card16 ¬ 0,
directoryCtx, importCtx, outerCtx: Symbols.CTXIndex,
hvBlock: BlockDescriptor,
htBlock: BlockDescriptor,
ssBlock: BlockDescriptor,
outerPackBlock: BlockDescriptor,
innerPackBlock: BlockDescriptor,
constBlock: BlockDescriptor,
seBlock: BlockDescriptor,
ctxBlock: BlockDescriptor,
mdBlock: BlockDescriptor,
bodyBlock: BlockDescriptor,
extBlock: BlockDescriptor,
treeBlock: BlockDescriptor,
litBlock: BlockDescriptor,
sLitBlock: BlockDescriptor,
epMapBlock: BlockDescriptor,
spareBlock: BlockDescriptor,
fgRelBase: CARD, -- in bytes
fgCount: CARD]; -- in bytes
fine grain table header
FGHeader: TYPE = MACHINE DEPENDENT RECORD [
offset: WordOffset,
length: Card16 ¬ 0,
sourceFile: PACKED SEQUENCE maxLength: Card16 OF CHAR];
fine grain table declarations
SourceStep: CARDINAL = Card16.LAST;
ObjectStep: CARDINAL = Card16.LAST;
FGTEntry: TYPE = MACHINE DEPENDENT RECORD [
deltaObject: Card16,
deltaSource: Card16
];
}.