Header menu logo B2R2

AST Module

LowUIR AST construction must be done through this module.

Nested modules

Modules Description

InfixOp

Functions and values

Function or value Description

(mod) e1 e2

Full Usage: (mod) e1 e2

Parameters:
Returns: Expr

Unsigned modulus.

e1 : Expr
e2 : Expr
Returns: Expr

``and`` e1 e2

Full Usage: ``and`` e1 e2

Parameters:
Returns: Expr

Bitwise AND.

e1 : Expr
e2 : Expr
Returns: Expr

``not`` e

Full Usage: ``not`` e

Parameters:
Returns: Expr

Logical not.

e : Expr
Returns: Expr

``or`` e1 e2

Full Usage: ``or`` e1 e2

Parameters:
Returns: Expr

Bitwise OR.

e1 : Expr
e2 : Expr
Returns: Expr

add e1 e2

Full Usage: add e1 e2

Parameters:
Returns: Expr

Add two expressions.

e1 : Expr
e2 : Expr
Returns: Expr

app name args retType

Full Usage: app name args retType

Parameters:
Returns: Expr

Construct a function application.

name : string
args : Expr list
retType : RegType
Returns: Expr

assign dst src

Full Usage: assign dst src

Parameters:
Returns: Stmt

An assignment statement.

dst : Expr
src : Expr
Returns: Stmt

assignForExtractDst e1 e2

Full Usage: assignForExtractDst e1 e2

Parameters:
Returns: Stmt
e1 : Expr
e2 : Expr
Returns: Stmt

b0

Full Usage: b0

Returns: Expr

Num expression for a one-bit number zero.

Returns: Expr

b1

Full Usage: b1

Returns: Expr

Num expression for a one-bit number one.

Returns: Expr

binop op e1 e2

Full Usage: binop op e1 e2

Parameters:
Returns: Expr

Construct a binary operator (BinOp).

op : BinOpType
e1 : Expr
e2 : Expr
Returns: Expr

binopWithType op t e1 e2

Full Usage: binopWithType op t e1 e2

Parameters:
Returns: Expr
op : BinOpType
t : RegType
e1 : Expr
e2 : Expr
Returns: Expr

cast kind rt e

Full Usage: cast kind rt e

Parameters:
Returns: Expr

Construct a cast expression (Cast).

kind : CastKind
rt : RegType
e : Expr
Returns: Expr

cjmp cond dst1 dst2

Full Usage: cjmp cond dst1 dst2

Parameters:
Returns: Stmt

A CJmp statement.

cond : Expr
dst1 : Expr
dst2 : Expr
Returns: Stmt

concat e1 e2

Full Usage: concat e1 e2

Parameters:
Returns: Expr

Concatenation.

e1 : Expr
e2 : Expr
Returns: Expr

concatArr arr

Full Usage: concatArr arr

Parameters:
Returns: Expr

Concatenate an array of expressions.

arr : Expr[]
Returns: Expr

cons a b

Full Usage: cons a b

Parameters:
Returns: Expr

Consing two expr.

a : Expr
b : Expr
Returns: Expr

div e1 e2

Full Usage: div e1 e2

Parameters:
Returns: Expr

Unsigned division.

e1 : Expr
e2 : Expr
Returns: Expr

eq e1 e2

Full Usage: eq e1 e2

Parameters:
Returns: Expr

Equal.

e1 : Expr
e2 : Expr
Returns: Expr

extCall appExpr

Full Usage: extCall appExpr

Parameters:
Returns: Stmt

An external call statement.

appExpr : Expr
Returns: Stmt

extract expr rt pos

Full Usage: extract expr rt pos

Parameters:
Returns: Expr

Construct a extract expression (Extract).

expr : Expr
rt : RegType
pos : int
Returns: Expr

fadd e1 e2

Full Usage: fadd e1 e2

Parameters:
Returns: Expr

Floating point add two expressions.

e1 : Expr
e2 : Expr
Returns: Expr

