et

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package et defines execution tree

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unsupported

func Unsupported(message string) (internal.Compute, error)

Unsupported returns unsupported fn

Types

type Control

type Control struct {
	internal.Flow
}

Control controls tree generation based on flow features

func (*Control) Concat

func (c *Control) Concat(flag internal.Flow)

Concat concat

type New

type New func(control *Control) (internal.Compute, error)

New function creating a compute function

func NewAssignExpr

func NewAssignExpr(trackPos []uint16, ops ...*Operand) New

NewAssignExpr create an assign expression

func NewBinaryExpr

func NewBinaryExpr(op token.Token, operands ...*Operand) (New, reflect.Type)

NewBinaryExpr creates binary expr

func NewBlockStmt

func NewBlockStmt(newStatementsFn []New, forStmt bool) New

NewBlockStmt crates block node

func NewBranchStmt

func NewBranchStmt(tkn token.Token, label *ast.Ident) (New, error)

NewBranchStmt create branch statment

func NewCallExprAssign

func NewCallExprAssign(caller exec.Caller, args []*Operand, dest []*Operand) (New, error)

NewCallExprAssign create an assign expression

func NewCaller

func NewCaller(caller exec.Caller, args []*Operand) (New, error)

NewCaller crates a caller

func NewComposite

func NewComposite(cType reflect.Type, operands Operands) New

NewComposite returns composite literal evaluator

func NewForStmt

func NewForStmt(cond *Operand, init, post, body New) (New, error)

NewForStmt creates a for stmt

func NewGroupStmt

func NewGroupStmt(newStatementsFn []New, stmt bool) New

NewGroupStmt crates group node

func NewIfStmt

func NewIfStmt(cond *Operand, whenBranch, elseBranch New) (New, error)

NewIfStmt creates if stmt

func NewIncDec

func NewIncDec(tok token.Token, op *Operand) New

NewIncDec creates inc/dec stmt

func NewMake

func NewMake(destType reflect.Type, args Operands) (New, reflect.Type, error)

NewMake creates a make stmt

func NewMapper

func NewMapper(x *exec.Selector, params []*exec.Selector, results []*exec.Selector, body New) (New, reflect.Type, error)

NewMapper creates a mapper

func NewRange

func NewRange(x *Operand, key, value *exec.Selector, body New) (New, error)

NewRange creates a range stmt

func NewReducer

func NewReducer(x *exec.Selector, params []*exec.Selector, results []*exec.Selector, init *Operand, body New) (New, reflect.Type, error)

NewReducer creates reducer

func NewReturnStmt

func NewReturnStmt(retOperands Operands, results []*exec.Selector) (New, error)

NewReturnStmt creates a return stmt

func NewStarExpr added in v0.1.1

func NewStarExpr(operand *Operand) (New, error)

type Operand

type Operand struct {
	Key string
	Idx int
	*exec.Selector
	Type     *xunsafe.Type
	Value    interface{}
	ValuePtr unsafe.Pointer
	New
}

Operand defines operand

func NewOperand

func NewOperand(sel *exec.Selector, oType reflect.Type, newFn New, value interface{}) *Operand

NewOperand crates a new operand

func (*Operand) Compute

func (o *Operand) Compute(control *Control) (internal.Compute, *exec.Selector, error)

Compute computes operand

func (*Operand) IsNilSelector added in v0.1.1

func (o *Operand) IsNilSelector() bool

func (*Operand) NewOperand

func (o *Operand) NewOperand(control *Control) (*exec.Operand, error)

NewOperand create an operand

type Operands

type Operands []*Operand

Operands represents opertands

func (Operands) HasNil added in v0.1.1

func (o Operands) HasNil() bool

func (Operands) NonNilOperand added in v0.1.1

func (o Operands) NonNilOperand() *Operand

func (Operands) Validate

func (o Operands) Validate() error

Jump to

Keyboard shortcuts

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