freebsd-dev/gnu/usr.bin/cc/cc1plus/hash.h

198 lines
6.3 KiB
C
Raw Normal View History

/* C code produced by gperf version 2.5 (GNU C++ version) */
/* Command-line: gperf -p -j1 -g -o -t -N is_reserved_word -k1,4,7,$ /deneb/blob/jason/g++/small/devo/gcc/cp/gxx.gperf */
/* Command-line: gperf -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf */
struct resword { char *name; short token; enum rid rid;};
#define TOTAL_KEYWORDS 86
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 16
#define MIN_HASH_VALUE 4
#define MAX_HASH_VALUE 171
/* maximum key range = 168, duplicates = 0 */
#ifdef __GNUC__
inline
#endif
static unsigned int
hash (str, len)
register char *str;
register int unsigned len;
{
static unsigned char asso_values[] =
{
172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
172, 172, 172, 172, 172, 0, 172, 36, 1, 61,
0, 0, 30, 44, 44, 35, 172, 7, 12, 53,
40, 17, 6, 172, 28, 2, 4, 35, 31, 51,
5, 7, 172, 172, 172, 172, 172, 172,
};
register int hval = len;
switch (hval)
{
default:
case 7:
hval += asso_values[str[6]];
case 6:
case 5:
case 4:
hval += asso_values[str[3]];
case 3:
case 2:
case 1:
hval += asso_values[str[0]];
}
return hval + asso_values[str[len - 1]];
}
#ifdef __GNUC__
inline
#endif
struct resword *
is_reserved_word (str, len)
register char *str;
register unsigned int len;
{
static struct resword wordlist[] =
{
1995-05-30 05:05:38 +00:00
{"",}, {"",}, {"",}, {"",},
{"else", ELSE, NORID,},
1995-05-30 05:05:38 +00:00
{"",},
{"delete", DELETE, NORID,},
{"double", TYPESPEC, RID_DOUBLE,},
{"true", CXX_TRUE, NORID,},
{"__asm__", GCC_ASM_KEYWORD, NORID},
{"typeid", TYPEID, NORID,},
1995-05-30 05:05:38 +00:00
{"",},
{"this", THIS, NORID,},
1995-05-30 05:05:38 +00:00
{"",},
{"try", TRY, NORID,},
1995-05-30 05:05:38 +00:00
{"",}, {"",}, {"",}, {"",},
{"do", DO, NORID,},
1995-05-30 05:05:38 +00:00
{"",},
{"static_cast", STATIC_CAST, NORID,},
{"template", TEMPLATE, RID_TEMPLATE,},
{"protected", VISSPEC, RID_PROTECTED,},
1995-05-30 05:05:38 +00:00
{"",},
{"__classof__", CLASSOF, NORID},
1995-05-30 05:05:38 +00:00
{"",},
{"__headof__", HEADOF, NORID},
1995-05-30 05:05:38 +00:00
{"",},
{"bool", TYPESPEC, RID_BOOL,},
{"__const__", TYPE_QUAL, RID_CONST},
{"__volatile", TYPE_QUAL, RID_VOLATILE},
{"__const", TYPE_QUAL, RID_CONST},
{"__volatile__", TYPE_QUAL, RID_VOLATILE},
{"__typeof__", TYPEOF, NORID},
{"void", TYPESPEC, RID_VOID,},
{"friend", SCSPEC, RID_FRIEND,},
{"false", CXX_FALSE, NORID,},
{"sizeof", SIZEOF, NORID,},
{"short", TYPESPEC, RID_SHORT,},
{"typeof", TYPEOF, NORID,},
1995-05-30 05:05:38 +00:00
{"",},
{"int", TYPESPEC, RID_INT,},
{"__signed", TYPESPEC, RID_SIGNED},
{"private", VISSPEC, RID_PRIVATE,},
{"__signed__", TYPESPEC, RID_SIGNED},
{"extern", SCSPEC, RID_EXTERN,},
{"struct", AGGR, RID_RECORD,},
{"signed", TYPESPEC, RID_SIGNED,},
{"break", BREAK, NORID,},
{"__attribute", ATTRIBUTE, NORID},
{"default", DEFAULT, NORID,},
{"__attribute__", ATTRIBUTE, NORID},
{"__classof", CLASSOF, NORID},
{"sigof", SIGOF, NORID /* Extension */,},
{"__headof", HEADOF, NORID},
{"switch", SWITCH, NORID,},
{"__label__", LABEL, NORID},
{"__extension__", EXTENSION, NORID},
1995-05-30 05:05:38 +00:00
{"",},
{"__asm", GCC_ASM_KEYWORD, NORID},
{"for", FOR, NORID,},
{"__typeof", TYPEOF, NORID},
{"__alignof__", ALIGNOF, NORID},
1995-05-30 05:05:38 +00:00
{"",},
{"case", CASE, NORID,},
{"virtual", SCSPEC, RID_VIRTUAL,},
{"if", IF, NORID,},
{"while", WHILE, NORID,},
1995-05-30 05:05:38 +00:00
{"",},
{"class", AGGR, RID_CLASS,},
{"typedef", SCSPEC, RID_TYPEDEF,},
{"const", TYPE_QUAL, RID_CONST,},
{"static", SCSPEC, RID_STATIC,},
{"auto", SCSPEC, RID_AUTO,},
{"float", TYPESPEC, RID_FLOAT,},
{"inline", SCSPEC, RID_INLINE,},
{"throw", THROW, NORID,},
{"unsigned", TYPESPEC, RID_UNSIGNED,},
1995-05-30 05:05:38 +00:00
{"",},
{"headof", HEADOF, NORID,},
1995-05-30 05:05:38 +00:00
{"",},
{"goto", GOTO, NORID,},
1995-05-30 05:05:38 +00:00
{"",}, {"",},
{"public", VISSPEC, RID_PUBLIC,},
{"signature", AGGR, RID_SIGNATURE /* Extension */,},
{"volatile", TYPE_QUAL, RID_VOLATILE,},
{"__inline", SCSPEC, RID_INLINE},
{"overload", OVERLOAD, NORID,},
{"__inline__", SCSPEC, RID_INLINE},
{"__alignof", ALIGNOF, NORID},
{"asm", ASM_KEYWORD, NORID,},
1995-05-30 05:05:38 +00:00
{"",},
{"new", NEW, NORID,},
1995-05-30 05:05:38 +00:00
{"",},
{"mutable", SCSPEC, RID_MUTABLE,},
{"union", AGGR, RID_UNION,},
{"operator", OPERATOR, NORID,},
{"register", SCSPEC, RID_REGISTER,},
1995-05-30 05:05:38 +00:00
{"",}, {"",},
{"__wchar_t", TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,},
1995-05-30 05:05:38 +00:00
{"",},
{"long", TYPESPEC, RID_LONG,},
1995-05-30 05:05:38 +00:00
{"",}, {"",}, {"",},
{"continue", CONTINUE, NORID,},
{"return", RETURN, NORID,},
{"enum", ENUM, NORID,},
1995-05-30 05:05:38 +00:00
{"",}, {"",},
{"dynamic_cast", DYNAMIC_CAST, NORID,},
1995-05-30 05:05:38 +00:00
{"",}, {"",},
{"reinterpret_cast", REINTERPRET_CAST, NORID,},
1995-05-30 05:05:38 +00:00
{"",}, {"",}, {"",}, {"",},
{"char", TYPESPEC, RID_CHAR,},
1995-05-30 05:05:38 +00:00
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"classof", CLASSOF, NORID,},
1995-05-30 05:05:38 +00:00
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"const_cast", CONST_CAST, NORID,},
1995-05-30 05:05:38 +00:00
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",},
{"catch", CATCH, NORID,},
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register char *s = wordlist[key].name;
if (*s == *str && !strcmp (str + 1, s + 1))
return &wordlist[key];
}
}
return 0;
}