-- file P5L.mesa
-- last modified by Sweet,  8-Sep-81 23:49:49
-- last modified by Satterthwaite, October 27, 1982 4:40 pm

DIRECTORY
  CodeDefs: TYPE USING [
    BoVarIndex, Lexeme, MoveDirection, VarComponent, VarIndex, VarTag, wordlength],
  Symbols: TYPE USING [ContextLevel, ISEIndex, RecordSEIndex, ISENull];

P5L: DEFINITIONS = {
  OPEN Symbols, CodeDefs;

  -- from VarUtils

  AdjustComponent: PROC [var: POINTER TO VarComponent,
    rSei: RecordSEIndex, fSei: ISEIndex, tBits: CARDINAL];
  AllLoaded: PROC [r: VarIndex, junkOk: BOOL ← FALSE] RETURNS [BOOL];
  ComponentForLex: PROC [l: Lexeme, allowFields: BOOL ← FALSE] RETURNS [VarComponent]; 
  ComponentForSE: PROC [sei: ISEIndex] RETURNS [var: VarComponent];
  CopyLex: PROC [l: Lexeme] RETURNS [Lexeme];
  CopyToTemp: PROC [r: VarIndex, tsei: ISEIndex ← ISENull]
    RETURNS [var: VarComponent, sei: ISEIndex];
  CopyVarItem: PROC [r: VarIndex] RETURNS [rr: VarIndex];
  EasilyLoadable: PROC [var: VarComponent, dir: MoveDirection] RETURNS [evar: VarComponent];
  EasyToLoad: PROC [var: VarComponent, dir: MoveDirection] RETURNS [BOOL];
  FieldOfComponent: PROC [var: POINTER TO VarComponent, wd, bd, wSize, bSize: CARDINAL ← 0];
  FieldOfComponentOnly: PROC [var: POINTER TO VarComponent, wd, bd, wSize, bSize: CARDINAL ← 0];
  FieldOfVar: PROC [r: VarIndex, wd, bd, wSize, bSize: CARDINAL ← 0];
  FieldOfVarOnly: PROC [r: VarIndex, wd, bd, wSize, bSize: CARDINAL ← 0];
  GenVarItem: PROC [tag: VarTag] RETURNS [r: VarIndex];
  InCode: PROC [r: VarIndex] RETURNS [BOOL];
  IsCopyKnown: PROC [var: VarComponent] RETURNS [known: BOOL, cvar: VarComponent];
  LongVarAddress: PROC [r: VarIndex] RETURNS [BOOL];
  ModComponent: PROC [var: POINTER TO VarComponent, wd, bd: CARDINAL ← 0];
  NormalLex: PROC [nwords: CARDINAL, long, code: BOOL ← FALSE] RETURNS [Lexeme];
  NormalizeExp: PROC [r: VarIndex, tempsei: ISEIndex ← ISENull, codeOk: BOOL ← FALSE]
    RETURNS [nwords: CARDINAL, long: BOOL, tsei: ISEIndex];
  OVarItem: PROC [var: VarComponent] RETURNS [r: VarIndex];
  ReleaseLex: PROC [lex: Lexeme];
  ReleaseVarItem: PROC [r: VarIndex];
  ReusableCopies: PROC [r: VarIndex, dir: MoveDirection, stackOk: BOOL, stackFree: BOOL ← FALSE]
    RETURNS [first, next: VarIndex];
  StackSpareAddr: PROC [r: VarIndex] RETURNS [BOOL];
  StackSpareLoad: PROC [r: VarIndex] RETURNS [BOOL];
  TOSAddrLex: PROC [size: CARDINAL, long: BOOL ← FALSE] RETURNS [Lexeme.bdo];
  TOSCodeAddrLex: PROC [size: CARDINAL] RETURNS [Lexeme.bdo];
  TOSComponent: PROC [size: CARDINAL ← 1] RETURNS [VarComponent];
  TOSLex: PROC [size: CARDINAL ← 1] RETURNS [Lexeme];
  VarAddressEasy: PROC [r: VarIndex] RETURNS [BOOL];
  VarAlignment: PROC [r: VarIndex, dir: MoveDirection]
    RETURNS [bd, bSize: [0..wordlength), wSize: CARDINAL];
  VarFinal: PROC;
  VarForLex: PROC [l: Lexeme] RETURNS [r: VarIndex]; 
  VarInit: PROC;
  VarStackWords: PROC [r: VarIndex] RETURNS [nW: CARDINAL];

  -- from VarBasics

  AddrComponent: PROC [var: VarComponent] RETURNS [avar: VarComponent];
  AddrForVar: PROC [r: VarIndex, codeOk: BOOL ← FALSE] RETURNS [avar: VarComponent];
  BaseComponent: PROC [lvl: ContextLevel] RETURNS [VarComponent];
  GenAdd: PROC [delta: UNSPECIFIED, long: BOOL ← FALSE];
  GenAnd: PROC [delta: UNSPECIFIED];
  GenRFC: PROC [wd: CARDINAL, bd: [0..16), len: [1..16]];
  GenShift: PROC [delta: UNSPECIFIED];
  LoadAddress: PROC [r: VarIndex, codeOk: BOOL ← FALSE] RETURNS [long: BOOL];
  LoadBoth: PROC [atC1, atC2: POINTER TO VarComponent, abelian: BOOL];
  LoadSum: PROC [atB, atD: POINTER TO VarComponent] RETURNS [bpSize: [1..2]];
  MakeBo: PROC [r: VarIndex] RETURNS [bor: BoVarIndex];
  MakeComponent: PROC [r: VarIndex, allowFields: BOOL ← FALSE]
    RETURNS [var: VarComponent];
  VarVarAssign: PROC [to, from: VarIndex, isexp: BOOL] RETURNS [l: Lexeme];
  Words: PROC [w, b: CARDINAL] RETURNS [CARDINAL];

  -- from VarMove

  LoadComponent: PROC [var: VarComponent];
  LoadVar: PROC [r: VarIndex];
  StoreComponent: PROC [var: VarComponent];
  StoreVar: PROC [r: VarIndex];
  
  }.