| Index: pkg/analyzer2dart/lib/src/dart_backend.dart
|
| diff --git a/pkg/analyzer2dart/lib/src/dart_backend.dart b/pkg/analyzer2dart/lib/src/dart_backend.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..840951551d581a9e4829266441f07e8ae918c262
|
| --- /dev/null
|
| +++ b/pkg/analyzer2dart/lib/src/dart_backend.dart
|
| @@ -0,0 +1,87 @@
|
| +// Copyright (c) 2014, 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.
|
| +
|
| +library analyzer2dart.dart_backend;
|
| +
|
| +import 'package:compiler/implementation/elements/elements.dart';
|
| +import 'package:compiler/implementation/dart_backend/dart_backend.dart';
|
| +import 'package:compiler/implementation/dart2jslib.dart';
|
| +
|
| +import 'driver.dart';
|
| +import 'converted_world.dart';
|
| +
|
| +void compileToDart(Driver driver, ConvertedWorld convertedWorld) {
|
| + DartOutputter outputter =
|
| + new DartOutputter(new Listener(), driver.outputProvider);
|
| + outputter.assembleProgram(
|
| + libraries: convertedWorld.libraries,
|
| + instantiatedClasses: convertedWorld.instantiatedClasses,
|
| + resolvedElements: convertedWorld.resolvedElements,
|
| + mainFunction: convertedWorld.mainFunction,
|
| + computeElementAst: (Element element) {
|
| + return DartBackend.createElementAst(
|
| + null, null, null, null, convertedWorld.getIr(element));
|
| + },
|
| + shouldOutput: (_) => true,
|
| + isSafeToRemoveTypeDeclarations: (_) => false);
|
| +
|
| +}
|
| +
|
| +class Listener implements DiagnosticListener {
|
| +
|
| + @override
|
| + void internalError(Spannable spannable, message) {
|
| + // TODO: implement internalError
|
| + }
|
| +
|
| + @override
|
| + void log(message) {
|
| + // TODO: implement log
|
| + }
|
| +
|
| + @override
|
| + void reportError(Spannable node,
|
| + MessageKind errorCode,
|
| + [Map arguments = const {}]) {
|
| + // TODO: implement reportError
|
| + }
|
| +
|
| + @override
|
| + void reportFatalError(Spannable node,
|
| + MessageKind errorCode,
|
| + [Map arguments = const {}]) {
|
| + // TODO: implement reportFatalError
|
| + }
|
| +
|
| + @override
|
| + void reportHint(Spannable node,
|
| + MessageKind errorCode,
|
| + [Map arguments = const {}]) {
|
| + // TODO: implement reportHint
|
| + }
|
| +
|
| + @override
|
| + void reportInfo(Spannable node,
|
| + MessageKind errorCode,
|
| + [Map arguments = const {}]) {
|
| + // TODO: implement reportInfo
|
| + }
|
| +
|
| + @override
|
| + void reportWarning(Spannable node,
|
| + MessageKind errorCode,
|
| + [Map arguments = const {}]) {
|
| + // TODO: implement reportWarning
|
| + }
|
| +
|
| + @override
|
| + SourceSpan spanFromSpannable(Spannable node) {
|
| + // TODO: implement spanFromSpannable
|
| + }
|
| +
|
| + @override
|
| + withCurrentElement(element, f()) {
|
| + // TODO: implement withCurrentElement
|
| + }
|
| +}
|
|
|