public abstract class CobolAstVisitor extends Object implements org.sonar.squid.api.CodeVisitor, AstVisitor
| Modifier and Type | Field and Description |
|---|---|
protected CobolGrammar |
grammar |
| Constructor and Description |
|---|
CobolAstVisitor() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSourceCode(org.sonar.squid.api.SourceCode child)
Do not use
|
void |
destroy()
Destroy the visitor.
|
List<AstNodeType> |
getAstNodeTypesToVisit()
This method can't be overridden.
|
Charset |
getCharset() |
protected CicsGrammar |
getCicsGrammar() |
protected CobolGrammar |
getCobolGrammar() |
Comments |
getComments() |
CobolExecutionFlow |
getExecutionFlow() |
File |
getFile() |
protected DB2Grammar |
getSqlGrammar() |
CobolSymbolTable |
getSymbolTable() |
void |
init()
Initialize the visitor.
|
void |
leaveFile(AstNode astNode)
Called once a computation unit tree has been fully visited.
|
void |
leaveNode(AstNode astNode)
Called once an AST node has been fully visited.
|
org.sonar.squid.api.SourceCode |
peekSourceCode()
Do not use
|
void |
popSourceCode()
Do not use
|
void |
processMetrics(org.sonar.squid.indexer.SquidIndex index)
Called after
leaveFile(AstNode), after metrics have been aggregated. |
void |
setCharset(Charset charset) |
void |
setComments(Comments comments)
Do not use
|
void |
setExecutionFlow(CobolExecutionFlow executionFlow) |
void |
setFile(File file) |
void |
setGrammar(CobolGrammar grammar)
Do not use
|
void |
setSourceCodeStack(Deque<org.sonar.squid.api.SourceCode> sourceCodeStack)
Do not use
|
void |
setSymbolTable(CobolSymbolTable symbolTable)
Do not use
|
void |
subscribeTo(AstNodeType... astNodeTypes)
This method must called into the init() method when a Cobol AST visitor wants to subscribe to a set of AST node type.
|
void |
visitFile(AstNode astNode)
Called before starting visiting a computation unit tree.
|
void |
visitNode(AstNode astNode)
Called to process an AST node whose type has been registered to be visited.
|
protected CobolGrammar grammar
public final List<AstNodeType> getAstNodeTypesToVisit()
getAstNodeTypesToVisit in interface AstVisitorpublic final void subscribeTo(AstNodeType... astNodeTypes)
public final void setSourceCodeStack(Deque<org.sonar.squid.api.SourceCode> sourceCodeStack)
public final void setGrammar(CobolGrammar grammar)
public final void setComments(Comments comments)
public final void setSymbolTable(CobolSymbolTable symbolTable)
public final CobolSymbolTable getSymbolTable()
public final Comments getComments()
public final void addSourceCode(org.sonar.squid.api.SourceCode child)
public final void popSourceCode()
public final org.sonar.squid.api.SourceCode peekSourceCode()
public void init()
public void visitFile(@Nullable AstNode astNode)
visitFile in interface AstVisitorastNode - the root of the tree, or null if no treepublic void visitNode(AstNode astNode)
visitNode in interface AstVisitorastNode - the AST node to processpublic void leaveFile(@Nullable AstNode astNode)
leaveFile in interface AstVisitorastNode - the root of the tree, or null if no treepublic void leaveNode(AstNode astNode)
leaveNode in interface AstVisitorastNode - the AST node which has been visitedpublic void processMetrics(org.sonar.squid.indexer.SquidIndex index)
leaveFile(AstNode), after metrics have been aggregated.public void destroy()
public final void setFile(File file)
public final File getFile()
public Charset getCharset()
public void setCharset(Charset charset)
protected final CobolGrammar getCobolGrammar()
protected final DB2Grammar getSqlGrammar()
protected final CicsGrammar getCicsGrammar()
public final void setExecutionFlow(CobolExecutionFlow executionFlow)
public final CobolExecutionFlow getExecutionFlow()
Copyright © 2009–2015 SonarSource. All rights reserved.