OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env dart |
| 2 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. |
| 5 |
| 6 import 'dart:io'; |
| 7 |
| 8 const String ClassPath = '.:/usr/share/java/antlr3-runtime.jar'; |
| 9 const String MainClass = 'SpecParser'; |
| 10 const String JavaExecutable = 'java'; |
| 11 |
| 12 main([arguments]) { |
| 13 for (String arg in arguments) { |
| 14 handleResult(ProcessResult result) { |
| 15 if (result.stderr.length != 0) { |
| 16 print('Error parsing $arg:\n${result.stderr}'); |
| 17 } |
| 18 print(result.stdout); |
| 19 } |
| 20 |
| 21 List<String> javaArguments = <String>['-cp', ClassPath, MainClass, arg]; |
| 22 Process.run(JavaExecutable, javaArguments).then(handleResult); |
| 23 } |
| 24 } |
OLD | NEW |