compiler

package
v0.0.0-...-baef74e Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2018 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicCompiler

type BasicCompiler struct{}

BasicCompiler is the default compiler used by Xslate

func New

func New() *BasicCompiler

New creates a new BasicCompiler instance

func (*BasicCompiler) Compile

func (c *BasicCompiler) Compile(ast *parser.AST) (*vm.ByteCode, error)

Compile satisfies the compiler.Compiler interface. It accepts an AST created by parser.Parser, and returns vm.ByteCode or an error

type Compiler

type Compiler interface {
	Compile(*parser.AST) (*vm.ByteCode, error)
}

Compiler is the interface to objects that can convert AST trees to actual Xslate Virtual Machine bytecode (see vm.ByteCode)

type NaiveOptimizer

type NaiveOptimizer struct{}

NaiveOptimizer is the default ByteCode optimizer

func (*NaiveOptimizer) Optimize

func (o *NaiveOptimizer) Optimize(bc *vm.ByteCode) error

Optimize modifies the ByteCode in place to an optimized version

type Optimizer

type Optimizer interface {
	Optimize(*vm.ByteCode) error
}

Optimizer is the interface of things that can optimize the ByteCode

Jump to

Keyboard shortcuts

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