Class EPatternCompiler
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.compiler.EPatternCompiler
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
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
IR expression multi-pattern, consisting of one or more inputs, and zero or one output (for replacement). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EPatternCompiler
A static pattern compiler using default settings (no flags).static final int
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.static final int
This flag is used to indicate that input patterns leaves matching EVar should not map to overlapped IR elements.static final int
This flag indicates that all leaves in the input pattern must have the same bitsize. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a pattern compiler using default settings.EPatternCompiler
(int flags) Create a pattern compiler. -
Method Summary
Modifier and TypeMethodDescriptioncompile
(EPatternCompiler.EPattern pattern) Compile an IR pattern.int
getFlags()
-
Field Details
-
FLAG_NO_VARIABLE_LEAF_OVERLAP
public static final int FLAG_NO_VARIABLE_LEAF_OVERLAPThis 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.- See Also:
-
FLAG_SAME_BITSIZE_FOR_LEAVES
public static final int FLAG_SAME_BITSIZE_FOR_LEAVESThis 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.
- See Also:
-
FLAG_INVALIDATE_DFA
public static final int FLAG_INVALIDATE_DFAThis 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.
- See Also:
-
DEFAULT_COMPILER
A static pattern compiler using default settings (no flags).
-
-
Constructor Details
-
EPatternCompiler
public EPatternCompiler(int flags) Create a pattern compiler.- Parameters:
flags
- compiler flags
-
EPatternCompiler
public EPatternCompiler()Create a pattern compiler using default settings.
-
-
Method Details
-
getFlags
public int getFlags() -
compile
Compile an IR pattern.- Parameters:
pattern
- a non-compiled pattern; attempting to compile an already-compiled pattern will raise anIllegalStateException
- Returns:
- this pattern, compiled
-