/*--------------------------------------------------------------------
 * Symbols referenced in this file:
 * - ReservedPLKeywords
 * - ReservedPLKeywords_kw_string
 * - ReservedPLKeywords_kw_offsets
 * - ReservedPLKeywords_hash_func
 *--------------------------------------------------------------------
 */

/*-------------------------------------------------------------------------
 *
 * pl_reserved_kwlist_d.h
 *    List of keywords represented as a ScanKeywordList.
 *
 * Portions Copyright (c) 1996-2024, 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 */
