# Class: com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.AbstractEExpressionOptimizer

Skeleton for a top\-down, recursive, [IEGeneric](IEGeneric) optimizer. Expressions are provided in depth\-first, pre\-order way: parent expressions are provided before their constituting children. 

 By default, [IEStatement](IEStatement)s are not candidates for optimization \(although they can be\). Generally, [IEStatement](IEStatement)s should be optimized via the use an [AbstractEStatementOptimizer](AbstractEStatementOptimizer).

## Constructor: AbstractEExpressionOptimizer
- parameter: `dataChainsUpdatePolicy`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.DataChainsUpdatePolicy`

Description: Create an expression optimizer.
parameter: dataChainsUpdatePolicy: expression optimizers should have a policy of            [DataChainsUpdatePolicy#UPDATE_IF_OPTIMIZED](DataChainsUpdatePolicy#UPDATE_IF_OPTIMIZED) or            [DataChainsUpdatePolicy#UPDATE_IF_REQUIRED](DataChainsUpdatePolicy#UPDATE_IF_REQUIRED)

## Protected Field: currentStatement
Type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEStatement`
Description: This field holds a reference to the top\-level parent statement of the expression currently being optimized.

## Protected Field: skipLeftSideOfAssignment
Type: `boolean`
Description: Do not process left\-side of [statement](IEStatement). Exception: If the left\-side is an [IEMem](IEMem), the memory reference is processed.
 Default value: false.

## Protected Field: skipStatementProcessing
Type: `boolean`
Description: Optimize only the constituents of the IRE statements, not the statements themselves.
 Default value: true.

## Protected Method: doSubstitution
- parameter: `e`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEGeneric`
- parameter: `substitutions`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.compiler.SubstitutionDefinition[]`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEGeneric`

Description: Attempt to apply the first matching [SubstitutionDefinition](SubstitutionDefinition) on an [IEGeneric](IEGeneric) expression.
parameter: e: the target expression to be matched and modified
parameter: substitutions: a list of candidate substitutions
return: null if no substitution was performed, else the new expression

## Protected Method: optimizeExpression
- parameter: `e`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEGeneric`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.AbstractEExpressionOptimizer.EOR`

Description: Attempt to optimize expressions. Sub\-expressions may be examined. The implementor should not attempt to modify parent or cousins expressions.
parameter: e: IRE
return: the new \(optimized\) expression as well as DFA update hints, or null if the expression         could not be optimized

## Protected Method: perform
- return type: `int`


## Method: performOnExpression
- parameter: `exp`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEGeneric`
- parameter: `ectx`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.IERoutineContext`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEGeneric`


