OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart_backend; | |
6 | |
7 class CloningVisitor implements Visitor<Node> { | 5 class CloningVisitor implements Visitor<Node> { |
8 final TreeElements originalTreeElements; | 6 final TreeElements originalTreeElements; |
9 final TreeElementMapping cloneTreeElements; | 7 final TreeElementMapping cloneTreeElements; |
10 | 8 |
11 CloningVisitor(this.originalTreeElements) | 9 CloningVisitor(this.originalTreeElements) |
12 : cloneTreeElements = new TreeElementMapping(); | 10 : cloneTreeElements = new TreeElementMapping(); |
13 | 11 |
14 visit(Node node) { | 12 visit(Node node) { |
15 if (node == null) return null; | 13 if (node == null) return null; |
16 final clone = node.accept(this); | 14 final clone = node.accept(this); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 268 } |
271 | 269 |
272 Node visitStringNode(StringNode node) { | 270 Node visitStringNode(StringNode node) { |
273 unimplemented('visitNode', node: node); | 271 unimplemented('visitNode', node: node); |
274 } | 272 } |
275 | 273 |
276 unimplemented(String message, {Node node}) { | 274 unimplemented(String message, {Node node}) { |
277 throw message; | 275 throw message; |
278 } | 276 } |
279 } | 277 } |
OLD | NEW |