variables

package
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: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Variable

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

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

NewVariable returns a new instance of a Variable token

func (*Variable) Clone

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

Clone returns a copy of the token and all its children

func (*Variable) Get

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

Get returns the current referenced token

func (*Variable) Index

func (v *Variable) Index() int

Index returns the index of this token in its parent token

func (*Variable) InternalGet

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

InternalGet returns the current referenced internal token

func (*Variable) InternalLogicalRemove

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

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

func (v *Variable) Len() int

Len returns the number of the current referenced tokens

func (*Variable) Name

func (v *Variable) Name() string

Name returns the name of the variable

func (*Variable) Parse

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

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

Permutation sets a specific permutation for this token

func (*Variable) Permutations

func (v *Variable) Permutations() uint

Permutations returns the number of permutations for this token

func (*Variable) PermutationsAll

func (v *Variable) PermutationsAll() uint

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

func (*Variable) SetScope

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

SetScope sets the scope of the token

func (*Variable) String

func (v *Variable) String() string

type VariableItem

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

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

func NewVariableItem

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

NewVariableItem returns a new instance of a VariableItem token

func (*VariableItem) Clone

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

Clone returns a copy of the token and all its children

func (*VariableItem) Follow

func (v *VariableItem) Follow() bool

Follow returns if the children of the token should be traversed

func (*VariableItem) Get

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

Get returns the current referenced token

func (*VariableItem) Index

func (v *VariableItem) Index() int

Index returns the index of this token in its parent token

func (*VariableItem) InternalGet

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

InternalGet returns the current referenced internal token

func (*VariableItem) InternalLogicalRemove

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

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

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

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

Permutation sets a specific permutation for this token

func (*VariableItem) Permutations

func (v *VariableItem) Permutations() uint

Permutations returns the number of permutations for this token

func (*VariableItem) PermutationsAll

func (v *VariableItem) PermutationsAll() uint

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

func (*VariableItem) SetScope

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

SetScope sets the scope of the token

func (*VariableItem) String

func (v *VariableItem) String() string

type VariableReference

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

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

func NewVariableReference

func NewVariableReference(variable token.VariableToken) *VariableReference

NewVariableReference returns a new instance of a VariableReference token

func (*VariableReference) Clone

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

Clone returns a copy of the token and all its children

func (*VariableReference) Follow

func (v *VariableReference) Follow() bool

Follow returns if the children of the token should be traversed

func (*VariableReference) Index

func (v *VariableReference) Index() int

Index returns the index of this token in its parent token

func (*VariableReference) Parse

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

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

Permutation sets a specific permutation for this token

func (*VariableReference) Permutations

func (v *VariableReference) Permutations() uint

Permutations returns the number of permutations for this token

func (*VariableReference) PermutationsAll

func (v *VariableReference) PermutationsAll() uint

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

func (*VariableReference) Reference

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

Reference returns the referenced token

func (*VariableReference) SetScope

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

SetScope sets the scope of the token

func (*VariableReference) String

func (v *VariableReference) String() string

type VariableSave

type VariableSave struct {
	Variable
}

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

func NewVariableSave

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

NewVariableSave returns a new instance of a VariableSave token

func (*VariableSave) Clone

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

Clone returns a copy of the token and all its children

func (*VariableSave) String

func (v *VariableSave) String() string

type VariableValue

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

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

func NewVariableValue

func NewVariableValue(variable token.VariableToken) *VariableValue

NewVariableValue returns a new instance of a VariableValue token

func (*VariableValue) Clone

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

Clone returns a copy of the token and all its children

func (*VariableValue) Get

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

Get returns the current referenced token

func (*VariableValue) Index

func (v *VariableValue) Index() int

Index returns the index of this token in its parent token

func (*VariableValue) InternalGet

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

InternalGet returns the current referenced internal token

func (*VariableValue) InternalLogicalRemove

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

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

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

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

Permutation sets a specific permutation for this token

func (*VariableValue) Permutations

func (v *VariableValue) Permutations() uint

Permutations returns the number of permutations for this token

func (*VariableValue) PermutationsAll

func (v *VariableValue) PermutationsAll() uint

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

func (*VariableValue) SetScope

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

SetScope sets the scope of the token

func (*VariableValue) String

func (v *VariableValue) String() string

Jump to

Keyboard shortcuts

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