]>
Commit | Line | Data |
---|---|---|
6eabb241 MM |
1 | /* C code produced by gperf version 2.7.1 (19981006 egcs) */ |
2 | /* Command-line: gperf -L C -F , 0, 0 -p -j1 -g -o -t -N is_reserved_word -k1,4,7,$ ../../../gcc/cp/gxx.gperf */ | |
f5984164 | 3 | /* Command-line: gperf -L C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf */ |
8e6befc1 | 4 | struct resword { const char *name; short token; enum rid rid;}; |
f5984164 KG |
5 | #ifdef __GNUC__ |
6 | __inline | |
7 | #endif | |
8 | static unsigned int hash PARAMS ((const char *, unsigned int)); | |
9 | #ifdef __GNUC__ | |
10 | __inline | |
11 | #endif | |
12 | struct resword *is_reserved_word PARAMS ((const char *, unsigned int)); | |
8d08fdba | 13 | |
6eabb241 | 14 | #define TOTAL_KEYWORDS 103 |
8d08fdba | 15 | #define MIN_WORD_LENGTH 2 |
a4443a08 | 16 | #define MAX_WORD_LENGTH 16 |
8d08fdba | 17 | #define MIN_HASH_VALUE 4 |
6eabb241 MM |
18 | #define MAX_HASH_VALUE 274 |
19 | /* maximum key range = 271, duplicates = 0 */ | |
8d08fdba MS |
20 | |
21 | #ifdef __GNUC__ | |
9e46e5e8 | 22 | __inline |
8d08fdba MS |
23 | #endif |
24 | static unsigned int | |
25 | hash (str, len) | |
8e6befc1 | 26 | register const char *str; |
9e46e5e8 | 27 | register unsigned int len; |
8d08fdba | 28 | { |
6eabb241 | 29 | static unsigned short asso_values[] = |
8d08fdba | 30 | { |
6eabb241 MM |
31 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, |
32 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
33 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
34 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
35 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
36 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
37 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
38 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
39 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
40 | 275, 275, 275, 275, 275, 0, 275, 97, 1, 19, | |
41 | 40, 0, 12, 68, 0, 74, 275, 0, 11, 67, | |
42 | 27, 0, 70, 6, 96, 43, 6, 37, 3, 10, | |
43 | 8, 104, 275, 275, 275, 275, 275, 275, 275, 275, | |
44 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
45 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
46 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
47 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
48 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
49 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
50 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
51 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
52 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
53 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
54 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
55 | 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, | |
56 | 275, 275, 275, 275, 275, 275 | |
8d08fdba MS |
57 | }; |
58 | register int hval = len; | |
59 | ||
60 | switch (hval) | |
61 | { | |
62 | default: | |
63 | case 7: | |
9e46e5e8 | 64 | hval += asso_values[(unsigned char)str[6]]; |
8d08fdba MS |
65 | case 6: |
66 | case 5: | |
67 | case 4: | |
9e46e5e8 | 68 | hval += asso_values[(unsigned char)str[3]]; |
8d08fdba MS |
69 | case 3: |
70 | case 2: | |
71 | case 1: | |
9e46e5e8 | 72 | hval += asso_values[(unsigned char)str[0]]; |
c73964b2 | 73 | break; |
8d08fdba | 74 | } |
9e46e5e8 | 75 | return hval + asso_values[(unsigned char)str[len - 1]]; |
8d08fdba MS |
76 | } |
77 | ||
78 | #ifdef __GNUC__ | |
9e46e5e8 | 79 | __inline |
8d08fdba MS |
80 | #endif |
81 | struct resword * | |
82 | is_reserved_word (str, len) | |
8e6befc1 | 83 | register const char *str; |
8d08fdba MS |
84 | register unsigned int len; |
85 | { | |
86 | static struct resword wordlist[] = | |
87 | { | |
9e46e5e8 | 88 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, |
adecb3f4 | 89 | {"else", ELSE, RID_UNUSED,}, |
6eabb241 | 90 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, |
adecb3f4 | 91 | {"__real__", REALPART, RID_UNUSED}, |
6eabb241 | 92 | {"", 0, 0}, |
adecb3f4 | 93 | {"true", CXX_TRUE, RID_UNUSED,}, |
6eabb241 MM |
94 | {"or_eq", ASSIGN, RID_UNUSED,}, |
95 | {"export", SCSPEC, RID_EXPORT,}, | |
4a4b0aa3 | 96 | {"", 0, 0}, {"", 0, 0}, |
6eabb241 MM |
97 | {"__const__", CV_QUALIFIER, RID_CONST}, |
98 | {"__volatile", CV_QUALIFIER, RID_VOLATILE}, | |
99 | {"__real", REALPART, RID_UNUSED}, | |
100 | {"__volatile__", CV_QUALIFIER, RID_VOLATILE}, | |
101 | {"__const", CV_QUALIFIER, RID_CONST}, | |
102 | {"xor_eq", ASSIGN, RID_UNUSED,}, | |
103 | {"throw", THROW, RID_UNUSED,}, | |
104 | {"__complex__", TYPESPEC, RID_COMPLEX}, | |
105 | {"case", CASE, RID_UNUSED,}, | |
106 | {"typeof", TYPEOF, RID_UNUSED,}, | |
107 | {"", 0, 0}, | |
108 | {"while", WHILE, RID_UNUSED,}, | |
109 | {"bool", TYPESPEC, RID_BOOL,}, | |
110 | {"__complex", TYPESPEC, RID_COMPLEX}, | |
111 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, | |
9e46e5e8 | 112 | {"extern", SCSPEC, RID_EXTERN,}, |
91063b51 | 113 | {"", 0, 0}, {"", 0, 0}, |
adecb3f4 | 114 | {"not", '!', RID_UNUSED,}, |
6eabb241 MM |
115 | {"typedef", SCSPEC, RID_TYPEDEF,}, |
116 | {"virtual", SCSPEC, RID_VIRTUAL,}, | |
117 | {"not_eq", EQCOMPARE, RID_UNUSED,}, | |
118 | {"new", NEW, RID_UNUSED,}, | |
9e46e5e8 | 119 | {"", 0, 0}, |
6eabb241 MM |
120 | {"do", DO, RID_UNUSED,}, |
121 | {"catch", CATCH, RID_UNUSED,}, | |
122 | {"", 0, 0}, {"", 0, 0}, | |
123 | {"delete", DELETE, RID_UNUSED,}, | |
124 | {"double", TYPESPEC, RID_DOUBLE,}, | |
adecb3f4 | 125 | {"__extension__", EXTENSION, RID_UNUSED}, |
6eabb241 | 126 | {"__alignof__", ALIGNOF, RID_UNUSED}, |
4a4b0aa3 | 127 | {"__asm__", ASM_KEYWORD, RID_UNUSED}, |
4a4b0aa3 | 128 | {"", 0, 0}, |
6eabb241 | 129 | {"typeid", TYPEID, RID_UNUSED,}, |
4a4b0aa3 | 130 | {"", 0, 0}, |
6eabb241 MM |
131 | {"__null", CONSTANT, RID_NULL}, |
132 | {"switch", SWITCH, RID_UNUSED,}, | |
133 | {"", 0, 0}, {"", 0, 0}, | |
134 | {"friend", SCSPEC, RID_FRIEND,}, | |
135 | {"__alignof", ALIGNOF, RID_UNUSED}, | |
136 | {"false", CXX_FALSE, RID_UNUSED,}, | |
137 | {"sizeof", SIZEOF, RID_UNUSED,}, | |
91063b51 | 138 | {"__inline", SCSPEC, RID_INLINE}, |
6eabb241 | 139 | {"", 0, 0}, |
91063b51 | 140 | {"__inline__", SCSPEC, RID_INLINE}, |
4a4b0aa3 | 141 | {"", 0, 0}, |
adecb3f4 | 142 | {"static_cast", STATIC_CAST, RID_UNUSED,}, |
4a4b0aa3 | 143 | {"", 0, 0}, {"", 0, 0}, |
6eabb241 MM |
144 | {"union", AGGR, RID_UNION,}, |
145 | {"continue", CONTINUE, RID_UNUSED,}, | |
146 | {"", 0, 0}, | |
147 | {"goto", GOTO, RID_UNUSED,}, | |
148 | {"const", CV_QUALIFIER, RID_CONST,}, | |
149 | {"static", SCSPEC, RID_STATIC,}, | |
150 | {"__imag__", IMAGPART, RID_UNUSED}, | |
151 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, | |
152 | {"private", VISSPEC, RID_PRIVATE,}, | |
4a4b0aa3 RH |
153 | {"typename", TYPENAME_KEYWORD, RID_UNUSED,}, |
154 | {"", 0, 0}, | |
6eabb241 MM |
155 | {"int", TYPESPEC, RID_INT,}, |
156 | {"__signed__", TYPESPEC, RID_SIGNED}, | |
157 | {"", 0, 0}, {"", 0, 0}, | |
158 | {"void", TYPESPEC, RID_VOID,}, | |
159 | {"if", IF, RID_UNUSED,}, | |
9e46e5e8 | 160 | {"", 0, 0}, |
6eabb241 MM |
161 | {"template", TEMPLATE, RID_TEMPLATE,}, |
162 | {"__attribute", ATTRIBUTE, RID_UNUSED}, | |
163 | {"struct", AGGR, RID_RECORD,}, | |
164 | {"__attribute__", ATTRIBUTE, RID_UNUSED}, | |
165 | {"", 0, 0}, {"", 0, 0}, | |
166 | {"this", THIS, RID_UNUSED,}, | |
167 | {"const_cast", CONST_CAST, RID_UNUSED,}, | |
168 | {"or", OROR, RID_UNUSED,}, | |
169 | {"explicit", SCSPEC, RID_EXPLICIT,}, | |
4a4b0aa3 | 170 | {"", 0, 0}, |
6eabb241 MM |
171 | {"auto", SCSPEC, RID_AUTO,}, |
172 | {"bitor", '|', RID_UNUSED,}, | |
173 | {"break", BREAK, RID_UNUSED,}, | |
4a4b0aa3 | 174 | {"", 0, 0}, |
6eabb241 MM |
175 | {"compl", '~', RID_UNUSED,}, |
176 | {"public", VISSPEC, RID_PUBLIC,}, | |
177 | {"xor", '^', RID_UNUSED,}, | |
178 | {"__restrict__", CV_QUALIFIER, RID_RESTRICT}, | |
179 | {"and_eq", ASSIGN, RID_UNUSED,}, | |
91063b51 | 180 | {"class", AGGR, RID_CLASS,}, |
6eabb241 MM |
181 | {"for", FOR, RID_UNUSED,}, |
182 | {"__restrict", CV_QUALIFIER, RID_RESTRICT}, | |
183 | {"try", TRY, RID_UNUSED,}, | |
adecb3f4 | 184 | {"__typeof__", TYPEOF, RID_UNUSED}, |
4a4b0aa3 | 185 | {"__asm", ASM_KEYWORD, RID_UNUSED}, |
6eabb241 MM |
186 | {"signed", TYPESPEC, RID_SIGNED,}, |
187 | {"__label__", LABEL, RID_UNUSED}, | |
188 | {"", 0, 0}, | |
189 | {"volatile", CV_QUALIFIER, RID_VOLATILE,}, | |
190 | {"float", TYPESPEC, RID_FLOAT,}, | |
191 | {"", 0, 0}, | |
4a4b0aa3 | 192 | {"__signed", TYPESPEC, RID_SIGNED}, |
9e46e5e8 | 193 | {"", 0, 0}, |
6eabb241 | 194 | {"__typeof", TYPEOF, RID_UNUSED}, |
4a4b0aa3 | 195 | {"", 0, 0}, {"", 0, 0}, |
4a4b0aa3 | 196 | {"__builtin_va_arg", VA_ARG, RID_UNUSED}, |
4a4b0aa3 | 197 | {"", 0, 0}, {"", 0, 0}, |
6eabb241 MM |
198 | {"__wchar_t", TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,}, |
199 | {"protected", VISSPEC, RID_PROTECTED,}, | |
200 | {"", 0, 0}, | |
201 | {"namespace", NAMESPACE, RID_UNUSED,}, | |
202 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, | |
adecb3f4 | 203 | {"using", USING, RID_UNUSED,}, |
6eabb241 | 204 | {"enum", ENUM, RID_UNUSED,}, |
9e46e5e8 | 205 | {"", 0, 0}, |
6eabb241 MM |
206 | {"and", ANDAND, RID_UNUSED,}, |
207 | {"__imag", IMAGPART, RID_UNUSED}, | |
4a4b0aa3 | 208 | {"", 0, 0}, {"", 0, 0}, |
6eabb241 MM |
209 | {"bitand", '&', RID_UNUSED,}, |
210 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, | |
211 | {"short", TYPESPEC, RID_SHORT,}, | |
212 | {"long", TYPESPEC, RID_LONG,}, | |
4a4b0aa3 | 213 | {"", 0, 0}, {"", 0, 0}, |
6eabb241 | 214 | {"inline", SCSPEC, RID_INLINE,}, |
91063b51 | 215 | {"", 0, 0}, |
6eabb241 | 216 | {"default", DEFAULT, RID_UNUSED,}, |
4a4b0aa3 | 217 | {"", 0, 0}, {"", 0, 0}, |
4a4b0aa3 | 218 | {"unsigned", TYPESPEC, RID_UNSIGNED,}, |
4a4b0aa3 | 219 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, |
6eabb241 MM |
220 | {"return", RETURN_KEYWORD, RID_UNUSED,}, |
221 | {"asm", ASM_KEYWORD, RID_UNUSED,}, | |
4a4b0aa3 | 222 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, |
6eabb241 MM |
223 | {"mutable", SCSPEC, RID_MUTABLE,}, |
224 | {"", 0, 0}, {"", 0, 0}, | |
225 | {"dynamic_cast", DYNAMIC_CAST, RID_UNUSED,}, | |
9e46e5e8 | 226 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, |
9e46e5e8 | 227 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, |
6eabb241 | 228 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, |
4a4b0aa3 | 229 | {"operator", OPERATOR, RID_UNUSED,}, |
9e46e5e8 | 230 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, |
6eabb241 MM |
231 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, |
232 | {"char", TYPESPEC, RID_CHAR,}, | |
233 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, | |
234 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, | |
235 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, | |
236 | {"reinterpret_cast", REINTERPRET_CAST, RID_UNUSED,}, | |
237 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, | |
9e46e5e8 KG |
238 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, |
239 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, | |
6eabb241 MM |
240 | {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, |
241 | {"register", SCSPEC, RID_REGISTER,} | |
8d08fdba MS |
242 | }; |
243 | ||
244 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) | |
245 | { | |
246 | register int key = hash (str, len); | |
247 | ||
248 | if (key <= MAX_HASH_VALUE && key >= 0) | |
249 | { | |
8e6befc1 | 250 | register const char *s = wordlist[key].name; |
8d08fdba | 251 | |
9e46e5e8 | 252 | if (*str == *s && !strcmp (str + 1, s + 1)) |
8d08fdba MS |
253 | return &wordlist[key]; |
254 | } | |
255 | } | |
256 | return 0; | |
257 | } |