diff options
author | Sergey Alekseev <sergey.alekseev.minsk@gmail.com> | 2014-12-05 16:09:03 +0300 |
---|---|---|
committer | Sergey Alekseev <sergey.alekseev.minsk@gmail.com> | 2014-12-05 16:09:03 +0300 |
commit | db00c5b7a4ffe34ef8879b42e252890659750b46 (patch) | |
tree | 63017c0ceefcf17dcf14150386902c033472ae87 /actionpack | |
parent | 95ddfc4e5840ca88e559157ca105e0042eb5942b (diff) | |
download | rails-db00c5b7a4ffe34ef8879b42e252890659750b46.tar.gz rails-db00c5b7a4ffe34ef8879b42e252890659750b46.tar.bz2 rails-db00c5b7a4ffe34ef8879b42e252890659750b46.zip |
remove unused `#generalized_table`
This method wass copied from journey at https://github.com/rails/rails/commit/56fee39c392788314c44a575b3fd66e16a50c8b5#diff-d89de8881fc4b9f10cb3e4fc7b2463f3R53. However it looks the method was unused in journey at those point as well.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/nfa/transition_table.rb | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/actionpack/lib/action_dispatch/journey/nfa/transition_table.rb b/actionpack/lib/action_dispatch/journey/nfa/transition_table.rb index e65f7238ab..0ccab21801 100644 --- a/actionpack/lib/action_dispatch/journey/nfa/transition_table.rb +++ b/actionpack/lib/action_dispatch/journey/nfa/transition_table.rb @@ -45,51 +45,6 @@ module ActionDispatch (@table.keys + @table.values.flat_map(&:keys)).uniq end - # Returns a generalized transition graph with reduced states. The states - # are reduced like a DFA, but the table must be simulated like an NFA. - # - # Edges of the GTG are regular expressions. - def generalized_table - gt = GTG::TransitionTable.new - marked = {} - state_id = Hash.new { |h,k| h[k] = h.length } - alphabet = self.alphabet - - stack = [eclosure(0)] - - until stack.empty? - state = stack.pop - next if marked[state] || state.empty? - - marked[state] = true - - alphabet.each do |alpha| - next_state = eclosure(following_states(state, alpha)) - next if next_state.empty? - - gt[state_id[state], state_id[next_state]] = alpha - stack << next_state - end - end - - final_groups = state_id.keys.find_all { |s| - s.sort.last == accepting - } - - final_groups.each do |states| - id = state_id[states] - - gt.add_accepting(id) - save = states.find { |s| - @memos.key?(s) && eclosure(s).sort.last == accepting - } - - gt.add_memo(id, memo(save)) - end - - gt - end - # Returns set of NFA states to which there is a transition on ast symbol # +a+ from some state +s+ in +t+. def following_states(t, a) |