1 /* C code produced by gperf version 2.8 (ACE version) */
2 /* Command-line: ../src/gperf -D -p -t */
3 /* Command-line: gperf -p -j1 -i 1 -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
5 struct resword { const char *name; short token; enum rid rid; };
7 #define TOTAL_KEYWORDS 51
8 #define MIN_WORD_LENGTH 2
9 #define MAX_WORD_LENGTH 13
10 #define MIN_HASH_VALUE 4
11 #define MAX_HASH_VALUE 82
12 #define HASH_VALUE_RANGE 79
14 #define WORDLIST_SIZE 55
21 static unsigned char asso_values[] =
24 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
25 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
26 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
27 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
28 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
29 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
30 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
31 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
32 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
33 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
34 83, 83, 83, 83, 83, 83, 83, 83, 83, 0,
35 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
36 83, 83, 83, 83, 83, 83, 83, 83, 83, 40,
37 20, 50, 25, 10, 30, 0, 0, 50, 83, 83,
38 83, 83, 83, 83, 83, 83, 0, 15, 0, 35,
39 0, 83, 83, 20, 83, 83, 83, 83, 83, 83,
40 83, 83, 0, 10, 40, 5, 15, 83, 83, 83,
41 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
42 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
43 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
44 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
45 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
46 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
47 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
48 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
49 83, 83, 83, 83, 83, 83,
51 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
52 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
53 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
54 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
55 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
56 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
57 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
58 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
59 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
60 83, 83, 83, 83, 83, 0, 83, 40, 20, 50,
61 25, 10, 30, 0, 0, 50, 83, 0, 15, 0,
62 35, 0, 83, 83, 20, 0, 10, 40, 5, 15,
63 83, 83, 83, 83, 83, 83, 83, 83,
66 return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
70 in_word_set (str, len)
74 static struct resword wordlist[] =
76 {"",},{"",},{"",},{"",},
77 {"goto", GOTO, NORID},
78 {"__asm", ASM, NORID},
79 {"switch", SWITCH, NORID},
80 {"__asm__", ASM, NORID},
81 {"__const__", TYPE_QUAL, RID_CONST},
82 {"__inline__", SCSPEC, RID_INLINE},
83 {"__typeof__", TYPEOF, NORID},
84 {"__signed__", TYPESPEC, RID_SIGNED},
85 {"__alignof__", ALIGNOF, NORID},
86 {"__volatile__", TYPE_QUAL, RID_VOLATILE},
87 {"__attribute__", ATTRIBUTE, NORID},
88 {"enum", ENUM, NORID},
89 {"short", TYPESPEC, RID_SHORT},
90 {"struct", STRUCT, NORID},
91 {"__const", TYPE_QUAL, RID_CONST},
92 {"__inline", SCSPEC, RID_INLINE},
93 {"long", TYPESPEC, RID_LONG},
94 {"__volatile", TYPE_QUAL, RID_VOLATILE},
95 {"__attribute", ATTRIBUTE, NORID},
96 {"volatile", TYPE_QUAL, RID_VOLATILE},
97 {"else", ELSE, NORID},
98 {"break", BREAK, NORID},
100 {"while", WHILE, NORID},
101 {"signed", TYPESPEC, RID_SIGNED},
102 {"__signed", TYPESPEC, RID_SIGNED},
103 {"void", TYPESPEC, RID_VOID},
104 {"sizeof", SIZEOF, NORID},
105 {"__typeof", TYPEOF, NORID},
106 {"__alignof", ALIGNOF, NORID},
107 {"double", TYPESPEC, RID_DOUBLE},
108 {"default", DEFAULT, NORID},
110 {"auto", SCSPEC, RID_AUTO},
111 {"float", TYPESPEC, RID_FLOAT},
112 {"typeof", TYPEOF, NORID},
113 {"typedef", SCSPEC, RID_TYPEDEF},
114 {"register", SCSPEC, RID_REGISTER},
115 {"extern", SCSPEC, RID_EXTERN},
117 {"static", SCSPEC, RID_STATIC},
118 {"return", RETURN, NORID},
119 {"int", TYPESPEC, RID_INT},
120 {"case", CASE, NORID},
121 {"const", TYPE_QUAL, RID_CONST},
122 {"inline", SCSPEC, RID_INLINE},
123 {"continue", CONTINUE, NORID},
124 {"unsigned", TYPESPEC, RID_UNSIGNED},
125 {"char", TYPESPEC, RID_CHAR},
126 {"union", UNION, NORID},
130 static signed char lookup[] =
132 -1, -1, -9, -3, 4, 5, 6, 7, -1, 8, -90, 12, 13, 14,
133 15, 16, 17, 18, 19, 20, 21, 22, -1, 23, 24, 25, -1, 26,
134 -1, -1, 27, 28, -1, 29, 30, -1, 31, -1, 32, 33, -1, 34,
135 35, 36, 37, 38, 39, 40, 41, -1, -1, 42, -1, 43, -1, -1,
136 44, -1, -1, -1, -1, 45, -1, 46, 47, 48, 49, -1, 50, -1,
137 -1, -1, -1, 51, 52, -1, -1, -1, -1, -1, 53, -1, 54,
140 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
142 unsigned int key = hash (str, len);
144 if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
146 int slot = lookup[key];
148 if (slot >= 0 && slot < WORDLIST_SIZE)
150 char *s = wordlist[slot].name;
152 if (*str == *s && !strcmp (str + 1, s + 1))
153 return &wordlist[slot];
155 else if (slot < 0 && slot >= -MAX_HASH_VALUE)
159 unsigned int offset = key + slot + (slot > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
160 struct resword *base = &wordlist[-lookup[offset]];
161 struct resword *ptr = base + -lookup[offset + 1];
163 while (--ptr >= base)
164 if (*str == *ptr->name && !strcmp (str + 1, ptr->name + 1))