ballerina/bir module
Type Definitions
Type | Values | Description | |
---|---|---|---|
$anonType$0 | RETURN | MOVE | GOTO | CONST_LOAD | CALL | BRANCH | ||
$anonType$1 | TEMP | RETURN | LOCAL | ||
ADD | ADD | ||
ArgVarKind | ARG | ||
BType | BTypeNil | BTypeInt | BTypeBoolean | ||
BTypeBoolean | boolean | ||
BTypeInt | int | ||
BTypeNil | () | ||
BinaryOpInstructionKind | SUB | NOT_EQUAL | MUL | LESS_THAN | LESS_EQUAL | GREATER_THAN | GREATER_EQUAL | EQUAL | DIV | ADD | ||
DIV | DIV | ||
DocTag | VARIABLE | RETURN | RECEIVER | PARAM | FIELD | ENDPOINT | ||
EQUAL | EQUAL | ||
GREATER_EQUAL | GREATER_EQUAL | ||
GREATER_THAN | GREATER_THAN | ||
Instruction | Move | ConstantLoad | BinaryOp | ||
InstructionKind | BinaryOpInstructionKind | $anonType$0 | ||
Kind | VAR_REF | CONST | ||
LESS_EQUAL | LESS_EQUAL | ||
LESS_THAN | LESS_THAN | ||
MUL | MUL | ||
NOT_EQUAL | NOT_EQUAL | ||
Operand | VarRef | ||
SUB | SUB | ||
SymbolKind | XMLNS | WORKER | TYPE_DEF | TRANSFORMER | STRUCT | SERVICE_VARIABLE | SERVICE | SCOPE | RESOURCE | RECORD | PARAMETER | PACKAGE_VARIABLE | PACKAGE | OTHER | OBJECT | LOCAL_VARIABLE | FUNCTION | ENUM | CONVERSION_OPERATOR | CONSTANT | CONNECTOR_VARIABLE | CONNECTOR | CAST_OPERATOR | ANNOTATION_ATTRIBUTE | ANNOTATION | ACTION | ||
Terminator | Return | GOTO | Call | Branch | ||
VarKind | ArgVarKind | $anonType$1 | ||
Visibility | PUBLIC | PRIVATE | PACKAGE_PRIVATE |
Records Summary
Record | Description | ||
---|---|---|---|
BInvokableType | |||
BSymbol | |||
BTypeSymbol | |||
BasicBlock | |||
ConstPool | |||
DocAttachment | |||
DocAttribute | |||
Function | |||
Name | |||
Package | |||
PackageID | |||
PackageId | |||
Scope | |||
VariableDcl |
Objects Summary
Object | Description | ||
---|---|---|---|
BinaryOp | |||
BirChannelReader | |||
Branch | |||
Call | |||
ChannelReader | |||
ConstPoolParser | |||
ConstantLoad | |||
FuncBodyParser | |||
GOTO | |||
Move | |||
PackageParser | |||
Return | |||
VarRef |
public type BInvokableType record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
paramTypes | int|boolean|()[] | ||
retType | int|boolean|() |
public type BSymbol record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
closure | boolean | ||
documentationValue | bir:DocAttachment | ||
flags | int | ||
kind | LOCAL_VARIABLE|CONNECTOR_VARIABLE|CONVERSION_OPERATOR|PARAMETER|ACTION|SCOPE|OTHER|WORKER|SERVICE|SERVICE_VARIABLE|XMLNS|TYPE_DEF|STRUCT|ANNOTATION_ATTRIBUTE|CONNECTOR|TRANSFORMER|CONSTANT|RECORD|ENUM|RESOURCE|PACKAGE|PACKAGE_VARIABLE|ANNOTATION|FUNCTION|OBJECT|CAST_OPERATOR | ||
name | bir:Name | ||
pkgID | bir:PackageID | ||
tag | int | ||
tainted | boolean | ||
typeValue | int|boolean|() |
public type BTypeSymbol record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
closure | boolean | ||
documentationValue | bir:DocAttachment | ||
flags | int | ||
isLabel | boolean | ||
kind | LOCAL_VARIABLE|CONNECTOR_VARIABLE|CONVERSION_OPERATOR|PARAMETER|ACTION|SCOPE|OTHER|WORKER|SERVICE|SERVICE_VARIABLE|XMLNS|TYPE_DEF|STRUCT|ANNOTATION_ATTRIBUTE|CONNECTOR|TRANSFORMER|CONSTANT|RECORD|ENUM|RESOURCE|PACKAGE|PACKAGE_VARIABLE|ANNOTATION|FUNCTION|OBJECT|CAST_OPERATOR | ||
name | bir:Name | ||
pkgID | bir:PackageID | ||
scopeValue | bir:Scope | ||
tag | int | ||
tainted | boolean | ||
typeValue | int|boolean|() |
public type BasicBlock record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
id | bir:Name | ||
instructions | bir:Move|bir:BinaryOp|bir:ConstantLoad[] | ||
terminator | bir:Call|bir:Branch|bir:GOTO|bir:Return |
public type ConstPool record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
packages | bir:PackageId[] | ||
strings | string[] | ||
ints | int[] |
public type DocAttachment record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
attributes | bir:DocAttribute[] | ||
description | string |
public type DocAttribute record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
description | string | ||
docTag | FIELD|RECEIVER|VARIABLE|ENDPOINT|RETURN|PARAM | ||
name | string |
public type Function record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
argsCount | int | ||
basicBlocks | bir:BasicBlock[] | ||
isDeclaration | boolean | ||
localVars | bir:VariableDcl[] | ||
name | bir:Name | ||
typeValue | bir:BInvokableType | ||
visibility | PACKAGE_PRIVATE|PUBLIC|PRIVATE |
public type Name record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
value | string |
public type Package record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
functions | bir:Function[] | ||
name | bir:Name | ||
org | bir:Name | ||
types | int|boolean|()[] | ||
versionValue | bir:Name |
public type PackageID record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
orgName | bir:Name | ||
sourceFileName | bir:Name | ||
versionValue | bir:Name |
public type PackageId record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
name | string | ||
versionValue | string | ||
org | string |
public type Scope record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
owner | bir:BSymbol |
public type VariableDcl record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
kind | ARG|RETURN|TEMP|LOCAL | ||
name | bir:Name | ||
typeValue | int|boolean|() |
public type BinaryOp object
Field Name | Data Type | Default Value | Description |
---|---|---|---|
kind | ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL | ||
lhsOp | bir:VarRef | ||
rhsOp1 | bir:VarRef | ||
rhsOp2 | bir:VarRef | ||
typeValue | int|boolean|() |
-
<BinaryOp> new(ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL kind, bir:VarRef lhsOp, bir:VarRef rhsOp1, bir:VarRef rhsOp2, int|boolean|() typeValue)
Parameter Name Data Type Default Value Description kind ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL lhsOp bir:VarRef rhsOp1 bir:VarRef rhsOp2 bir:VarRef typeValue int|boolean|()
public type BirChannelReader object
-
<BirChannelReader> new(bir:ChannelReader reader, bir:ConstPool cp)
Parameter Name Data Type Default Value Description reader bir:ChannelReader cp bir:ConstPool -
<BirChannelReader> readBType() returns (BType)
Return Type Description BType -
<BirChannelReader> readStringCpRef() returns (string)
Return Type Description string -
<BirChannelReader> readIntCpRef() returns (int)
Return Type Description int -
<BirChannelReader> readBoolean() returns (boolean)
Return Type Description boolean -
<BirChannelReader> readInt8() returns (int)
Return Type Description int -
<BirChannelReader> readInt32() returns (int)
Return Type Description int -
<BirChannelReader> readInt64() returns (int)
Return Type Description int -
<BirChannelReader> readString() returns (string)
Return Type Description string -
<BirChannelReader> readByteArray(int len) returns (byte[])
Parameter Name Data Type Default Value Description len int Return Type Description byte[]
public type Branch object
Field Name | Data Type | Default Value | Description |
---|---|---|---|
falseBB | bir:BasicBlock | ||
kind | ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH | ||
op | bir:VarRef | ||
trueBB | bir:BasicBlock |
-
<Branch> new(bir:BasicBlock falseBB, ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH kind, bir:VarRef op, bir:BasicBlock trueBB)
Parameter Name Data Type Default Value Description falseBB bir:BasicBlock kind ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH op bir:VarRef trueBB bir:BasicBlock
public type Call object
Field Name | Data Type | Default Value | Description |
---|---|---|---|
args | bir:VarRef[] | ||
kind | ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH | ||
lhsOp | bir:VarRef? | ||
name | bir:Name | ||
thenBB | bir:BasicBlock |
-
<Call> new(bir:VarRef[] args, ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH kind, bir:VarRef? lhsOp, bir:Name name, bir:BasicBlock thenBB)
Parameter Name Data Type Default Value Description args bir:VarRef[] kind ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH lhsOp bir:VarRef? name bir:Name thenBB bir:BasicBlock
public type ChannelReader object
-
<ChannelReader> new(io:ReadableByteChannel byteChannel)
Parameter Name Data Type Default Value Description byteChannel io:ReadableByteChannel -
<ChannelReader> readBoolean() returns (boolean)
Return Type Description boolean -
<ChannelReader> readInt8() returns (int)
Return Type Description int -
<ChannelReader> readInt32() returns (int)
Return Type Description int -
<ChannelReader> readInt64() returns (int)
Return Type Description int -
<ChannelReader> readString() returns (string)
Return Type Description string -
<ChannelReader> readByteArray(int len) returns (byte[])
Parameter Name Data Type Default Value Description len int Return Type Description byte[]
public type ConstPoolParser object
-
<ConstPoolParser> new(bir:ChannelReader reader)
Parameter Name Data Type Default Value Description reader bir:ChannelReader -
<ConstPoolParser> parse() returns (ConstPool)
Return Type Description ConstPool -
<ConstPoolParser> parseConstPoolEntry()
public type ConstantLoad object
Field Name | Data Type | Default Value | Description |
---|---|---|---|
kind | ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH | ||
lhsOp | bir:VarRef | ||
typeValue | int|boolean|() | ||
value | int |
-
<ConstantLoad> new(ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH kind, bir:VarRef lhsOp, int|boolean|() typeValue, int value)
Parameter Name Data Type Default Value Description kind ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH lhsOp bir:VarRef typeValue int|boolean|() value int
public type FuncBodyParser object
-
<FuncBodyParser> new(bir:BirChannelReader reader, map<bir:VariableDcl> localVarMap)
Parameter Name Data Type Default Value Description reader bir:BirChannelReader localVarMap map -
<FuncBodyParser> parseBB() returns (BasicBlock)
Return Type Description BasicBlock -
<FuncBodyParser> parseInstruction() returns (Instruction)
Return Type Description Instruction -
<FuncBodyParser> parseTerminator() returns (Terminator)
Return Type Description Terminator -
<FuncBodyParser> parseVarRef() returns (VarRef)
Return Type Description VarRef -
<FuncBodyParser> parseBBRef() returns (BasicBlock)
Return Type Description BasicBlock -
<FuncBodyParser> parseBinaryOpInstruction(int kindTag) returns (BinaryOp)
Parameter Name Data Type Default Value Description kindTag int Return Type Description BinaryOp
public type GOTO object
Field Name | Data Type | Default Value | Description |
---|---|---|---|
kind | ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH | ||
targetBB | bir:BasicBlock |
-
<GOTO> new(ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH kind, bir:BasicBlock targetBB)
Parameter Name Data Type Default Value Description kind ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH targetBB bir:BasicBlock
public type Move object
Field Name | Data Type | Default Value | Description |
---|---|---|---|
kind | ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH | ||
lhsOp | bir:VarRef | ||
rhsOp | bir:VarRef |
-
<Move> new(ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH kind, bir:VarRef lhsOp, bir:VarRef rhsOp)
Parameter Name Data Type Default Value Description kind ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH lhsOp bir:VarRef rhsOp bir:VarRef
public type PackageParser object
-
<PackageParser> new(bir:BirChannelReader reader)
Parameter Name Data Type Default Value Description reader bir:BirChannelReader -
<PackageParser> parseVariableDcl() returns (VariableDcl)
Return Type Description VariableDcl -
<PackageParser> parseFunction() returns (Function)
Return Type Description Function -
<PackageParser> parsePackage() returns (Package)
Return Type Description Package -
<PackageParser> parseVisibility() returns (Visibility)
Return Type Description Visibility -
<PackageParser> parseVarKind() returns (VarKind)
Return Type Description VarKind -
<PackageParser> parseSig(string sig) returns (BInvokableType)
Parameter Name Data Type Default Value Description sig string Return Type Description BInvokableType
public type Return object
Field Name | Data Type | Default Value | Description |
---|---|---|---|
kind | ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH |
-
<Return> new(ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH kind)
Parameter Name Data Type Default Value Description kind ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|EQUAL">GREATER_EQUAL|LESS_THAN|LESS_EQUAL|CONST_LOAD|RETURN|GOTO|MOVE|CALL|BRANCH
public type VarRef object
Field Name | Data Type | Default Value | Description |
---|---|---|---|
kind | VAR_REF|CONST | ||
typeValue | int|boolean|() | ||
variableDcl | bir:VariableDcl |
-
<VarRef> new(VAR_REF|CONST kind, int|boolean|() typeValue, bir:VariableDcl variableDcl)
Parameter Name Data Type Default Value Description kind VAR_REF|CONST typeValue int|boolean|() variableDcl bir:VariableDcl