public class UndeclaredProgramVariableCollector extends ProgramVariableCollector
This class is a specialization of ProgramVariableCollector
which
returns as result (result()
) used LocationVariable
which
are undeclared, but used in the given ProgramElement.
Declared {@link LocationVariable}s are:
Modifier and Type | Field and Description |
---|---|
private java.util.LinkedHashSet<LocationVariable> |
allVariables
Contains the super result.
|
private java.util.LinkedHashSet<IProgramVariable> |
declaredVariables
Contains the found declared
IProgramVariable s. |
private java.util.LinkedHashSet<LocationVariable> |
undeclaredVariables
Contains the undeclared variables as result.
|
services
Constructor and Description |
---|
UndeclaredProgramVariableCollector(ProgramElement root,
Services services)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
collectHeapVariables() |
java.util.LinkedHashSet<LocationVariable> |
getAllVariables()
Returns all used variables.
|
java.util.Set<IProgramVariable> |
getDeclaredVariables()
Returns the found declared variables.
|
void |
performActionOnExecutionContext(ExecutionContext x) |
void |
performActionOnLocalVariableDeclaration(LocalVariableDeclaration x) |
void |
performActionOnMethodFrame(MethodFrame x) |
java.util.LinkedHashSet<LocationVariable> |
result()
Returns the undeclared variables as result.
|
doDefaultAction, performActionOnBlockContract, performActionOnLocationVariable, performActionOnLoopContract, performActionOnLoopInvariant, performActionOnMergeContract, start, toString
doAction, performActionOnAbstractProgramElement, performActionOnAllFields, performActionOnAllObjects, performActionOnArrayDeclaration, performActionOnArrayInitializer, performActionOnArrayLengthReference, performActionOnArrayReference, performActionOnAssert, performActionOnBinaryAnd, performActionOnBinaryAndAssignment, performActionOnBinaryNot, performActionOnBinaryOr, performActionOnBinaryOrAssignment, performActionOnBinaryXOr, performActionOnBinaryXOrAssignment, performActionOnBlockContract, performActionOnBooleanLiteral, performActionOnBreak, performActionOnCase, performActionOnCatch, performActionOnCatchAllStatement, performActionOnCharLiteral, performActionOnClassDeclaration, performActionOnClassInitializer, performActionOnComment, performActionOnCompilationUnit, performActionOnConditional, performActionOnConstructorDeclaration, performActionOnContextStatementBlock, performActionOnContinue, performActionOnCopyAssignment, performActionOnDefault, performActionOnDivide, performActionOnDivideAssignment, performActionOnDLEmbeddedExpression, performActionOnDo, performActionOnDoubleLiteral, performActionOnElse, performActionOnEmptyMapLiteral, performActionOnEmptySeqLiteral, performActionOnEmptySetLiteral, performActionOnEmptyStatement, performActionOnEnhancedFor, performActionOnEquals, performActionOnExactInstanceof, performActionOnExtends, performActionOnFieldDeclaration, performActionOnFieldReference, performActionOnFieldSpecification, performActionOnFinally, performActionOnFloatLiteral, performActionOnFor, performActionOnForUpdates, performActionOnGreaterOrEquals, performActionOnGreaterThan, performActionOnGuard, performActionOnIf, performActionOnImplements, performActionOnImplicitFieldSpecification, performActionOnImport, performActionOnInstanceof, performActionOnInterfaceDeclaration, performActionOnIntersect, performActionOnIntLiteral, performActionOnIProgramVariable, performActionOnLabeledStatement, performActionOnLessOrEquals, performActionOnLessThan, performActionOnLogicalAnd, performActionOnLogicalNot, performActionOnLogicalOr, performActionOnLongLiteral, performActionOnLoopContract, performActionOnLoopContract, performActionOnLoopInit, performActionOnLoopScopeBlock, performActionOnMergePointStatement, performActionOnMetaClassReference, performActionOnMethod, performActionOnMethodBodyStatement, performActionOnMethodDeclaration, performActionOnMethodReference, performActionOnMinus, performActionOnMinusAssignment, performActionOnModifier, performActionOnModulo, performActionOnModuloAssignment, performActionOnNegative, performActionOnNew, performActionOnNewArray, performActionOnNotEquals, performActionOnNullLiteral, performActionOnPackageReference, performActionOnPackageSpecification, performActionOnParameterDeclaration, performActionOnParenthesizedExpression, performActionOnPassiveExpression, performActionOnPlus, performActionOnPlusAssignment, performActionOnPositive, performActionOnPostDecrement, performActionOnPostIncrement, performActionOnPreDecrement, performActionOnPreIncrement, performActionOnProgramConstant, performActionOnProgramElementName, performActionOnProgramMetaConstruct, performActionOnProgramMethod, performActionOnProgramVariable, performActionOnReturn, performActionOnSchematicFieldReference, performActionOnSchemaVariable, performActionOnSeqConcat, performActionOnSeqGet, performActionOnSeqIndexOf, performActionOnSeqLength, performActionOnSeqReverse, performActionOnSeqSingleton, performActionOnSeqSub, performActionOnSetMinus, performActionOnSetUnion, performActionOnShiftLeft, performActionOnShiftLeftAssignment, performActionOnShiftRight, performActionOnShiftRightAssignment, performActionOnSingleton, performActionOnStatementBlock, performActionOnStringLiteral, performActionOnSuperArrayDeclaration, performActionOnSuperConstructorReference, performActionOnSuperReference, performActionOnSwitch, performActionOnSynchronizedBlock, performActionOnThen, performActionOnThisConstructorReference, performActionOnThisReference, performActionOnThrow, performActionOnThrows, performActionOnTimes, performActionOnTimesAssignment, performActionOnTransactionStatement, performActionOnTry, performActionOnTypeCast, performActionOnTypeReference, performActionOnUnsignedShiftRight, performActionOnUnsignedShiftRightAssignment, performActionOnVariableDeclaration, performActionOnVariableReference, performActionOnVariableSpecification, performActionOnWhile, walk
depth, root
private java.util.LinkedHashSet<IProgramVariable> declaredVariables
IProgramVariable
s.private java.util.LinkedHashSet<LocationVariable> allVariables
private java.util.LinkedHashSet<LocationVariable> undeclaredVariables
public UndeclaredProgramVariableCollector(ProgramElement root, Services services)
root
- The ProgramElement
to collect undeclared variables in.services
- The Services
to use.protected void collectHeapVariables()
collectHeapVariables
in class ProgramVariableCollector
public void performActionOnLocalVariableDeclaration(LocalVariableDeclaration x)
performActionOnLocalVariableDeclaration
in interface Visitor
performActionOnLocalVariableDeclaration
in class JavaASTVisitor
public void performActionOnMethodFrame(MethodFrame x)
performActionOnMethodFrame
in interface Visitor
performActionOnMethodFrame
in class JavaASTVisitor
public void performActionOnExecutionContext(ExecutionContext x)
performActionOnExecutionContext
in interface Visitor
performActionOnExecutionContext
in class JavaASTVisitor
public java.util.Set<IProgramVariable> getDeclaredVariables()
public java.util.LinkedHashSet<LocationVariable> getAllVariables()
public java.util.LinkedHashSet<LocationVariable> result()
result
in class ProgramVariableCollector