--- parser3/src/main/pa_exception.C 2001/01/30 13:07:31 1.2 +++ parser3/src/main/pa_exception.C 2001/08/27 12:02:24 1.12 @@ -1,40 +1,39 @@ -/* - $Id: pa_exception.C,v 1.2 2001/01/30 13:07:31 paf Exp $ -*/ - -#include -#include - -#include "pa_exception.h" -#include "pa_common.h" - -Exception::Exception()/* : - ftype(0), - fcode(0), - fproblem_source(0), - fcomment("")*/ { -} - -void Exception::die(char *acomment) { - // FIX: log(LOG_ERROR, acomment) - fprintf(stderr, "die: %s\n", acomment); - exit(1); -} - -void Exception::raise(const String *atype, const String *acode, - const String *aproblem_source, - const char *comment_fmt, ...) { - ftype=atype; - fcode=acode; - fproblem_source=aproblem_source; - - if(comment_fmt) { - va_list args; - va_start(args, comment_fmt); - vsnprintf(fcomment, MAX_STRING, comment_fmt, args); - va_end(args); - } else - fcomment[0]=0; - - longjmp(mark, 1); -} +/** @file + Parser: exception class. + + Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) + + Author: Alexander Petrosyan (http://design.ru/paf) +*/ +static const char *RCSId="$Id: pa_exception.C,v 1.12 2001/08/27 12:02:24 parser Exp $"; + +#include +#include + +#include "pa_common.h" +#include "pa_exception.h" + +void Exception::_throw(const String *atype, const String *acode, + const String *aproblem_source, + const char *comment_fmt, ...) const { + ftype=atype; + fcode=acode; + fproblem_source=aproblem_source; + + if(comment_fmt) { + va_list args; + va_start(args, comment_fmt); + vsnprintf(fcomment, MAX_STRING, comment_fmt, args); + //fcomment[0]='z'; + //fcomment[1]=0; + va_end(args); + } else + fcomment[0]=0; + + int *p=(int *)(void *)&mark; + for(int i=0; i