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" |
11 #include "vm/scopes.h" | 11 #include "vm/scopes.h" |
12 #include "vm/object.h" | 12 #include "vm/object.h" |
13 #include "vm/native_entry.h" | 13 #include "vm/native_entry.h" |
14 #include "vm/token.h" | 14 #include "vm/token.h" |
15 | 15 |
16 namespace dart { | 16 namespace dart { |
17 | 17 |
18 #define FOR_EACH_NODE(V) \ | 18 #define FOR_EACH_NODE(V) \ |
19 V(Await) \ | |
19 V(Return) \ | 20 V(Return) \ |
20 V(Literal) \ | 21 V(Literal) \ |
21 V(Type) \ | 22 V(Type) \ |
22 V(Assignable) \ | 23 V(Assignable) \ |
23 V(BinaryOp) \ | 24 V(BinaryOp) \ |
24 V(BinaryOpWithMask32) \ | 25 V(BinaryOpWithMask32) \ |
25 V(Comparison) \ | 26 V(Comparison) \ |
26 V(UnaryOp) \ | 27 V(UnaryOp) \ |
27 V(ConditionalExpr) \ | 28 V(ConditionalExpr) \ |
28 V(If) \ | 29 V(If) \ |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 | 140 |
140 protected: | 141 protected: |
141 friend class ParsedFunction; | 142 friend class ParsedFunction; |
142 | 143 |
143 private: | 144 private: |
144 const intptr_t token_pos_; | 145 const intptr_t token_pos_; |
145 DISALLOW_COPY_AND_ASSIGN(AstNode); | 146 DISALLOW_COPY_AND_ASSIGN(AstNode); |
146 }; | 147 }; |
147 | 148 |
148 | 149 |
150 class AwaitNode : public AstNode { | |
151 public: | |
152 AwaitNode(intptr_t token_pos, AstNode* expr) | |
153 : AstNode(token_pos), | |
154 expr_(expr) { | |
srdjan
2014/08/13 18:41:05
all in one line ?
Michael Lippautz (Google)
2014/08/13 20:32:23
Done.
| |
155 } | |
156 | |
157 void VisitChildren(AstNodeVisitor* visitor) const { | |
158 expr_->Visit(visitor); | |
159 } | |
160 | |
161 AstNode* expr() const { return expr_; } | |
162 | |
163 DECLARE_COMMON_NODE_FUNCTIONS(AwaitNode); | |
164 | |
165 private: | |
166 AstNode* expr_; | |
167 | |
168 DISALLOW_COPY_AND_ASSIGN(AwaitNode); | |
169 }; | |
170 | |
171 | |
149 class SequenceNode : public AstNode { | 172 class SequenceNode : public AstNode { |
150 public: | 173 public: |
151 SequenceNode(intptr_t token_pos, LocalScope* scope) | 174 SequenceNode(intptr_t token_pos, LocalScope* scope) |
152 : AstNode(token_pos), | 175 : AstNode(token_pos), |
153 scope_(scope), | 176 scope_(scope), |
154 nodes_(4), | 177 nodes_(4), |
155 label_(NULL) { | 178 label_(NULL) { |
156 } | 179 } |
157 | 180 |
158 LocalScope* scope() const { return scope_; } | 181 LocalScope* scope() const { return scope_; } |
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1806 const intptr_t try_index_; | 1829 const intptr_t try_index_; |
1807 | 1830 |
1808 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1831 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
1809 }; | 1832 }; |
1810 | 1833 |
1811 } // namespace dart | 1834 } // namespace dart |
1812 | 1835 |
1813 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1836 #undef DECLARE_COMMON_NODE_FUNCTIONS |
1814 | 1837 |
1815 #endif // VM_AST_H_ | 1838 #endif // VM_AST_H_ |
OLD | NEW |