Annotation of parser3/src/include/pa_exception.h, revision 1.2
1.1 paf 1: /*
1.2 ! paf 2: $Id: pa_exception.h,v 1.1 2001/01/30 11:51:07 paf Exp $
1.1 paf 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; }
1.2 ! paf 29: const char *comment() { return fcomment[0]?fcomment:0; }
1.1 paf 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: