parser

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseQuery

func ParseQuery(s string) (query.Query, error)

ParseQuery parses a query string and returns its AST representation.

Types

type ParseError

type ParseError struct {
	Message  string
	Found    string
	Expected []string
	Pos      scanner.Pos
}

ParseError represents an error that occurred during parsing.

func (*ParseError) Error

func (e *ParseError) Error() string

Error returns the string representation of the error.

type Parser

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

Parser represents an Genji SQL Parser.

func NewParser

func NewParser(r io.Reader) *Parser

NewParser returns a new instance of Parser.

func (*Parser) ParseQuery

func (p *Parser) ParseQuery() (query.Query, error)

ParseQuery parses a Genji SQL string and returns a Query.

func (*Parser) ParseStatement

func (p *Parser) ParseStatement() (query.Statement, error)

ParseStatement parses a Genji SQL string and returns a Statement AST object.

func (*Parser) Scan

func (p *Parser) Scan() (tok scanner.Token, pos scanner.Pos, lit string)

Scan returns the next token from the underlying scanner.

func (*Parser) ScanIgnoreWhitespace

func (p *Parser) ScanIgnoreWhitespace() (tok scanner.Token, pos scanner.Pos, lit string)

ScanIgnoreWhitespace scans the next non-whitespace and non-comment token.

func (*Parser) Unscan

func (p *Parser) Unscan()

Unscan pushes the previously read token back onto the buffer.

Jump to

Keyboard shortcuts

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