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

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: Updated cf. comments. 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
« no previous file with comments | « pkg/analyzer2dart/lib/src/cps_generator.dart ('k') | pkg/analyzer2dart/lib/src/driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
+ }
+}
« no previous file with comments | « pkg/analyzer2dart/lib/src/cps_generator.dart ('k') | pkg/analyzer2dart/lib/src/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698