class

StackMachine::Builder

Inherits Reference < Object

Helper class to build stack vm bytecode Class is only available through StackMachine.build method

Constructors

new

Create a builder with an empty set of instructions

Source

Instance methods

build

Return the built instructions

Source
op_add

Opcode helper method for adding an add instruction

Source
op_div

Opcode helper method for adding a div instruction

Source
op_eq

Opcode helper method for adding a eq instruction

Source
op_ge

Opcode helper method for adding a ge instruction

Source
op_gt

Opcode helper method for adding a gt instruction

Source
op_jmpf(x : Int32 | Symbol)

Opcode helper method for creating a jmpf instruction

Source
op_jmpf_backward(x : Int32)

Opcode helper method for creating a jmpf_backward instruction

Source
op_jmpf_forward(x : Int32)

Opcode helper method for creating a jmpf_forward instruction

Source
op_jmpt(x : Int32 | Symbol)

Opcode helper method for creating a jmpt instruction

Source
op_jmpt_backward(x : Int32)

Opcode helper method for creating a jmpt_backward instruction

Source
op_jmpt_forward(x : Int32)

Opcode helper method for creating a jmpt_forward instruction

Source
op_jump(x : Int32 | Symbol)

Opcode helper method for creating a jump instruction

Source
op_jump_backward(x : Int32)

Opcode helper method for creating a jump_backward instruction

Source
op_jump_forward(x : Int32)

Opcode helper method for creating a jump_forward instruction

Source
op_label(x : Symbol)

Opcode helper method for creating a label instruction

Source
op_le

Opcode helper method for adding a le instruction

Source
op_load(x : Int32)

Opcode helper method for creating a load instruction

Source
op_lt

Opcode helper method for adding a lt instruction

Source
op_mul

Opcode helper method for adding a mul instruction

Source
op_ne

Opcode helper method for adding a ne instruction

Source
op_num(n : Int32)

Opcode helper method for adding an integer instruction

Source
op_store(x : Int32)

Opcode helper method for creating a store instruction

Source
op_sub

Opcode helper method for adding a sub instruction

Source