Package com.strobel.decompiler.ast
Class PatternMatching
java.lang.Object
com.strobel.decompiler.ast.PatternMatching
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
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<Boolean> comparand) static Boolean
matchBooleanConstant
(Node node) static boolean
matchBooleanConstant
(Node node, Consumer<? super Boolean> value) static Character
matchCharacterConstant
(Node node) static boolean
matchCharacterConstant
(Node node, Consumer<? super 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 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, List<Expression> arguments) static boolean
matchGetArguments
(Node node, AstCode code, List<Expression> arguments) static <T> boolean
matchGetOperand
(Node node, AstCode code, Consumer<? super T> operand) static <T> boolean
matchGetOperand
(Node node, AstCode code, Class<T> operandType, StrongBox<? super T> operand) static boolean
matchIntegralConstant
(Node node, Consumer<? super 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
static <T> boolean
static <T> boolean
private static <T> boolean
matchLast
(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
static boolean
static boolean
static boolean
matchLoad
(Node node, Variable expectedVariable, StrongBox<Expression> argument) static boolean
static boolean
matchLoadAny
(Node node, 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, Iterable<Variable> expectedVariables, StrongBox<Variable> targetVariable) static boolean
static boolean
matchNullOrEmpty
(Block block) static boolean
matchNumericConstant
(Node node, Consumer<? super Number> constant) static boolean
matchNumericLdC
(Node node, StrongBox<? super Number> value) static boolean
matchReturnOrThrow
(Node node) static boolean
static boolean
matchSimpleBreak
(BasicBlock block, StrongBox<Label> label) static boolean
matchSimpleBreak
(BasicBlock block, Label label) static boolean
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, List<Expression> argument) static boolean
matchStore
(Node node, Variable expectedVariable) static boolean
matchStore
(Node node, Variable expectedVariable, StrongBox<Expression> value) static boolean
static Boolean
static boolean
matchUnconditionalBranch
(Node node) static boolean
matchUnlock
(Node e, LockInfo lockInfo) static boolean
matchVariableIncDec
(Node node, StrongBox<Variable> variable) static boolean
static boolean
matchVariableMutation
(Node node, Variable variable)
-
Constructor Details
-
PatternMatching
private PatternMatching()
-
-
Method Details
-
match
-
matchLeaveHandler
-
matchGetOperand
-
matchGetOperand
-
matchGetArguments
-
matchGetArguments
public static <T> boolean matchGetArguments(Node node, AstCode code, StrongBox<? super T> operand, List<Expression> arguments) -
matchGetArgument
-
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
-
matchSingle
public static <T> boolean matchSingle(Block block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument) -
matchNullOrEmpty
-
matchEmptyReturn
-
matchEmptyBlockOrLeave
-
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
-
matchSimpleBreak
-
matchAssignmentAndConditionalBreak
public static boolean matchAssignmentAndConditionalBreak(BasicBlock block, StrongBox<Expression> assignedValue, StrongBox<Expression> condition, StrongBox<Label> trueLabel, StrongBox<Label> falseLabel, StrongBox<Expression> equivalentLoad) -
matchAssignment
-
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
-
matchLast
-
matchLast
-
matchLast
-
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
-
matchLastAndBreak
public static <T> boolean matchLastAndBreak(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument, StrongBox<Label> label) -
matchThis
-
matchLoadAny
-
matchLoad
-
matchNumericLdC
-
matchVariableIncDec
-
matchVariableIncDec
-
matchStore
public static boolean matchStore(Node node, StrongBox<Variable> variable, StrongBox<Expression> argument) -
matchStore
public static boolean matchStore(Node node, StrongBox<Variable> variable, List<Expression> argument) -
matchLoadOrRet
-
matchLoad
-
matchStore
-
matchStore
-
matchLoad
public static boolean matchLoad(Node node, Variable expectedVariable, StrongBox<Expression> argument) -
matchLoadStore
-
matchLoadStoreAny
-
matchBooleanComparison
public static boolean matchBooleanComparison(Node node, StrongBox<Expression> argument, StrongBox<Boolean> comparand) -
matchComparison
public static boolean matchComparison(Node node, StrongBox<Expression> left, StrongBox<Expression> right) -
matchSimplifiableComparison
-
matchReversibleComparison
-
matchReturnOrThrow
-
matchTrue
-
matchFalse
-
matchIntegralConstant
-
matchNumericConstant
-
matchLoad
-
matchLoad
-
matchBooleanConstant
-
matchCharacterConstant
-
matchBooleanConstant
-
matchCharacterConstant
-
matchUnconditionalBranch
-
matchLock
-
matchUnlock
-
matchVariableMutation
-