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 csslib.visitor; | 5 part of csslib.visitor; |
6 | 6 |
7 /** | 7 /** |
8 * The base type for all nodes in a CSS abstract syntax tree. | 8 * The base type for all nodes in a CSS abstract syntax tree. |
9 */ | 9 */ |
10 abstract class TreeNode { | 10 abstract class TreeNode { |
11 /** The source code this [TreeNode] represents. */ | 11 /** The source code this [TreeNode] represents. */ |
12 Span span; | 12 Span span; |
13 | 13 |
14 TreeNode(this.span) {} | 14 TreeNode(this.span) {} |
15 | 15 |
| 16 TreeNode clone(); |
| 17 |
16 /** Classic double-dispatch visitor for implementing passes. */ | 18 /** Classic double-dispatch visitor for implementing passes. */ |
17 visit(VisitorBase visitor); | 19 visit(VisitorBase visitor); |
18 | 20 |
19 /** A multiline string showing the node and its children. */ | 21 /** A multiline string showing the node and its children. */ |
20 String toDebugString() { | 22 String toDebugString() { |
21 var to = new TreeOutput(); | 23 var to = new TreeOutput(); |
22 var tp = new _TreePrinter(to, true); | 24 var tp = new _TreePrinter(to, true); |
23 this.visit(tp); | 25 this.visit(tp); |
24 return to.buf.toString(); | 26 return to.buf.toString(); |
25 } | 27 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 writeln('null'); | 102 writeln('null'); |
101 } | 103 } |
102 } | 104 } |
103 depth -= 1; | 105 depth -= 1; |
104 writeln(']'); | 106 writeln(']'); |
105 } | 107 } |
106 } | 108 } |
107 | 109 |
108 String toString() => buf.toString(); | 110 String toString() => buf.toString(); |
109 } | 111 } |
OLD | NEW |