edu.umd.cs.findbugs.ba.bcp

Class PatternElementMatch

public class PatternElementMatch extends Object

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
PatternElementMatch(PatternElement patternElement, InstructionHandle matchedInstruction, BasicBlock basicBlock, int matchCount, PatternElementMatch prev)
Constructor.
Method Summary
booleanallowTrailingEdges()
Return whether or not the most recently matched instruction allows trailing edges.
BasicBlockgetBasicBlock()
Get the basic block containing the matched instruction.
PatternElementMatchgetFirstLabeledMatch(String label)
Get first match element with given label, if any.
InstructionHandlegetLabeledInstruction(String label)
Get the first instruction matched by the PatternElement with given label.
PatternElementMatchgetLastLabeledMatch(String label)
Get last match element with given label, if any.
intgetMatchCount()
InstructionHandlegetMatchedInstructionInstructionHandle()
Get the matched instruction.
PatternElementgetPatternElement()
Get the PatternElement.
PatternElementMatchgetPrev()
Get the previous PatternMatchElement.

Constructor Detail

PatternElementMatch

public PatternElementMatch(PatternElement patternElement, InstructionHandle matchedInstruction, BasicBlock basicBlock, int matchCount, PatternElementMatch prev)
Constructor.

Parameters: patternElement the PatternElement being matched matchedInstruction the instruction which matched the PatternElement basicBlock the basic block containing the matched instruction matchCount the index (starting at zero) of the instructions matching the PatternElement; multiple instructions can match the same PatternElement prev the previous PatternElementMatch

Method Detail

allowTrailingEdges

public boolean allowTrailingEdges()
Return whether or not the most recently matched instruction allows trailing edges.

getBasicBlock

public BasicBlock getBasicBlock()
Get the basic block containing the matched instruction.

getFirstLabeledMatch

public PatternElementMatch getFirstLabeledMatch(String label)
Get first match element with given label, if any.

getLabeledInstruction

public InstructionHandle getLabeledInstruction(String label)
Get the first instruction matched by the PatternElement with given label.

getLastLabeledMatch

public PatternElementMatch getLastLabeledMatch(String label)
Get last match element with given label, if any.

getMatchCount

public int getMatchCount()

getMatchedInstructionInstructionHandle

public InstructionHandle getMatchedInstructionInstructionHandle()
Get the matched instruction.

getPatternElement

public PatternElement getPatternElement()
Get the PatternElement.

getPrev

public PatternElementMatch getPrev()
Get the previous PatternMatchElement.
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.