tokenhash.h
Go to the documentation of this file.
00001 /* C++ code produced by gperf version 3.0.4 */
00002 /* Command-line: /usr/bin/gperf --compare-strncmp -C -m 20 ../../src/lib/tokens.gperf  */
00003 /* Computed positions: -k'1,4-5,8' */
00004 
00005 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
00006       && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
00007       && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
00008       && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
00009       && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
00010       && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
00011       && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
00012       && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
00013       && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
00014       && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
00015       && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
00016       && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
00017       && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
00018       && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
00019       && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
00020       && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
00021       && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
00022       && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
00023       && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
00024       && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
00025       && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
00026       && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
00027       && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
00028 /* The character set is not based on ISO-646.  */
00029 #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
00030 #endif
00031 
00032 #line 5 "../../src/lib/tokens.gperf"
00033 struct fhtoken
00034 {
00035   const char *name;
00036   int tokenId;
00037 };
00038 
00039 #define TOTAL_KEYWORDS 115
00040 #define MIN_WORD_LENGTH 4
00041 #define MAX_WORD_LENGTH 24
00042 #define MIN_HASH_VALUE 8
00043 #define MAX_HASH_VALUE 154
00044 /* maximum key range = 147, duplicates = 0 */
00045 
00046 class Perfect_Hash
00047 {
00048 private:
00049   static inline unsigned int hash (const char *str, unsigned int len);
00050 public:
00051   static const struct fhtoken *in_word_set (const char *str, unsigned int len);
00052 };
00053 
00054 inline unsigned int
00055 Perfect_Hash::hash (register const char *str, register unsigned int len)
00056 {
00057   static const unsigned char asso_values[] =
00058     {
00059       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00060       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00061       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00062       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00063       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00064       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00065       155, 155, 155, 155, 155,  81,  18,   1,  69,  15,
00066         3,  18,  79,  40, 155, 155,   5,   1,  12,  88,
00067        33, 155,  72,  42,   3,   2,  34, 155,  15, 155,
00068       155, 155, 155, 155, 155, 155, 155,   6,   5,   1,
00069        72,   3,   7,  19,  19,   2,   3,  86,  25,  62,
00070        40,  23,  21, 155,   1,   8,   1,  53,   3,  22,
00071       155,   1, 155, 155, 155, 155, 155, 155, 155, 155,
00072       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00073       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00074       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00075       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00076       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00077       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00078       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00079       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00080       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00081       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00082       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00083       155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
00084       155, 155, 155, 155, 155, 155
00085     };
00086   register int hval = len;
00087 
00088   switch (hval)
00089     {
00090       default:
00091         hval += asso_values[(unsigned char)str[7]];
00092       /*FALLTHROUGH*/
00093       case 7:
00094       case 6:
00095       case 5:
00096         hval += asso_values[(unsigned char)str[4]];
00097       /*FALLTHROUGH*/
00098       case 4:
00099         hval += asso_values[(unsigned char)str[3]];
00100       /*FALLTHROUGH*/
00101       case 3:
00102       case 2:
00103       case 1:
00104         hval += asso_values[(unsigned char)str[0]];
00105         break;
00106     }
00107   return hval;
00108 }
00109 
00110 static const struct fhtoken wordlist[] =
00111   {
00112     {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
00113     {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
00114 #line 67 "../../src/lib/tokens.gperf"
00115     {"MDict",FH_MDICT},
00116     {(char*)0, 0},
00117 #line 66 "../../src/lib/tokens.gperf"
00118     {"List",FH_LIST},
00119 #line 71 "../../src/lib/tokens.gperf"
00120     {"MString",FH_MSTRING},
00121 #line 122 "../../src/lib/tokens.gperf"
00122     {"UString",FH_USTRING},
00123 #line 111 "../../src/lib/tokens.gperf"
00124     {"TString",FH_TSTRING},
00125 #line 61 "../../src/lib/tokens.gperf"
00126     {"Layer",FH_LAYER},
00127 #line 68 "../../src/lib/tokens.gperf"
00128     {"MList",FH_MLIST},
00129 #line 70 "../../src/lib/tokens.gperf"
00130     {"MQuickDict",FH_MQUICKDICT},
00131 #line 79 "../../src/lib/tokens.gperf"
00132     {"MultiBlend",FH_MULTIBLEND},
00133 #line 78 "../../src/lib/tokens.gperf"
00134     {"MpObject",FH_MPOBJECT},
00135 #line 31 "../../src/lib/tokens.gperf"
00136     {"ContentFill",FH_CONTENTFILL},
00137 #line 109 "../../src/lib/tokens.gperf"
00138     {"TEffect",FH_TEFFECT},
00139 #line 113 "../../src/lib/tokens.gperf"
00140     {"TaperedFill",FH_TAPEREDFILL},
00141 #line 114 "../../src/lib/tokens.gperf"
00142     {"TaperedFillX",FH_TAPEREDFILLX},
00143 #line 112 "../../src/lib/tokens.gperf"
00144     {"TabTable",FH_TABTABLE},
00145 #line 24 "../../src/lib/tokens.gperf"
00146     {"CharacterFill",FH_CHARACTERFILL},
00147 #line 45 "../../src/lib/tokens.gperf"
00148     {"FWBevelFilter",FH_FWBEVELFILTER},
00149 #line 65 "../../src/lib/tokens.gperf"
00150     {"LinearFill",FH_LINEARFILL},
00151 #line 72 "../../src/lib/tokens.gperf"
00152     {"MasterPageDocMan",FH_MASTERPAGEDOCMAN},
00153 #line 73 "../../src/lib/tokens.gperf"
00154     {"MasterPageElement",FH_MASTERPAGEELEMENT},
00155 #line 53 "../../src/lib/tokens.gperf"
00156     {"FilterAttributeHolder",FH_FILTERATTRIBUTEHOLDER},
00157 #line 47 "../../src/lib/tokens.gperf"
00158     {"FWFeatherFilter",FH_FWFEATHERFILTER},
00159 #line 27 "../../src/lib/tokens.gperf"
00160     {"Color6",FH_COLOR6},
00161 #line 76 "../../src/lib/tokens.gperf"
00162     {"MasterPageSymbolClass",FH_MASTERPAGESYMBOLCLASS},
00163 #line 74 "../../src/lib/tokens.gperf"
00164     {"MasterPageLayerElement",FH_MASTERPAGELAYERELEMENT},
00165 #line 75 "../../src/lib/tokens.gperf"
00166     {"MasterPageLayerInstance",FH_MASTERPAGELAYERINSTANCE},
00167 #line 77 "../../src/lib/tokens.gperf"
00168     {"MasterPageSymbolInstance",FH_MASTERPAGESYMBOLINSTANCE},
00169 #line 33 "../../src/lib/tokens.gperf"
00170     {"CustomProc",FH_CUSTOMPROC},
00171 #line 119 "../../src/lib/tokens.gperf"
00172     {"TintColor",FH_TINTCOLOR},
00173 #line 120 "../../src/lib/tokens.gperf"
00174     {"TintColor6",FH_TINTCOLOR6},
00175 #line 32 "../../src/lib/tokens.gperf"
00176     {"ContourFill",FH_CONTOURFILL},
00177 #line 29 "../../src/lib/tokens.gperf"
00178     {"ConeFill",FH_CONEFILL},
00179 #line 123 "../../src/lib/tokens.gperf"
00180     {"VDict",FH_VDICT},
00181 #line 118 "../../src/lib/tokens.gperf"
00182     {"TileFill",FH_TILEFILL},
00183 #line 80 "../../src/lib/tokens.gperf"
00184     {"MultiColorList",FH_MULTICOLORLIST},
00185 #line 44 "../../src/lib/tokens.gperf"
00186     {"FHDocHeader",FH_FHDOCHEADER},
00187 #line 64 "../../src/lib/tokens.gperf"
00188     {"LineTable",FH_LINETABLE},
00189 #line 50 "../../src/lib/tokens.gperf"
00190     {"FWSharpenFilter",FH_FWSHARPENFILTER},
00191 #line 95 "../../src/lib/tokens.gperf"
00192     {"Procedure",FH_PROCEDURE},
00193 #line 63 "../../src/lib/tokens.gperf"
00194     {"LinePat",FH_LINEPAT},
00195 #line 62 "../../src/lib/tokens.gperf"
00196     {"LensFill",FH_LENSFILL},
00197 #line 19 "../../src/lib/tokens.gperf"
00198     {"Brush",FH_BRUSH},
00199 #line 90 "../../src/lib/tokens.gperf"
00200     {"PatternFill",FH_PATTERNFILL},
00201 #line 23 "../../src/lib/tokens.gperf"
00202     {"CalligraphicStroke",FH_CALLIGRAPHICSTROKE},
00203 #line 91 "../../src/lib/tokens.gperf"
00204     {"PatternLine",FH_PATTERNLINE},
00205 #line 41 "../../src/lib/tokens.gperf"
00206     {"Envelope",FH_ENVELOPE},
00207 #line 15 "../../src/lib/tokens.gperf"
00208     {"BasicFill",FH_BASICFILL},
00209 #line 88 "../../src/lib/tokens.gperf"
00210     {"Path",FH_PATH},
00211 #line 21 "../../src/lib/tokens.gperf"
00212     {"BrushStroke",FH_BRUSHSTROKE},
00213 #line 101 "../../src/lib/tokens.gperf"
00214     {"SketchFilter",FH_SKETCHFILTER},
00215 #line 28 "../../src/lib/tokens.gperf"
00216     {"CompositePath",FH_COMPOSITEPATH},
00217 #line 117 "../../src/lib/tokens.gperf"
00218     {"TextInPath",FH_TEXTINPATH},
00219 #line 26 "../../src/lib/tokens.gperf"
00220     {"Collector",FH_COLLECTOR},
00221 #line 20 "../../src/lib/tokens.gperf"
00222     {"BrushList",FH_BRUSHLIST},
00223 #line 51 "../../src/lib/tokens.gperf"
00224     {"Figure",FH_FIGURE},
00225 #line 49 "../../src/lib/tokens.gperf"
00226     {"FWShadowFilter",FH_FWSHADOWFILTER},
00227 #line 48 "../../src/lib/tokens.gperf"
00228     {"FWGlowFilter",FH_FWGLOWFILTER},
00229 #line 96 "../../src/lib/tokens.gperf"
00230     {"PropLst",FH_PROPLST},
00231 #line 121 "../../src/lib/tokens.gperf"
00232     {"TransformFilter",FH_TRANSFORMFILTER},
00233 #line 116 "../../src/lib/tokens.gperf"
00234     {"TextColumn",FH_TEXTCOLUMN},
00235 #line 94 "../../src/lib/tokens.gperf"
00236     {"PolygonFigure",FH_POLYGONFIGURE},
00237 #line 16 "../../src/lib/tokens.gperf"
00238     {"BasicLine",FH_BASICLINE},
00239 #line 69 "../../src/lib/tokens.gperf"
00240     {"MName",FH_MNAME},
00241 #line 89 "../../src/lib/tokens.gperf"
00242     {"PathTextLineInfo",FH_PATHTEXTLINEINFO},
00243 #line 82 "../../src/lib/tokens.gperf"
00244     {"NewContourFill",FH_NEWCONTOURFILL},
00245 #line 22 "../../src/lib/tokens.gperf"
00246     {"BrushTip",FH_BRUSHTIP},
00247 #line 42 "../../src/lib/tokens.gperf"
00248     {"ExpandFilter",FH_EXPANDFILTER},
00249 #line 102 "../../src/lib/tokens.gperf"
00250     {"SpotColor",FH_SPOTCOLOR},
00251 #line 103 "../../src/lib/tokens.gperf"
00252     {"SpotColor6",FH_SPOTCOLOR6},
00253 #line 93 "../../src/lib/tokens.gperf"
00254     {"PerspectiveGrid",FH_PERSPECTIVEGRID},
00255 #line 34 "../../src/lib/tokens.gperf"
00256     {"Data",FH_DATA},
00257 #line 30 "../../src/lib/tokens.gperf"
00258     {"ConnectorLine",FH_CONNECTORLINE},
00259 #line 86 "../../src/lib/tokens.gperf"
00260     {"PSLine",FH_PSLINE},
00261 #line 92 "../../src/lib/tokens.gperf"
00262     {"PerspectiveEnvelope",FH_PERSPECTIVEENVELOPE},
00263 #line 125 "../../src/lib/tokens.gperf"
00264     {"Xform",FH_XFORM},
00265 #line 37 "../../src/lib/tokens.gperf"
00266     {"DuetFilter",FH_DUETFILTER},
00267 #line 108 "../../src/lib/tokens.gperf"
00268     {"SymbolLibrary",FH_SYMBOLLIBRARY},
00269 #line 36 "../../src/lib/tokens.gperf"
00270     {"DateTime",FH_DATETIME},
00271 #line 40 "../../src/lib/tokens.gperf"
00272     {"Element",FH_ELEMENT},
00273 #line 87 "../../src/lib/tokens.gperf"
00274     {"Paragraph",FH_PARAGRAPH},
00275 #line 35 "../../src/lib/tokens.gperf"
00276     {"DataList",FH_DATALIST},
00277 #line 52 "../../src/lib/tokens.gperf"
00278     {"FileDescriptor",FH_FILEDESCRIPTOR},
00279 #line 38 "../../src/lib/tokens.gperf"
00280     {"ElemList",FH_ELEMLIST},
00281 #line 97 "../../src/lib/tokens.gperf"
00282     {"RadialFill",FH_RADIALFILL},
00283 #line 98 "../../src/lib/tokens.gperf"
00284     {"RadialFillX",FH_RADIALFILLX},
00285 #line 60 "../../src/lib/tokens.gperf"
00286     {"ImageImport",FH_IMAGEIMPORT},
00287 #line 46 "../../src/lib/tokens.gperf"
00288     {"FWBlurFilter",FH_FWBLURFILTER},
00289 #line 59 "../../src/lib/tokens.gperf"
00290     {"ImageFill",FH_IMAGEFILL},
00291 #line 56 "../../src/lib/tokens.gperf"
00292     {"Group",FH_GROUP},
00293 #line 58 "../../src/lib/tokens.gperf"
00294     {"Halftone",FH_HALFTONE},
00295 #line 57 "../../src/lib/tokens.gperf"
00296     {"Guides",FH_GUIDES},
00297 #line 14 "../../src/lib/tokens.gperf"
00298     {"AttributeHolder",FH_ATTRIBUTEHOLDER},
00299 #line 43 "../../src/lib/tokens.gperf"
00300     {"Extrusion",FH_EXTRUSION},
00301 #line 25 "../../src/lib/tokens.gperf"
00302     {"ClipGroup",FH_CLIPGROUP},
00303 #line 110 "../../src/lib/tokens.gperf"
00304     {"TFOnPath",FH_TFONPATH},
00305 #line 17 "../../src/lib/tokens.gperf"
00306     {"BendFilter",FH_BENDFILTER},
00307 #line 104 "../../src/lib/tokens.gperf"
00308     {"StylePropLst",FH_STYLEPROPLST},
00309 #line 106 "../../src/lib/tokens.gperf"
00310     {"SymbolClass",FH_SYMBOLCLASS},
00311 #line 84 "../../src/lib/tokens.gperf"
00312     {"OpacityFilter",FH_OPACITYFILTER},
00313 #line 99 "../../src/lib/tokens.gperf"
00314     {"RaggedFilter",FH_RAGGEDFILTER},
00315 #line 83 "../../src/lib/tokens.gperf"
00316     {"NewRadialFill",FH_NEWRADIALFILL},
00317 #line 18 "../../src/lib/tokens.gperf"
00318     {"Block",FH_BLOCK},
00319 #line 54 "../../src/lib/tokens.gperf"
00320     {"GradientMaskFilter",FH_GRADIENTMASKFILTER},
00321 #line 55 "../../src/lib/tokens.gperf"
00322     {"GraphicStyle",FH_GRAPHICSTYLE},
00323 #line 100 "../../src/lib/tokens.gperf"
00324     {"Rectangle",FH_RECTANGLE},
00325 #line 11 "../../src/lib/tokens.gperf"
00326     {"AGDFont",FH_AGDFONT},
00327     {(char*)0, 0},
00328 #line 115 "../../src/lib/tokens.gperf"
00329     {"TextBlok",FH_TEXTBLOK},
00330 #line 85 "../../src/lib/tokens.gperf"
00331     {"Oval",FH_OVAL},
00332     {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
00333     {(char*)0, 0}, {(char*)0, 0},
00334 #line 107 "../../src/lib/tokens.gperf"
00335     {"SymbolInstance",FH_SYMBOLINSTANCE},
00336     {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
00337     {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
00338 #line 124 "../../src/lib/tokens.gperf"
00339     {"VMpObj",FH_VMPOBJ},
00340     {(char*)0, 0},
00341 #line 81 "../../src/lib/tokens.gperf"
00342     {"NewBlend",FH_NEWBLEND},
00343 #line 13 "../../src/lib/tokens.gperf"
00344     {"ArrowPath",FH_ARROWPATH},
00345     {(char*)0, 0}, {(char*)0, 0},
00346 #line 12 "../../src/lib/tokens.gperf"
00347     {"AGDSelection",FH_AGDSELECTION},
00348     {(char*)0, 0}, {(char*)0, 0},
00349 #line 39 "../../src/lib/tokens.gperf"
00350     {"ElemPropLst",FH_ELEMPROPLST},
00351     {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
00352     {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
00353     {(char*)0, 0}, {(char*)0, 0}, {(char*)0, 0},
00354 #line 105 "../../src/lib/tokens.gperf"
00355     {"SwfImport",FH_SWFIMPORT}
00356   };
00357 
00358 const struct fhtoken *
00359 Perfect_Hash::in_word_set (register const char *str, register unsigned int len)
00360 {
00361   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
00362     {
00363       register int key = hash (str, len);
00364 
00365       if (key <= MAX_HASH_VALUE && key >= 0)
00366         {
00367           register const char *s = wordlist[key].name;
00368 
00369           if (s && *str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
00370             return &wordlist[key];
00371         }
00372     }
00373   return 0;
00374 }
00375 #line 126 "../../src/lib/tokens.gperf"
00376