public class

EExpressionMatcher

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.compiler.EExpressionMatcher

Class Overview

Match an IR expression against an IR template.

Summary

Fields
public static boolean verbose
Public Constructors
EExpressionMatcher(INode template, Map<Integer, Object> initmap)
Create an IRE matcher.
EExpressionMatcher(INode template)
Create an IRE matcher.
Public Methods
Map<IEGeneric, Integer> getIRDepthsMap()
Map<Integer, Object> getMatchMap()
Retrieve the match map:
- Key= leaf id
- Value= matched IRE (IEgeneric) for leaves or operator (OperationType) for operator groups.
boolean isAllowDeepAssociativity()
boolean isMatch(IEGeneric e)
void reset()
void reset(boolean keepMatches)
void setAllowDeepAssociativity(boolean allowDeepAssociativity)
Use an operator's associativity to achieve better matching.
void setIRDepthsMap(Map<IEGeneric, Integer> IRDepthsMap)
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static boolean verbose

Public Constructors

public EExpressionMatcher (INode template, Map<Integer, Object> initmap)

Create an IRE matcher.

Parameters
template the template to match an expression against
initmap an optional, initial match map

public EExpressionMatcher (INode template)

Create an IRE matcher.

Parameters
template the template to match an expression against

Public Methods

public Map<IEGeneric, Integer> getIRDepthsMap ()

public Map<Integer, Object> getMatchMap ()

Retrieve the match map:
- Key= leaf id
- Value= matched IRE (IEgeneric) for leaves or operator (OperationType) for operator groups.

public boolean isAllowDeepAssociativity ()

public boolean isMatch (IEGeneric e)

public void reset ()

public void reset (boolean keepMatches)

public void setAllowDeepAssociativity (boolean allowDeepAssociativity)

Use an operator's associativity to achieve better matching. For example, matching V0 * (#1 + $2) on r0 * ((r1 + 4) + r2) could match on:

 V0 = r0
 #1 = 4
 $2 = (r1 + r2)
 
even if (r1 + r2) does not exists in inner expression.

public void setIRDepthsMap (Map<IEGeneric, Integer> IRDepthsMap)

public String toString ()