query

package
v0.0.0-...-290f48c Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inspect

func Inspect(node Statement, f func(Statement) bool)

Inspect traverses an AST in depth-first order: It starts by calling f(node); node must not be nil. If f returns true, Inspect invokes f recursively for each of the non-nil children of node, followed by a call of f(nil).

func Walk

func Walk(v Visitor, stmt Statement)

Types

type AndStatement

type AndStatement struct {
	Left, Right Statement
}

func (*AndStatement) String

func (s *AndStatement) String() string

type Expression

type Expression struct {
	Value string
}

func (*Expression) String

func (e *Expression) String() string

type NotStatement

type NotStatement struct {
	S Statement
}

func (*NotStatement) String

func (s *NotStatement) String() string

type OrStatement

type OrStatement struct {
	Left, Right Statement
}

func (*OrStatement) String

func (s *OrStatement) String() string

type Parser

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

Parser represents a parser.

func NewParser

func NewParser(r io.Reader) *Parser

NewParser returns a new instance of Parser.

func (*Parser) Parse

func (p *Parser) Parse() (Statement, error)

type Scanner

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

Scanner represents a lexical scanner.

func NewScanner

func NewScanner(r io.Reader) *Scanner

NewScanner returns a new instance of Scanner.

func (*Scanner) Scan

func (s *Scanner) Scan() (tok Token, lit string)

Scan returns the next token and literal value.

type Statement

type Statement interface {
	String() string
	// contains filtered or unexported methods
}

type Token

type Token int
const (
	// Special tokens.
	ILLEGAL Token = iota
	EOF
	WS

	// Literals
	IDENT

	// Special characters
	// COLON       // :
	LEFT_PAREN  // (
	RIGHT_PAREN // )

	AND // AND
	OR  // OR
	NOT // NOT
)

type Visitor

type Visitor interface {
	Visit(Statement) Visitor
}

Jump to

Keyboard shortcuts

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