FIFO.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Pradeep Sindhu September 20, 1986 8:21:25 pm PDT
FIFO:
CEDAR
DEFINITIONS =
BEGIN
FIFO: TYPE = REF FIFORec;
FIFORec:
TYPE =
RECORD [
head, tail: FIFOElement ← NIL,
size: INT ← 0
];
FIFOElement: TYPE = REF FIFOElementRec;
FIFOElementRec:
TYPE =
RECORD [
data: REF ← NIL,
next: FIFOElement ← NIL
];
Create:
PROC []
RETURNS [fifo:
FIFO];
Size: PROC [fifo: FIFO] RETURNS [INT];
Get: PROC [fifo: FIFO] RETURNS [data: REF];
Put: PROC [fifo: FIFO, data: REF];