OLD | NEW |
1 | 1 |
2 #line 1 "hb-ot-shape-complex-myanmar-machine.rl" | 2 #line 1 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
3 /* | 3 /* |
4 * Copyright © 2011,2012 Google, Inc. | 4 * Copyright © 2011,2012 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 0, 32, 61, 87, 92, 118, 142, 164, | 55 0, 32, 61, 87, 92, 118, 142, 164, |
56 186, 214, 242, 270, 298, 315, 343, 371, | 56 186, 214, 242, 270, 298, 315, 343, 371, |
57 399, 427, 455, 483, 511, 539, 567, 593, | 57 399, 427, 455, 483, 511, 539, 567, 593, |
58 598, 624, 648, 670, 692, 720, 748, 776, | 58 598, 624, 648, 670, 692, 720, 748, 776, |
59 804, 833, 861, 892, 920, 948, 976, 1004, | 59 804, 833, 861, 892, 920, 948, 976, 1004, |
60 1032, 1060, 1088, 1116, 1144 | 60 1032, 1060, 1088, 1116, 1144 |
61 }; | 61 }; |
62 | 62 |
63 static const char _myanmar_syllable_machine_indicies[] = { | 63 static const char _myanmar_syllable_machine_indicies[] = { |
64 1, 1, 2, 3, 4, 4, 0, 5, | 64 1, 1, 2, 3, 4, 4, 0, 5, |
65 » 0, 6, 0, 1, 0, 0, 0, 7, | 65 » 0, 6, 1, 0, 0, 0, 0, 7, |
66 0, 8, 1, 0, 9, 10, 11, 12, | 66 0, 8, 1, 0, 9, 10, 11, 12, |
67 13, 14, 15, 16, 17, 18, 19, 0, | 67 13, 14, 15, 16, 17, 18, 19, 0, |
68 21, 22, 23, 23, 20, 24, 20, 25, | 68 21, 22, 23, 23, 20, 24, 20, 25, |
69 20, 20, 20, 20, 20, 20, 20, 26, | 69 20, 20, 20, 20, 20, 20, 20, 26, |
70 20, 20, 27, 28, 29, 30, 31, 32, | 70 20, 20, 27, 28, 29, 30, 31, 32, |
71 33, 34, 35, 36, 20, 23, 23, 20, | 71 33, 34, 35, 36, 20, 23, 23, 20, |
72 24, 20, 20, 20, 20, 20, 20, 20, | 72 24, 20, 20, 20, 20, 20, 20, 20, |
73 20, 20, 37, 20, 20, 20, 20, 20, | 73 20, 20, 37, 20, 20, 20, 20, 20, |
74 20, 31, 20, 20, 20, 35, 20, 23, | 74 20, 31, 20, 20, 20, 35, 20, 23, |
75 23, 20, 24, 20, 23, 23, 20, 24, | 75 23, 20, 24, 20, 23, 23, 20, 24, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 20, 20, 20, 20, 20, 20, 20, 20, | 112 20, 20, 20, 20, 20, 20, 20, 20, |
113 20, 31, 32, 33, 34, 35, 20, 21, | 113 20, 31, 32, 33, 34, 35, 20, 21, |
114 20, 23, 23, 20, 24, 20, 25, 20, | 114 20, 23, 23, 20, 24, 20, 25, 20, |
115 20, 20, 20, 20, 20, 20, 20, 20, | 115 20, 20, 20, 20, 20, 20, 20, 20, |
116 20, 20, 20, 20, 20, 31, 32, 33, | 116 20, 20, 20, 20, 20, 31, 32, 33, |
117 20, 35, 20, 21, 20, 23, 23, 20, | 117 20, 35, 20, 21, 20, 23, 23, 20, |
118 24, 20, 25, 20, 20, 20, 20, 20, | 118 24, 20, 25, 20, 20, 20, 20, 20, |
119 20, 20, 20, 20, 20, 20, 20, 20, | 119 20, 20, 20, 20, 20, 20, 20, 20, |
120 20, 31, 20, 33, 20, 35, 20, 21, | 120 20, 31, 20, 33, 20, 35, 20, 21, |
121 20, 23, 23, 20, 24, 20, 25, 20, | 121 20, 23, 23, 20, 24, 20, 25, 20, |
122 » 20, 20, 20, 20, 20, 20, 20, 20, | 122 » 20, 20, 20, 20, 20, 20, 34, 20, |
123 20, 27, 20, 29, 20, 31, 32, 33, | 123 20, 27, 20, 29, 20, 31, 32, 33, |
124 34, 35, 20, 21, 20, 23, 23, 20, | 124 34, 35, 20, 21, 20, 23, 23, 20, |
125 24, 20, 25, 20, 20, 20, 20, 20, | 125 24, 20, 25, 20, 20, 20, 20, 20, |
126 20, 20, 34, 20, 20, 27, 20, 20, | 126 20, 20, 34, 20, 20, 27, 20, 20, |
127 20, 31, 32, 33, 34, 35, 20, 21, | 127 20, 31, 32, 33, 34, 35, 20, 21, |
128 20, 23, 23, 20, 24, 20, 25, 20, | 128 20, 23, 23, 20, 24, 20, 25, 20, |
129 » 20, 20, 20, 20, 20, 20, 20, 20, | 129 » 20, 20, 20, 20, 20, 20, 34, 20, |
130 20, 27, 28, 29, 20, 31, 32, 33, | 130 20, 27, 28, 29, 20, 31, 32, 33, |
131 34, 35, 20, 21, 22, 23, 23, 20, | 131 34, 35, 20, 21, 22, 23, 23, 20, |
132 24, 20, 25, 20, 20, 20, 20, 20, | 132 24, 20, 25, 20, 20, 20, 20, 20, |
133 20, 20, 26, 20, 20, 27, 28, 29, | 133 20, 20, 26, 20, 20, 27, 28, 29, |
134 30, 31, 32, 33, 34, 35, 20, 3, | 134 30, 31, 32, 33, 34, 35, 20, 3, |
135 3, 42, 5, 42, 42, 42, 42, 42, | 135 3, 42, 5, 42, 42, 42, 42, 42, |
136 42, 42, 42, 42, 43, 42, 42, 42, | 136 42, 42, 42, 42, 43, 42, 42, 42, |
137 42, 42, 42, 13, 42, 42, 42, 17, | 137 42, 42, 42, 13, 42, 42, 42, 17, |
138 42, 3, 3, 42, 5, 42, 3, 3, | 138 42, 3, 3, 42, 5, 42, 3, 3, |
139 42, 5, 42, 42, 42, 42, 42, 42, | 139 42, 5, 42, 42, 42, 42, 42, 42, |
(...skipping 22 matching lines...) Expand all Loading... |
162 42, 42, 42, 42, 42, 42, 42, 42, | 162 42, 42, 42, 42, 42, 42, 42, 42, |
163 42, 42, 42, 42, 42, 42, 13, 47, | 163 42, 42, 42, 42, 42, 42, 13, 47, |
164 42, 42, 17, 42, 21, 22, 23, 23, | 164 42, 42, 17, 42, 21, 22, 23, 23, |
165 20, 24, 20, 25, 20, 20, 20, 20, | 165 20, 24, 20, 25, 20, 20, 20, 20, |
166 20, 20, 20, 48, 20, 20, 27, 28, | 166 20, 20, 20, 48, 20, 20, 27, 28, |
167 29, 30, 31, 32, 33, 34, 35, 36, | 167 29, 30, 31, 32, 33, 34, 35, 36, |
168 20, 21, 49, 23, 23, 20, 24, 20, | 168 20, 21, 49, 23, 23, 20, 24, 20, |
169 25, 20, 20, 20, 20, 20, 20, 20, | 169 25, 20, 20, 20, 20, 20, 20, 20, |
170 26, 20, 20, 27, 28, 29, 30, 31, | 170 26, 20, 20, 27, 28, 29, 30, 31, |
171 32, 33, 34, 35, 20, 1, 1, 2, | 171 32, 33, 34, 35, 20, 1, 1, 2, |
172 » 3, 3, 3, 42, 5, 42, 6, 42, | 172 » 3, 3, 3, 42, 5, 42, 6, 1, |
173 » 1, 42, 42, 42, 1, 42, 8, 1, | 173 » 42, 42, 42, 42, 1, 42, 8, 1, |
174 42, 9, 10, 11, 12, 13, 14, 15, | 174 42, 9, 10, 11, 12, 13, 14, 15, |
175 16, 17, 18, 42, 2, 42, 3, 3, | 175 16, 17, 18, 42, 2, 42, 3, 3, |
176 42, 5, 42, 6, 42, 42, 42, 42, | 176 42, 5, 42, 6, 42, 42, 42, 42, |
177 42, 42, 42, 8, 42, 42, 9, 10, | 177 42, 42, 42, 8, 42, 42, 9, 10, |
178 11, 12, 13, 14, 15, 16, 17, 42, | 178 11, 12, 13, 14, 15, 16, 17, 42, |
179 2, 42, 3, 3, 42, 5, 42, 6, | 179 2, 42, 3, 3, 42, 5, 42, 6, |
180 42, 42, 42, 42, 42, 42, 42, 16, | 180 42, 42, 42, 42, 42, 42, 42, 16, |
181 42, 42, 42, 42, 42, 42, 13, 14, | 181 42, 42, 42, 42, 42, 42, 13, 14, |
182 15, 16, 17, 42, 2, 42, 3, 3, | 182 15, 16, 17, 42, 2, 42, 3, 3, |
183 42, 5, 42, 6, 42, 42, 42, 42, | 183 42, 5, 42, 6, 42, 42, 42, 42, |
184 42, 42, 42, 42, 42, 42, 42, 42, | 184 42, 42, 42, 42, 42, 42, 42, 42, |
185 42, 42, 13, 14, 15, 16, 17, 42, | 185 42, 42, 13, 14, 15, 16, 17, 42, |
186 2, 42, 3, 3, 42, 5, 42, 6, | 186 2, 42, 3, 3, 42, 5, 42, 6, |
187 42, 42, 42, 42, 42, 42, 42, 42, | 187 42, 42, 42, 42, 42, 42, 42, 42, |
188 42, 42, 42, 42, 42, 42, 13, 14, | 188 42, 42, 42, 42, 42, 42, 13, 14, |
189 15, 42, 17, 42, 2, 42, 3, 3, | 189 15, 42, 17, 42, 2, 42, 3, 3, |
190 42, 5, 42, 6, 42, 42, 42, 42, | 190 42, 5, 42, 6, 42, 42, 42, 42, |
191 42, 42, 42, 42, 42, 42, 42, 42, | 191 42, 42, 42, 42, 42, 42, 42, 42, |
192 42, 42, 13, 42, 15, 42, 17, 42, | 192 42, 42, 13, 42, 15, 42, 17, 42, |
193 2, 42, 3, 3, 42, 5, 42, 6, | 193 2, 42, 3, 3, 42, 5, 42, 6, |
194 » 42, 42, 42, 42, 42, 42, 42, 42, | 194 » 42, 42, 42, 42, 42, 42, 42, 16, |
195 42, 42, 9, 42, 11, 42, 13, 14, | 195 42, 42, 9, 42, 11, 42, 13, 14, |
196 15, 16, 17, 42, 2, 42, 3, 3, | 196 15, 16, 17, 42, 2, 42, 3, 3, |
197 42, 5, 42, 6, 42, 42, 42, 42, | 197 42, 5, 42, 6, 42, 42, 42, 42, |
198 42, 42, 42, 16, 42, 42, 9, 42, | 198 42, 42, 42, 16, 42, 42, 9, 42, |
199 42, 42, 13, 14, 15, 16, 17, 42, | 199 42, 42, 13, 14, 15, 16, 17, 42, |
200 2, 42, 3, 3, 42, 5, 42, 6, | 200 2, 42, 3, 3, 42, 5, 42, 6, |
201 » 42, 42, 42, 42, 42, 42, 42, 42, | 201 » 42, 42, 42, 42, 42, 42, 42, 16, |
202 42, 42, 9, 10, 11, 42, 13, 14, | 202 42, 42, 9, 10, 11, 42, 13, 14, |
203 15, 16, 17, 42, 2, 3, 3, 3, | 203 15, 16, 17, 42, 2, 3, 3, 3, |
204 42, 5, 42, 6, 42, 42, 42, 42, | 204 42, 5, 42, 6, 42, 42, 42, 42, |
205 42, 42, 42, 8, 42, 42, 9, 10, | 205 42, 42, 42, 8, 42, 42, 9, 10, |
206 11, 12, 13, 14, 15, 16, 17, 42, | 206 11, 12, 13, 14, 15, 16, 17, 42, |
207 51, 50, 0 | 207 51, 50, 0 |
208 }; | 208 }; |
209 | 209 |
210 static const char _myanmar_syllable_machine_trans_targs[] = { | 210 static const char _myanmar_syllable_machine_trans_targs[] = { |
211 0, 1, 22, 0, 0, 23, 29, 32, | 211 0, 1, 22, 0, 0, 23, 29, 32, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 43, 43, 43, 43, 51 | 254 43, 43, 43, 43, 51 |
255 }; | 255 }; |
256 | 256 |
257 static const int myanmar_syllable_machine_start = 0; | 257 static const int myanmar_syllable_machine_start = 0; |
258 static const int myanmar_syllable_machine_first_final = 0; | 258 static const int myanmar_syllable_machine_first_final = 0; |
259 static const int myanmar_syllable_machine_error = -1; | 259 static const int myanmar_syllable_machine_error = -1; |
260 | 260 |
261 static const int myanmar_syllable_machine_en_main = 0; | 261 static const int myanmar_syllable_machine_en_main = 0; |
262 | 262 |
263 | 263 |
264 #line 36 "hb-ot-shape-complex-myanmar-machine.rl" | 264 #line 36 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
265 | 265 |
266 | 266 |
267 | 267 |
268 #line 93 "hb-ot-shape-complex-myanmar-machine.rl" | 268 #line 93 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
269 | 269 |
270 | 270 |
271 #define found_syllable(syllable_type) \ | 271 #define found_syllable(syllable_type) \ |
272 HB_STMT_START { \ | 272 HB_STMT_START { \ |
273 if (0) fprintf (stderr, "syllable %d..%d %s\n", last, p+1, #syllable_type);
\ | 273 if (0) fprintf (stderr, "syllable %d..%d %s\n", last, p+1, #syllable_type);
\ |
274 for (unsigned int i = last; i < p+1; i++) \ | 274 for (unsigned int i = last; i < p+1; i++) \ |
275 info[i].syllable() = (syllable_serial << 4) | syllable_type; \ | 275 info[i].syllable() = (syllable_serial << 4) | syllable_type; \ |
276 last = p+1; \ | 276 last = p+1; \ |
277 syllable_serial++; \ | 277 syllable_serial++; \ |
278 if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ | 278 if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ |
279 } HB_STMT_END | 279 } HB_STMT_END |
280 | 280 |
281 static void | 281 static void |
282 find_syllables (hb_buffer_t *buffer) | 282 find_syllables (hb_buffer_t *buffer) |
283 { | 283 { |
284 unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED; | 284 unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED; |
285 int cs; | 285 int cs; |
286 hb_glyph_info_t *info = buffer->info; | 286 hb_glyph_info_t *info = buffer->info; |
287 | 287 |
288 #line 289 "hb-ot-shape-complex-myanmar-machine.hh.tmp" | 288 #line 289 "hb-ot-shape-complex-myanmar-machine.hh.tmp" |
289 { | 289 { |
290 cs = myanmar_syllable_machine_start; | 290 cs = myanmar_syllable_machine_start; |
291 ts = 0; | 291 ts = 0; |
292 te = 0; | 292 te = 0; |
293 act = 0; | 293 act = 0; |
294 } | 294 } |
295 | 295 |
296 #line 114 "hb-ot-shape-complex-myanmar-machine.rl" | 296 #line 114 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
297 | 297 |
298 | 298 |
299 p = 0; | 299 p = 0; |
300 pe = eof = buffer->len; | 300 pe = eof = buffer->len; |
301 | 301 |
302 unsigned int last = 0; | 302 unsigned int last = 0; |
303 unsigned int syllable_serial = 1; | 303 unsigned int syllable_serial = 1; |
304 | 304 |
305 #line 306 "hb-ot-shape-complex-myanmar-machine.hh.tmp" | 305 #line 306 "hb-ot-shape-complex-myanmar-machine.hh.tmp" |
306 { | 306 { |
(...skipping 21 matching lines...) Expand all Loading... |
328 ( info[p].myanmar_category()) - _keys[0] : _slen ]; | 328 ( info[p].myanmar_category()) - _keys[0] : _slen ]; |
329 | 329 |
330 _eof_trans: | 330 _eof_trans: |
331 cs = _myanmar_syllable_machine_trans_targs[_trans]; | 331 cs = _myanmar_syllable_machine_trans_targs[_trans]; |
332 | 332 |
333 if ( _myanmar_syllable_machine_trans_actions[_trans] == 0 ) | 333 if ( _myanmar_syllable_machine_trans_actions[_trans] == 0 ) |
334 goto _again; | 334 goto _again; |
335 | 335 |
336 switch ( _myanmar_syllable_machine_trans_actions[_trans] ) { | 336 switch ( _myanmar_syllable_machine_trans_actions[_trans] ) { |
337 case 7: | 337 case 7: |
338 #line 85 "hb-ot-shape-complex-myanmar-machine.rl" | 338 #line 85 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
339 {te = p+1;{ found_syllable (consonant_syllable); }} | 339 {te = p+1;{ found_syllable (consonant_syllable); }} |
340 break; | 340 break; |
341 case 5: | 341 case 5: |
342 #line 86 "hb-ot-shape-complex-myanmar-machine.rl" | 342 #line 86 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
343 {te = p+1;{ found_syllable (non_myanmar_cluster); }} | 343 {te = p+1;{ found_syllable (non_myanmar_cluster); }} |
344 break; | 344 break; |
345 case 10: | 345 case 10: |
346 #line 87 "hb-ot-shape-complex-myanmar-machine.rl" | 346 #line 87 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
347 {te = p+1;{ found_syllable (punctuation_cluster); }} | 347 {te = p+1;{ found_syllable (punctuation_cluster); }} |
348 break; | 348 break; |
349 case 4: | 349 case 4: |
350 #line 88 "hb-ot-shape-complex-myanmar-machine.rl" | 350 #line 88 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
351 {te = p+1;{ found_syllable (broken_cluster); }} | 351 {te = p+1;{ found_syllable (broken_cluster); }} |
352 break; | 352 break; |
353 case 3: | 353 case 3: |
354 #line 89 "hb-ot-shape-complex-myanmar-machine.rl" | 354 #line 89 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
355 {te = p+1;{ found_syllable (non_myanmar_cluster); }} | 355 {te = p+1;{ found_syllable (non_myanmar_cluster); }} |
356 break; | 356 break; |
357 case 6: | 357 case 6: |
358 #line 85 "hb-ot-shape-complex-myanmar-machine.rl" | 358 #line 85 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
359 {te = p;p--;{ found_syllable (consonant_syllable); }} | 359 {te = p;p--;{ found_syllable (consonant_syllable); }} |
360 break; | 360 break; |
361 case 8: | 361 case 8: |
362 #line 88 "hb-ot-shape-complex-myanmar-machine.rl" | 362 #line 88 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
363 {te = p;p--;{ found_syllable (broken_cluster); }} | 363 {te = p;p--;{ found_syllable (broken_cluster); }} |
364 break; | 364 break; |
365 case 9: | 365 case 9: |
366 #line 89 "hb-ot-shape-complex-myanmar-machine.rl" | 366 #line 89 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
367 {te = p;p--;{ found_syllable (non_myanmar_cluster); }} | 367 {te = p;p--;{ found_syllable (non_myanmar_cluster); }} |
368 break; | 368 break; |
369 #line 370 "hb-ot-shape-complex-myanmar-machine.hh.tmp" | 369 #line 370 "hb-ot-shape-complex-myanmar-machine.hh.tmp" |
370 } | 370 } |
371 | 371 |
372 _again: | 372 _again: |
373 switch ( _myanmar_syllable_machine_to_state_actions[cs] ) { | 373 switch ( _myanmar_syllable_machine_to_state_actions[cs] ) { |
374 case 1: | 374 case 1: |
375 #line 1 "NONE" | 375 #line 1 "NONE" |
376 {ts = 0;} | 376 {ts = 0;} |
377 break; | 377 break; |
378 #line 379 "hb-ot-shape-complex-myanmar-machine.hh.tmp" | 378 #line 379 "hb-ot-shape-complex-myanmar-machine.hh.tmp" |
379 } | 379 } |
380 | 380 |
381 if ( ++p != pe ) | 381 if ( ++p != pe ) |
382 goto _resume; | 382 goto _resume; |
383 _test_eof: {} | 383 _test_eof: {} |
384 if ( p == eof ) | 384 if ( p == eof ) |
385 { | 385 { |
386 if ( _myanmar_syllable_machine_eof_trans[cs] > 0 ) { | 386 if ( _myanmar_syllable_machine_eof_trans[cs] > 0 ) { |
387 _trans = _myanmar_syllable_machine_eof_trans[cs] - 1; | 387 _trans = _myanmar_syllable_machine_eof_trans[cs] - 1; |
388 goto _eof_trans; | 388 goto _eof_trans; |
389 } | 389 } |
390 } | 390 } |
391 | 391 |
392 } | 392 } |
393 | 393 |
394 #line 123 "hb-ot-shape-complex-myanmar-machine.rl" | 394 #line 123 "../../src/hb-ot-shape-complex-myanmar-machine.rl" |
395 | 395 |
396 } | 396 } |
397 | 397 |
398 #undef found_syllable | 398 #undef found_syllable |
399 | 399 |
400 #endif /* HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH */ | 400 #endif /* HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH */ |
OLD | NEW |