tokenhash.h Source File documentation

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