compiler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPkg

func NewPkg(name string) *pkg

Types

type Compiler

type Compiler struct {

	// runtime.GOOS and runtime.GOARCH
	GOOS, GOARCH string
	// contains filtered or unexported fields
}

func NewCompiler

func NewCompiler(options *Options) *Compiler

func (*Compiler) Compile

func (c *Compiler) Compile(root parser.PackageNode) (err error)

func (*Compiler) GetIR

func (c *Compiler) GetIR() string

func (*Compiler) IsPackageImported

func (c *Compiler) IsPackageImported(name string) bool

type OSFuncs

type OSFuncs struct {
	Printf  value.Value
	Malloc  value.Value
	Realloc value.Value
	Memcpy  value.Value
	Strcat  value.Value
	Strcpy  value.Value
	Strncpy value.Value
	Strndup value.Value
	Exit    value.Value
}

OSFuncs and the "os" package contains a mapping to glibc functions. These are used to make bootstrapping of the language easier. The end goal is to not depend on glibc.

type Options

type Options struct {
	Target string
}

type Panic

type Panic string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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