From 899b096f901c44b23ba0089f0c3554ad1c046e6f Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 21 Mar 2009 02:51:15 -0500 Subject: [PATCH] Dan asked me to remove state-machine --- extra/state-machine/authors.txt | 1 - extra/state-machine/state-machine.factor | 42 ------------------------ 2 files changed, 43 deletions(-) delete mode 100755 extra/state-machine/authors.txt delete mode 100755 extra/state-machine/state-machine.factor diff --git a/extra/state-machine/authors.txt b/extra/state-machine/authors.txt deleted file mode 100755 index f990dd0ed2..0000000000 --- a/extra/state-machine/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Daniel Ehrenberg diff --git a/extra/state-machine/state-machine.factor b/extra/state-machine/state-machine.factor deleted file mode 100755 index 18c3720927..0000000000 --- a/extra/state-machine/state-machine.factor +++ /dev/null @@ -1,42 +0,0 @@ -USING: kernel parser lexer strings math namespaces make -sequences words io arrays quotations debugger accessors -sequences.private ; -IN: state-machine - -: STATES: - ! STATES: set-name state1 state2 ... ; - ";" parse-tokens - [ length ] keep - unclip suffix - [ create-in swap 1quotation define ] 2each ; parsing - -TUPLE: state place data ; - -ERROR: missing-state ; - -M: missing-state error. - drop "Missing state" print ; - -: make-machine ( states -- table quot ) - ! quot is ( state string -- output-string ) - [ missing-state ] dup - [ - [ [ dup [ data>> ] [ place>> ] bi ] dip ] % - [ swapd bounds-check dispatch ] curry , - [ each pick (>>place) swap (>>date) ] % - ] [ ] make [ over make ] curry ; - -: define-machine ( word state-class -- ) - execute make-machine - [ over ] dip define - "state-table" set-word-prop ; - -: MACHINE: - ! MACHINE: utf8 unicode-states - CREATE scan-word define-machine ; parsing - -: S: - ! S: state state-machine definition... ; - ! definition MUST be ( data char -- newdata state ) - scan-word execute scan-word "state-table" word-prop - parse-definition -rot set-nth ; parsing