Documentation ¶
Index ¶
- type Concatenation
- func (l *Concatenation) Clone() token.Token
- func (l *Concatenation) Get(i int) (token.Token, error)
- func (l *Concatenation) InternalGet(i int) (token.Token, error)
- func (l *Concatenation) InternalLen() int
- func (l *Concatenation) InternalLogicalRemove(tok token.Token) token.Token
- func (l *Concatenation) InternalReplace(oldToken, newToken token.Token) error
- func (l *Concatenation) Len() int
- func (l *Concatenation) Minimize() token.Token
- func (l *Concatenation) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (l *Concatenation) Permutation(i uint) error
- func (l *Concatenation) Permutations() uint
- func (l *Concatenation) PermutationsAll() uint
- func (l *Concatenation) String() string
- type IndexItem
- func (l *IndexItem) Clone() token.Token
- func (l *IndexItem) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (l *IndexItem) Permutation(i uint) error
- func (l *IndexItem) Permutations() uint
- func (l *IndexItem) PermutationsAll() uint
- func (l *IndexItem) SetScope(variableScope *token.VariableScope)
- func (l *IndexItem) String() string
- type ListError
- type ListErrorType
- type ListItem
- func (l *ListItem) Clone() token.Token
- func (l *ListItem) Index() int
- func (l *ListItem) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (l *ListItem) Permutation(i uint) error
- func (l *ListItem) Permutations() uint
- func (l *ListItem) PermutationsAll() uint
- func (l *ListItem) SetScope(variableScope *token.VariableScope)
- func (l *ListItem) String() string
- type Once
- func (l *Once) Clone() token.Token
- func (l *Once) Get(i int) (token.Token, error)
- func (l *Once) InternalGet(i int) (token.Token, error)
- func (l *Once) InternalLen() int
- func (l *Once) InternalLogicalRemove(tok token.Token) token.Token
- func (l *Once) InternalReplace(oldToken, newToken token.Token) error
- func (l *Once) Len() int
- func (l *Once) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (l *Once) Permutation(i uint) error
- func (l *Once) Permutations() uint
- func (l *Once) PermutationsAll() uint
- func (l *Once) String() string
- type One
- func (l *One) Clone() token.Token
- func (l *One) Get(i int) (token.Token, error)
- func (l *One) InternalGet(i int) (token.Token, error)
- func (l *One) InternalLen() int
- func (l *One) InternalLogicalRemove(tok token.Token) token.Token
- func (l *One) InternalReplace(oldToken, newToken token.Token) error
- func (l *One) Len() int
- func (l *One) Minimize() token.Token
- func (l *One) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (l *One) Permutation(i uint) error
- func (l *One) Permutations() uint
- func (l *One) PermutationsAll() uint
- func (l *One) String() string
- type Repeat
- func (l *Repeat) Activate()
- func (l *Repeat) Clone() token.Token
- func (l *Repeat) Deactivate()
- func (l *Repeat) From() int64
- func (l *Repeat) Get(i int) (token.Token, error)
- func (l *Repeat) InternalGet(i int) (token.Token, error)
- func (l *Repeat) InternalLen() int
- func (l *Repeat) InternalLogicalRemove(tok token.Token) token.Token
- func (l *Repeat) InternalReplace(oldToken, newToken token.Token) error
- func (l *Repeat) IsOptional() bool
- func (l *Repeat) Len() int
- func (l *Repeat) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (l *Repeat) Permutation(i uint) error
- func (l *Repeat) Permutations() uint
- func (l *Repeat) PermutationsAll() uint
- func (l *Repeat) Reduce(i uint) error
- func (l *Repeat) Reduces() uint
- func (l *Repeat) Reset() error
- func (l *Repeat) String() string
- func (l *Repeat) To() int64
- type UniqueItem
- func (l *UniqueItem) Clone() token.Token
- func (l *UniqueItem) Index() int
- func (l *UniqueItem) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (l *UniqueItem) Permutation(i uint) error
- func (l *UniqueItem) Permutations() uint
- func (l *UniqueItem) PermutationsAll() uint
- func (l *UniqueItem) Release()
- func (l *UniqueItem) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Concatenation ¶
type Concatenation struct {
// contains filtered or unexported fields
}
Concatenation implements a list token which holds an ordered set of tokens
func NewConcatenation ¶
func NewConcatenation(toks ...token.Token) *Concatenation
NewConcatenation returns a new instance of a Concatenation token given the set of tokens
func (*Concatenation) Clone ¶
func (l *Concatenation) Clone() token.Token
Clone returns a copy of the token and all its children
func (*Concatenation) Get ¶
func (l *Concatenation) 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 (*Concatenation) InternalGet ¶
func (l *Concatenation) 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 (*Concatenation) InternalLen ¶
func (l *Concatenation) InternalLen() int
InternalLen returns the number of referenced internal tokens
func (*Concatenation) InternalLogicalRemove ¶
func (l *Concatenation) 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 (*Concatenation) InternalReplace ¶
func (l *Concatenation) 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 (*Concatenation) Len ¶
func (l *Concatenation) Len() int
Len returns the number of the current referenced tokens
func (*Concatenation) Minimize ¶
func (l *Concatenation) Minimize() token.Token
Minimize tries to minimize itself and returns a token if it was successful, or nil if there was nothing to minimize
func (*Concatenation) Parse ¶
func (l *Concatenation) 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 (*Concatenation) Permutation ¶
func (l *Concatenation) Permutation(i uint) error
Permutation sets a specific permutation for this token
func (*Concatenation) Permutations ¶
func (l *Concatenation) Permutations() uint
Permutations returns the number of permutations for this token
func (*Concatenation) PermutationsAll ¶
func (l *Concatenation) PermutationsAll() uint
PermutationsAll returns the number of all possible permutations for this token including its children
func (*Concatenation) String ¶
func (l *Concatenation) String() string
type IndexItem ¶
type IndexItem struct {
// contains filtered or unexported fields
}
IndexItem implements a list item which references an Index token to represent the index itself of this token
func NewIndexItem ¶
func NewIndexItem(tok token.IndexToken) *IndexItem
NewIndexItem returns a new instance of a IndexItem token referencing the given Index token
func (*IndexItem) Parse ¶
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 (*IndexItem) Permutation ¶
Permutation sets a specific permutation for this token
func (*IndexItem) Permutations ¶
Permutations returns the number of permutations for this token
func (*IndexItem) PermutationsAll ¶
PermutationsAll returns the number of all possible permutations for this token including its children
func (*IndexItem) SetScope ¶
func (l *IndexItem) SetScope(variableScope *token.VariableScope)
SetScope sets the scope of the token
type ListErrorType ¶
type ListErrorType int
ListErrorType the list error type
const ( // ListErrorOutOfBound an index not in the bound of available list items was used. ListErrorOutOfBound ListErrorType = iota )
type ListItem ¶
type ListItem struct {
// contains filtered or unexported fields
}
ListItem implements a list item token which references a List token and holds one index of the list to reference a list item
func NewListItem ¶
NewListItem returns a new instance of a ListItem token referencing the given list and the given index
func (*ListItem) Parse ¶
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 (*ListItem) Permutation ¶
Permutation sets a specific permutation for this token
func (*ListItem) Permutations ¶
Permutations returns the number of permutations for this token
func (*ListItem) PermutationsAll ¶
PermutationsAll returns the number of all possible permutations for this token including its children
func (*ListItem) SetScope ¶
func (l *ListItem) SetScope(variableScope *token.VariableScope)
SetScope sets the scope of the token
type Once ¶
type Once struct {
// contains filtered or unexported fields
}
Once implements a list token which holds a set of tokens that get shuffled on every permutation
func (*Once) Get ¶
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 (*Once) InternalGet ¶
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 (*Once) InternalLen ¶
InternalLen returns the number of referenced internal tokens
func (*Once) InternalLogicalRemove ¶
InternalLogicalRemove removes the referenced internal token and returns the replacement for the current token or nil if the current token should be removed.
func (*Once) InternalReplace ¶
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 (*Once) Parse ¶
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 (*Once) Permutation ¶
Permutation sets a specific permutation for this token
func (*Once) Permutations ¶
Permutations returns the number of permutations for this token
func (*Once) PermutationsAll ¶
PermutationsAll returns the number of all possible permutations for this token including its children
type One ¶
type One struct {
// contains filtered or unexported fields
}
One implements a list token which chooses of a set of referenced token exactly one token Every permutation chooses one token out of the token set.
func (*One) Get ¶
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 (*One) InternalGet ¶
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 (*One) InternalLen ¶
InternalLen returns the number of referenced internal tokens
func (*One) InternalLogicalRemove ¶
InternalLogicalRemove removes the referenced internal token and returns the replacement for the current token or nil if the current token should be removed.
func (*One) InternalReplace ¶
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 (*One) Minimize ¶
Minimize tries to minimize itself and returns a token if it was successful, or nil if there was nothing to minimize
func (*One) Parse ¶
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 (*One) Permutation ¶
Permutation sets a specific permutation for this token
func (*One) Permutations ¶
Permutations returns the number of permutations for this token
func (*One) PermutationsAll ¶
PermutationsAll returns the number of all possible permutations for this token including its children
type Repeat ¶
type Repeat struct {
// contains filtered or unexported fields
}
Repeat implements a list token which repeats a referenced token by a given range
func NewRepeat ¶
NewRepeat returns a new instance of a Repeat token referencing the given token and the given integer range
func NewRepeatWithTokens ¶
NewRepeatWithTokens returns a new instance of a Repeat token referencing the given token and the given token range The tokens of the given range must return a valid integer values.
func (*Repeat) Get ¶
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 (*Repeat) InternalGet ¶
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 (*Repeat) InternalLen ¶
InternalLen returns the number of referenced internal tokens
func (*Repeat) InternalLogicalRemove ¶
InternalLogicalRemove removes the referenced internal token and returns the replacement for the current token or nil if the current token should be removed.
func (*Repeat) InternalReplace ¶
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 (*Repeat) IsOptional ¶
IsOptional checks dynamically if this token is in the current state optional
func (*Repeat) Parse ¶
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 (*Repeat) Permutation ¶
Permutation sets a specific permutation for this token
func (*Repeat) Permutations ¶
Permutations returns the number of permutations for this token
func (*Repeat) PermutationsAll ¶
PermutationsAll returns the number of all possible permutations for this token including its children
type UniqueItem ¶
type UniqueItem struct {
// contains filtered or unexported fields
}
UniqueItem implements a list item token which holds an distinct list item of a referenced List token
func NewUniqueItem ¶
func NewUniqueItem(list token.ListToken) *UniqueItem
NewUniqueItem returns a new instance of a UniqueItem token referencing the given List token
func (*UniqueItem) Clone ¶
func (l *UniqueItem) Clone() token.Token
Clone returns a copy of the token and all its children
func (*UniqueItem) Index ¶
func (l *UniqueItem) Index() int
Index returns the index of this token in its parent token
func (*UniqueItem) Parse ¶
func (l *UniqueItem) 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 (*UniqueItem) Permutation ¶
func (l *UniqueItem) Permutation(i uint) error
Permutation sets a specific permutation for this token
func (*UniqueItem) Permutations ¶
func (l *UniqueItem) Permutations() uint
Permutations returns the number of permutations for this token
func (*UniqueItem) PermutationsAll ¶
func (l *UniqueItem) PermutationsAll() uint
PermutationsAll returns the number of all possible permutations for this token including its children
func (*UniqueItem) Release ¶
func (l *UniqueItem) Release()
Release gives the token a chance to remove resources
func (*UniqueItem) String ¶
func (l *UniqueItem) String() string