codegen

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecType     byte = 1
	SecFunction byte = 3
	SecExport   byte = 7
	SecCode     byte = 10
)
View Source
const (
	OpCodeEnd    byte = 0x0B
	OpCodeReturn byte = 0x0F

	OpCodeLocalGet byte = 0x20
	OpCodeLocalSet byte = 0x21

	OpCodeI32Const          byte = 0x41
	OpCodeI32Add            byte = 0x6A
	OpCodeI32Sub            byte = 0x6B
	OpCodeI32Mul            byte = 0x6C
	OpCodeI32SignedDivision byte = 0x6D
	OpCodeI32And            byte = 0x71

	OpCodeF32Const    byte = 0x43
	OpCodeF32Neg      byte = 0x8C
	OpCodeF32Add      byte = 0x92
	OpCodeF32Sub      byte = 0x93
	OpCodeF32Mul      byte = 0x94
	OpCodeF32Division byte = 0x95
)

Variables

This section is empty.

Functions

This section is empty.

Types

type WASMModule

type WASMModule struct {
	// contains filtered or unexported fields
}

func NewModule

func NewModule(program parser.Program) *WASMModule

func (*WASMModule) Generate

func (m *WASMModule) Generate() error

func (*WASMModule) Save

func (m *WASMModule) Save(filename string) error

Jump to

Keyboard shortcuts

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