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

Unified Diff: compiler/javatests/com/google/dart/compiler/backend/js/FlatteningVisitor.java

Issue 9479013: Remove backends. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More clean up Created 8 years, 10 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: compiler/javatests/com/google/dart/compiler/backend/js/FlatteningVisitor.java
diff --git a/compiler/javatests/com/google/dart/compiler/backend/js/FlatteningVisitor.java b/compiler/javatests/com/google/dart/compiler/backend/js/FlatteningVisitor.java
deleted file mode 100644
index b50515ad0245197bdb8a5dc42a8b2d7d198a8ab6..0000000000000000000000000000000000000000
--- a/compiler/javatests/com/google/dart/compiler/backend/js/FlatteningVisitor.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2011, 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.
-
-package com.google.dart.compiler.backend.js;
-
-import com.google.dart.compiler.backend.js.ast.JsStatement;
-import com.google.dart.compiler.backend.js.ast.JsVisitable;
-import com.google.dart.compiler.backend.js.ast.JsVisitor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-class FlatteningVisitor extends JsVisitor {
-
- public static TreeNode exec(List<JsStatement> statements) {
- FlatteningVisitor visitor = new FlatteningVisitor();
- visitor.acceptList(statements);
- return visitor.root;
- }
-
- public static class TreeNode {
- public final JsVisitable node;
- public final List<TreeNode> children = new ArrayList<TreeNode>();
-
- public TreeNode(JsVisitable node) {
- this.node = node;
- }
- }
-
- private TreeNode root;
-
- private FlatteningVisitor() {
- root = new TreeNode(null);
- }
-
- protected <T extends JsVisitable> T doAccept(T node) {
- TreeNode oldRoot = root;
- root = new TreeNode(node);
- oldRoot.children.add(root);
- super.doAccept(node);
- root = oldRoot;
- return node;
- }
-
- // @Override
- protected <T extends JsVisitable> void doAcceptList(List<T> collection) {
- for (Iterator<T> it = collection.iterator(); it.hasNext();) {
- doAccept(it.next());
- }
- }
-}

Powered by Google App Engine
This is Rietveld 408576698