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
-
Constructor Summary
ConstructorDescriptionAbstractExpressionMatcher
(Class<? extends T> cls) AbstractExpressionMatcher
(Set<Class<? extends T>> ops) -
Method Summary
Modifier and TypeMethodDescriptionprotected static boolean
boolean
match
(PatternExpression expression, Map<ExpressionMatcher<?>, PatternExpression> result) Attempt to match the given expression, recording substitutions in the given mapprotected abstract boolean
matchDetails
(T expression, Map<ExpressionMatcher<?>, PatternExpression> result) protected T
opMatches
(PatternExpression expression) protected boolean
recordResult
(PatternExpression expression, Map<ExpressionMatcher<?>, PatternExpression> result) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:ExpressionMatcher
Attempt 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:
match
in 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
-