-- file code.mesa
-- last modified by Sweet, July 23, 1980  10:00 AM
-- last modified by Satterthwaite, 14-Dec-81 11:55:15

DIRECTORY
  CodeDefs: TYPE USING [CaseCVState, CCIndex, LabelCCIndex, Lexeme],
  CompilerUtil: TYPE USING [],
  P5: TYPE USING [Module],
  Symbols: TYPE USING [ContextLevel, CTXIndex, ISEIndex, RecordSEIndex];

Code: PROGRAM 
    IMPORTS P5 
    EXPORTS CompilerUtil =
  PUBLIC BEGIN OPEN CodeDefs;

 -- the following variables are shared among the code generation modules

  curctxlvl: Symbols.ContextLevel;
  codeptr: CCIndex;
  bodyRetLabel, bodyComRetLabel: LabelCCIndex;
  reentryLabel: LabelCCIndex;
  bodyInRecord, bodyOutRecord: Symbols.RecordSEIndex;
  bodyFileIndex: CARDINAL;
  mainBody: BOOLEAN;
  ZEROlexeme: word literal Lexeme;
  stking: BOOLEAN;
  tailJumpOK: BOOLEAN;
  caseCVState: CaseCVState;
  mwCaseCV: Lexeme;
  fileindex, inlineFileIndex: CARDINAL;
  catchcount: CARDINAL;
  catchoutrecord: Symbols.RecordSEIndex;
  tempcontext: Symbols.CTXIndex;
  firstTemp, tempstart, framesz: CARDINAL;
  cfSize: CARDINAL;
  cfsi: CARDINAL;
  actenable, substenable: LabelCCIndex;
  xtracting: BOOLEAN;
  xtractlex: Lexeme;
  xtractsei: Symbols.ISEIndex;

  ACStackOverflow: SIGNAL = CODE;
  ACStackUnderflow: SIGNAL = CODE;
  StackNotEmptyAtStatement: SIGNAL = CODE;
  CodeNotImplemented: SIGNAL = CODE;
  DeletingUnreachableCode: SIGNAL = CODE;
  CodePassInconsistency: SIGNAL = CODE;


  P5module: PROC =
    BEGIN -- starts the code generation pass
    P5.Module[];
    END;

  END.