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

Side by Side Diff: pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart

Issue 1089793002: Add a command line option to use the new CPS based backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update comment. Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/dart2js.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart_tree_printer; 5 library dart_tree_printer;
6 6
7 import '../constants/values.dart' as values; 7 import '../constants/values.dart' as values;
8 import '../dart_types.dart' as types; 8 import '../dart_types.dart' as types;
9 import '../dart2jslib.dart' as dart2js; 9 import '../dart2jslib.dart' as dart2js;
10 import '../elements/elements.dart' as elements; 10 import '../elements/elements.dart' as elements;
11 import '../tree/tree.dart' as tree; 11 import '../tree/tree.dart' as tree;
12 import '../scanner/scannerlib.dart'; 12 import '../scanner/scannerlib.dart';
13 import '../util/util.dart'; 13 import '../util/util.dart';
14 import 'backend_ast_nodes.dart'; 14 import 'backend_ast_nodes.dart';
15 import 'backend_ast_emitter.dart' show TypeGenerator; 15 import 'backend_ast_emitter.dart' show TypeGenerator;
16 16
17 /// Translates the backend AST to Dart frontend AST. 17 /// Translates the backend AST to Dart frontend AST.
18 tree.Node emit(dart2js.TreeElementMapping treeElements, 18 tree.Node emit(dart2js.TreeElementMapping treeElements,
19 RootNode root) { 19 RootNode root) {
20 return new TreePrinter(treeElements).makeDefinition(root); 20 return new TreePrinter(treeElements).makeDefinition(root);
21 } 21 }
22 22
23 /// If true, the unparser will insert a coment in front of every function 23 /// If true, the unparser will insert a coment in front of every function
24 /// it emits. This helps indicate which functions were translated by the new 24 /// it emits. This helps indicate which functions were translated by the new
25 /// backend. 25 /// backend.
26 bool INSERT_NEW_BACKEND_COMMENT = 26 bool INSERT_NEW_BACKEND_COMMENT =
27 const bool.fromEnvironment('USE_NEW_BACKEND', defaultValue: false); 27 const bool.fromEnvironment("INSERT_NEW_BACKEND_COMMENT");
28 28
29 /// Converts backend ASTs to frontend ASTs. 29 /// Converts backend ASTs to frontend ASTs.
30 class TreePrinter { 30 class TreePrinter {
31 dart2js.TreeElementMapping treeElements; 31 dart2js.TreeElementMapping treeElements;
32 32
33 TreePrinter([this.treeElements]); 33 TreePrinter([this.treeElements]);
34 34
35 tree.Node makeDefinition(RootNode node) { 35 tree.Node makeDefinition(RootNode node) {
36 if (node is FieldDefinition) { 36 if (node is FieldDefinition) {
37 tree.Node definition; 37 tree.Node definition;
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 printStringChunk(chunk.previous), 1332 printStringChunk(chunk.previous),
1333 node); 1333 node);
1334 } else { 1334 } else {
1335 return node; 1335 return node;
1336 } 1336 }
1337 } 1337 }
1338 return printStringChunk(output.chunk); 1338 return printStringChunk(output.chunk);
1339 } 1339 }
1340 1340
1341 } 1341 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart2js.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698