compile

package
v0.0.0-...-94861f8 Latest Latest
Warning

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

Go to latest
Published: May 3, 2017 License: BSD-3-Clause, Unlicense Imports: 10 Imported by: 0

Documentation

Overview

Package compile provides an interface for compiling a type checked parse tree into native code. It is a stack machine with a simple queuing mechanism to avoid reloading registers. It uses an accumulator described in the SubC compiler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(conf Config, prog *ast.Prog, info *types.Info) error

Compile compiles a AST tree down to native machine code. It assumes a correct AST and valid typed check structure for the AST.

Types

type Config

type Config struct {
	Emitter   *arch.Emitter // the code emitter for the compiler, needed for generating code for an architecture
	MaxErrors int           // max number of errors before bailing out
}

Config provide options for how the compiler will act when compiling.

Directories

Path Synopsis
amd64
Package amd64 contains a code emitter for generating code for the x86_64 architecture.
Package amd64 contains a code emitter for generating code for the x86_64 architecture.
arm6
Package arm6 contains a code emitter to generate code for the ARMv6 architecture.
Package arm6 contains a code emitter to generate code for the ARMv6 architecture.
darwinamd64
Package darwinamd64 contains code to generate a x86_64 architecture that is running on darwin.
Package darwinamd64 contains code to generate a x86_64 architecture that is running on darwin.
i386
Package i386 contains code to generate code for the x86 architecture.
Package i386 contains code to generate code for the x86 architecture.

Jump to

Keyboard shortcuts

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