//----------------------------------------------------------------------
//  SPECIFICATION FILE (cstack.h)
//  This module exports an ADT for a stack of characters.
//----------------------------------------------------------------------
#include "bool.h"

// DOMAIN: Each stack is a list of char values

const int MAX_LENG = 100;

class CharStack {
public:
    Boolean IsEmpty() const;
        // POST: FCTVAL == (stack is empty)

    Boolean IsFull() const;
        // POST: FCTVAL == (stack is full)

    void Push( /* in */ char newItem );
        // PRE:  NOT IsFull()  &&  Assigned(newItem)
        // POST: newItem is at top of stack

    char Top() const;
        // PRE:  NOT IsEmpty()
        // POST: FCTVAL == char at top of stack

    void Pop();
        // PRE:  NOT IsEmpty()
        // POST: Top char removed from stack

    CharStack();
        // Constructor
        // POST: Empty stack created
private:
    int  top;
    char data[MAX_LENG];
};

