Pattern matching machine


state := 1; for i := 1 to n do begin while trans( state, text[i] ) = FAIL do state := failure( state ); state := trans( state, text[i] ); if output(state) <> {} then {*** a match was found ***}; end;

Pascal source (714.srch.p)



© Addison-Wesley Publishing Co. Inc.