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