Class DPatternMatcher.Result
java.lang.Object
com.pnfsoftware.jeb.core.units.code.android.ir.compiler.DPatternMatcher.Result
- Enclosing class:
DPatternMatcher
Result object provided by a
DPatternMatcher.-
Method Summary
Modifier and TypeMethodDescriptiongetCfg()Retrieve the input control-flow graph.Retrieve the method context used for matching.Retrieve the input expression.intRetrieve the matched input pattern index.longRetrieve the address of the match.Retrieve the matched expression.getMatchedLeaf(int index) Retrieve a matched expression leaf.<T> TgetMatchedLeaf(int index, Class<T> clazz) Retrieve a matched leaf and cast it to the requested type.Retrieve the parent of the matched expression.Retrieve the leaf match map.Retrieve the optimized expression produced by a replacement.Retrieve the pattern used for matching.booleanDetermine whether this match was replaced.toString()
-
Method Details
-
getContext
Retrieve the method context used for matching.- Returns:
- the method context
-
getCfg
Retrieve the input control-flow graph.- Returns:
- the input CFG, or null for expression-only matching
-
getInputExpression
Retrieve the input expression.- Returns:
- the input expression, or null for CFG matching
-
getPattern
Retrieve the pattern used for matching.- Returns:
- the pattern
-
getInputIndex
public int getInputIndex()Retrieve the matched input pattern index.- Returns:
- the input pattern index
-
getMatchedExpression
Retrieve the matched expression.- Returns:
- the matched expression, or null if the match was statement-only
-
getMatchedParent
Retrieve the parent of the matched expression.- Returns:
- the matched expression parent, or null if the matched expression was the root
-
getMatchAddress
public long getMatchAddress()Retrieve the address of the match.- Returns:
- the match address, or 0 for expression-only matching
-
getMatchMap
Retrieve the leaf match map.- Returns:
- the match map keyed by pattern leaf id
-
getMatchedLeaf
Retrieve a matched leaf and cast it to the requested type.- Type Parameters:
T- expected leaf type- Parameters:
index- leaf idclazz- expected leaf class- Returns:
- the matched leaf
-
getMatchedLeaf
Retrieve a matched expression leaf.- Parameters:
index- leaf id- Returns:
- the matched expression
-
isReplaced
public boolean isReplaced()Determine whether this match was replaced.- Returns:
- true if replacement succeeded
-
getOptimizedExpression
Retrieve the optimized expression produced by a replacement.- Returns:
- the optimized expression, or null if none was produced
-
toString
-