| 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 /** | 5 /** |
| 6 * Pretty-prints Node tree in XML-like format. | 6 * Pretty-prints Node tree in XML-like format. |
| 7 * | 7 * |
| 8 * TODO(smok): Add main() to run from command-line to print out tree for given | 8 * TODO(smok): Add main() to run from command-line to print out tree for given |
| 9 * .dart file. | 9 * .dart file. |
| 10 */ | 10 */ |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 visitCaseMatch(CaseMatch node) { | 121 visitCaseMatch(CaseMatch node) { |
| 122 visitNodeWithChildren(node, "CaseMatch"); | 122 visitNodeWithChildren(node, "CaseMatch"); |
| 123 } | 123 } |
| 124 | 124 |
| 125 visitCatchBlock(CatchBlock node) { | 125 visitCatchBlock(CatchBlock node) { |
| 126 visitNodeWithChildren(node, "CatchBlock"); | 126 visitNodeWithChildren(node, "CatchBlock"); |
| 127 } | 127 } |
| 128 | 128 |
| 129 visitClassNode(ClassNode node) { | 129 visitClassNode(ClassNode node) { |
| 130 visitNodeWithChildren(node, "ClassNode"); | 130 openNode("ClassNode", { |
| 131 "beginToken" : tokenToStringOrNull(node.getBeginToken()), |
| 132 "endToken" : tokenToStringOrNull(node.getEndToken()), |
| 133 "extendsKeyword" : tokenToStringOrNull(node.extendsKeyword), |
| 134 }); |
| 135 visitWithPrefix(node.name, "name:"); |
| 136 visitWithPrefix(node.superclass, "superclass:"); |
| 137 visitWithPrefix(node.interfaces, "interfaces:"); |
| 138 visitWithPrefix(node.typeParameters, "typeParameters:"); |
| 139 visitWithPrefix(node.defaultClause, "defaultClause:"); |
| 140 closeNode("ClassNode"); |
| 131 } | 141 } |
| 132 | 142 |
| 133 visitConditional(Conditional node) { | 143 visitConditional(Conditional node) { |
| 134 visitNodeWithChildren(node, "Conditional"); | 144 visitNodeWithChildren(node, "Conditional"); |
| 135 } | 145 } |
| 136 | 146 |
| 137 visitContinueStatement(ContinueStatement node) { | 147 visitContinueStatement(ContinueStatement node) { |
| 138 visitNodeWithChildren(node, "ContinueStatement"); | 148 visitNodeWithChildren(node, "ContinueStatement"); |
| 139 } | 149 } |
| 140 | 150 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 visitWithPrefix(node.type, "type:"); | 380 visitWithPrefix(node.type, "type:"); |
| 371 visitWithPrefix(node.modifiers, "modifiers:"); | 381 visitWithPrefix(node.modifiers, "modifiers:"); |
| 372 visitWithPrefix(node.definitions, "definitions:"); | 382 visitWithPrefix(node.definitions, "definitions:"); |
| 373 closeNode("VariableDefinitions"); | 383 closeNode("VariableDefinitions"); |
| 374 } | 384 } |
| 375 | 385 |
| 376 visitWhile(While node) { | 386 visitWhile(While node) { |
| 377 visitNodeWithChildren(node, "While"); | 387 visitNodeWithChildren(node, "While"); |
| 378 } | 388 } |
| 379 } | 389 } |
| OLD | NEW |