<> <> <> <<>> <> <<>> DIRECTORY Rope USING [ROPE]; ACFind: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; <> Ref: TYPE ~ REF Rep; ActionProc: TYPE ~ PROC[position: INT, keyFound: ROPE] RETURNS [quit: BOOL _ FALSE]; <> <<>> Create: PROC [keys: LIST OF ROPE, caseSensitive: BOOL _ FALSE] RETURNS [Ref]; <> <<>> Find: PROC [self: Ref, text: ROPE, action: ActionProc] RETURNS [foundAny: BOOLEAN _ FALSE]; <> <> <> MoveRep: TYPE ~ RECORD[SEQUENCE l: NAT OF State]; State: TYPE ~ REF StateRep _ NIL; StateRep: TYPE ~ RECORD [ keys: LIST OF ROPE _ NIL, -- what keys have been matched, if any? failure: State _ NIL, -- the next state, by default offset: CHAR _ '\000, -- offset to first char of the move sequence move: REF MoveRep _ NIL -- maps characters into States ]; Rep: TYPE ~ RECORD [ initialState: State _ NIL, caseSensitive: BOOLEAN _ FALSE ]; END.