File: pl_reserved_kwlist_d.h

package info (click to toggle)
ruby-pg-query 5.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 18,248 kB
  • sloc: ansic: 149,767; ruby: 865; makefile: 3
file content (114 lines) | stat: -rw-r--r-- 2,074 bytes parent folder | download
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
/*-------------------------------------------------------------------------
 *
 * pl_reserved_kwlist_d.h
 *    List of keywords represented as a ScanKeywordList.
 *
 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * NOTES
 *  ******************************
 *  *** DO NOT EDIT THIS FILE! ***
 *  ******************************
 *
 *  It has been GENERATED by src/tools/gen_keywordlist.pl
 *
 *-------------------------------------------------------------------------
 */

#ifndef PL_RESERVED_KWLIST_D_H
#define PL_RESERVED_KWLIST_D_H

#include "common/kwlookup.h"

static const char ReservedPLKeywords_kw_string[] =
	"all\0"
	"begin\0"
	"by\0"
	"case\0"
	"declare\0"
	"else\0"
	"end\0"
	"execute\0"
	"for\0"
	"foreach\0"
	"from\0"
	"if\0"
	"in\0"
	"into\0"
	"loop\0"
	"not\0"
	"null\0"
	"or\0"
	"strict\0"
	"then\0"
	"to\0"
	"using\0"
	"when\0"
	"while";

static const uint16 ReservedPLKeywords_kw_offsets[] = {
	0,
	4,
	10,
	13,
	18,
	26,
	31,
	35,
	43,
	47,
	55,
	60,
	63,
	66,
	71,
	76,
	80,
	85,
	88,
	95,
	100,
	103,
	109,
	114,
};

#define RESERVEDPLKEYWORDS_NUM_KEYWORDS 24

static int
ReservedPLKeywords_hash_func(const void *key, size_t keylen)
{
	static const int8 h[49] = {
		127,   7,     127,   127,   -2,    127,   13,    127,
		127,   5,     0,     23,    0,     2,     127,   0,
		17,    0,     127,   19,    5,     127,   6,     2,
		-3,    17,    0,     6,     127,   8,     18,    127,
		-6,    3,     -5,    0,     127,   0,     0,     11,
		15,    127,   127,   127,   13,    127,   0,     17,
		127
	};

	const unsigned char *k = (const unsigned char *) key;
	uint32		a = 0;
	uint32		b = 1;

	while (keylen--)
	{
		unsigned char c = *k++ | 0x20;

		a = a * 257 + c;
		b = b * 8191 + c;
	}
	return h[a % 49] + h[b % 49];
}

static const ScanKeywordList ReservedPLKeywords = {
	ReservedPLKeywords_kw_string,
	ReservedPLKeywords_kw_offsets,
	ReservedPLKeywords_hash_func,
	RESERVEDPLKEYWORDS_NUM_KEYWORDS,
	7
};

#endif							/* PL_RESERVED_KWLIST_D_H */