public abstract class

AbstractCElementOptimizer

extends AbstractCBlockOptimizer
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.AbstractPlugin
     ↳ com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.AbstractOptimizer<T extends com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizerTarget>
       ↳ com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt.AbstractCOptimizer
         ↳ com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt.AbstractCBlockOptimizer
           ↳ com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt.AbstractCElementOptimizer

Class Overview

Specialized base optimizer for C elements. Each element contained in the AST method is provided to optimizeElement(ICElement, ICElement)

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer
[Expand]
Inherited Fields
From class com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt.AbstractCOptimizer
From class com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.AbstractOptimizer
Public Constructors
AbstractCElementOptimizer()
Same as this(false).
AbstractCElementOptimizer(boolean innerReplacement)
Protected Methods
final int optimizeBlock(ICBlock b)
Process the block.
abstract ICElement optimizeElement(ICElement e, ICElement parent)
Optimize an element.
[Expand]
Inherited Methods
From class com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt.AbstractCBlockOptimizer
From class com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.opt.AbstractCOptimizer
From class com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.AbstractOptimizer
From class com.pnfsoftware.jeb.core.AbstractPlugin
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.IPlugin
From interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.IOptimizer

Public Constructors

public AbstractCElementOptimizer ()

Same as this(false).

public AbstractCElementOptimizer (boolean innerReplacement)

Parameters
innerReplacement if false, parent.replaceSubElement(elt, new_elt) will be called after a successful optimization (optimizeElement(ICElement, ICElement) returned non-null)

Protected Methods

protected final int optimizeBlock (ICBlock b)

Process the block. Sub-classes should not override the default implementation.

Parameters
b a block of statements
Returns
  • the number of optimizations done

protected abstract ICElement optimizeElement (ICElement e, ICElement parent)

Optimize an element. Sub-classes must implement this method

Parameters
e input element to be optimized
parent the parent of the input element
Returns
  • non-null if the element was optimized; null means it was not optimized (if innerReplacement=true was provided to the constructor, this return value, if non-null, must be the input element itself)