1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00
Files
gperf/tests/modula2.exp

188 lines
4.9 KiB
Plaintext

/* C code produced by gperf version 2.7.2 */
/* Command-line: ../src/gperf -n -k1-8 -l */
#define TOTAL_KEYWORDS 40
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 14
#define MIN_HASH_VALUE 1
#define MAX_HASH_VALUE 155
/* maximum key range = 155, duplicates = 0 */
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
static unsigned int
hash (str, len)
register const char *str;
register unsigned int len;
{
static unsigned char asso_values[] =
{
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 1, 10, 30, 25, 0,
10, 55, 6, 0, 156, 156, 15, 15, 35, 15,
30, 0, 5, 1, 0, 45, 21, 45, 6, 1,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156
};
register int hval = 0;
switch (len)
{
default:
hval += asso_values[(unsigned char)str[7]];
case 7:
hval += asso_values[(unsigned char)str[6]];
case 6:
hval += asso_values[(unsigned char)str[5]];
case 5:
hval += asso_values[(unsigned char)str[4]];
case 4:
hval += asso_values[(unsigned char)str[3]];
case 3:
hval += asso_values[(unsigned char)str[2]];
case 2:
hval += asso_values[(unsigned char)str[1]];
case 1:
hval += asso_values[(unsigned char)str[0]];
break;
}
return hval;
}
#ifdef __GNUC__
__inline
#endif
const char *
in_word_set (str, len)
register const char *str;
register unsigned int len;
{
static unsigned char lengthtable[] =
{
0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 2, 2, 0, 5,
0, 2, 4, 0, 0, 0, 2, 0, 0, 0, 0, 2, 5, 3,
0, 0, 3, 4, 4, 0, 0, 2, 6, 0, 0, 0, 2, 4,
0, 0, 0, 4, 3, 0, 0, 0, 3, 4, 0, 0, 0, 3,
6, 0, 0, 0, 3, 3, 0, 0, 0, 6, 5, 0, 0, 0,
10, 9, 0, 0, 0, 4, 0, 0, 0, 0, 6, 5, 0, 0,
0, 7, 0, 0, 0, 0, 6, 0, 0, 0, 0, 5, 0, 0,
0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0,
0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 9
};
static const char * wordlist[] =
{
"",
"SET",
"", "", "", "",
"EXIT",
"", "", "",
"IF",
"BY",
"",
"ARRAY",
"",
"TO",
"ELSE",
"", "", "",
"OR",
"", "", "", "",
"OF",
"ELSIF",
"VAR",
"", "",
"FOR",
"TYPE",
"CASE",
"", "",
"IN",
"REPEAT",
"", "", "",
"DO",
"THEN",
"", "", "",
"FROM",
"DIV",
"", "", "",
"NOT",
"WITH",
"", "", "",
"MOD",
"EXPORT",
"", "", "",
"END",
"AND",
"", "", "",
"IMPORT",
"WHILE",
"", "", "",
"DEFINITION",
"QUALIFIED",
"", "", "",
"LOOP",
"", "", "", "",
"RECORD",
"CONST",
"", "", "",
"POINTER",
"", "", "", "",
"RETURN",
"", "", "", "",
"UNTIL",
"", "", "", "",
"BEGIN",
"", "", "", "", "", "", "", "", "",
"IMPLEMENTATION",
"", "", "", "",
"MODULE",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "",
"PROCEDURE"
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
if (len == lengthtable[key])
{
register const char *s = wordlist[key];
if (*str == *s && !memcmp (str + 1, s + 1, len - 1))
return s;
}
}
return 0;
}