backend

package
v0.0.0-...-90e8e0c Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateBinary

func GenerateBinary(be Backend, top *sema.Package, deps ...*sema.Package) error

func GeneratePackage

func GeneratePackage(be Backend, name, tag string, sem *sema.Sema) (*sema.Package, error)

func Init

func Init(be Backend, options Options) error

Types

type Backend

type Backend interface {
	String() string
	Init(options Options)
	Options() Options
	// BuildPkg builds a single package uniquely identified by its `name`.
	// Any dependency is assumed to be compiled at some point.
	BuildPkg(pkg_name, pkg_tag string, sem *sema.Sema) (*sema.Package, error)
	// BuildBin combines all the built packages into a binary file.
	BuildBin(top *sema.Package, deps ...*sema.Package) error
}

type Options

type Options struct {
	// Output file name.
	Out string
	// Entry is the code entry point.
	Entry string
	// KeepComments when generating the intermediate files, if any.
	KeepComments bool
	// WithLocation adds every statement location to the intermediate file.
	WithLocation bool
	CacheDir     string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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