-- File stacks.ads -- Specification for a simple stack, implemented as a linked list -- The stack is intended to be used in lab4, to help implement an -- infix to postfix algorithm package Stacks is type Stack is private; -- constructors procedure Copy (Source : in Stack; Destination : in out Stack); procedure Clear (AStack : in out Stack); procedure Push (Item : in Character; OnStack : in out Stack); procedure Pop (AStack : in out Stack); -- selectors function Equal (Left, Right : in Stack) return Boolean; function Depth (OfStack : in Stack) return Natural; function Empty (AStack : in Stack) return Boolean; function Top (OfStack : in Stack) return Character; -- exceptions Overflow, Underflow : exception; -- hidden part private type Node; type Stack is access Node; type Node is record Datum : Character; Tail : Stack; end record; end Stacks;