1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/harfbuzz/src/hb-ot-shape-complex-myanmar-machine.hh Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,400 @@ 1.4 + 1.5 +#line 1 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.6 +/* 1.7 + * Copyright © 2011,2012 Google, Inc. 1.8 + * 1.9 + * This is part of HarfBuzz, a text shaping library. 1.10 + * 1.11 + * Permission is hereby granted, without written agreement and without 1.12 + * license or royalty fees, to use, copy, modify, and distribute this 1.13 + * software and its documentation for any purpose, provided that the 1.14 + * above copyright notice and the following two paragraphs appear in 1.15 + * all copies of this software. 1.16 + * 1.17 + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 1.18 + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 1.19 + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 1.20 + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 1.21 + * DAMAGE. 1.22 + * 1.23 + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 1.24 + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 1.25 + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 1.26 + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 1.27 + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 1.28 + * 1.29 + * Google Author(s): Behdad Esfahbod 1.30 + */ 1.31 + 1.32 +#ifndef HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH 1.33 +#define HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH 1.34 + 1.35 +#include "hb-private.hh" 1.36 + 1.37 + 1.38 +#line 36 "hb-ot-shape-complex-myanmar-machine.hh.tmp" 1.39 +static const unsigned char _myanmar_syllable_machine_trans_keys[] = { 1.40 + 1u, 31u, 3u, 30u, 5u, 29u, 5u, 8u, 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, 1.41 + 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 1u, 16u, 3u, 29u, 3u, 29u, 3u, 29u, 1.42 + 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 5u, 29u, 5u, 8u, 1.43 + 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 1.44 + 3u, 30u, 3u, 29u, 1u, 30u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 1.45 + 3u, 29u, 3u, 29u, 3u, 29u, 3u, 29u, 8u, 8u, 0 1.46 +}; 1.47 + 1.48 +static const char _myanmar_syllable_machine_key_spans[] = { 1.49 + 31, 28, 25, 4, 25, 23, 21, 21, 1.50 + 27, 27, 27, 27, 16, 27, 27, 27, 1.51 + 27, 27, 27, 27, 27, 27, 25, 4, 1.52 + 25, 23, 21, 21, 27, 27, 27, 27, 1.53 + 28, 27, 30, 27, 27, 27, 27, 27, 1.54 + 27, 27, 27, 27, 1 1.55 +}; 1.56 + 1.57 +static const short _myanmar_syllable_machine_index_offsets[] = { 1.58 + 0, 32, 61, 87, 92, 118, 142, 164, 1.59 + 186, 214, 242, 270, 298, 315, 343, 371, 1.60 + 399, 427, 455, 483, 511, 539, 567, 593, 1.61 + 598, 624, 648, 670, 692, 720, 748, 776, 1.62 + 804, 833, 861, 892, 920, 948, 976, 1004, 1.63 + 1032, 1060, 1088, 1116, 1144 1.64 +}; 1.65 + 1.66 +static const char _myanmar_syllable_machine_indicies[] = { 1.67 + 1, 1, 2, 3, 4, 4, 0, 5, 1.68 + 0, 6, 0, 1, 0, 0, 0, 7, 1.69 + 0, 8, 1, 0, 9, 10, 11, 12, 1.70 + 13, 14, 15, 16, 17, 18, 19, 0, 1.71 + 21, 22, 23, 23, 20, 24, 20, 25, 1.72 + 20, 20, 20, 20, 20, 20, 20, 26, 1.73 + 20, 20, 27, 28, 29, 30, 31, 32, 1.74 + 33, 34, 35, 36, 20, 23, 23, 20, 1.75 + 24, 20, 20, 20, 20, 20, 20, 20, 1.76 + 20, 20, 37, 20, 20, 20, 20, 20, 1.77 + 20, 31, 20, 20, 20, 35, 20, 23, 1.78 + 23, 20, 24, 20, 23, 23, 20, 24, 1.79 + 20, 20, 20, 20, 20, 20, 20, 20, 1.80 + 20, 20, 20, 20, 20, 20, 20, 20, 1.81 + 31, 20, 20, 20, 35, 20, 38, 20, 1.82 + 23, 23, 20, 24, 20, 31, 20, 20, 1.83 + 20, 20, 20, 20, 20, 39, 20, 20, 1.84 + 20, 20, 20, 20, 31, 20, 23, 23, 1.85 + 20, 24, 20, 20, 20, 20, 20, 20, 1.86 + 20, 20, 20, 39, 20, 20, 20, 20, 1.87 + 20, 20, 31, 20, 23, 23, 20, 24, 1.88 + 20, 20, 20, 20, 20, 20, 20, 20, 1.89 + 20, 20, 20, 20, 20, 20, 20, 20, 1.90 + 31, 20, 21, 20, 23, 23, 20, 24, 1.91 + 20, 25, 20, 20, 20, 20, 20, 20, 1.92 + 20, 40, 20, 20, 40, 20, 20, 20, 1.93 + 31, 41, 20, 20, 35, 20, 21, 20, 1.94 + 23, 23, 20, 24, 20, 25, 20, 20, 1.95 + 20, 20, 20, 20, 20, 20, 20, 20, 1.96 + 20, 20, 20, 20, 31, 20, 20, 20, 1.97 + 35, 20, 21, 20, 23, 23, 20, 24, 1.98 + 20, 25, 20, 20, 20, 20, 20, 20, 1.99 + 20, 40, 20, 20, 20, 20, 20, 20, 1.100 + 31, 41, 20, 20, 35, 20, 21, 20, 1.101 + 23, 23, 20, 24, 20, 25, 20, 20, 1.102 + 20, 20, 20, 20, 20, 20, 20, 20, 1.103 + 20, 20, 20, 20, 31, 41, 20, 20, 1.104 + 35, 20, 1, 1, 20, 20, 20, 20, 1.105 + 20, 20, 20, 20, 20, 20, 20, 20, 1.106 + 20, 1, 20, 21, 20, 23, 23, 20, 1.107 + 24, 20, 25, 20, 20, 20, 20, 20, 1.108 + 20, 20, 26, 20, 20, 27, 28, 29, 1.109 + 30, 31, 32, 33, 34, 35, 20, 21, 1.110 + 20, 23, 23, 20, 24, 20, 25, 20, 1.111 + 20, 20, 20, 20, 20, 20, 34, 20, 1.112 + 20, 20, 20, 20, 20, 31, 32, 33, 1.113 + 34, 35, 20, 21, 20, 23, 23, 20, 1.114 + 24, 20, 25, 20, 20, 20, 20, 20, 1.115 + 20, 20, 20, 20, 20, 20, 20, 20, 1.116 + 20, 31, 32, 33, 34, 35, 20, 21, 1.117 + 20, 23, 23, 20, 24, 20, 25, 20, 1.118 + 20, 20, 20, 20, 20, 20, 20, 20, 1.119 + 20, 20, 20, 20, 20, 31, 32, 33, 1.120 + 20, 35, 20, 21, 20, 23, 23, 20, 1.121 + 24, 20, 25, 20, 20, 20, 20, 20, 1.122 + 20, 20, 20, 20, 20, 20, 20, 20, 1.123 + 20, 31, 20, 33, 20, 35, 20, 21, 1.124 + 20, 23, 23, 20, 24, 20, 25, 20, 1.125 + 20, 20, 20, 20, 20, 20, 20, 20, 1.126 + 20, 27, 20, 29, 20, 31, 32, 33, 1.127 + 34, 35, 20, 21, 20, 23, 23, 20, 1.128 + 24, 20, 25, 20, 20, 20, 20, 20, 1.129 + 20, 20, 34, 20, 20, 27, 20, 20, 1.130 + 20, 31, 32, 33, 34, 35, 20, 21, 1.131 + 20, 23, 23, 20, 24, 20, 25, 20, 1.132 + 20, 20, 20, 20, 20, 20, 20, 20, 1.133 + 20, 27, 28, 29, 20, 31, 32, 33, 1.134 + 34, 35, 20, 21, 22, 23, 23, 20, 1.135 + 24, 20, 25, 20, 20, 20, 20, 20, 1.136 + 20, 20, 26, 20, 20, 27, 28, 29, 1.137 + 30, 31, 32, 33, 34, 35, 20, 3, 1.138 + 3, 42, 5, 42, 42, 42, 42, 42, 1.139 + 42, 42, 42, 42, 43, 42, 42, 42, 1.140 + 42, 42, 42, 13, 42, 42, 42, 17, 1.141 + 42, 3, 3, 42, 5, 42, 3, 3, 1.142 + 42, 5, 42, 42, 42, 42, 42, 42, 1.143 + 42, 42, 42, 42, 42, 42, 42, 42, 1.144 + 42, 42, 13, 42, 42, 42, 17, 42, 1.145 + 44, 42, 3, 3, 42, 5, 42, 13, 1.146 + 42, 42, 42, 42, 42, 42, 42, 45, 1.147 + 42, 42, 42, 42, 42, 42, 13, 42, 1.148 + 3, 3, 42, 5, 42, 42, 42, 42, 1.149 + 42, 42, 42, 42, 42, 45, 42, 42, 1.150 + 42, 42, 42, 42, 13, 42, 3, 3, 1.151 + 42, 5, 42, 42, 42, 42, 42, 42, 1.152 + 42, 42, 42, 42, 42, 42, 42, 42, 1.153 + 42, 42, 13, 42, 2, 42, 3, 3, 1.154 + 42, 5, 42, 6, 42, 42, 42, 42, 1.155 + 42, 42, 42, 46, 42, 42, 46, 42, 1.156 + 42, 42, 13, 47, 42, 42, 17, 42, 1.157 + 2, 42, 3, 3, 42, 5, 42, 6, 1.158 + 42, 42, 42, 42, 42, 42, 42, 42, 1.159 + 42, 42, 42, 42, 42, 42, 13, 42, 1.160 + 42, 42, 17, 42, 2, 42, 3, 3, 1.161 + 42, 5, 42, 6, 42, 42, 42, 42, 1.162 + 42, 42, 42, 46, 42, 42, 42, 42, 1.163 + 42, 42, 13, 47, 42, 42, 17, 42, 1.164 + 2, 42, 3, 3, 42, 5, 42, 6, 1.165 + 42, 42, 42, 42, 42, 42, 42, 42, 1.166 + 42, 42, 42, 42, 42, 42, 13, 47, 1.167 + 42, 42, 17, 42, 21, 22, 23, 23, 1.168 + 20, 24, 20, 25, 20, 20, 20, 20, 1.169 + 20, 20, 20, 48, 20, 20, 27, 28, 1.170 + 29, 30, 31, 32, 33, 34, 35, 36, 1.171 + 20, 21, 49, 23, 23, 20, 24, 20, 1.172 + 25, 20, 20, 20, 20, 20, 20, 20, 1.173 + 26, 20, 20, 27, 28, 29, 30, 31, 1.174 + 32, 33, 34, 35, 20, 1, 1, 2, 1.175 + 3, 3, 3, 42, 5, 42, 6, 42, 1.176 + 1, 42, 42, 42, 1, 42, 8, 1, 1.177 + 42, 9, 10, 11, 12, 13, 14, 15, 1.178 + 16, 17, 18, 42, 2, 42, 3, 3, 1.179 + 42, 5, 42, 6, 42, 42, 42, 42, 1.180 + 42, 42, 42, 8, 42, 42, 9, 10, 1.181 + 11, 12, 13, 14, 15, 16, 17, 42, 1.182 + 2, 42, 3, 3, 42, 5, 42, 6, 1.183 + 42, 42, 42, 42, 42, 42, 42, 16, 1.184 + 42, 42, 42, 42, 42, 42, 13, 14, 1.185 + 15, 16, 17, 42, 2, 42, 3, 3, 1.186 + 42, 5, 42, 6, 42, 42, 42, 42, 1.187 + 42, 42, 42, 42, 42, 42, 42, 42, 1.188 + 42, 42, 13, 14, 15, 16, 17, 42, 1.189 + 2, 42, 3, 3, 42, 5, 42, 6, 1.190 + 42, 42, 42, 42, 42, 42, 42, 42, 1.191 + 42, 42, 42, 42, 42, 42, 13, 14, 1.192 + 15, 42, 17, 42, 2, 42, 3, 3, 1.193 + 42, 5, 42, 6, 42, 42, 42, 42, 1.194 + 42, 42, 42, 42, 42, 42, 42, 42, 1.195 + 42, 42, 13, 42, 15, 42, 17, 42, 1.196 + 2, 42, 3, 3, 42, 5, 42, 6, 1.197 + 42, 42, 42, 42, 42, 42, 42, 42, 1.198 + 42, 42, 9, 42, 11, 42, 13, 14, 1.199 + 15, 16, 17, 42, 2, 42, 3, 3, 1.200 + 42, 5, 42, 6, 42, 42, 42, 42, 1.201 + 42, 42, 42, 16, 42, 42, 9, 42, 1.202 + 42, 42, 13, 14, 15, 16, 17, 42, 1.203 + 2, 42, 3, 3, 42, 5, 42, 6, 1.204 + 42, 42, 42, 42, 42, 42, 42, 42, 1.205 + 42, 42, 9, 10, 11, 42, 13, 14, 1.206 + 15, 16, 17, 42, 2, 3, 3, 3, 1.207 + 42, 5, 42, 6, 42, 42, 42, 42, 1.208 + 42, 42, 42, 8, 42, 42, 9, 10, 1.209 + 11, 12, 13, 14, 15, 16, 17, 42, 1.210 + 51, 50, 0 1.211 +}; 1.212 + 1.213 +static const char _myanmar_syllable_machine_trans_targs[] = { 1.214 + 0, 1, 22, 0, 0, 23, 29, 32, 1.215 + 35, 36, 40, 41, 42, 25, 38, 39, 1.216 + 37, 28, 43, 44, 0, 2, 12, 0, 1.217 + 3, 9, 13, 14, 18, 19, 20, 5, 1.218 + 16, 17, 15, 8, 21, 4, 6, 7, 1.219 + 10, 11, 0, 24, 26, 27, 30, 31, 1.220 + 33, 34, 0, 0 1.221 +}; 1.222 + 1.223 +static const char _myanmar_syllable_machine_trans_actions[] = { 1.224 + 3, 0, 0, 4, 5, 0, 0, 0, 1.225 + 0, 0, 0, 0, 0, 0, 0, 0, 1.226 + 0, 0, 0, 0, 6, 0, 0, 7, 1.227 + 0, 0, 0, 0, 0, 0, 0, 0, 1.228 + 0, 0, 0, 0, 0, 0, 0, 0, 1.229 + 0, 0, 8, 0, 0, 0, 0, 0, 1.230 + 0, 0, 9, 10 1.231 +}; 1.232 + 1.233 +static const char _myanmar_syllable_machine_to_state_actions[] = { 1.234 + 1, 0, 0, 0, 0, 0, 0, 0, 1.235 + 0, 0, 0, 0, 0, 0, 0, 0, 1.236 + 0, 0, 0, 0, 0, 0, 0, 0, 1.237 + 0, 0, 0, 0, 0, 0, 0, 0, 1.238 + 0, 0, 0, 0, 0, 0, 0, 0, 1.239 + 0, 0, 0, 0, 0 1.240 +}; 1.241 + 1.242 +static const char _myanmar_syllable_machine_from_state_actions[] = { 1.243 + 2, 0, 0, 0, 0, 0, 0, 0, 1.244 + 0, 0, 0, 0, 0, 0, 0, 0, 1.245 + 0, 0, 0, 0, 0, 0, 0, 0, 1.246 + 0, 0, 0, 0, 0, 0, 0, 0, 1.247 + 0, 0, 0, 0, 0, 0, 0, 0, 1.248 + 0, 0, 0, 0, 0 1.249 +}; 1.250 + 1.251 +static const short _myanmar_syllable_machine_eof_trans[] = { 1.252 + 0, 21, 21, 21, 21, 21, 21, 21, 1.253 + 21, 21, 21, 21, 21, 21, 21, 21, 1.254 + 21, 21, 21, 21, 21, 21, 43, 43, 1.255 + 43, 43, 43, 43, 43, 43, 43, 43, 1.256 + 21, 21, 43, 43, 43, 43, 43, 43, 1.257 + 43, 43, 43, 43, 51 1.258 +}; 1.259 + 1.260 +static const int myanmar_syllable_machine_start = 0; 1.261 +static const int myanmar_syllable_machine_first_final = 0; 1.262 +static const int myanmar_syllable_machine_error = -1; 1.263 + 1.264 +static const int myanmar_syllable_machine_en_main = 0; 1.265 + 1.266 + 1.267 +#line 36 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.268 + 1.269 + 1.270 + 1.271 +#line 93 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.272 + 1.273 + 1.274 +#define found_syllable(syllable_type) \ 1.275 + HB_STMT_START { \ 1.276 + if (0) fprintf (stderr, "syllable %d..%d %s\n", last, p+1, #syllable_type); \ 1.277 + for (unsigned int i = last; i < p+1; i++) \ 1.278 + info[i].syllable() = (syllable_serial << 4) | syllable_type; \ 1.279 + last = p+1; \ 1.280 + syllable_serial++; \ 1.281 + if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ 1.282 + } HB_STMT_END 1.283 + 1.284 +static void 1.285 +find_syllables (hb_buffer_t *buffer) 1.286 +{ 1.287 + unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED; 1.288 + int cs; 1.289 + hb_glyph_info_t *info = buffer->info; 1.290 + 1.291 +#line 289 "hb-ot-shape-complex-myanmar-machine.hh.tmp" 1.292 + { 1.293 + cs = myanmar_syllable_machine_start; 1.294 + ts = 0; 1.295 + te = 0; 1.296 + act = 0; 1.297 + } 1.298 + 1.299 +#line 114 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.300 + 1.301 + 1.302 + p = 0; 1.303 + pe = eof = buffer->len; 1.304 + 1.305 + unsigned int last = 0; 1.306 + unsigned int syllable_serial = 1; 1.307 + 1.308 +#line 306 "hb-ot-shape-complex-myanmar-machine.hh.tmp" 1.309 + { 1.310 + int _slen; 1.311 + int _trans; 1.312 + const unsigned char *_keys; 1.313 + const char *_inds; 1.314 + if ( p == pe ) 1.315 + goto _test_eof; 1.316 +_resume: 1.317 + switch ( _myanmar_syllable_machine_from_state_actions[cs] ) { 1.318 + case 2: 1.319 +#line 1 "NONE" 1.320 + {ts = p;} 1.321 + break; 1.322 +#line 320 "hb-ot-shape-complex-myanmar-machine.hh.tmp" 1.323 + } 1.324 + 1.325 + _keys = _myanmar_syllable_machine_trans_keys + (cs<<1); 1.326 + _inds = _myanmar_syllable_machine_indicies + _myanmar_syllable_machine_index_offsets[cs]; 1.327 + 1.328 + _slen = _myanmar_syllable_machine_key_spans[cs]; 1.329 + _trans = _inds[ _slen > 0 && _keys[0] <=( info[p].myanmar_category()) && 1.330 + ( info[p].myanmar_category()) <= _keys[1] ? 1.331 + ( info[p].myanmar_category()) - _keys[0] : _slen ]; 1.332 + 1.333 +_eof_trans: 1.334 + cs = _myanmar_syllable_machine_trans_targs[_trans]; 1.335 + 1.336 + if ( _myanmar_syllable_machine_trans_actions[_trans] == 0 ) 1.337 + goto _again; 1.338 + 1.339 + switch ( _myanmar_syllable_machine_trans_actions[_trans] ) { 1.340 + case 7: 1.341 +#line 85 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.342 + {te = p+1;{ found_syllable (consonant_syllable); }} 1.343 + break; 1.344 + case 5: 1.345 +#line 86 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.346 + {te = p+1;{ found_syllable (non_myanmar_cluster); }} 1.347 + break; 1.348 + case 10: 1.349 +#line 87 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.350 + {te = p+1;{ found_syllable (punctuation_cluster); }} 1.351 + break; 1.352 + case 4: 1.353 +#line 88 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.354 + {te = p+1;{ found_syllable (broken_cluster); }} 1.355 + break; 1.356 + case 3: 1.357 +#line 89 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.358 + {te = p+1;{ found_syllable (non_myanmar_cluster); }} 1.359 + break; 1.360 + case 6: 1.361 +#line 85 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.362 + {te = p;p--;{ found_syllable (consonant_syllable); }} 1.363 + break; 1.364 + case 8: 1.365 +#line 88 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.366 + {te = p;p--;{ found_syllable (broken_cluster); }} 1.367 + break; 1.368 + case 9: 1.369 +#line 89 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.370 + {te = p;p--;{ found_syllable (non_myanmar_cluster); }} 1.371 + break; 1.372 +#line 370 "hb-ot-shape-complex-myanmar-machine.hh.tmp" 1.373 + } 1.374 + 1.375 +_again: 1.376 + switch ( _myanmar_syllable_machine_to_state_actions[cs] ) { 1.377 + case 1: 1.378 +#line 1 "NONE" 1.379 + {ts = 0;} 1.380 + break; 1.381 +#line 379 "hb-ot-shape-complex-myanmar-machine.hh.tmp" 1.382 + } 1.383 + 1.384 + if ( ++p != pe ) 1.385 + goto _resume; 1.386 + _test_eof: {} 1.387 + if ( p == eof ) 1.388 + { 1.389 + if ( _myanmar_syllable_machine_eof_trans[cs] > 0 ) { 1.390 + _trans = _myanmar_syllable_machine_eof_trans[cs] - 1; 1.391 + goto _eof_trans; 1.392 + } 1.393 + } 1.394 + 1.395 + } 1.396 + 1.397 +#line 123 "../../src/hb-ot-shape-complex-myanmar-machine.rl" 1.398 + 1.399 +} 1.400 + 1.401 +#undef found_syllable 1.402 + 1.403 +#endif /* HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH */