Annotation of parser3/src/include/pa_exception.h, revision 1.1
1.1 ! paf 1: /*
! 2: $Id: pa_error.h,v 1.3 2001/01/29 22:34:57 paf Exp $
! 3: */
! 4:
! 5: #ifndef PA_EXCEPTION_H
! 6: #define PA_EXCEPTION_H
! 7:
! 8: #include <setjmp.h>
! 9:
! 10: #include "pa_types.h"
! 11: #include "pa_string.h"
! 12:
! 13: class Exception {
! 14: public:
! 15:
! 16: // address for long jump to jump to
! 17: jmp_buf mark;
! 18:
! 19: Exception();
! 20: static void die(char *acomment);
! 21: void raise(
! 22: const String *atype, const String *acode,
! 23: const String *aproblem_source,
! 24: const char *comment_fmt, ...);
! 25:
! 26: const String *type() { return ftype; }
! 27: const String *code() { return fcode; }
! 28: const String *problem_source() { return fproblem_source; }
! 29: const char *comment() { return fcomment; }
! 30:
! 31: private:
! 32:
! 33: const String *ftype, *fcode, *fproblem_source;
! 34: char fcomment[MAX_STRING];
! 35: };
! 36:
! 37: #define EXCEPTION_TRY(e) (setjmp(e.mark)==0)
! 38:
! 39: #endif
E-mail: