Package com.sonar.sslr.api
Interface AstVisitor
- All Known Subinterfaces:
AstAndTokenVisitor
- All Known Implementing Classes:
CobolAstVisitor,CobolCheck
public interface AstVisitor
-
Method Summary
Modifier and TypeMethodDescriptionThe AST node types that this check must be registered for.voidCalled once a computation unit tree has been fully visited.voidCalled once an AST node has been fully visited.voidCalled before starting visiting a computation unit tree.voidCalled to process an AST node whose type has been registered to be visited.
-
Method Details
-
getAstNodeTypesToVisit
List<AstNodeType> getAstNodeTypesToVisit()The AST node types that this check must be registered for.- Returns:
- the AST node types this must be registered for.
-
visitFile
Called before starting visiting a computation unit tree. Ideal place to initialize information that is to be collected while processing the tree.- Parameters:
ast- the root of the tree, ornullif no tree
-
leaveFile
Called once a computation unit tree has been fully visited. Ideal place to report on information collected while processing a tree.- Parameters:
ast- the root of the tree, ornullif no tree
-
visitNode
Called to process an AST node whose type has been registered to be visited.- Parameters:
ast- the AST node to process
-
leaveNode
Called once an AST node has been fully visited.- Parameters:
ast- the AST node which has been visited
-