| 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/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
| 10 #include "src/ast/modules.h" | 10 #include "src/ast/modules.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); | 200 void PrettyPrint(Isolate* isolate); |
| 201 void PrettyPrint(); | |
| 202 void Print(Isolate* isolate); | 201 void Print(Isolate* isolate); |
| 203 void Print(); | |
| 204 #endif // DEBUG | 202 #endif // DEBUG |
| 205 | 203 |
| 206 // Type testing & conversion functions overridden by concrete subclasses. | 204 // Type testing & conversion functions overridden by concrete subclasses. |
| 207 #define DECLARE_NODE_FUNCTIONS(type) \ | 205 #define DECLARE_NODE_FUNCTIONS(type) \ |
| 208 V8_INLINE bool Is##type() const; \ | 206 V8_INLINE bool Is##type() const; \ |
| 209 V8_INLINE type* As##type(); \ | 207 V8_INLINE type* As##type(); \ |
| 210 V8_INLINE const type* As##type() const; | 208 V8_INLINE const type* As##type() const; |
| 211 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 209 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 212 #undef DECLARE_NODE_FUNCTIONS | 210 #undef DECLARE_NODE_FUNCTIONS |
| 213 | 211 |
| (...skipping 3340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3554 : NULL; \ | 3552 : NULL; \ |
| 3555 } | 3553 } |
| 3556 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3554 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3557 #undef DECLARE_NODE_FUNCTIONS | 3555 #undef DECLARE_NODE_FUNCTIONS |
| 3558 | 3556 |
| 3559 | 3557 |
| 3560 } // namespace internal | 3558 } // namespace internal |
| 3561 } // namespace v8 | 3559 } // namespace v8 |
| 3562 | 3560 |
| 3563 #endif // V8_AST_AST_H_ | 3561 #endif // V8_AST_AST_H_ |
| OLD | NEW |