|##########|
|#MAGIC   #|CLABLJAI
|#PROJECT #|"ImportAll"
|#PATHS   #|"StdProject"
|#FLAGS   #|xx-x-x--x-----x--x--------------
|#USERSW  #|--------------------------------
|#USERMASK#|--------------------------------
|#SWITCHES#|xx---xxxxx------
|##########|
DEFINITION MODULE Exceptions;

EXCEPTION
  EverythingOk           : 0;
  BusError               : 2;
  AddressError           : 3;
  IllegalOpcode          : 4;
  DivisionByZero         : 5;
  RangeViolation         : 6;
  Overflow               : 7;
  PrivilegeViolation     : 8;
  Trace                  : 9;
  Line_A_Emulator        : 10;
  Line_F_Emulator        : 11;

  Trap_0                 : 32;
  Trap_1                 : 33;
  Trap_2                 : 34;
  Trap_3                 : 35;
  Trap_4                 : 36;
  Trap_5                 : 37;
  Trap_6                 : 38;
  Trap_7                 : 39;
  Trap_8                 : 40;
  Trap_9                 : 41;
  Trap_10                : 42;

  Function_No_Return     : 43;
  Local_Proc_Var         : 44;
  NIL_Dereferenced       : 45;
  Overflow2              : 46;
  RangeViolation2        : 47;

  StackUnderflow         : 99;
  UserBreak              : 100;

  CouldNotOpenLibrary    : "Could not open library";
  CouldNotOpenResource   : "Could not open resource";
  UnimplementedProcedure : "Unimplemented procedure";
  NilPassed              : "Nil-pointer passed to procedure";

PROCEDURE GetExceptionId():LONGINT;

$$OwnHeap:=TRUE;
PROCEDURE GetExceptionString():STRING;

PROCEDURE WriteException;

PROCEDURE ExceptionToSer;

END Exceptions.

