public class

EPatternCompiler

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

Class Overview

IR expression pattern compiler. (Do not confuse this class with the IR compiler!)

This compiler takes a pattern as a string and compiles it to a pattern. A pattern is essentially is a template tree.

Rules: see EPatternCompiler.EPattern.

Summary

Nested Classes
class EPatternCompiler.EPattern IR expression multi-pattern, consisting of one or more inputs, and zero or one output (for replacement). 
Constants
int FLAG_INVALIDATE_DFA This client-side flag indicates that a successfully generated output (replacing a matched input) should be followed by the invalidation of all data-flow analysis.
int FLAG_NO_VARIABLE_LEAF_OVERLAP This flag is used to indicate that input patterns leaves matching EVar should not map to overlapped IR elements.
int FLAG_SAME_BITSIZE_FOR_LEAVES This flag indicates that all leaves in the input pattern must have the same bitsize.
Fields
public static final EPatternCompiler DEFAULT_COMPILER A static pattern compiler using default settings (no flags).
Public Constructors
EPatternCompiler(int flags)
Create a pattern compiler.
EPatternCompiler()
Create a pattern compiler using default settings.
Public Methods
EPatternCompiler.EPattern compile(EPatternCompiler.EPattern pattern)
Compile an IR pattern.
int getFlags()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int FLAG_INVALIDATE_DFA

This client-side flag indicates that a successfully generated output (replacing a matched input) should be followed by the invalidation of all data-flow analysis.

This flag is not honored by the matcher. It is up to the client to take action and honor this flag on a successful matching.

Constant Value: 256 (0x00000100)

public static final int FLAG_NO_VARIABLE_LEAF_OVERLAP

This flag is used to indicate that input patterns leaves matching EVar should not map to overlapped IR elements.

Example:

 Pattern: V0 = V1
 IR:      r5 = r5
 
If this flag is specified, the pattern will not match on the IR since leaves ids 0 and 1 would map to the same underlying IR EVar r5.

Constant Value: 1 (0x00000001)

public static final int FLAG_SAME_BITSIZE_FOR_LEAVES

This flag indicates that all leaves in the input pattern must have the same bitsize.

If some leaves in the pattern have specified (required) bitsizes, then those bitsizes must be the same and other leaves with unspecified bitsizes must have that same bitsize as well, else matching will fail.

Constant Value: 2 (0x00000002)

Fields

public static final EPatternCompiler DEFAULT_COMPILER

A static pattern compiler using default settings (no flags).

Public Constructors

public EPatternCompiler (int flags)

Create a pattern compiler.

Parameters
flags compiler flags

public EPatternCompiler ()

Create a pattern compiler using default settings.

Public Methods

public EPatternCompiler.EPattern compile (EPatternCompiler.EPattern pattern)

Compile an IR pattern.

Parameters
pattern a non-compiled pattern; attempting to compile an already-compiled pattern will raise an IllegalStateException
Returns
  • this pattern, compiled

public int getFlags ()