Documentation ¶
Overview ¶
Package parser implements a SQL parser with respect to the SQLite grammar. https://www.sqlite.org/lang.html
Index ¶
Constants ¶
View Source
const ( ErrIncompleteStatement = Error("incomplete statement") ErrPrematureEOF = Error("unexpectedly reached EOF") ErrScanner = Error("scanner") ErrUnexpectedToken = Error("unexpected token") ErrUnknownToken = Error("unknown token") ErrUnsupportedConstruct = Error("unsupported construct") )
parser errors
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser interface { // Next returns stmt=<statement>, errs=nil, ok=true if a statement was // parsed successfully without any parse errors. If there were parse errors, // Next will return stmt=<statement>, errs=([]error), ok=true. // // stmt always is the statement that was parsed. If it could not be parsed // free of errors, the statement might be incomplete or incorrect, but // efforts will be taken to parse as much out of the given input as // possible. ok indicates whether any statement could have been parsed, or // more precisely, if the underlying scanner had any more tokens. // // If ok=false, that means that the parser has reached its EOF and no more // statements can be returned. Subsequent calls to Next will result in // stmt=nil, errs=nil, ok=false. Next() (stmt *ast.SQLStmt, errs []error, ok bool) }
Parser describes a parser that returns (maybe multiple) SQLStatements from a given input.
func NewSimpleParser ¶
NewSimpleParser creates new ready to use parser.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package ast implements an abstract syntax tree that represents SQL statements.
|
Package ast implements an abstract syntax tree that represents SQL statements. |
Package scanner implements a tokenizer that creates tokens of the SQLite grammar.
|
Package scanner implements a tokenizer that creates tokens of the SQLite grammar. |
matcher
Package matcher implements a matcher component, that can determine whether or not a rune is part of a custom character class.
|
Package matcher implements a matcher component, that can determine whether or not a rune is part of a custom character class. |
ruleset
Package ruleset implements rules that can be used in combination with a rule based scanner.
|
Package ruleset implements rules that can be used in combination with a rule based scanner. |
token
Package token implements tokens that are produced by the scanner.
|
Package token implements tokens that are produced by the scanner. |
Click to show internal directories.
Click to hide internal directories.