-- BcdSymbols.Mesa
-- last edited by Satterthwaite on May 30, 1980  12:42 PM
-- Copyright  Xerox Corporation 1979, 1980

DIRECTORY
  BcdDefs USING [CTIndex, EXPIndex, FTIndex, IMPIndex, MTIndex],
  Table USING [Base, Index, Limit];

Symbols: DEFINITIONS =
  BEGIN

  -- Hash Table

  HVLength: INTEGER = 71;
  HVIndex: TYPE = INTEGER [0..HVLength);

  HTRecord: TYPE = RECORD [link: HTIndex, offset: CARDINAL];

  HTNull: HTIndex = FIRST[HTIndex];
  HTIndex: TYPE = INTEGER [0..Table.Limit/2);

  -- Semantic Table

  STRecord: TYPE = RECORD [
    filename, assigned: BOOLEAN,
    hti: HTIndex,
    imported, exported: BOOLEAN,
    link: STIndex,
    impi: BcdDefs.IMPIndex,
    impgfi: CARDINAL,
    body:
      SELECT type: * FROM
	unknown => [],
	local => [
	  info: Table.Index, --BcdTreeDefs.TreeIndex,
	  context: CXIndex],
	external => [
	  map: STMap,
	  pointer:
	    SELECT ptype: * FROM
	      instance => [sti: STIndex],
	      file => [fti: BcdDefs.FTIndex],
	      ENDCASE]
	ENDCASE];

  STNull: STIndex = LAST[STIndex];
  STIndex: TYPE = Table.Base RELATIVE POINTER [0..Table.Limit) TO STRecord;

  -- to share source modules with compiler

  ISEIndex, SEIndex: TYPE = STIndex;

  STMap: TYPE = RECORD [
    SELECT type: * FROM
      unknown => [],
      config => [cti: BcdDefs.CTIndex],
      module => [mti: BcdDefs.MTIndex],
      interface => [expi: BcdDefs.EXPIndex]
      ENDCASE];

  -- Context Table

  CXRecord: TYPE = RECORD [link: STIndex];

  CXNull: CXIndex = LAST[CXIndex];
  CXIndex: TYPE = Table.Base RELATIVE POINTER [0..Table.Limit) TO CXRecord;

  END.