Class Leaf
java.lang.Object
com.pnfsoftware.jeb.core.units.code.android.ir.compiler.Leaf
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intLeaf flag allowing any expression.static final intLeaf flag allowing immediate expressions.static final intLeaf flag allowing non-terminal expressions.static final intLeaf flag allowing terminal expressions.static final intLeaf flag allowing variable expressions.inttype of allowed leaf; must be set, because the default value (0) means noneoptional custom handler used after a leaf was matchedintinternal id assigned to this leaf; must be >= 0intoptional requested size of the leaf; leave to 0 for any size.for Leaf representingIDImm. -
Constructor Summary
ConstructorsConstructorDescriptionLeaf(int id, int bitsize, int flags) Create a wildcard leaf.Leaf(int id, int bitsize, int flags, INodeHandler handler) Create a wildcard leaf.Leaf(long value, int bitsize, int id) Create a fixed, pre-determined immediate constant leaf. -
Method Summary
-
Field Details
-
FLAG_POSSIBLE_IMM
public static final int FLAG_POSSIBLE_IMMLeaf flag allowing immediate expressions.- See Also:
-
FLAG_POSSIBLE_VAR
public static final int FLAG_POSSIBLE_VARLeaf flag allowing variable expressions.- See Also:
-
FLAG_POSSIBLE_NON_TERMINAL
public static final int FLAG_POSSIBLE_NON_TERMINALLeaf flag allowing non-terminal expressions.- See Also:
-
FLAG_POSSIBLE_TERMINAL
public static final int FLAG_POSSIBLE_TERMINALLeaf flag allowing terminal expressions.- See Also:
-
FLAG_POSSIBLE_ALL
public static final int FLAG_POSSIBLE_ALLLeaf flag allowing any expression.- See Also:
-
id
public int idinternal id assigned to this leaf; must be >= 0 -
optionalBitsize
public int optionalBitsizeoptional requested size of the leaf; leave to 0 for any size. -
flags
public int flagstype of allowed leaf; must be set, because the default value (0) means none -
handler
optional custom handler used after a leaf was matched -
value
for Leaf representingIDImm.
-
-
Constructor Details
-
Leaf
Create a wildcard leaf. Can be a terminal (e.g. imm or var) or non-terminal (e.g., complex expression).Gotcha: When using
FLAG_LASTBIT_IMM, theidrefers to the target expression to be examined.- Parameters:
id- a value in [0,1000[bitsize- optional bitsizeflags- seeFLAG_xxxhandler- 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- optional bitsizeflags- seeFLAG_xxx
-
Leaf
public Leaf(long value, int bitsize, int id) Create a fixed, pre-determined immediate constant leaf.- Parameters:
value- mandatory immediate valuebitsize- optional, use 0 if unknownid- 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