vm

package
v0.0.0-...-1de4a8b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExternalFunc

type ExternalFunc struct {
	ArgCount    int
	ArgValidate bool
	Fn          func(lexer.TokenContext, ...parser.Value) error
}

type VM

type VM struct {
	Memory    []int64
	Variables map[string]int64
	Funcs     map[string]ExternalFunc
	// contains filtered or unexported fields
}

func New

func New(memsize int) *VM

func (*VM) RegisterFunc

func (vm *VM) RegisterFunc(name string, argCount int, argValidate bool, fn func(lexer.TokenContext, ...parser.Value) error)

func (*VM) Run

func (vm *VM) Run(program *parser.Program) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL