lapc

package
v0.0.0-...-9dcd13a Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBackend

func NewBackend() *gen.Backend

NewBackend returns lapc compiler backend.

func Simplify

func Simplify(form sexp.Form) sexp.Form

Simplify translates semantic-rich forms into more generic and fundamental forms. For example, it converts DoTimes to While.

It is necessary to call Simplify before compiling forms into IR because compiler does not recognize some high level constructs.

Types

type InstrCall

type InstrCall struct {
	Instr ir.Instr
	Args  []sexp.Form
}

InstrCall is optimized version of Call/Op. Used when there is dedicated opcode available.

func (*InstrCall) Copy

func (call *InstrCall) Copy() sexp.Form

func (*InstrCall) Cost

func (call *InstrCall) Cost() int

func (*InstrCall) Type

func (call *InstrCall) Type() types.Type

type Object

type Object struct {
	StackUsage int
	Code       []byte
	ConstVec   *dt.ConstPool
}

Object is a compiled IR unit.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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