1 /* ANSI-C code produced by gperf version 3.0.4 */
2 /* Command-line: gperf -L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k'1,3,$' /home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords */
4 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
5 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
6 && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
7 && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
8 && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
9 && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
10 && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
11 && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
12 && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
13 && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
14 && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
15 && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
16 && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
17 && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
18 && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
19 && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
20 && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
21 && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
22 && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
23 && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
24 && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
25 && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
26 && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
27 /* The character set is not based on ISO-646. */
28 #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
31 #line 1 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
33 struct kwtable {const char *name; int id[2]; enum mrb_lex_state_enum state;};
34 const struct kwtable *mrb_reserved_word(const char *, unsigned int);
35 static const struct kwtable *reserved_word(const char *, unsigned int);
36 #define mrb_reserved_word(str, len) reserved_word(str, len)
37 #line 8 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
40 #define TOTAL_KEYWORDS 40
41 #define MIN_WORD_LENGTH 2
42 #define MAX_WORD_LENGTH 12
43 #define MIN_HASH_VALUE 8
44 #define MAX_HASH_VALUE 50
45 /* maximum key range = 43, duplicates = 0 */
55 hash (const char *str, unsigned int len)
57 static const unsigned char asso_values[] =
59 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
60 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
61 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
62 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
63 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
64 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
65 51, 51, 51, 51, 51, 51, 14, 51, 16, 8,
66 11, 13, 51, 51, 51, 51, 10, 51, 13, 51,
67 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
68 51, 51, 51, 51, 51, 11, 51, 13, 1, 26,
69 4, 1, 8, 28, 51, 23, 51, 1, 1, 27,
70 5, 19, 21, 51, 8, 3, 3, 11, 51, 21,
71 24, 16, 51, 51, 51, 51, 51, 51, 51, 51,
72 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
73 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
74 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
75 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
76 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
77 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
78 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
79 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
80 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
81 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
82 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
83 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
84 51, 51, 51, 51, 51, 51
91 hval += asso_values[(unsigned char)str[2]];
95 hval += asso_values[(unsigned char)str[0]];
98 return hval + asso_values[(unsigned char)str[len - 1]];
103 #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
104 __attribute__ ((__gnu_inline__))
107 const struct kwtable *
108 mrb_reserved_word (const char *str, unsigned int len)
110 static const struct kwtable wordlist[] =
112 {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
113 #line 18 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
114 {"break", {keyword_break, keyword_break}, EXPR_MID},
115 #line 23 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
116 {"else", {keyword_else, keyword_else}, EXPR_BEG},
117 #line 33 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
118 {"nil", {keyword_nil, keyword_nil}, EXPR_END},
119 #line 26 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
120 {"ensure", {keyword_ensure, keyword_ensure}, EXPR_BEG},
121 #line 25 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
122 {"end", {keyword_end, keyword_end}, EXPR_END},
123 #line 42 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
124 {"then", {keyword_then, keyword_then}, EXPR_BEG},
125 #line 34 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
126 {"not", {keyword_not, keyword_not}, EXPR_ARG},
127 #line 27 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
128 {"false", {keyword_false, keyword_false}, EXPR_END},
129 #line 40 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
130 {"self", {keyword_self, keyword_self}, EXPR_END},
131 #line 24 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
132 {"elsif", {keyword_elsif, keyword_elsif}, EXPR_VALUE},
133 #line 37 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
134 {"rescue", {keyword_rescue, modifier_rescue}, EXPR_MID},
135 #line 43 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
136 {"true", {keyword_true, keyword_true}, EXPR_END},
137 #line 46 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
138 {"until", {keyword_until, modifier_until}, EXPR_VALUE},
139 #line 45 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
140 {"unless", {keyword_unless, modifier_unless}, EXPR_VALUE},
141 #line 39 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
142 {"return", {keyword_return, keyword_return}, EXPR_MID},
143 #line 21 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
144 {"def", {keyword_def, keyword_def}, EXPR_FNAME},
145 #line 16 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
146 {"and", {keyword_and, keyword_and}, EXPR_VALUE},
147 #line 22 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
148 {"do", {keyword_do, keyword_do}, EXPR_BEG},
149 #line 49 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
150 {"yield", {keyword_yield, keyword_yield}, EXPR_ARG},
151 #line 28 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
152 {"for", {keyword_for, keyword_for}, EXPR_VALUE},
153 #line 44 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
154 {"undef", {keyword_undef, keyword_undef}, EXPR_FNAME},
155 #line 35 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
156 {"or", {keyword_or, keyword_or}, EXPR_VALUE},
157 #line 30 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
158 {"in", {keyword_in, keyword_in}, EXPR_VALUE},
159 #line 47 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
160 {"when", {keyword_when, keyword_when}, EXPR_VALUE},
161 #line 38 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
162 {"retry", {keyword_retry, keyword_retry}, EXPR_END},
163 #line 29 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
164 {"if", {keyword_if, modifier_if}, EXPR_VALUE},
165 #line 19 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
166 {"case", {keyword_case, keyword_case}, EXPR_VALUE},
167 #line 36 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
168 {"redo", {keyword_redo, keyword_redo}, EXPR_END},
169 #line 32 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
170 {"next", {keyword_next, keyword_next}, EXPR_MID},
171 #line 41 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
172 {"super", {keyword_super, keyword_super}, EXPR_ARG},
173 #line 31 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
174 {"module", {keyword_module, keyword_module}, EXPR_VALUE},
175 #line 17 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
176 {"begin", {keyword_begin, keyword_begin}, EXPR_BEG},
177 #line 12 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
178 {"__LINE__", {keyword__LINE__, keyword__LINE__}, EXPR_END},
179 #line 11 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
180 {"__FILE__", {keyword__FILE__, keyword__FILE__}, EXPR_END},
181 #line 10 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
182 {"__ENCODING__", {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END},
183 #line 14 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
184 {"END", {keyword_END, keyword_END}, EXPR_END},
185 #line 15 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
186 {"alias", {keyword_alias, keyword_alias}, EXPR_FNAME},
187 #line 13 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
188 {"BEGIN", {keyword_BEGIN, keyword_BEGIN}, EXPR_END},
190 #line 20 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
191 {"class", {keyword_class, keyword_class}, EXPR_CLASS},
193 #line 48 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
194 {"while", {keyword_while, modifier_while}, EXPR_VALUE}
197 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
199 int key = hash (str, len);
201 if (key <= MAX_HASH_VALUE && key >= 0)
203 const char *s = wordlist[key].name;
205 if (*str == *s && !strcmp (str + 1, s + 1))
206 return &wordlist[key];
211 #line 50 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"