Annotation of GNUtools/cc/obcp-hash.h, revision 1.1.1.1

1.1       root        1: /* starting time is 13:16:31 */
                      2: /* C code produced by gperf version 2.5 (GNU C++ version) */
                      3: /* Command-line: /Net/seaport/homes/nebraska/mwagner/bin/gperf -G -i 1 -p -j1 -o -t -N is_reserved_word -k1,4,$,7 obcp.gperf  */
                      4: /* Command-line: gperf -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf  */
                      5: struct resword { char *name; short token; enum rid rid; enum languages lang; char *save; };
                      6: 
                      7: #define TOTAL_KEYWORDS 99
                      8: #define MIN_WORD_LENGTH 2
                      9: #define MAX_WORD_LENGTH 15
                     10: #define MIN_HASH_VALUE 7
                     11: #define MAX_HASH_VALUE 180
                     12: /* maximum key range = 174, duplicates = 0 */
                     13: 
                     14: static unsigned int
                     15: hash (str, len)
                     16:      register char *str;
                     17:      register int unsigned len;
                     18: {
                     19:   static unsigned char asso_values[] =
                     20:     {
                     21:      181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
                     22:      181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
                     23:      181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
                     24:      181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
                     25:      181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
                     26:      181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
                     27:      181, 181, 181, 181,  59, 181, 181, 181, 181, 181,
                     28:      181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
                     29:      181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
                     30:      181, 181, 181, 181, 181,   1, 181, 103,   7,  38,
                     31:       27,   1,  13,   6,  22,  67, 181,   1,  18,   8,
                     32:       32,   1,  19, 181,  40,  12,   5,  34,  21,  67,
                     33:        1,  23, 181, 181, 181, 181, 181, 181,
                     34:     };
                     35:   register int hval = len;
                     36: 
                     37:   switch (hval)
                     38:     {
                     39:       default:
                     40:       case 7:
                     41:         hval += asso_values[str[6]];
                     42:       case 6:
                     43:       case 5:
                     44:       case 4:
                     45:         hval += asso_values[str[3]];
                     46:       case 3:
                     47:       case 2:
                     48:       case 1:
                     49:         hval += asso_values[str[0]];
                     50:     }
                     51:   return hval + asso_values[str[len - 1]];
                     52: }
                     53: 
                     54: static struct resword wordlist[] =
                     55: {
                     56:       {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, 
                     57:       {"else",  ELSE, NORID, lang_c,},
                     58:       {"",}, 
                     59:       {"out",  TYPE_QUAL, RID_OUT, lang_objc,},
                     60:       {"",}, {"",}, 
                     61:       {"goto",  GOTO, NORID, lang_c,},
                     62:       {"except",  EXCEPT, NORID, lang_cplusplus,               /* Extension */},
                     63:       {"__headof__",  HEADOF, NORID, lang_c,},
                     64:       {"",}, {"",}, 
                     65:       {"__const__",  TYPE_QUAL, RID_CONST, lang_c,},
                     66:       {"__volatile",  TYPE_QUAL, RID_VOLATILE, lang_c,},
                     67:       {"__const",  TYPE_QUAL, RID_CONST, lang_c,},
                     68:       {"__volatile__",  TYPE_QUAL, RID_VOLATILE, lang_c,},
                     69:       {"enum",  ENUM, NORID, lang_c,},
                     70:       {"__asm__",  GCC_ASM_KEYWORD, NORID, lang_c,},
                     71:       {"",}, 
                     72:       {"__headof",  HEADOF, NORID, lang_c,},
                     73:       {"typeof",  TYPEOF, NORID, lang_c, },
                     74:       {"__asm",  GCC_ASM_KEYWORD, NORID, lang_c,},
                     75:       {"",}, {"",}, {"",}, 
                     76:       {"do",  DO, NORID, lang_c,},
                     77:       {"try",  TRY, NORID, lang_cplusplus                      /* Extension */,},
                     78:       {"sizeof",  SIZEOF, NORID, lang_c, },
                     79:       {"this",  THIS, NORID, lang_cplusplus, },
                     80:       {"long",  TYPESPEC, RID_LONG, lang_c,},
                     81:       {"delete",  DELETE, NORID, lang_cplusplus,},
                     82:       {"__typeof__",  TYPEOF, NORID, lang_c,},
                     83:       {"bycopy",  TYPE_QUAL, RID_BYCOPY, lang_objc,},
                     84:       {"template",  TEMPLATE, NORID, lang_cplusplus, },
                     85:       {"typedef",  SCSPEC, RID_TYPEDEF, lang_c, },
                     86:       {"extern",  SCSPEC, RID_EXTERN, lang_c,},
                     87:       {"double",  TYPESPEC, RID_DOUBLE, lang_c,},
                     88:       {"",}, 
                     89:       {"__classof__",  CLASSOF, NORID, lang_c,},
                     90:       {"case",  CASE, NORID, lang_c,},
                     91:       {"switch",  SWITCH, NORID, lang_c, },
                     92:       {"__typeof",  TYPEOF, NORID, lang_c,},
                     93:       {"friend",  SCSPEC, RID_FRIEND, lang_cplusplus,},
                     94:       {"__extension__",  EXTENSION, NORID, lang_c,},
                     95:       {"private",  VISSPEC, RID_PRIVATE, lang_cplusplus,},
                     96:       {"",}, {"",}, {"",}, 
                     97:       {"__classof",  CLASSOF, NORID, lang_c,},
                     98:       {"",}, {"",}, 
                     99:       {"for",  FOR, NORID, lang_c,},
                    100:       {"struct",  AGGR, RID_RECORD, lang_c, },
                    101:       {"raise",  RAISE, NORID, lang_cplusplus,         /* Extension */},
                    102:       {"",}, 
                    103:       {"const",  TYPE_QUAL, RID_CONST, lang_c,},
                    104:       {"static",  SCSPEC, RID_STATIC, lang_c, },
                    105:       {"short",  TYPESPEC, RID_SHORT, lang_c, },
                    106:       {"__alignof__",  ALIGNOF, NORID, lang_c,},
                    107:       {"",}, 
                    108:       {"protected",  VISSPEC, RID_PROTECTED, lang_cplusplus,},
                    109:       {"",}, 
                    110:       {"class",  AGGR, RID_CLASS, lang_cplusplus,},
                    111:       {"headof",  HEADOF, NORID, lang_cplusplus,},
                    112:       {"virtual",  SCSPEC, RID_VIRTUAL, lang_cplusplus, },
                    113:       {"raises",  RAISES, NORID, lang_cplusplus,               /* Extension */},
                    114:       {"",}, 
                    115:       {"union",  AGGR, RID_UNION, lang_c, },
                    116:       {"__alignof",  ALIGNOF, NORID, lang_c,},
                    117:       {"__inline",  SCSPEC, RID_INLINE, lang_c,},
                    118:       {"int",  TYPESPEC, RID_INT, lang_c,},
                    119:       {"__inline__",  SCSPEC, RID_INLINE, lang_c,},
                    120:       {"signed",  TYPESPEC, RID_SIGNED, lang_c, },
                    121:       {"throw",  THROW, NORID, lang_cplusplus          /* Extension */,},
                    122:       {"void",  TYPESPEC, RID_VOID, lang_c, },
                    123:       {"__signed__",  TYPESPEC, RID_SIGNED, lang_c,},
                    124:       {"public",  VISSPEC, RID_PUBLIC, lang_cplusplus, },
                    125:       {"if",  IF, NORID, lang_c,},
                    126:       {"classof",  CLASSOF, NORID, lang_cplusplus,},
                    127:       {"",}, 
                    128:       {"__attribute",  ATTRIBUTE, NORID, lang_c,},
                    129:       {"continue",  CONTINUE, NORID, lang_c,},
                    130:       {"__attribute__",  ATTRIBUTE, NORID, lang_c,},
                    131:       {"@interface",  INTERFACE, NORID, lang_objc,},
                    132:       {"@defs",  DEFS, NORID, lang_objc,},
                    133:       {"operator",  OPERATOR, NORID, lang_cplusplus,},
                    134:       {"while",  WHILE, NORID, lang_c, },
                    135:       {"",}, 
                    136:       {"__wchar_t",  TYPESPEC, RID_WCHAR, lang_cplusplus, /* Unique to ANSI C++ */},
                    137:       {"",}, {"",}, 
                    138:       {"id",  OBJECTNAME, RID_ID, lang_objc,},
                    139:       {"oneway",  TYPE_QUAL, RID_ONEWAY, lang_objc,},
                    140:       {"",}, {"",}, {"",}, 
                    141:       {"in",  TYPE_QUAL, RID_IN, lang_objc,},
                    142:       {"new",  NEW, NORID, lang_cplusplus,},
                    143:       {"catch",  CATCH, NORID, lang_cplusplus,},
                    144:       {"__signed",  TYPESPEC, RID_SIGNED, lang_c,},
                    145:       {"",}, 
                    146:       {"@encode",  ENCODE, NORID, lang_objc,},
                    147:       {"",}, {"",}, 
                    148:       {"auto",  SCSPEC, RID_AUTO, lang_c,},
                    149:       {"exception",  AGGR, RID_EXCEPTION, lang_cplusplus,      /* Extension */},
                    150:       {"inout",  TYPE_QUAL, RID_INOUT, lang_objc,},
                    151:       {"return",  RETURN, NORID, lang_c, },
                    152:       {"",}, 
                    153:       {"asm",  ASM_KEYWORD, NORID, lang_c,},
                    154:       {"",}, 
                    155:       {"break",  BREAK, NORID, lang_c,},
                    156:       {"@end",  END, NORID, lang_objc,},
                    157:       {"",}, {"",}, 
                    158:       {"mutable",  SCSPEC, RID_MUTABLE, lang_cplusplus,},
                    159:       {"",}, 
                    160:       {"char",  TYPESPEC, RID_CHAR, lang_c,},
                    161:       {"",}, 
                    162:       {"all",  ALL, NORID, lang_cplusplus,             /* Extension */},
                    163:       {"@protocol",  PROTOCOL, NORID, lang_objc,},
                    164:       {"float",  TYPESPEC, RID_FLOAT, lang_c,},
                    165:       {"",}, {"",}, {"",}, {"",}, 
                    166:       {"@selector",  SELECTOR, NORID, lang_objc, },
                    167:       {"__label__",  LABEL, NORID, lang_c,},
                    168:       {"@implementation",  IMPLEMENTATION, NORID, lang_objc,},
                    169:       {"",}, 
                    170:       {"@protected",  PROTECTED, NORID, lang_objc,},
                    171:       {"",}, 
                    172:       {"unsigned",  TYPESPEC, RID_UNSIGNED, lang_c, },
                    173:       {"",}, {"",}, 
                    174:       {"@private",  PRIVATE, NORID, lang_objc,},
                    175:       {"inline",  SCSPEC, RID_INLINE, lang_c,},
                    176:       {"",}, {"",}, {"",}, {"",}, {"",}, 
                    177:       {"default",  DEFAULT, NORID, lang_c,},
                    178:       {"",}, 
                    179:       {"@public",  PUBLIC, NORID, lang_objc,},
                    180:       {"",}, 
                    181:       {"volatile",  TYPE_QUAL, RID_VOLATILE, lang_c, },
                    182:       {"reraise",  RERAISE, NORID, lang_cplusplus,     /* Extension */},
                    183:       {"",}, {"",}, {"",}, 
                    184:       {"register",  SCSPEC, RID_REGISTER, lang_c, },
                    185:       {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, 
                    186:       {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, 
                    187:       {"",}, {"",}, {"",}, {"",}, 
                    188:       {"overload",  OVERLOAD, NORID, lang_cplusplus,},
                    189:       {"@class",  CLASS, NORID, lang_objc,},
                    190: };
                    191: 
                    192: struct resword *
                    193: is_reserved_word (str, len)
                    194:      register char *str;
                    195:      register unsigned int len;
                    196: {
                    197:   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
                    198:     {
                    199:       register int key = hash (str, len);
                    200: 
                    201:       if (key <= MAX_HASH_VALUE && key >= 0)
                    202:         {
                    203:           register char *s = wordlist[key].name;
                    204: 
                    205:           if (*s == *str && !strcmp (str + 1, s + 1))
                    206:             return &wordlist[key];
                    207:         }
                    208:     }
                    209:   return 0;
                    210: }
                    211: /* ending time is 13:16:31 */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.