tokenhash.h Source File documentation

tokenhash.h
Go to the documentation of this file.
1/* C++ code produced by gperf version 3.3 */
2/* Command-line: gperf --compare-strncmp -C -m 20 tokens.gperf */
3/* Computed positions: -k'1,4-5,8' */
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#line 5 "tokens.gperf"
33 struct fhtoken
34{
35 const char *name;
36 int tokenId;
37};
38
39#define TOTAL_KEYWORDS 124
40#define MIN_WORD_LENGTH 4
41#define MAX_WORD_LENGTH 24
42#define MIN_HASH_VALUE 18
43#define MAX_HASH_VALUE 187
44/* maximum key range = 170, duplicates = 0 */
45
46 class Perfect_Hash
47{
48private:
49 static inline unsigned int hash (const char *str, size_t len);
50public:
51 static const struct fhtoken *in_word_set (const char *str, size_t len);
52};
53
54inline unsigned int
55 Perfect_Hash::hash (const char *str, size_t len)
56{
57 static const unsigned char asso_values[] =
58 {
59 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
60 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
61 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
62 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
63 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
64 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
65 188, 188, 188, 188, 188, 91, 12, 10, 57, 24,
66 6, 14, 5, 51, 188, 188, 9, 6, 49, 101,
67 37, 188, 81, 44, 5, 7, 31, 188, 17, 188,
68 188, 188, 188, 188, 188, 188, 188, 6, 12, 14,
69 94, 9, 5, 31, 50, 5, 5, 111, 24, 50,
70 54, 29, 12, 188, 6, 37, 5, 81, 39, 13,
71 188, 34, 188, 188, 188, 188, 188, 188, 188, 188,
72 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
73 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
74 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
75 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
76 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
77 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
78 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
79 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
80 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
81 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
82 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
83 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
84 188, 188, 188, 188, 188, 188
85 };
86 unsigned int hval = len;
87
88 switch (hval)
89 {
90 default:
91 hval += asso_values[static_cast<unsigned char>(str[7])];
92#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))
93 [[fallthrough]];
94#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)
95 __attribute__ ((__fallthrough__));
96#endif
97 /*FALLTHROUGH*/
98 case 7:
99 case 6:
100 case 5:
101 hval += asso_values[static_cast<unsigned char>(str[4])];
102#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))
103 [[fallthrough]];
104#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)
105 __attribute__ ((__fallthrough__));
106#endif
107 /*FALLTHROUGH*/
108 case 4:
109 hval += asso_values[static_cast<unsigned char>(str[3])];
110#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))
111 [[fallthrough]];
112#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)
113 __attribute__ ((__fallthrough__));
114#endif
115 /*FALLTHROUGH*/
116 case 3:
117 case 2:
118 case 1:
119 hval += asso_values[static_cast<unsigned char>(str[0])];
120 break;
121 }
122 return hval;
123}
124
125#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3)
126#pragma GCC diagnostic push
127#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
128#endif
129 static const struct fhtoken wordlist[] =
130 {
131 {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
132 {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
133 {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
134 {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
135 {(char*)0, 0}, {(char*)0, 0},
136#line 70 "tokens.gperf"
137 {"List",FH_LIST},
138 {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
139#line 119 "tokens.gperf"
140 {"TString",FH_TSTRING},
141#line 75 "tokens.gperf"
142 {"MString",FH_MSTRING},
143#line 131 "tokens.gperf"
144 {"UString",FH_USTRING},
145#line 117 "tokens.gperf"
146 {"TEffect",FH_TEFFECT},
147 {(char*)0, 0}, {(char*)0, 0},
148#line 65 "tokens.gperf"
149 {"Layer",FH_LAYER},
150#line 71 "tokens.gperf"
151 {"MDict",FH_MDICT},
152 {(char*)0, 0},
153#line 61 "tokens.gperf"
154 {"Halftone",FH_HALFTONE},
155#line 120 "tokens.gperf"
156 {"TabTable",FH_TABTABLE},
157 {(char*)0, 0},
158#line 83 "tokens.gperf"
159 {"MultiBlend",FH_MULTIBLEND},
160#line 82 "tokens.gperf"
161 {"MpObject",FH_MPOBJECT},
162#line 121 "tokens.gperf"
163 {"TaperedFill",FH_TAPEREDFILL},
164#line 122 "tokens.gperf"
165 {"TaperedFillX",FH_TAPEREDFILLX},
166#line 69 "tokens.gperf"
167 {"LinearFill",FH_LINEARFILL},
168#line 74 "tokens.gperf"
169 {"MQuickDict",FH_MQUICKDICT},
170#line 32 "tokens.gperf"
171 {"ContentFill",FH_CONTENTFILL},
172#line 76 "tokens.gperf"
173 {"MasterPageDocMan",FH_MASTERPAGEDOCMAN},
174#line 77 "tokens.gperf"
175 {"MasterPageElement",FH_MASTERPAGEELEMENT},
176#line 25 "tokens.gperf"
177 {"CharacterFill",FH_CHARACTERFILL},
178#line 50 "tokens.gperf"
179 {"FWFeatherFilter",FH_FWFEATHERFILTER},
180#line 56 "tokens.gperf"
181 {"FilterAttributeHolder",FH_FILTERATTRIBUTEHOLDER},
182#line 80 "tokens.gperf"
183 {"MasterPageSymbolClass",FH_MASTERPAGESYMBOLCLASS},
184#line 78 "tokens.gperf"
185 {"MasterPageLayerElement",FH_MASTERPAGELAYERELEMENT},
186#line 79 "tokens.gperf"
187 {"MasterPageLayerInstance",FH_MASTERPAGELAYERINSTANCE},
188#line 81 "tokens.gperf"
189 {"MasterPageSymbolInstance",FH_MASTERPAGESYMBOLINSTANCE},
190#line 28 "tokens.gperf"
191 {"Color6",FH_COLOR6},
192#line 127 "tokens.gperf"
193 {"TileFill",FH_TILEFILL},
194#line 72 "tokens.gperf"
195 {"MList",FH_MLIST},
196#line 84 "tokens.gperf"
197 {"MultiColorList",FH_MULTICOLORLIST},
198#line 132 "tokens.gperf"
199 {"VDict",FH_VDICT},
200#line 68 "tokens.gperf"
201 {"LineTable",FH_LINETABLE},
202#line 30 "tokens.gperf"
203 {"ConeFill",FH_CONEFILL},
204#line 128 "tokens.gperf"
205 {"TintColor",FH_TINTCOLOR},
206#line 129 "tokens.gperf"
207 {"TintColor6",FH_TINTCOLOR6},
208#line 34 "tokens.gperf"
209 {"CustomProc",FH_CUSTOMPROC},
210#line 33 "tokens.gperf"
211 {"ContourFill",FH_CONTOURFILL},
212#line 67 "tokens.gperf"
213 {"LinePat",FH_LINEPAT},
214#line 24 "tokens.gperf"
215 {"CalligraphicStroke",FH_CALLIGRAPHICSTROKE},
216#line 15 "tokens.gperf"
217 {"BasicFill",FH_BASICFILL},
218#line 104 "tokens.gperf"
219 {"PropLst",FH_PROPLST},
220#line 47 "tokens.gperf"
221 {"FHDocHeader",FH_FHDOCHEADER},
222#line 35 "tokens.gperf"
223 {"Data",FH_DATA},
224#line 97 "tokens.gperf"
225 {"PatternFill",FH_PATTERNFILL},
226#line 29 "tokens.gperf"
227 {"CompositePath",FH_COMPOSITEPATH},
228#line 73 "tokens.gperf"
229 {"MName",FH_MNAME},
230#line 98 "tokens.gperf"
231 {"PatternLine",FH_PATTERNLINE},
232#line 90 "tokens.gperf"
233 {"PSFill",FH_PSFILL},
234#line 48 "tokens.gperf"
235 {"FWBevelFilter",FH_FWBEVELFILTER},
236#line 44 "tokens.gperf"
237 {"Envelope",FH_ENVELOPE},
238#line 102 "tokens.gperf"
239 {"Procedure",FH_PROCEDURE},
240#line 51 "tokens.gperf"
241 {"FWGlowFilter",FH_FWGLOWFILTER},
242#line 126 "tokens.gperf"
243 {"TextInPath",FH_TEXTINPATH},
244#line 134 "tokens.gperf"
245 {"Xform",FH_XFORM},
246#line 125 "tokens.gperf"
247 {"TextEffs",FH_TEXTEFFS},
248#line 109 "tokens.gperf"
249 {"SketchFilter",FH_SKETCHFILTER},
250#line 27 "tokens.gperf"
251 {"Collector",FH_COLLECTOR},
252#line 103 "tokens.gperf"
253 {"ProcessColor",FH_PROCESSCOLOR},
254#line 39 "tokens.gperf"
255 {"DuetFilter",FH_DUETFILTER},
256#line 66 "tokens.gperf"
257 {"LensFill",FH_LENSFILL},
258#line 36 "tokens.gperf"
259 {"DataList",FH_DATALIST},
260#line 53 "tokens.gperf"
261 {"FWSharpenFilter",FH_FWSHARPENFILTER},
262 {(char*)0, 0},
263#line 37 "tokens.gperf"
264 {"DateTime",FH_DATETIME},
265#line 52 "tokens.gperf"
266 {"FWShadowFilter",FH_FWSHADOWFILTER},
267#line 43 "tokens.gperf"
268 {"Element",FH_ELEMENT},
269#line 94 "tokens.gperf"
270 {"Path",FH_PATH},
271#line 64 "tokens.gperf"
272 {"Import",FH_IMPORT},
273#line 92 "tokens.gperf"
274 {"PantoneColor",FH_PANTONECOLOR},
275#line 16 "tokens.gperf"
276 {"BasicLine",FH_BASICLINE},
277#line 93 "tokens.gperf"
278 {"Paragraph",FH_PARAGRAPH},
279#line 41 "tokens.gperf"
280 {"ElemList",FH_ELEMLIST},
281#line 110 "tokens.gperf"
282 {"SpotColor",FH_SPOTCOLOR},
283#line 111 "tokens.gperf"
284 {"SpotColor6",FH_SPOTCOLOR6},
285#line 54 "tokens.gperf"
286 {"Figure",FH_FIGURE},
287#line 55 "tokens.gperf"
288 {"FileDescriptor",FH_FILEDESCRIPTOR},
289#line 45 "tokens.gperf"
290 {"ExpandFilter",FH_EXPANDFILTER},
291#line 91 "tokens.gperf"
292 {"PSLine",FH_PSLINE},
293#line 116 "tokens.gperf"
294 {"SymbolLibrary",FH_SYMBOLLIBRARY},
295#line 20 "tokens.gperf"
296 {"Brush",FH_BRUSH},
297#line 95 "tokens.gperf"
298 {"PathText",FH_PATHTEXT},
299#line 100 "tokens.gperf"
300 {"PerspectiveGrid",FH_PERSPECTIVEGRID},
301#line 105 "tokens.gperf"
302 {"RadialFill",FH_RADIALFILL},
303#line 106 "tokens.gperf"
304 {"RadialFillX",FH_RADIALFILLX},
305#line 38 "tokens.gperf"
306 {"DisplayText",FH_DISPLAYTEXT},
307#line 99 "tokens.gperf"
308 {"PerspectiveEnvelope",FH_PERSPECTIVEENVELOPE},
309#line 124 "tokens.gperf"
310 {"TextColumn",FH_TEXTCOLUMN},
311#line 59 "tokens.gperf"
312 {"Group",FH_GROUP},
313#line 96 "tokens.gperf"
314 {"PathTextLineInfo",FH_PATHTEXTLINEINFO},
315#line 63 "tokens.gperf"
316 {"ImageImport",FH_IMAGEIMPORT},
317#line 31 "tokens.gperf"
318 {"ConnectorLine",FH_CONNECTORLINE},
319#line 22 "tokens.gperf"
320 {"BrushStroke",FH_BRUSHSTROKE},
321#line 130 "tokens.gperf"
322 {"TransformFilter",FH_TRANSFORMFILTER},
323#line 112 "tokens.gperf"
324 {"StylePropLst",FH_STYLEPROPLST},
325#line 23 "tokens.gperf"
326 {"BrushTip",FH_BRUSHTIP},
327#line 114 "tokens.gperf"
328 {"SymbolClass",FH_SYMBOLCLASS},
329#line 101 "tokens.gperf"
330 {"PolygonFigure",FH_POLYGONFIGURE},
331#line 14 "tokens.gperf"
332 {"AttributeHolder",FH_ATTRIBUTEHOLDER},
333#line 60 "tokens.gperf"
334 {"Guides",FH_GUIDES},
335#line 62 "tokens.gperf"
336 {"ImageFill",FH_IMAGEFILL},
337#line 108 "tokens.gperf"
338 {"Rectangle",FH_RECTANGLE},
339#line 26 "tokens.gperf"
340 {"ClipGroup",FH_CLIPGROUP},
341#line 17 "tokens.gperf"
342 {"BendFilter",FH_BENDFILTER},
343#line 49 "tokens.gperf"
344 {"FWBlurFilter",FH_FWBLURFILTER},
345#line 89 "tokens.gperf"
346 {"Oval",FH_OVAL},
347 {(char*)0, 0},
348#line 86 "tokens.gperf"
349 {"NewContourFill",FH_NEWCONTOURFILL},
350#line 58 "tokens.gperf"
351 {"GraphicStyle",FH_GRAPHICSTYLE},
352#line 11 "tokens.gperf"
353 {"AGDFont",FH_AGDFONT},
354#line 42 "tokens.gperf"
355 {"ElemPropLst",FH_ELEMPROPLST},
356 {(char*)0, 0},
357#line 57 "tokens.gperf"
358 {"GradientMaskFilter",FH_GRADIENTMASKFILTER},
359 {(char*)0, 0},
360#line 107 "tokens.gperf"
361 {"RaggedFilter",FH_RAGGEDFILTER},
362#line 88 "tokens.gperf"
363 {"OpacityFilter",FH_OPACITYFILTER},
364#line 40 "tokens.gperf"
365 {"EPSImport",FH_EPSIMPORT},
366#line 123 "tokens.gperf"
367 {"TextBlok",FH_TEXTBLOK},
368#line 19 "tokens.gperf"
369 {"Block",FH_BLOCK},
370 {(char*)0, 0}, {(char*)0, 0},
371#line 21 "tokens.gperf"
372 {"BrushList",FH_BRUSHLIST},
373 {(char*)0, 0},
374#line 13 "tokens.gperf"
375 {"ArrowPath",FH_ARROWPATH},
376 {(char*)0, 0},
377#line 46 "tokens.gperf"
378 {"Extrusion",FH_EXTRUSION},
379#line 133 "tokens.gperf"
380 {"VMpObj",FH_VMPOBJ},
381 {(char*)0, 0}, {(char*)0, 0},
382#line 115 "tokens.gperf"
383 {"SymbolInstance",FH_SYMBOLINSTANCE},
384#line 118 "tokens.gperf"
385 {"TFOnPath",FH_TFONPATH},
386#line 87 "tokens.gperf"
387 {"NewRadialFill",FH_NEWRADIALFILL},
388 {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
389#line 113 "tokens.gperf"
390 {"SwfImport",FH_SWFIMPORT},
391 {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
392 {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
393 {(char*)0, 0},
394#line 12 "tokens.gperf"
395 {"AGDSelection",FH_AGDSELECTION},
396 {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
397 {(char*)0, 0},
398#line 18 "tokens.gperf"
399 {"BlendObject",FH_BLENDOBJECT},
400 {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
401 {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
402 {(char*)0, 0}, {(char*)0, 0},
403#line 85 "tokens.gperf"
404 {"NewBlend",FH_NEWBLEND}
405 };
406#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3)
407#pragma GCC diagnostic pop
408#endif
409
410const struct fhtoken *
411 Perfect_Hash::in_word_set (const char *str, size_t len)
412{
413 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
414 {
415 unsigned int key = hash (str, len);
416
417 if (key <= MAX_HASH_VALUE)
418 {
419 const char *s = wordlist[key].name;
420
421 if (s && *str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
422 return &wordlist[key];
423 }
424 }
425 return static_cast<struct fhtoken *> (0);
426}
427#line 135 "tokens.gperf"
428