/work/workdir/CustomTarget/editeng/generated/tokens.cxx
Line | Count | Source |
1 | | /* C++ code produced by gperf version 3.1 */ |
2 | | /* Command-line: /usr/bin/gperf --compare-strncmp --readonly-tables --pic /work/workdir/CustomTarget/editeng/generated/tokens.gperf */ |
3 | | /* Computed positions: -k'1' */ |
4 | | |
5 | | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ |
6 | | && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ |
7 | | && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ |
8 | | && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ |
9 | | && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ |
10 | | && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ |
11 | | && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ |
12 | | && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ |
13 | | && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ |
14 | | && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ |
15 | | && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ |
16 | | && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ |
17 | | && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ |
18 | | && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ |
19 | | && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ |
20 | | && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ |
21 | | && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ |
22 | | && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ |
23 | | && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ |
24 | | && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ |
25 | | && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ |
26 | | && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ |
27 | | && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) |
28 | | /* The character set is not based on ISO-646. */ |
29 | | #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>." |
30 | | #endif |
31 | | |
32 | | struct xmltoken |
33 | | { |
34 | | int name; XMLTokenEnum nToken; |
35 | | }; |
36 | | |
37 | | #define TOTAL_KEYWORDS 7 |
38 | 0 | #define MIN_WORD_LENGTH 4 |
39 | 0 | #define MAX_WORD_LENGTH 16 |
40 | | #define MIN_HASH_VALUE 4 |
41 | 0 | #define MAX_HASH_VALUE 21 |
42 | | /* maximum key range = 18, duplicates = 0 */ |
43 | | |
44 | | class Perfect_Hash |
45 | | { |
46 | | private: |
47 | | static inline unsigned int hash (const char *str, size_t len); |
48 | | public: |
49 | | static const struct xmltoken *in_word_set (const char *str, size_t len); |
50 | | }; |
51 | | |
52 | | inline unsigned int |
53 | | Perfect_Hash::hash (const char *str, size_t len) |
54 | 0 | { |
55 | 0 | static const unsigned char asso_values[] = |
56 | 0 | { |
57 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
58 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
59 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
60 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
61 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
62 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
63 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
64 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
65 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
66 | 0 | 22, 22, 22, 22, 22, 22, 22, 5, 0, 22, |
67 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 0, 22, |
68 | 0 | 0, 22, 0, 22, 22, 22, 22, 0, 22, 22, |
69 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
70 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
71 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
72 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
73 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
74 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
75 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
76 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
77 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
78 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
79 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
80 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
81 | 0 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
82 | 0 | 22, 22, 22, 22, 22, 22 |
83 | 0 | }; |
84 | 0 | return len + asso_values[static_cast<unsigned char>(str[0])]; |
85 | 0 | } |
86 | | |
87 | | struct stringpool_t |
88 | | { |
89 | | char stringpool_str4[sizeof("name")]; |
90 | | char stringpool_str5[sizeof("block")]; |
91 | | char stringpool_str9[sizeof("list-name")]; |
92 | | char stringpool_str10[sizeof("block-list")]; |
93 | | char stringpool_str12[sizeof("package-name")]; |
94 | | char stringpool_str16[sizeof("unformatted-text")]; |
95 | | char stringpool_str21[sizeof("abbreviated-name")]; |
96 | | }; |
97 | | static const struct stringpool_t stringpool_contents = |
98 | | { |
99 | | "name", |
100 | | "block", |
101 | | "list-name", |
102 | | "block-list", |
103 | | "package-name", |
104 | | "unformatted-text", |
105 | | "abbreviated-name" |
106 | | }; |
107 | 0 | #define stringpool ((const char *) &stringpool_contents) |
108 | | |
109 | | static const struct xmltoken wordlist[] = |
110 | | { |
111 | | {-1}, {-1}, {-1}, {-1}, |
112 | | {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str4,XML_NAME}, |
113 | | {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str5,XML_BLOCK}, |
114 | | {-1}, {-1}, {-1}, |
115 | | {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9,XML_LIST_NAME}, |
116 | | {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10,XML_BLOCK_LIST}, |
117 | | {-1}, |
118 | | {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12,XML_PACKAGE_NAME}, |
119 | | {-1}, {-1}, {-1}, |
120 | | {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16,XML_UNFORMATTED_TEXT}, |
121 | | {-1}, {-1}, {-1}, {-1}, |
122 | | {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21,XML_ABBREVIATED_NAME} |
123 | | }; |
124 | | |
125 | | const struct xmltoken * |
126 | | Perfect_Hash::in_word_set (const char *str, size_t len) |
127 | 0 | { |
128 | 0 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) |
129 | 0 | { |
130 | 0 | unsigned int key = hash (str, len); |
131 | |
|
132 | 0 | if (key <= MAX_HASH_VALUE) |
133 | 0 | { |
134 | 0 | int o = wordlist[key].name; |
135 | 0 | if (o >= 0) |
136 | 0 | { |
137 | 0 | const char *s = o + stringpool; |
138 | |
|
139 | 0 | if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') |
140 | 0 | return &wordlist[key]; |
141 | 0 | } |
142 | 0 | } |
143 | 0 | } |
144 | 0 | return 0; |
145 | 0 | } |
146 | | |