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 #if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) | 13 #if !defined(PRODUCT) |
14 | 14 |
15 namespace dart { | 15 namespace dart { |
16 | 16 |
17 AstPrinter::AstPrinter(bool log) | 17 AstPrinter::AstPrinter(bool log) |
18 : indent_(0), logger_(log ? Log::Current() : Log::NoOpLog()) {} | 18 : indent_(0), logger_(log ? Log::Current() : Log::NoOpLog()) {} |
19 | 19 |
20 AstPrinter::~AstPrinter() {} | 20 AstPrinter::~AstPrinter() {} |
21 | 21 |
22 void AstPrinter::VisitGenericAstNode(AstNode* node) { | 22 void AstPrinter::VisitGenericAstNode(AstNode* node) { |
23 logger_->Print("(%s ", node->Name()); | 23 logger_->Print("(%s ", node->Name()); |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 ASSERT(node_sequence != NULL); | 504 ASSERT(node_sequence != NULL); |
505 const char* function_name = | 505 const char* function_name = |
506 parsed_function.function().ToFullyQualifiedCString(); | 506 parsed_function.function().ToFullyQualifiedCString(); |
507 logger_->Print("Ast for function '%s' {\n", function_name); | 507 logger_->Print("Ast for function '%s' {\n", function_name); |
508 node_sequence->Visit(this); | 508 node_sequence->Visit(this); |
509 logger_->Print("}\n"); | 509 logger_->Print("}\n"); |
510 } | 510 } |
511 | 511 |
512 } // namespace dart | 512 } // namespace dart |
513 | 513 |
514 #endif // !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) | 514 #endif // !defined(PRODUCT) |
OLD | NEW |