Documentation ¶
Index ¶
- type BaseToken
- func (t *BaseToken) Description() any
- func (t *BaseToken) IsLiteral() bool
- func (t *BaseToken) IsOperator() bool
- func (t *BaseToken) IsOperatorOf(name string) bool
- func (t *BaseToken) IsSeperator() bool
- func (t *BaseToken) IsString() bool
- func (t *BaseToken) Line() int
- func (t *BaseToken) Position() int
- func (t *BaseToken) String() string
- func (t *BaseToken) Type() string
- func (t *BaseToken) Value() string
- type CommentDescription
- type CommentToken
- type Lexer
- func (lex *Lexer) Lex(value string) (tokens TokenList, err error)
- func (lex *Lexer) SetCommentDefinitions(descriptions []*CommentDescription)
- func (lex *Lexer) SetEscapeChar(char rune)
- func (lex *Lexer) SetOperators(descriptions []*OperatorDescription)
- func (lex *Lexer) SetSeperators(seperators string)
- func (lex *Lexer) SetStringDefinitions(descriptions []*StringDescription)
- type LexerInput
- func (in *LexerInput) Begin() *LexerInput
- func (in *LexerInput) BeginSelect()
- func (in *LexerInput) CharPosition() (position int)
- func (in *LexerInput) Current() rune
- func (in *LexerInput) CurrentString() string
- func (in *LexerInput) Cursor() int
- func (in *LexerInput) EOF() bool
- func (in *LexerInput) End()
- func (in *LexerInput) EndSelect() []rune
- func (in *LexerInput) Error(msg string) error
- func (in *LexerInput) ErrorExpected(expected string) error
- func (in *LexerInput) ExpectedChars(count int) (value string)
- func (in *LexerInput) IsLastLine() bool
- func (in *LexerInput) Line() int
- func (in *LexerInput) Next() bool
- func (in *LexerInput) Peek() rune
- func (in *LexerInput) Seek(position int, whence int) bool
- func (in *LexerInput) Skip(count int) bool
- func (in *LexerInput) SkipToEndOf(sequence string) bool
- func (in *LexerInput) SkipToStartOf(sequence string) bool
- func (in *LexerInput) StartsWith(value string) bool
- type LiteralToken
- type OperatorDescription
- type OperatorToken
- type SeperatorToken
- type StringDescription
- type StringToken
- type Token
- type TokenList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseToken ¶
type BaseToken struct { Token // contains filtered or unexported fields }
func (*BaseToken) Description ¶
func (*BaseToken) IsOperator ¶
func (*BaseToken) IsOperatorOf ¶
func (*BaseToken) IsSeperator ¶
type CommentDescription ¶
type CommentToken ¶
type CommentToken struct { *BaseToken // contains filtered or unexported fields }
func (*CommentToken) Description ¶
func (t *CommentToken) Description() any
func (*CommentToken) String ¶
func (t *CommentToken) String() string
func (*CommentToken) Type ¶
func (t *CommentToken) Type() string
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
func (*Lexer) SetCommentDefinitions ¶
func (lex *Lexer) SetCommentDefinitions(descriptions []*CommentDescription)
func (*Lexer) SetEscapeChar ¶
func (*Lexer) SetOperators ¶
func (lex *Lexer) SetOperators(descriptions []*OperatorDescription)
func (*Lexer) SetSeperators ¶
func (*Lexer) SetStringDefinitions ¶
func (lex *Lexer) SetStringDefinitions(descriptions []*StringDescription)
type LexerInput ¶
type LexerInput struct {
// contains filtered or unexported fields
}
func NewLexerInput ¶
func NewLexerInput(lexer *Lexer, value string) *LexerInput
func (*LexerInput) Begin ¶
func (in *LexerInput) Begin() *LexerInput
func (*LexerInput) BeginSelect ¶
func (in *LexerInput) BeginSelect()
func (*LexerInput) CharPosition ¶
func (in *LexerInput) CharPosition() (position int)
func (*LexerInput) Current ¶
func (in *LexerInput) Current() rune
func (*LexerInput) CurrentString ¶
func (in *LexerInput) CurrentString() string
func (*LexerInput) Cursor ¶
func (in *LexerInput) Cursor() int
func (*LexerInput) EOF ¶
func (in *LexerInput) EOF() bool
func (*LexerInput) End ¶
func (in *LexerInput) End()
func (*LexerInput) EndSelect ¶
func (in *LexerInput) EndSelect() []rune
func (*LexerInput) Error ¶
func (in *LexerInput) Error(msg string) error
func (*LexerInput) ErrorExpected ¶
func (in *LexerInput) ErrorExpected(expected string) error
func (*LexerInput) ExpectedChars ¶
func (in *LexerInput) ExpectedChars(count int) (value string)
ExpectedChars returns up to “count“ chars if the buffer has more runes in it then requested, it appends ... to the return value
func (*LexerInput) IsLastLine ¶
func (in *LexerInput) IsLastLine() bool
func (*LexerInput) Line ¶
func (in *LexerInput) Line() int
func (*LexerInput) Next ¶
func (in *LexerInput) Next() bool
func (*LexerInput) Peek ¶
func (in *LexerInput) Peek() rune
func (*LexerInput) Skip ¶
func (in *LexerInput) Skip(count int) bool
func (*LexerInput) SkipToEndOf ¶
func (in *LexerInput) SkipToEndOf(sequence string) bool
func (*LexerInput) SkipToStartOf ¶
func (in *LexerInput) SkipToStartOf(sequence string) bool
func (*LexerInput) StartsWith ¶
func (in *LexerInput) StartsWith(value string) bool
type LiteralToken ¶
type LiteralToken struct {
*BaseToken
}
func (*LiteralToken) Description ¶
func (t *LiteralToken) Description() any
func (*LiteralToken) IsLiteral ¶
func (t *LiteralToken) IsLiteral() bool
func (*LiteralToken) String ¶
func (t *LiteralToken) String() string
func (*LiteralToken) Type ¶
func (t *LiteralToken) Type() string
type OperatorDescription ¶
type OperatorToken ¶
type OperatorToken struct { *BaseToken // contains filtered or unexported fields }
func (*OperatorToken) Description ¶
func (t *OperatorToken) Description() any
func (OperatorToken) IsOperatorOf ¶
func (t OperatorToken) IsOperatorOf(name string) bool
func (*OperatorToken) String ¶
func (t *OperatorToken) String() string
func (*OperatorToken) Type ¶
func (t *OperatorToken) Type() string
type SeperatorToken ¶
type SeperatorToken struct {
*BaseToken
}
func (*SeperatorToken) Description ¶
func (t *SeperatorToken) Description() any
func (*SeperatorToken) String ¶
func (t *SeperatorToken) String() string
func (*SeperatorToken) Type ¶
func (t *SeperatorToken) Type() string
type StringDescription ¶
type StringToken ¶
type StringToken struct { *BaseToken // contains filtered or unexported fields }
func (*StringToken) Description ¶
func (t *StringToken) Description() any
func (*StringToken) String ¶
func (t *StringToken) String() string
func (*StringToken) Type ¶
func (t *StringToken) Type() string
Click to show internal directories.
Click to hide internal directories.