# Class: com.pnfsoftware.jeb.core.units.code.android.ir.compiler.Leaf

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'\).

## Constructor: Leaf
- parameter: `id`, type: `int`
- parameter: `bitsize`, type: `int`
- parameter: `flags`, type: `int`
- parameter: `handler`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.compiler.INodeHandler`

Description: 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`, the `id` refers to the target expression to be examined.
parameter: id: a value in \[0,1000\[
parameter: bitsize: optional bitsize
parameter: flags: see `FLAG_xxx`
parameter: handler: custom optional handler to do custom processing \(custom checks\) on a matched            node

## Constructor: Leaf
- parameter: `id`, type: `int`
- parameter: `bitsize`, type: `int`
- parameter: `flags`, type: `int`

Description: Create a wildcard leaf. Can be a terminal \(eg, EVar, EImm\) or non\-terminal \(eg, complex expression\).
parameter: id: a value in \[0,1000\[
parameter: bitsize: optional bitsize
parameter: flags: see `FLAG_xxx`

## Constructor: Leaf
- parameter: `value`, type: `long`
- parameter: `bitsize`, type: `int`
- parameter: `id`, type: `int`

Description: Create a fixed, pre\-determined immediate constant leaf.
parameter: value: mandatory immediate value
parameter: bitsize: optional, use 0 if unknown
parameter: 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

## Field: flags
Type: `int`
Description: type of allowed leaf; must be set, because the default value \(0\) means none

## Field: handler
Type: `com.pnfsoftware.jeb.core.units.code.android.ir.compiler.INodeHandler`
Description: optional custom handler used after a leaf was matched

## Field: id
Type: `int`
Description: internal id assigned to this leaf; must be \>= 0

## Field: optionalBitsize
Type: `int`
Description: optional requested size of the leaf; leave to 0 for any size.

## Field: value
Type: `java.lang.Long`
Description: for Leaf representing [IDImm](IDImm).

## Static Field: FLAG_POSSIBLE_ALL
Type: `int`

Constant value: `7`
Description: Leaf flag allowing any expression.

## Static Field: FLAG_POSSIBLE_IMM
Type: `int`

Constant value: `1`
Description: Leaf flag allowing immediate expressions.

## Static Field: FLAG_POSSIBLE_NON_TERMINAL
Type: `int`

Constant value: `4`
Description: Leaf flag allowing non\-terminal expressions.

## Static Field: FLAG_POSSIBLE_TERMINAL
Type: `int`

Constant value: `3`
Description: Leaf flag allowing terminal expressions.

## Static Field: FLAG_POSSIBLE_VAR
Type: `int`

Constant value: `2`
Description: Leaf flag allowing variable expressions.

## Method: setHandler
- parameter: `h`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.compiler.INodeHandler`
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.compiler.Leaf`

Description: Set the optional custom handler.
parameter: h: custom handler
return: this leaf

## Method: toString
- return type: `java.lang.String`


