|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
de.unisaarland.cs.st.jerify.verifier.typestate.ClassCFG
public class ClassCFG
Creates the typestate check data structure ClassCFGData for a class and its subclasses, it does so
by creating a control flow graph data structure for each method MethodCFGData.
The flow data structure consists of FlowNodes, which replicate the flow structure
of the underlying Java code and incorporate alias and typestate tracking. It is created while running the
Visitor on the ClassTree representing the class.
visitClass and scanMethod create the corresponding ClassCFGData respectively MethodCFGData, all other visit*
methods create and link the FlowNodes.
The information created while visiting is stored in the TSInfos MethodCFGWorkData
data structure, this is only the work data for constructing the ClassCFGData/MethodCFGData.
| Constructor Summary | |
|---|---|
ClassCFG(java.lang.String qualifiedPackageName,
checkers.types.AnnotatedTypeFactory factory)
Create a TSMapping which typestate-checks the CompilationUnitTree. |
|
| Method Summary | |
|---|---|
MethodCFGData |
scanMethod(com.sun.source.tree.MethodTree tree,
MethodCFGWorkData tsinfo)
For each method, create the flow data structure relations TSFlowNode
and return it in the MethodCFGData. |
ClassCFGData |
visitAnnotation(com.sun.source.tree.AnnotationTree arg0,
MethodCFGWorkData arg1)
Skip analysis of annotations, so we do not have to case about @annotaion( is="bla") assignments in visitAssingment |
ClassCFGData |
visitAssignment(com.sun.source.tree.AssignmentTree tree,
MethodCFGWorkData tsinfo)
Visit assignments and create FlowNodes that update alias information accordingly |
ClassCFGData |
visitBlock(com.sun.source.tree.BlockTree tree,
MethodCFGWorkData tsinfo)
Create a new work-data aliasAnalysis for each block, so the variables that with scope of a block will be removed after each block |
ClassCFGData |
visitBreak(com.sun.source.tree.BreakTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow changes caused by break |
ClassCFGData |
visitClass(com.sun.source.tree.ClassTree node,
MethodCFGWorkData tsinfo)
Create the ClassCFGData from the node that is passed. |
ClassCFGData |
visitConditionalExpression(com.sun.source.tree.ConditionalExpressionTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow implications for the analysis caused by conditional expressions |
ClassCFGData |
visitContinue(com.sun.source.tree.ContinueTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow changes caused by continue |
ClassCFGData |
visitDoWhileLoop(com.sun.source.tree.DoWhileLoopTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow changes caused by a do-while loop |
ClassCFGData |
visitEnhancedForLoop(com.sun.source.tree.EnhancedForLoopTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow changes caused by a enhanced for loop Actually currently the checker needs a @SetState annotation on the loop variable, the rational being that one can more easily annotate the loop variable but may have a hard time annotating the iterator. |
ClassCFGData |
visitForLoop(com.sun.source.tree.ForLoopTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow changes caused by a for loop |
ClassCFGData |
visitIf(com.sun.source.tree.IfTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow implications for the analysis caused by if statements |
ClassCFGData |
visitLabeledStatement(com.sun.source.tree.LabeledStatementTree tree,
MethodCFGWorkData tsinfo)
Analyse the body of the the label statement with the knowledge about that label. |
ClassCFGData |
visitMethodInvocation(com.sun.source.tree.MethodInvocationTree tree,
MethodCFGWorkData tsinfo)
Analyse method invocations and create FlowNodes that track typestate changes. |
ClassCFGData |
visitNewClass(com.sun.source.tree.NewClassTree node,
MethodCFGWorkData tsinfo)
|
ClassCFGData |
visitReturn(com.sun.source.tree.ReturnTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow implications for the analysis caused by return statements |
ClassCFGData |
visitSwitch(com.sun.source.tree.SwitchTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow implications for the analysis caused by switch statements |
ClassCFGData |
visitThrow(com.sun.source.tree.ThrowTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow implications for the analysis caused by throw statements |
ClassCFGData |
visitTry(com.sun.source.tree.TryTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow implications for the analysis caused by try-catch-finally statements |
ClassCFGData |
visitVariable(com.sun.source.tree.VariableTree tree,
MethodCFGWorkData tsinfo)
Parse variable / fields and create alias information / flownodes accordingly |
ClassCFGData |
visitWhileLoop(com.sun.source.tree.WhileLoopTree tree,
MethodCFGWorkData tsinfo)
Create FlowNodes that handle the control flow changes caused by a while loop |
| Methods inherited from class com.sun.source.util.TreeScanner |
|---|
reduce, scan, scan, visitAnnotatedType, visitArrayAccess, visitArrayType, visitAssert, visitBinary, visitCase, visitCatch, visitCompilationUnit, visitCompoundAssignment, visitEmptyStatement, visitErroneous, visitExpressionStatement, visitIdentifier, visitImport, visitInstanceOf, visitLiteral, visitMemberSelect, visitMethod, visitModifiers, visitNewArray, visitOther, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitSynchronized, visitTypeCast, visitTypeParameter, visitUnary, visitWildcard |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassCFG(java.lang.String qualifiedPackageName,
checkers.types.AnnotatedTypeFactory factory)
CompilationUnitTree.
checker - used to initialize the SourceVisitor (This is the checkers checker so Checker in our case)factory - The AnnotatedTypeFactory of the checkerroot - used to initialize the SourceVisitor (This is the root from which we will descend and create the data structure)| Method Detail |
|---|
public ClassCFGData visitClass(com.sun.source.tree.ClassTree node,
MethodCFGWorkData tsinfo)
ClassCFGData from the node that is passed.
Is called by the visitor, not directly.
visitClass in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitClass in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>node - the tree repesenting the class.tsinfo - the data that all the other visit* methods use to create a control flow graph
public final MethodCFGData scanMethod(com.sun.source.tree.MethodTree tree,
MethodCFGWorkData tsinfo)
TSFlowNode
and return it in the MethodCFGData.
tree - the method to analyse.tsinfo - the working data
public ClassCFGData visitVariable(com.sun.source.tree.VariableTree tree,
MethodCFGWorkData tsinfo)
visitVariable in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitVariable in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public ClassCFGData visitAnnotation(com.sun.source.tree.AnnotationTree arg0,
MethodCFGWorkData arg1)
visitAnnotation in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitAnnotation in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public ClassCFGData visitAssignment(com.sun.source.tree.AssignmentTree tree,
MethodCFGWorkData tsinfo)
visitAssignment in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitAssignment in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitBlock(com.sun.source.tree.BlockTree tree,
MethodCFGWorkData tsinfo)
visitBlock in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitBlock in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitBreak(com.sun.source.tree.BreakTree tree,
MethodCFGWorkData tsinfo)
visitBreak in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitBreak in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitConditionalExpression(com.sun.source.tree.ConditionalExpressionTree tree,
MethodCFGWorkData tsinfo)
visitConditionalExpression in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitConditionalExpression in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitContinue(com.sun.source.tree.ContinueTree tree,
MethodCFGWorkData tsinfo)
visitContinue in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitContinue in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitDoWhileLoop(com.sun.source.tree.DoWhileLoopTree tree,
MethodCFGWorkData tsinfo)
visitDoWhileLoop in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitDoWhileLoop in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitEnhancedForLoop(com.sun.source.tree.EnhancedForLoopTree tree,
MethodCFGWorkData tsinfo)
visitEnhancedForLoop in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitEnhancedForLoop in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitForLoop(com.sun.source.tree.ForLoopTree tree,
MethodCFGWorkData tsinfo)
visitForLoop in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitForLoop in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitIf(com.sun.source.tree.IfTree tree,
MethodCFGWorkData tsinfo)
visitIf in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitIf in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitLabeledStatement(com.sun.source.tree.LabeledStatementTree tree,
MethodCFGWorkData tsinfo)
visitLabeledStatement in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitLabeledStatement in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitMethodInvocation(com.sun.source.tree.MethodInvocationTree tree,
MethodCFGWorkData tsinfo)
visitMethodInvocation in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitMethodInvocation in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public ClassCFGData visitNewClass(com.sun.source.tree.NewClassTree node,
MethodCFGWorkData tsinfo)
visitNewClass in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitNewClass in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitReturn(com.sun.source.tree.ReturnTree tree,
MethodCFGWorkData tsinfo)
visitReturn in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitReturn in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitSwitch(com.sun.source.tree.SwitchTree tree,
MethodCFGWorkData tsinfo)
visitSwitch in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitSwitch in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitThrow(com.sun.source.tree.ThrowTree tree,
MethodCFGWorkData tsinfo)
visitThrow in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitThrow in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitTry(com.sun.source.tree.TryTree tree,
MethodCFGWorkData tsinfo)
visitTry in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitTry in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
public final ClassCFGData visitWhileLoop(com.sun.source.tree.WhileLoopTree tree,
MethodCFGWorkData tsinfo)
visitWhileLoop in interface com.sun.source.tree.TreeVisitor<ClassCFGData,MethodCFGWorkData>visitWhileLoop in class com.sun.source.util.TreeScanner<ClassCFGData,MethodCFGWorkData>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||