fatan e

Full Usage: fatan e

Parameters:
Returns: Expr

Floating point arc tangent.

e : Expr
Returns: Expr

fcos e

Full Usage: fcos e

Parameters:
Returns: Expr

Floating point cosine.

e : Expr
Returns: Expr

fdiv e1 e2

Full Usage: fdiv e1 e2

Parameters:
Returns: Expr

Floating point division.

e1 : Expr
e2 : Expr
Returns: Expr

feq e1 e2

Full Usage: feq e1 e2

Parameters:
Returns: Expr

Floating point equal.

e1 : Expr
e2 : Expr
Returns: Expr

fge e1 e2

Full Usage: fge e1 e2

Parameters:
Returns: Expr

Floating point greater than or equal.

e1 : Expr
e2 : Expr
Returns: Expr

fgt e1 e2

Full Usage: fgt e1 e2

Parameters:
Returns: Expr

Floating point greater than.

e1 : Expr
e2 : Expr
Returns: Expr

fle e1 e2

Full Usage: fle e1 e2

Parameters:
Returns: Expr

Floating point less than or equal.

e1 : Expr
e2 : Expr
Returns: Expr

flog e1 e2

Full Usage: flog e1 e2

Parameters:
Returns: Expr

Floating point logarithm.

e1 : Expr
e2 : Expr
Returns: Expr

flt e1 e2

Full Usage: flt e1 e2

Parameters:
Returns: Expr

Floating point less than.

e1 : Expr
e2 : Expr
Returns: Expr

fmul e1 e2

Full Usage: fmul e1 e2

Parameters:
Returns: Expr

Floating point multiplication.

e1 : Expr
e2 : Expr
Returns: Expr

fpow e1 e2

Full Usage: fpow e1 e2

Parameters:
Returns: Expr

Floating point power.

e1 : Expr
e2 : Expr
Returns: Expr

fsin e

Full Usage: fsin e

Parameters:
Returns: Expr

Floating point sine.

e : Expr
Returns: Expr

fsqrt e

Full Usage: fsqrt e

Parameters:
Returns: Expr

Floating point square root.

e : Expr
Returns: Expr

fsub e1 e2

Full Usage: fsub e1 e2

Parameters:
Returns: Expr

Floating point subtract two expressions.

e1 : Expr
e2 : Expr
Returns: Expr

ftan e

Full Usage: ftan e

Parameters:
Returns: Expr

Floating point tangent.

e : Expr
Returns: Expr

funcName name

Full Usage: funcName name

Parameters:
    name : string

Returns: Expr

Function name.

name : string
Returns: Expr

ge e1 e2

Full Usage: ge e1 e2

Parameters:
Returns: Expr

Unsigned greater than or equal.

e1 : Expr
e2 : Expr
Returns: Expr

gt e1 e2

Full Usage: gt e1 e2

Parameters:
Returns: Expr

Unsigned greater than.

e1 : Expr
e2 : Expr
Returns: Expr

iemark nBytes

Full Usage: iemark nBytes

Parameters:
    nBytes : uint32

Returns: Stmt

An IEMark statement.

nBytes : uint32
Returns: Stmt

intercjmp cond d1 d2

Full Usage: intercjmp cond d1 d2

Parameters:
Returns: Stmt

A InterCJmp statement.

cond : Expr
d1 : Expr
d2 : Expr
Returns: Stmt

interjmp dst kind

Full Usage: interjmp dst kind

Parameters:
Returns: Stmt

An InterJmp statement.

dst : Expr
kind : InterJmpKind
Returns: Stmt

ismark nBytes

Full Usage: ismark nBytes

Parameters:
    nBytes : uint32

Returns: Stmt

An ISMark statement.

nBytes : uint32
Returns: Stmt

ite cond e1 e2

Full Usage: ite cond e1 e2

Parameters:
Returns: Expr

Construct an ITE (if-then-else) expression (Ite).

cond : Expr
e1 : Expr
e2 : Expr
Returns: Expr

