Diff for /parser3/src/include/pa_stack.h between versions 1.17.2.2 and 1.18

version 1.17.2.2, 2003/01/28 09:48:16 version 1.18, 2003/07/24 11:31:21
Line 1 Line 1
 /** @file  /** @file
         Parser: stack class decl.          Parser: stack class decl.
   
         Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com)          Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)
         Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)          Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
 */  */
   
Line 26  public: Line 26  public:
                         *this+=item; // append it                          *this+=item; // append it
                 ftop++;                  ftop++;
         }          }
   
         T pop() {          T pop() {
                 return get(--ftop);                  return get(--ftop);
         }          }
   
         int top_index() { return ftop-1; }          bool is_empty() { return ftop==0; }
         void top_index(int top_index) { ftop=top_index+1; }          size_t top() { return ftop; }
         T top_value() { return get(top_index()); }          void top(size_t atop) { ftop=atop; }
           T upper_value() { 
                   assert(!is_empty());
                   return get(ftop-1); 
           }
   
 private:          /// call this prior to collecting garbage [in unused part of stack there may be pointers(unused)]
           void wipe_unused() {
                   if(!is_full())
                           memset(&felements[fused], 0, (fallocated-fused)*sizeof(T));
           }
   
         // deepest used index  protected:
         int ftop;  
   
           // deepest used index+1
           size_t ftop;
 };  };
   
 #endif  #endif

Removed from v.1.17.2.2  
changed lines
  Added in v.1.18


E-mail: