tavor: github.com/zimmski/tavor/token/expressions Index | Files

package expressions

import "github.com/zimmski/tavor/token/expressions"

Index

Package Files

arithmetic.go funcs.go path.go

type AddArithmetic Uses

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

AddArithmetic implements an arithmetic token adding the values of two tokens

func NewAddArithmetic Uses

func NewAddArithmetic(a, b token.Token) *AddArithmetic

NewAddArithmetic returns a new instance of a AddArithmetic token

func (*AddArithmetic) Clone Uses

func (e *AddArithmetic) Clone() token.Token

Clone returns a copy of the token and all its children

func (*AddArithmetic) Get Uses

func (e *AddArithmetic) Get(i int) (token.Token, error)

Get returns the current referenced token at the given index. The error return argument is not nil, if the index is out of bound.

func (*AddArithmetic) InternalGet Uses

func (e *AddArithmetic) InternalGet(i int) (token.Token, error)

InternalGet returns the current referenced internal token at the given index. The error return argument is not nil, if the index is out of bound.

func (*AddArithmetic) InternalLen Uses

func (e *AddArithmetic) InternalLen() int

InternalLen returns the number of referenced internal tokens

func (*AddArithmetic) InternalLogicalRemove Uses

func (e *AddArithmetic) InternalLogicalRemove(tok token.Token) token.Token

InternalLogicalRemove removes the referenced internal token and returns the replacement for the current token or nil if the current token should be removed.

func (*AddArithmetic) InternalReplace Uses

func (e *AddArithmetic) InternalReplace(oldToken, newToken token.Token) error

InternalReplace replaces an old with a new internal token if it is referenced by this token. The error return argument is not nil, if the replacement is not suitable.

func (*AddArithmetic) Len Uses

func (e *AddArithmetic) Len() int

Len returns the number of the current referenced tokens

func (*AddArithmetic) Parse Uses

func (e *AddArithmetic) Parse(pars *token.InternalParser, cur int) (int, []error)

Parse tries to parse the token beginning from the current position in the parser data. If the parsing is successful the error argument is nil and the next current position after the token is returned.

func (*AddArithmetic) Permutation Uses

func (e *AddArithmetic) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*AddArithmetic) Permutations Uses

func (e *AddArithmetic) Permutations() uint

Permutations returns the number of permutations for this token

func (*AddArithmetic) PermutationsAll Uses

func (e *AddArithmetic) PermutationsAll() uint

PermutationsAll returns the number of all possible permutations for this token including its children

func (*AddArithmetic) String Uses

func (e *AddArithmetic) String() string

type DivArithmetic Uses

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

DivArithmetic implements an arithmetic token dividing the values of two tokens

func NewDivArithmetic Uses

func NewDivArithmetic(a, b token.Token) *DivArithmetic

NewDivArithmetic returns a new instance of a DivArithmetic token

func (*DivArithmetic) Clone Uses

func (e *DivArithmetic) Clone() token.Token

Clone returns a copy of the token and all its children

func (*DivArithmetic) Get Uses

func (e *DivArithmetic) Get(i int) (token.Token, error)

Get returns the current referenced token at the given index. The error return argument is not nil, if the index is out of bound.

func (*DivArithmetic) InternalGet Uses

func (e *DivArithmetic) InternalGet(i int) (token.Token, error)

InternalGet returns the current referenced internal token at the given index. The error return argument is not nil, if the index is out of bound.

func (*DivArithmetic) InternalLen Uses

func (e *DivArithmetic) InternalLen() int

InternalLen returns the number of referenced internal tokens

func (*DivArithmetic) InternalLogicalRemove Uses

func (e *DivArithmetic) InternalLogicalRemove(tok token.Token) token.Token

InternalLogicalRemove removes the referenced internal token and returns the replacement for the current token or nil if the current token should be removed.

func (*DivArithmetic) InternalReplace Uses

func (e *DivArithmetic) InternalReplace(oldToken, newToken token.Token) error

InternalReplace replaces an old with a new internal token if it is referenced by this token. The error return argument is not nil, if the replacement is not suitable.

func (*DivArithmetic) Len Uses

func (e *DivArithmetic) Len() int

Len returns the number of the current referenced tokens

func (*DivArithmetic) Parse Uses

func (e *DivArithmetic) Parse(pars *token.InternalParser, cur int) (int, []error)

Parse tries to parse the token beginning from the current position in the parser data. If the parsing is successful the error argument is nil and the next current position after the token is returned.

