parser

package
v0.0.0-...-56ee609 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AND = 57361
View Source
const (
	EOF = -1
)
View Source
const FALSE = 57359
View Source
const FLOAT = 57357
View Source
const FROM = 57348
View Source
const GE = 57365
View Source
const IDENT = 57355
View Source
const ILLEGAL = 57346
View Source
const IN = 57369
View Source
const INTEGER = 57356
View Source
const IS = 57367
View Source
const LE = 57364
View Source
const LIKE = 57368
View Source
const LIMIT = 57351
View Source
const NE = 57366
View Source
const NOT = 57363
View Source
const NULL = 57360
View Source
const OFFSET = 57352
View Source
const OR = 57362
View Source
const ORDER_BY = 57350
View Source
const SELECT = 57347
View Source
const SHOW = 57353
View Source
const TABLE = 57354
View Source
const TRUE = 57358
View Source
const WHERE = 57349

Variables

This section is empty.

Functions

This section is empty.

Types

type AndExpr

type AndExpr struct {
	Left, Right Expr
}

func (*AndExpr) Evaluate

func (e *AndExpr) Evaluate(cols []string, row value.Row) (bool, error)

func (*AndExpr) GetTargetCols

func (e *AndExpr) GetTargetCols() []string

type ColExpr

type ColExpr struct {
	Name string
}

type ComparisonExpr

type ComparisonExpr struct {
	Left     string
	Operator string
	Right    value.Value
}

func (*ComparisonExpr) Evaluate

func (e *ComparisonExpr) Evaluate(cols []string, row value.Row) (bool, error)

func (*ComparisonExpr) GetTargetCols

func (e *ComparisonExpr) GetTargetCols() []string

type Expr

type Expr interface {
	Evaluate(cols []string, row value.Row) (bool, error)
	GetTargetCols() []string
}

type FuncExpr

type FuncExpr struct {
	Name   string
	Fields SelectFieldList
}

type GroupBy

type GroupBy []string

type Lexer

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

func NewLexer

func NewLexer(sql string) *Lexer

func (*Lexer) Error

func (l *Lexer) Error(s string)

func (*Lexer) Lex

func (l *Lexer) Lex(yylval *yySymType) int

type Limit

type Limit struct {
	Offset, Rowcount int
}

type NestColExpr

type NestColExpr struct {
	Subs []string
}

type NotExpr

type NotExpr struct {
	Expr Expr
}

func (*NotExpr) Evaluate

func (e *NotExpr) Evaluate(cols []string, row value.Row) (bool, error)

func (*NotExpr) GetTargetCols

func (e *NotExpr) GetTargetCols() []string

type OrExpr

type OrExpr struct {
	Left, Right Expr
}

func (*OrExpr) Evaluate

func (e *OrExpr) Evaluate(cols []string, row value.Row) (bool, error)

func (*OrExpr) GetTargetCols

func (e *OrExpr) GetTargetCols() []string

type Order

type Order struct {
	Cols      []string
	Direction string
}

type OrderBy

type OrderBy []*Order

type Scanner

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

func NewScanner

func NewScanner(sql string) *Scanner

func (*Scanner) Scan

func (s *Scanner) Scan() (*Token, error)

type Select

type Select struct {
	Fields    SelectFieldList
	TableName string
	Where     *Where
	OrderBy   OrderBy
	GroupBy   GroupBy
	Limit     *Limit
}

func NewSelect

func NewSelect(fields SelectFieldList, table string, where *Where, limit *Limit) *Select

type SelectField

type SelectField interface {
}

type SelectFieldList

type SelectFieldList []SelectField

type ShowTable

type ShowTable struct {
}

func NewShowTable

func NewShowTable() *ShowTable

type StarExpr

type StarExpr struct {
}

type Statement

type Statement interface {
}

func Parse

func Parse(s string) (Statement, error)

type Token

type Token struct {
	Token   int
	Literal string
}

type Where

type Where struct {
	Expr Expr
}

func NewWhere

func NewWhere(expr Expr) *Where

Jump to

Keyboard shortcuts

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