OLD | NEW |
1 | 1 |
2 #line 1 "hb-ot-shape-complex-sea-machine.rl" | 2 #line 1 "../../src/hb-ot-shape-complex-sea-machine.rl" |
3 /* | 3 /* |
4 * Copyright © 2011,2012,2013 Google, Inc. | 4 * Copyright © 2011,2012,2013 Google, Inc. |
5 * | 5 * |
6 * This is part of HarfBuzz, a text shaping library. | 6 * This is part of HarfBuzz, a text shaping library. |
7 * | 7 * |
8 * Permission is hereby granted, without written agreement and without | 8 * Permission is hereby granted, without written agreement and without |
9 * license or royalty fees, to use, copy, modify, and distribute this | 9 * license or royalty fees, to use, copy, modify, and distribute this |
10 * software and its documentation for any purpose, provided that the | 10 * software and its documentation for any purpose, provided that the |
11 * above copyright notice and the following two paragraphs appear in | 11 * above copyright notice and the following two paragraphs appear in |
12 * all copies of this software. | 12 * all copies of this software. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 1, 3, 0, 7, 9, 11 | 82 1, 3, 0, 7, 9, 11 |
83 }; | 83 }; |
84 | 84 |
85 static const int sea_syllable_machine_start = 2; | 85 static const int sea_syllable_machine_start = 2; |
86 static const int sea_syllable_machine_first_final = 2; | 86 static const int sea_syllable_machine_first_final = 2; |
87 static const int sea_syllable_machine_error = -1; | 87 static const int sea_syllable_machine_error = -1; |
88 | 88 |
89 static const int sea_syllable_machine_en_main = 2; | 89 static const int sea_syllable_machine_en_main = 2; |
90 | 90 |
91 | 91 |
92 #line 36 "hb-ot-shape-complex-sea-machine.rl" | 92 #line 36 "../../src/hb-ot-shape-complex-sea-machine.rl" |
93 | 93 |
94 | 94 |
95 | 95 |
96 #line 67 "hb-ot-shape-complex-sea-machine.rl" | 96 #line 67 "../../src/hb-ot-shape-complex-sea-machine.rl" |
97 | 97 |
98 | 98 |
99 #define found_syllable(syllable_type) \ | 99 #define found_syllable(syllable_type) \ |
100 HB_STMT_START { \ | 100 HB_STMT_START { \ |
101 if (0) fprintf (stderr, "syllable %d..%d %s\n", last, p+1, #syllable_type);
\ | 101 if (0) fprintf (stderr, "syllable %d..%d %s\n", last, p+1, #syllable_type);
\ |
102 for (unsigned int i = last; i < p+1; i++) \ | 102 for (unsigned int i = last; i < p+1; i++) \ |
103 info[i].syllable() = (syllable_serial << 4) | syllable_type; \ | 103 info[i].syllable() = (syllable_serial << 4) | syllable_type; \ |
104 last = p+1; \ | 104 last = p+1; \ |
105 syllable_serial++; \ | 105 syllable_serial++; \ |
106 if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ | 106 if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ |
107 } HB_STMT_END | 107 } HB_STMT_END |
108 | 108 |
109 static void | 109 static void |
110 find_syllables (hb_buffer_t *buffer) | 110 find_syllables (hb_buffer_t *buffer) |
111 { | 111 { |
112 unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED; | 112 unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED; |
113 int cs; | 113 int cs; |
114 hb_glyph_info_t *info = buffer->info; | 114 hb_glyph_info_t *info = buffer->info; |
115 | 115 |
116 #line 117 "hb-ot-shape-complex-sea-machine.hh.tmp" | 116 #line 117 "hb-ot-shape-complex-sea-machine.hh.tmp" |
117 { | 117 { |
118 cs = sea_syllable_machine_start; | 118 cs = sea_syllable_machine_start; |
119 ts = 0; | 119 ts = 0; |
120 te = 0; | 120 te = 0; |
121 act = 0; | 121 act = 0; |
122 } | 122 } |
123 | 123 |
124 #line 88 "hb-ot-shape-complex-sea-machine.rl" | 124 #line 88 "../../src/hb-ot-shape-complex-sea-machine.rl" |
125 | 125 |
126 | 126 |
127 p = 0; | 127 p = 0; |
128 pe = eof = buffer->len; | 128 pe = eof = buffer->len; |
129 | 129 |
130 unsigned int last = 0; | 130 unsigned int last = 0; |
131 unsigned int syllable_serial = 1; | 131 unsigned int syllable_serial = 1; |
132 | 132 |
133 #line 134 "hb-ot-shape-complex-sea-machine.hh.tmp" | 133 #line 134 "hb-ot-shape-complex-sea-machine.hh.tmp" |
134 { | 134 { |
(...skipping 25 matching lines...) Expand all Loading... |
160 | 160 |
161 if ( _sea_syllable_machine_trans_actions[_trans] == 0 ) | 161 if ( _sea_syllable_machine_trans_actions[_trans] == 0 ) |
162 goto _again; | 162 goto _again; |
163 | 163 |
164 switch ( _sea_syllable_machine_trans_actions[_trans] ) { | 164 switch ( _sea_syllable_machine_trans_actions[_trans] ) { |
165 case 2: | 165 case 2: |
166 #line 1 "NONE" | 166 #line 1 "NONE" |
167 {te = p+1;} | 167 {te = p+1;} |
168 break; | 168 break; |
169 case 6: | 169 case 6: |
170 #line 63 "hb-ot-shape-complex-sea-machine.rl" | 170 #line 63 "../../src/hb-ot-shape-complex-sea-machine.rl" |
171 {te = p+1;{ found_syllable (non_sea_cluster); }} | 171 {te = p+1;{ found_syllable (non_sea_cluster); }} |
172 break; | 172 break; |
173 case 7: | 173 case 7: |
174 #line 61 "hb-ot-shape-complex-sea-machine.rl" | 174 #line 61 "../../src/hb-ot-shape-complex-sea-machine.rl" |
175 {te = p;p--;{ found_syllable (consonant_syllable); }} | 175 {te = p;p--;{ found_syllable (consonant_syllable); }} |
176 break; | 176 break; |
177 case 8: | 177 case 8: |
178 #line 62 "hb-ot-shape-complex-sea-machine.rl" | 178 #line 62 "../../src/hb-ot-shape-complex-sea-machine.rl" |
179 {te = p;p--;{ found_syllable (broken_cluster); }} | 179 {te = p;p--;{ found_syllable (broken_cluster); }} |
180 break; | 180 break; |
181 case 9: | 181 case 9: |
182 #line 63 "hb-ot-shape-complex-sea-machine.rl" | 182 #line 63 "../../src/hb-ot-shape-complex-sea-machine.rl" |
183 {te = p;p--;{ found_syllable (non_sea_cluster); }} | 183 {te = p;p--;{ found_syllable (non_sea_cluster); }} |
184 break; | 184 break; |
185 case 1: | 185 case 1: |
186 #line 61 "hb-ot-shape-complex-sea-machine.rl" | 186 #line 61 "../../src/hb-ot-shape-complex-sea-machine.rl" |
187 {{p = ((te))-1;}{ found_syllable (consonant_syllable); }} | 187 {{p = ((te))-1;}{ found_syllable (consonant_syllable); }} |
188 break; | 188 break; |
189 case 3: | 189 case 3: |
190 #line 62 "hb-ot-shape-complex-sea-machine.rl" | 190 #line 62 "../../src/hb-ot-shape-complex-sea-machine.rl" |
191 {{p = ((te))-1;}{ found_syllable (broken_cluster); }} | 191 {{p = ((te))-1;}{ found_syllable (broken_cluster); }} |
192 break; | 192 break; |
193 #line 194 "hb-ot-shape-complex-sea-machine.hh.tmp" | 193 #line 194 "hb-ot-shape-complex-sea-machine.hh.tmp" |
194 } | 194 } |
195 | 195 |
196 _again: | 196 _again: |
197 switch ( _sea_syllable_machine_to_state_actions[cs] ) { | 197 switch ( _sea_syllable_machine_to_state_actions[cs] ) { |
198 case 4: | 198 case 4: |
199 #line 1 "NONE" | 199 #line 1 "NONE" |
200 {ts = 0;} | 200 {ts = 0;} |
201 break; | 201 break; |
202 #line 203 "hb-ot-shape-complex-sea-machine.hh.tmp" | 202 #line 203 "hb-ot-shape-complex-sea-machine.hh.tmp" |
203 } | 203 } |
204 | 204 |
205 if ( ++p != pe ) | 205 if ( ++p != pe ) |
206 goto _resume; | 206 goto _resume; |
207 _test_eof: {} | 207 _test_eof: {} |
208 if ( p == eof ) | 208 if ( p == eof ) |
209 { | 209 { |
210 if ( _sea_syllable_machine_eof_trans[cs] > 0 ) { | 210 if ( _sea_syllable_machine_eof_trans[cs] > 0 ) { |
211 _trans = _sea_syllable_machine_eof_trans[cs] - 1; | 211 _trans = _sea_syllable_machine_eof_trans[cs] - 1; |
212 goto _eof_trans; | 212 goto _eof_trans; |
213 } | 213 } |
214 } | 214 } |
215 | 215 |
216 } | 216 } |
217 | 217 |
218 #line 97 "hb-ot-shape-complex-sea-machine.rl" | 218 #line 97 "../../src/hb-ot-shape-complex-sea-machine.rl" |
219 | 219 |
220 } | 220 } |
221 | 221 |
222 #undef found_syllable | 222 #undef found_syllable |
223 | 223 |
224 #endif /* HB_OT_SHAPE_COMPLEX_SEA_MACHINE_HH */ | 224 #endif /* HB_OT_SHAPE_COMPLEX_SEA_MACHINE_HH */ |
OLD | NEW |