jmp target

Full Usage: jmp target

Parameters:
Returns: Stmt

A Jmp statement.

target : Expr
Returns: Stmt

le e1 e2

Full Usage: le e1 e2

Parameters:
Returns: Expr

Unsigned less than or equal.

e1 : Expr
e2 : Expr
Returns: Expr

lmark (arg1, arg2)

Full Usage: lmark (arg1, arg2)

Parameters:
    arg0 : string
    arg1 : int

Returns: Stmt

An LMark statement.

arg0 : string
arg1 : int
Returns: Stmt

load endian rt addr

Full Usage: load endian rt addr

Parameters:
Returns: Expr

Construct a load expression (Load).

endian : Endian
rt : RegType
addr : Expr
Returns: Expr

loadBE t expr

Full Usage: loadBE t expr

Parameters:
Returns: Expr

Construct a load expression in big-endian.

t : RegType
expr : Expr
Returns: Expr

loadLE t expr

Full Usage: loadLE t expr

Parameters:
Returns: Expr

Construct a load expression in little-endian.

t : RegType
expr : Expr
Returns: Expr

lt e1 e2

Full Usage: lt e1 e2

Parameters:
Returns: Expr

Unsigned less than.

e1 : Expr
e2 : Expr
Returns: Expr

mul e1 e2

Full Usage: mul e1 e2

Parameters:
Returns: Expr

Multiply two expressions.

e1 : Expr
e2 : Expr
Returns: Expr

name (arg1, arg2)

Full Usage: name (arg1, arg2)

Parameters:
    arg0 : string
    arg1 : int

Returns: Expr

Construct a symbolic name (Name).

arg0 : string
arg1 : int
Returns: Expr

neg e

Full Usage: neg e

Parameters:
Returns: Expr

