c49cbae7f0
Change-Id: Iddd1e8a795bfaed0092a30bb9d83070fe62d4a60 Reviewed-on: https://dart-review.googlesource.com/7261 Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
25 lines
782 B
Dart
Executable File
25 lines
782 B
Dart
Executable File
#!/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);
|
|
}
|
|
}
|