compiler

package
v0.0.0-...-8bb7ff2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package compiler is the package which is actually responsible for reading the user-program and generating the binary result.

Internally this uses the parser, as you would expect

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

type Compiler struct {
	// contains filtered or unexported fields
}

Compiler holds our state

func New

func New(src string) *Compiler

New creates a new instance of the compiler

func (*Compiler) Compile

func (c *Compiler) Compile() error

Compile walks over the parser-generated AST and assembles the source program.

Once the program has been completed an ELF executable will be produced

func (*Compiler) SetOutput

func (c *Compiler) SetOutput(path string)

SetOutput sets the path to the executable we create.

If no output has been specified we default to `./a.out`.

Jump to

Keyboard shortcuts

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