class StackMachine::Builder
- StackMachine::Builder
- Reference
- Object
Overview
Helper class to build stack vm bytecode
Class is only available through StackMachine.build method
Defined in:
stackmachine/builder.crstackmachine/opcode.cr:28
stackmachine/opcode.cr:29
stackmachine/opcode.cr:31
stackmachine/opcode.cr:33
stackmachine/opcode.cr:34
stackmachine/opcode.cr:35
stackmachine/opcode.cr:37
stackmachine/opcode.cr:38
stackmachine/opcode.cr:39
stackmachine/opcode.cr:41
stackmachine/opcode.cr:42
stackmachine/opcode.cr:43
Constructors
-
.new
Create a builder with an empty set of instructions
Instance Method Summary
-
#build : Array(Bytecode)
Return the built instructions
-
#op_add
Opcode helper method for adding an add instruction
-
#op_div
Opcode helper method for adding a div instruction
-
#op_eq
Opcode helper method for adding a eq instruction
-
#op_ge
Opcode helper method for adding a ge instruction
-
#op_gt
Opcode helper method for adding a gt instruction
-
#op_jmpf(x : Int32 | Symbol)
Opcode helper method for creating a jmpf instruction
-
#op_jmpf_backward(x : Int32)
Opcode helper method for creating a jmpf_backward instruction
-
#op_jmpf_forward(x : Int32)
Opcode helper method for creating a jmpf_forward instruction
-
#op_jmpt(x : Int32 | Symbol)
Opcode helper method for creating a jmpt instruction
-
#op_jmpt_backward(x : Int32)
Opcode helper method for creating a jmpt_backward instruction
-
#op_jmpt_forward(x : Int32)
Opcode helper method for creating a jmpt_forward instruction
-
#op_jump(x : Int32 | Symbol)
Opcode helper method for creating a jump instruction
-
#op_jump_backward(x : Int32)
Opcode helper method for creating a jump_backward instruction
-
#op_jump_forward(x : Int32)
Opcode helper method for creating a jump_forward instruction
-
#op_label(x : Symbol)
Opcode helper method for creating a label instruction
-
#op_le
Opcode helper method for adding a le instruction
-
#op_load(x : Int32)
Opcode helper method for creating a load instruction
-
#op_lt
Opcode helper method for adding a lt instruction
-
#op_mul
Opcode helper method for adding a mul instruction
-
#op_ne
Opcode helper method for adding a ne instruction
-
#op_num(n : Int32)
Opcode helper method for adding an integer instruction
-
#op_store(x : Int32)
Opcode helper method for creating a store instruction
-
#op_sub
Opcode helper method for adding a sub instruction