dart-sdk/tools/spec_parser/spec_parse.dart
Devon Carew c4dc032f6c [repo] improve the analysis of the tools/ directory
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>
2022-02-17 19:09:52 +00:00

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);
}
}