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 privatePatternMatching()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanmatch(Node node, AstCode code)static booleanmatchAssignment(Node node, StrongBox<Expression> assignedValue)static booleanmatchAssignment(Node node, StrongBox<Expression> assignedValue, StrongBox<Expression> equivalentLoad)static booleanmatchAssignmentAndConditionalBreak(BasicBlock block, StrongBox<Expression> assignedValue, StrongBox<Expression> condition, StrongBox<Label> trueLabel, StrongBox<Label> falseLabel, StrongBox<Expression> equivalentLoad)static booleanmatchBooleanComparison(Node node, StrongBox<Expression> argument, StrongBox<java.lang.Boolean> comparand)static java.lang.BooleanmatchBooleanConstant(Node node)static booleanmatchBooleanConstant(Node node, Consumer<? super java.lang.Boolean> value)static java.lang.CharactermatchCharacterConstant(Node node)static booleanmatchCharacterConstant(Node node, Consumer<? super java.lang.Character> value)static booleanmatchComparison(Node node, StrongBox<Expression> left, StrongBox<Expression> right)private static booleanmatchElementAssignment(Node node, StrongBox<Expression> assignedValue, StrongBox<Expression> equivalentLoad)static booleanmatchEmptyBlockOrLeave(Node node)static booleanmatchEmptyReturn(Node node)static java.lang.BooleanmatchFalse(Node node)static <T> booleanmatchGetArgument(Node node, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)static booleanmatchGetArgument(Node node, AstCode code, StrongBox<Expression> argument)static <T> booleanmatchGetArguments(Node node, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument1, StrongBox<Expression> argument2)static <T> booleanmatchGetArguments(Node node, AstCode code, StrongBox<? super T> operand, java.util.List<Expression> arguments)static booleanmatchGetArguments(Node node, AstCode code, java.util.List<Expression> arguments)static <T> booleanmatchGetOperand(Node node, AstCode code, Consumer<? super T> operand)static <T> booleanmatchGetOperand(Node node, AstCode code, java.lang.Class<T> operandType, StrongBox<? super T> operand)static booleanmatchIntegralConstant(Node node, Consumer<? super java.lang.Long> constant)static booleanmatchLast(BasicBlock block, AstCode code)static <T> booleanmatchLast(BasicBlock block, AstCode code, StrongBox<? super T> operand)static <T> booleanmatchLast(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)static booleanmatchLast(Block block, AstCode code)static <T> booleanmatchLast(Block block, AstCode code, StrongBox<? super T> operand)static <T> booleanmatchLast(Block block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)private static <T> booleanmatchLast(java.util.List<Node> body, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)static <T> booleanmatchLastAndBreak(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument, StrongBox<Label> label)static booleanmatchLeaveHandler(Node node)static booleanmatchLoad(Node node, Predicate<? super Variable> condition)static booleanmatchLoad(Node node, StrongBox<? super java.lang.Object> temp, Predicate<? super Variable> condition)static booleanmatchLoad(Node node, Variable expectedVariable)static booleanmatchLoad(Node node, Variable expectedVariable, StrongBox<Expression> argument)static booleanmatchLoad(Node node, Consumer<? super Variable> variable)static booleanmatchLoadAny(Node node, java.lang.Iterable<Variable> expectedVariables)static booleanmatchLoadOrRet(Node node, StrongBox<Variable> variable)static booleanmatchLoadStore(Node node, Variable expectedVariable, StrongBox<Variable> targetVariable)static booleanmatchLoadStoreAny(Node node, java.lang.Iterable<Variable> expectedVariables, StrongBox<Variable> targetVariable)static booleanmatchLock(java.util.List<Node> body, int position, Consumer<? super LockInfo> result)static booleanmatchNullOrEmpty(Block block)static booleanmatchNumericConstant(Node node, Consumer<? super java.lang.Number> constant)static booleanmatchNumericLdC(Node node, StrongBox<? super java.lang.Number> value)static booleanmatchReturnOrThrow(Node node)static booleanmatchReversibleComparison(Node node)static booleanmatchSimpleBreak(BasicBlock block, StrongBox<Label> label)static booleanmatchSimpleBreak(BasicBlock block, Label label)static booleanmatchSimplifiableComparison(Node node)static <T> booleanmatchSingle(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)static <T> booleanmatchSingle(Block block, AstCode code, StrongBox<? super T> operand)static <T> booleanmatchSingle(Block block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument)static <T> booleanmatchSingleAndBreak(BasicBlock block, AstCode code, StrongBox<? super T> operand, StrongBox<Expression> argument, StrongBox<Label> label)static booleanmatchStore(Node node, StrongBox<Variable> variable, StrongBox<Expression> argument)static booleanmatchStore(Node node, StrongBox<Variable> variable, java.util.List<Expression> argument)static booleanmatchStore(Node node, Variable expectedVariable)static booleanmatchStore(Node node, Variable expectedVariable, StrongBox<Expression> value)static booleanmatchThis(Node node)static java.lang.BooleanmatchTrue(Node node)static booleanmatchUnconditionalBranch(Node node)static booleanmatchUnlock(Node e, LockInfo lockInfo)static booleanmatchVariableIncDec(Node node, StrongBox<Variable> variable)static booleanmatchVariableIncDec(Node node, StrongBox<Variable> variable, StrongBox<java.lang.Number> amount)static booleanmatchVariableMutation(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)
-
-