| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512 |
- /* Automatically generated from ./asm/pptok.dat by ./asm/pptok.pl */
- /* Do not edit */
- #include "compiler.h"
- #include <ctype.h>
- #include "nasmlib.h"
- #include "hashtbl.h"
- #include "preproc.h"
- const char * const pp_directives[109] = {
- "%elif",
- "%elifn",
- "%elifctx",
- "%elifnctx",
- "%elifdef",
- "%elifndef",
- "%elifempty",
- "%elifnempty",
- "%elifenv",
- "%elifnenv",
- "%elifid",
- "%elifnid",
- "%elifidn",
- "%elifnidn",
- "%elifidni",
- "%elifnidni",
- "%elifmacro",
- "%elifnmacro",
- "%elifnum",
- "%elifnnum",
- "%elifstr",
- "%elifnstr",
- "%eliftoken",
- "%elifntoken",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "%if",
- "%ifn",
- "%ifctx",
- "%ifnctx",
- "%ifdef",
- "%ifndef",
- "%ifempty",
- "%ifnempty",
- "%ifenv",
- "%ifnenv",
- "%ifid",
- "%ifnid",
- "%ifidn",
- "%ifnidn",
- "%ifidni",
- "%ifnidni",
- "%ifmacro",
- "%ifnmacro",
- "%ifnum",
- "%ifnnum",
- "%ifstr",
- "%ifnstr",
- "%iftoken",
- "%ifntoken",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "%arg",
- "%assign",
- "%clear",
- "%define",
- "%defstr",
- "%deftok",
- "%depend",
- "%else",
- "%endif",
- "%endm",
- "%endmacro",
- "%endrep",
- "%error",
- "%exitmacro",
- "%exitrep",
- "%fatal",
- "%iassign",
- "%idefine",
- "%idefstr",
- "%ideftok",
- "%imacro",
- "%include",
- "%irmacro",
- "%ixdefine",
- "%line",
- "%local",
- "%macro",
- "%pathsearch",
- "%pop",
- "%pragma",
- "%push",
- "%rep",
- "%repl",
- "%rmacro",
- "%rotate",
- "%stacksize",
- "%strcat",
- "%strlen",
- "%substr",
- "%undef",
- "%unimacro",
- "%unmacro",
- "%use",
- "%warning",
- "%xdefine",
- };
- const uint8_t pp_directives_len[109] = {
- 5,
- 6,
- 8,
- 9,
- 8,
- 9,
- 10,
- 11,
- 8,
- 9,
- 7,
- 8,
- 8,
- 9,
- 9,
- 10,
- 10,
- 11,
- 8,
- 9,
- 8,
- 9,
- 10,
- 11,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 3,
- 4,
- 6,
- 7,
- 6,
- 7,
- 8,
- 9,
- 6,
- 7,
- 5,
- 6,
- 6,
- 7,
- 7,
- 8,
- 8,
- 9,
- 6,
- 7,
- 6,
- 7,
- 8,
- 9,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 4,
- 7,
- 6,
- 7,
- 7,
- 7,
- 7,
- 5,
- 6,
- 5,
- 9,
- 7,
- 6,
- 10,
- 8,
- 6,
- 8,
- 8,
- 8,
- 8,
- 7,
- 8,
- 8,
- 9,
- 5,
- 6,
- 6,
- 11,
- 4,
- 7,
- 5,
- 4,
- 5,
- 7,
- 7,
- 10,
- 7,
- 7,
- 7,
- 6,
- 9,
- 8,
- 4,
- 8,
- 8,
- };
- enum preproc_token pp_token_hash(const char *token)
- {
- #define UNUSED (65535/3)
- static const int16_t hash1[128] = {
- UNUSED,
- UNUSED,
- 0,
- 0,
- 0,
- 0,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- 0,
- UNUSED,
- UNUSED,
- 0,
- 0,
- UNUSED,
- 0,
- UNUSED,
- UNUSED,
- UNUSED,
- 0,
- -45,
- UNUSED,
- 0,
- UNUSED,
- -60,
- 0,
- UNUSED,
- UNUSED,
- -42,
- UNUSED,
- UNUSED,
- -49,
- UNUSED,
- UNUSED,
- 0,
- UNUSED,
- UNUSED,
- 0,
- UNUSED,
- UNUSED,
- UNUSED,
- 48,
- UNUSED,
- UNUSED,
- 49,
- 5,
- UNUSED,
- -53,
- 65,
- UNUSED,
- UNUSED,
- 0,
- 0,
- UNUSED,
- 38,
- UNUSED,
- 31,
- 0,
- UNUSED,
- 6,
- 35,
- UNUSED,
- UNUSED,
- 60,
- 33,
- UNUSED,
- 136,
- UNUSED,
- -87,
- -12,
- 42,
- 17,
- 0,
- 130,
- -85,
- UNUSED,
- UNUSED,
- 82,
- 0,
- UNUSED,
- 16,
- 98,
- -66,
- -100,
- 0,
- -10,
- -76,
- UNUSED,
- 84,
- UNUSED,
- 1,
- UNUSED,
- 0,
- 12,
- UNUSED,
- -145,
- 41,
- 106,
- UNUSED,
- 85,
- UNUSED,
- 43,
- 85,
- UNUSED,
- 23,
- 0,
- -14,
- UNUSED,
- UNUSED,
- 77,
- -2,
- UNUSED,
- UNUSED,
- 11,
- 91,
- -7,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- 107,
- 44,
- UNUSED,
- };
- static const int16_t hash2[128] = {
- UNUSED,
- 0,
- UNUSED,
- 0,
- UNUSED,
- UNUSED,
- 0,
- UNUSED,
- UNUSED,
- 0,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- 0,
- 80,
- 0,
- 64,
- UNUSED,
- 0,
- 0,
- 0,
- 0,
- UNUSED,
- UNUSED,
- UNUSED,
- 64,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- 0,
- 121,
- 0,
- UNUSED,
- 22,
- 100,
- 63,
- UNUSED,
- 114,
- UNUSED,
- 178,
- UNUSED,
- UNUSED,
- UNUSED,
- 0,
- UNUSED,
- -40,
- UNUSED,
- 88,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- 87,
- UNUSED,
- 42,
- UNUSED,
- UNUSED,
- 141,
- UNUSED,
- UNUSED,
- UNUSED,
- 103,
- UNUSED,
- 46,
- 106,
- 149,
- UNUSED,
- 23,
- 53,
- 0,
- UNUSED,
- UNUSED,
- UNUSED,
- 0,
- UNUSED,
- UNUSED,
- UNUSED,
- 33,
- 0,
- 0,
- 92,
- UNUSED,
- 50,
- 72,
- UNUSED,
- 7,
- 43,
- 66,
- UNUSED,
- UNUSED,
- 113,
- 52,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- UNUSED,
- 99,
- 101,
- 71,
- UNUSED,
- 20,
- 63,
- 32,
- UNUSED,
- UNUSED,
- UNUSED,
- 97,
- 18,
- 84,
- 132,
- UNUSED,
- 37,
- UNUSED,
- 9,
- 20,
- UNUSED,
- UNUSED,
- 75,
- 98,
- UNUSED,
- };
- uint32_t k1, k2;
- uint64_t crc;
- uint16_t ix;
- crc = crc64i(UINT64_C(0xaee7ac5ccabdec91), token);
- k1 = (uint32_t)crc;
- k2 = (uint32_t)(crc >> 32);
- ix = hash1[k1 & 0x7f] + hash2[k2 & 0x7f];
- if (ix >= 109)
- return PP_INVALID;
- if (!pp_directives[ix] || nasm_stricmp(pp_directives[ix], token))
- return PP_INVALID;
- return ix;
- }
|