Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1248)

Unified Diff: src/ast/ast.h

Issue 1963243003: [compiler] Add a traversing AST visitor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove accidental build file Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index c4d6a6ae8bab94c8722727f82b8a2c3bc6973f34..bee0bab47e5640cbcf43c89e3739993d8fdfac73 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -3047,6 +3047,30 @@ class AstVisitor BASE_EMBEDDED {
// ----------------------------------------------------------------------------
+// Traversing visitor
+// - fully traverses the entire AST.
+
+class AstTraversalVisitor : public AstVisitor {
+ public:
+ explicit AstTraversalVisitor(Isolate* isolate);
+ virtual ~AstTraversalVisitor() {}
+
+ // Iteration left-to-right.
+ void VisitDeclarations(ZoneList<Declaration*>* declarations) override;
+ void VisitStatements(ZoneList<Statement*>* statements) override;
+ void VisitExpressions(ZoneList<Expression*>* expressions) override;
+
+// Individual nodes
+#define DECLARE_VISIT(type) void Visit##type(type* node) override;
+ AST_NODE_LIST(DECLARE_VISIT)
+#undef DECLARE_VISIT
+
+ private:
+ DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
+ DISALLOW_COPY_AND_ASSIGN(AstTraversalVisitor);
+};
+
+// ----------------------------------------------------------------------------
// AstNode factory
class AstNodeFactory final BASE_EMBEDDED {
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698