monkey-lang: github.com/prologic/monkey-lang/code Index | Files

package code

import "github.com/prologic/monkey-lang/code"

Index

Package Files

code.go

func Make Uses

func Make(op Opcode, operands ...int) []byte

func ReadOperands Uses

func ReadOperands(def *Definition, ins Instructions) ([]int, int)

func ReadUint16 Uses

func ReadUint16(ins Instructions) uint16

func ReadUint8 Uses

func ReadUint8(ins Instructions) uint8

type Definition Uses

type Definition struct {
    Name          string
    OperandWidths []int
}

func Lookup Uses

func Lookup(op byte) (*Definition, error)

type Instructions Uses

type Instructions []byte

func (Instructions) String Uses

func (ins Instructions) String() string

type Opcode Uses

type Opcode byte
const (
    LoadConstant Opcode = iota
    LoadBuiltin
    // AssignGlobal ...
    AssignGlobal
    // AssignLocal ...
    AssignLocal
    LoadGlobal
    BindGlobal
    LoadLocal
    BindLocal
    LoadFree
    LoadModule
    SetSelf
    LoadTrue
    LoadFalse
    LoadNull
    GetItem
    SetItem
    MakeArray
    MakeHash
    MakeClosure
    Pop
    // Noop ...
    Noop
    Add
    Sub
    Mul
    Div
    Mod
    Or
    And
    Not
    BitwiseOR
    BitwiseXOR
    BitwiseAND
    BitwiseNOT
    LeftShift
    RightShift
    Equal
    NotEqual
    GreaterThan
    // GreaterThanEqual ...
    GreaterThanEqual
    Minus
    JumpIfFalse
    Jump
    Call
    Return
    ReturnValue
)

func (Opcode) String Uses

func (o Opcode) String() string

Package code imports 3 packages (graph) and is imported by 3 packages. Updated 2019-04-03. Refresh now. Tools for package owners.