regexp.dfa: more use of hash-sets.
parent
e9d8ff1c0d
commit
e9aeef7a5e
|
@ -43,9 +43,7 @@ IN: regexp.dfa
|
||||||
[ tagged-epsilon? not ] filter ;
|
[ tagged-epsilon? not ] filter ;
|
||||||
|
|
||||||
: add-todo-state ( state visited-states new-states -- )
|
: add-todo-state ( state visited-states new-states -- )
|
||||||
2over key? [ 3drop ] [
|
2over ?adjoin [ nip push ] [ 3drop ] if ;
|
||||||
[ conjoin ] [ push ] bi-curry* bi
|
|
||||||
] if ;
|
|
||||||
|
|
||||||
: add-todo-states ( state/condition visited-states new-states -- )
|
: add-todo-states ( state/condition visited-states new-states -- )
|
||||||
[ condition-states ] 2dip
|
[ condition-states ] 2dip
|
||||||
|
@ -82,6 +80,6 @@ IN: regexp.dfa
|
||||||
: construct-dfa ( nfa -- dfa )
|
: construct-dfa ( nfa -- dfa )
|
||||||
dup initialize-dfa
|
dup initialize-dfa
|
||||||
dup start-state>> condition-states >vector
|
dup start-state>> condition-states >vector
|
||||||
H{ } clone
|
HS{ } clone
|
||||||
new-transitions
|
new-transitions
|
||||||
[ set-final-states ] keep ;
|
[ set-final-states ] keep ;
|
||||||
|
|
Loading…
Reference in New Issue