Files
sdk/tools/spec_parser/spec_parse.dart
Devon Carew dd5b9cd7d7 [tools/] remove many uses of dynamic in the tools/ directory
Change-Id: I1bd930c11e0463ba0de1938ba417b6664c8cdb28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376023
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-07-17 15:38:50 +00:00

25 lines
814 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';
void main(List<String> arguments) {
for (String arg in arguments) {
void handleResult(ProcessResult result) {
if ((result.stderr as String).isNotEmpty) {
print('Error parsing $arg:\n${result.stderr}');
}
print(result.stdout);
}
List<String> javaArguments = <String>['-cp', classPath, mainClass, arg];
Process.run(javaExecutable, javaArguments).then(handleResult);
}
}