parse

package
v0.0.0-...-280af2a Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AndExpr

type AndExpr struct {
	Left, Right BoolExpr
}

AndExpr represents an AND expression.

type ArrayLit

type ArrayLit struct {
	Values []ValExpr
}

ArrayLit represents an array literal.

type BasicLit

type BasicLit struct {
	Kind  Literal // INT, REAL, TEXT
	Value []byte
}

BasicLit represents a basic literal.

type BoolExpr

type BoolExpr interface {
	Node
	// contains filtered or unexported methods
}

BoolExpr defines a boolean expression.

type ComparisonExpr

type ComparisonExpr struct {
	Operator    Operator
	Left, Right ValExpr
}

ComparisonExpr represents a two-value comparison expression.

type Field

type Field struct {
	Name []byte
}

Field represents a value lookup by name.

type Literal

type Literal int

Literal identifies the type of literal.

const (
	LiteralBool Literal = iota
	LiteralInt
	LiteralReal
	LiteralText
)

The list of possible literal kinds.

type Node

type Node interface {
	// contains filtered or unexported methods
}

Node is an element in the parse tree.

type NotExpr

type NotExpr struct {
	Expr BoolExpr
}

NotExpr represents a NOT expression.

type Operator

type Operator int

Operator identifies the type of operator.

const (
	OperatorEq Operator = iota
	OperatorLt
	OperatorLte
	OperatorGt
	OperatorGte
	OperatorNeq
	OperatorIn
	OperatorRe
	OperatorGlob
	OperatorNotIn
	OperatorNotRe
	OperatorNotGlob
)

Comparison operators.

type OrExpr

type OrExpr struct {
	Left, Right BoolExpr
}

OrExpr represents an OR expression.

type ParenBoolExpr

type ParenBoolExpr struct {
	Expr BoolExpr
}

ParenBoolExpr represents a parenthesized boolean expression.

type Tree

type Tree struct {
	Root BoolExpr
	// contains filtered or unexported fields
}

Tree is the representation of a single parsed SQL statement.

func Parse

func Parse(buf []byte) (*Tree, error)

Parse parses the SQL statement and returns a Tree.

func (*Tree) Parse

func (t *Tree) Parse(buf []byte) (tree *Tree, err error)

Parse parses the SQL statement buffer to construct an ast representation for execution.

type ValExpr

type ValExpr interface {
	Node
	// contains filtered or unexported methods
}

ValExpr defines a value expression.

Jump to

Keyboard shortcuts

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