class StackMachine::Builder

Overview

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

Defined in:

stackmachine/builder.cr
stackmachine/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

Instance Method Summary

Constructor Detail

def self.new #

Create a builder with an empty set of instructions


[View source]

Instance Method Detail

def build : Array(Bytecode) #

Return the built instructions


[View source]
def op_add #

Opcode helper method for adding an add instruction


[View source]
def op_div #

Opcode helper method for adding a div instruction


[View source]
def op_eq #

Opcode helper method for adding a eq instruction


[View source]
def op_ge #

Opcode helper method for adding a ge instruction


[View source]
def op_gt #

Opcode helper method for adding a gt instruction


[View source]
def op_jmpf(x : Int32 | Symbol) #

Opcode helper method for creating a jmpf instruction


[View source]
def op_jmpf_backward(x : Int32) #

Opcode helper method for creating a jmpf_backward instruction


[View source]
def op_jmpf_forward(x : Int32) #

Opcode helper method for creating a jmpf_forward instruction


[View source]
def op_jmpt(x : Int32 | Symbol) #

Opcode helper method for creating a jmpt instruction


[View source]
def op_jmpt_backward(x : Int32) #

Opcode helper method for creating a jmpt_backward instruction


[View source]
def op_jmpt_forward(x : Int32) #

Opcode helper method for creating a jmpt_forward instruction


[View source]
def op_jump(x : Int32 | Symbol) #

Opcode helper method for creating a jump instruction


[View source]
def op_jump_backward(x : Int32) #

Opcode helper method for creating a jump_backward instruction


[View source]
def op_jump_forward(x : Int32) #

Opcode helper method for creating a jump_forward instruction


[View source]
def op_label(x : Symbol) #

Opcode helper method for creating a label instruction


[View source]
def op_le #

Opcode helper method for adding a le instruction


[View source]
def op_load(x : Int32) #

Opcode helper method for creating a load instruction


[View source]
def op_lt #

Opcode helper method for adding a lt instruction


[View source]
def op_mul #

Opcode helper method for adding a mul instruction


[View source]
def op_ne #

Opcode helper method for adding a ne instruction


[View source]
def op_num(n : Int32) #

Opcode helper method for adding an integer instruction


[View source]
def op_store(x : Int32) #

Opcode helper method for creating a store instruction


[View source]
def op_sub #

Opcode helper method for adding a sub instruction


[View source]