Package com.strobel.decompiler.ast
Class PatternMatching
- java.lang.Object
-
- com.strobel.decompiler.ast.PatternMatching
-
public final class PatternMatching extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description private
PatternMatching()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
match(Node node, AstCode code)
static boolean
matchAssignment(Node node, StrongBox<Expression> assignedValue)
static boolean
matchAssignment(Node node, StrongBox<Expression> assignedValue, StrongBox<Expression> equivalentLoad)
static boolean
matchAssignmentAndConditionalBreak(BasicBlock block, StrongBox<Expression> assignedValue, StrongBox<Expression> condition, StrongBox<Label> trueLabel, StrongBox<Label> falseLabel, StrongBox<Expression> equivalentLoad)
static boolean
matchBooleanComparison(Node node, StrongBox<Expression> argument, StrongBox<java.lang.Boolean> comparand)
static java.lang.Boolean
matchBooleanConstant(Node node)
static boolean
matchBooleanConstant(Node node, Consumer<? super java.lang.Boolean> value)
static java.lang.Character
matchCharacterConstant(Node node)
static boolean
matchCharacterConstant(Node node, Consumer<? super java.lang.Character> value)
static boolean
matchComparison(Node node, StrongBox<Expression> left, StrongBox<Expression> right)
private static boolean
matchElementAssignment(Node node, StrongBox<Expression> assignedValue, StrongBox<Expression> equivalentLoad)
static boolean
matchEmptyBlockOrLeave(Node node)
static boolean
matchEmptyReturn(Node node)
static java.lang.Boolean
matchFalse(Node node)
static <T> boolean
matchGetArgument(Node node, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
static boolean
matchGetArgument(Node node, AstCode code, StrongBox<Expression> argument)
static <T> boolean
matchGetArguments(Node node, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument1, StrongBox<Expression> argument2)
static <T> boolean
matchGetArguments(Node node, AstCode code, StrongBox<? super T> operand, java.util.List<Expression> arguments)
static boolean
matchGetArguments(Node node, AstCode code, java.util.List<Expression> arguments)
static <T> boolean
matchGetOperand(Node node, AstCode code, Consumer<? super T> operand)
static <T> boolean
matchGetOperand(Node node, AstCode code, java.lang.Class<T> operandType, StrongBox<? super T> operand)
static boolean
matchIntegralConstant(Node node, Consumer<? super java.lang.Long> constant)
static boolean
matchLast(BasicBlock block, AstCode code)
static <T> boolean
matchLast(BasicBlock block, AstCode code, StrongBox<? super T> operand)
static <T> boolean
matchLast(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
static boolean
matchLast(Block block, AstCode code)
static <T> boolean
matchLast(Block block, AstCode code, StrongBox<? super T> operand)
static <T> boolean
matchLast(Block block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
private static <T> boolean
matchLast(java.util.List<Node> body, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
static <T> boolean
matchLastAndBreak(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument, StrongBox<Label> label)
static boolean
matchLeaveHandler(Node node)
static boolean
matchLoad(Node node, Predicate<? super Variable> condition)
static boolean
matchLoad(Node node, StrongBox<? super java.lang.Object> temp, Predicate<? super Variable> condition)
static boolean
matchLoad(Node node, Variable expectedVariable)
static boolean
matchLoad(Node node, Variable expectedVariable, StrongBox<Expression> argument)
static boolean
matchLoad(Node node, Consumer<? super Variable> variable)
static boolean
matchLoadAny(Node node, java.lang.Iterable<Variable> expectedVariables)
static boolean
matchLoadOrRet(Node node, StrongBox<Variable> variable)
static boolean
matchLoadStore(Node node, Variable expectedVariable, StrongBox<Variable> targetVariable)
static boolean
matchLoadStoreAny(Node node, java.lang.Iterable<Variable> expectedVariables, StrongBox<Variable> targetVariable)
static boolean
matchLock(java.util.List<Node> body, int position, Consumer<? super LockInfo> result)
static boolean
matchNullOrEmpty(Block block)
static boolean
matchNumericConstant(Node node, Consumer<? super java.lang.Number> constant)
static boolean
matchNumericLdC(Node node, StrongBox<? super java.lang.Number> value)
static boolean
matchReturnOrThrow(Node node)
static boolean
matchReversibleComparison(Node node)
static boolean
matchSimpleBreak(BasicBlock block, StrongBox<Label> label)
static boolean
matchSimpleBreak(BasicBlock block, Label label)
static boolean
matchSimplifiableComparison(Node node)
static <T> boolean
matchSingle(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
static <T> boolean
matchSingle(Block block, AstCode code, StrongBox<? super T> operand)
static <T> boolean
matchSingle(Block block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
static <T> boolean
matchSingleAndBreak(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument, StrongBox<Label> label)
static boolean
matchStore(Node node, StrongBox<Variable> variable, StrongBox<Expression> argument)
static boolean
matchStore(Node node, StrongBox<Variable> variable, java.util.List<Expression> argument)
static boolean
matchStore(Node node, Variable expectedVariable)
static boolean
matchStore(Node node, Variable expectedVariable, StrongBox<Expression> value)
static boolean
matchThis(Node node)
static java.lang.Boolean
matchTrue(Node node)
static boolean
matchUnconditionalBranch(Node node)
static boolean
matchUnlock(Node e, LockInfo lockInfo)
static boolean
matchVariableIncDec(Node node, StrongBox<Variable> variable)
static boolean
matchVariableIncDec(Node node, StrongBox<Variable> variable, StrongBox<java.lang.Number> amount)
static boolean
matchVariableMutation(Node node, Variable variable)
-
-
-
Method Detail
-
matchLeaveHandler
public static boolean matchLeaveHandler(Node node)
-
matchGetOperand
public static <T> boolean matchGetOperand(Node node, AstCode code, Consumer<? super T> operand)
-
matchGetOperand
public static <T> boolean matchGetOperand(Node node, AstCode code, java.lang.Class<T> operandType, StrongBox<? super T> operand)
-
matchGetArguments
public static boolean matchGetArguments(Node node, AstCode code, java.util.List<Expression> arguments)
-
matchGetArguments
public static <T> boolean matchGetArguments(Node node, AstCode code, StrongBox<? super T> operand, java.util.List<Expression> arguments)
-
matchGetArgument
public static boolean matchGetArgument(Node node, AstCode code, StrongBox<Expression> argument)
-
matchGetArgument
public static <T> boolean matchGetArgument(Node node, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
-
matchGetArguments
public static <T> boolean matchGetArguments(Node node, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument1, StrongBox<Expression> argument2)
-
matchSingle
public static <T> boolean matchSingle(Block block, AstCode code, StrongBox<? super T> operand)
-
matchSingle
public static <T> boolean matchSingle(Block block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
-
matchNullOrEmpty
public static boolean matchNullOrEmpty(Block block)
-
matchEmptyReturn
public static boolean matchEmptyReturn(Node node)
-
matchEmptyBlockOrLeave
public static boolean matchEmptyBlockOrLeave(Node node)
-
matchSingle
public static <T> boolean matchSingle(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
-
matchSingleAndBreak
public static <T> boolean matchSingleAndBreak(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument, StrongBox<Label> label)
-
matchSimpleBreak
public static boolean matchSimpleBreak(BasicBlock block, StrongBox<Label> label)
-
matchSimpleBreak
public static boolean matchSimpleBreak(BasicBlock block, Label label)
-
matchAssignmentAndConditionalBreak
public static boolean matchAssignmentAndConditionalBreak(BasicBlock block, StrongBox<Expression> assignedValue, StrongBox<Expression> condition, StrongBox<Label> trueLabel, StrongBox<Label> falseLabel, StrongBox<Expression> equivalentLoad)
-
matchAssignment
public static boolean matchAssignment(Node node, StrongBox<Expression> assignedValue)
-
matchAssignment
public static boolean matchAssignment(Node node, StrongBox<Expression> assignedValue, StrongBox<Expression> equivalentLoad)
-
matchElementAssignment
private static boolean matchElementAssignment(Node node, StrongBox<Expression> assignedValue, StrongBox<Expression> equivalentLoad)
-
matchLast
public static boolean matchLast(BasicBlock block, AstCode code)
-
matchLast
public static <T> boolean matchLast(BasicBlock block, AstCode code, StrongBox<? super T> operand)
-
matchLast
public static <T> boolean matchLast(Block block, AstCode code, StrongBox<? super T> operand)
-
matchLast
public static <T> boolean matchLast(Block block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
-
matchLast
public static <T> boolean matchLast(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
-
matchLast
private static <T> boolean matchLast(java.util.List<Node> body, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)
-
matchLastAndBreak
public static <T> boolean matchLastAndBreak(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument, StrongBox<Label> label)
-
matchThis
public static boolean matchThis(Node node)
-
matchLoadAny
public static boolean matchLoadAny(Node node, java.lang.Iterable<Variable> expectedVariables)
-
matchNumericLdC
public static boolean matchNumericLdC(Node node, StrongBox<? super java.lang.Number> value)
-
matchVariableIncDec
public static boolean matchVariableIncDec(Node node, StrongBox<Variable> variable)
-
matchVariableIncDec
public static boolean matchVariableIncDec(Node node, StrongBox<Variable> variable, StrongBox<java.lang.Number> amount)
-
matchStore
public static boolean matchStore(Node node, StrongBox<Variable> variable, StrongBox<Expression> argument)
-
matchStore
public static boolean matchStore(Node node, StrongBox<Variable> variable, java.util.List<Expression> argument)
-
matchStore
public static boolean matchStore(Node node, Variable expectedVariable, StrongBox<Expression> value)
-
matchLoad
public static boolean matchLoad(Node node, Variable expectedVariable, StrongBox<Expression> argument)
-
matchLoadStore
public static boolean matchLoadStore(Node node, Variable expectedVariable, StrongBox<Variable> targetVariable)
-
matchLoadStoreAny
public static boolean matchLoadStoreAny(Node node, java.lang.Iterable<Variable> expectedVariables, StrongBox<Variable> targetVariable)
-
matchBooleanComparison
public static boolean matchBooleanComparison(Node node, StrongBox<Expression> argument, StrongBox<java.lang.Boolean> comparand)
-
matchComparison
public static boolean matchComparison(Node node, StrongBox<Expression> left, StrongBox<Expression> right)
-
matchSimplifiableComparison
public static boolean matchSimplifiableComparison(Node node)
-
matchReversibleComparison
public static boolean matchReversibleComparison(Node node)
-
matchReturnOrThrow
public static boolean matchReturnOrThrow(Node node)
-
matchTrue
public static java.lang.Boolean matchTrue(Node node)
-
matchFalse
public static java.lang.Boolean matchFalse(Node node)
-
matchIntegralConstant
public static boolean matchIntegralConstant(Node node, Consumer<? super java.lang.Long> constant)
-
matchNumericConstant
public static boolean matchNumericConstant(Node node, Consumer<? super java.lang.Number> constant)
-
matchLoad
public static boolean matchLoad(Node node, StrongBox<? super java.lang.Object> temp, Predicate<? super Variable> condition)
-
matchBooleanConstant
public static java.lang.Boolean matchBooleanConstant(Node node)
-
matchCharacterConstant
public static java.lang.Character matchCharacterConstant(Node node)
-
matchBooleanConstant
public static boolean matchBooleanConstant(Node node, Consumer<? super java.lang.Boolean> value)
-
matchCharacterConstant
public static boolean matchCharacterConstant(Node node, Consumer<? super java.lang.Character> value)
-
matchUnconditionalBranch
public static boolean matchUnconditionalBranch(Node node)
-
matchLock
public static boolean matchLock(java.util.List<Node> body, int position, Consumer<? super LockInfo> result)
-
-