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 #include "vm/ast_printer.h" | 5 #include "vm/ast_printer.h" |
6 | 6 |
7 #include "vm/handles.h" | 7 #include "vm/handles.h" |
8 #include "vm/log.h" | 8 #include "vm/log.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/os.h" | 10 #include "vm/os.h" |
11 #include "vm/parser.h" | 11 #include "vm/parser.h" |
12 | 12 |
13 namespace dart { | 13 namespace dart { |
14 | 14 |
| 15 #ifndef PRODUCT |
| 16 |
15 AstPrinter::AstPrinter() : indent_(0) { } | 17 AstPrinter::AstPrinter() : indent_(0) { } |
16 | 18 |
17 | 19 |
18 AstPrinter::~AstPrinter() { } | 20 AstPrinter::~AstPrinter() { } |
19 | 21 |
20 | 22 |
21 void AstPrinter::VisitGenericAstNode(AstNode* node) { | 23 void AstPrinter::VisitGenericAstNode(AstNode* node) { |
22 THR_Print("(%s ", node->PrettyName()); | 24 THR_Print("(%s ", node->PrettyName()); |
23 node->VisitChildren(this); | 25 node->VisitChildren(this); |
24 THR_Print(")"); | 26 THR_Print(")"); |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 SequenceNode* node_sequence = parsed_function.node_sequence(); | 569 SequenceNode* node_sequence = parsed_function.node_sequence(); |
568 ASSERT(node_sequence != NULL); | 570 ASSERT(node_sequence != NULL); |
569 AstPrinter ast_printer; | 571 AstPrinter ast_printer; |
570 const char* function_name = | 572 const char* function_name = |
571 parsed_function.function().ToFullyQualifiedCString(); | 573 parsed_function.function().ToFullyQualifiedCString(); |
572 THR_Print("Ast for function '%s' {\n", function_name); | 574 THR_Print("Ast for function '%s' {\n", function_name); |
573 node_sequence->Visit(&ast_printer); | 575 node_sequence->Visit(&ast_printer); |
574 THR_Print("}\n"); | 576 THR_Print("}\n"); |
575 } | 577 } |
576 | 578 |
| 579 #endif // !PRODUCT |
| 580 |
577 } // namespace dart | 581 } // namespace dart |
OLD | NEW |