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

Unified Diff: tools/lexer_generator/nfa_builder.py

Issue 78153002: Experimental parser: remove some dead code (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years, 1 month 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/nfa.py ('k') | tools/lexer_generator/rule_parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/nfa_builder.py
diff --git a/tools/lexer_generator/nfa_builder.py b/tools/lexer_generator/nfa_builder.py
index c5410b324d693466233b22cc7dbef846241b1173..d5a3e09c3bfe9354c21cebc8dcc319acecaf0c59 100644
--- a/tools/lexer_generator/nfa_builder.py
+++ b/tools/lexer_generator/nfa_builder.py
@@ -146,16 +146,12 @@ class NfaBuilder(object):
return self.__key_state(TransitionKey.unique('catch_all'))
def __join(self, graph):
- (graph, name, subgraph, modifier) = graph[1:]
+ (graph, name, subgraph) = graph[1:]
subgraphs = self.__peek_state()['subgraphs']
if not name in subgraphs:
subgraphs[name] = self.__nfa(subgraph)
(subgraph_start, subgraph_end, nodes_in_subgraph) = subgraphs[name]
(start, ends) = self.__process(graph)
- if modifier:
- assert modifier == 'ZERO_OR_MORE'
- for end in ends:
- end.add_epsilon_transition(subgraph_end)
self.__patch_ends(ends, subgraph_start)
end = self.__new_state()
subgraph_end.add_epsilon_transition(end)
@@ -214,7 +210,8 @@ class NfaBuilder(object):
is_epsilon = lambda k: k == TransitionKey.epsilon()
state_iter = lambda node : node.state_iter(key_filter = is_epsilon)
edge = set(state_iter(node))
- closure = Automaton.visit_states(edge, inner, state_iter=state_iter, visit_state=set())
+ closure = Automaton.visit_states(
+ edge, inner, state_iter=state_iter, visit_state=set())
node.set_epsilon_closure(closure)
Automaton.visit_states(set([start_state]), outer)
@@ -260,10 +257,8 @@ class NfaBuilder(object):
return ('EPSILON',)
@staticmethod
- def join_subgraph(graph, name, subgraph, modifier):
- if modifier:
- modifier = NfaBuilder.__modifer_map[modifier]
- return ('JOIN', graph, name, subgraph, modifier)
+ def join_subgraph(graph, name, subgraph):
+ return ('JOIN', graph, name, subgraph)
@staticmethod
def or_graphs(graphs):
« no previous file with comments | « tools/lexer_generator/nfa.py ('k') | tools/lexer_generator/rule_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698