OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/kernel.h" | 5 #include "vm/kernel.h" |
6 | 6 |
7 namespace dart { | 7 namespace dart { |
8 | 8 |
9 namespace kernel { | 9 namespace kernel { |
10 | 10 |
11 | 11 |
12 template <typename T> | 12 template <typename T> |
13 void VisitList(List<T>* list, Visitor* visitor) { | 13 void VisitList(List<T>* list, Visitor* visitor) { |
14 for (int i = 0; i < list->length(); ++i) { | 14 for (int i = 0; i < list->length(); ++i) { |
15 (*list)[i]->AcceptVisitor(visitor); | 15 (*list)[i]->AcceptVisitor(visitor); |
16 } | 16 } |
17 } | 17 } |
18 | 18 |
19 | 19 |
20 Node::~Node() {} | 20 Node::~Node() {} |
21 | 21 |
22 | 22 |
23 TreeNode::~TreeNode() {} | 23 TreeNode::~TreeNode() {} |
24 | 24 |
25 | 25 |
26 void TreeNode::AcceptVisitor(Visitor* visitor) { AcceptTreeVisitor(visitor); } | 26 void TreeNode::AcceptVisitor(Visitor* visitor) { |
| 27 AcceptTreeVisitor(visitor); |
| 28 } |
27 | 29 |
28 | 30 |
29 Library::~Library() {} | 31 Library::~Library() {} |
30 | 32 |
31 | 33 |
32 void Library::AcceptTreeVisitor(TreeVisitor* visitor) { | 34 void Library::AcceptTreeVisitor(TreeVisitor* visitor) { |
33 visitor->VisitLibrary(this); | 35 visitor->VisitLibrary(this); |
34 } | 36 } |
35 | 37 |
36 | 38 |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 | 1067 |
1066 void FunctionDeclaration::VisitChildren(Visitor* visitor) { | 1068 void FunctionDeclaration::VisitChildren(Visitor* visitor) { |
1067 visitor->VisitVariableDeclaration(variable()); | 1069 visitor->VisitVariableDeclaration(variable()); |
1068 visitor->VisitFunctionNode(function()); | 1070 visitor->VisitFunctionNode(function()); |
1069 } | 1071 } |
1070 | 1072 |
1071 | 1073 |
1072 Name::~Name() {} | 1074 Name::~Name() {} |
1073 | 1075 |
1074 | 1076 |
1075 void Name::AcceptVisitor(Visitor* visitor) { visitor->VisitName(this); } | 1077 void Name::AcceptVisitor(Visitor* visitor) { |
| 1078 visitor->VisitName(this); |
| 1079 } |
1076 | 1080 |
1077 | 1081 |
1078 void Name::VisitChildren(Visitor* visitor) {} | 1082 void Name::VisitChildren(Visitor* visitor) {} |
1079 | 1083 |
1080 | 1084 |
1081 InferredValue::~InferredValue() {} | 1085 InferredValue::~InferredValue() {} |
1082 | 1086 |
1083 | 1087 |
1084 void InferredValue::AcceptVisitor(Visitor* visitor) { | 1088 void InferredValue::AcceptVisitor(Visitor* visitor) { |
1085 visitor->VisitInferredValue(this); | 1089 visitor->VisitInferredValue(this); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 | 1200 |
1197 void Program::VisitChildren(Visitor* visitor) { | 1201 void Program::VisitChildren(Visitor* visitor) { |
1198 VisitList(&libraries(), visitor); | 1202 VisitList(&libraries(), visitor); |
1199 visitor->VisitProcedureReference(main_method()); | 1203 visitor->VisitProcedureReference(main_method()); |
1200 } | 1204 } |
1201 | 1205 |
1202 | 1206 |
1203 } // namespace kernel | 1207 } // namespace kernel |
1204 | 1208 |
1205 } // namespace dart | 1209 } // namespace dart |
OLD | NEW |