1 module bio.std.maf.parser; 2 #line 1 "maf_block.rl" 3 /* 4 This file is part of BioD. 5 Copyright (C) 2013 Artem Tarasov <lomereiter@gmail.com> 6 7 Permission is hereby granted, free of charge, to any person obtaining a 8 copy of this software and associated documentation files (the "Software"), 9 to deal in the Software without restriction, including without limitation 10 the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 and/or sell copies of the Software, and to permit persons to whom the 12 Software is furnished to do so, subject to the following conditions: 13 14 The above copyright notice and this permission notice shall be included in 15 all copies or substantial portions of the Software. 16 17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 DEALINGS IN THE SOFTWARE. 24 25 */ 26 import std.conv; 27 import std.array; 28 import bio.std.maf.block; 29 30 31 #line 27 "maf_block.d" 32 static byte[] _maf_block_actions = [ 33 0, 1, 1, 1, 2, 1, 5, 1, 34 6, 1, 7, 1, 8, 1, 9, 1, 35 10, 1, 11, 1, 12, 1, 14, 1, 36 16, 1, 17, 1, 18, 1, 19, 1, 37 20, 1, 21, 1, 22, 2, 0, 1, 38 2, 3, 4, 2, 7, 13, 2, 15, 39 12 40 ]; 41 42 static short[] _maf_block_key_offsets = [ 43 0, 0, 1, 5, 11, 20, 23, 26, 44 29, 34, 39, 44, 49, 54, 57, 62, 45 67, 74, 77, 80, 83, 92, 95, 100, 46 105, 114, 117, 122, 127, 132, 137, 142, 47 147, 152, 157, 162, 167, 172, 177, 182, 48 187, 192, 197, 202, 205, 208, 211, 214, 49 221, 224, 227, 230, 235, 240, 245, 250, 50 255, 258, 263, 268, 271, 276, 281, 286, 51 291, 296, 301, 306, 311, 316, 321, 326, 52 331, 336, 341, 346, 351, 354, 359, 364, 53 369, 374, 379, 384, 389, 394, 399, 404, 54 409, 414, 419, 424, 429, 434, 437, 442, 55 447, 452, 457, 462, 467, 472, 477, 482, 56 487, 492, 497, 502, 507, 512, 517, 520, 57 525, 530, 535, 540, 545, 550, 555, 560, 58 565, 570, 575, 580, 585, 590, 595, 600, 59 603, 608, 613, 618, 623, 628, 633, 638, 60 643, 648, 653, 658, 663, 668, 673, 678, 61 683, 686, 691, 696, 701, 706, 711, 716, 62 721, 726, 731, 736, 741, 746, 751, 756, 63 761, 766, 769, 770, 771, 772, 773, 775, 64 781, 787, 793, 799, 805, 811, 817, 823, 65 829, 835, 841, 847, 853, 859, 865, 871, 66 877, 881, 885, 886, 887, 888, 889, 896, 67 900, 902, 910, 914, 916, 922, 931, 932, 68 933, 937, 938, 939, 940, 944, 948, 956, 69 962, 968, 974, 980, 986, 992, 998, 1004, 70 1010, 1016, 1022, 1028, 1034, 1040, 1046, 1052, 71 1058, 1062, 1070 72 ]; 73 74 static char[] _maf_block_trans_keys = [ 75 97u, 10u, 32u, 9u, 13u, 10u, 32u, 112u, 76 115u, 9u, 13u, 10u, 32u, 101u, 105u, 112u, 77 113u, 115u, 9u, 13u, 32u, 9u, 13u, 32u, 78 9u, 13u, 32u, 9u, 13u, 32u, 9u, 13u, 79 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 80 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 81 57u, 32u, 43u, 45u, 9u, 13u, 32u, 9u, 82 13u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 83 13u, 48u, 57u, 32u, 67u, 73u, 77u, 110u, 84 9u, 13u, 32u, 9u, 13u, 32u, 9u, 13u, 85 32u, 9u, 13u, 32u, 67u, 73u, 84u, 110u, 86 9u, 13u, 77u, 78u, 32u, 9u, 13u, 32u, 87 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 88 57u, 32u, 67u, 73u, 84u, 110u, 9u, 13u, 89 77u, 78u, 32u, 9u, 13u, 32u, 9u, 13u, 90 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 91 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 92 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 93 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 94 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 95 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 96 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 97 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 98 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 99 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 100 48u, 57u, 32u, 9u, 13u, 32u, 9u, 13u, 101 32u, 9u, 13u, 32u, 9u, 13u, 32u, 45u, 102 70u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 103 32u, 9u, 13u, 32u, 9u, 13u, 32u, 9u, 104 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 105 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 106 48u, 57u, 32u, 43u, 45u, 9u, 13u, 32u, 107 9u, 13u, 32u, 9u, 13u, 48u, 57u, 32u, 108 9u, 13u, 48u, 57u, 32u, 9u, 13u, 32u, 109 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 110 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 111 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 112 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 113 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 114 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 115 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 116 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 117 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 118 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 119 9u, 13u, 32u, 9u, 13u, 48u, 57u, 32u, 120 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 121 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 122 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 123 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 124 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 125 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 126 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 127 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 128 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 129 48u, 57u, 32u, 9u, 13u, 32u, 9u, 13u, 130 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 131 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 132 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 133 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 134 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 135 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 136 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 137 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 138 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 139 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 140 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 141 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 142 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 143 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 144 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 145 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 146 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 147 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 148 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 149 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 150 32u, 9u, 13u, 32u, 9u, 13u, 48u, 57u, 151 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 152 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 153 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 154 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 155 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 156 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 157 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 158 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 159 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 160 13u, 48u, 57u, 32u, 9u, 13u, 32u, 9u, 161 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 162 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 163 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 164 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 165 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 166 13u, 48u, 57u, 32u, 9u, 13u, 48u, 57u, 167 32u, 9u, 13u, 48u, 57u, 32u, 9u, 13u, 168 48u, 57u, 32u, 9u, 13u, 48u, 57u, 32u, 169 9u, 13u, 48u, 57u, 32u, 9u, 13u, 48u, 170 57u, 32u, 9u, 13u, 48u, 57u, 32u, 9u, 171 13u, 97u, 115u, 115u, 61u, 48u, 57u, 10u, 172 32u, 9u, 13u, 48u, 57u, 10u, 32u, 9u, 173 13u, 48u, 57u, 10u, 32u, 9u, 13u, 48u, 174 57u, 10u, 32u, 9u, 13u, 48u, 57u, 10u, 175 32u, 9u, 13u, 48u, 57u, 10u, 32u, 9u, 176 13u, 48u, 57u, 10u, 32u, 9u, 13u, 48u, 177 57u, 10u, 32u, 9u, 13u, 48u, 57u, 10u, 178 32u, 9u, 13u, 48u, 57u, 10u, 32u, 9u, 179 13u, 48u, 57u, 10u, 32u, 9u, 13u, 48u, 180 57u, 10u, 32u, 9u, 13u, 48u, 57u, 10u, 181 32u, 9u, 13u, 48u, 57u, 10u, 32u, 9u, 182 13u, 48u, 57u, 10u, 32u, 9u, 13u, 48u, 183 57u, 10u, 32u, 9u, 13u, 48u, 57u, 10u, 184 32u, 9u, 13u, 48u, 57u, 10u, 32u, 9u, 185 13u, 32u, 99u, 9u, 13u, 111u, 114u, 101u, 186 61u, 43u, 45u, 46u, 105u, 110u, 48u, 57u, 187 46u, 105u, 48u, 57u, 48u, 57u, 10u, 32u, 188 69u, 101u, 9u, 13u, 48u, 57u, 43u, 45u, 189 48u, 57u, 48u, 57u, 10u, 32u, 9u, 13u, 190 48u, 57u, 10u, 32u, 46u, 69u, 101u, 9u, 191 13u, 48u, 57u, 110u, 102u, 10u, 32u, 9u, 192 13u, 97u, 110u, 99u, 10u, 32u, 9u, 13u, 193 10u, 32u, 9u, 13u, 10u, 32u, 101u, 105u, 194 113u, 115u, 9u, 13u, 10u, 32u, 9u, 13u, 195 48u, 57u, 10u, 32u, 9u, 13u, 48u, 57u, 196 10u, 32u, 9u, 13u, 48u, 57u, 10u, 32u, 197 9u, 13u, 48u, 57u, 10u, 32u, 9u, 13u, 198 48u, 57u, 10u, 32u, 9u, 13u, 48u, 57u, 199 10u, 32u, 9u, 13u, 48u, 57u, 10u, 32u, 200 9u, 13u, 48u, 57u, 10u, 32u, 9u, 13u, 201 48u, 57u, 10u, 32u, 9u, 13u, 48u, 57u, 202 10u, 32u, 9u, 13u, 48u, 57u, 10u, 32u, 203 9u, 13u, 48u, 57u, 10u, 32u, 9u, 13u, 204 48u, 57u, 10u, 32u, 9u, 13u, 48u, 57u, 205 10u, 32u, 9u, 13u, 48u, 57u, 10u, 32u, 206 9u, 13u, 48u, 57u, 10u, 32u, 9u, 13u, 207 48u, 57u, 10u, 32u, 9u, 13u, 10u, 32u, 208 45u, 70u, 9u, 13u, 48u, 57u, 10u, 32u, 209 9u, 13u, 0 210 ]; 211 212 static byte[] _maf_block_single_lengths = [ 213 0, 1, 2, 4, 7, 1, 1, 1, 214 1, 1, 1, 1, 3, 1, 1, 1, 215 5, 1, 1, 1, 5, 1, 1, 1, 216 5, 1, 1, 1, 1, 1, 1, 1, 217 1, 1, 1, 1, 1, 1, 1, 1, 218 1, 1, 1, 1, 1, 1, 1, 3, 219 1, 1, 1, 1, 1, 1, 1, 3, 220 1, 1, 1, 1, 1, 1, 1, 1, 221 1, 1, 1, 1, 1, 1, 1, 1, 222 1, 1, 1, 1, 1, 1, 1, 1, 223 1, 1, 1, 1, 1, 1, 1, 1, 224 1, 1, 1, 1, 1, 1, 1, 1, 225 1, 1, 1, 1, 1, 1, 1, 1, 226 1, 1, 1, 1, 1, 1, 1, 1, 227 1, 1, 1, 1, 1, 1, 1, 1, 228 1, 1, 1, 1, 1, 1, 1, 1, 229 1, 1, 1, 1, 1, 1, 1, 1, 230 1, 1, 1, 1, 1, 1, 1, 1, 231 1, 1, 1, 1, 1, 1, 1, 1, 232 1, 1, 1, 1, 1, 1, 1, 1, 233 1, 1, 1, 1, 1, 1, 0, 2, 234 2, 2, 2, 2, 2, 2, 2, 2, 235 2, 2, 2, 2, 2, 2, 2, 2, 236 2, 2, 1, 1, 1, 1, 5, 2, 237 0, 4, 2, 0, 2, 5, 1, 1, 238 2, 1, 1, 1, 2, 2, 6, 2, 239 2, 2, 2, 2, 2, 2, 2, 2, 240 2, 2, 2, 2, 2, 2, 2, 2, 241 2, 4, 2 242 ]; 243 244 static byte[] _maf_block_range_lengths = [ 245 0, 0, 1, 1, 1, 1, 1, 1, 246 2, 2, 2, 2, 1, 1, 2, 2, 247 1, 1, 1, 1, 2, 1, 2, 2, 248 2, 1, 2, 2, 2, 2, 2, 2, 249 2, 2, 2, 2, 2, 2, 2, 2, 250 2, 2, 2, 1, 1, 1, 1, 2, 251 1, 1, 1, 2, 2, 2, 2, 1, 252 1, 2, 2, 1, 2, 2, 2, 2, 253 2, 2, 2, 2, 2, 2, 2, 2, 254 2, 2, 2, 2, 1, 2, 2, 2, 255 2, 2, 2, 2, 2, 2, 2, 2, 256 2, 2, 2, 2, 2, 1, 2, 2, 257 2, 2, 2, 2, 2, 2, 2, 2, 258 2, 2, 2, 2, 2, 2, 1, 2, 259 2, 2, 2, 2, 2, 2, 2, 2, 260 2, 2, 2, 2, 2, 2, 2, 1, 261 2, 2, 2, 2, 2, 2, 2, 2, 262 2, 2, 2, 2, 2, 2, 2, 2, 263 1, 2, 2, 2, 2, 2, 2, 2, 264 2, 2, 2, 2, 2, 2, 2, 2, 265 2, 1, 0, 0, 0, 0, 1, 2, 266 2, 2, 2, 2, 2, 2, 2, 2, 267 2, 2, 2, 2, 2, 2, 2, 2, 268 1, 1, 0, 0, 0, 0, 1, 1, 269 1, 2, 1, 1, 2, 2, 0, 0, 270 1, 0, 0, 0, 1, 1, 1, 2, 271 2, 2, 2, 2, 2, 2, 2, 2, 272 2, 2, 2, 2, 2, 2, 2, 2, 273 1, 2, 1 274 ]; 275 276 static short[] _maf_block_index_offsets = [ 277 0, 0, 2, 6, 12, 21, 24, 27, 278 30, 34, 38, 42, 46, 51, 54, 58, 279 62, 69, 72, 75, 78, 86, 89, 93, 280 97, 105, 108, 112, 116, 120, 124, 128, 281 132, 136, 140, 144, 148, 152, 156, 160, 282 164, 168, 172, 176, 179, 182, 185, 188, 283 194, 197, 200, 203, 207, 211, 215, 219, 284 224, 227, 231, 235, 238, 242, 246, 250, 285 254, 258, 262, 266, 270, 274, 278, 282, 286 286, 290, 294, 298, 302, 305, 309, 313, 287 317, 321, 325, 329, 333, 337, 341, 345, 288 349, 353, 357, 361, 365, 369, 372, 376, 289 380, 384, 388, 392, 396, 400, 404, 408, 290 412, 416, 420, 424, 428, 432, 436, 439, 291 443, 447, 451, 455, 459, 463, 467, 471, 292 475, 479, 483, 487, 491, 495, 499, 503, 293 506, 510, 514, 518, 522, 526, 530, 534, 294 538, 542, 546, 550, 554, 558, 562, 566, 295 570, 573, 577, 581, 585, 589, 593, 597, 296 601, 605, 609, 613, 617, 621, 625, 629, 297 633, 637, 640, 642, 644, 646, 648, 650, 298 655, 660, 665, 670, 675, 680, 685, 690, 299 695, 700, 705, 710, 715, 720, 725, 730, 300 735, 739, 743, 745, 747, 749, 751, 758, 301 762, 764, 771, 775, 777, 782, 790, 792, 302 794, 798, 800, 802, 804, 808, 812, 820, 303 825, 830, 835, 840, 845, 850, 855, 860, 304 865, 870, 875, 880, 885, 890, 895, 900, 305 905, 909, 916 306 ]; 307 308 static ubyte[] _maf_block_trans_targs = [ 309 2, 0, 4, 3, 3, 0, 4, 3, 310 162, 203, 3, 0, 4, 3, 5, 17, 311 162, 44, 185, 3, 0, 6, 6, 0, 312 6, 6, 7, 8, 8, 7, 8, 8, 313 9, 0, 10, 10, 145, 0, 10, 10, 314 11, 0, 12, 12, 128, 0, 12, 13, 315 13, 12, 0, 14, 14, 0, 14, 14, 316 15, 0, 16, 16, 111, 0, 16, 204, 317 204, 204, 204, 16, 0, 18, 18, 0, 318 18, 18, 19, 20, 20, 19, 20, 21, 319 21, 21, 21, 20, 21, 0, 22, 22, 320 0, 22, 22, 23, 0, 24, 24, 27, 321 0, 24, 25, 25, 25, 25, 24, 25, 322 0, 26, 26, 0, 26, 26, 207, 0, 323 24, 24, 28, 0, 24, 24, 29, 0, 324 24, 24, 30, 0, 24, 24, 31, 0, 325 24, 24, 32, 0, 24, 24, 33, 0, 326 24, 24, 34, 0, 24, 24, 35, 0, 327 24, 24, 36, 0, 24, 24, 37, 0, 328 24, 24, 38, 0, 24, 24, 39, 0, 329 24, 24, 40, 0, 24, 24, 41, 0, 330 24, 24, 42, 0, 24, 24, 43, 0, 331 24, 24, 0, 45, 45, 0, 45, 45, 332 46, 47, 47, 46, 47, 225, 225, 47, 333 225, 0, 49, 49, 0, 49, 49, 50, 334 51, 51, 50, 51, 51, 52, 0, 53, 335 53, 94, 0, 53, 53, 54, 0, 55, 336 55, 77, 0, 55, 56, 56, 55, 0, 337 57, 57, 0, 57, 57, 58, 0, 59, 338 59, 60, 0, 59, 59, 226, 59, 59, 339 61, 0, 59, 59, 62, 0, 59, 59, 340 63, 0, 59, 59, 64, 0, 59, 59, 341 65, 0, 59, 59, 66, 0, 59, 59, 342 67, 0, 59, 59, 68, 0, 59, 59, 343 69, 0, 59, 59, 70, 0, 59, 59, 344 71, 0, 59, 59, 72, 0, 59, 59, 345 73, 0, 59, 59, 74, 0, 59, 59, 346 75, 0, 59, 59, 76, 0, 59, 59, 347 0, 55, 55, 78, 0, 55, 55, 79, 348 0, 55, 55, 80, 0, 55, 55, 81, 349 0, 55, 55, 82, 0, 55, 55, 83, 350 0, 55, 55, 84, 0, 55, 55, 85, 351 0, 55, 55, 86, 0, 55, 55, 87, 352 0, 55, 55, 88, 0, 55, 55, 89, 353 0, 55, 55, 90, 0, 55, 55, 91, 354 0, 55, 55, 92, 0, 55, 55, 93, 355 0, 55, 55, 0, 53, 53, 95, 0, 356 53, 53, 96, 0, 53, 53, 97, 0, 357 53, 53, 98, 0, 53, 53, 99, 0, 358 53, 53, 100, 0, 53, 53, 101, 0, 359 53, 53, 102, 0, 53, 53, 103, 0, 360 53, 53, 104, 0, 53, 53, 105, 0, 361 53, 53, 106, 0, 53, 53, 107, 0, 362 53, 53, 108, 0, 53, 53, 109, 0, 363 53, 53, 110, 0, 53, 53, 0, 16, 364 16, 112, 0, 16, 16, 113, 0, 16, 365 16, 114, 0, 16, 16, 115, 0, 16, 366 16, 116, 0, 16, 16, 117, 0, 16, 367 16, 118, 0, 16, 16, 119, 0, 16, 368 16, 120, 0, 16, 16, 121, 0, 16, 369 16, 122, 0, 16, 16, 123, 0, 16, 370 16, 124, 0, 16, 16, 125, 0, 16, 371 16, 126, 0, 16, 16, 127, 0, 16, 372 16, 0, 12, 12, 129, 0, 12, 12, 373 130, 0, 12, 12, 131, 0, 12, 12, 374 132, 0, 12, 12, 133, 0, 12, 12, 375 134, 0, 12, 12, 135, 0, 12, 12, 376 136, 0, 12, 12, 137, 0, 12, 12, 377 138, 0, 12, 12, 139, 0, 12, 12, 378 140, 0, 12, 12, 141, 0, 12, 12, 379 142, 0, 12, 12, 143, 0, 12, 12, 380 144, 0, 12, 12, 0, 10, 10, 146, 381 0, 10, 10, 147, 0, 10, 10, 148, 382 0, 10, 10, 149, 0, 10, 10, 150, 383 0, 10, 10, 151, 0, 10, 10, 152, 384 0, 10, 10, 153, 0, 10, 10, 154, 385 0, 10, 10, 155, 0, 10, 10, 156, 386 0, 10, 10, 157, 0, 10, 10, 158, 387 0, 10, 10, 159, 0, 10, 10, 160, 388 0, 10, 10, 161, 0, 10, 10, 0, 389 163, 0, 164, 0, 165, 0, 166, 0, 390 167, 0, 4, 3, 3, 168, 0, 4, 391 3, 3, 169, 0, 4, 3, 3, 170, 392 0, 4, 3, 3, 171, 0, 4, 3, 393 3, 172, 0, 4, 3, 3, 173, 0, 394 4, 3, 3, 174, 0, 4, 3, 3, 395 175, 0, 4, 3, 3, 176, 0, 4, 396 3, 3, 177, 0, 4, 3, 3, 178, 397 0, 4, 3, 3, 179, 0, 4, 3, 398 3, 180, 0, 4, 3, 3, 181, 0, 399 4, 3, 3, 182, 0, 4, 3, 3, 400 183, 0, 4, 3, 3, 184, 0, 4, 401 3, 3, 0, 49, 186, 49, 0, 187, 402 0, 188, 0, 189, 0, 190, 0, 191, 403 191, 192, 198, 201, 197, 0, 192, 198, 404 197, 0, 193, 0, 4, 3, 194, 194, 405 3, 193, 0, 195, 195, 196, 0, 196, 406 0, 4, 3, 3, 196, 0, 4, 3, 407 192, 194, 194, 3, 197, 0, 199, 0, 408 200, 0, 4, 3, 3, 0, 202, 0, 409 200, 0, 186, 0, 206, 205, 205, 0, 410 206, 205, 205, 0, 206, 205, 5, 17, 411 44, 48, 205, 0, 206, 205, 205, 208, 412 0, 206, 205, 205, 209, 0, 206, 205, 413 205, 210, 0, 206, 205, 205, 211, 0, 414 206, 205, 205, 212, 0, 206, 205, 205, 415 213, 0, 206, 205, 205, 214, 0, 206, 416 205, 205, 215, 0, 206, 205, 205, 216, 417 0, 206, 205, 205, 217, 0, 206, 205, 418 205, 218, 0, 206, 205, 205, 219, 0, 419 206, 205, 205, 220, 0, 206, 205, 205, 420 221, 0, 206, 205, 205, 222, 0, 206, 421 205, 205, 223, 0, 206, 205, 205, 224, 422 0, 206, 205, 205, 0, 206, 205, 225, 423 225, 205, 225, 0, 206, 205, 205, 226, 424 0 425 ]; 426 427 static byte[] _maf_block_trans_actions = [ 428 0, 0, 0, 0, 0, 0, 0, 0, 429 0, 0, 0, 0, 0, 0, 0, 0, 430 0, 0, 0, 0, 0, 0, 0, 0, 431 0, 0, 7, 9, 9, 0, 0, 0, 432 37, 0, 11, 11, 1, 0, 0, 0, 433 37, 0, 13, 13, 1, 0, 0, 15, 434 15, 0, 0, 0, 0, 0, 0, 0, 435 37, 0, 17, 17, 1, 0, 0, 31, 436 31, 31, 31, 0, 0, 0, 0, 0, 437 0, 0, 7, 43, 43, 0, 0, 23, 438 23, 23, 23, 0, 23, 0, 0, 0, 439 0, 0, 0, 37, 0, 25, 25, 1, 440 0, 0, 27, 27, 27, 27, 0, 27, 441 0, 0, 0, 0, 0, 0, 37, 0, 442 25, 25, 1, 0, 25, 25, 1, 0, 443 25, 25, 1, 0, 25, 25, 1, 0, 444 25, 25, 1, 0, 25, 25, 1, 0, 445 25, 25, 1, 0, 25, 25, 1, 0, 446 25, 25, 1, 0, 25, 25, 1, 0, 447 25, 25, 1, 0, 25, 25, 1, 0, 448 25, 25, 1, 0, 25, 25, 1, 0, 449 25, 25, 1, 0, 25, 25, 1, 0, 450 25, 25, 0, 0, 0, 0, 0, 0, 451 7, 43, 43, 0, 0, 33, 33, 0, 452 33, 0, 0, 0, 0, 0, 0, 7, 453 9, 9, 0, 0, 0, 37, 0, 11, 454 11, 1, 0, 0, 0, 37, 0, 13, 455 13, 1, 0, 0, 15, 15, 0, 0, 456 0, 0, 0, 0, 0, 37, 0, 17, 457 17, 1, 0, 0, 0, 21, 17, 17, 458 1, 0, 17, 17, 1, 0, 17, 17, 459 1, 0, 17, 17, 1, 0, 17, 17, 460 1, 0, 17, 17, 1, 0, 17, 17, 461 1, 0, 17, 17, 1, 0, 17, 17, 462 1, 0, 17, 17, 1, 0, 17, 17, 463 1, 0, 17, 17, 1, 0, 17, 17, 464 1, 0, 17, 17, 1, 0, 17, 17, 465 1, 0, 17, 17, 1, 0, 17, 17, 466 0, 13, 13, 1, 0, 13, 13, 1, 467 0, 13, 13, 1, 0, 13, 13, 1, 468 0, 13, 13, 1, 0, 13, 13, 1, 469 0, 13, 13, 1, 0, 13, 13, 1, 470 0, 13, 13, 1, 0, 13, 13, 1, 471 0, 13, 13, 1, 0, 13, 13, 1, 472 0, 13, 13, 1, 0, 13, 13, 1, 473 0, 13, 13, 1, 0, 13, 13, 1, 474 0, 13, 13, 0, 11, 11, 1, 0, 475 11, 11, 1, 0, 11, 11, 1, 0, 476 11, 11, 1, 0, 11, 11, 1, 0, 477 11, 11, 1, 0, 11, 11, 1, 0, 478 11, 11, 1, 0, 11, 11, 1, 0, 479 11, 11, 1, 0, 11, 11, 1, 0, 480 11, 11, 1, 0, 11, 11, 1, 0, 481 11, 11, 1, 0, 11, 11, 1, 0, 482 11, 11, 1, 0, 11, 11, 0, 17, 483 17, 1, 0, 17, 17, 1, 0, 17, 484 17, 1, 0, 17, 17, 1, 0, 17, 485 17, 1, 0, 17, 17, 1, 0, 17, 486 17, 1, 0, 17, 17, 1, 0, 17, 487 17, 1, 0, 17, 17, 1, 0, 17, 488 17, 1, 0, 17, 17, 1, 0, 17, 489 17, 1, 0, 17, 17, 1, 0, 17, 490 17, 1, 0, 17, 17, 1, 0, 17, 491 17, 0, 13, 13, 1, 0, 13, 13, 492 1, 0, 13, 13, 1, 0, 13, 13, 493 1, 0, 13, 13, 1, 0, 13, 13, 494 1, 0, 13, 13, 1, 0, 13, 13, 495 1, 0, 13, 13, 1, 0, 13, 13, 496 1, 0, 13, 13, 1, 0, 13, 13, 497 1, 0, 13, 13, 1, 0, 13, 13, 498 1, 0, 13, 13, 1, 0, 13, 13, 499 1, 0, 13, 13, 0, 11, 11, 1, 500 0, 11, 11, 1, 0, 11, 11, 1, 501 0, 11, 11, 1, 0, 11, 11, 1, 502 0, 11, 11, 1, 0, 11, 11, 1, 503 0, 11, 11, 1, 0, 11, 11, 1, 504 0, 11, 11, 1, 0, 11, 11, 1, 505 0, 11, 11, 1, 0, 11, 11, 1, 506 0, 11, 11, 1, 0, 11, 11, 1, 507 0, 11, 11, 1, 0, 11, 11, 0, 508 0, 0, 0, 0, 0, 0, 0, 0, 509 37, 0, 5, 5, 5, 1, 0, 5, 510 5, 5, 1, 0, 5, 5, 5, 1, 511 0, 5, 5, 5, 1, 0, 5, 5, 512 5, 1, 0, 5, 5, 5, 1, 0, 513 5, 5, 5, 1, 0, 5, 5, 5, 514 1, 0, 5, 5, 5, 1, 0, 5, 515 5, 5, 1, 0, 5, 5, 5, 1, 516 0, 5, 5, 5, 1, 0, 5, 5, 517 5, 1, 0, 5, 5, 5, 1, 0, 518 5, 5, 5, 1, 0, 5, 5, 5, 519 1, 0, 5, 5, 5, 1, 0, 5, 520 5, 5, 0, 0, 0, 0, 0, 0, 521 0, 0, 0, 0, 0, 0, 0, 3, 522 3, 3, 3, 3, 3, 0, 0, 0, 523 0, 0, 0, 0, 40, 40, 0, 0, 524 40, 0, 0, 0, 0, 0, 0, 0, 525 0, 40, 40, 40, 0, 0, 40, 40, 526 0, 0, 0, 40, 0, 0, 0, 0, 527 0, 0, 40, 40, 40, 0, 0, 0, 528 0, 0, 0, 0, 19, 19, 19, 0, 529 0, 0, 0, 0, 0, 0, 0, 0, 530 0, 0, 0, 0, 29, 29, 29, 1, 531 0, 29, 29, 29, 1, 0, 29, 29, 532 29, 1, 0, 29, 29, 29, 1, 0, 533 29, 29, 29, 1, 0, 29, 29, 29, 534 1, 0, 29, 29, 29, 1, 0, 29, 535 29, 29, 1, 0, 29, 29, 29, 1, 536 0, 29, 29, 29, 1, 0, 29, 29, 537 29, 1, 0, 29, 29, 29, 1, 0, 538 29, 29, 29, 1, 0, 29, 29, 29, 539 1, 0, 29, 29, 29, 1, 0, 29, 540 29, 29, 1, 0, 29, 29, 29, 1, 541 0, 29, 29, 29, 0, 35, 35, 0, 542 0, 35, 0, 0, 46, 46, 46, 0, 543 0 544 ]; 545 546 static byte[] _maf_block_eof_actions = [ 547 0, 0, 0, 0, 0, 0, 0, 0, 548 0, 0, 0, 0, 0, 0, 0, 0, 549 0, 0, 0, 0, 0, 0, 0, 0, 550 0, 0, 0, 0, 0, 0, 0, 0, 551 0, 0, 0, 0, 0, 0, 0, 0, 552 0, 0, 0, 0, 0, 0, 0, 0, 553 0, 0, 0, 0, 0, 0, 0, 0, 554 0, 0, 0, 0, 0, 0, 0, 0, 555 0, 0, 0, 0, 0, 0, 0, 0, 556 0, 0, 0, 0, 0, 0, 0, 0, 557 0, 0, 0, 0, 0, 0, 0, 0, 558 0, 0, 0, 0, 0, 0, 0, 0, 559 0, 0, 0, 0, 0, 0, 0, 0, 560 0, 0, 0, 0, 0, 0, 0, 0, 561 0, 0, 0, 0, 0, 0, 0, 0, 562 0, 0, 0, 0, 0, 0, 0, 0, 563 0, 0, 0, 0, 0, 0, 0, 0, 564 0, 0, 0, 0, 0, 0, 0, 0, 565 0, 0, 0, 0, 0, 0, 0, 0, 566 0, 0, 0, 0, 0, 0, 0, 0, 567 0, 0, 0, 0, 0, 0, 0, 0, 568 0, 0, 0, 0, 0, 0, 0, 0, 569 0, 0, 0, 0, 0, 0, 0, 0, 570 0, 0, 0, 0, 0, 0, 0, 0, 571 0, 0, 0, 0, 0, 0, 0, 0, 572 0, 0, 0, 0, 19, 0, 0, 29, 573 29, 29, 29, 29, 29, 29, 29, 29, 574 29, 29, 29, 29, 29, 29, 29, 29, 575 29, 35, 46 576 ]; 577 578 static int maf_block_start = 1; 579 static int maf_block_first_final = 204; 580 static int maf_block_error = 0; 581 582 static int maf_block_en_block = 1; 583 584 585 #line 122 "maf_block.rl" 586 587 588 MafBlock parseMafBlock(string line) { 589 char* p = cast(char*)line.ptr; 590 char* pe = p + line.length; 591 char* eof = pe; 592 int cs; 593 594 int current_sign; 595 int int_value; 596 double float_value; 597 size_t float_beg; 598 599 MafBlock block; 600 MafSequence sequence; 601 auto sequences = Appender!(MafSequence[])(); 602 603 size_t src_beg; 604 size_t text_beg; 605 size_t qual_beg; 606 607 608 #line 604 "maf_block.d" 609 { 610 cs = maf_block_start; 611 } 612 613 #line 144 "maf_block.rl" 614 615 #line 611 "maf_block.d" 616 { 617 int _klen; 618 uint _trans; 619 byte* _acts; 620 uint _nacts; 621 char* _keys; 622 623 if ( p == pe ) 624 goto _test_eof; 625 if ( cs == 0 ) 626 goto _out; 627 _resume: 628 _keys = &_maf_block_trans_keys[_maf_block_key_offsets[cs]]; 629 _trans = _maf_block_index_offsets[cs]; 630 631 _klen = _maf_block_single_lengths[cs]; 632 if ( _klen > 0 ) { 633 char* _lower = _keys; 634 char* _mid; 635 char* _upper = _keys + _klen - 1; 636 while (1) { 637 if ( _upper < _lower ) 638 break; 639 640 _mid = _lower + ((_upper-_lower) >> 1); 641 if ( (*p) < *_mid ) 642 _upper = _mid - 1; 643 else if ( (*p) > *_mid ) 644 _lower = _mid + 1; 645 else { 646 _trans += cast(uint)(_mid - _keys); 647 goto _match; 648 } 649 } 650 _keys += _klen; 651 _trans += _klen; 652 } 653 654 _klen = _maf_block_range_lengths[cs]; 655 if ( _klen > 0 ) { 656 char* _lower = _keys; 657 char* _mid; 658 char* _upper = _keys + (_klen<<1) - 2; 659 while (1) { 660 if ( _upper < _lower ) 661 break; 662 663 _mid = _lower + (((_upper-_lower) >> 1) & ~1); 664 if ( (*p) < _mid[0] ) 665 _upper = _mid - 2; 666 else if ( (*p) > _mid[1] ) 667 _lower = _mid + 2; 668 else { 669 _trans += cast(uint)((_mid - _keys)>>1); 670 goto _match; 671 } 672 } 673 _trans += _klen; 674 } 675 676 _match: 677 cs = _maf_block_trans_targs[_trans]; 678 679 if ( _maf_block_trans_actions[_trans] == 0 ) 680 goto _again; 681 682 _acts = &_maf_block_actions[_maf_block_trans_actions[_trans]]; 683 _nacts = cast(uint) *_acts++; 684 while ( _nacts-- > 0 ) 685 { 686 switch ( *_acts++ ) 687 { 688 case 0: 689 #line 28 "maf_block.rl" 690 { int_value = 0; } 691 break; 692 case 1: 693 #line 29 "maf_block.rl" 694 { int_value *= 10; int_value += (*p) - '0'; } 695 break; 696 case 2: 697 #line 37 "maf_block.rl" 698 { float_beg = p - line.ptr; } 699 break; 700 case 3: 701 #line 38 "maf_block.rl" 702 { 703 float_value = to!float(line[float_beg .. p - line.ptr]); 704 } 705 break; 706 case 4: 707 #line 46 "maf_block.rl" 708 { block.score = float_value; } 709 break; 710 case 5: 711 #line 47 "maf_block.rl" 712 { block.pass = int_value; } 713 break; 714 case 6: 715 #line 55 "maf_block.rl" 716 { src_beg = p - line.ptr; } 717 break; 718 case 7: 719 #line 56 "maf_block.rl" 720 { sequence.source = line[src_beg .. p - line.ptr]; } 721 break; 722 case 8: 723 #line 57 "maf_block.rl" 724 { sequence.start = int_value; } 725 break; 726 case 9: 727 #line 58 "maf_block.rl" 728 { sequence.size = int_value; } 729 break; 730 case 10: 731 #line 59 "maf_block.rl" 732 { sequence.strand = (*p); } 733 break; 734 case 11: 735 #line 60 "maf_block.rl" 736 { sequence.source_size = int_value; } 737 break; 738 case 12: 739 #line 61 "maf_block.rl" 740 { sequences.put(sequence); sequence = MafSequence.init; } 741 break; 742 case 13: 743 #line 62 "maf_block.rl" 744 { assert(line[src_beg .. p - line.ptr] == sequences.data.back.source); } 745 break; 746 case 14: 747 #line 70 "maf_block.rl" 748 { text_beg = p - line.ptr; } 749 break; 750 case 15: 751 #line 71 "maf_block.rl" 752 { sequence.text = line[text_beg .. p - line.ptr]; } 753 break; 754 case 16: 755 #line 82 "maf_block.rl" 756 { sequences.data.back.left_status = (*p); } 757 break; 758 case 17: 759 #line 83 "maf_block.rl" 760 { sequences.data.back.left_count = int_value; } 761 break; 762 case 18: 763 #line 84 "maf_block.rl" 764 { sequences.data.back.right_status = (*p); } 765 break; 766 case 19: 767 #line 85 "maf_block.rl" 768 { sequences.data.back.right_count = int_value; } 769 break; 770 case 20: 771 #line 99 "maf_block.rl" 772 { sequence.empty_status = *p; } 773 break; 774 case 21: 775 #line 110 "maf_block.rl" 776 { qual_beg = p - line.ptr; } 777 break; 778 case 22: 779 #line 111 "maf_block.rl" 780 { sequences.data.back.quality = line[qual_beg .. p - line.ptr]; } 781 break; 782 #line 778 "maf_block.d" 783 default: break; 784 } 785 } 786 787 _again: 788 if ( cs == 0 ) 789 goto _out; 790 if ( ++p != pe ) 791 goto _resume; 792 _test_eof: {} 793 if ( p == eof ) 794 { 795 byte* __acts = &_maf_block_actions[_maf_block_eof_actions[cs]]; 796 uint __nacts = cast(uint) *__acts++; 797 while ( __nacts-- > 0 ) { 798 switch ( *__acts++ ) { 799 case 12: 800 #line 61 "maf_block.rl" 801 { sequences.put(sequence); sequence = MafSequence.init; } 802 break; 803 case 15: 804 #line 71 "maf_block.rl" 805 { sequence.text = line[text_beg .. p - line.ptr]; } 806 break; 807 case 19: 808 #line 85 "maf_block.rl" 809 { sequences.data.back.right_count = int_value; } 810 break; 811 case 22: 812 #line 111 "maf_block.rl" 813 { sequences.data.back.quality = line[qual_beg .. p - line.ptr]; } 814 break; 815 #line 811 "maf_block.d" 816 default: break; 817 } 818 } 819 } 820 821 _out: {} 822 } 823 824 #line 145 "maf_block.rl" 825 826 block.sequences = sequences.data; 827 return block; 828 }