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 2826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2837 }; | 2837 }; |
2838 | 2838 |
2839 | 2839 |
2840 | 2840 |
2841 // ---------------------------------------------------------------------------- | 2841 // ---------------------------------------------------------------------------- |
2842 // Basic visitor | 2842 // Basic visitor |
2843 // Sub-class should parametrize AstVisitor with itself, e.g.: | 2843 // Sub-class should parametrize AstVisitor with itself, e.g.: |
2844 // class SpecificVisitor : public AstVisitor<SpecificVisitor> { ... } | 2844 // class SpecificVisitor : public AstVisitor<SpecificVisitor> { ... } |
2845 | 2845 |
2846 template <class Subclass> | 2846 template <class Subclass> |
2847 class AstVisitor BASE_EMBEDDED { | 2847 class AstVisitor { |
2848 public: | 2848 public: |
2849 void Visit(AstNode* node) { impl()->Visit(node); } | 2849 void Visit(AstNode* node) { impl()->Visit(node); } |
2850 | 2850 |
2851 void VisitDeclarations(ZoneList<Declaration*>* declarations) { | 2851 void VisitDeclarations(ZoneList<Declaration*>* declarations) { |
2852 for (int i = 0; i < declarations->length(); i++) { | 2852 for (int i = 0; i < declarations->length(); i++) { |
2853 Visit(declarations->at(i)); | 2853 Visit(declarations->at(i)); |
2854 } | 2854 } |
2855 } | 2855 } |
2856 | 2856 |
2857 void VisitStatements(ZoneList<Statement*>* statements) { | 2857 void VisitStatements(ZoneList<Statement*>* statements) { |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3477 : NULL; \ | 3477 : NULL; \ |
3478 } | 3478 } |
3479 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3479 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3480 #undef DECLARE_NODE_FUNCTIONS | 3480 #undef DECLARE_NODE_FUNCTIONS |
3481 | 3481 |
3482 | 3482 |
3483 } // namespace internal | 3483 } // namespace internal |
3484 } // namespace v8 | 3484 } // namespace v8 |
3485 | 3485 |
3486 #endif // V8_AST_AST_H_ | 3486 #endif // V8_AST_AST_H_ |
OLD | NEW |