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

package variables

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

Index

Package Files

variables.go

type Variable Uses

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

Variable implements general variable token which references a token as its value and forwards all token functions to its token.

func NewVariable Uses

func NewVariable(name string, token token.Token) *Variable

NewVariable returns a new instance of a Variable token

func (*Variable) Clone Uses

func (v *Variable) Clone() token.Token

Clone returns a copy of the token and all its children

func (*Variable) Get Uses

func (v *Variable) Get() token.Token

Get returns the current referenced token

func (*Variable) Index Uses

func (v *Variable) Index() int

Index returns the index of this token in its parent token

func (*Variable) InternalGet Uses

func (v *Variable) InternalGet() token.Token

InternalGet returns the current referenced internal token

func (*Variable) InternalLogicalRemove Uses

func (v *Variable) 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 (*Variable) InternalReplace Uses

func (v *Variable) 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 (*Variable) Len Uses

func (v *Variable) Len() int

Len returns the number of the current referenced tokens

func (*Variable) Name Uses

func (v *Variable) Name() string

Name returns the name of the variable

func (*Variable) Parse Uses

func (v *Variable) 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 (*Variable) Permutation Uses

func (v *Variable) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*Variable) Permutations Uses

func (v *Variable) Permutations() uint

Permutations returns the number of permutations for this token

func (*Variable) PermutationsAll Uses

func (v *Variable) PermutationsAll() uint

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

func (*Variable) SetScope Uses

func (v *Variable) SetScope(variableScope *token.VariableScope)

SetScope sets the scope of the token

func (*Variable) String Uses

func (v *Variable) String() string

type VariableItem Uses

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

VariableItem implements a token which references a Variable token to output its referenced token

func NewVariableItem Uses

func NewVariableItem(index token.Token, variable token.VariableToken) *VariableItem

NewVariableItem returns a new instance of a VariableItem token

func (*VariableItem) Clone Uses

func (v *VariableItem) Clone() token.Token

Clone returns a copy of the token and all its children

func (*VariableItem) Follow Uses

func (v *VariableItem) Follow() bool

Follow returns if the children of the token should be traversed

func (*VariableItem) Get Uses

func (v *VariableItem) Get() token.Token

Get returns the current referenced token

func (*VariableItem) Index Uses

func (v *VariableItem) Index() int

Index returns the index of this token in its parent token

func (*VariableItem) InternalGet Uses

func (v *VariableItem) InternalGet() token.Token

InternalGet returns the current referenced internal token

func (*VariableItem) InternalLogicalRemove Uses

func (v *VariableItem) 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 (*VariableItem) InternalReplace Uses

func (v *VariableItem) 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 (*VariableItem) Parse Uses

func (v *VariableItem) 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 (*VariableItem) Permutation Uses

func (v *VariableItem) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*VariableItem) Permutations Uses

func (v *VariableItem) Permutations() uint

Permutations returns the number of permutations for this token

func (*VariableItem) PermutationsAll Uses

func (v *VariableItem) PermutationsAll() uint

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

func (*VariableItem) SetScope Uses

func (v *VariableItem) SetScope(variableScope *token.VariableScope)

SetScope sets the scope of the token

func (*VariableItem) String Uses

func (v *VariableItem) String() string

type VariableReference Uses

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

VariableReference implements a token which references a Variable token to output its referenced token

func NewVariableReference Uses

func NewVariableReference(variable token.VariableToken) *VariableReference

NewVariableReference returns a new instance of a VariableReference token

func (*VariableReference) Clone Uses

func (v *VariableReference) Clone() token.Token

Clone returns a copy of the token and all its children

func (*VariableReference) Follow Uses

func (v *VariableReference) Follow() bool

Follow returns if the children of the token should be traversed

func (*VariableReference) Index Uses

func (v *VariableReference) Index() int

Index returns the index of this token in its parent token

func (*VariableReference) Parse Uses

func (v *VariableReference) 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 (*VariableReference) Permutation Uses

func (v *VariableReference) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*VariableReference) Permutations Uses

func (v *VariableReference) Permutations() uint

Permutations returns the number of permutations for this token

func (*VariableReference) PermutationsAll Uses

func (v *VariableReference) PermutationsAll() uint

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

func (*VariableReference) Reference Uses

func (v *VariableReference) Reference() token.Token

Reference returns the referenced token

func (*VariableReference) SetScope Uses

func (v *VariableReference) SetScope(variableScope *token.VariableScope)

SetScope sets the scope of the token

func (*VariableReference) String Uses

func (v *VariableReference) String() string

type VariableSave Uses

type VariableSave struct {
    Variable
}

VariableSave is based on the general Variable token but does prevent the output of the referenced token

func NewVariableSave Uses

func NewVariableSave(name string, token token.Token) *VariableSave

NewVariableSave returns a new instance of a VariableSave token

func (*VariableSave) Clone Uses

func (v *VariableSave) Clone() token.Token

Clone returns a copy of the token and all its children

func (*VariableSave) String Uses

func (v *VariableSave) String() string

type VariableValue Uses

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

VariableValue implements a token which references a Variable token to output its referenced token

func NewVariableValue Uses

func NewVariableValue(variable token.VariableToken) *VariableValue

NewVariableValue returns a new instance of a VariableValue token

func (*VariableValue) Clone Uses

func (v *VariableValue) Clone() token.Token

Clone returns a copy of the token and all its children

func (*VariableValue) Get Uses

func (v *VariableValue) Get() token.Token

Get returns the current referenced token

func (*VariableValue) Index Uses

func (v *VariableValue) Index() int

Index returns the index of this token in its parent token

func (*VariableValue) InternalGet Uses

func (v *VariableValue) InternalGet() token.Token

InternalGet returns the current referenced internal token

func (*VariableValue) InternalLogicalRemove Uses

func (v *VariableValue) 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 (*VariableValue) InternalReplace Uses

func (v *VariableValue) 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 (*VariableValue) Parse Uses

func (v *VariableValue) 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 (*VariableValue) Permutation Uses

func (v *VariableValue) Permutation(i uint) error

Permutation sets a specific permutation for this token

func (*VariableValue) Permutations Uses

func (v *VariableValue) Permutations() uint

Permutations returns the number of permutations for this token

func (*VariableValue) PermutationsAll Uses

func (v *VariableValue) PermutationsAll() uint

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

func (*VariableValue) SetScope Uses

func (v *VariableValue) SetScope(variableScope *token.VariableScope)

SetScope sets the scope of the token

func (*VariableValue) String Uses

func (v *VariableValue) String() string

Package variables imports 4 packages (graph) and is imported by 5 packages. Updated 2018-12-16. Refresh now. Tools for package owners.