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 | false | |
| documentationValue | bir:DocAttachment | {} | |
| flags | int | 0 | |
| kind | PACKAGE|STRUCT|OBJECT|RECORD|ENUM|CONNECTOR|ACTION|SERVICE|RESOURCE|FUNCTION|WORKER|ANNOTATION|ANNOTATION_ATTRIBUTE|CONSTANT|PACKAGE_VARIABLE|TRANSFORMER|TYPE_DEF|PARAMETER|LOCAL_VARIABLE|SERVICE_VARIABLE|CONNECTOR_VARIABLE|CAST_OPERATOR|CONVERSION_OPERATOR|XMLNS|SCOPE|OTHER | OTHER | |
| name | bir:Name | {} | |
| pkgID | bir:PackageID | {} | |
| tag | int | 0 | |
| tainted | boolean | false | |
| typeValue | int|boolean|() | () |
public type BTypeSymbol record
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| closure | boolean | false | |
| documentationValue | bir:DocAttachment | {} | |
| flags | int | 0 | |
| isLabel | boolean | false | |
| kind | PACKAGE|STRUCT|OBJECT|RECORD|ENUM|CONNECTOR|ACTION|SERVICE|RESOURCE|FUNCTION|WORKER|ANNOTATION|ANNOTATION_ATTRIBUTE|CONSTANT|PACKAGE_VARIABLE|TRANSFORMER|TYPE_DEF|PARAMETER|LOCAL_VARIABLE|SERVICE_VARIABLE|CONNECTOR_VARIABLE|CAST_OPERATOR|CONVERSION_OPERATOR|XMLNS|SCOPE|OTHER | OTHER | |
| name | bir:Name | {} | |
| pkgID | bir:PackageID | {} | |
| scopeValue | bir:Scope | {} | |
| tag | int | 0 | |
| tainted | boolean | false | |
| 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 | BLangTypeInit: new Return ([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 | RETURN|PARAM|RECEIVER|FIELD|VARIABLE|ENDPOINT | ||
| name | string |
public type Function record
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| argsCount | int | 0 | |
| basicBlocks | bir:BasicBlock[] | [] | |
| isDeclaration | boolean | false | |
| localVars | bir:VariableDcl[] | [] | |
| name | bir:Name | {} | |
| typeValue | bir:BInvokableType | {} | |
| visibility | PACKAGE_PRIVATE|PRIVATE|PUBLIC | PACKAGE_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|LOCAL|TEMP|RETURN | 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> __init(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> __init(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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD | ||
| op | bir:VarRef | ||
| trueBB | bir:BasicBlock |
-
<Branch> __init(bir:BasicBlock falseBB, ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD 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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD 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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD | ||
| lhsOp | bir:VarRef? | ||
| name | bir:Name | ||
| thenBB | bir:BasicBlock |
-
<Call> __init(bir:VarRef[] args, ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD 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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD lhsOp bir:VarRef? name bir:Name thenBB bir:BasicBlock
public type ChannelReader object
-
<ChannelReader> __init(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> __init(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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD | ||
| lhsOp | bir:VarRef | ||
| typeValue | int|boolean|() | ||
| value | int |
-
<ConstantLoad> __init(ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD 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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD lhsOp bir:VarRef typeValue int|boolean|() value int
public type FuncBodyParser object
-
<FuncBodyParser> __init(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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD | ||
| targetBB | bir:BasicBlock |
-
<GOTO> __init(ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD 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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD 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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD | ||
| lhsOp | bir:VarRef | ||
| rhsOp | bir:VarRef |
-
<Move> __init(ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD 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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD lhsOp bir:VarRef rhsOp bir:VarRef
public type PackageParser object
-
<PackageParser> __init(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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD |
-
<Return> __init(ADD|SUB|MUL|DIV|EQUAL|NOT_EQUAL|GREATER_THAN|GREATER_EQUAL|LESS_THAN|LESS_EQUAL|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD 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|GOTO|CALL|BRANCH|RETURN|MOVE|CONST_LOAD
public type VarRef object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| kind | VAR_REF|CONST | ||
| typeValue | int|boolean|() | ||
| variableDcl | bir:VariableDcl |
-
<VarRef> __init(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