[Indigo]<Dragon>Cache>Rosemary>Cache.df=>CacheDecoderImpl.Mesa
Last Edited by: Barth, March 13, 1984 8:05:39 pm PST
DIRECTORY CacheDecoder, CacheMicroMachine;
CacheDecoderImpl:
CEDAR
PROGRAM
IMPORTS
EXPORTS CacheDecoder, CacheMicroMachine =
BEGIN OPEN CacheDecoder, CacheMicroMachine;
tree: ARRAY BOOL OF ARRAY SequenceNumber OF ARRAY CycleNumber OF LIST OF ATOM;
master: BOOL;
sequence: SequenceNumber;
SetMaster: PUBLIC PROC = {master ← TRUE};
SetSlave: PUBLIC PROC = {master ← FALSE};
Sequence:
PUBLIC
PROC [number: SequenceNumber] = {
sequence ← number;
};
Cycle:
PUBLIC
PROC [number: CycleNumber, decodes:
LIST
OF
ATOM] = {
tree[master][sequence][number] ← decodes;
};
Decode:
PUBLIC
PROC[state: MCtlMachineState, decode:
ATOM]
RETURNS [conducts:
BOOL] = {
z: LIST OF ATOM ← tree[state.SeqMaster][state.Sequence][state.SeqState];
UNTIL z =
NIL
DO
IF z.first=decode THEN RETURN[TRUE];
z ← z.rest;
ENDLOOP;
RETURN[FALSE];
};
END.