Class AbstractExpressionMatcher<T extends PatternExpression>
java.lang.Object
ghidra.app.plugin.assembler.sleigh.expr.match.AbstractExpressionMatcher<T>
- Type Parameters:
T- the type of expression matched
- All Implemented Interfaces:
ExpressionMatcher<T>
- Direct Known Subclasses:
AnyMatcher,BinaryExpressionMatcher,ConstantValueMatcher,FieldSizeMatcher,OperandValueMatcher,UnaryExpressionMatcher
public abstract class AbstractExpressionMatcher<T extends PatternExpression>
extends Object
implements ExpressionMatcher<T>
Base implementation for expression matchers
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.app.plugin.assembler.sleigh.expr.match.ExpressionMatcher
ExpressionMatcher.Context -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractExpressionMatcher(Class<? extends T> cls) AbstractExpressionMatcher(Set<Class<? extends T>> ops) -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanbooleanmatch(PatternExpression expression, Map<ExpressionMatcher<?>, PatternExpression> result) Attempt to match the given expression, recording substitutions in the given mapprotected abstract booleanmatchDetails(T expression, Map<ExpressionMatcher<?>, PatternExpression> result) protected TopMatches(PatternExpression expression) protected booleanrecordResult(PatternExpression expression, Map<ExpressionMatcher<?>, PatternExpression> result) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.app.plugin.assembler.sleigh.expr.match.ExpressionMatcher
get, match
-
Field Details
-
ops
-
-
Constructor Details
-
AbstractExpressionMatcher
-
AbstractExpressionMatcher
-
-
Method Details
-
opMatches
-
matchDetails
protected abstract boolean matchDetails(T expression, Map<ExpressionMatcher<?>, PatternExpression> result) -
match
public boolean match(PatternExpression expression, Map<ExpressionMatcher<?>, PatternExpression> result) Description copied from interface:ExpressionMatcherAttempt to match the given expression, recording substitutions in the given mapEven if the match was unsuccessful, the result map may contain attempted substitutions. Thus, the map should be discarded if unsuccessful.
- Specified by:
matchin interfaceExpressionMatcher<T extends PatternExpression>- Parameters:
expression- the expression to matchresult- a map to store matchers to substituted expressions- Returns:
- true if successful, false if not
-
recordResult
protected boolean recordResult(PatternExpression expression, Map<ExpressionMatcher<?>, PatternExpression> result) -
expressionsIdenticallyDefined
-