compiler

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package compiler translates syntax trees into bytecode for the stack machine. It resolves names (locals, parameters, temporaries, captured variables, members, then top-level names), checks the language's rules (the "Rule:" comments of syntax.ebnf), evaluates constants and generates the code of every function, member function and function literal, together with the prelude that defines class Error.

Index

Constants

View Source
const PreludeName = "<prelude>"

PreludeName is the file name of the prelude in positions and traces.

Variables

This section is empty.

Functions

func Compile

func Compile(files []*ast.File, builtins []string) (prog *bytecode.Program, err error)

Compile compiles the files of one program, in order. builtins lists the names of the built-in functions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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