java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.compiler.Leaf
All Implemented Interfaces:
INode

public class Leaf extends Object implements INode
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').

  • Field Details

    • FLAG_POSSIBLE_IMM

      public static final int FLAG_POSSIBLE_IMM
      See Also:
    • FLAG_POSSIBLE_VAR

      public static final int FLAG_POSSIBLE_VAR
      See Also:
    • FLAG_POSSIBLE_RANGE

      public static final int FLAG_POSSIBLE_RANGE
      See Also:
    • FLAG_POSSIBLE_NON_TERMINAL

      public static final int FLAG_POSSIBLE_NON_TERMINAL
      See Also:
    • FLAG_POSSIBLE_TERMINAL

      public static final int FLAG_POSSIBLE_TERMINAL
      See Also:
    • FLAG_POSSIBLE_ALL

      public static final int FLAG_POSSIBLE_ALL
      See Also:
    • id

      public int id
      internal id assigned to this leaf; must be >= 0
    • optionalBitsize

      public int optionalBitsize
      optional requested size of the leaf; leave to 0 for any size.
    • flags

      public int flags
      type of allowed leaf; must be set, because the default value (0) means none
    • handler

      public INodeHandler handler
    • value

      public BigInteger value
      for Leaf representing IEImm.
  • Constructor Details

    • Leaf

      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[
      bitsize -
      flags -
      handler - custom optional handler to do custom processing (custom checks) on a matched node
    • Leaf

      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[
      bitsize -
      flags -
    • Leaf

      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
  • Method Details