Negation (Two's complement).

e : Expr
Returns: Expr

neq e1 e2

Full Usage: neq e1 e2

Parameters:
Returns: Expr

Not equal.

e1 : Expr
e2 : Expr
Returns: Expr

nil

Full Usage: nil

Returns: Expr

Nil.

Returns: Expr

num bv

Full Usage: num bv

Parameters:
Returns: Expr

Construct a number (Num).

bv : BitVector
Returns: Expr

num0 rt

Full Usage: num0 rt

Parameters:
Returns: Expr

Construct a (Num 0) of size t.

rt : int<MeasureProduct<rt, MeasureOne>>
Returns: Expr

num1 rt

Full Usage: num1 rt

Parameters:
Returns: Expr

Construct a (Num 1) of size t.

rt : int<MeasureProduct<rt, MeasureOne>>
Returns: Expr

pcvar t name

Full Usage: pcvar t name

Parameters:
Returns: Expr

Construct a pc variable (PCVar).

t : RegType
name : string
Returns: Expr

put dst src

Full Usage: put dst src

Parameters:
Returns: Stmt

A Put statement.

dst : Expr
src : Expr
Returns: Stmt

relop op e1 e2

Full Usage: relop op e1 e2

Parameters:
Returns: Expr

Construct a relative operator (RelOp).

op : RelOpType
e1 : Expr
e2 : Expr
Returns: Expr

sar e1 e2

Full Usage: sar e1 e2

Parameters:
Returns: Expr

Shift arithmetic right.

e1 : Expr
e2 : Expr
Returns: Expr

sdiv e1 e2

Full Usage: sdiv e1 e2

Parameters:
Returns: Expr

Signed division.

e1 : Expr
e2 : Expr
Returns: Expr

sext addrSize expr

Full Usage: sext addrSize expr

Parameters:
Returns: Expr

Sign-extend an expression.

addrSize : RegType
expr : Expr
Returns: Expr

sge e1 e2

Full Usage: sge e1 e2

Parameters:
Returns: Expr

Signed greater than or equal.

e1 : Expr
e2 : Expr
Returns: Expr

sgt e1 e2

Full Usage: sgt e1 e2

Parameters:
Returns: Expr

Signed greater than.

e1 : Expr
e2 : Expr
Returns: Expr

shl e1 e2

Full Usage: shl e1 e2

Parameters:
Returns: Expr

Shift logical left.

e1 : Expr
e2 : Expr
Returns: Expr

shr e1 e2

Full Usage: shr e1 e2

Parameters:
Returns: Expr

Shift logical right.

e1 : Expr
e2 : Expr
Returns: Expr

sideEffect eff

Full Usage: sideEffect eff

Parameters:
Returns: Stmt

A SideEffect statement.

eff : SideEffect
Returns: Stmt

sle e1 e2

Full Usage: sle e1 e2

Parameters:
Returns: Expr

Signed less than or equal.

e1 : Expr
e2 : Expr
Returns: Expr

slt e1 e2

Full Usage: slt e1 e2

Parameters:
Returns: Expr

Signed less than.

e1 : Expr
e2 : Expr
Returns: Expr

smod e1 e2

Full Usage: smod e1 e2

Parameters:
Returns: Expr

Signed modulus.

e1 : Expr
e2 : Expr
Returns: Expr

store endian addr v

Full Usage: store endian addr v

Parameters:
Returns: Stmt

A Store statement.

endian : Endian
addr : Expr
v : Expr
Returns: Stmt

sub e1 e2

Full Usage: sub e1 e2

Parameters:
Returns: Expr

Subtract two expressions.

e1 : Expr
e2 : Expr
Returns: Expr

symbol name id

Full Usage: symbol name id

Parameters:
    name : string
    id : int

Returns: Symbol
Modifiers: inline

Construct a symbol (for a label) from a string and a IDCounter.

name : string
id : int
Returns: Symbol

tmpvar t id

Full Usage: tmpvar t id

Parameters:
Returns: Expr

Construct a temporary variable (TempVar) with the given ID.

t : RegType
id : int
Returns: Expr

undef rt s

Full Usage: undef rt s

Parameters:
Returns: Expr

Undefined expression.

rt : RegType
s : string
Returns: Expr

unop op e

Full Usage: unop op e

Parameters:
Returns: Expr

Construct an unary operator (UnOp).

op : UnOpType
e : Expr
Returns: Expr

unwrap e

Full Usage: unwrap e

Parameters:
Returns: Expr

Unwrap (casted) expression.

e : Expr
Returns: Expr

updateAllVarsUses rset tset arg3

Full Usage: updateAllVarsUses rset tset arg3

Parameters:

Record the use of vars and tempvars from the given expression.

rset : RegisterSet
tset : HashSet<int>
arg2 : Expr

updateRegsUses rset arg2

Full Usage: updateRegsUses rset arg2

Parameters:

Record the use of vars (registers) from the given expression.

rset : RegisterSet
arg1 : Expr

updateTempsUses tset arg2

Full Usage: updateTempsUses tset arg2

Parameters:

Record the use of tempvars from the given expression.

tset : HashSet<int>
arg1 : Expr

var t id name

Full Usage: var t id name

Parameters:
Returns: Expr

Construct a variable (Var).

t : RegType
id : RegisterID
name : string
Returns: Expr

xor e1 e2

Full Usage: xor e1 e2

Parameters:
Returns: Expr

Bitwise XOR.

e1 : Expr
e2 : Expr
Returns: Expr

xthi addrSize expr

Full Usage: xthi addrSize expr

Parameters:
Returns: Expr

Take the high half bits of an expression.

addrSize : RegType
expr : Expr
Returns: Expr

xtlo addrSize expr

Full Usage: xtlo addrSize expr

Parameters:
Returns: Expr

Take the low half bits of an expression.

addrSize : RegType
expr : Expr
Returns: Expr

zext addrSize expr

Full Usage: zext addrSize expr

Parameters:
Returns: Expr

Zero-extend an expression.

addrSize : RegType
expr : Expr
Returns: Expr

Type something to start searching.