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

Unified Diff: tools/spec_parser/spec_parse.dart

Issue 2688903004: Creating an ANTLR grammar for Dart, potentially the syntax spec.
Patch Set: Enabled parsing many files from one JVM process Created 3 years, 4 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/spec_parser/SpecParserRunner.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/spec_parser/spec_parse.dart
diff --git a/tools/spec_parser/spec_parse.dart b/tools/spec_parser/spec_parse.dart
new file mode 100755
index 0000000000000000000000000000000000000000..d94ce95beef2b0f821b7fbecb24d6d44012f745b
--- /dev/null
+++ b/tools/spec_parser/spec_parse.dart
@@ -0,0 +1,24 @@
+#!/usr/bin/env dart
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+const String ClassPath = '.:/usr/share/java/antlr3-runtime.jar';
+const String MainClass = 'SpecParser';
+const String JavaExecutable = 'java';
+
+main([arguments]) {
+ for (String arg in arguments) {
+ handleResult(ProcessResult result) {
+ if (result.stderr.length != 0) {
+ print('Error parsing $arg:\n${result.stderr}');
+ }
+ print(result.stdout);
+ }
+
+ List<String> javaArguments = <String>['-cp', ClassPath, MainClass, arg];
+ Process.run(JavaExecutable, javaArguments).then(handleResult);
+ }
+}
« no previous file with comments | « tools/spec_parser/SpecParserRunner.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698