Chromium Code Reviews| 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 * The base type for all nodes in a dart abstract syntax tree. | 5 * The base type for all nodes in a dart abstract syntax tree. |
| 6 */ | 6 */ |
| 7 class Node { | 7 class Node { |
| 8 /** The source code this [Node] represents. */ | 8 /** The source code this [Node] represents. */ |
| 9 SourceSpan span; | 9 SourceSpan span; |
| 10 | 10 |
| 11 Node(this.span) {} | 11 Node(this.span) {} |
| 12 | 12 |
| 13 /** Classic double-dispatch visitor for implementing passes. */ | 13 /** Classic double-dispatch visitor for implementing passes. */ |
| 14 abstract void visit(TreeVisitor visitor); | 14 abstract visit(TreeVisitor visitor); |
|
jimhug
2011/10/28 20:02:44
Good catch.
| |
| 15 | 15 |
| 16 /** A multiline string showing the node and its children. */ | 16 /** A multiline string showing the node and its children. */ |
| 17 String toDebugString() { | 17 String toDebugString() { |
| 18 var to = new TreeOutput(); | 18 var to = new TreeOutput(); |
| 19 var tp = new TreePrinter(to); | 19 var tp = new TreePrinter(to); |
| 20 this.visit(tp); | 20 this.visit(tp); |
| 21 return to.buf.toString(); | 21 return to.buf.toString(); |
| 22 } | 22 } |
| 23 } | 23 } |
| 24 | 24 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 if (node != null) { | 121 if (node != null) { |
| 122 node.visit(printer); | 122 node.visit(printer); |
| 123 } else { | 123 } else { |
| 124 writeln('null'); | 124 writeln('null'); |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 depth -= 1; | 127 depth -= 1; |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 } | 130 } |
| OLD | NEW |