-- Dump.mesa  last edit, Bruce  September 1, 1980  1:49 PM

DIRECTORY
  DebugFormat USING [BitAddress, Foo, LongSubString],
  DI USING [EnumeratedSEIndex, Foo, SEIndex, SequenceSEIndex, UnionSEIndex, ValFormat],
  PrincOps USING [ControlLink, ProcDesc, SignalDesc, SVPointer],
  String USING [SubString],
  Symbols USING [
    CTXIndex, HTIndex, ISEIndex, RecordSEIndex, RecordSENull, SEIndex, TransferMode];

Dump: DEFINITIONS =
  BEGIN OPEN DI;

  DefaultOutputFormat: DI.ValFormat;

  printers: POINTER TO PrintRec;

  PrintRec: TYPE = RECORD [
    link: POINTER TO PrintRec,
    sym: STRING,
    tsei: SEIndex,
    proc: Printer];

  ArrayHandle: TYPE = POINTER TO ArrayInfo;
  ArrayInfo: TYPE = RECORD [
    addr: DebugFormat.BitAddress,
    start: CARDINAL,
    stop: CARDINAL,
    length: CARDINAL,
    packing: CARDINAL,  -- in bits
    type: SEIndex];

  Printer: TYPE = PROC [Foo];
  AddPrinter: PROC [type: STRING, proc: Printer];
  ResetPrinters: PROC;

  --  popular TypeClasses
  Basic, Pointer, Relative, StringPrinter, Enumerated, Record: Printer;
  Array, LongArrayDesc, ArrayDesc, Xfer, Subrange, Real, Long, Opaque: Printer;
  Spare1, Spare2: Printer;
  Variant: PROC [f: Foo, pad: CARDINAL, usei: UnionSEIndex,
    variant: PROC RETURNS [Symbols.RecordSEIndex] ← NullVariant];
  Sequence: PUBLIC PROC [f: Foo, pad: CARDINAL, sei: SequenceSEIndex,
    variant: PROC RETURNS [Symbols.RecordSEIndex] ← NullVariant];

  -- some utilities
  CalculateAddr: PROC [ai: ArrayHandle, n: CARDINAL] 
    RETURNS [ba: DebugFormat.BitAddress];
  Elements: PROC [ai: POINTER TO ArrayInfo, printAll: BOOLEAN ← FALSE];
  CompareSes: PROC [sei1, sei2: Symbols.SEIndex] RETURNS [print: BOOLEAN];
  EvalStack: PROC;
  FieldCtx: PROC [f: Foo, ctx: Symbols.CTXIndex, pad: CARDINAL,
    variant: PROC RETURNS [Symbols.RecordSEIndex] ← NullVariant,
    rsei: Symbols.RecordSEIndex ← Symbols.RecordSENull];
  NullVariant: PROC RETURNS [Symbols.RecordSEIndex];
  Proc: PROC [PrincOps.ControlLink];
  Port: PROC [PrincOps.ControlLink];
  Process: PROC [UNSPECIFIED];
  Prog: PROC [UNSPECIFIED];
  PrintUCS: PROC;
  Sig: PROC [PrincOps.ProcDesc];
  SignalCtxFromState: PROC [PrincOps.SignalDesc, PrincOps.SVPointer];
  XferName: PROC [cl: PrincOps.ProcDesc, isei: Symbols.ISEIndex];
  XferFrame: PROC [cl: PrincOps.ProcDesc];

  ArrayLimit: CARDINAL;
  StringLimit: CARDINAL;
  Char: PROC [UNSPECIFIED];
  HashVal: PROC [isei: Symbols.ISEIndex];
  HtiVal: PROC [hti: Symbols.HTIndex];
  Type: PROC [isei: Symbols.ISEIndex,
    pub: BOOLEAN ← FALSE, nest: CARDINAL ← 0, recurring: BOOLEAN ← FALSE];
  EnumVal: PROC [val: UNSPECIFIED, esei: EnumeratedSEIndex];
  TypedNum: PROC [val: UNSPECIFIED, tsei: SEIndex];
  TypedLongNum: PROC [val: LONG UNSPECIFIED, tsei: SEIndex];
  BadNum: PROC [UNSPECIFIED];
  Num: PROC [UNSPECIFIED, DI.ValFormat];
  LongNum: PROC [LONG UNSPECIFIED, DI.ValFormat];
  ModeName: PROC [Symbols.TransferMode];

  -- from user world
  UserText: PROC [s: STRING];
  UserLongText: PROC[s: LONG STRING];
  UserSubString: PROC[ss: String.SubString];
  UserLongSubString: PROC [ls: DebugFormat.LongSubString];

  END.