vm

package
v0.0.0-...-daaaa79 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownOp       = fmt.Errorf("expr: unknown op type")
	ErrUnknownNodeType = fmt.Errorf("expr: unknown node type")
	ErrExecute         = fmt.Errorf("Could not execute")

	SchemaInfoEmpty = &NoSchema{}
)

Functions

func Eval

func Eval(ctx expr.EvalContext, arg expr.Node) (value.Value, bool)

Types

type EvalBaseContext

type EvalBaseContext struct {
	expr.ContextReader
}

type EvaluatorFunc

type EvaluatorFunc func(ctx expr.EvalContext) (value.Value, bool)

func Evaluator

func Evaluator(arg expr.Node) EvaluatorFunc

type ExprVm

type ExprVm interface {
	Execute(writeContext expr.ContextWriter, readContext expr.ContextReader) error
}

type NoSchema

type NoSchema struct {
}

func (*NoSchema) Key

func (m *NoSchema) Key() string

type State

type State struct {
	ExprVm // reference to the VM operating on this state

	expr.ContextReader
	Writer expr.ContextWriter
	// contains filtered or unexported fields
}

func NewState

func NewState(vm ExprVm, read expr.ContextReader, write expr.ContextWriter) *State

func (*State) Walk

func (e *State) Walk(arg expr.Node) (value.Value, bool)

type Vm

type Vm struct {
	*expr.Tree
}

A node vm is a vm for parsing, evaluating a single tree-node

func NewVm

func NewVm(exprText string) (*Vm, error)

func (*Vm) Execute

func (m *Vm) Execute(writeContext expr.ContextWriter, readContext expr.ContextReader) (err error)

Execute applies a parse expression to the specified context's

func (*Vm) MarshalJSON

func (m *Vm) MarshalJSON() ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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