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

Unified Diff: tools/lexer_generator/dfa.py

Issue 160443002: Experimental parser: remove match actions (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/code_generator.py ('k') | tools/lexer_generator/dfa_optimizer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/dfa.py
diff --git a/tools/lexer_generator/dfa.py b/tools/lexer_generator/dfa.py
index 32ac769fafbb037fea4a215d42e8e1049486c86c..5a3dd5e4b364588ef2e1eb893056661d41af8cb0 100644
--- a/tools/lexer_generator/dfa.py
+++ b/tools/lexer_generator/dfa.py
@@ -44,6 +44,14 @@ class DfaState(AutomatonState):
def action(self):
return self.__action
+ def transition_count(self):
+ return len(self.__transitions)
+
+ def omega_transition(self):
+ if TransitionKey.omega() in self.__transitions:
+ return self.__transitions[TransitionKey.omega()]
+ return None
+
def epsilon_closure_iter(self):
return iter([])
@@ -185,7 +193,8 @@ class DfaMinimizer:
else:
# Match actions are valid only if we have matched the whole token, not
# just some sub-part of it.
- assert not action.match_action()
+ # TODO(dcarney): restore
+ # assert not action.is_match_action()
key = ("nonterminal set", action)
if not key in initial_partitions:
initial_partitions[key] = set()
« no previous file with comments | « tools/lexer_generator/code_generator.py ('k') | tools/lexer_generator/dfa_optimizer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698