Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: tools/lexer_generator/dfa_minimizer.py

Issue 169583003: Experimental parser: more verification (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/lexer_generator/dfa.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/dfa_minimizer.py
diff --git a/tools/lexer_generator/dfa_minimizer.py b/tools/lexer_generator/dfa_minimizer.py
index 9b42f604ff11cb3b34fd7a710f0dd8dac29de4ea..142ce1a33e4214cc52a85acd0fbfefd4a73095c7 100644
--- a/tools/lexer_generator/dfa_minimizer.py
+++ b/tools/lexer_generator/dfa_minimizer.py
@@ -89,14 +89,12 @@ class DfaMinimizer:
# IDs.
initial_partitions = {}
terminal_set = self.__dfa.terminal_set()
- all_keys = [] # Will contain all TransitionKeys in the dfa.
# f fills in initial_partitions, id_to_state and all_keys.
def f(state, visitor_state):
state_id = len(id_to_state)
id_to_state[state_id] = state
action = state.action()
- all_keys.append(state.key_iter())
if state in terminal_set:
key = ("terminal set", action)
else:
@@ -133,8 +131,7 @@ class DfaMinimizer:
# become clear when we check the transition for TransitionKey [c-d] (S1 has
# a transition to S2, S3 has a transition to S4).
encoding = self.__dfa.encoding()
- self.__alphabet = list(
- TransitionKey.disjoint_keys(encoding, chain(*all_keys)))
+ self.__alphabet = list(self.__dfa.disjoint_keys_iter())
# For each state and each TransitionKey in the alphabet, find out which
# transition we take from the state with the TransitionKey.
« no previous file with comments | « tools/lexer_generator/dfa.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698