1 /* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
2 
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License, version 2.0,
5    as published by the Free Software Foundation.
6 
7    This program is also distributed with certain software (including
8    but not limited to OpenSSL) that is licensed under separate terms,
9    as designated in a particular file or component or in included license
10    documentation.  The authors of MySQL hereby grant you an additional
11    permission to link the program and your derivative works with the
12    separately licensed software that they have included with MySQL.
13 
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License, version 2.0, for more details.
18 
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
22 
23 /* This struct includes all reserved words and functions */
24 
25 #ifndef _lex_symbol_h
26 #define _lex_symbol_h
27 
28 enum SYM_GROUP {
29   SG_KEYWORDS = 1 << 0,           // SQL keywords and reserved words
30   SG_FUNCTIONS = 1 << 1,          // very special native SQL functions
31   SG_HINTABLE_KEYWORDS = 1 << 2,  // SQL keywords that accept optimizer hints
32   SG_HINTS = 1 << 3,              // optimizer hint parser keywords
33 
34   /* All tokens of the main parser: */
35   SG_MAIN_PARSER = SG_KEYWORDS | SG_HINTABLE_KEYWORDS | SG_FUNCTIONS
36 };
37 
38 struct SYMBOL {
39   const char *name;
40   const unsigned int length;
41   const unsigned int tok;
42   /** group mask, see SYM_GROUP enum for bits. */
43   int group;
44 };
45 
46 struct LEX_SYMBOL {
47   const SYMBOL *symbol;
48   char *str;
49   unsigned int length;
50 };
51 
52 #endif /* _lex_symbol_h */
53