/**********************************************************************/
/*                                                                    */
/*   "DP_ERROR.H"                                                     */
/*                                                                    */
/*   Last change    == Feb-01-92 ==                                   */
/*        A.Just / R.Hammer                                           */
/*                                                                    */
/* This file contains the prototype declarations of the functions in  */
/* "DP_ERROR.C".                                                      */
/*                                                                    */
/* Jul-23-91 Just : 'cCASTFUNC' added to checkerror numbers.          */
/* Feb-01-92 Just : function 'd_checkerr()' will only exist with      */
/*                  macro CHECK defined.                              */
/*                                                                    */
/**********************************************************************/


#include <setjmp.h>



     /* Error Flags */
#define dNOFLAG     ((char)0x00)
#define dSTRUC      ((char)0x01)
#define dBASE       ((char)0x02)
#define dKIND       ((char)0x04)
#define dNMKND      ((char)0x08)
#define dNAME       ((char)0x10)
#define dSELF       ((char)0x20)


     /* Error Numbers */                /* case for error */
typedef enum {
          de_start = 2000,
          dPARNOREAL     ,    /* 01 Real constant expected            */
          dNONESTNG      ,    /* 02 Nested dotexpressions             */
          dILLSMBL       ,    /* 03 Illegal symbol                    */
          dWRGNCNST      ,    /* 04 Invalid type of constant          */
          dSUPLARG       ,    /* 05 Too many func. arg.               */
          dWRGARGTP      ,    /* 06 Invalid type of func. arg.        */
          dMATREXPCT     ,    /* 07 Matrix arg. expected              */
          dVECTEXPCT     ,    /* 08 Vector type expected              */
          dARGSSTRUC     ,    /* 09 Different structure of args.      */
          dSUMNESTED     ,    /* 10 Nested loop variable              */
          dILLRBASE      ,    /* 11 Invalid basetype of result        */
          dILLRSTRUC     ,    /* 12 Invalid structure of result       */
          dOPSSTRUC      ,    /* 13 Different structure of opnds.     */
          dDOTMUL        ,    /* 14 Multiplication of dp-vars.        */
          dWRGMSTRUC     ,    /* 15 Factors do not match              */
          dINTASSMNT     ,    /* 16 Integer assignment expected       */
          dASSTYPE       ,    /* 17 Invalid type for assignment       */
          dVAREXPCT      ,    /* 18 Variable expected                 */
          dILLOPND       ,    /* 19 Invalid operand                   */
          dIDERROR       ,    /* 20 Invalid arguments in 'ID()'       */
          dWVARBASE      ,    /* 21 Invalid basetype of var.          */
          dWVARSTRUC     ,    /* 22 Invalid structure of var.         */
          dTOEXPCT       ,    /* 23 'TO' or 'DOWNTO' expected         */
          dMISSARG       ,    /* 24 Argument(s) missing in func.      */
          dBADSYNTAX     ,    /* 25 bad syntax in dotexpression       */
          dINTEXPR       ,    /* 26 integer expression expected       */
          dILLCPAR       ,    /* 27 illegal use of cnst. rounding     */
          dMAX_ERROR          /* max. error number                    */
          }d_errtype;



/* Warning numbers */
typedef enum {
          dw_start =  200,
          wNOCAST        ,    /* 01 no explicit type casting          */
          wNOCPAR        ,    /* 02 cnst. without rounding directive  */
          wMAX_WARN
          }d_warntype;



/* Checkerror numbers */
typedef enum {
          dc_start = 9100,
          cISNULL        ,    /* 01 '@' is NULL.                           */
          cISNIL         ,    /* 02 '@' is NIL.                            */
          cVARNIL        ,    /* 03 Pointer to variable is NIL.            */
          cIBASE         ,    /* 04 Illegal basetype.                      */
          cISTRUC        ,    /* 05 Illegal structure                      */
          cILNODE        ,    /* 06 Illegal work node.                     */
          cILBASE        ,    /* 07 Illegal basetype of work node.         */
          cILSTRUC       ,    /* 08 Illegal structure of work node.        */
          cILKIND        ,    /* 09 Illegal kind of work node.             */
          cILNAME        ,    /* 10 Illegal name of work node.             */
          cILERES        ,    /* 11 Illegal dotexpression result.          */
          cILEBASE       ,    /* 12 Illegal basetype of dotexpr. result.   */
          cILESTRUC      ,    /* 13 Illegal structure of dotexpr. result.  */
          cILRRES        ,    /* 14 Illegal dotexpr. result for '@'.       */
          cILRSYM        ,    /* 15 Illegal rounding symbol.               */
          cILVARID       ,    /* 16 Illegal 'idptr' of variable.           */
          cBADCALL       ,    /* 17 '@' shouldn't be called at this place. */
          cILOPND        ,    /* 18 Illegal Operator.                      */
          cMULDOT        ,    /* 19 Multiplication of dotexpr. operand(s). */
          cOPWSTRUC      ,    /* 20 R. op. has ill. struc with left = '@'. */
          cCNSTEXPCT     ,    /* 21 Constant expected.                     */
          cILVALUE       ,    /* 22 '@' has an illegal value.              */
          cNROWDEF       ,    /* 23 Row undefined in info block.           */
          cNCOLDEF       ,    /* 24 Column undefined in info block.        */
          cCASTFUNC      ,    /* 25 Conv. function in dotexpr.-generation  */
          cMAX_CHECK
          }d_checktype;



/*---------------------------------------*/
/*  Runtime errors for dimension checks  */
/*---------------------------------------*/

/* Dotexpression with vector summands */
/*------------------------------------*/

#define dSUMVEC    400   /* Summation of vectors with different lengths      */
#define dSCLPRD    401   /* Scalar product of vectors with different lengths */
#define dFCTVEC    402   /* Function call with vectors of different lengths  */
                         /* i. e. an compl(.,.) or intval(.,.) call          */
#define dPRDMATVEC 403   /* Inner dimensions in a 'matrix * vectors' product */
                         /* do not fit together                              */


/* Dotexpression with matrix summands */
/*------------------------------------*/

#define dSUMROW    404   /* Summation of matrices with different row lengths */
#define dSUMCOL    405   /* Summation of matrices with different column      */
                         /* lengths                                          */
#define dFCTROW    406   /* Function call with matrices of different row     */
                         /* lengths, i. e. an compl(.,.) or intval(.,.) call */
#define dFCTCOL    407   /* Function call with matrices of different column  */
                         /* lengths, i. e. an compl(.,.) or intval(.,.) call */
#define dFCTPRD    408   /* Inner dimensions of arguments in a function call */
                         /* do not fit together, i. e. id(.,.)               */
#define dPRDMATMAT 409   /* Inner dimensions in a 'matrix * matrix' product  */
                         /* do not fit together                              */



global jmp_buf d_critjmp;



#ifdef LINT_ARGS

     global void    d_critical     ( char* );
     global void    d_noncritical  ( char, d_errtype, tNODE* );
     global void    d_trace        ( char* );
     global void    d_warn         ( d_warntype, postype );
#ifdef CHECK
     global void    d_checkerr     ( d_checktype, postype, char* );
#endif

#else

     global void    d_critical     ();
     global void    d_noncritical  ();
     global void    d_trace        ();
     global void    d_warn         ();
#ifdef CHECK
     global void    d_checkerr     ();
#endif

#endif
