compiler

package
v0.0.0-...-f82d28d Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Generates go code

Index

Constants

View Source
const ERROR_THRESHOLD = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type Codegen

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

func NewCodegen

func NewCodegen(pack ast.GoPackage) *Codegen

func (*Codegen) Run

func (c *Codegen) Run() string

type CollectedVar

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

type Compiler

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

func NewCompiler

func NewCompiler(sources []string, opts Options) *Compiler

func (*Compiler) Compile

func (*Compiler) Errors

func (c *Compiler) Errors() []data.CompilerProblem

func (*Compiler) Modules

func (c *Compiler) Modules() map[string]typechecker.FullModuleEnv

func (*Compiler) Run

func (c *Compiler) Run(output string, dryRun bool) []data.CompilerProblem

type Desugar

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

func NewDesugar

func NewDesugar(smod ast.SModule, tc *tc.Typechecker) *Desugar

func (*Desugar) Desugar

func (d *Desugar) Desugar() (ast.Module, error)

If error != nil a fatal error ocurred. Call Errors to get all errors.

func (*Desugar) Errors

func (d *Desugar) Errors() []data.CompilerProblem

type Environment

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

The environment where a full compilation process takes place.

func NewEnviroment

func NewEnviroment(opts Options) *Environment

func (*Environment) GenerateCode

func (env *Environment) GenerateCode(output string, dryRun bool)

Optimize the AST and generate go code

func (*Environment) ParseSources

func (env *Environment) ParseSources(srcs []Source) (map[string]tc.FullModuleEnv, []data.CompilerProblem)

type Optimizer

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

Generates go ast

func NewOptimizer

func NewOptimizer(mod ast.Module) *Optimizer

func (*Optimizer) Convert

func (o *Optimizer) Convert() ast.GoPackage

type Options

type Options struct {
	Verbose bool
	DevMode bool
	Stdlib  bool
}

type Source

type Source struct {
	Path string
	Str  string
}

func (Source) WithReader

func (s Source) WithReader(action func(io.Reader))

Directories

Path Synopsis
This file contains the initial parsed AST before desugaring and type checking
This file contains the initial parsed AST before desugaring and type checking

Jump to

Keyboard shortcuts

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