| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/assert.h" | 9 #include "vm/assert.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 #define DECLARE_COMMON_NODE_FUNCTIONS(type) \ | 90 #define DECLARE_COMMON_NODE_FUNCTIONS(type) \ |
| 91 virtual void Visit(AstNodeVisitor* visitor); \ | 91 virtual void Visit(AstNodeVisitor* visitor); \ |
| 92 virtual const char* ShortName() const; \ | 92 virtual const char* ShortName() const; \ |
| 93 virtual bool Is##type() const { return true; } \ | 93 virtual bool Is##type() const { return true; } \ |
| 94 virtual type* As##type() { return this; } | 94 virtual type* As##type() { return this; } |
| 95 | 95 |
| 96 | 96 |
| 97 class AstNode : public ZoneAllocated { | 97 class AstNode : public ZoneAllocated { |
| 98 public: | 98 public: |
| 99 static const int kInvalidId = -1; | 99 static const int kNoId = -1; |
| 100 | 100 |
| 101 explicit AstNode(intptr_t token_index) | 101 explicit AstNode(intptr_t token_index) |
| 102 : token_index_(token_index), | 102 : token_index_(token_index), |
| 103 id_(GetNextId()), | 103 id_(GetNextId()), |
| 104 ic_data_(Array::ZoneHandle()), | 104 ic_data_(Array::ZoneHandle()), |
| 105 info_(NULL) { | 105 info_(NULL) { |
| 106 ASSERT(token_index >= 0); | 106 ASSERT(token_index >= 0); |
| 107 } | 107 } |
| 108 | 108 |
| 109 intptr_t token_index() const { return token_index_; } | 109 intptr_t token_index() const { return token_index_; } |
| (...skipping 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1866 const LocalVariable& context_var_; | 1866 const LocalVariable& context_var_; |
| 1867 | 1867 |
| 1868 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1868 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
| 1869 }; | 1869 }; |
| 1870 | 1870 |
| 1871 } // namespace dart | 1871 } // namespace dart |
| 1872 | 1872 |
| 1873 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1873 #undef DECLARE_COMMON_NODE_FUNCTIONS |
| 1874 | 1874 |
| 1875 #endif // VM_AST_H_ | 1875 #endif // VM_AST_H_ |
| OLD | NEW |