1 /****************************************************************************
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
40 ****************************************************************************/
41 /* C++ code produced by gperf version 3.0.3 */
42 /* Command-line: gperf TokenLookup.gperf */
43 /* Computed positions: -k'1,3,$' */
45 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
46 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
47 && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
48 && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
49 && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
50 && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
51 && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
52 && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
53 && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
54 && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
55 && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
56 && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
57 && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
58 && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
59 && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
60 && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
61 && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
62 && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
63 && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
64 && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
65 && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
66 && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
67 && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
68 /* The character set is not based on ISO-646. */
69 #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
72 #line 107 "TokenLookup.gperf"
80 #line 101 "TokenLookup.gperf"
84 const Tokenizer::TokenType token;
88 /* The strings below are in UTF-16 encoding. Subsequently, each ASCII
89 * character is stored as the ASCII character, followed by a null byte.
90 * Sorted alphabetically. */;
91 /* maximum key range = 228, duplicates = 0 */
96 static inline unsigned int hash (const char *str, unsigned int len);
98 static const struct TokenMap *value (const char *str, unsigned int len);
102 TokenLookup::hash (register const char *str, register unsigned int len)
104 static const unsigned char asso_values[] =
106 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
107 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
108 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
109 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
110 230, 230, 230, 230, 230, 25, 230, 230, 230, 230,
111 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
112 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
113 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
114 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
115 230, 230, 230, 230, 230, 230, 230, 0, 2, 5,
116 25, 0, 20, 20, 35, 85, 230, 230, 40, 110,
117 25, 65, 80, 0, 60, 5, 10, 0, 55, 5,
118 20, 0, 230, 230, 230, 230, 230, 230, 230, 230,
119 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
120 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
121 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
122 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
123 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
124 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
125 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
126 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
127 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
128 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
129 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
130 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
131 230, 230, 230, 230, 230, 230
133 register int hval = len;
138 hval += asso_values[(unsigned char)str[2]];
142 hval += asso_values[(unsigned char)str[0]];
145 return hval + asso_values[(unsigned char)str[len - 1]];
148 const struct TokenMap *
149 TokenLookup::value (register const char *str, register unsigned int len)
155 MAX_WORD_LENGTH = 22,
160 static const struct TokenMap wordlist[] =
162 {"",ERROR}, {"",ERROR},
163 #line 152 "TokenLookup.gperf"
166 #line 130 "TokenLookup.gperf"
168 #line 153 "TokenLookup.gperf"
171 #line 123 "TokenLookup.gperf"
174 #line 148 "TokenLookup.gperf"
176 #line 217 "TokenLookup.gperf"
178 #line 204 "TokenLookup.gperf"
180 #line 126 "TokenLookup.gperf"
183 #line 131 "TokenLookup.gperf"
186 #line 129 "TokenLookup.gperf"
187 {"boundary-space", BOUNDARY_SPACE},
188 #line 147 "TokenLookup.gperf"
189 {"element", ELEMENT},
190 #line 132 "TokenLookup.gperf"
191 {"castable", CASTABLE},
192 #line 127 "TokenLookup.gperf"
193 {"attribute", ATTRIBUTE},
195 #line 154 "TokenLookup.gperf"
197 #line 161 "TokenLookup.gperf"
200 #line 133 "TokenLookup.gperf"
202 #line 210 "TokenLookup.gperf"
204 #line 218 "TokenLookup.gperf"
206 #line 181 "TokenLookup.gperf"
209 #line 198 "TokenLookup.gperf"
210 {"satisfies", SATISFIES},
211 {"",ERROR}, {"",ERROR},
212 #line 163 "TokenLookup.gperf"
214 #line 151 "TokenLookup.gperf"
215 {"encoding", ENCODING},
216 #line 124 "TokenLookup.gperf"
217 {"ascending", ASCENDING},
219 #line 125 "TokenLookup.gperf"
221 #line 139 "TokenLookup.gperf"
222 {"declare", DECLARE},
223 #line 162 "TokenLookup.gperf"
224 {"greatest", GREATEST},
225 #line 208 "TokenLookup.gperf"
228 #line 121 "TokenLookup.gperf"
229 {"ancestor-or-self", ANCESTOR_OR_SELF},
230 #line 175 "TokenLookup.gperf"
232 #line 146 "TokenLookup.gperf"
233 {"document-node", DOCUMENT_NODE},
234 #line 207 "TokenLookup.gperf"
237 #line 201 "TokenLookup.gperf"
240 #line 145 "TokenLookup.gperf"
241 {"document", DOCUMENT},
243 #line 141 "TokenLookup.gperf"
244 {"descendant", DESCENDANT},
246 #line 177 "TokenLookup.gperf"
248 #line 122 "TokenLookup.gperf"
250 #line 182 "TokenLookup.gperf"
252 #line 174 "TokenLookup.gperf"
254 #line 199 "TokenLookup.gperf"
255 {"schema-attribute", SCHEMA_ATTRIBUTE},
257 #line 155 "TokenLookup.gperf"
258 {"external", EXTERNAL},
260 #line 143 "TokenLookup.gperf"
261 {"descending", DESCENDING},
262 #line 184 "TokenLookup.gperf"
263 {"no-preserve", NO_PRESERVE},
264 #line 140 "TokenLookup.gperf"
265 {"default", DEFAULT},
266 #line 176 "TokenLookup.gperf"
268 #line 200 "TokenLookup.gperf"
269 {"schema-element", SCHEMA_ELEMENT},
270 {"",ERROR}, {"",ERROR},
271 #line 137 "TokenLookup.gperf"
272 {"construction", CONSTRUCTION},
273 #line 142 "TokenLookup.gperf"
274 {"descendant-or-self", DESCENDANT_OR_SELF},
275 #line 202 "TokenLookup.gperf"
277 #line 183 "TokenLookup.gperf"
278 {"no-inherit", NO_INHERIT},
280 #line 158 "TokenLookup.gperf"
281 {"follows", FOLLOWS},
282 #line 120 "TokenLookup.gperf"
283 {"ancestor", ANCESTOR},
284 {"",ERROR}, {"",ERROR}, {"",ERROR},
285 #line 209 "TokenLookup.gperf"
287 #line 160 "TokenLookup.gperf"
288 {"function", FUNCTION},
289 #line 135 "TokenLookup.gperf"
290 {"collation", COLLATION},
292 #line 205 "TokenLookup.gperf"
295 #line 173 "TokenLookup.gperf"
298 #line 149 "TokenLookup.gperf"
301 #line 185 "TokenLookup.gperf"
303 #line 195 "TokenLookup.gperf"
304 {"preserve", PRESERVE},
305 #line 156 "TokenLookup.gperf"
306 {"following", FOLLOWING},
307 {"",ERROR}, {"",ERROR},
308 #line 171 "TokenLookup.gperf"
310 #line 192 "TokenLookup.gperf"
311 {"precedes", PRECEDES},
312 #line 150 "TokenLookup.gperf"
313 {"empty-sequence", EMPTY_SEQUENCE},
314 {"",ERROR}, {"",ERROR},
315 #line 157 "TokenLookup.gperf"
316 {"following-sibling", FOLLOWING_SIBLING},
317 #line 169 "TokenLookup.gperf"
318 {"instance", INSTANCE},
319 #line 213 "TokenLookup.gperf"
320 {"unordered", UNORDERED},
321 #line 128 "TokenLookup.gperf"
322 {"base-uri", BASEURI},
323 #line 197 "TokenLookup.gperf"
326 #line 214 "TokenLookup.gperf"
327 {"validate", VALIDATE},
329 #line 138 "TokenLookup.gperf"
330 {"copy-namespaces", COPY_NAMESPACES},
331 #line 186 "TokenLookup.gperf"
333 #line 165 "TokenLookup.gperf"
336 #line 193 "TokenLookup.gperf"
337 {"preceding", PRECEDING},
338 {"",ERROR}, {"",ERROR},
339 #line 168 "TokenLookup.gperf"
342 #line 170 "TokenLookup.gperf"
343 {"intersect", INTERSECT},
344 #line 212 "TokenLookup.gperf"
347 #line 194 "TokenLookup.gperf"
348 {"preceding-sibling", PRECEDING_SIBLING},
349 #line 188 "TokenLookup.gperf"
350 {"ordering", ORDERING},
351 #line 203 "TokenLookup.gperf"
353 #line 134 "TokenLookup.gperf"
356 #line 187 "TokenLookup.gperf"
357 {"ordered", ORDERED},
358 #line 215 "TokenLookup.gperf"
359 {"variable", VARIABLE},
360 {"",ERROR}, {"",ERROR}, {"",ERROR},
361 #line 190 "TokenLookup.gperf"
363 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
364 #line 136 "TokenLookup.gperf"
365 {"comment", COMMENT},
366 {"",ERROR}, {"",ERROR},
367 #line 211 "TokenLookup.gperf"
368 {"typeswitch", TYPESWITCH},
370 #line 167 "TokenLookup.gperf"
371 {"inherit", INHERIT},
372 #line 144 "TokenLookup.gperf"
374 {"",ERROR}, {"",ERROR},
375 #line 179 "TokenLookup.gperf"
378 #line 159 "TokenLookup.gperf"
380 #line 180 "TokenLookup.gperf"
381 {"namespace", NAMESPACE},
382 {"",ERROR}, {"",ERROR},
383 #line 216 "TokenLookup.gperf"
384 {"version", VERSION},
385 {"",ERROR}, {"",ERROR},
386 #line 206 "TokenLookup.gperf"
388 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
389 #line 189 "TokenLookup.gperf"
391 #line 191 "TokenLookup.gperf"
393 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
394 {"",ERROR}, {"",ERROR},
395 #line 178 "TokenLookup.gperf"
397 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
398 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
399 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
400 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
402 #line 166 "TokenLookup.gperf"
404 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
405 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
406 {"",ERROR}, {"",ERROR},
407 #line 196 "TokenLookup.gperf"
408 {"processing-instruction", PROCESSING_INSTRUCTION},
409 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
410 {"",ERROR}, {"",ERROR},
411 #line 172 "TokenLookup.gperf"
413 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
414 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
415 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
416 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
417 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
418 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
419 {"",ERROR}, {"",ERROR}, {"",ERROR}, {"",ERROR},
421 #line 164 "TokenLookup.gperf"
425 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
427 register int key = hash (str, len);
429 if (key <= MAX_HASH_VALUE && key >= 0)
431 register const char *s = wordlist[key].name;
433 if (*str == *s && !strcmp (str + 1, s + 1))
434 return &wordlist[key];
439 #line 219 "TokenLookup.gperf"
442 } /* Close the QPatternist namespace. */