| Index: runtime/vm/ast_transformer.h
|
| diff --git a/runtime/vm/ast_transformer.h b/runtime/vm/ast_transformer.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f4e8ce55a74d7d63a4238e72af9c2404e96efe85
|
| --- /dev/null
|
| +++ b/runtime/vm/ast_transformer.h
|
| @@ -0,0 +1,54 @@
|
| +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +#ifndef VM_AST_TRANSFORMER_H_
|
| +#define VM_AST_TRANSFORMER_H_
|
| +
|
| +#include "platform/assert.h"
|
| +#include "vm/ast.h"
|
| +
|
| +namespace dart {
|
| +
|
| +class ParsedFunction;
|
| +
|
| +class AwaitTransformer : public AstNodeVisitor {
|
| + public:
|
| + explicit AwaitTransformer(SequenceNode* preamble,
|
| + const Library& library,
|
| + ParsedFunction* const parsed_function)
|
| + : preamble_(preamble),
|
| + temp_cnt_(0),
|
| + library_(library),
|
| + parsed_function_(parsed_function) {}
|
| +
|
| +#define DECLARE_VISIT(BaseName) \
|
| + virtual void Visit##BaseName##Node(BaseName##Node* node);
|
| +
|
| + FOR_EACH_NODE(DECLARE_VISIT)
|
| +#undef DECLARE_VISIT
|
| +
|
| + void Transform(AstNode* expr);
|
| + AstNode* Result() const { return result_; }
|
| +
|
| + private:
|
| + LocalVariable* EnsureCurrentTempVar();
|
| + void NextTempVar() { temp_cnt_++; }
|
| + LocalVariable* AddToPreambleNewTempVar(AstNode* node);
|
| + ArgumentListNode* TransformArguments(ArgumentListNode* node);
|
| + AstNode* LazyTransform(const Token::Kind kind,
|
| + AstNode* new_left,
|
| + AstNode* right);
|
| +
|
| + SequenceNode* preamble_;
|
| + intptr_t temp_cnt_;
|
| + AstNode* result_;
|
| + const Library& library_;
|
| + ParsedFunction* const parsed_function_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AwaitTransformer);
|
| +};
|
| +
|
| +} // namespace dart
|
| +
|
| +#endif // VM_AST_TRANSFORMER_H_
|
|
|