~drizzle-trunk/drizzle/development

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