mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
c4dc032f6c
Change-Id: I4185e3bdc1f0f6f8464ebc2a043254200e3df486 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233502 Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Devon Carew <devoncarew@google.com>
24 lines
782 B
Dart
Executable file
24 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);
|
|
}
|
|
}
|