CompiledNodeBuilder

class CompiledNodeBuilder(parent: CompiledSourceBuilder, nodeId: Int)

Types

Companion
Link copied to clipboard
object Companion

Functions

arrayInsertInsn
Link copied to clipboard
fun arrayInsertInsn()

Pushes a value into the array.

assignInsn
Link copied to clipboard
fun assignInsn(name: String)

Assigns a value to a variable.

binaryOperationInsn
Link copied to clipboard
fun binaryOperationInsn(operator: BinaryOperationType)
branchIfFalseInsn
Link copied to clipboard
fun branchIfFalseInsn(labelCode: Int)

Branches to the label if the top value of the stack is false (according to the truth rules).

branchIfTrueInsn
Link copied to clipboard
fun branchIfTrueInsn(labelCode: Int)

Branches to the label if the top value of the stack is true (according to the truth rules).

breakInsn
Link copied to clipboard
fun breakInsn()

Breaks a loop.

build
Link copied to clipboard
fun build(): CompiledNode
continueInsn
Link copied to clipboard
fun continueInsn()

Continues a loop.

declareVariableInsn
Link copied to clipboard
fun declareVariableInsn(name: String, mutable: Boolean)
dupInsn
Link copied to clipboard
fun dupInsn()
getMemberPropertyInsn
Link copied to clipboard
fun getMemberPropertyInsn(name: String)
getSubscriptInsn
Link copied to clipboard
fun getSubscriptInsn(size: Int)
getVariableInsn
Link copied to clipboard
fun getVariableInsn(name: String)

Loads a variable from the scope into the stack.

invokeInsn
Link copied to clipboard
fun invokeInsn(size: Int)

Invokes a function on the stack with arguments.

invokeLocalInsn
Link copied to clipboard
fun invokeLocalInsn(name: String, size: Int)

Loads a function from the scope and invokes it with arguments.

invokeMemberInsn
Link copied to clipboard
fun invokeMemberInsn(name: String, size: Int)

Invokes a member function from an object on the stack with arguments.

jumpInsn
Link copied to clipboard
fun jumpInsn(labelCode: Int)

Jumps to the label specified.

markLabel
Link copied to clipboard
fun markLabel(code: Int)

Marks a label.

markSection
Link copied to clipboard
inline fun markSection(sectional: Sectional, block: () -> Unit)
inline fun markSection(sectionId: Int, block: () -> Unit)
markSectionEnd
Link copied to clipboard
fun markSectionEnd()
markSectionStart
Link copied to clipboard
fun markSectionStart(section: Section)
fun markSectionStart(sectionId: Int)
newArrayInsn
Link copied to clipboard
fun newArrayInsn()

Creates an array.

newFunctionInsn
Link copied to clipboard
fun newFunctionInsn(parameters: List<CompiledParameter>, name: String?, bodyId: Int)
newObjectInsn
Link copied to clipboard
fun newObjectInsn()

Creates an object.

nextLabel
Link copied to clipboard
fun nextLabel(): Int
objectInsertInsn
Link copied to clipboard
fun objectInsertInsn()

Pushes an entry into the object.

popExceptionHandlingInsn
Link copied to clipboard
fun popExceptionHandlingInsn()
popInsn
Link copied to clipboard
fun popInsn()
popLoopHandlingInsn
Link copied to clipboard
fun popLoopHandlingInsn()
popScopeInsn
Link copied to clipboard
fun popScopeInsn()
pushBooleanInsn
Link copied to clipboard
fun pushBooleanInsn(value: Boolean)

Pushes a boolean into the stack.

pushDecimalInsn
Link copied to clipboard
fun pushDecimalInsn(value: Double)

Pushes a double into the stack.

pushExceptionHandlingInsn
Link copied to clipboard
fun pushExceptionHandlingInsn(catchLabel: Int, endLabel: Int)
pushIntegerInsn
Link copied to clipboard
fun pushIntegerInsn(value: Long)

Pushes a long into the stack.

pushLoopHandlingInsn
Link copied to clipboard
fun pushLoopHandlingInsn(continueLabel: Int, breakLabel: Int)
pushNullInsn
Link copied to clipboard
fun pushNullInsn()

Pushes null into the stack.

pushScopeInsn
Link copied to clipboard
fun pushScopeInsn()
pushStringInsn
Link copied to clipboard
fun pushStringInsn(value: String)

Pushes a string into the stack.

pushThisInsn
Link copied to clipboard
fun pushThisInsn()

Pushes this into the stack.

returnInsn
Link copied to clipboard
fun returnInsn()

Returns the value on the top of the stack.

setMemberPropertyInsn
Link copied to clipboard
fun setMemberPropertyInsn(name: String)
setSubscriptInsn
Link copied to clipboard
fun setSubscriptInsn(size: Int)
setVariableInsn
Link copied to clipboard
fun setVariableInsn(name: String)
throwInsn
Link copied to clipboard
fun throwInsn()

Throws the object from the top of the stack.

typeofInsn
Link copied to clipboard
fun typeofInsn()

Pushes a string representing the type of the value on the top of the stack.

unaryOperationInsn
Link copied to clipboard
fun unaryOperationInsn(operator: UnaryOperationType)
withExceptionHandling
Link copied to clipboard
inline fun withExceptionHandling(catchLabel: Int, endLabel: Int, block: () -> Unit)

Automatically pushes/pops the required exception handlers.

withLoopHandling
Link copied to clipboard
inline fun withLoopHandling(continueLabel: Int, breakLabel: Int, block: () -> Unit)

Automatically pushes/pops the required loop handlers.

withScope
Link copied to clipboard
inline fun withScope(block: () -> Unit)

Automatically pushes/pops the required scope instructions.

Properties

nodeId
Link copied to clipboard
val nodeId: Int