| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
| 6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast-value-factory.h" | 8 #include "src/ast/ast-value-factory.h" |
| 9 #include "src/ast/modules.h" | 9 #include "src/ast/modules.h" |
| 10 #include "src/ast/variables.h" | 10 #include "src/ast/variables.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 void* operator new(size_t size, Zone* zone) { return zone->New(size); } | 190 void* operator new(size_t size, Zone* zone) { return zone->New(size); } |
| 191 | 191 |
| 192 explicit AstNode(int position): position_(position) {} | 192 explicit AstNode(int position): position_(position) {} |
| 193 virtual ~AstNode() {} | 193 virtual ~AstNode() {} |
| 194 | 194 |
| 195 virtual void Accept(AstVisitor* v) = 0; | 195 virtual void Accept(AstVisitor* v) = 0; |
| 196 virtual NodeType node_type() const = 0; | 196 virtual NodeType node_type() const = 0; |
| 197 int position() const { return position_; } | 197 int position() const { return position_; } |
| 198 | 198 |
| 199 #ifdef DEBUG | 199 #ifdef DEBUG |
| 200 void PrettyPrint(Isolate* isolate); | |
| 201 void Print(Isolate* isolate); | 200 void Print(Isolate* isolate); |
| 202 #endif // DEBUG | 201 #endif // DEBUG |
| 203 | 202 |
| 204 // Type testing & conversion functions overridden by concrete subclasses. | 203 // Type testing & conversion functions overridden by concrete subclasses. |
| 205 #define DECLARE_NODE_FUNCTIONS(type) \ | 204 #define DECLARE_NODE_FUNCTIONS(type) \ |
| 206 V8_INLINE bool Is##type() const; \ | 205 V8_INLINE bool Is##type() const; \ |
| 207 V8_INLINE type* As##type(); \ | 206 V8_INLINE type* As##type(); \ |
| 208 V8_INLINE const type* As##type() const; | 207 V8_INLINE const type* As##type() const; |
| 209 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 208 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 210 #undef DECLARE_NODE_FUNCTIONS | 209 #undef DECLARE_NODE_FUNCTIONS |
| (...skipping 3346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3557 : NULL; \ | 3556 : NULL; \ |
| 3558 } | 3557 } |
| 3559 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3558 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3560 #undef DECLARE_NODE_FUNCTIONS | 3559 #undef DECLARE_NODE_FUNCTIONS |
| 3561 | 3560 |
| 3562 | 3561 |
| 3563 } // namespace internal | 3562 } // namespace internal |
| 3564 } // namespace v8 | 3563 } // namespace v8 |
| 3565 | 3564 |
| 3566 #endif // V8_AST_AST_H_ | 3565 #endif // V8_AST_AST_H_ |
| OLD | NEW |