Class DPatternMatcher.Result

java.lang.Object
com.pnfsoftware.jeb.core.units.code.android.ir.compiler.DPatternMatcher.Result
Enclosing class:
DPatternMatcher

public static class DPatternMatcher.Result extends Object
Result object provided by a DPatternMatcher.
  • Method Details

    • getContext

      public IDMethodContext getContext()
      Retrieve the method context used for matching.
      Returns:
      the method context
    • getCfg

      public CFG<IDInstruction> getCfg()
      Retrieve the input control-flow graph.
      Returns:
      the input CFG, or null for expression-only matching
    • getInputExpression

      public IDExpression getInputExpression()
      Retrieve the input expression.
      Returns:
      the input expression, or null for CFG matching
    • getPattern

      public DPatternCompiler.DPattern 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

      public IDExpression getMatchedExpression()
      Retrieve the matched expression.
      Returns:
      the matched expression, or null if the match was statement-only
    • getMatchedParent

      public IDExpression 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

      public Map<Integer,Object> getMatchMap()
      Retrieve the leaf match map.
      Returns:
      the match map keyed by pattern leaf id
    • getMatchedLeaf

      public <T> T getMatchedLeaf(int index, Class<T> clazz)
      Retrieve a matched leaf and cast it to the requested type.
      Type Parameters:
      T - expected leaf type
      Parameters:
      index - leaf id
      clazz - expected leaf class
      Returns:
      the matched leaf
    • getMatchedLeaf

      public IDExpression getMatchedLeaf(int index)
      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

      public IDExpression getOptimizedExpression()
      Retrieve the optimized expression produced by a replacement.
      Returns:
      the optimized expression, or null if none was produced
    • toString

      public String toString()
      Overrides:
      toString in class Object