Documentation ¶
Index ¶
- Constants
- func MakeValueOf(t string, v interface{}) *typedValue
- func WrapValue(v expr.TypedValue) *typedValue
- type ASTNode
- type ASTNodeSet
- type FunctionHandler
- type Ident
- type IdentHandler
- type Lexer
- type Parser
- type RuneReader
- type Token
- type TokenConsumerComma
- type TokenConsumerGeneric
- type TokenConsumerIdent
- type TokenConsumerNumber
- type TokenConsumerOperator
- type TokenConsumerString
- type TokenConsumerWS
- type TokenConsumers
Constants ¶
View Source
const ( CHAR_WHITELIST_WHITESPACE = " \n\t" CHAR_WHITELIST_OPERATORS = "!+-/*=<>&|" CHAR_WHITELIST_QUOTES = "'" )
View Source
const ( // Special tokens ILLEGAL tokenCode = iota EOF WS // 2 IDENT LNULL LBOOL // 4 LNUMBER LSTRING COMMA // , DOT // . OPERATOR // + - / * PARENTHESIS_OPEN PARENTHESIS_CLOSE KEYWORD )
Variables ¶
This section is empty.
Functions ¶
func MakeValueOf ¶
func MakeValueOf(t string, v interface{}) *typedValue
func WrapValue ¶
func WrapValue(v expr.TypedValue) *typedValue
Types ¶
type ASTNode ¶
type ASTNode struct { // Meta holds additional node data // while processing the AST Meta map[string]any `json:"-"` Ref string `json:"ref,omitempty"` Args ASTNodeSet `json:"args,omitempty"` Symbol string `json:"symbol,omitempty"` Value *typedValue `json:"value,omitempty"` Raw string `json:"raw,omitempty"` // contains filtered or unexported fields }
func (*ASTNode) CollectSymbols ¶
type ASTNodeSet ¶
type ASTNodeSet []*ASTNode
type FunctionHandler ¶
type FunctionHandler func(ident function) (parserNode, error)
type Ident ¶
type Ident struct { Value string // contains filtered or unexported fields }
SelectStatement represents a SQL SELECT statement.
type IdentHandler ¶
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
Lexer represents a lexical scanner.
type Parser ¶
type Parser struct { OnIdent IdentHandler OnFunction FunctionHandler // contains filtered or unexported fields }
Parser represents a parser.
type RuneReader ¶
type RuneReader interface {
// contains filtered or unexported methods
}
Lexer represents a lexical scanner.
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
Lexer represents a lexical scanner.
type TokenConsumerComma ¶
type TokenConsumerComma struct{}
type TokenConsumerGeneric ¶
type TokenConsumerGeneric struct {
// contains filtered or unexported fields
}
func (TokenConsumerGeneric) Consume ¶
func (g TokenConsumerGeneric) Consume(s RuneReader) Token
func (TokenConsumerGeneric) Test ¶
func (g TokenConsumerGeneric) Test(ch rune) bool
type TokenConsumerIdent ¶
type TokenConsumerIdent struct{}
func (TokenConsumerIdent) Consume ¶
func (TokenConsumerIdent) Consume(s RuneReader) Token
Consumes the current rune and all contiguous ident runes.
func (TokenConsumerIdent) Test ¶
func (i TokenConsumerIdent) Test(ch rune) bool
type TokenConsumerNumber ¶
type TokenConsumerNumber struct{}
func (TokenConsumerNumber) Consume ¶
func (str TokenConsumerNumber) Consume(s RuneReader) Token
Consumes entire number (very naive and simplified)
func (TokenConsumerNumber) Test ¶
func (str TokenConsumerNumber) Test(ch rune) bool
type TokenConsumerOperator ¶
type TokenConsumerOperator struct{}
type TokenConsumerString ¶
type TokenConsumerString struct{}
func (TokenConsumerString) Consume ¶
func (str TokenConsumerString) Consume(s RuneReader) Token
Consumes entire string (skipping quotes)
func (TokenConsumerString) Test ¶
func (str TokenConsumerString) Test(ch rune) bool
type TokenConsumerWS ¶
type TokenConsumerWS struct{}
type TokenConsumers ¶
type TokenConsumers interface { Test(ch rune) bool Consume(s RuneReader) Token }
Lexer represents a lexical scanner.
Click to show internal directories.
Click to hide internal directories.