DEFINITION FIFO;

  TYPE

    Elem     = POINTER TO ElemDesc;
    ElemDesc = RECORD
                 next: Elem;
               END;
    fifo     = POINTER TO fifodesc;
    fifodesc = RECORD
                 top  : Elem;
                 last : Elem;
                 PROCEDURE (VAR queue: fifo) Init();
                 PROCEDURE (VAR queue: fifo) Empty(): BOOLEAN;
                   (* Returns TRUE if the fifo is empty.
                      You can also use fifo.top=NIL      *)
                 PROCEDURE (VAR queue: fifo) Put(e: Elem);
                   (* inserts element e *)
                 PROCEDURE (VAR queue: fifo) Get(VAR e: Elem);
                   (* removes top element e (NIL, if empty) *)
               END;

END FIFO.
