Documentation ¶
Index ¶
- func IsRegexOp(t Token) bool
- func LoadTokenMap(keywordTokens map[Token]string)
- func ScanBareIdent(r io.RuneScanner) string
- func ScanDelimited(r io.RuneScanner, start, end rune, escapes map[rune]rune, escapesPassThru bool) ([]byte, error)
- func ScanString(r io.RuneScanner) (string, error)
- type Pos
- type Scanner
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadTokenMap ¶
LoadTokenMap allows for extra keywords to be added to the lexer
func ScanBareIdent ¶
func ScanBareIdent(r io.RuneScanner) string
ScanBareIdent reads bare identifier from a rune reader.
func ScanDelimited ¶
func ScanString ¶
func ScanString(r io.RuneScanner) (string, error)
ScanString reads a quoted string from a rune reader.
Types ¶
type Pos ¶
Pos specifies the line and character position of a token. The Char and Line are both zero-based indexes.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner represents a lexical scanner for InfluxQL.
func NewScanner ¶
NewScanner returns a new instance of Scanner.
type Token ¶
type Token int
Token represents each lexer symbol
const ( ILLEGAL Token = iota EOF WS LPAREN // ( RPAREN // ) LBRACKET // [ RBRACKET // ] LCURLY // { RCURLY // } COMMA // , SEMICOLON // ; COLON // : DOT // . SINGLEQUOTE // ' DOUBLEQUOTE // " PERCENT // % DOLLAR // $ HASH // # ATSIGN // @ IDENT NUMBER STRING BADSTRING BADESCAPE TRUE FALSE REGEX BADREGEX DURATION_VAL PLUS // + MINUS // - MUL // * DIV // / AMPERSAND // & XOR // ^ PIPE // | LSHIFT // << RSHIFT // >> AND // AND OR // OR EQ // = NEQ // != EQREGEX // =~ NEQREGEX // !~ LT // < LTE // <= GT // > GTE // >= )
Token enums
func (Token) Precedence ¶
Precedence returns the operator precedence of the binary operator token.
Click to show internal directories.
Click to hide internal directories.