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

package sequences

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

Index

Package Files

sequence.go

type Sequence Uses

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

Sequence implements a general sequence token which can generate Item tokens to use the internal sequence The sequence starts its numeration at the given start value and increases with every new sequence numeration its current value by the given step value.

func NewSequence Uses

func NewSequence(start, step int) *Sequence

NewSequence returns a new instance of a Sequence token with a start value and a step value

func (*Sequence) Clone Uses

func (s *Sequence) Clone() token.Token

Clone returns a copy of the token and all its children

func (*Sequence) ExistingItem Uses

func (s *Sequence) ExistingItem(except []token.Token) *SequenceExistingItem

ExistingItem returns a new instance of a SequenceExistingItem token referencing the sequence and holding the starting value of the sequence as its current value

func (*Sequence) Item Uses

func (s *Sequence) Item() *SequenceItem

Item returns a new instance of a SequenceItem token referencing the sequence and generating and holding a new sequence numeration

func (*Sequence) Next Uses

func (s *Sequence) Next() int

Next generates a new sequence numeration

func (*Sequence) Parse Uses

func (s *Sequence) 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 (*Sequence) Permutation Uses

func (s *Sequence) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*Sequence) Permutations Uses

func (s *Sequence) Permutations() uint

Permutations returns the number of permutations for this token

func (*Sequence) PermutationsAll Uses

func (s *Sequence) PermutationsAll() uint

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

func (*Sequence) Reset Uses

func (s *Sequence) Reset() error

Reset resets the (internal) state of this token and its dependences, returns an error if the reseted state should not be used for a generation.

func (*Sequence) ResetItem Uses

func (s *Sequence) ResetItem() *SequenceResetItem

ResetItem returns a new intsance of a SequenceResetItem token referencing the sequence

func (*Sequence) String Uses

func (s *Sequence) String() string

type SequenceExistingItem Uses

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

SequenceExistingItem implements a sequence item token which holds one existing value of the sequence A new existing sequence value is choosen on every token permutation.

func (*SequenceExistingItem) Clone Uses

func (s *SequenceExistingItem) Clone() token.Token

Clone returns a copy of the token and all its children

func (*SequenceExistingItem) Get Uses

func (s *SequenceExistingItem) 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 (*SequenceExistingItem) InternalGet Uses

func (s *SequenceExistingItem) 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 (*SequenceExistingItem) InternalLen Uses

func (s *SequenceExistingItem) InternalLen() int

InternalLen returns the number of referenced internal tokens

func (*SequenceExistingItem) InternalLogicalRemove Uses

func (s *SequenceExistingItem) 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 (*SequenceExistingItem) InternalReplace Uses

func (s *SequenceExistingItem) 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 (*SequenceExistingItem) Len Uses

func (s *SequenceExistingItem) Len() int

Len returns the number of the current referenced tokens

func (*SequenceExistingItem) Parse Uses

func (s *SequenceExistingItem) 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 (*SequenceExistingItem) Permutation Uses

func (s *SequenceExistingItem) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*SequenceExistingItem) Permutations Uses

func (s *SequenceExistingItem) Permutations() uint

Permutations returns the number of permutations for this token

func (*SequenceExistingItem) PermutationsAll Uses

func (s *SequenceExistingItem) PermutationsAll() uint

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

func (*SequenceExistingItem) Reset Uses

func (s *SequenceExistingItem) Reset() error

Reset resets the (internal) state of this token and its dependences, returns an error if the reseted state should not be used for a generation.

func (*SequenceExistingItem) SetScope Uses

func (s *SequenceExistingItem) SetScope(variableScope *token.VariableScope)

SetScope sets the scope of the token

func (*SequenceExistingItem) String Uses

func (s *SequenceExistingItem) String() string

type SequenceItem Uses

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

SequenceItem implements a sequence item token which holds one distinct value of the sequence A new sequence value is generated on every token permutation.

func (*SequenceItem) Clone Uses

func (s *SequenceItem) Clone() token.Token

Clone returns a copy of the token and all its children

func (*SequenceItem) Parse Uses

func (s *SequenceItem) 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 (*SequenceItem) Permutation Uses

func (s *SequenceItem) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*SequenceItem) Permutations Uses

func (s *SequenceItem) Permutations() uint

Permutations returns the number of permutations for this token

func (*SequenceItem) PermutationsAll Uses

func (s *SequenceItem) PermutationsAll() uint

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

func (*SequenceItem) Reset Uses

func (s *SequenceItem) Reset() error

Reset resets the (internal) state of this token and its dependences, returns an error if the reseted state should not be used for a generation.

func (*SequenceItem) String Uses

func (s *SequenceItem) String() string

type SequenceResetItem Uses

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

SequenceResetItem implements a sequence token item which resets its referencing sequence on every permutation

func (*SequenceResetItem) Clone Uses

func (s *SequenceResetItem) Clone() token.Token

Clone returns a copy of the token and all its children

func (*SequenceResetItem) Parse Uses

func (s *SequenceResetItem) 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 (*SequenceResetItem) Permutation Uses

func (s *SequenceResetItem) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*SequenceResetItem) Permutations Uses

func (s *SequenceResetItem) Permutations() uint

Permutations returns the number of permutations for this token

func (*SequenceResetItem) PermutationsAll Uses

func (s *SequenceResetItem) PermutationsAll() uint

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

func (*SequenceResetItem) Reset Uses

func (s *SequenceResetItem) Reset() error

Reset resets the (internal) state of this token and its dependences, returns an error if the reseted state should not be used for a generation.

func (*SequenceResetItem) String Uses

func (s *SequenceResetItem) String() string

Package sequences imports 5 packages (graph) and is imported by 4 packages. Updated 2018-11-29. Refresh now. Tools for package owners.