1 /*-------------------------------------------------------------------------
2 *
3 * pl_reserved_kwlist_d.h
4 * List of keywords represented as a ScanKeywordList.
5 *
6 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * NOTES
10 * ******************************
11 * *** DO NOT EDIT THIS FILE! ***
12 * ******************************
13 *
14 * It has been GENERATED by src/tools/gen_keywordlist.pl
15 *
16 *-------------------------------------------------------------------------
17 */
18
19 #ifndef PL_RESERVED_KWLIST_D_H
20 #define PL_RESERVED_KWLIST_D_H
21
22 #include "common/kwlookup.h"
23
24 static const char ReservedPLKeywords_kw_string[] =
25 "all\0"
26 "begin\0"
27 "by\0"
28 "case\0"
29 "declare\0"
30 "else\0"
31 "end\0"
32 "execute\0"
33 "for\0"
34 "foreach\0"
35 "from\0"
36 "if\0"
37 "in\0"
38 "into\0"
39 "loop\0"
40 "not\0"
41 "null\0"
42 "or\0"
43 "strict\0"
44 "then\0"
45 "to\0"
46 "using\0"
47 "when\0"
48 "while";
49
50 static const uint16 ReservedPLKeywords_kw_offsets[] = {
51 0,
52 4,
53 10,
54 13,
55 18,
56 26,
57 31,
58 35,
59 43,
60 47,
61 55,
62 60,
63 63,
64 66,
65 71,
66 76,
67 80,
68 85,
69 88,
70 95,
71 100,
72 103,
73 109,
74 114,
75 };
76
77 #define RESERVEDPLKEYWORDS_NUM_KEYWORDS 24
78
79 static int
ReservedPLKeywords_hash_func(const void * key,size_t keylen)80 ReservedPLKeywords_hash_func(const void *key, size_t keylen)
81 {
82 static const int8 h[49] = {
83 127, 0, 15, 127, 9, 127, 127, 127,
84 -14, 23, 127, 0, 127, 8, -7, 127,
85 0, 127, 127, 4, 5, 127, 127, 22,
86 10, -6, 127, -20, 127, -2, -5, 127,
87 1, 22, -6, 14, 0, 0, 127, 13,
88 0, -1, 127, 127, 21, 23, 7, 12,
89 0
90 };
91
92 const unsigned char *k = (const unsigned char *) key;
93 uint32 a = 0;
94 uint32 b = 9;
95
96 while (keylen--)
97 {
98 unsigned char c = *k++ | 0x20;
99
100 a = a * 257 + c;
101 b = b * 17 + c;
102 }
103 return h[a % 49] + h[b % 49];
104 }
105
106 static const ScanKeywordList ReservedPLKeywords = {
107 ReservedPLKeywords_kw_string,
108 ReservedPLKeywords_kw_offsets,
109 ReservedPLKeywords_hash_func,
110 RESERVEDPLKEYWORDS_NUM_KEYWORDS,
111 7
112 };
113
114 #endif /* PL_RESERVED_KWLIST_D_H */
115