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

Unified Diff: tools/lexer_generator/generator.py

Issue 172893003: Experimental parser: add dfa path iterator (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/generator.py
diff --git a/tools/lexer_generator/generator.py b/tools/lexer_generator/generator.py
index 20668f9a75efdf3aa49d28b7d3393b03165ddc35..f69b5eddfa5565869a860147728f156cf3e97295 100644
--- a/tools/lexer_generator/generator.py
+++ b/tools/lexer_generator/generator.py
@@ -141,6 +141,7 @@ if __name__ == '__main__':
parser.add_argument('--debug-code', action='store_true')
parser.add_argument('--profile', action='store_true')
parser.add_argument('--rule-html')
+ parser.add_argument('--count-paths', action='store_true')
args = parser.parse_args()
minimize_default = not args.no_minimize_default
@@ -168,6 +169,13 @@ if __name__ == '__main__':
dfa.node_count(), mdfa.node_count())
DfaMinimizer.set_verify(True)
+ if args.count_paths:
+ path_count = 0
+ print 'counting'
+ for path in rule_processor.default_automata().minimal_dfa().path_iter():
+ path_count += 1
+ print 'done', path_count
+
html_file = args.html
if html_file:
html = generate_html(
« 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