-
Notifications
You must be signed in to change notification settings - Fork 1
/
token.go
80 lines (72 loc) · 1.23 KB
/
token.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package awqlparse
/*
Base AWQL grammar
https://developers.google.com/adwords/api/docs/guides/awql#grammar
Extended AWQL grammar
https://github.com/rvflash/awql/
*/
// Token represents a lexical token.
type Token int
// List of special runes or reserved keywords.
const (
// Special tokens
ILLEGAL Token = iota
EOF
DIGIT // [0-9]
DECIMAL // [0-9.]
G_MODIFIER // \G ou \g
// Literals
IDENTIFIER // base element
WHITE_SPACE // white space
STRING // char between single or double quotes
STRING_LIST
VALUE_LITERAL // [a-zA-Z0-9_.]
VALUE_LITERAL_LIST
// Misc characters
ASTERISK // *
COMMA // ,
LEFT_PARENTHESIS // (
RIGHT_PARENTHESIS // )
LEFT_SQUARE_BRACKETS // [
RIGHT_SQUARE_BRACKETS // ]
SEMICOLON // ;
// Operator
EQUAL // =
DIFFERENT // !=
SUPERIOR // >
SUPERIOR_OR_EQUAL // >=
INFERIOR // <
INFERIOR_OR_EQUAL // <=
IN
NOT_IN
STARTS_WITH
STARTS_WITH_IGNORE_CASE
CONTAINS
CONTAINS_IGNORE_CASE
DOES_NOT_CONTAIN
DOES_NOT_CONTAIN_IGNORE_CASE
// Base keywords
DESCRIBE
SELECT
CREATE
REPLACE
VIEW
SHOW
FULL
TABLES
DISTINCT
AS
FROM
WHERE
LIKE
WITH
AND
OR
DURING
ORDER
GROUP
BY
ASC
DESC
LIMIT
)