OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_TRANSFORMER_H_ | 5 #ifndef VM_AST_TRANSFORMER_H_ |
6 #define VM_AST_TRANSFORMER_H_ | 6 #define VM_AST_TRANSFORMER_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #define DECLARE_VISIT(BaseName) \ | 44 #define DECLARE_VISIT(BaseName) \ |
45 virtual void Visit##BaseName##Node(BaseName##Node* node); | 45 virtual void Visit##BaseName##Node(BaseName##Node* node); |
46 | 46 |
47 FOR_EACH_NODE(DECLARE_VISIT) | 47 FOR_EACH_NODE(DECLARE_VISIT) |
48 #undef DECLARE_VISIT | 48 #undef DECLARE_VISIT |
49 | 49 |
50 AstNode* Transform(AstNode* expr); | 50 AstNode* Transform(AstNode* expr); |
51 | 51 |
52 private: | 52 private: |
53 LocalVariable* EnsureCurrentTempVar(); | 53 LocalVariable* EnsureCurrentTempVar(); |
54 LocalVariable* AddToPreambleNewTempVar(AstNode* node, intptr_t token_pos); | 54 LocalVariable* AddToPreambleNewTempVar(AstNode* node, |
| 55 TokenPosition token_pos); |
55 ArgumentListNode* TransformArguments(ArgumentListNode* node); | 56 ArgumentListNode* TransformArguments(ArgumentListNode* node); |
56 AstNode* LazyTransform(const Token::Kind kind, | 57 AstNode* LazyTransform(const Token::Kind kind, |
57 AstNode* new_left, | 58 AstNode* new_left, |
58 AstNode* right); | 59 AstNode* right); |
59 LocalScope* ChainNewScope(LocalScope* parent); | 60 LocalScope* ChainNewScope(LocalScope* parent); |
60 LocalVariable* GetVariableInScope(LocalScope* scope, const String& symbol); | 61 LocalVariable* GetVariableInScope(LocalScope* scope, const String& symbol); |
61 | 62 |
62 void NextTempVar() { temp_cnt_++; } | 63 void NextTempVar() { temp_cnt_++; } |
63 | 64 |
64 Thread* thread() const { return thread_; } | 65 Thread* thread() const { return thread_; } |
65 | 66 |
66 SequenceNode* preamble_; | 67 SequenceNode* preamble_; |
67 int32_t temp_cnt_; | 68 int32_t temp_cnt_; |
68 AstNode* result_; | 69 AstNode* result_; |
69 LocalScope* async_temp_scope_; | 70 LocalScope* async_temp_scope_; |
70 | 71 |
71 Thread* thread_; | 72 Thread* thread_; |
72 | 73 |
73 DISALLOW_COPY_AND_ASSIGN(AwaitTransformer); | 74 DISALLOW_COPY_AND_ASSIGN(AwaitTransformer); |
74 }; | 75 }; |
75 | 76 |
76 } // namespace dart | 77 } // namespace dart |
77 | 78 |
78 #endif // VM_AST_TRANSFORMER_H_ | 79 #endif // VM_AST_TRANSFORMER_H_ |
OLD | NEW |