Documentation
¶
Overview ¶
Weblang VM environment base struct types such as Function, MmemoryMap, Class and Object.
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
AttributesType map[string]uint8 // Attributes type list
Memory *MemoryMap // list of all declared global classes & objects in VM environment
}
Object struct in VM environment
Click to show internal directories.
Click to hide internal directories.