parse

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LastStates

func LastStates(input io.Reader) (ParseState, ParseState, error)

func Parse

func Parse(input io.Reader) (sql.Node, error)

Types

type Associativity

type Associativity byte
const (
	LeftAssoc Associativity = 1 << iota
	RightAssoc
)

type Lexer

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

func NewLexer

func NewLexer(input io.Reader) *Lexer

func (*Lexer) Backup

func (l *Lexer) Backup()

func (*Lexer) Next

func (l *Lexer) Next() *Token

func (*Lexer) Run

func (l *Lexer) Run() error

type ParseState

type ParseState uint
const (
	NilState ParseState = iota
	ErrorState
	SelectState
	SelectFieldList
	FromState
	FromRelationState
	WhereState
	WhereClauseState
	OrderState
	OrderByState
	OrderClauseState
	LimitState
	LimitNumberState
	DoneState

	ExprState
	ExprEndState
)

type Token

type Token struct {
	Type  TokenType
	Value string
	Line  uint
	Pos   uint
}

func NewToken

func NewToken(typ TokenType, value string, line, pos uint) *Token

type TokenType

type TokenType uint
const (
	ErrorToken TokenType = iota
	EOFToken
	LeftParenToken
	RightParenToken
	CommaToken
	DotToken
	KeywordToken
	IdentifierToken
	IntToken
	FloatToken
	StringToken
	OpToken
	FunctionToken
)

func (TokenType) String

func (i TokenType) String() string

Jump to

Keyboard shortcuts

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