lexer

package
v0.0.0-...-727adce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenTrue = iota
	TokenFalse
	UnquotedString
	SingleQuotedString
	DoubleQuotedString
	OpenParens
	CloseParens
	OpenSquareBracket
	CloseSquareBracket
	OpenCurlyBrace
	CloseCurlyBrace
	Colon
	Not
	Equals
	NotEquals
	GreaterThan
	GreaterThanOrEqual
	LessThan
	LessThanOrEqual
	Has
	In
	Concat
	Contains
	EndsWith
	IndexOf
	Length
	StartsWith
	Substring
	HasSubset
	HasSubsequence
	MatchesPattern
	ToLower
	ToUpper
	Trim
	Day
	FractionalSeconds
	Hour
	Minute
	Month
	Second
	Year
	Ceiling
	Floor
	Round
	Add
	Subtract
	Multiply
	Divide
	DivideFloat
	Modulo
	And
	Or
	NullLiteral
	FloatingPointLiteral
	IntegerLiteral
	Comma
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Lexer

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

func NewLexer

func NewLexer(input string) *Lexer

func (*Lexer) NextToken

func (l *Lexer) NextToken() (*Token, error)

type NoMatchingTokenError

type NoMatchingTokenError struct {
	Position int
}

func (NoMatchingTokenError) Error

func (e NoMatchingTokenError) Error() string

type Token

type Token struct {
	Type  TokenKey
	Start int
	End   int
	Text  string
}

func (Token) GetData

func (t Token) GetData() (interface{}, error)

func (*Token) HasParameters

func (t *Token) HasParameters() bool

func (*Token) IsAdditive

func (t *Token) IsAdditive() bool

func (*Token) IsCorrectReplacement

func (t *Token) IsCorrectReplacement(index int) bool

func (*Token) IsEquality

func (t *Token) IsEquality() bool

func (*Token) IsMultiplicative

func (t *Token) IsMultiplicative() bool

func (*Token) IsRelational

func (t *Token) IsRelational() bool

func (*Token) IsUnary

func (t *Token) IsUnary() bool

func (*Token) Replace

func (t *Token) Replace(operand interface{}) error

type TokenKey

type TokenKey int

func (TokenKey) HasParameters

func (t TokenKey) HasParameters() bool

func (*TokenKey) MarshalJSON

func (t *TokenKey) MarshalJSON() ([]byte, error)

func (TokenKey) String

func (t TokenKey) String() string

type TokenType

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

type UnsupportedReplacementError

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

func (UnsupportedReplacementError) Error

Jump to

Keyboard shortcuts

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