bytecode

package
v0.2.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ByteCodeVersion uint16 = 0x0001

Constant for current Weblang bytecode version

Variables

This section is empty.

Functions

This section is empty.

Types

type ClassHeader

type ClassHeader struct {
	FileFormatText      [8]byte // First 8 bytes of file. It's contains "WEBLANG\x0f"
	ByteCodeVersion     uint16  // Version of bytecode file
	InstructionSetCount uint64  // Count of InstructionSet struct
	ClassMethodsCount   uint64  // Count of ClassMethodHeader struct
}

Header struct for Weblang bytecode class file

func (*ClassHeader) WriteHeader

func (header *ClassHeader) WriteHeader()

Write header data to struct. Use to prepare for write header struct to file

type ClassMethodHeader

type ClassMethodHeader struct {
	ClassName                [80]byte // Class name
	InstructionSetStartIndex uint64   // Index of first InstructionSet block
	InstructionSetEndIndex   uint64   // Index of last InstructionSet block
}

Header struct for classMethod declaration in Weblang bytecode file

type InstructionSet

type InstructionSet struct {
	Index    uint64    // Index number
	Type     uint16    // InstructionSet type
	ByteCode [255]byte //  Array of 255 bytes
}

255 bytes Instruction block for Weblang VM

Jump to

Keyboard shortcuts

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