public class

Leaf

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

Class Overview

IR template element.

A leaf node is never null. Examples: an immediate or variable (atomic leaf, aka 'Terminal leaf') or memory access (composed leaf, aka 'Non-terminal leaf').

Summary

Constants
int FLAG_POSSIBLE_ALL
int FLAG_POSSIBLE_IMM
int FLAG_POSSIBLE_NON_TERMINAL
int FLAG_POSSIBLE_RANGE
int FLAG_POSSIBLE_TERMINAL
int FLAG_POSSIBLE_VAR
Fields
public int flags type of allowed leaf; must be set, because the default value (0) means none
public INodeHandler handler
public int id internal id assigned to this leaf; must be >= 0
public int optionalBitsize optional requested size of the leaf; leave to 0 for any size.
public BigInteger value for Leaf representing IEImm.
Public Constructors
Leaf(int id, int bitsize, int flags, INodeHandler handler)
Create a wildcard leaf.
Leaf(int id, int bitsize, int flags)
Create a wildcard leaf.
Leaf(long value, int bitsize, int id)
Create a fixed, pre-determined immediate constant leaf.
Public Methods
Leaf setHandler(INodeHandler h)
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int FLAG_POSSIBLE_ALL

Constant Value: 15 (0x0000000f)

public static final int FLAG_POSSIBLE_IMM

Constant Value: 1 (0x00000001)

public static final int FLAG_POSSIBLE_NON_TERMINAL

Constant Value: 8 (0x00000008)

public static final int FLAG_POSSIBLE_RANGE

Constant Value: 4 (0x00000004)

public static final int FLAG_POSSIBLE_TERMINAL

Constant Value: 7 (0x00000007)

public static final int FLAG_POSSIBLE_VAR

Constant Value: 2 (0x00000002)

Fields

public int flags

type of allowed leaf; must be set, because the default value (0) means none

public INodeHandler handler

public int id

internal id assigned to this leaf; must be >= 0

public int optionalBitsize

optional requested size of the leaf; leave to 0 for any size.

public BigInteger value

for Leaf representing IEImm.

Public Constructors

public Leaf (int id, int bitsize, int flags, INodeHandler handler)

Create a wildcard leaf. Can be a terminal (eg, EVar, EImm) or non-terminal (eg, complex expression).

Gotcha: When using FLAG_LASTBIT_IMM, the id refers to the target expression to be examined.

Parameters
id a value in [0,1000[
handler custom optional handler to do custom processing (custom checks) on a matched node

public Leaf (int id, int bitsize, int flags)

Create a wildcard leaf. Can be a terminal (eg, EVar, EImm) or non-terminal (eg, complex expression).

Parameters
id a value in [0,1000[

public Leaf (long value, int bitsize, int id)

Create a fixed, pre-determined immediate constant leaf.

Parameters
value mandatory immediate value
bitsize optional, use 0 if unknown
id optional, use -1 if not needed, else an id in the [0,1000[ range; use if the leaf needs to be used in a subsequent substitution step

Public Methods

public Leaf setHandler (INodeHandler h)

public String toString ()