--- parser3/src/include/pa_pool.h 2001/02/22 11:08:06 1.24 +++ parser3/src/include/pa_pool.h 2001/03/11 08:16:32 1.28 @@ -1,5 +1,9 @@ /* - $Id: pa_pool.h,v 1.24 2001/02/22 11:08:06 paf Exp $ + Parser + Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexander Petrosyan (http://design.ru/paf) + + $Id: pa_pool.h,v 1.28 2001/03/11 08:16:32 paf Exp $ */ #ifndef PA_POOL_H @@ -7,12 +11,11 @@ #include -//class String; class Exception; -class Temp_exception_change; +class Temp_exception; class Pool { - friend Temp_exception_change; + friend Temp_exception; public: Pool() : fexception(0) {} @@ -91,15 +94,15 @@ public: }; #define NEW new(pool()) -class Temp_exception_change { +class Temp_exception { Pool pool; Exception *saved_exception; public: - Temp_exception_change(Pool& apool, Exception& exception) : + Temp_exception(Pool& apool, Exception& exception) : pool(apool), saved_exception(apool.set_exception(&exception)) { } - ~Temp_exception_change() { + ~Temp_exception() { pool.restore_exception(saved_exception); } }; @@ -107,10 +110,11 @@ public: #define TRY \ { \ Exception temp_exception; \ - Temp_exception_change le(pool(), temp_exception); \ + Temp_exception le(pool(), temp_exception); \ if(setjmp(temp_exception.mark)==0) #define THROW exception()._throw +#define POOL_THROW pool.exception()._throw #define CATCH(e) \ else{ \ Exception& e=temp_exception;