DEFINITION Stack; (* SJ *)

(* Stack implements a LIFO structure. The last value pushed is popped again.
*)

TYPE elem* = POINTER TO stk;

PROCEDURE Push*(VAR First : elem; Value : LONGINT);

(* stores Value. If a long word is not enough, it may be interpreted as
   a pointer to values.
*)

PROCEDURE Pop*(VAR First : elem) : LONGINT;

(* reads the value that was last pushed. If no value was pushed, 0 is
   returned.
*)

PROCEDURE Empty*(First : elem) : BOOLEAN;

(* returns true if the stack is empty. It may be empty even if First is
   not NIL, so use this procedure to test.
*)

END Stack.
