* cppexp.c (parse_charconst): Null does not end character
[official-gcc.git] / gcc / c-gperf.h
blob9062af53851431f8040eecb51caadb2fdf3b9080
1 /* C code produced by gperf version 2.7.1 (19981006 egcs) */
2 /* Command-line: gperf -L C -F , 0, 0 -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ /work/src/gcc/gcc/c-parse.gperf */
3 /* Command-line: gperf -L C -F ', 0, 0' -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
4 struct resword { const char *name; short token; enum rid rid; };
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));
14 #define TOTAL_KEYWORDS 94
15 #define MIN_WORD_LENGTH 2
16 #define MAX_WORD_LENGTH 20
17 #define MIN_HASH_VALUE 4
18 #define MAX_HASH_VALUE 249
19 /* maximum key range = 246, duplicates = 0 */
21 #ifdef __GNUC__
22 __inline
23 #endif
24 static unsigned int
25 hash (str, len)
26 register const char *str;
27 register unsigned int len;
29 static unsigned char asso_values[] =
31 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
32 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
33 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
34 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
35 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
36 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
37 250, 250, 250, 250, 11, 250, 250, 250, 250, 250,
38 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
39 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
40 250, 250, 250, 250, 250, 1, 250, 78, 38, 61,
41 1, 37, 47, 70, 1, 13, 250, 4, 94, 37,
42 81, 1, 100, 250, 19, 8, 25, 4, 50, 1,
43 2, 1, 2, 250, 250, 250, 250, 250, 250, 250,
44 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
45 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
46 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
47 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
48 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
49 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
50 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
51 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
52 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
53 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
54 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
55 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
56 250, 250, 250, 250, 250, 250
58 register int hval = len;
60 switch (hval)
62 default:
63 case 3:
64 hval += asso_values[(unsigned char)str[2]];
65 case 2:
66 case 1:
67 hval += asso_values[(unsigned char)str[0]];
68 break;
70 return hval + asso_values[(unsigned char)str[len - 1]];
73 static struct resword wordlist[] =
75 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
76 {"do", DO, NORID},
77 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
78 {"", 0, 0}, {"", 0, 0},
79 {"id", OBJECTNAME, RID_ID},
80 {"__unbounded", TYPE_QUAL, RID_UNBOUNDED},
81 {"__signed", TYPESPEC, RID_SIGNED},
82 {"__unbounded__", TYPE_QUAL, RID_UNBOUNDED},
83 {"__signed__", TYPESPEC, RID_SIGNED},
84 {"unsigned", TYPESPEC, RID_UNSIGNED},
85 {"", 0, 0},
86 {"__imag__", IMAGPART, NORID},
87 {"", 0, 0},
88 {"__inline__", SCSPEC, RID_INLINE},
89 {"", 0, 0},
90 {"__iterator__", SCSPEC, RID_ITERATOR},
91 {"switch", SWITCH, NORID},
92 {"__real__", REALPART, NORID},
93 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
94 {"__restrict__", TYPE_QUAL, RID_RESTRICT},
95 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
96 {"__typeof__", TYPEOF, NORID},
97 {"", 0, 0},
98 {"short", TYPESPEC, RID_SHORT},
99 {"@compatibility_alias", ALIAS, NORID},
100 {"@protected", PROTECTED, NORID},
101 {"", 0, 0},
102 {"__iterator", SCSPEC, RID_ITERATOR},
103 {"inout", TYPE_QUAL, RID_INOUT},
104 {"oneway", TYPE_QUAL, RID_ONEWAY},
105 {"", 0, 0}, {"", 0, 0},
106 {"double", TYPESPEC, RID_DOUBLE},
107 {"__bounded", TYPE_QUAL, RID_BOUNDED},
108 {"", 0, 0},
109 {"__bounded__", TYPE_QUAL, RID_BOUNDED},
110 {"__extension__", EXTENSION, NORID},
111 {"", 0, 0},
112 {"out", TYPE_QUAL, RID_OUT},
113 {"__restrict", TYPE_QUAL, RID_RESTRICT},
114 {"while", WHILE, NORID},
115 {"", 0, 0},
116 {"struct", STRUCT, NORID},
117 {"__inline", SCSPEC, RID_INLINE},
118 {"restrict", TYPE_QUAL, RID_RESTRICT},
119 {"@defs", DEFS, NORID},
120 {"if", IF, NORID},
121 {"sizeof", SIZEOF, NORID},
122 {"__volatile__", TYPE_QUAL, RID_VOLATILE},
123 {"", 0, 0},
124 {"int", TYPESPEC, RID_INT},
125 {"", 0, 0},
126 {"void", TYPESPEC, RID_VOID},
127 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
128 {"__const__", TYPE_QUAL, RID_CONST},
129 {"__complex", TYPESPEC, RID_COMPLEX},
130 {"__complex__", TYPESPEC, RID_COMPLEX},
131 {"@private", PRIVATE, NORID},
132 {"@selector", SELECTOR, NORID},
133 {"", 0, 0},
134 {"float", TYPESPEC, RID_FLOAT},
135 {"", 0, 0},
136 {"default", DEFAULT, NORID},
137 {"__typeof", TYPEOF, NORID},
138 {"enum", ENUM, NORID},
139 {"@public", PUBLIC, NORID},
140 {"break", BREAK, NORID},
141 {"signed", TYPESPEC, RID_SIGNED},
142 {"else", ELSE, NORID},
143 {"__asm__", ASM_KEYWORD, NORID},
144 {"for", FOR, NORID},
145 {"", 0, 0},
146 {"__imag", IMAGPART, NORID},
147 {"__alignof__", ALIGNOF, NORID},
148 {"", 0, 0},
149 {"__attribute__", ATTRIBUTE, NORID},
150 {"__const", TYPE_QUAL, RID_CONST},
151 {"", 0, 0},
152 {"in", TYPE_QUAL, RID_IN},
153 {"@end", END, NORID},
154 {"__volatile", TYPE_QUAL, RID_VOLATILE},
155 {"", 0, 0},
156 {"goto", GOTO, NORID},
157 {"", 0, 0}, {"", 0, 0},
158 {"union", UNION, NORID},
159 {"", 0, 0},
160 {"__label__", LABEL, NORID},
161 {"bycopy", TYPE_QUAL, RID_BYCOPY},
162 {"", 0, 0},
163 {"auto", SCSPEC, RID_AUTO},
164 {"byref", TYPE_QUAL, RID_BYREF},
165 {"case", CASE, NORID},
166 {"", 0, 0}, {"", 0, 0},
167 {"__ptrbase__", PTR_BASE, NORID},
168 {"__ptrvalue__", PTR_VALUE, NORID},
169 {"__ptrextent__", PTR_EXTENT, NORID},
170 {"register", SCSPEC, RID_REGISTER},
171 {"", 0, 0}, {"", 0, 0},
172 {"@class", CLASS, NORID},
173 {"__real", REALPART, NORID},
174 {"__asm", ASM_KEYWORD, NORID},
175 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
176 {"__builtin_va_arg", VA_ARG, NORID},
177 {"", 0, 0},
178 {"__attribute", ATTRIBUTE, NORID},
179 {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
180 {"return", RETURN, NORID},
181 {"", 0, 0},
182 {"@protocol", PROTOCOL, NORID},
183 {"", 0, 0},
184 {"__alignof", ALIGNOF, NORID},
185 {"@encode", ENCODE, NORID},
186 {"__ptrextent", PTR_EXTENT, NORID},
187 {"", 0, 0},
188 {"@interface", INTERFACE, NORID},
189 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
190 {"@implementation", IMPLEMENTATION, NORID},
191 {"", 0, 0}, {"", 0, 0},
192 {"__ptrbase", PTR_BASE, NORID},
193 {"__ptrvalue", PTR_VALUE, NORID},
194 {"extern", SCSPEC, RID_EXTERN},
195 {"inline", SCSPEC, RID_INLINE},
196 {"", 0, 0}, {"", 0, 0},
197 {"static", SCSPEC, RID_STATIC},
198 {"", 0, 0},
199 {"asm", ASM_KEYWORD, NORID},
200 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
201 {"char", TYPESPEC, RID_CHAR},
202 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
203 {"const", TYPE_QUAL, RID_CONST},
204 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
205 {"typeof", TYPEOF, NORID},
206 {"typedef", SCSPEC, RID_TYPEDEF},
207 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
208 {"continue", CONTINUE, NORID},
209 {"", 0, 0},
210 {"volatile", TYPE_QUAL, RID_VOLATILE},
211 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
212 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
213 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
214 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
215 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
216 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
217 {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
218 {"long", TYPESPEC, RID_LONG}
221 #ifdef __GNUC__
222 __inline
223 #endif
224 struct resword *
225 is_reserved_word (str, len)
226 register const char *str;
227 register unsigned int len;
229 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
231 register int key = hash (str, len);
233 if (key <= MAX_HASH_VALUE && key >= 0)
235 register const char *s = wordlist[key].name;
237 if (*str == *s && !strcmp (str + 1, s + 1))
238 return &wordlist[key];
241 return 0;