Annotation of gcc/cp-hash.h, revision 1.1.1.2

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

unix.superglobalmegacorp.com

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