eval

package
v0.0.0-...-2c4dd6d Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eval

func Eval(s string) (out []float64)

Types

type Group

type Group struct {
	LParen Node
	Child  Node
	RParen Node
}

func (*Group) Evaluate

func (n *Group) Evaluate() (out []float64)

func (*Group) String

func (n *Group) String() string

type List

type List struct {
	Nums []Node
}

func (*List) Evaluate

func (n *List) Evaluate() (out []float64)

type Node

type Node interface {
	Evaluate() []float64
}

type Operator

type Operator struct {
	Op  Token
	LHS Node
	RHS Node
}

func (*Operator) Evaluate

func (n *Operator) Evaluate() (out []float64)

func (*Operator) String

func (n *Operator) String() string

type Parser

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

func (*Parser) Parse

func (p *Parser) Parse() Node

type Token

type Token string

func Tokenize

func Tokenize(s string) []Token

func (Token) Evaluate

func (t Token) Evaluate() (out []float64)

type Value

type Value struct {
	Tok Token
}

func (*Value) Evaluate

func (n *Value) Evaluate() (out []float64)

func (*Value) String

func (n *Value) String() string

Jump to

Keyboard shortcuts

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