#include <slang/ast/ASTVisitor.h>
template<typename TDerived, bool VisitStatements, bool VisitExpressions, bool VisitBad = false>
ASTVisitor class
A base class for AST visitors.
This class provides default visitors that can visit each child of an AST node recursively. Statement and expression trees under each node will only be visited if the corresponding template argument is set to true.
You provide custom logic for specific node types by including a handle(const Type& t) method in your derived class. If you provide such a handler, by default child nodes of that node will not be visited – you can include that behavior by invoking visitDefault in your handler.
Public functions
-
template<typename T>void visit(const T& t)
- The visit() entry point for visiting AST nodes.
-
template<typename T>void visitDefault(const T& t)
- The default visit implementation, which is to descend into child nodes.
Function documentation
template<typename TDerived, bool VisitStatements, bool VisitExpressions, bool VisitBad>
template<typename T>
void slang:: ast:: ASTVisitor<TDerived, VisitStatements, VisitExpressions, VisitBad>:: visitDefault(const T& t)
The default visit implementation, which is to descend into child nodes.
You can invoke this from custom node handlers to get the default behavior.