| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 virtual bool Is##type() const { return true; } \ | 91 virtual bool Is##type() const { return true; } \ |
| 92 virtual type* As##type() { return this; } | 92 virtual type* As##type() { return this; } |
| 93 | 93 |
| 94 | 94 |
| 95 class AstNode : public ZoneAllocated { | 95 class AstNode : public ZoneAllocated { |
| 96 public: | 96 public: |
| 97 explicit AstNode(intptr_t token_pos) | 97 explicit AstNode(intptr_t token_pos) |
| 98 : token_pos_(token_pos) { | 98 : token_pos_(token_pos) { |
| 99 ASSERT(token_pos_ >= 0); | 99 ASSERT(token_pos_ >= 0); |
| 100 } | 100 } |
| 101 virtual ~AstNode() { } |
| 101 | 102 |
| 102 intptr_t token_pos() const { return token_pos_; } | 103 intptr_t token_pos() const { return token_pos_; } |
| 103 | 104 |
| 104 #define AST_TYPE_CHECK(BaseName) \ | 105 #define AST_TYPE_CHECK(BaseName) \ |
| 105 virtual bool Is##BaseName##Node() const { return false; } \ | 106 virtual bool Is##BaseName##Node() const { return false; } \ |
| 106 virtual BaseName##Node* As##BaseName##Node() { return NULL; } | 107 virtual BaseName##Node* As##BaseName##Node() { return NULL; } |
| 107 | 108 |
| 108 FOR_EACH_NODE(AST_TYPE_CHECK) | 109 FOR_EACH_NODE(AST_TYPE_CHECK) |
| 109 #undef AST_TYPE_CHECK | 110 #undef AST_TYPE_CHECK |
| 110 | 111 |
| (...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1802 const intptr_t try_index_; | 1803 const intptr_t try_index_; |
| 1803 | 1804 |
| 1804 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1805 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
| 1805 }; | 1806 }; |
| 1806 | 1807 |
| 1807 } // namespace dart | 1808 } // namespace dart |
| 1808 | 1809 |
| 1809 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1810 #undef DECLARE_COMMON_NODE_FUNCTIONS |
| 1810 | 1811 |
| 1811 #endif // VM_AST_H_ | 1812 #endif // VM_AST_H_ |
| OLD | NEW |