--- parser3/src/include/pa_stack.h 2003/04/03 09:18:46 1.17.2.6.2.7 +++ parser3/src/include/pa_stack.h 2003/07/24 11:31:21 1.18 @@ -8,7 +8,7 @@ #ifndef PA_STACK_H #define PA_STACK_H -static const char* IDENT_STACK_H="$Date: 2003/04/03 09:18:46 $"; +static const char* IDENT_STACK_H="$Date: 2003/07/24 11:31:21 $"; #include "pa_config_includes.h" #include "pa_array.h" @@ -31,9 +31,13 @@ public: return get(--ftop); } - size_t top_index() { return ftop-1; } - void top_index(size_t top_index) { ftop=top_index+1; } - T top_value() { return get(top_index()); } + bool is_empty() { return ftop==0; } + size_t top() { return ftop; } + void top(size_t atop) { ftop=atop; } + T upper_value() { + assert(!is_empty()); + return get(ftop-1); + } /// call this prior to collecting garbage [in unused part of stack there may be pointers(unused)] void wipe_unused() {