//---------------------------------------------------------------------- // SPECIFICATION FILE (cstack.h) // This module exports an ADT for a stack of characters. //---------------------------------------------------------------------- #ifndef cstack_h #define cstack_h 1 #include "bool.h" const int SMAX_LENG = 100; class CharStack { // ABSTRACTLY: a sequence of component values of type char public: CharStack(); // MODIFIES: self // POST: the sequence is empty Boolean IsEmpty() const; // POST: FCTVAL == (sequence is empty) Boolean IsFull() const; // POST: FCTVAL == true if no more // items can be stored, false otherwise void Push(char newItem ); // PRE: the sequence isn't full // MODIFIES: self // POST: newItem is the first in the sequence, rest is self char Top() const; // PRE: the sequence isn't empty // POST: FCTVAL == first item in the sequence void Pop(); // PRE: the sequence isn't empty // MODIFIES: self // POST: the sequence is the tail of the sequence in self #include "cstack.pri" }; #endif