-- Lookup.mesa  last edit, Bruce  July 15, 1980  12:23 PM

DIRECTORY
  DebugFormat USING [BBHandle, BitAddress, Foo],
  Literals USING [LitRecord],
  MachineDefs USING [FHandle, GFHandle, MaxParmsInStack, SVPointer],
  PrincOps USING [ProcDesc, SignalDesc],
  Symbols USING [CTXIndex, HTIndex, HTNull, ISEIndex, SEIndex];

Lookup: DEFINITIONS =
  BEGIN OPEN DebugFormat, MachineDefs, Symbols;

  HTIndex: TYPE = Symbols.HTIndex;

  InCtx: PROC [id: HTIndex, ctx: CTXIndex] RETURNS [Foo];
  InGF: PROC [id: HTIndex, gf: GFHandle ← NIL, check: BOOLEAN ← TRUE]
    RETURNS [Foo];
  InMod: PROC [id: HTIndex, mod: HTIndex ← Symbols.HTNull] RETURNS [Foo];
  InLF: PROC [id: HTIndex, lf: FHandle ← NIL, check: BOOLEAN ← TRUE]
    RETURNS [Foo];
  InBreakBlock: PROC [id: HTIndex, bb: BBHandle] RETURNS [Foo];
  OnStack: PROC [id: HTIndex, lf: FHandle ← NIL, check: BOOLEAN ← TRUE]
    RETURNS [Foo];

  Signal: PROC [PrincOps.SignalDesc] RETURNS [ISEIndex];
  Proc: PROC [PrincOps.ProcDesc] RETURNS [ISEIndex];
  StateCtx: PROC [
      sei: SEIndex, sv: SVPointer, io: InOut,
      max: CARDINAL ← MaxParmsInStack]
    RETURNS [f: Foo];
  XferCtx: PROC [SEIndex, LONG POINTER, InOut] RETURNS [Foo];
  InOut: TYPE = {in,out};

  StringToHti: PROC [STRING] RETURNS [HTIndex];
  HtiToString: PROC [HTIndex, STRING];

  Flavor: TYPE = {manifest, refVal, refProc, val, inline, controlLink,
    unrelocatedControlLink};

  Mode: PROCEDURE [isei: Symbols.ISEIndex] RETURNS [Flavor];

  MakeFoo: PROC [
    isei: ISEIndex, ba: BitAddress ← [NIL, 0], sizeInc: CARDINAL ← 0]
    RETURNS [Foo];
  CopyLiteral: PROC [info: Literals.LitRecord]
    RETURNS [p: POINTER, length: CARDINAL];
  CopyMore: PROC [tsei: SEIndex, doVariants: BOOLEAN ← FALSE];
  Complete: PROC [ictx: CTXIndex, variants: BOOLEAN ← FALSE];

  Fail: SIGNAL [s: STRING];
  NotRelocated: SIGNAL RETURNS [LONG POINTER];

  END.