Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Pos ¶
Pos specifies the line and character position of a token. The Char and Line are both zero-based indexes.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner represents a buffered scanner. It provides a fixed-length circular buffer that can be unread.
func NewScanner ¶
NewScanner returns a new buffered scanner for a reader.
type Token ¶
type Token int
Token is a lexical token of the Genji SQL language.
const ( // ILLEGAL Token, EOF, WS are Special Genji SQL tokens. ILLEGAL Token = iota EOF WS COMMENT // IDENT and the following are Genji SQL literal tokens. IDENT // main NAMEDPARAM // $param POSITIONALPARAM // ? NUMBER // 12345.67 INTEGER // 12345 STRING // "abc" BADSTRING // "abc BADESCAPE // \q TRUE // true FALSE // false NULL // NULL REGEX // Regular expressions BADREGEX // `.* ELLIPSIS // ... // ADD and the following are Genji SQL Operators ADD // + SUB // - MUL // * DIV // / MOD // % BITWISEAND // & BITWISEOR // | BITWISEXOR // ^ AND // AND OR // OR EQ // = NEQ // != EQREGEX // =~ NEQREGEX // !~ LT // < LTE // <= GT // > GTE // >= IN // IN NIN // NOT IN IS // IS ISN // IS NOT LIKE // LIKE NLIKE // NOT LIKE CONCAT // || BETWEEN // BETWEEN LPAREN // ( RPAREN // ) LBRACKET // { RBRACKET // } LSBRACKET // [ RSBRACKET // ] COMMA // , COLON // : DOUBLECOLON // :: SEMICOLON // ; DOT // . // ALL and the following are Genji SQL Keywords ADD_KEYWORD ALL ALTER AS ASC BEGIN BY CACHE CAST CHECK COMMIT CONFLICT CONSTRAINT CREATE CYCLE DEFAULT DELETE DESC DISTINCT DO DROP EXISTS EXPLAIN FIELD FOR FROM GROUP IF IGNORE INCREMENT INDEX INSERT INTO KEY LIMIT MAXVALUE MINVALUE NEXT NO NOT NOTHING OFFSET ON ONLY ORDER PRECISION PRIMARY READ REINDEX RENAME REPLACE RETURNING ROLLBACK SELECT SEQUENCE SET START TABLE TO TRANSACTION UNION UNIQUE UNSET UPDATE VALUE VALUES WITH WHERE WRITE // Types TYPEANY TYPEARRAY TYPEBIGINT TYPEBLOB TYPEBOOL TYPEBOOLEAN TYPEBYTES TYPECHARACTER TYPEDOCUMENT TYPEDOUBLE TYPEINT TYPEINT2 TYPEINT8 TYPEINTEGER TYPEMEDIUMINT TYPESMALLINT TYPETEXT TYPETINYINT TYPEREAL TYPEVARCHAR )
These are a comprehensive list of Genji SQL language tokens.
func AllKeywords ¶
func AllKeywords() []Token
AllKeywords returns all defined tokens corresponding to keywords.
func (Token) IsOperator ¶
IsOperator returns true for operator tokens.
func (Token) Precedence ¶
Precedence returns the operator precedence of the binary operator token.
Click to show internal directories.
Click to hide internal directories.