Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: pkg/analyzer2dart/lib/src/dart_backend.dart

Issue 548253003: First end-to-end capability in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..f6a3cd158c9ce751d8dfd1b99f99dca5b9b88afa
--- /dev/null
+++ b/pkg/analyzer2dart/lib/src/dart_backend.dart
@@ -0,0 +1,77 @@
+// 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);
sigurdm 2014/09/08 14:07:15 Long line
Johnni Winther 2014/09/09 14:21:26 Done.
+ 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
+ );
sigurdm 2014/09/08 14:07:15 I think this `);` should go to previous line.
Johnni Winther 2014/09/09 14:21:26 Done.
+
+}
+
+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 {}]) {
sigurdm 2014/09/08 14:07:15 Long line (several in this file)
Johnni Winther 2014/09/09 14:21:26 Quick fix!! Done.
+ // 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
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698