| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 tree; |
| 6 |
| 5 /** | 7 /** |
| 6 * This visitor takes another visitor and applies it to every | 8 * This visitor takes another visitor and applies it to every |
| 7 * node in the tree. There is currently no way to control the | 9 * node in the tree. There is currently no way to control the |
| 8 * traversal. | 10 * traversal. |
| 9 */ | 11 */ |
| 10 class TraversingVisitor extends Visitor { | 12 class TraversingVisitor extends Visitor { |
| 11 final Visitor visitor; | 13 final Visitor visitor; |
| 12 | 14 |
| 13 TraversingVisitor(Visitor this.visitor); | 15 TraversingVisitor(Visitor this.visitor); |
| 14 | 16 |
| 15 visitNode(Node node) { | 17 visitNode(Node node) { |
| 16 node.accept(visitor); | 18 node.accept(visitor); |
| 17 node.visitChildren(this); | 19 node.visitChildren(this); |
| 18 } | 20 } |
| 19 } | 21 } |
| OLD | NEW |