func (*DivArithmetic) Permutation Uses

func (e *DivArithmetic) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*DivArithmetic) Permutations Uses

func (e *DivArithmetic) Permutations() uint

Permutations returns the number of permutations for this token

func (*DivArithmetic) PermutationsAll Uses

func (e *DivArithmetic) PermutationsAll() uint

PermutationsAll returns the number of all possible permutations for this token including its children

func (*DivArithmetic) String Uses

func (e *DivArithmetic) String() string

type FuncExpression Uses

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

FuncExpression implements a expression token which executes a given list on output

func NewFuncExpression Uses

func NewFuncExpression(
    state interface{},
    permutationFunc func(state interface{}, i uint) interface{},
    permutationsFunc func(state interface{}) uint,
    permutationsAllFunc func(state interface{}) uint,
    stringFunc func(state interface{}) string,
) *FuncExpression

NewFuncExpression returns a new instance of a FuncExpression token given the output function

func (*FuncExpression) Clone Uses

func (e *FuncExpression) Clone() token.Token

Clone returns a copy of the token and all its children

func (*FuncExpression) Parse Uses

func (e *FuncExpression) Parse(pars *token.InternalParser, cur int) (int, []error)

Parse tries to parse the token beginning from the current position in the parser data. If the parsing is successful the error argument is nil and the next current position after the token is returned.

func (*FuncExpression) Permutation Uses

func (e *FuncExpression) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*FuncExpression) Permutations Uses

func (e *FuncExpression) Permutations() uint

Permutations returns the number of permutations for this token

func (*FuncExpression) PermutationsAll Uses

func (e *FuncExpression) PermutationsAll() uint

PermutationsAll returns the number of all possible permutations for this token including its children

func (*FuncExpression) String Uses

func (e *FuncExpression) String() string

type MulArithmetic Uses

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

MulArithmetic implements an arithmetic token multiplying the values of two tokens

func NewMulArithmetic Uses

func NewMulArithmetic(a, b token.Token) *MulArithmetic

NewMulArithmetic returns a new instance of a MulArithmetic token

func (*MulArithmetic) Clone Uses

func (e *MulArithmetic) Clone() token.Token

Clone returns a copy of the token and all its children

func (*MulArithmetic) Get Uses

func (e *MulArithmetic) Get(i int) (token.Token, error)

Get returns the current referenced token at the given index. The error return argument is not nil, if the index is out of bound.

func (*MulArithmetic) InternalGet Uses

func (e *MulArithmetic) InternalGet(i int) (token.Token, error)

InternalGet returns the current referenced internal token at the given index. The error return argument is not nil, if the index is out of bound.

func (*MulArithmetic) InternalLen Uses

func (e *MulArithmetic) InternalLen() int

InternalLen returns the number of referenced internal tokens

func (*MulArithmetic) InternalLogicalRemove Uses

func (e *MulArithmetic) InternalLogicalRemove(tok token.Token) token.Token

InternalLogicalRemove removes the referenced internal token and returns the replacement for the current token or nil if the current token should be removed.

func (*MulArithmetic) InternalReplace Uses

func (e *MulArithmetic) InternalReplace(oldToken, newToken token.Token) error

InternalReplace replaces an old with a new internal token if it is referenced by this token. The error return argument is not nil, if the replacement is not suitable.

func (*MulArithmetic) Len Uses

func (e *MulArithmetic) Len() int

Len returns the number of the current referenced tokens

func (*MulArithmetic) Parse Uses

func (e *MulArithmetic) Parse(pars *token.InternalParser, cur int) (int, []error)

Parse tries to parse the token beginning from the current position in the parser data. If the parsing is successful the error argument is nil and the next current position after the token is returned.

func (*MulArithmetic) Permutation Uses

func (e *MulArithmetic) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*MulArithmetic) Permutations Uses

func (e *MulArithmetic) Permutations() uint

Permutations returns the number of permutations for this token

func (*MulArithmetic) PermutationsAll Uses

func (e *MulArithmetic) PermutationsAll() uint

PermutationsAll returns the number of all possible permutations for this token including its children

func (*MulArithmetic) String Uses

func (e *MulArithmetic) String() string

type Path Uses

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

Path implements a path query

func NewPath Uses

func NewPath(list token.Token, from token.Token, over token.Token, connectBy []token.Token, without []token.Token) (*Path, error)

NewPath returns a new instance of a Path token given the set of tokens

