-- file ComData.Mesa
-- last modified by Satterthwaite,  3-Nov-81 11:38:38

DIRECTORY
  Alloc: TYPE USING [Handle],
  BcdDefs: TYPE USING [SGRecord, VersionStamp],
  BcdOps: TYPE USING [MTHandle],
  FileParms: TYPE USING [ActualId],
  OSMiscOps: TYPE USING [Stamp],
  Symbols: TYPE USING [ISEIndex, CSEIndex, CTXIndex, CBTIndex],
  SymbolSegment: TYPE USING [FGTEntry],
  SymbolTable: TYPE USING [Base],
  Strings: TYPE USING [String],
  Tree: TYPE USING [Link];

ComData: PROGRAM = PUBLIC {
   OPEN Symbols;

 -- basic types (initialized in Pass1)

  typeINT, typeCARDINAL: CSEIndex;
  typeBOOL, typeCHAR, typeREAL: CSEIndex;
  typeSTRING, typeStringBody: CSEIndex;
  typeATOM, typeAtomRecord: CSEIndex;
  typeRefANY, typeListANY: CSEIndex;
  typeLOCK, typeCONDITION: CSEIndex;

 -- global info describing module

  definitionsOnly: BOOLEAN;
  monitored: BOOLEAN;
  stopping: BOOLEAN;
  outerCtx: CTXIndex;		-- predefined identifiers
  moduleCtx: CTXIndex;		-- module identifiers
  importCtx: CTXIndex;		-- import id context
  exportCtx: CTXIndex;		-- export id context
  mainCtx: CTXIndex;		-- main program's context
  nBodies: CARDINAL;
  nInnerBodies: CARDINAL;
  nSigCodes: CARDINAL;
  defBodyLimit: INTEGER;
  linkCount: CARDINAL;		-- global control links (externals, etc)

 -- shared instance of SymbolTable

  ownSymbols: SymbolTable.Base;

 -- type identifiers (initialized in Pass1)

  idANY: ISEIndex;
  idINT, idCARDINAL, idCHAR, idBOOL, idREAL, idSTRING: ISEIndex;
  idTEXT: ISEIndex;
  idLOCK: ISEIndex;
  idATOM: ISEIndex;

 -- anonymous entry for undeclared ids

  seAnon: ISEIndex;

 -- symbolic constants

  tC0, tC1: Tree.Link;
  idUNWIND: ISEIndex;

 -- scratch storage
 
  table: Alloc.Handle;
  zone: UNCOUNTED ZONE;
  
 -- compilation options

  switches: PACKED ARRAY CHARACTER ['a..'z] OF BOOLEAN;

 -- input

  source: FileParms.ActualId;
  sourceTokens: CARDINAL;

  pattern: FileParms.ActualId;	-- old bcd to match
  matched: BOOLEAN;
    
 -- variables used for error reporting

  nErrors: CARDINAL;
  nWarnings: CARDINAL;
  bodyIndex: CBTIndex;		-- current body
  textIndex: CARDINAL;		-- start index of line with error

 -- output

  compilerVersion: BcdDefs.VersionStamp;

  objectFile: Strings.String;
  objectVersion: BcdDefs.VersionStamp;
  objectStamp: OSMiscOps.Stamp;

  globalFrameSize: CARDINAL;
  objectBytes: CARDINAL;

  fgTable: LONG DESCRIPTOR FOR ARRAY OF SymbolSegment.FGTEntry ← NIL;

  codeSeg, symSeg: BcdDefs.SGRecord;
  mtRoot: BcdOps.MTHandle ← NIL;
  mtRootSize: CARDINAL;
  fixupLoc: LONG CARDINAL;

  }.