00001
00002
00003
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
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 1 "octave.gperf"
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 enum octave_kw_id
00060 {
00061 break_kw,
00062 case_kw,
00063 catch_kw,
00064 classdef_kw,
00065 continue_kw,
00066 do_kw,
00067 else_kw,
00068 elseif_kw,
00069 end_kw,
00070 end_try_catch_kw,
00071 end_unwind_protect_kw,
00072 endclassdef_kw,
00073 endevents_kw,
00074 endfor_kw,
00075 endfunction_kw,
00076 endif_kw,
00077 endmethods_kw,
00078 endproperties_kw,
00079 endswitch_kw,
00080 endwhile_kw,
00081 events_kw,
00082 for_kw,
00083 function_kw,
00084 get_kw,
00085 global_kw,
00086 if_kw,
00087 magic_file_kw,
00088 magic_line_kw,
00089 methods_kw,
00090 otherwise_kw,
00091 properties_kw,
00092 return_kw,
00093 set_kw,
00094 static_kw,
00095 switch_kw,
00096 try_kw,
00097 until_kw,
00098 unwind_protect_kw,
00099 unwind_protect_cleanup_kw,
00100 while_kw
00101 };
00102 #line 71 "octave.gperf"
00103 struct octave_kw { const char *name; int tok; octave_kw_id kw_id; };
00104
00105 #define TOTAL_KEYWORDS 41
00106 #define MIN_WORD_LENGTH 2
00107 #define MAX_WORD_LENGTH 22
00108 #define MIN_HASH_VALUE 2
00109 #define MAX_HASH_VALUE 68
00110
00111
00112 class octave_kw_hash
00113 {
00114 private:
00115 static inline unsigned int hash (const char *str, unsigned int len);
00116 public:
00117 static const struct octave_kw *in_word_set (const char *str, unsigned int len);
00118 };
00119
00120 inline unsigned int
00121 octave_kw_hash::hash (register const char *str, register unsigned int len)
00122 {
00123 static const unsigned char asso_values[] =
00124 {
00125 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00126 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00127 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00128 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00129 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00130 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00131 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00132 69, 69, 69, 69, 69, 69, 35, 69, 30, 69,
00133 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00134 69, 69, 69, 69, 69, 25, 69, 0, 15, 10,
00135 0, 0, 15, 55, 0, 5, 69, 15, 5, 5,
00136 0, 0, 15, 69, 25, 10, 30, 30, 10, 0,
00137 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00138 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00139 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00140 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00141 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00142 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00143 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00144 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00145 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00146 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00147 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00148 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00149 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
00150 69, 69, 69, 69, 69, 69
00151 };
00152 register int hval = len;
00153
00154 switch (hval)
00155 {
00156 default:
00157 hval += asso_values[(unsigned char)str[4]];
00158
00159 case 4:
00160 case 3:
00161 case 2:
00162 case 1:
00163 hval += asso_values[(unsigned char)str[0]];
00164 break;
00165 }
00166 return hval;
00167 }
00168
00169 static const struct octave_kw wordlist[] =
00170 {
00171 #line 78 "octave.gperf"
00172 {"do", DO, do_kw},
00173 #line 81 "octave.gperf"
00174 {"end", END, end_kw},
00175 #line 79 "octave.gperf"
00176 {"else", ELSE, else_kw},
00177 #line 111 "octave.gperf"
00178 {"while", WHILE, while_kw},
00179 #line 86 "octave.gperf"
00180 {"endfor", END, endfor_kw},
00181 #line 98 "octave.gperf"
00182 {"if", IF, if_kw},
00183 #line 92 "octave.gperf"
00184 {"endwhile", END, endwhile_kw},
00185 #line 91 "octave.gperf"
00186 {"endswitch", END, endswitch_kw},
00187 #line 89 "octave.gperf"
00188 {"endmethods", END, endmethods_kw},
00189 #line 80 "octave.gperf"
00190 {"elseif", ELSEIF, elseif_kw},
00191 #line 99 "octave.gperf"
00192 {"methods", METHODS, methods_kw},
00193 #line 104 "octave.gperf"
00194 {"set", SET, set_kw},
00195 #line 74 "octave.gperf"
00196 {"case", CASE, case_kw},
00197 #line 75 "octave.gperf"
00198 {"catch", CATCH, catch_kw},
00199 #line 84 "octave.gperf"
00200 {"endclassdef", END, endclassdef_kw },
00201 #line 94 "octave.gperf"
00202 {"for", FOR, for_kw},
00203 #line 85 "octave.gperf"
00204 {"endevents", END, endevents_kw},
00205 #line 88 "octave.gperf"
00206 {"endif", END, endif_kw},
00207 #line 105 "octave.gperf"
00208 {"static", STATIC, static_kw},
00209 #line 77 "octave.gperf"
00210 {"continue", CONTINUE, continue_kw},
00211 #line 102 "octave.gperf"
00212 {"properties", PROPERTIES, properties_kw},
00213 #line 106 "octave.gperf"
00214 {"switch", SWITCH, switch_kw},
00215 #line 76 "octave.gperf"
00216 {"classdef", CLASSDEF, classdef_kw},
00217 #line 101 "octave.gperf"
00218 {"persistent", STATIC, static_kw},
00219 #line 107 "octave.gperf"
00220 {"try", TRY, try_kw},
00221 #line 100 "octave.gperf"
00222 {"otherwise", OTHERWISE, otherwise_kw},
00223 #line 73 "octave.gperf"
00224 {"break", BREAK, break_kw},
00225 #line 93 "octave.gperf"
00226 {"events", EVENTS, events_kw},
00227 #line 90 "octave.gperf"
00228 {"endproperties", END, endproperties_kw},
00229 #line 108 "octave.gperf"
00230 {"until", UNTIL, until_kw},
00231 #line 87 "octave.gperf"
00232 {"endfunction", END, endfunction_kw},
00233 #line 82 "octave.gperf"
00234 {"end_try_catch", END, end_try_catch_kw},
00235 #line 109 "octave.gperf"
00236 {"unwind_protect", UNWIND, unwind_protect_kw},
00237 #line 83 "octave.gperf"
00238 {"end_unwind_protect", END, end_unwind_protect_kw},
00239 #line 110 "octave.gperf"
00240 {"unwind_protect_cleanup", CLEANUP, unwind_protect_cleanup_kw},
00241 #line 95 "octave.gperf"
00242 {"function", FCN, function_kw},
00243 #line 103 "octave.gperf"
00244 {"return", FUNC_RET, return_kw},
00245 #line 96 "octave.gperf"
00246 {"get", GET, get_kw},
00247 #line 97 "octave.gperf"
00248 {"global", GLOBAL, global_kw},
00249 #line 113 "octave.gperf"
00250 {"__LINE__", NUM, magic_line_kw},
00251 #line 112 "octave.gperf"
00252 {"__FILE__", DQ_STRING, magic_file_kw}
00253 };
00254
00255 static const signed char gperf_lookup[] =
00256 {
00257 -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
00258 12, 13, 14, -1, 15, 16, 17, 18, -1, 19, -1, 20, 21, -1,
00259 22, -1, 23, -1, -1, 24, 25, 26, 27, -1, 28, -1, 29, 30,
00260 -1, 31, 32, -1, -1, -1, 33, -1, -1, -1, 34, 35, -1, -1,
00261 36, -1, 37, -1, -1, 38, -1, 39, -1, -1, -1, -1, 40
00262 };
00263
00264 const struct octave_kw *
00265 octave_kw_hash::in_word_set (register const char *str, register unsigned int len)
00266 {
00267 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
00268 {
00269 register int key = hash (str, len);
00270
00271 if (key <= MAX_HASH_VALUE && key >= 0)
00272 {
00273 register int index = gperf_lookup[key];
00274
00275 if (index >= 0)
00276 {
00277 register const char *s = wordlist[index].name;
00278
00279 if (*str == *s && !strcmp (str + 1, s + 1))
00280 return &wordlist[index];
00281 }
00282 }
00283 }
00284 return 0;
00285 }