| 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/object.h" | 8 #include "vm/object.h" |
| 9 #include "vm/os.h" | 9 #include "vm/os.h" |
| 10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void AstPrinter::VisitCloneContextNode(CloneContextNode* node) { | 41 void AstPrinter::VisitCloneContextNode(CloneContextNode* node) { |
| 42 VisitGenericAstNode(node); | 42 VisitGenericAstNode(node); |
| 43 } | 43 } |
| 44 | 44 |
| 45 | 45 |
| 46 void AstPrinter::VisitArgumentListNode(ArgumentListNode* arguments) { | 46 void AstPrinter::VisitArgumentListNode(ArgumentListNode* arguments) { |
| 47 VisitGenericAstNode(arguments); | 47 VisitGenericAstNode(arguments); |
| 48 } | 48 } |
| 49 | 49 |
| 50 | 50 |
| 51 void AstPrinter::VisitArgumentDefinitionTestNode( |
| 52 ArgumentDefinitionTestNode* node) { |
| 53 OS::Print("(%s ?%s @%d)", |
| 54 node->Name(), |
| 55 node->formal_parameter_name().ToCString(), |
| 56 node->formal_parameter_index()); |
| 57 } |
| 58 |
| 59 |
| 51 void AstPrinter::VisitReturnNode(ReturnNode* node) { | 60 void AstPrinter::VisitReturnNode(ReturnNode* node) { |
| 52 VisitGenericAstNode(node); | 61 VisitGenericAstNode(node); |
| 53 } | 62 } |
| 54 | 63 |
| 55 | 64 |
| 56 void AstPrinter::VisitGenericLocalNode(AstNode* node, | 65 void AstPrinter::VisitGenericLocalNode(AstNode* node, |
| 57 const LocalVariable& var) { | 66 const LocalVariable& var) { |
| 58 OS::Print("(%s %s%s '%s'", | 67 OS::Print("(%s %s%s '%s'", |
| 59 node->Name(), | 68 node->Name(), |
| 60 var.is_final() ? "final " : "", | 69 var.is_final() ? "final " : "", |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 ASSERT(node_sequence != NULL); | 480 ASSERT(node_sequence != NULL); |
| 472 AstPrinter ast_printer; | 481 AstPrinter ast_printer; |
| 473 const char* function_name = | 482 const char* function_name = |
| 474 parsed_function.function().ToFullyQualifiedCString(); | 483 parsed_function.function().ToFullyQualifiedCString(); |
| 475 OS::Print("Ast for function '%s' {\n", function_name); | 484 OS::Print("Ast for function '%s' {\n", function_name); |
| 476 node_sequence->Visit(&ast_printer); | 485 node_sequence->Visit(&ast_printer); |
| 477 OS::Print("}\n"); | 486 OS::Print("}\n"); |
| 478 } | 487 } |
| 479 | 488 |
| 480 } // namespace dart | 489 } // namespace dart |
| OLD | NEW |