compiler

package
v0.0.0-...-5655933 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

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
}

func New

func New(options ...Option) (*Compiler, error)

func (*Compiler) Compile

func (c *Compiler) Compile(name string, input io.Reader) (obj *code.Object, err error)

Compile compiles a program from the input into bytecode and data stored in an Object, or a list of compile errors.

func (*Compiler) SetOption

func (c *Compiler) SetOption(options ...Option) error

type Option

type Option func(*Compiler) error

Option configures a new Compiler.

func DisableOptimisation

func DisableOptimisation() Option

DisableOptimisation disables the optimisation phase.

func EmitAst

func EmitAst() Option

EmitAst emits the AST after the parse phase.

func EmitAstTypes

func EmitAstTypes() Option

EmitAstTypes emits the AST with types after the type checking phase.

func MaxRecursionDepth

func MaxRecursionDepth(maxRecursionDepth int) Option

MaxRecursionDepth sets the maximum allowable depth of the AST.

func MaxRegexpLength

func MaxRegexpLength(maxRegexpLength int) Option

MaxRegexpLength sets the maximum allowable length of a regular expression.

Directories

Path Synopsis
package opt has a compiler pass for making optimisations on the AST.
package opt has a compiler pass for making optimisations on the AST.
Package parser implements the parse phase of the mtail program compilation.
Package parser implements the parse phase of the mtail program compilation.
Package position implements a data structure for storing source code positions.
Package position implements a data structure for storing source code positions.

Jump to

Keyboard shortcuts

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