com.sonar.sslr.api
Interface AstVisitor

All Known Subinterfaces:
AstAndTokenVisitor
All Known Implementing Classes:
CAstCheck, CAstVisitor

public interface AstVisitor


Method Summary
 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(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

leaveFile

void leaveFile(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

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


Copyright © 2011 SonarSource. All Rights Reserved.