Package com.sonar.sslr.api
Interface AstVisitor
-
- All Known Subinterfaces:
AstAndTokenVisitor
- All Known Implementing Classes:
CobolAstVisitor
,CobolCheck
public interface AstVisitor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<AstNodeType>
getAstNodeTypesToVisit()
The AST node types that this check must be registered for.void
leaveFile(AstNode ast)
Called once a computation unit tree has been fully visited.void
leaveNode(AstNode ast)
Called once an AST node has been fully visited.void
visitFile(AstNode ast)
Called before starting visiting a computation unit tree.void
visitNode(AstNode ast)
Called to process an AST node whose type has been registered to be visited.
-
-
-
Method Detail
-
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
void visitFile(@Nullable AstNode ast)
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, ornull
if no tree
-
leaveFile
void leaveFile(@Nullable AstNode ast)
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, ornull
if no tree
-
visitNode
void visitNode(AstNode ast)
Called to process an AST node whose type has been registered to be visited.- Parameters:
ast
- the AST node to process
-
leaveNode
void leaveNode(AstNode ast)
Called once an AST node has been fully visited.- Parameters:
ast
- the AST node which has been visited
-
-