compiler

package
v0.0.0-...-fe244b6 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MEM_SIZE int = 30000

Variables

This section is empty.

Functions

func CompileCCode

func CompileCCode(filename string) (string, error)

func Execute

func Execute(code, filename string, debug bool)

Execute executes the given code with the specified filename.

func GenerateCCode

func GenerateCCode(source []byte) (string, error)

func GetCCode

func GetCCode(source []byte) bytes.Buffer

func NewGlobalPointer

func NewGlobalPointer() *int

NewGlobalPointer creates a new instance of a global pointer.

func NewGlobalRegister

func NewGlobalRegister() *int

NewGlobalRegister creates a new instance of a global register.

func RunCCode

func RunCCode(filename string) error

Types

type GlobalMemory

type GlobalMemory struct {
	Memory []int
}

GlobalMemory represents the global memory in the program.

func NewGlobalMemory

func NewGlobalMemory() *GlobalMemory

NewGlobalMemory creates a new instance of GlobalMemory.

type GlobalVariables

type GlobalVariables struct {
	Variables map[string]MemoryVariable
}

GlobalVariables represents the global variables in the program.

func NewGlobalVariables

func NewGlobalVariables() *GlobalVariables

NewGlobalVariables creates a new instance of GlobalVariables.

type MemoryVariable

type MemoryVariable struct {
	Start  int
	Length int
}

MemoryVariable represents a memory variable with a start index and length.

Jump to

Keyboard shortcuts

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