func (*Path) Clone Uses

func (e *Path) Clone() token.Token

Clone returns a copy of the token and all its children

func (*Path) Get Uses

func (e *Path) Get(i int) (token.Token, error)

Get returns the current referenced token at the given index. The error return argument is not nil, if the index is out of bound.

func (*Path) InternalGet Uses

func (e *Path) InternalGet(i int) (token.Token, error)

InternalGet returns the current referenced internal token at the given index. The error return argument is not nil, if the index is out of bound.

func (*Path) InternalLen Uses

func (e *Path) InternalLen() int

InternalLen returns the number of referenced internal tokens

func (*Path) InternalLogicalRemove Uses

func (e *Path) InternalLogicalRemove(tok token.Token) token.Token

InternalLogicalRemove removes the referenced internal token and returns the replacement for the current token or nil if the current token should be removed.

func (*Path) InternalReplace Uses

func (e *Path) InternalReplace(oldToken, newToken token.Token) error

InternalReplace replaces an old with a new internal token if it is referenced by this token. The error return argument is not nil, if the replacement is not suitable.

func (*Path) Len Uses

func (e *Path) Len() int

Len returns the number of the current referenced tokens

func (*Path) Parse Uses

func (e *Path) Parse(pars *token.InternalParser, cur int) (int, []error)

Parse tries to parse the token beginning from the current position in the parser data. If the parsing is successful the error argument is nil and the next current position after the token is returned.

func (*Path) Permutation Uses

func (e *Path) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*Path) Permutations Uses

func (e *Path) Permutations() uint

Permutations returns the number of permutations for this token

func (*Path) PermutationsAll Uses

func (e *Path) PermutationsAll() uint

PermutationsAll returns the number of all possible permutations for this token including its children

func (*Path) SetScope Uses

func (e *Path) SetScope(variableScope *token.VariableScope)

SetScope sets the scope of the token

func (*Path) String Uses

func (e *Path) String() string

type SubArithmetic Uses

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

SubArithmetic implements an arithmetic token subtracting the values of two tokens

func NewSubArithmetic Uses

func NewSubArithmetic(a, b token.Token) *SubArithmetic

NewSubArithmetic returns a new instance of a SubArithmetic token

func (*SubArithmetic) Clone Uses

func (e *SubArithmetic) Clone() token.Token

Clone returns a copy of the token and all its children

func (*SubArithmetic) Get Uses

func (e *SubArithmetic) Get(i int) (token.Token, error)

Get returns the current referenced token at the given index. The error return argument is not nil, if the index is out of bound.

func (*SubArithmetic) InternalGet Uses

func (e *SubArithmetic) InternalGet(i int) (token.Token, error)

InternalGet returns the current referenced internal token at the given index. The error return argument is not nil, if the index is out of bound.

func (*SubArithmetic) InternalLen Uses

func (e *SubArithmetic) InternalLen() int

InternalLen returns the number of referenced internal tokens

func (*SubArithmetic) InternalLogicalRemove Uses

func (e *SubArithmetic) InternalLogicalRemove(tok token.Token) token.Token

InternalLogicalRemove removes the referenced internal token and returns the replacement for the current token or nil if the current token should be removed.

func (*SubArithmetic) InternalReplace Uses

func (e *SubArithmetic) InternalReplace(oldToken, newToken token.Token) error

InternalReplace replaces an old with a new internal token if it is referenced by this token. The error return argument is not nil, if the replacement is not suitable.

func (*SubArithmetic) Len Uses

func (e *SubArithmetic) Len() int

Len returns the number of the current referenced tokens

func (*SubArithmetic) Parse Uses

func (e *SubArithmetic) Parse(pars *token.InternalParser, cur int) (int, []error)

Parse tries to parse the token beginning from the current position in the parser data. If the parsing is successful the error argument is nil and the next current position after the token is returned.

func (*SubArithmetic) Permutation Uses

func (e *SubArithmetic) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*SubArithmetic) Permutations Uses

func (e *SubArithmetic) Permutations() uint

Permutations returns the number of permutations for this token

func (*SubArithmetic) PermutationsAll Uses

func (e *SubArithmetic) PermutationsAll() uint

PermutationsAll returns the number of all possible permutations for this token including its children

func (*SubArithmetic) String Uses

func (e *SubArithmetic) String() string

Package expressions imports 7 packages (graph) and is imported by 3 packages. Updated 2018-11-29. Refresh now. Tools for package owners.