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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
|
%{
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
* Copyright (C) 2011 Brian Aker
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <cstring>
#ifndef DRIZZLED_SQL_RESERVED_WORDS_H
#define DRIZZLED_SQL_RESERVED_WORDS_H
/* This file includes all SQL:2003 reserved words */
namespace drizzled {
namespace sql {
enum keyword_t {
ABS,
ALL,
ALLOCATE,
ALTER,
AND,
ANY,
ARE,
ARRAY,
AS,
ASENSITIVE,
ASYMMETRIC,
AT,
ATOMIC,
AUTHORIZATION,
AVG,
BEGIN,
BETWEEN,
BIGINT,
BINARY,
BLOB,
BOOLEAN,
BOTH,
BY,
CALL,
CALLED,
CARDINALITY,
CASCADED,
CASE,
CAST,
CEIL,
CEILING,
CHAR,
CHARACTER,
CHARACTER_LENGTH,
CHAR_LENGTH,
CHECK,
CLOB,
CLOSE,
COALESCE,
COLLATE,
COLLECT,
COLUMN,
COMMIT,
CONDITION,
CONNECT,
CONSTRAINT,
CONVERT,
CORR,
CORRESPONDING,
COUNT,
COVAR_POP,
COVAR_SAMP,
CREATE,
CROSS,
CUBE,
CUME_DIST,
CURRENT,
CURRENT_DATE,
CURRENT_DEFAULT_TRANSFORM_GROUP,
CURRENT_PATH,
CURRENT_ROLE,
CURRENT_TIME,
CURRENT_TIMESTAMP,
CURRENT_TRANSFORM_GROUP_FOR_TYPE,
CURRENT_USER,
CURSOR,
CYCLE,
DATE,
DAY,
DEALLOCATE,
DEC,
DECIMAL,
DECLARE,
DEFAULT,
DELETE,
DENSE_RANK,
DEREF,
DESCRIBE,
DETERMINISTIC,
DISCONNECT,
DISTINCT,
DOUBLE,
DROP,
DYNAMIC,
EACH,
ELEMENT,
ELSE,
END,
ESCAPE,
EVERY,
EXCEPT,
EXEC,
EXECUTE,
EXISTS,
EXP,
EXTERNAL,
EXTRACT,
FALSE,
FETCH,
FILTER,
FLOAT,
FLOOR,
FOR,
FOREIGN,
FREE,
FROM,
FULL,
FUNCTION,
FUSION,
GET,
GLOBAL,
GRANT,
GROUP,
GROUPING,
HAVING,
HOLD,
HOUR,
IDENTITY,
IN,
INDICATOR,
INNER,
INOUT,
INSENSITIVE,
INSERT,
INT,
INTEGER,
INTERSECT,
INTERSECTION,
INTERVAL,
INTO,
IS,
JOIN,
LANGUAGE,
LARGE,
LATERAL,
LEADING,
LEFT,
LIKE,
LN,
LOCAL,
LOCALTIME,
LOCALTIMESTAMP,
LOWER,
MATCH,
MAX,
MEMBER,
MERGE,
METHOD,
MIN,
MINUTE,
MOD,
MODIFIES,
MODULE,
MONTH,
MULTISET,
NATIONAL,
NATURAL,
NCHAR,
NCLOB,
NEW,
NO,
NONE,
NORMALIZE,
NOT,
NULL_SYM,
NULLIF,
NUMERIC,
OCTET_LENGTH,
OF,
OLD,
ON,
ONLY,
OPEN,
OR,
ORDER,
OUT,
OUTER,
OVER,
OVERLAPS,
OVERLAY,
PARAMETER,
PARTITION,
PERCENTILE_CONT,
PERCENTILE_DISC,
PERCENT_RANK,
POSITION,
POWER,
PRECISION,
PREPARE,
PRIMARY,
PROCEDURE,
RANGE,
RANK,
READS,
REAL,
RECURSIVE,
REF,
REFERENCES,
REFERENCING,
REGR_AVGX,
REGR_AVGY,
REGR_COUNT,
REGR_INTERCEPT,
REGR_R2,
REGR_SLOPE,
REGR_SXX,
REGR_SXY,
REGR_SYY,
RELEASE,
RESULT,
RETURN,
RETURNS,
REVOKE,
RIGHT,
ROLLBACK,
ROLLUP,
ROW,
ROWS,
ROW_NUMBER,
SAVEPOINT,
SCOPE,
SCROLL,
SEARCH,
SECOND,
SELECT,
SENSITIVE,
SESSION_USER,
SET,
SIMILAR,
SMALLINT,
SOME,
SPECIFIC,
SPECIFICTYPE,
SQL,
SQLEXCEPTION,
SQLSTATE,
SQLWARNING,
SQRT,
START,
STATIC,
STDDEV_POP,
STDDEV_SAMP,
SUBMULTISET,
SUBSTRING,
SUM,
SYMMETRIC,
SYSTEM,
SYSTEM_USER,
TABLE,
TABLESAMPLE,
THEN,
TIME,
TIMESTAMP,
TIMEZONE_HOUR,
TIMEZONE_MINUTE,
TO,
TRAILING,
TRANSLATE,
TRANSLATION,
TREAT,
TRIGGER,
TRIM,
TRUE,
UESCAPE,
UNION,
UNIQUE,
UNKNOWN,
UNNEST,
UPDATE,
UPPER,
USER,
USING,
VALUE,
VALUES,
VARCHAR,
VARYING,
VAR_POP,
VAR_SAMP,
WHEN,
WHENEVER,
WHERE,
WIDTH_BUCKET,
WINDOW,
WITH,
WITHIN,
WITHOUT,
XML,
XMLAGG,
XMLATTRIBUTES,
XMLBINARY,
XMLCOMMENT,
XMLCONCAT,
XMLELEMENT,
XMLFOREST,
XMLNAMESPACES,
XMLPARSE,
XMLPI,
XMLROOT,
XMLSERIALIZE,
YEAR
};
} // namespace sql
struct keyword_st
{
const char* name;
sql::keyword_t code;
};
%}
struct keyword_st
{
const char* name;
sql::keyword_t code;
};
%%
ABS, sql::ABS
ALL, sql::ALL
ALLOCATE, sql::ALLOCATE
ALTER, sql::ALTER
AND, sql::AND
ANY, sql::ANY
ARE, sql::ARE
ARRAY, sql::ARRAY
AS, sql::AS
ASENSITIVE, sql::ASENSITIVE
ASYMMETRIC, sql::ASYMMETRIC
AT, sql::AT
ATOMIC, sql::ATOMIC
AUTHORIZATION, sql::AUTHORIZATION
AVG, sql::AVG
BEGIN, sql::BEGIN
BETWEEN, sql::BETWEEN
BIGINT, sql::BIGINT
BINARY, sql::BINARY
BLOB, sql::BLOB
BOOLEAN, sql::BOOLEAN
BOTH, sql::BOTH
BY, sql::BY
CALL, sql::CALL
CALLED, sql::CALLED
CARDINALITY, sql::CARDINALITY
CASCADED, sql::CASCADED
CASE, sql::CASE
CAST, sql::CAST
CEIL, sql::CEIL
CEILING, sql::CEILING
CHAR, sql::CHAR
CHARACTER, sql::CHARACTER
CHARACTER_LENGTH, sql::CHARACTER_LENGTH
CHAR_LENGTH, sql::CHAR_LENGTH
CHECK, sql::CHECK
CLOB, sql::CLOB
CLOSE, sql::CLOSE
COALESCE, sql::COALESCE
COLLATE, sql::COLLATE
COLLECT, sql::COLLECT
COLUMN, sql::COLUMN
COMMIT, sql::COMMIT
CONDITION, sql::CONDITION
CONNECT, sql::CONNECT
CONSTRAINT, sql::CONSTRAINT
CONVERT, sql::CONVERT
CORR, sql::CORR
CORRESPONDING, sql::CORRESPONDING
COUNT, sql::COUNT
COVAR_POP, sql::COVAR_POP
COVAR_SAMP, sql::COVAR_SAMP
CREATE, sql::CREATE
CROSS, sql::CROSS
CUBE, sql::CUBE
CUME_DIST, sql::CUME_DIST
CURRENT, sql::CURRENT
CURRENT_DATE, sql::CURRENT_DATE
CURRENT_DEFAULT_TRANSFORM_GROUP, sql::CURRENT_DEFAULT_TRANSFORM_GROUP
CURRENT_PATH, sql::CURRENT_PATH
CURRENT_ROLE, sql::CURRENT_ROLE
CURRENT_TIME, sql::CURRENT_TIME
CURRENT_TIMESTAMP, sql::CURRENT_TIMESTAMP
CURRENT_TRANSFORM_GROUP_FOR_TYPE, sql::CURRENT_TRANSFORM_GROUP_FOR_TYPE
CURRENT_USER, sql::CURRENT_USER
CURSOR, sql::CURSOR
CYCLE, sql::CYCLE
DATE, sql::DATE
DAY, sql::DAY
DEALLOCATE, sql::DEALLOCATE
DEC, sql::DEC
DECIMAL, sql::DECIMAL
DECLARE, sql::DECLARE
DEFAULT, sql::DEFAULT
DELETE, sql::DELETE
DENSE_RANK, sql::DENSE_RANK
DEREF, sql::DEREF
DESCRIBE, sql::DESCRIBE
DETERMINISTIC, sql::DETERMINISTIC
DISCONNECT, sql::DISCONNECT
DISTINCT, sql::DISTINCT
DOUBLE, sql::DOUBLE
DROP, sql::DROP
DYNAMIC, sql::DYNAMIC
EACH, sql::EACH
ELEMENT, sql::ELEMENT
ELSE, sql::ELSE
END, sql::END
ESCAPE, sql::ESCAPE
EVERY, sql::EVERY
EXCEPT, sql::EXCEPT
EXEC, sql::EXEC
EXECUTE, sql::EXECUTE
EXISTS, sql::EXISTS
EXP, sql::EXP
EXTERNAL, sql::EXTERNAL
EXTRACT, sql::EXTRACT
FALSE, sql::FALSE
FETCH, sql::FETCH
FILTER, sql::FILTER
FLOAT, sql::FLOAT
FLOOR, sql::FLOOR
FOR, sql::FOR
FOREIGN, sql::FOREIGN
FREE, sql::FREE
FROM, sql::FROM
FULL, sql::FULL
FUNCTION, sql::FUNCTION
FUSION, sql::FUSION
GET, sql::GET
GLOBAL, sql::GLOBAL
GRANT, sql::GRANT
GROUP, sql::GROUP
GROUPING, sql::GROUPING
HAVING, sql::HAVING
HOLD, sql::HOLD
HOUR, sql::HOUR
IDENTITY, sql::IDENTITY
IN, sql::IN
INDICATOR, sql::INDICATOR
INNER, sql::INNER
INOUT, sql::INOUT
INSENSITIVE, sql::INSENSITIVE
INSERT, sql::INSERT
INT, sql::INT
INTEGER, sql::INTEGER
INTERSECT, sql::INTERSECT
INTERSECTION, sql::INTERSECTION
INTERVAL, sql::INTERVAL
INTO, sql::INTO
IS, sql::IS
JOIN, sql::JOIN
LANGUAGE, sql::LANGUAGE
LARGE, sql::LARGE
LATERAL, sql::LATERAL
LEADING, sql::LEADING
LEFT, sql::LEFT
LIKE, sql::LIKE
LN, sql::LN
LOCAL, sql::LOCAL
LOCALTIME, sql::LOCALTIME
LOCALTIMESTAMP, sql::LOCALTIMESTAMP
LOWER, sql::LOWER
MATCH, sql::MATCH
MAX, sql::MAX
MEMBER, sql::MEMBER
MERGE, sql::MERGE
METHOD, sql::METHOD
MIN, sql::MIN
MINUTE, sql::MINUTE
MOD, sql::MOD
MODIFIES, sql::MODIFIES
MODULE, sql::MODULE
MONTH, sql::MONTH
MULTISET, sql::MULTISET
NATIONAL, sql::NATIONAL
NATURAL, sql::NATURAL
NCHAR, sql::NCHAR
NCLOB, sql::NCLOB
NEW, sql::NEW
NO, sql::NO
NONE, sql::NONE
NORMALIZE, sql::NORMALIZE
NOT, sql::NOT
NULL, sql::NULL_SYM
NULLIF, sql::NULLIF
NUMERIC, sql::NUMERIC
OCTET_LENGTH, sql::OCTET_LENGTH
OF, sql::OF
OLD, sql::OLD
ON, sql::ON
ONLY, sql::ONLY
OPEN, sql::OPEN
OR, sql::OR
ORDER, sql::ORDER
OUT, sql::OUT
OUTER, sql::OUTER
OVER, sql::OVER
OVERLAPS, sql::OVERLAPS
OVERLAY, sql::OVERLAY
PARAMETER, sql::PARAMETER
PARTITION, sql::PARTITION
PERCENTILE_CONT, sql::PERCENTILE_CONT
PERCENTILE_DISC, sql::PERCENTILE_DISC
PERCENT_RANK, sql::PERCENT_RANK
POSITION, sql::POSITION
POWER, sql::POWER
PRECISION, sql::PRECISION
PREPARE, sql::PREPARE
PRIMARY, sql::PRIMARY
PROCEDURE, sql::PROCEDURE
RANGE, sql::RANGE
RANK, sql::RANK
READS, sql::READS
REAL, sql::REAL
RECURSIVE, sql::RECURSIVE
REF, sql::REF
REFERENCES, sql::REFERENCES
REFERENCING, sql::REFERENCING
REGR_AVGX, sql::REGR_AVGX
REGR_AVGY, sql::REGR_AVGY
REGR_COUNT, sql::REGR_COUNT
REGR_INTERCEPT, sql::REGR_INTERCEPT
REGR_R2, sql::REGR_R2
REGR_SLOPE, sql::REGR_SLOPE
REGR_SXX, sql::REGR_SXX
REGR_SXY, sql::REGR_SXY
REGR_SYY, sql::REGR_SYY
RELEASE, sql::RELEASE
RESULT, sql::RESULT
RETURN, sql::RETURN
RETURNS, sql::RETURNS
REVOKE, sql::REVOKE
RIGHT, sql::RIGHT
ROLLBACK, sql::ROLLBACK
ROLLUP, sql::ROLLUP
ROW, sql::ROW
ROWS, sql::ROWS
ROW_NUMBER, sql::ROW_NUMBER
SAVEPOINT, sql::SAVEPOINT
SCOPE, sql::SCOPE
SCROLL, sql::SCROLL
SEARCH, sql::SEARCH
SECOND, sql::SECOND
SELECT, sql::SELECT
SENSITIVE, sql::SENSITIVE
SESSION_USER, sql::SESSION_USER
SET, sql::SET
SIMILAR, sql::SIMILAR
SMALLINT, sql::SMALLINT
SOME, sql::SOME
SPECIFIC, sql::SPECIFIC
SPECIFICTYPE, sql::SPECIFICTYPE
SQL, sql::SQL
SQLEXCEPTION, sql::SQLEXCEPTION
SQLSTATE, sql::SQLSTATE
SQLWARNING, sql::SQLWARNING
SQRT, sql::SQRT
START, sql::START
STATIC, sql::STATIC
STDDEV_POP, sql::STDDEV_POP
STDDEV_SAMP, sql::STDDEV_SAMP
SUBMULTISET, sql::SUBMULTISET
SUBSTRING, sql::SUBSTRING
SUM, sql::SUM
SYMMETRIC, sql::SYMMETRIC
SYSTEM, sql::SYSTEM
SYSTEM_USER, sql::SYSTEM_USER
TABLE, sql::TABLE
TABLESAMPLE, sql::TABLESAMPLE
THEN, sql::THEN
TIME, sql::TIME
TIMESTAMP, sql::TIMESTAMP
TIMEZONE_HOUR, sql::TIMEZONE_HOUR
TIMEZONE_MINUTE, sql::TIMEZONE_MINUTE
TO, sql::TO
TRAILING, sql::TRAILING
TRANSLATE, sql::TRANSLATE
TRANSLATION, sql::TRANSLATION
TREAT, sql::TREAT
TRIGGER, sql::TRIGGER
TRIM, sql::TRIM
TRUE, sql::TRUE
UESCAPE, sql::UESCAPE
UNION, sql::UNION
UNIQUE, sql::UNIQUE
UNKNOWN, sql::UNKNOWN
UNNEST, sql::UNNEST
UPDATE, sql::UPDATE
UPPER, sql::UPPER
USER, sql::USER
USING, sql::USING
VALUE, sql::VALUE
VALUES, sql::VALUES
VARCHAR, sql::VARCHAR
VARYING, sql::VARYING
VAR_POP, sql::VAR_POP
VAR_SAMP, sql::VAR_SAMP
WHEN, sql::WHEN
WHENEVER, sql::WHENEVER
WHERE, sql::WHERE
WIDTH_BUCKET, sql::WIDTH_BUCKET
WINDOW, sql::WINDOW
WITH, sql::WITH
WITHIN, sql::WITHIN
WITHOUT, sql::WITHOUT
XML, sql::XML
XMLAGG, sql::XMLAGG
XMLATTRIBUTES, sql::XMLATTRIBUTES
XMLBINARY, sql::XMLBINARY
XMLCOMMENT, sql::XMLCOMMENT
XMLCONCAT, sql::XMLCONCAT
XMLELEMENT, sql::XMLELEMENT
XMLFOREST, sql::XMLFOREST
XMLNAMESPACES, sql::XMLNAMESPACES
XMLPARSE, sql::XMLPARSE
XMLPI, sql::XMLPI
XMLROOT, sql::XMLROOT
XMLSERIALIZE, sql::XMLSERIALIZE
YEAR, sql::YEAR
%%
} // namespace drizzled
#endif /* DRIZZLED_SQL_RESERVED_WORDS_H */
|