Expand description
This module defines the AstVisitor trait and its associated macros.
The AstVisitor trait provides a set of methods for traversing and visiting ASTs
Traits§
- AstVisitor
- The
AstVisitortrait provides a set of methods for visiting different types of AST nodes. Implementors can individually override the methods they are interested in. When overriding a method, make sure to callwalkon the visited statement to visit its children. DO NOT call walk on the node itself to avoid a recursion (last parameter). Implementors may also decide to not call the statement’swalkmethod to avoid visiting the children of the statement. - Walker
- The
Walkerimplements the traversal of the AST nodes and Ast-related objects (e.g. CompilationUnit). Thewalkmethod is called on the object to visit its children. If the object passed to aAstVisitor’svisitmethod implements theWalkertrait, a call to the it’s walk function continues the visiting process on its children.