compiler

package
v0.0.0-...-6ec744d Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytecode

type Bytecode struct {
	Instructions code.Instructions
	Constants    []object.Object
}

Bytecode stores the compiled bytecode emitted by the compiler

type Compiler

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

Compiler walks the AST and compiles it into bytecode

func New

func New() *Compiler

New returns a new compiler struct

func (*Compiler) Bytecode

func (c *Compiler) Bytecode() *Bytecode

Bytecode returns the compiled bytecode from the compiler

func (*Compiler) Compile

func (c *Compiler) Compile(node ast.Node) error

Compile is the main compiler function and does all the heavy lifting

Jump to

Keyboard shortcuts

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