Documentation ¶
Index ¶
- type BooleanEqual
- func (c *BooleanEqual) Clone() token.Token
- func (c *BooleanEqual) Evaluate() bool
- func (c *BooleanEqual) Get(i int) (token.Token, error)
- func (c *BooleanEqual) InternalGet(i int) (token.Token, error)
- func (c *BooleanEqual) InternalLen() int
- func (c *BooleanEqual) InternalLogicalRemove(tok token.Token) token.Token
- func (c *BooleanEqual) InternalReplace(oldToken, newToken token.Token) error
- func (c *BooleanEqual) Len() int
- func (c *BooleanEqual) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (c *BooleanEqual) Permutation(i uint) error
- func (c *BooleanEqual) Permutations() uint
- func (c *BooleanEqual) PermutationsAll() uint
- func (c *BooleanEqual) String() string
- type BooleanExpression
- type BooleanTrue
- func (c *BooleanTrue) Clone() token.Token
- func (c *BooleanTrue) Evaluate() bool
- func (c *BooleanTrue) Get(i int) (token.Token, error)
- func (c *BooleanTrue) InternalGet(i int) (token.Token, error)
- func (c *BooleanTrue) InternalLen() int
- func (c *BooleanTrue) InternalLogicalRemove(tok token.Token) token.Token
- func (c *BooleanTrue) InternalReplace(oldToken, newToken token.Token) error
- func (c *BooleanTrue) Len() int
- func (c *BooleanTrue) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (c *BooleanTrue) Permutation(i uint) error
- func (c *BooleanTrue) Permutations() uint
- func (c *BooleanTrue) PermutationsAll() uint
- func (c *BooleanTrue) String() string
- type ExpressionPointer
- func (c *ExpressionPointer) Clone() token.Token
- func (c *ExpressionPointer) Evaluate() bool
- func (c *ExpressionPointer) Get() token.Token
- func (c *ExpressionPointer) InternalGet() token.Token
- func (c *ExpressionPointer) InternalLogicalRemove(tok token.Token) token.Token
- func (c *ExpressionPointer) InternalReplace(oldToken, newToken token.Token) error
- func (c *ExpressionPointer) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (c *ExpressionPointer) Permutation(i uint) error
- func (c *ExpressionPointer) Permutations() uint
- func (c *ExpressionPointer) PermutationsAll() uint
- func (c *ExpressionPointer) SetScope(variableScope *token.VariableScope)
- func (c *ExpressionPointer) String() string
- type If
- type IfPair
- func (c *IfPair) Clone() token.Token
- func (c *IfPair) Get(i int) (token.Token, error)
- func (c *IfPair) InternalGet(i int) (token.Token, error)
- func (c *IfPair) InternalLen() int
- func (c *IfPair) InternalLogicalRemove(tok token.Token) token.Token
- func (c *IfPair) InternalReplace(oldToken, newToken token.Token) error
- func (c *IfPair) Len() int
- func (c *IfPair) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (c *IfPair) Permutation(i uint) error
- func (c *IfPair) Permutations() uint
- func (c *IfPair) PermutationsAll() uint
- func (c *IfPair) String() string
- type VariableDefined
- func (c *VariableDefined) Clone() token.Token
- func (c *VariableDefined) Evaluate() bool
- func (c *VariableDefined) Parse(pars *token.InternalParser, cur int) (int, []error)
- func (c *VariableDefined) Permutation(i uint) error
- func (c *VariableDefined) Permutations() uint
- func (c *VariableDefined) PermutationsAll() uint
- func (c *VariableDefined) SetScope(variableScope *token.VariableScope)
- func (c *VariableDefined) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BooleanEqual ¶
type BooleanEqual struct {
// contains filtered or unexported fields
}
BooleanEqual implements a boolean expression which compares the value of two tokens
func NewBooleanEqual ¶
func NewBooleanEqual(a, b token.Token) *BooleanEqual
NewBooleanEqual returns a new instance of a BooleanEqual token referencing two tokens
func (*BooleanEqual) Clone ¶
func (c *BooleanEqual) Clone() token.Token
Clone returns a copy of the token and all its children
func (*BooleanEqual) Evaluate ¶
func (c *BooleanEqual) Evaluate() bool
Evaluate evaluates the boolean expression and returns its result
func (*BooleanEqual) Get ¶
func (c *BooleanEqual) 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 (*BooleanEqual) InternalGet ¶
func (c *BooleanEqual) 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 (*BooleanEqual) InternalLen ¶
func (c *BooleanEqual) InternalLen() int
InternalLen returns the number of referenced internal tokens
func (*BooleanEqual) InternalLogicalRemove ¶
func (c *BooleanEqual) 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 (*BooleanEqual) InternalReplace ¶
func (c *BooleanEqual) 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 (*BooleanEqual) Len ¶
func (c *BooleanEqual) Len() int
Len returns the number of the current referenced tokens
func (*BooleanEqual) Parse ¶
func (c *BooleanEqual) 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 (*BooleanEqual) Permutation ¶
func (c *BooleanEqual) Permutation(i uint) error
Permutation sets a specific permutation for this token
func (*BooleanEqual) Permutations ¶
func (c *BooleanEqual) Permutations() uint
Permutations returns the number of permutations for this token
func (*BooleanEqual) PermutationsAll ¶
func (c *BooleanEqual) PermutationsAll() uint
PermutationsAll returns the number of all possible permutations for this token including its children
func (*BooleanEqual) String ¶
func (c *BooleanEqual) String() string
type BooleanExpression ¶
type BooleanExpression interface { token.Token // Evaluate evaluates the boolean expression and returns its result Evaluate() bool }
BooleanExpression defines a boolean expression
type BooleanTrue ¶
type BooleanTrue struct{}
BooleanTrue implements a boolean expression which evaluates to always true
func NewBooleanTrue ¶
func NewBooleanTrue() *BooleanTrue
NewBooleanTrue returns a new instance of a BooleanTrue token
func (*BooleanTrue) Clone ¶
func (c *BooleanTrue) Clone() token.Token
Clone returns a copy of the token and all its children
func (*BooleanTrue) Evaluate ¶
func (c *BooleanTrue) Evaluate() bool
Evaluate evaluates the boolean expression and returns its result
func (*BooleanTrue) Get ¶
func (c *BooleanTrue) 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 (*BooleanTrue) InternalGet ¶
func (c *BooleanTrue) 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 (*BooleanTrue) InternalLen ¶
func (c *BooleanTrue) InternalLen() int
InternalLen returns the number of referenced internal tokens
func (*BooleanTrue) InternalLogicalRemove ¶
func (c *BooleanTrue) 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 (*BooleanTrue) InternalReplace ¶
func (c *BooleanTrue) 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 (*BooleanTrue) Len ¶
func (c *BooleanTrue) Len() int
Len returns the number of the current referenced tokens
func (*BooleanTrue) Parse ¶
func (c *BooleanTrue) 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 (*BooleanTrue) Permutation ¶
func (c *BooleanTrue) Permutation(i uint) error
Permutation sets a specific permutation for this token
func (*BooleanTrue) Permutations ¶
func (c *BooleanTrue) Permutations() uint
Permutations returns the number of permutations for this token
func (*BooleanTrue) PermutationsAll ¶
func (c *BooleanTrue) PermutationsAll() uint
PermutationsAll returns the number of all possible permutations for this token including its children
func (*BooleanTrue) String ¶
func (c *BooleanTrue) String() string
type ExpressionPointer ¶
type ExpressionPointer struct {
// contains filtered or unexported fields
}
ExpressionPointer implements a token pointer to an expression token
func NewExpressionPointer ¶
func NewExpressionPointer(token token.Token) *ExpressionPointer
NewExpressionPointer returns a new instance of a ExpressionPointer token referencing the given token
func (*ExpressionPointer) Clone ¶
func (c *ExpressionPointer) Clone() token.Token
Clone returns a copy of the token and all its children
func (*ExpressionPointer) Evaluate ¶
func (c *ExpressionPointer) Evaluate() bool
Evaluate evaluates the boolean expression and returns its result
func (*ExpressionPointer) Get ¶
func (c *ExpressionPointer) Get() token.Token
Get returns the current referenced token
func (*ExpressionPointer) InternalGet ¶
func (c *ExpressionPointer) InternalGet() token.Token
InternalGet returns the current referenced internal token
func (*ExpressionPointer) InternalLogicalRemove ¶
func (c *ExpressionPointer) 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 (*ExpressionPointer) InternalReplace ¶
func (c *ExpressionPointer) 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 (*ExpressionPointer) Parse ¶
func (c *ExpressionPointer) 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 (*ExpressionPointer) Permutation ¶
func (c *ExpressionPointer) Permutation(i uint) error
Permutation sets a specific permutation for this token
func (*ExpressionPointer) Permutations ¶
func (c *ExpressionPointer) Permutations() uint
Permutations returns the number of permutations for this token
func (*ExpressionPointer) PermutationsAll ¶
func (c *ExpressionPointer) PermutationsAll() uint
PermutationsAll returns the number of all possible permutations for this token including its children
func (*ExpressionPointer) SetScope ¶
func (c *ExpressionPointer) SetScope(variableScope *token.VariableScope)
SetScope sets the scope of the token
func (*ExpressionPointer) String ¶
func (c *ExpressionPointer) String() string
type If ¶
type If struct {
Pairs []IfPair
}
If implements a condition token which holds a list of IfPairs which belong together (e.g. If Elsif ... Else)
func (*If) 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 (*If) Permutation ¶
Permutation sets a specific permutation for this token
func (*If) Permutations ¶
Permutations returns the number of permutations for this token
func (*If) PermutationsAll ¶
PermutationsAll returns the number of all possible permutations for this token including its children
func (*If) SetScope ¶
func (c *If) SetScope(variableScope *token.VariableScope)
SetScope sets the scope of the token
type IfPair ¶
type IfPair struct { Head BooleanExpression Body token.Token }
IfPair implements a condition token which holds an If condition with its head and body
func (*IfPair) 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 (*IfPair) 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 (*IfPair) InternalLen ¶
InternalLen returns the number of referenced internal tokens
func (*IfPair) 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 (*IfPair) 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 (*IfPair) 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 (*IfPair) Permutation ¶
Permutation sets a specific permutation for this token
func (*IfPair) Permutations ¶
Permutations returns the number of permutations for this token
func (*IfPair) PermutationsAll ¶
PermutationsAll returns the number of all possible permutations for this token including its children
type VariableDefined ¶
type VariableDefined struct {
// contains filtered or unexported fields
}
VariableDefined implements a boolean expression which evaluates if a variable is defined in a given scope
func NewVariableDefined ¶
func NewVariableDefined(name string, variableScope *token.VariableScope) *VariableDefined
NewVariableDefined returns a new instance of a VariableDefined token initialzed with the given name and scope
func (*VariableDefined) Clone ¶
func (c *VariableDefined) Clone() token.Token
Clone returns a copy of the token and all its children
func (*VariableDefined) Evaluate ¶
func (c *VariableDefined) Evaluate() bool
Evaluate evaluates the boolean expression and returns its result
func (*VariableDefined) Parse ¶
func (c *VariableDefined) 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 (*VariableDefined) Permutation ¶
func (c *VariableDefined) Permutation(i uint) error
Permutation sets a specific permutation for this token
func (*VariableDefined) Permutations ¶
func (c *VariableDefined) Permutations() uint
Permutations returns the number of permutations for this token
func (*VariableDefined) PermutationsAll ¶
func (c *VariableDefined) PermutationsAll() uint
PermutationsAll returns the number of all possible permutations for this token including its children
func (*VariableDefined) SetScope ¶
func (c *VariableDefined) SetScope(variableScope *token.VariableScope)
SetScope sets the scope of the token
func (*VariableDefined) String ¶
func (c *VariableDefined) String() string