Text preview for : Symtab.mesa_Sep78.pdf part of xerox Symtab.mesa Sep78 xerox mesa 4.0_1978 listing Mesa_4_Compiler Symtab.mesa_Sep78.pdf



Back to : Symtab.mesa_Sep78.pdf | Home

Symtab.mesa 2-Sep-78 12:59:59 Page 1



-- file SymTab.Mesa
-- last modified by Johnsson, April 7, 1978 8:06 AM
DIRECTORY
AltoDefs: FROM "altodefs",
ControlDefs: FROM "controldefs",
StringDefs: FROM "stringdefs",
SymbolTable: FROM "symboltable",
SymbolTableDefs: FROM "symboltabledefs",
SymDefs: FROM "symdefs",
SymSegDefs: FROM "symsegdefs",
SymTabDefs: FROM "symtabdefs",
TableDefs: FROM "tabledefs";
SymTab: PROGRAM
IMPORTS
StringDefs, TableDefs, SymTabDefs,
own: SymbolTable
EXPORTS SymTabDefs SHARES SymDefs =
PUBLIC
BEGIN
OPEN TableDefs, SymTabDefs, SymDefs;
SubString: TYPE = StringDefs.SubString;
StaticNestError: SIGNAL = CODE;
-- tables defining the current symbol table
hashVector: PRIVATE ARRAY HVIndex OF HTIndex;
ht: PRIVATE DESCRIPTOR FOR ARRAY --HTIndex-- OF HTRecord;
hashVec: PRIVATE DESCRIPTOR FOR ARRAY OF HTIndex = -- DESCRIPTOR[hashVector]
DESCRIPTOR[BASE[hashVector], HVLength]; -- 77
htb: PRIVATE TableBase; hash table
5sb: PRIVATE STRING; id string
5eb: PRIVATE TableBase; se table
ctxb: PRIVATE TableBase; context table
mdb: PRIVATE TableBase; module directory base
bb: PRIVATE TableBase; body table
UpdateBases: PRIVATE TableNotifier =
BEGIN -- called whenever the main symbol table is repacked
own.hashVec ~ hashVec;
htb ~ base[httype];
own.ssb ~ ssb ~ LOOPHOLE[base[sstype], STRING];
own.ht ~ ht ~ DESCRIPTOR[htb, LENGTH[ht]];
own.seb ~ seb ~ base[setype];
own.ctxb ~ ctxb ~ base[ctxtype]; own.mdb ~ mdb ~ base[mdtype]:
own.bb ~ bb ~ base[bodytype];
own.tb ~ base[SymSegDefs.treetype];
own. ltb ~ base[SymSegDeFs.lttype];
own.extb ~ base[SymSegDefs.exttype];
own.notifier[own]:
RETURN
END;
AllocateHash: PRIVATE PROCEDURE RETURNS [HTIndex]