Package edu.umd.cs.findbugs.ba.bcp
Class ByteCodePattern
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.bcp.ByteCodePattern
-
public class ByteCodePattern extends java.lang.Object
A ByteCodePattern is a pattern matching a sequence of bytecode instructions.- See Also:
PatternElement
,PatternMatcher
-
-
Field Summary
Fields Modifier and Type Field Description private int
dummyVariableCount
private PatternElement
first
private int
interElementWild
private PatternElement
last
private int
numElements
-
Constructor Summary
Constructors Constructor Description ByteCodePattern()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteCodePattern
add(PatternElement element)
Add a PatternElement to the end of the pattern.private void
addElement(PatternElement element)
private void
addInterElementWild()
ByteCodePattern
addWild(int numWild)
Add a wildcard to match between 0 and given number of instructions.java.lang.String
dummyVariable()
Get a dummy variable name.PatternElement
getFirst()
Get the first PatternElement in the pattern.private Wild
isLastWild()
ByteCodePattern
setInterElementWild(int numWild)
Set number of inter-element wildcards to create between explicit PatternElements.
-
-
-
Field Detail
-
first
private PatternElement first
-
last
private PatternElement last
-
interElementWild
private int interElementWild
-
numElements
private int numElements
-
dummyVariableCount
private int dummyVariableCount
-
-
Method Detail
-
add
public ByteCodePattern add(PatternElement element)
Add a PatternElement to the end of the pattern.- Parameters:
element
- the PatternElement- Returns:
- this object
-
addWild
public ByteCodePattern addWild(int numWild)
Add a wildcard to match between 0 and given number of instructions. If there is already a wildcard at the end of the current pattern, resets its max value to that given.- Parameters:
numWild
- maximum number of instructions to be matched by the wildcard
-
setInterElementWild
public ByteCodePattern setInterElementWild(int numWild)
Set number of inter-element wildcards to create between explicit PatternElements. By default, no implicit wildcards are created.- Parameters:
numWild
- the number of wildcard instructions which may be matched between explicit PatternElements- Returns:
- this object
-
getFirst
public PatternElement getFirst()
Get the first PatternElement in the pattern.
-
dummyVariable
public java.lang.String dummyVariable()
Get a dummy variable name. The name returned will begin with the'$'
character, and will be different than any previous dummy variable name allocated by this object. Dummy variable names are useful for creating PatternElements where you don't care whether the value it uses is the same as one used by another PatternElement.
-
addInterElementWild
private void addInterElementWild()
-
addElement
private void addElement(PatternElement element)
-
isLastWild
private Wild isLastWild()
-
-