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

package filters

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

Index

Package Files

funcs.go

type FuncFilter Uses

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

FuncFilter implements a filter token which takes a token and filters its output according to a fuzzing function

func NewFuncFilter Uses

func NewFuncFilter(
    tok token.Token,
    state interface{},
    permutationFunc func(state interface{}, tok token.Token, i uint) interface{},
    permutationsFunc func(state interface{}, tok token.Token) uint,
    permutationsAllFunc func(state interface{}, tok token.Token) uint,
    stringFunc func(state interface{}, tok token.Token) string,
) *FuncFilter

NewFuncFilter returns a new instance of a FuncFilter token give the referenced token, a fuzzing and a stringer function

func (*FuncFilter) Clone Uses

func (f *FuncFilter) Clone() token.Token

Clone returns a copy of the token and all its children

func (*FuncFilter) Get Uses

func (f *FuncFilter) Get() token.Token

Get returns the current referenced token

func (*FuncFilter) InternalGet Uses

func (f *FuncFilter) InternalGet() token.Token

InternalGet returns the current referenced internal token

func (*FuncFilter) InternalLogicalRemove Uses

func (f *FuncFilter) 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 (*FuncFilter) InternalReplace Uses

func (f *FuncFilter) 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 (*FuncFilter) Parse Uses

func (f *FuncFilter) 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 (*FuncFilter) Permutation Uses

func (f *FuncFilter) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*FuncFilter) Permutations Uses

func (f *FuncFilter) Permutations() uint

Permutations returns the number of permutations for this token

func (*FuncFilter) PermutationsAll Uses

func (f *FuncFilter) PermutationsAll() uint

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

func (*FuncFilter) String Uses

func (f *FuncFilter) String() string

Package filters imports 1 packages (graph). Updated 2018-11-07. Refresh now. Tools for package owners.