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), expr_(expr) { } |
| 154 |
| 155 void VisitChildren(AstNodeVisitor* visitor) const { |
| 156 expr_->Visit(visitor); |
| 157 } |
| 158 |
| 159 AstNode* expr() const { return expr_; } |
| 160 |
| 161 DECLARE_COMMON_NODE_FUNCTIONS(AwaitNode); |
| 162 |
| 163 private: |
| 164 AstNode* expr_; |
| 165 |
| 166 DISALLOW_COPY_AND_ASSIGN(AwaitNode); |
| 167 }; |
| 168 |
| 169 |
149 class SequenceNode : public AstNode { | 170 class SequenceNode : public AstNode { |
150 public: | 171 public: |
151 SequenceNode(intptr_t token_pos, LocalScope* scope) | 172 SequenceNode(intptr_t token_pos, LocalScope* scope) |
152 : AstNode(token_pos), | 173 : AstNode(token_pos), |
153 scope_(scope), | 174 scope_(scope), |
154 nodes_(4), | 175 nodes_(4), |
155 label_(NULL) { | 176 label_(NULL) { |
156 } | 177 } |
157 | 178 |
158 LocalScope* scope() const { return scope_; } | 179 LocalScope* scope() const { return scope_; } |
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 const intptr_t try_index_; | 1827 const intptr_t try_index_; |
1807 | 1828 |
1808 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1829 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
1809 }; | 1830 }; |
1810 | 1831 |
1811 } // namespace dart | 1832 } // namespace dart |
1812 | 1833 |
1813 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1834 #undef DECLARE_COMMON_NODE_FUNCTIONS |
1814 | 1835 |
1815 #endif // VM_AST_H_ | 1836 #endif // VM_AST_H_ |
OLD | NEW |