Annotation of parser3/src/include/pa_exception.h, revision 1.12

1.10      paf         1: /** @file
1.11      paf         2:        Parser: exception decls.
                      3: 
1.6       paf         4:        Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
1.11      paf         5: 
1.7       paf         6:        Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
1.6       paf         7: 
1.12    ! parser      8:        $Id: pa_exception.h,v 1.11 2001/03/19 17:42:12 paf Exp $
1.1       paf         9: */
                     10: 
                     11: #ifndef PA_EXCEPTION_H
                     12: #define PA_EXCEPTION_H
                     13: 
1.12    ! parser     14: #include "pa_config_includes.h"
1.1       paf        15: #include "pa_types.h"
                     16: #include "pa_string.h"
                     17: 
1.10      paf        18: /// Just simple longjump mechanizm dressed in class clothes. use Temp_exception
1.1       paf        19: class Exception {
                     20: public:
                     21: 
1.10      paf        22:        /**
                     23:                address for long jump to jump to 
                     24:                regretfully public:
                     25:                can't make local unless sure of inlining
                     26:                for to-die stack frame ruins it all
                     27:        */
1.5       paf        28:        mutable jmp_buf mark;
1.1       paf        29: 
1.10      paf        30:        /// throws an exception[really goes to mark-ed position
1.5       paf        31:        void _throw(
1.1       paf        32:                const String *atype, const String *acode,
                     33:                const String *aproblem_source, 
1.5       paf        34:                const char *comment_fmt, ...) const;
1.1       paf        35: 
1.10      paf        36:        /// extracts exception type
1.5       paf        37:        const String *type() const { return ftype; }
1.10      paf        38:        /// extracts exception code
1.5       paf        39:        const String *code() const { return fcode; }
1.10      paf        40:        /// extracts exception problem_source
1.5       paf        41:        const String *problem_source() const { return fproblem_source; }
1.10      paf        42:        /// extracts exception comment
1.5       paf        43:        const char *comment() const { return fcomment[0]?fcomment:0; }
1.1       paf        44: 
                     45: private:
                     46: 
1.5       paf        47:        mutable const String *ftype, *fcode, *fproblem_source;
                     48:        mutable char fcomment[MAX_STRING];
1.1       paf        49: };
                     50: 
                     51: #endif

E-mail: