base

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class struct {
	Type     string              // Class type (string representation)
	Methods  map[string]Function // Function list
	ByteCode *bytecode.ByteCode  // Bytecode pointer
}

Weblang class represantation in VM

type Function

type Function struct {
	Args        map[string]interface{} // arguments list
	Handler     FunctionHandler        // FunctionHandler interface for function invoke
	ClassMethod *method.ClassMethod    // ClassMethod struct from bytecode file
}

Web function representation in VM

type FunctionHandler added in v0.2.2

type FunctionHandler interface {
	Invoke(args map[string]interface{}, funcPtr *Function, callerObj *Object, receiverObj *Object) error // Invoke function execution
}

User defined function handler

type MemoryMap added in v0.4.1

type MemoryMap struct {
	Classes map[string]Class  // Class list
	Objects map[string]Object // All objects list
}

Memory of all declared classes in VM

type Object added in v0.3.0

type Object struct {
	Scope      uint                   // Object scope, 0 - global, 1 and larger - local
	Class      *Class                 // pointer to class struct
	Attributes map[string]interface{} // Attributes list
	Memory     *MemoryMap             // list of all declared global classes & objects in VM environment
}

Object struct in VM environment

Jump to

Keyboard shortcuts

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