| 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 tree; | 5 part of tree; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Pretty-prints Node tree in XML-like format. | 8 * Pretty-prints Node tree in XML-like format. |
| 9 * | 9 * |
| 10 * TODO(smok): Add main() to run from command-line to print out tree for given | 10 * TODO(smok): Add main() to run from command-line to print out tree for given |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 visitChildNode(node.superclass, "superclass"); | 81 visitChildNode(node.superclass, "superclass"); |
| 82 visitChildNode(node.interfaces, "interfaces"); | 82 visitChildNode(node.interfaces, "interfaces"); |
| 83 visitChildNode(node.typeParameters, "typeParameters"); | 83 visitChildNode(node.typeParameters, "typeParameters"); |
| 84 closeNode(); | 84 closeNode(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 visitConditional(Conditional node) { | 87 visitConditional(Conditional node) { |
| 88 visitNodeWithChildren(node, "Conditional"); | 88 visitNodeWithChildren(node, "Conditional"); |
| 89 } | 89 } |
| 90 | 90 |
| 91 visitConditionalUri(ConditionalUri node) { |
| 92 visitNodeWithChildren(node, "ConditionalUri"); |
| 93 } |
| 94 |
| 91 visitContinueStatement(ContinueStatement node) { | 95 visitContinueStatement(ContinueStatement node) { |
| 92 visitNodeWithChildren(node, "ContinueStatement"); | 96 visitNodeWithChildren(node, "ContinueStatement"); |
| 93 } | 97 } |
| 94 | 98 |
| 99 visitDottedName(DottedName node) { |
| 100 openNode(node, "DottedName"); |
| 101 visitChildNode(node.identifiers, "identifiers"); |
| 102 closeNode(); |
| 103 } |
| 104 |
| 95 visitDoWhile(DoWhile node) { | 105 visitDoWhile(DoWhile node) { |
| 96 visitNodeWithChildren(node, "DoWhile"); | 106 visitNodeWithChildren(node, "DoWhile"); |
| 97 } | 107 } |
| 98 | 108 |
| 99 visitEmptyStatement(EmptyStatement node) { | 109 visitEmptyStatement(EmptyStatement node) { |
| 100 visitNodeWithChildren(node, "EmptyStatement"); | 110 visitNodeWithChildren(node, "EmptyStatement"); |
| 101 } | 111 } |
| 102 | 112 |
| 103 visitEnum(Enum node) { | 113 visitEnum(Enum node) { |
| 104 visitNodeWithChildren(node, "Enum"); | 114 visitNodeWithChildren(node, "Enum"); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 383 |
| 374 visitCombinator(Combinator node) { | 384 visitCombinator(Combinator node) { |
| 375 openNode(node, "Combinator", {"isShow" : "${node.isShow}", | 385 openNode(node, "Combinator", {"isShow" : "${node.isShow}", |
| 376 "isHide" : "${node.isHide}"}); | 386 "isHide" : "${node.isHide}"}); |
| 377 closeNode(); | 387 closeNode(); |
| 378 } | 388 } |
| 379 | 389 |
| 380 visitExport(Export node) { | 390 visitExport(Export node) { |
| 381 openNode(node, "Export"); | 391 openNode(node, "Export"); |
| 382 visitChildNode(node.uri, "uri"); | 392 visitChildNode(node.uri, "uri"); |
| 393 if (node.conditionalUris != null) { |
| 394 visitChildNode(node.conditionalUris, "conditionalUris"); |
| 395 } |
| 383 visitChildNode(node.combinators, "combinators"); | 396 visitChildNode(node.combinators, "combinators"); |
| 384 closeNode(); | 397 closeNode(); |
| 385 } | 398 } |
| 386 | 399 |
| 387 visitImport(Import node) { | 400 visitImport(Import node) { |
| 388 openNode(node, "Import", { | 401 openNode(node, "Import", { |
| 389 "isDeferred" : "${node.isDeferred}"}); | 402 "isDeferred" : "${node.isDeferred}"}); |
| 390 visitChildNode(node.uri, "uri"); | 403 visitChildNode(node.uri, "uri"); |
| 404 if (node.conditionalUris != null) { |
| 405 visitChildNode(node.conditionalUris, "conditionalUris"); |
| 406 } |
| 391 visitChildNode(node.combinators, "combinators"); | 407 visitChildNode(node.combinators, "combinators"); |
| 392 if (node.prefix != null) { | 408 if (node.prefix != null) { |
| 393 visitChildNode(node.prefix, "prefix"); | 409 visitChildNode(node.prefix, "prefix"); |
| 394 } | 410 } |
| 395 closeNode(); | 411 closeNode(); |
| 396 } | 412 } |
| 397 | 413 |
| 398 visitPart(Part node) { | 414 visitPart(Part node) { |
| 399 openNode(node, "Part"); | 415 openNode(node, "Part"); |
| 400 visitChildNode(node.uri, "uri"); | 416 visitChildNode(node.uri, "uri"); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 } | 470 } |
| 455 | 471 |
| 456 visitGotoStatement(GotoStatement node) { | 472 visitGotoStatement(GotoStatement node) { |
| 457 unimplemented('visitNode', node: node); | 473 unimplemented('visitNode', node: node); |
| 458 } | 474 } |
| 459 | 475 |
| 460 unimplemented(String message, {Node node}) { | 476 unimplemented(String message, {Node node}) { |
| 461 throw message; | 477 throw message; |
| 462 } | 478 } |
| 463 } | 479 } |
| OLD | NEW |