# Class: com.pnfsoftware.jeb.core.units.code.android.ir.compiler.DExpressionMatcher

Match an IR expression against an IR template.

## Constructor: DExpressionMatcher
- parameter: `ctx`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDMethodContext`
- parameter: `template`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.compiler.INode`
- parameter: `initmap`, type: `java.util.Map<java.lang.Integer,java.lang.Object>`

Description: Create an IRE matcher.
parameter: ctx: IR method context
parameter: template: the template to match an expression against
parameter: initmap: an optional, initial match map

## Constructor: DExpressionMatcher
- parameter: `ctx`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDMethodContext`
- parameter: `template`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.compiler.INode`

Description: Create an IRE matcher.
parameter: ctx: IR method context
parameter: template: the template to match an expression against

## Static Field: verbose
Type: `boolean`
Description: Enable verbose matcher diagnostics.

## Method: getIRDepthsMap
- return type: `java.util.Map<com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression,java.lang.Integer>`

Description: Retrieve the expression depth map used during matching.
return: the expression depth map, or null if none was set

## Method: getMatchMap
- return type: `java.util.Map<java.lang.Integer,java.lang.Object>`

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

## Method: isAllowDeepAssociativity
- return type: `boolean`

Description: Determine whether deep associativity matching is allowed.
return: true if deep associativity matching is allowed

## Method: isMatch
- parameter: `e`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`
- return type: `boolean`

Description: Determine whether an expression matches the template.
parameter: e: expression to test
return: true if the expression matches

## Method: reset
- parameter: `keepMatches`, type: `boolean`

Description: Reset this matcher.
parameter: keepMatches: true to keep the current match map

## Method: reset

Description: Reset this matcher and clear current matches.

## Method: setAllowDeepAssociativity
- parameter: `allowDeepAssociativity`, type: `boolean`

Description: 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.
parameter: allowDeepAssociativity: true to allow deep associativity matching

## Method: setIRDepthsMap
- parameter: `IRDepthsMap`, type: `java.util.Map<com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression,java.lang.Integer>`

Description: Set precomputed expression depths used during matching.
parameter: IRDepthsMap: expression depth map

## Method: toString
- return type: `java.lang.String`


