parser

package
v0.0.0-...-9ff550a Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ALL = 57353
View Source
const AND = 57354
View Source
const AS = 57355
View Source
const ASC = 57356
View Source
const AT = 57401
View Source
const BETWEEN = 57357
View Source
const BOOL = 57358
View Source
const BY = 57359
View Source
const CAST = 57360
View Source
const CROSS = 57361
View Source
const DESC = 57362
View Source
const DISTINCT = 57363
View Source
const ERROR = 57345
View Source
const EXCEPT = 57364
View Source
const EXISTS = 57365
View Source
const FALSE = 57367
View Source
const FCONST = 57348
View Source
const FETCH = 57368
View Source
const FIRST = 57369
View Source
const FLOAT = 57370
View Source
const FROM = 57371
View Source
const FTOP = 57366
View Source
const FULL = 57372
View Source
const GREATER_EQUALS = 57351
View Source
const GROUP = 57373
View Source
const HAVING = 57374
View Source
const ICONST = 57347
View Source
const IDENT = 57346
View Source
const INNER = 57375
View Source
const INT = 57376
View Source
const INTERSECT = 57377
View Source
const IS = 57378
View Source
const JOIN = 57379
View Source
const LEFT = 57403
View Source
const LESS_EQUALS = 57350
View Source
const NATURAL = 57380
View Source
const NEXT = 57381
View Source
const NOT = 57382
View Source
const NOT_EQUALS = 57352
View Source
const NOT_LA = 57400
View Source
const NULL = 57383
View Source
const OFFSET = 57384
View Source
const ON = 57385
View Source
const ONLY = 57386
View Source
const OR = 57387
View Source
const ORDER = 57388
View Source
const OUTER = 57389
View Source
const RIGHT = 57390
View Source
const ROW = 57391
View Source
const ROWS = 57392
View Source
const SCONST = 57349
View Source
const SELECT = 57393
View Source
const STRING = 57394
View Source
const TIME = 57396
View Source
const TOP = 57395
View Source
const TRUE = 57397
View Source
const UMINUS = 57402
View Source
const UNION = 57398
View Source
const WHERE = 57399

Variables

This section is empty.

Functions

func EndsInSemicolon

func EndsInSemicolon(sql string) bool

EndsInSemicolon returns true if the last lexical token is a semicolon.

func LastLexicalToken

func LastLexicalToken(sql string) (lastTok int, ok bool)

LastLexicalToken returns the last lexical token. If the string has no lexical tokens, returns 0 and ok=false.

func Parse

func Parse(sql string) (*tree.Select, error)

func SplitFirstStatement

func SplitFirstStatement(sql string) (pos int, ok bool)

SplitFirstStatement returns the length of the prefix of the string up to and including the first semicolon that separates statements. If there is no semicolon, returns ok=false.

Types

type Parser

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

type TokenString

type TokenString struct {
	TokenID int32
	Str     string
}

TokenString is the unit value returned by Tokens.

func Tokens

func Tokens(sql string) (tokens []TokenString, ok bool)

Tokens decomposes the input into lexical tokens.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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