public class CLikeVariableUseExtractor extends java.lang.Object
Constructor and Description |
---|
CLikeVariableUseExtractor(java.util.EnumSet<ETokenType> accessOperators,
java.util.EnumSet<ETokenType> noVariableSuccessorTypes)
Constructor.
|
CLikeVariableUseExtractor(ETokenType accessOperator,
java.util.EnumSet<ETokenType> noVariableSuccessorTypes)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Integer> |
extractFilteredVariableUses(java.util.List<IToken> tokens,
java.lang.String variableName,
boolean isField,
boolean isShadowed,
IVariableUseFilter filter)
Extracts all uses of the given variable name from the given tokens.
|
java.util.List<java.lang.Integer> |
extractVariableReads(java.util.List<IToken> tokens,
java.lang.String variableName,
boolean isField,
boolean isShadowed)
Extracts all uses of the given variable name from the given tokens that read
its value.
|
java.util.List<java.lang.Integer> |
extractVariableUses(java.util.List<IToken> tokens,
java.lang.String variableName,
boolean isField,
boolean isShadowed)
Extracts all uses of the given variable name from the given tokens.
|
java.util.List<java.lang.Integer> |
extractVariableWrites(java.util.List<IToken> tokens,
java.lang.String variableName,
boolean isField,
boolean isShadowed)
Extracts all uses of the given variable name from the given tokens that
change its value.
|
java.util.List<java.lang.Integer> |
filterUses(java.util.List<IToken> tokens,
java.util.List<java.lang.Integer> useIndices,
boolean isField,
boolean isShadowed,
IVariableUseFilter filter)
Filters then given variable uses based on whether they are fields, shadowed
and the given custom filter.
|
public CLikeVariableUseExtractor(ETokenType accessOperator, java.util.EnumSet<ETokenType> noVariableSuccessorTypes)
public CLikeVariableUseExtractor(java.util.EnumSet<ETokenType> accessOperators, java.util.EnumSet<ETokenType> noVariableSuccessorTypes)
public java.util.List<java.lang.Integer> extractVariableUses(java.util.List<IToken> tokens, java.lang.String variableName, boolean isField, boolean isShadowed)
isField
- whether the given variable name is a field of a typeisShadowed
- whether the given variable name is shadowed by another variable
with the same namepublic java.util.List<java.lang.Integer> extractVariableReads(java.util.List<IToken> tokens, java.lang.String variableName, boolean isField, boolean isShadowed)
isField
- whether the given variable name is a field of a typeisShadowed
- whether the given variable name is shadowed by another variable
with the same namepublic java.util.List<java.lang.Integer> extractVariableWrites(java.util.List<IToken> tokens, java.lang.String variableName, boolean isField, boolean isShadowed)
isField
- whether the given variable name is a field of a typeisShadowed
- whether the given variable name is shadowed by another variable
with the same namepublic java.util.List<java.lang.Integer> extractFilteredVariableUses(java.util.List<IToken> tokens, java.lang.String variableName, boolean isField, boolean isShadowed, IVariableUseFilter filter)
isField
- whether the given variable name is a field of a typeisShadowed
- whether the given variable name is shadowed by another variable
with the same namepublic java.util.List<java.lang.Integer> filterUses(java.util.List<IToken> tokens, java.util.List<java.lang.Integer> useIndices, boolean isField, boolean isShadowed, IVariableUseFilter filter)