sequences

package
Version: v0.0.0-...-9f34108 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sequence

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

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

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

Clone returns a copy of the token and all its children

func (*Sequence) ExistingItem

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

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

func (s *Sequence) Next() int

Next generates a new sequence numeration

func (*Sequence) Parse

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

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

Permutation sets a specific permutation for this token

func (*Sequence) Permutations

func (s *Sequence) Permutations() uint

Permutations returns the number of permutations for this token

func (*Sequence) PermutationsAll

func (s *Sequence) PermutationsAll() uint

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

func (*Sequence) Reset

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

func (s *Sequence) ResetItem() *SequenceResetItem

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

func (*Sequence) String

func (s *Sequence) String() string

type SequenceExistingItem

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

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

Clone returns a copy of the token and all its children

func (*SequenceExistingItem) Get

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

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

func (s *SequenceExistingItem) InternalLen() int

InternalLen returns the number of referenced internal tokens

func (*SequenceExistingItem) InternalLogicalRemove

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

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

func (s *SequenceExistingItem) Len() int

Len returns the number of the current referenced tokens

func (*SequenceExistingItem) Parse

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

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

Permutation sets a specific permutation for this token

func (*SequenceExistingItem) Permutations

func (s *SequenceExistingItem) Permutations() uint

Permutations returns the number of permutations for this token

func (*SequenceExistingItem) PermutationsAll

func (s *SequenceExistingItem) PermutationsAll() uint

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

func (*SequenceExistingItem) Reset

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

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

SetScope sets the scope of the token

func (*SequenceExistingItem) String

func (s *SequenceExistingItem) String() string

type SequenceItem

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

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

Clone returns a copy of the token and all its children

func (*SequenceItem) Parse

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

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

Permutation sets a specific permutation for this token

func (*SequenceItem) Permutations

func (s *SequenceItem) Permutations() uint

Permutations returns the number of permutations for this token

func (*SequenceItem) PermutationsAll

func (s *SequenceItem) PermutationsAll() uint

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

func (*SequenceItem) Reset

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

func (s *SequenceItem) String() string

type SequenceResetItem

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

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

Clone returns a copy of the token and all its children

func (*SequenceResetItem) Parse

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

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

Permutation sets a specific permutation for this token

func (*SequenceResetItem) Permutations

func (s *SequenceResetItem) Permutations() uint

Permutations returns the number of permutations for this token

func (*SequenceResetItem) PermutationsAll

func (s *SequenceResetItem) PermutationsAll() uint

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

func (*SequenceResetItem) Reset

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

func (s *SequenceResetItem) String() string

Source Files

Jump to

Keyboard shortcuts

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