1/* Automatically generated from ./asm/pptok.dat by ./asm/pptok.pl */
2/* Do not edit */
3
4#include "compiler.h"
5#include <ctype.h>
6#include "nasmlib.h"
7#include "hashtbl.h"
8#include "preproc.h"
9
10const char * const pp_directives[109] = {
11 "%elif",
12 "%elifn",
13 "%elifctx",
14 "%elifnctx",
15 "%elifdef",
16 "%elifndef",
17 "%elifempty",
18 "%elifnempty",
19 "%elifenv",
20 "%elifnenv",
21 "%elifid",
22 "%elifnid",
23 "%elifidn",
24 "%elifnidn",
25 "%elifidni",
26 "%elifnidni",
27 "%elifmacro",
28 "%elifnmacro",
29 "%elifnum",
30 "%elifnnum",
31 "%elifstr",
32 "%elifnstr",
33 "%eliftoken",
34 "%elifntoken",
35 NULL,
36 NULL,
37 NULL,
38 NULL,
39 NULL,
40 NULL,
41 NULL,
42 NULL,
43 "%if",
44 "%ifn",
45 "%ifctx",
46 "%ifnctx",
47 "%ifdef",
48 "%ifndef",
49 "%ifempty",
50 "%ifnempty",
51 "%ifenv",
52 "%ifnenv",
53 "%ifid",
54 "%ifnid",
55 "%ifidn",
56 "%ifnidn",
57 "%ifidni",
58 "%ifnidni",
59 "%ifmacro",
60 "%ifnmacro",
61 "%ifnum",
62 "%ifnnum",
63 "%ifstr",
64 "%ifnstr",
65 "%iftoken",
66 "%ifntoken",
67 NULL,
68 NULL,
69 NULL,
70 NULL,
71 NULL,
72 NULL,
73 NULL,
74 NULL,
75 "%arg",
76 "%assign",
77 "%clear",
78 "%define",
79 "%defstr",
80 "%deftok",
81 "%depend",
82 "%else",
83 "%endif",
84 "%endm",
85 "%endmacro",
86 "%endrep",
87 "%error",
88 "%exitmacro",
89 "%exitrep",
90 "%fatal",
91 "%iassign",
92 "%idefine",
93 "%idefstr",
94 "%ideftok",
95 "%imacro",
96 "%include",
97 "%irmacro",
98 "%ixdefine",
99 "%line",
100 "%local",
101 "%macro",
102 "%pathsearch",
103 "%pop",
104 "%pragma",
105 "%push",
106 "%rep",
107 "%repl",
108 "%rmacro",
109 "%rotate",
110 "%stacksize",
111 "%strcat",
112 "%strlen",
113 "%substr",
114 "%undef",
115 "%unimacro",
116 "%unmacro",
117 "%use",
118 "%warning",
119 "%xdefine",
120};
121const uint8_t pp_directives_len[109] = {
122 5,
123 6,
124 8,
125 9,
126 8,
127 9,
128 10,
129 11,
130 8,
131 9,
132 7,
133 8,
134 8,
135 9,
136 9,
137 10,
138 10,
139 11,
140 8,
141 9,
142 8,
143 9,
144 10,
145 11,
146 0,
147 0,
148 0,
149 0,
150 0,
151 0,
152 0,
153 0,
154 3,
155 4,
156 6,
157 7,
158 6,
159 7,
160 8,
161 9,
162 6,
163 7,
164 5,
165 6,
166 6,
167 7,
168 7,
169 8,
170 8,
171 9,
172 6,
173 7,
174 6,
175 7,
176 8,
177 9,
178 0,
179 0,
180 0,
181 0,
182 0,
183 0,
184 0,
185 0,
186 4,
187 7,
188 6,
189 7,
190 7,
191 7,
192 7,
193 5,
194 6,
195 5,
196 9,
197 7,
198 6,
199 10,
200 8,
201 6,
202 8,
203 8,
204 8,
205 8,
206 7,
207 8,
208 8,
209 9,
210 5,
211 6,
212 6,
213 11,
214 4,
215 7,
216 5,
217 4,
218 5,
219 7,
220 7,
221 10,
222 7,
223 7,
224 7,
225 6,
226 9,
227 8,
228 4,
229 8,
230 8,
231};
232enum preproc_token pp_token_hash(const char *token)
233{
234#define UNUSED (65535/3)
235 static const int16_t hash1[128] = {
236 UNUSED,
237 UNUSED,
238 0,
239 0,
240 0,
241 0,
242 UNUSED,
243 UNUSED,
244 UNUSED,
245 UNUSED,
246 UNUSED,
247 UNUSED,
248 UNUSED,
249 UNUSED,
250 0,
251 UNUSED,
252 UNUSED,
253 0,
254 0,
255 UNUSED,
256 0,
257 UNUSED,
258 UNUSED,
259 UNUSED,
260 0,
261 -45,
262 UNUSED,
263 0,
264 UNUSED,
265 -60,
266 0,
267 UNUSED,
268 UNUSED,
269 -42,
270 UNUSED,
271 UNUSED,
272 -49,
273 UNUSED,
274 UNUSED,
275 0,
276 UNUSED,
277 UNUSED,
278 0,
279 UNUSED,
280 UNUSED,
281 UNUSED,
282 48,
283 UNUSED,
284 UNUSED,
285 49,
286 5,
287 UNUSED,
288 -53,
289 65,
290 UNUSED,
291 UNUSED,
292 0,
293 0,
294 UNUSED,
295 38,
296 UNUSED,
297 31,
298 0,
299 UNUSED,
300 6,
301 35,
302 UNUSED,
303 UNUSED,
304 60,
305 33,
306 UNUSED,
307 136,
308 UNUSED,
309 -87,
310 -12,
311 42,
312 17,
313 0,
314 130,
315 -85,
316 UNUSED,
317 UNUSED,
318 82,
319 0,
320 UNUSED,
321 16,
322 98,
323 -66,
324 -100,
325 0,
326 -10,
327 -76,
328 UNUSED,
329 84,
330 UNUSED,
331 1,
332 UNUSED,
333 0,
334 12,
335 UNUSED,
336 -145,
337 41,
338 106,
339 UNUSED,
340 85,
341 UNUSED,
342 43,
343 85,
344 UNUSED,
345 23,
346 0,
347 -14,
348 UNUSED,
349 UNUSED,
350 77,
351 -2,
352 UNUSED,
353 UNUSED,
354 11,
355 91,
356 -7,
357 UNUSED,
358 UNUSED,
359 UNUSED,
360 UNUSED,
361 107,
362 44,
363 UNUSED,
364 };
365 static const int16_t hash2[128] = {
366 UNUSED,
367 0,
368 UNUSED,
369 0,
370 UNUSED,
371 UNUSED,
372 0,
373 UNUSED,
374 UNUSED,
375 0,
376 UNUSED,
377 UNUSED,
378 UNUSED,
379 UNUSED,
380 UNUSED,
381 UNUSED,
382 UNUSED,
383 0,
384 80,
385 0,
386 64,
387 UNUSED,
388 0,
389 0,
390 0,
391 0,
392 UNUSED,
393 UNUSED,
394 UNUSED,
395 64,
396 UNUSED,
397 UNUSED,
398 UNUSED,
399 UNUSED,
400 UNUSED,
401 0,
402 121,
403 0,
404 UNUSED,
405 22,
406 100,
407 63,
408 UNUSED,
409 114,
410 UNUSED,
411 178,
412 UNUSED,
413 UNUSED,
414 UNUSED,
415 0,
416 UNUSED,
417 -40,
418 UNUSED,
419 88,
420 UNUSED,
421 UNUSED,
422 UNUSED,
423 UNUSED,
424 87,
425 UNUSED,
426 42,
427 UNUSED,
428 UNUSED,
429 141,
430 UNUSED,
431 UNUSED,
432 UNUSED,
433 103,
434 UNUSED,
435 46,
436 106,
437 149,
438 UNUSED,
439 23,
440 53,
441 0,
442 UNUSED,
443 UNUSED,
444 UNUSED,
445 0,
446 UNUSED,
447 UNUSED,
448 UNUSED,
449 33,
450 0,
451 0,
452 92,
453 UNUSED,
454 50,
455 72,
456 UNUSED,
457 7,
458 43,
459 66,
460 UNUSED,
461 UNUSED,
462 113,
463 52,
464 UNUSED,
465 UNUSED,
466 UNUSED,
467 UNUSED,
468 UNUSED,
469 UNUSED,
470 99,
471 101,
472 71,
473 UNUSED,
474 20,
475 63,
476 32,
477 UNUSED,
478 UNUSED,
479 UNUSED,
480 97,
481 18,
482 84,
483 132,
484 UNUSED,
485 37,
486 UNUSED,
487 9,
488 20,
489 UNUSED,
490 UNUSED,
491 75,
492 98,
493 UNUSED,
494 };
495 uint32_t k1, k2;
496 uint64_t crc;
497 uint16_t ix;
498
499 crc = crc64i(UINT64_C(0xaee7ac5ccabdec91), token);
500 k1 = (uint32_t)crc;
501 k2 = (uint32_t)(crc >> 32);
502
503 ix = hash1[k1 & 0x7f] + hash2[k2 & 0x7f];
504 if (ix >= 109)
505 return PP_INVALID;
506
507 if (!pp_directives[ix] || nasm_stricmp(pp_directives[ix], token))
508 return PP_INVALID;
509
510 return ix;
511}
512