Package edu.umd.cs.findbugs.ba.bcp
Class PatternElementMatch
java.lang.Object
edu.umd.cs.findbugs.ba.bcp.PatternElementMatch
PatternElementMatch represents matching a PatternElement against a single
instruction. The "prev" field points to the previous PatternElementMatch. By
building up sequences of PatternElementMatch objects in this way, we can
implement nondeterministic matching without having to copy anything.
-
Constructor Summary
ConstructorsConstructorDescriptionPatternElementMatch
(PatternElement patternElement, org.apache.bcel.generic.InstructionHandle matchedInstruction, BasicBlock basicBlock, int matchCount, PatternElementMatch prev) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Return whether or not the most recently matched instruction allows trailing edges.boolean
Get the basic block containing the matched instruction.getFirstLabeledMatch
(String label) Get first match element with given label, if any.org.apache.bcel.generic.InstructionHandle
getLabeledInstruction
(String label) Get the first instruction matched by the PatternElement with given label.getLastLabeledMatch
(String label) Get last match element with given label, if any.int
org.apache.bcel.generic.InstructionHandle
Get the matched instruction.Get the PatternElement.getPrev()
Get the previous PatternMatchElement.int
hashCode()
toString()
-
Constructor Details
-
PatternElementMatch
public PatternElementMatch(PatternElement patternElement, org.apache.bcel.generic.InstructionHandle matchedInstruction, BasicBlock basicBlock, int matchCount, PatternElementMatch prev) Constructor.- Parameters:
patternElement
- the PatternElement being matchedmatchedInstruction
- the instruction which matched the PatternElementbasicBlock
- the basic block containing the matched instructionmatchCount
- the index (starting at zero) of the instructions matching the PatternElement; multiple instructions can match the same PatternElementprev
- the previous PatternElementMatch
-
-
Method Details
-
getPatternElement
Get the PatternElement. -
getMatchedInstructionInstructionHandle
public org.apache.bcel.generic.InstructionHandle getMatchedInstructionInstructionHandle()Get the matched instruction. -
getBasicBlock
Get the basic block containing the matched instruction. -
getMatchCount
public int getMatchCount() -
getPrev
Get the previous PatternMatchElement. -
getLabeledInstruction
Get the first instruction matched by the PatternElement with given label. -
getFirstLabeledMatch
Get first match element with given label, if any. -
getLastLabeledMatch
Get last match element with given label, if any. -
allowTrailingEdges
public boolean allowTrailingEdges()Return whether or not the most recently matched instruction allows trailing edges. -
toString
-
hashCode
public int hashCode() -
equals
-