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 #ifndef VM_AST_H_ | 5 #ifndef VM_AST_H_ |
6 #define VM_AST_H_ | 6 #define VM_AST_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 LocalScope* scope() const { return scope_; } | 158 LocalScope* scope() const { return scope_; } |
159 | 159 |
160 SourceLabel* label() const { return label_; } | 160 SourceLabel* label() const { return label_; } |
161 void set_label(SourceLabel* value) { label_ = value; } | 161 void set_label(SourceLabel* value) { label_ = value; } |
162 | 162 |
163 void VisitChildren(AstNodeVisitor* visitor) const; | 163 void VisitChildren(AstNodeVisitor* visitor) const; |
164 | 164 |
165 void Add(AstNode* node) { nodes_.Add(node); } | 165 void Add(AstNode* node) { nodes_.Add(node); } |
166 intptr_t length() const { return nodes_.length(); } | 166 intptr_t length() const { return nodes_.length(); } |
167 AstNode* NodeAt(intptr_t index) const { return nodes_[index]; } | 167 AstNode* NodeAt(intptr_t index) const { return nodes_[index]; } |
| 168 void ReplaceNodeAt(intptr_t index, AstNode* value) { nodes_[index] = value; } |
168 | 169 |
169 DECLARE_COMMON_NODE_FUNCTIONS(SequenceNode); | 170 DECLARE_COMMON_NODE_FUNCTIONS(SequenceNode); |
170 | 171 |
171 // Collects all nodes accessible from this sequence node into array 'nodes'. | 172 // Collects all nodes accessible from this sequence node into array 'nodes'. |
172 void CollectAllNodes(GrowableArray<AstNode*>* nodes); | 173 void CollectAllNodes(GrowableArray<AstNode*>* nodes); |
173 | 174 |
174 private: | 175 private: |
175 LocalScope* scope_; | 176 LocalScope* scope_; |
176 GrowableArray<AstNode*> nodes_; | 177 GrowableArray<AstNode*> nodes_; |
177 SourceLabel* label_; | 178 SourceLabel* label_; |
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 const intptr_t try_index_; | 1804 const intptr_t try_index_; |
1804 | 1805 |
1805 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1806 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
1806 }; | 1807 }; |
1807 | 1808 |
1808 } // namespace dart | 1809 } // namespace dart |
1809 | 1810 |
1810 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1811 #undef DECLARE_COMMON_NODE_FUNCTIONS |
1811 | 1812 |
1812 #endif // VM_AST_H_ | 1813 #endif // VM_AST_H_ |
OLD | NEW |