1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
|
/* ANSI-C code produced by gperf version 3.3 */
/* Command-line: gperf -D -t -k'1,$' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
#endif
/* Command-line: gperf -L KR-C -F ', 0, 0' -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
struct resword { const char *name; short token; enum rid rid; };
#define TOTAL_KEYWORDS 83
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 20
#define MIN_HASH_VALUE 4
#define MAX_HASH_VALUE 127
/* maximum key range = 124, duplicates = 8 */
#ifdef __GNUC__
__inline
#else
#ifdef __cplusplus
inline
#endif
#endif
static unsigned int
hash (register const char *str, register size_t len)
{
static unsigned char asso_values[] =
{
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 0, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 5, 128, 0, 15, 50,
55, 0, 15, 35, 65, 60, 128, 40, 0, 60,
65, 10, 128, 128, 15, 20, 30, 20, 40, 0,
20, 15, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128
};
return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
}
struct resword *
in_word_set (register const char *str, register size_t len)
{
#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
static struct resword wordlist[] =
{
{"else", ELSE, NORID},
{"while", WHILE, NORID},
{"@encode", ENCODE, NORID},
{"@private", PRIVATE, NORID},
{"@protocol", PROTOCOL, NORID},
{"@interface", INTERFACE, NORID},
{"__real", REALPART, NORID},
{"__inline", SCSPEC, RID_INLINE},
{"auto", SCSPEC, RID_AUTO},
{"__volatile", TYPE_QUAL, RID_VOLATILE},
{"__attribute", ATTRIBUTE, NORID},
{"__asm__", ASM_KEYWORD, NORID},
{"__imag__", IMAGPART, NORID},
{"__real__", REALPART, NORID},
{"__const__", TYPE_QUAL, RID_CONST},
{"__label__", LABEL, NORID},
{"__inline__", SCSPEC, RID_INLINE},
{"__typeof__", TYPEOF, NORID},
{"__signed__", TYPESPEC, RID_SIGNED},
{"__alignof__", ALIGNOF, NORID},
{"__complex__", TYPESPEC, RID_COMPLEX},
{"__iterator__", SCSPEC, RID_ITERATOR},
{"__volatile__", TYPE_QUAL, RID_VOLATILE},
{"__restrict__", TYPE_QUAL, RID_RESTRICT},
{"__attribute__", ATTRIBUTE, NORID},
{"__extension__", EXTENSION, NORID},
{"@selector", SELECTOR, NORID},
{"@defs", DEFS, NORID},
{"@class", CLASS, NORID},
{"__typeof", TYPEOF, NORID},
{"__alignof", ALIGNOF, NORID},
{"__iterator", SCSPEC, RID_ITERATOR},
{"oneway", TYPE_QUAL, RID_ONEWAY},
{"for", FOR, NORID},
{"__complex", TYPESPEC, RID_COMPLEX},
{"byref", TYPE_QUAL, RID_BYREF},
{"bycopy", TYPE_QUAL, RID_BYCOPY},
{"register", SCSPEC, RID_REGISTER},
{"long", TYPESPEC, RID_LONG},
{"@compatibility_alias", ALIAS, NORID},
{"sizeof", SIZEOF, NORID},
{"__const", TYPE_QUAL, RID_CONST},
{"out", TYPE_QUAL, RID_OUT},
{"__restrict", TYPE_QUAL, RID_RESTRICT},
{"__imag", IMAGPART, NORID},
{"volatile", TYPE_QUAL, RID_VOLATILE},
{"goto", GOTO, NORID},
{"float", TYPESPEC, RID_FLOAT},
{"typeof", TYPEOF, NORID},
{"typedef", SCSPEC, RID_TYPEDEF},
{"restrict", TYPE_QUAL, RID_RESTRICT},
{"case", CASE, NORID},
{"short", TYPESPEC, RID_SHORT},
{"struct", STRUCT, NORID},
{"@public", PUBLIC, NORID},
{"continue", CONTINUE, NORID},
{"@end", END, NORID},
{"break", BREAK, NORID},
{"double", TYPESPEC, RID_DOUBLE},
{"asm", ASM_KEYWORD, NORID},
{"enum", ENUM, NORID},
{"@protected", PROTECTED, NORID},
{"inline", SCSPEC, RID_INLINE},
{"do", DO, NORID},
{"__signed", TYPESPEC, RID_SIGNED},
{"char", TYPESPEC, RID_CHAR},
{"__asm", ASM_KEYWORD, NORID},
{"extern", SCSPEC, RID_EXTERN},
{"static", SCSPEC, RID_STATIC},
{"if", IF, NORID},
{"@implementation", IMPLEMENTATION, NORID},
{"signed", TYPESPEC, RID_SIGNED},
{"unsigned", TYPESPEC, RID_UNSIGNED},
{"const", TYPE_QUAL, RID_CONST},
{"return", RETURN, NORID},
{"union", UNION, NORID},
{"switch", SWITCH, NORID},
{"default", DEFAULT, NORID},
{"int", TYPESPEC, RID_INT},
{"inout", TYPE_QUAL, RID_INOUT},
{"void", TYPESPEC, RID_VOID},
{"id", OBJECTNAME, RID_ID},
{"in", TYPE_QUAL, RID_IN}
};
#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3)
#pragma GCC diagnostic pop
#endif
static short lookup[] =
{
-1, -1, -1, -1, 0, 1, -1, 2,
3, 4, 5, 6, -1, 7, 8, 9,
10, 11, -184, -180, -171, -162, -158, -156,
26, 27, 28, -1, 29, 30, 31, 32,
-1, 33, 34, 35, 36, -1, 37, 38,
39, 40, 41, 42, -1, 43, 44, -1,
45, 46, 47, 48, 49, 50, 51, 52,
53, 54, 55, 56, 57, 58, -1, 59,
60, 61, 62, 63, 64, 65, 66, 67,
-59, -2, -62, -3, 68, 69, -64, -2,
70, 71, -1, 72, -1, 73, 74, -67,
-3, -1, 75, 76, 77, 78, -1, 79,
-69, -2, -1, 80, -71, -2, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 81, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 82
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register unsigned int key = hash (str, len);
if (key <= MAX_HASH_VALUE)
{
register int index = lookup[key];
if (index >= 0)
{
register const char *s = wordlist[index].name;
if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[index];
}
else if (index < -TOTAL_KEYWORDS)
{
register int offset = - 1 - TOTAL_KEYWORDS - index;
register struct resword *wordptr = &wordlist[TOTAL_KEYWORDS + lookup[offset]];
register struct resword *wordendptr = wordptr + -lookup[offset + 1];
while (wordptr < wordendptr)
{
register const char *s = wordptr->name;
if (*str == *s && !strcmp (str + 1, s + 1))
return wordptr;
wordptr++;
}
}
}
}
return (struct resword *) 0;
}
|