Changeset 3231 for proto/pabloj/trunk/output/cpplang/pablo_definitions.hpp
 Timestamp:
 May 29, 2013, 3:20:28 PM (6 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

proto/pabloj/trunk/output/cpplang/pablo_definitions.hpp
r3192 r3231 58 58 // namespace pablo 59 59 // { 60 struct Basis_bits60 struct KernelName 61 61 { 62 BitBlock bit_0; 63 BitBlock bit_1; 64 BitBlock bit_2; 65 BitBlock bit_3; 66 BitBlock bit_4; 67 BitBlock bit_5; 68 BitBlock bit_6; 69 BitBlock bit_7; 70 }; 71 72 struct U8 73 { 74 BitBlock unibyte; 75 BitBlock prefix; 76 BitBlock prefix2; 77 BitBlock prefix3; 78 BitBlock prefix4; 79 BitBlock suffix; 80 BitBlock badprefix; 81 BitBlock xE0; 82 BitBlock xED; 83 BitBlock xF0; 84 BitBlock xF4; 85 BitBlock xA0_xBF; 86 BitBlock x80_x9F; 87 BitBlock x90_xBF; 88 BitBlock x80_x8F; 89 BitBlock xEF; 90 BitBlock xBF; 91 BitBlock xBE; 92 BitBlock scope22; 93 BitBlock scope32; 94 BitBlock scope33; 95 BitBlock scope42; 96 BitBlock scope43; 97 BitBlock scope44; 98 BitBlock xE0_scope; 99 BitBlock xED_scope; 100 BitBlock xF0_scope; 101 BitBlock xF4_scope; 102 BitBlock xEF_scope; 103 }; 104 105 struct Lex 106 { 107 BitBlock CR; 108 BitBlock LF; 109 BitBlock HT; 110 BitBlock SP; 111 BitBlock CRLF; 112 BitBlock RefStart; 113 BitBlock Semicolon; 114 BitBlock Colon; 115 BitBlock LAngle; 116 BitBlock RAngle; 117 BitBlock LBracket; 118 BitBlock RBracket; 119 BitBlock Exclam; 120 BitBlock QMark; 121 BitBlock Hyphen; 122 BitBlock Equals; 123 BitBlock SQuote; 124 BitBlock DQuote; 125 BitBlock Slash; 126 BitBlock Hash; 127 BitBlock x; 128 BitBlock ASCII_name_start; 129 BitBlock ASCII_name_char; 130 BitBlock NameScan; 131 BitBlock Digit; 132 BitBlock Hex; 133 BitBlock WS; 134 }; 135 136 struct Marker 137 { 138 BitBlock LAngle_scope; 139 BitBlock Ref_opener; 140 BitBlock CD_closer; 141 }; 142 143 struct CtCDPI_Callouts 144 { 145 BitBlock Ct_starts; 146 BitBlock Ct_ends; 147 BitBlock CD_starts; 148 BitBlock CD_ends; 149 BitBlock PI_starts; 150 BitBlock PI_name_starts; 151 BitBlock PI_name_ends; 152 BitBlock PI_ends; 153 }; 154 155 struct Ref_Callouts 156 { 157 BitBlock GenRef_starts; 158 BitBlock GenRef_ends; 159 BitBlock DecRef_starts; 160 BitBlock DecRef_ends; 161 BitBlock HexRef_starts; 162 BitBlock HexRef_ends; 163 }; 164 165 struct Tag_Callouts 166 { 167 BitBlock ElemName_starts; 168 BitBlock ElemName_ends; 169 BitBlock AttName_starts; 170 BitBlock AttName_ends; 171 BitBlock AttVal_starts; 172 BitBlock AttVal_ends; 173 BitBlock AttVal_spans; 174 BitBlock EmptyTag_marks; 175 BitBlock EndTag_marks; 176 }; 177 178 struct Check_streams 179 { 180 BitBlock misc_mask; 181 BitBlock non_ascii_name_starts; 182 BitBlock non_ascii_names; 183 BitBlock tag_marks; 184 BitBlock name_follows; 185 BitBlock att_refs; 186 }; 187 188 struct Classify_bytes_Validate_utf8 189 { 190 Classify_bytes_Validate_utf8() 62 KernelName() 191 63 { 192 64 193 65 } 194 66 195 IDISA_INLINE void do_block( struct Basis_bits & basis_bits,struct Lex & lex,struct U8 & u8)67 IDISA_INLINE void do_block() 196 68 { 197 BitBlock temp1 = simd_or(basis_bits.bit_0,basis_bits.bit_1); 198 BitBlock temp2 = simd_andc(basis_bits.bit_2,basis_bits.bit_3); 199 BitBlock temp3 = simd_andc(temp2,temp1); 200 BitBlock temp4 = simd_andc(basis_bits.bit_5,basis_bits.bit_4); 201 BitBlock temp5 = simd_andc(basis_bits.bit_6,basis_bits.bit_7); 202 BitBlock temp6 = simd_and(temp4,temp5); 203 lex.RefStart = simd_and(temp3,temp6); 204 BitBlock temp7 = simd_and(basis_bits.bit_2,basis_bits.bit_3); 205 BitBlock temp8 = simd_andc(temp7,temp1); 206 BitBlock temp9 = simd_andc(basis_bits.bit_4,basis_bits.bit_5); 207 BitBlock temp10 = simd_and(basis_bits.bit_6,basis_bits.bit_7); 208 BitBlock temp11 = simd_and(temp9,temp10); 209 lex.Semicolon = simd_and(temp8,temp11); 210 BitBlock temp12 = simd_and(basis_bits.bit_4,basis_bits.bit_5); 211 BitBlock temp13 = simd_or(basis_bits.bit_6,basis_bits.bit_7); 212 BitBlock temp14 = simd_andc(temp12,temp13); 213 lex.LAngle = simd_and(temp8,temp14); 214 BitBlock temp15 = simd_and(temp12,temp5); 215 lex.RAngle = simd_and(temp8,temp15); 216 BitBlock temp16 = simd_andc(basis_bits.bit_1,basis_bits.bit_0); 217 BitBlock temp17 = simd_andc(basis_bits.bit_3,basis_bits.bit_2); 218 BitBlock temp18 = simd_and(temp16,temp17); 219 lex.LBracket = simd_and(temp18,temp11); 220 BitBlock temp19 = simd_andc(basis_bits.bit_7,basis_bits.bit_6); 221 BitBlock temp20 = simd_and(temp12,temp19); 222 lex.RBracket = simd_and(temp18,temp20); 223 BitBlock temp21 = simd_or(basis_bits.bit_4,basis_bits.bit_5); 224 BitBlock temp22 = simd_andc(temp19,temp21); 225 lex.Exclam = simd_and(temp3,temp22); 226 BitBlock temp23 = simd_and(temp12,temp10); 227 lex.QMark = simd_and(temp8,temp23); 228 lex.Hyphen = simd_and(temp3,temp20); 229 lex.Equals = simd_and(temp8,temp20); 230 BitBlock temp24 = simd_and(temp4,temp10); 231 lex.SQuote = simd_and(temp3,temp24); 232 BitBlock temp25 = simd_andc(temp5,temp21); 233 lex.DQuote = simd_and(temp3,temp25); 234 lex.Slash = simd_and(temp3,temp23); 235 BitBlock temp26 = simd_andc(temp10,temp21); 236 lex.Hash = simd_and(temp3,temp26); 237 BitBlock temp27 = simd_and(temp16,temp7); 238 BitBlock temp28 = simd_andc(temp9,temp13); 239 lex.x = simd_and(temp27,temp28); 240 BitBlock temp29 = simd_and(temp9,temp5); 241 lex.Colon = simd_and(temp8,temp29); 242 BitBlock temp30 = simd_and(temp18,temp23); 243 BitBlock temp31 = simd_or(temp30,lex.Colon); 244 BitBlock temp32 = simd_andc(temp16,basis_bits.bit_2); 245 BitBlock temp33 = simd_or(basis_bits.bit_5,temp10); 246 BitBlock temp34 = simd_and(basis_bits.bit_4,temp33); 247 BitBlock temp35 = simd_not(temp34); 248 BitBlock temp36 = simd_or(temp21,temp13); 249 BitBlock temp37 = simd_or(simd_and(basis_bits.bit_3,temp35),simd_andc(temp36,basis_bits.bit_3)); 250 BitBlock temp38 = simd_and(temp32,temp37); 251 BitBlock temp39 = simd_or(temp31,temp38); 252 BitBlock temp40 = simd_and(temp16,basis_bits.bit_2); 253 BitBlock temp41 = simd_and(temp40,temp37); 254 lex.ASCII_name_start = simd_or(temp39,temp41); 255 BitBlock temp42 = simd_or(temp30,lex.Hyphen); 256 BitBlock temp43 = simd_and(temp3,temp15); 257 BitBlock temp44 = simd_or(temp42,temp43); 258 BitBlock temp45 = simd_andc(temp8,temp34); 259 BitBlock temp46 = simd_or(temp44,temp45); 260 BitBlock temp47 = simd_or(temp46,temp38); 261 lex.ASCII_name_char = simd_or(temp47,temp41); 262 lex.NameScan = simd_or(lex.ASCII_name_char,basis_bits.bit_0); 263 BitBlock temp48 = simd_or(temp1,basis_bits.bit_2); 264 BitBlock x00_x1F = simd_not(temp48); 265 BitBlock temp49 = simd_or(basis_bits.bit_2,basis_bits.bit_3); 266 BitBlock temp50 = simd_or(temp1,temp49); 267 lex.CR = simd_andc(temp20,temp50); 268 lex.LF = simd_andc(temp29,temp50); 269 BitBlock temp51 = simd_and(temp9,temp19); 270 lex.HT = simd_andc(temp51,temp50); 271 lex.SP = simd_andc(temp3,temp36); 272 BitBlock temp52 = simd_or(temp20,temp29); 273 BitBlock temp53 = simd_or(temp52,temp51); 274 BitBlock temp54 = simd_andc(temp53,temp50); 275 lex.WS = simd_or(temp54,lex.SP); 276 BitBlock temp55 = simd_or(basis_bits.bit_5,basis_bits.bit_6); 277 BitBlock temp56 = simd_and(basis_bits.bit_4,temp55); 278 lex.Digit = simd_andc(temp8,temp56); 279 BitBlock temp57 = simd_andc(temp16,temp49); 280 BitBlock temp58 = simd_andc(temp57,basis_bits.bit_4); 281 BitBlock temp59 = simd_not(temp10); 282 BitBlock temp60 = simd_or(simd_and(basis_bits.bit_5,temp59),simd_andc(temp13,basis_bits.bit_5)); 283 BitBlock temp61 = simd_and(temp58,temp60); 284 BitBlock temp62 = simd_or(lex.Digit,temp61); 285 BitBlock temp63 = simd_and(temp16,temp2); 286 BitBlock temp64 = simd_andc(temp63,basis_bits.bit_4); 287 BitBlock temp65 = simd_and(temp64,temp60); 288 lex.Hex = simd_or(temp62,temp65); 289 BitBlock lex_error = simd_andc(x00_x1F,lex.WS); 290 if (bitblock::any(lex_error)) 291 { 292 assert_0_error("Error: illegal character",lex_error); 293 } 294 u8.unibyte = simd_not(basis_bits.bit_0); 295 u8.suffix = simd<1>::constant<0>(); 296 BitBlock u8_error = simd<1>::constant<0>(); 297 BitBlock u8_FFFE_FFFF = simd<1>::constant<0>(); 298 BitBlock u8anyscope = simd<1>::constant<0>(); 299 if (bitblock::any(simd_or(basis_bits.bit_0,carry_set_0.CarryRange(0,10)))) 300 { 301 u8.prefix = simd_and(basis_bits.bit_0,basis_bits.bit_1); 302 u8.prefix2 = simd_andc(u8.prefix,basis_bits.bit_2); 303 u8.prefix3 = simd_and(u8.prefix,temp2); 304 u8.prefix4 = simd_and(u8.prefix,temp7); 305 u8.suffix = simd_andc(basis_bits.bit_0,basis_bits.bit_1); 306 BitBlock temp66 = simd_andc(u8.prefix,temp49); 307 BitBlock temp67 = simd_or(temp21,basis_bits.bit_6); 308 BitBlock temp68 = simd_andc(temp66,temp67); 309 BitBlock temp69 = simd_and(basis_bits.bit_5,temp13); 310 BitBlock temp70 = simd_or(basis_bits.bit_4,temp69); 311 BitBlock temp71 = simd_and(u8.prefix4,temp70); 312 u8.badprefix = simd_or(temp68,temp71); 313 u8_error = u8.badprefix; 314 u8.scope22 = carry_set_0.BitBlock_advance_ci_co(u8.prefix2,carry_set_0.GetCarry(0),0); 315 u8anyscope = u8.scope22; 316 if (bitblock::any(simd_or(simd_or(u8.prefix3,u8.prefix4),carry_set_0.CarryRange(1,9)))) 317 { 318 BitBlock xE0 = simd_andc(u8.prefix3,temp36); 319 BitBlock xED = simd_and(u8.prefix3,temp20); 320 BitBlock xF0 = simd_andc(u8.prefix4,temp36); 321 BitBlock temp72 = simd_andc(temp4,temp13); 322 BitBlock xF4 = simd_and(u8.prefix4,temp72); 323 u8.xA0_xBF = simd_and(u8.suffix,basis_bits.bit_2); 324 u8.x80_x9F = simd_andc(u8.suffix,basis_bits.bit_2); 325 u8.x90_xBF = simd_and(u8.suffix,temp49); 326 u8.x80_x8F = simd_andc(u8.suffix,temp49); 327 BitBlock xEF = simd_and(u8.prefix3,temp23); 328 BitBlock temp73 = simd_and(u8.suffix,temp7); 329 u8.xBF = simd_and(temp73,temp23); 330 u8.xBE = simd_and(temp73,temp15); 331 u8.scope32 = carry_set_0.BitBlock_advance_ci_co(u8.prefix3,carry_set_0.GetCarry(1),1); 332 u8.scope33 = carry_set_0.BitBlock_advance_ci_co(u8.scope32,carry_set_0.GetCarry(2),2); 333 u8.scope42 = carry_set_0.BitBlock_advance_ci_co(u8.prefix4,carry_set_0.GetCarry(3),3); 334 u8.scope43 = carry_set_0.BitBlock_advance_ci_co(u8.scope42,carry_set_0.GetCarry(4),4); 335 u8.scope44 = carry_set_0.BitBlock_advance_ci_co(u8.scope43,carry_set_0.GetCarry(5),5); 336 BitBlock E0_F0_scope = carry_set_0.BitBlock_advance_ci_co(simd_or(xE0,xF0),carry_set_0.GetCarry(6),6); 337 BitBlock ED_F4_scope = carry_set_0.BitBlock_advance_ci_co(simd_or(xED,xF4),carry_set_0.GetCarry(7),7); 338 u8.xE0_scope = simd_and(u8.scope32,E0_F0_scope); 339 u8.xED_scope = simd_and(u8.scope32,ED_F4_scope); 340 u8.xF0_scope = simd_and(u8.scope42,E0_F0_scope); 341 u8.xF4_scope = simd_and(u8.scope42,ED_F4_scope); 342 u8.xEF_scope = carry_set_0.BitBlock_advance_ci_co(xEF,carry_set_0.GetCarry(8),8); 343 BitBlock u8lastscope = simd_or(simd_or(u8.scope22,u8.scope33),u8.scope44); 344 u8anyscope = simd_or(simd_or(simd_or(u8lastscope,u8.scope32),u8.scope42),u8.scope43); 345 BitBlock u8error1 = simd_and(u8.xE0_scope,u8.x80_x9F); 346 BitBlock u8error2 = simd_and(u8.xED_scope,u8.xA0_xBF); 347 BitBlock u8error3 = simd_and(u8.xF0_scope,u8.x80_x8F); 348 BitBlock u8error4 = simd_and(u8.xF4_scope,u8.x90_xBF); 349 u8_error = simd_or(u8_error,simd_or(simd_or(simd_or(u8error1,u8error2),u8error3),u8error4)); 350 BitBlock EF_BF_pending = carry_set_0.BitBlock_advance_ci_co(simd_and(u8.xEF_scope,u8.xBF),carry_set_0.GetCarry(9),9); 351 u8_FFFE_FFFF = simd_and(EF_BF_pending,simd_or(u8.xBE,u8.xBF)); 352 } 353 else 354 { 355 carry_set_0.CarryDequeueEnqueue(1,9); 356 } 357 BitBlock u8mismatch = simd_xor(u8anyscope,u8.suffix); 358 if (bitblock::any(simd_or(simd_or(u8_error,u8mismatch),u8_FFFE_FFFF))) 359 { 360 assert_0_error("UTF8 error found",simd_or(simd_or(u8_error,u8mismatch),u8_FFFE_FFFF)); 361 } 362 } 363 else 364 { 365 carry_set_0.CarryDequeueEnqueue(0,10); 366 } 367 carry_set_0.CarryAdjust(10); 69 BitBlock a; 70 BitBlock b; 71 BitBlock c; 72 BitBlock k; 73 BitBlock r; 74 bool t; 75 t = bitblock::any(a); 76 r = bitblock::slli<10>(a); 77 bitblock::store_unaligned(a, &b); 78 r = bitblock::load_aligned(&b); 79 r = simd_not(a); 80 r = simd_nor(a,b); 81 r = simd<16>::ifh(a,b,c); 82 r = simd<2>::constant<3>(); 83 r = simd<8>::slli<1>(a); 84 r = simd<1>::add(a,b); 85 r = simd<2>::sub(a,b); 86 r = simd<4>::mult(a,b); 87 r = simd<8>::eq(a,b); 88 r = simd<16>::gt(a,b); 89 r = simd<32>::ugt(a,b); 90 r = simd<64>::lt(a,b); 91 r = simd<128>::ult(a,b); 92 r = simd<128>::max(a,b); 93 r = simd<1>::umax(a,b); 94 r = simd<2>::min(a,b); 95 r = simd<4>::umin(a,b); 96 r = simd<64>::sll(a,b); 97 r = simd<64>::srl(a,b); 368 98 } 369 99 370 void do_final_block(struct Basis_bits & basis_bits,struct Lex & lex,struct U8 & u8,BitBlock & EOF_mask) 371 { 372 BitBlock temp1 = simd_or(basis_bits.bit_0,basis_bits.bit_1); 373 BitBlock temp2 = simd_andc(basis_bits.bit_2,basis_bits.bit_3); 374 BitBlock temp3 = simd_andc(temp2,temp1); 375 BitBlock temp4 = simd_andc(basis_bits.bit_5,basis_bits.bit_4); 376 BitBlock temp5 = simd_andc(basis_bits.bit_6,basis_bits.bit_7); 377 BitBlock temp6 = simd_and(temp4,temp5); 378 lex.RefStart = simd_and(temp3,temp6); 379 BitBlock temp7 = simd_and(basis_bits.bit_2,basis_bits.bit_3); 380 BitBlock temp8 = simd_andc(temp7,temp1); 381 BitBlock temp9 = simd_andc(basis_bits.bit_4,basis_bits.bit_5); 382 BitBlock temp10 = simd_and(basis_bits.bit_6,basis_bits.bit_7); 383 BitBlock temp11 = simd_and(temp9,temp10); 384 lex.Semicolon = simd_and(temp8,temp11); 385 BitBlock temp12 = simd_and(basis_bits.bit_4,basis_bits.bit_5); 386 BitBlock temp13 = simd_or(basis_bits.bit_6,basis_bits.bit_7); 387 BitBlock temp14 = simd_andc(temp12,temp13); 388 lex.LAngle = simd_and(temp8,temp14); 389 BitBlock temp15 = simd_and(temp12,temp5); 390 lex.RAngle = simd_and(temp8,temp15); 391 BitBlock temp16 = simd_andc(basis_bits.bit_1,basis_bits.bit_0); 392 BitBlock temp17 = simd_andc(basis_bits.bit_3,basis_bits.bit_2); 393 BitBlock temp18 = simd_and(temp16,temp17); 394 lex.LBracket = simd_and(temp18,temp11); 395 BitBlock temp19 = simd_andc(basis_bits.bit_7,basis_bits.bit_6); 396 BitBlock temp20 = simd_and(temp12,temp19); 397 lex.RBracket = simd_and(temp18,temp20); 398 BitBlock temp21 = simd_or(basis_bits.bit_4,basis_bits.bit_5); 399 BitBlock temp22 = simd_andc(temp19,temp21); 400 lex.Exclam = simd_and(temp3,temp22); 401 BitBlock temp23 = simd_and(temp12,temp10); 402 lex.QMark = simd_and(temp8,temp23); 403 lex.Hyphen = simd_and(temp3,temp20); 404 lex.Equals = simd_and(temp8,temp20); 405 BitBlock temp24 = simd_and(temp4,temp10); 406 lex.SQuote = simd_and(temp3,temp24); 407 BitBlock temp25 = simd_andc(temp5,temp21); 408 lex.DQuote = simd_and(temp3,temp25); 409 lex.Slash = simd_and(temp3,temp23); 410 BitBlock temp26 = simd_andc(temp10,temp21); 411 lex.Hash = simd_and(temp3,temp26); 412 BitBlock temp27 = simd_and(temp16,temp7); 413 BitBlock temp28 = simd_andc(temp9,temp13); 414 lex.x = simd_and(temp27,temp28); 415 BitBlock temp29 = simd_and(temp9,temp5); 416 lex.Colon = simd_and(temp8,temp29); 417 BitBlock temp30 = simd_and(temp18,temp23); 418 BitBlock temp31 = simd_or(temp30,lex.Colon); 419 BitBlock temp32 = simd_andc(temp16,basis_bits.bit_2); 420 BitBlock temp33 = simd_or(basis_bits.bit_5,temp10); 421 BitBlock temp34 = simd_and(basis_bits.bit_4,temp33); 422 BitBlock temp35 = simd_not(temp34); 423 BitBlock temp36 = simd_or(temp21,temp13); 424 BitBlock temp37 = simd_or(simd_and(basis_bits.bit_3,temp35),simd_andc(temp36,basis_bits.bit_3)); 425 BitBlock temp38 = simd_and(temp32,temp37); 426 BitBlock temp39 = simd_or(temp31,temp38); 427 BitBlock temp40 = simd_and(temp16,basis_bits.bit_2); 428 BitBlock temp41 = simd_and(temp40,temp37); 429 lex.ASCII_name_start = simd_or(temp39,temp41); 430 BitBlock temp42 = simd_or(temp30,lex.Hyphen); 431 BitBlock temp43 = simd_and(temp3,temp15); 432 BitBlock temp44 = simd_or(temp42,temp43); 433 BitBlock temp45 = simd_andc(temp8,temp34); 434 BitBlock temp46 = simd_or(temp44,temp45); 435 BitBlock temp47 = simd_or(temp46,temp38); 436 lex.ASCII_name_char = simd_or(temp47,temp41); 437 lex.NameScan = simd_or(lex.ASCII_name_char,basis_bits.bit_0); 438 BitBlock temp48 = simd_or(temp1,basis_bits.bit_2); 439 BitBlock x00_x1F = simd_not(temp48); 440 BitBlock temp49 = simd_or(basis_bits.bit_2,basis_bits.bit_3); 441 BitBlock temp50 = simd_or(temp1,temp49); 442 lex.CR = simd_andc(temp20,temp50); 443 lex.LF = simd_andc(temp29,temp50); 444 BitBlock temp51 = simd_and(temp9,temp19); 445 lex.HT = simd_andc(temp51,temp50); 446 lex.SP = simd_andc(temp3,temp36); 447 BitBlock temp52 = simd_or(temp20,temp29); 448 BitBlock temp53 = simd_or(temp52,temp51); 449 BitBlock temp54 = simd_andc(temp53,temp50); 450 lex.WS = simd_or(temp54,lex.SP); 451 BitBlock temp55 = simd_or(basis_bits.bit_5,basis_bits.bit_6); 452 BitBlock temp56 = simd_and(basis_bits.bit_4,temp55); 453 lex.Digit = simd_andc(temp8,temp56); 454 BitBlock temp57 = simd_andc(temp16,temp49); 455 BitBlock temp58 = simd_andc(temp57,basis_bits.bit_4); 456 BitBlock temp59 = simd_not(temp10); 457 BitBlock temp60 = simd_or(simd_and(basis_bits.bit_5,temp59),simd_andc(temp13,basis_bits.bit_5)); 458 BitBlock temp61 = simd_and(temp58,temp60); 459 BitBlock temp62 = simd_or(lex.Digit,temp61); 460 BitBlock temp63 = simd_and(temp16,temp2); 461 BitBlock temp64 = simd_andc(temp63,basis_bits.bit_4); 462 BitBlock temp65 = simd_and(temp64,temp60); 463 lex.Hex = simd_or(temp62,temp65); 464 BitBlock lex_error = simd_andc(x00_x1F,lex.WS); 465 if (bitblock::any(simd_and(lex_error,EOF_mask))) 466 { 467 assert_0_error("Error: illegal character",simd_and(lex_error,EOF_mask)); 468 } 469 u8.unibyte = simd_not(basis_bits.bit_0); 470 u8.suffix = simd<1>::constant<0>(); 471 BitBlock u8_error = simd<1>::constant<0>(); 472 BitBlock u8_FFFE_FFFF = simd<1>::constant<0>(); 473 BitBlock u8anyscope = simd<1>::constant<0>(); 474 if (bitblock::any(simd_or(basis_bits.bit_0,carry_set_0.CarryRange(0,10)))) 475 { 476 u8.prefix = simd_and(basis_bits.bit_0,basis_bits.bit_1); 477 u8.prefix2 = simd_andc(u8.prefix,basis_bits.bit_2); 478 u8.prefix3 = simd_and(u8.prefix,temp2); 479 u8.prefix4 = simd_and(u8.prefix,temp7); 480 u8.suffix = simd_andc(basis_bits.bit_0,basis_bits.bit_1); 481 BitBlock temp66 = simd_andc(u8.prefix,temp49); 482 BitBlock temp67 = simd_or(temp21,basis_bits.bit_6); 483 BitBlock temp68 = simd_andc(temp66,temp67); 484 BitBlock temp69 = simd_and(basis_bits.bit_5,temp13); 485 BitBlock temp70 = simd_or(basis_bits.bit_4,temp69); 486 BitBlock temp71 = simd_and(u8.prefix4,temp70); 487 u8.badprefix = simd_or(temp68,temp71); 488 u8_error = u8.badprefix; 489 u8.scope22 = carry_set_0.BitBlock_advance_ci_co(u8.prefix2,carry_set_0.GetCarry(0),0); 490 u8anyscope = u8.scope22; 491 if (bitblock::any(simd_or(simd_or(u8.prefix3,u8.prefix4),carry_set_0.CarryRange(1,9)))) 492 { 493 BitBlock xE0 = simd_andc(u8.prefix3,temp36); 494 BitBlock xED = simd_and(u8.prefix3,temp20); 495 BitBlock xF0 = simd_andc(u8.prefix4,temp36); 496 BitBlock temp72 = simd_andc(temp4,temp13); 497 BitBlock xF4 = simd_and(u8.prefix4,temp72); 498 u8.xA0_xBF = simd_and(u8.suffix,basis_bits.bit_2); 499 u8.x80_x9F = simd_andc(u8.suffix,basis_bits.bit_2); 500 u8.x90_xBF = simd_and(u8.suffix,temp49); 501 u8.x80_x8F = simd_andc(u8.suffix,temp49); 502 BitBlock xEF = simd_and(u8.prefix3,temp23); 503 BitBlock temp73 = simd_and(u8.suffix,temp7); 504 u8.xBF = simd_and(temp73,temp23); 505 u8.xBE = simd_and(temp73,temp15); 506 u8.scope32 = carry_set_0.BitBlock_advance_ci_co(u8.prefix3,carry_set_0.GetCarry(1),1); 507 u8.scope33 = carry_set_0.BitBlock_advance_ci_co(u8.scope32,carry_set_0.GetCarry(2),2); 508 u8.scope42 = carry_set_0.BitBlock_advance_ci_co(u8.prefix4,carry_set_0.GetCarry(3),3); 509 u8.scope43 = carry_set_0.BitBlock_advance_ci_co(u8.scope42,carry_set_0.GetCarry(4),4); 510 u8.scope44 = carry_set_0.BitBlock_advance_ci_co(u8.scope43,carry_set_0.GetCarry(5),5); 511 BitBlock E0_F0_scope = carry_set_0.BitBlock_advance_ci_co(simd_or(xE0,xF0),carry_set_0.GetCarry(6),6); 512 BitBlock ED_F4_scope = carry_set_0.BitBlock_advance_ci_co(simd_or(xED,xF4),carry_set_0.GetCarry(7),7); 513 u8.xE0_scope = simd_and(u8.scope32,E0_F0_scope); 514 u8.xED_scope = simd_and(u8.scope32,ED_F4_scope); 515 u8.xF0_scope = simd_and(u8.scope42,E0_F0_scope); 516 u8.xF4_scope = simd_and(u8.scope42,ED_F4_scope); 517 u8.xEF_scope = carry_set_0.BitBlock_advance_ci_co(xEF,carry_set_0.GetCarry(8),8); 518 BitBlock u8lastscope = simd_or(simd_or(u8.scope22,u8.scope33),u8.scope44); 519 u8anyscope = simd_or(simd_or(simd_or(u8lastscope,u8.scope32),u8.scope42),u8.scope43); 520 BitBlock u8error1 = simd_and(u8.xE0_scope,u8.x80_x9F); 521 BitBlock u8error2 = simd_and(u8.xED_scope,u8.xA0_xBF); 522 BitBlock u8error3 = simd_and(u8.xF0_scope,u8.x80_x8F); 523 BitBlock u8error4 = simd_and(u8.xF4_scope,u8.x90_xBF); 524 u8_error = simd_or(u8_error,simd_or(simd_or(simd_or(u8error1,u8error2),u8error3),u8error4)); 525 BitBlock EF_BF_pending = carry_set_0.BitBlock_advance_ci_co(simd_and(u8.xEF_scope,u8.xBF),carry_set_0.GetCarry(9),9); 526 u8_FFFE_FFFF = simd_and(EF_BF_pending,simd_or(u8.xBE,u8.xBF)); 527 } 528 else 529 { 530 carry_set_0.CarryDequeueEnqueue(1,9); 531 } 532 BitBlock u8mismatch = simd_xor(u8anyscope,u8.suffix); 533 if (bitblock::any(simd_or(simd_or(u8_error,u8mismatch),u8_FFFE_FFFF))) 534 { 535 assert_0_error("UTF8 error found",simd_or(simd_or(u8_error,u8mismatch),u8_FFFE_FFFF)); 536 } 537 } 538 else 539 { 540 carry_set_0.CarryDequeueEnqueue(0,10); 541 } 542 } 543 544 CarryDeclare(carry_set_0,10,0); 545 }; 546 547 struct Parse_CtCDPI 548 { 549 Parse_CtCDPI() 550 { 551 carry_set_0.SetCarry(carry_set_0.CarryFlip(carry_set_0.GetCarry(2)),2); 552 } 553 554 IDISA_INLINE void do_block(struct Lex & lex,struct Marker & marker,struct CtCDPI_Callouts & ctCDPI_Callouts,struct Check_streams & check_streams) 555 { 556 ctCDPI_Callouts.Ct_starts = simd<1>::constant<0>(); 557 ctCDPI_Callouts.Ct_ends = simd<1>::constant<0>(); 558 ctCDPI_Callouts.CD_starts = simd<1>::constant<0>(); 559 ctCDPI_Callouts.CD_ends = simd<1>::constant<0>(); 560 ctCDPI_Callouts.PI_starts = simd<1>::constant<0>(); 561 ctCDPI_Callouts.PI_name_starts = simd<1>::constant<0>(); 562 ctCDPI_Callouts.PI_name_ends = simd<1>::constant<0>(); 563 ctCDPI_Callouts.PI_ends = simd<1>::constant<0>(); 564 BitBlock CtCDPI_starts = simd<1>::constant<0>(); 565 BitBlock CtCDPI_ends = simd<1>::constant<0>(); 566 BitBlock ctCDPI_mask = simd<1>::constant<0>(); 567 BitBlock v = simd_or(lex.LAngle,lex.Hyphen); 568 BitBlock w = simd_or(lex.Hyphen,lex.QMark); 569 BitBlock v1 = carry_set_0.BitBlock_advance_n_<1>(v,carry_set_0.Pending64(0),0); 570 BitBlock w1 = carry_set_0.BitBlock_advance_n_<1>(w,carry_set_0.Pending64(1),1); 571 BitBlock LAngle_scope = simd_andc(v1,w1); 572 BitBlock PI_opener = simd_and(LAngle_scope,lex.QMark); 573 BitBlock CtCD_opener = simd_and(LAngle_scope,lex.Exclam); 574 BitBlock CtCDPI_opener = simd_or(PI_opener,CtCD_opener); 575 BitBlock CD_closer = simd<1>::constant<0>(); 576 BitBlock DoubleHyphen = simd_and(simd_and(v1,w1),lex.Hyphen); 577 if (bitblock::any(simd_or(lex.RBracket,carry_set_0.CarryRange(0,2)))) 578 { 579 BitBlock DoubleRBracket = simd_and(carry_set_0.BitBlock_advance_ci_co(lex.RBracket,carry_set_0.GetCarry(0),0),lex.RBracket); 580 CD_closer = simd_and(carry_set_0.BitBlock_advance_ci_co(DoubleRBracket,carry_set_0.GetCarry(1),1),lex.RAngle); 581 } 582 else 583 { 584 carry_set_0.CarryDequeueEnqueue(0,2); 585 } 586 BitBlock PI_closer = simd_and(simd_andc(w1,v1),lex.RAngle); 587 BitBlock CtCDPI_Cursor = carry_set_0.BitBlock_scantofirst(CtCDPI_opener,carry_set_0.GetCarry(2),2); 588 if (bitblock::any(simd_or(CtCDPI_Cursor,carry_set_0.CarryRange(3,13)))) 589 { 590 CtCDPI_starts = simd_or(CtCDPI_starts,CtCDPI_Cursor); 591 BitBlock PI_Cursor = simd_and(CtCDPI_Cursor,PI_opener); 592 BitBlock CD_Ct_Cursor = carry_set_0.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor,PI_Cursor),carry_set_0.GetCarry(3),3); 593 BitBlock CD_Cursor = simd_and(CD_Ct_Cursor,lex.LBracket); 594 BitBlock Ct_Cursor = simd_and(CD_Ct_Cursor,lex.Hyphen); 595 if (bitblock::any(simd_or(PI_Cursor,carry_set_0.CarryRange(4,4)))) 596 { 597 ctCDPI_Callouts.PI_starts = simd_or(ctCDPI_Callouts.PI_starts,PI_Cursor); 598 PI_Cursor = carry_set_0.BitBlock_advance_ci_co(PI_Cursor,carry_set_0.GetCarry(4),4); 599 ctCDPI_Callouts.PI_name_starts = simd_or(ctCDPI_Callouts.PI_name_starts,PI_Cursor); 600 BitBlock PI_name_end = carry_set_0.BitBlock_scanthru_ci_co(PI_Cursor,lex.NameScan,carry_set_0.GetCarry(5),5); 601 BitBlock PI_error = simd_and(PI_Cursor,PI_name_end); 602 BitBlock PI_noWS = simd_andc(PI_name_end,lex.WS); 603 PI_error = simd_or(PI_error,simd_or(simd_andc(PI_noWS,lex.QMark),simd_andc(carry_set_0.BitBlock_advance_ci_co(PI_noWS,carry_set_0.GetCarry(6),6),PI_closer))); 604 if (bitblock::any(PI_error)) 605 { 606 assert_0_error("Error in PI syntax",PI_error); 607 } 608 ctCDPI_Callouts.PI_name_ends = simd_or(ctCDPI_Callouts.PI_name_ends,PI_name_end); 609 PI_Cursor = carry_set_0.BitBlock_scanthru_ci_co(PI_name_end,simd_not(PI_closer),carry_set_0.GetCarry(7),7); 610 ctCDPI_Callouts.PI_ends = simd_or(ctCDPI_Callouts.PI_ends,PI_Cursor); 611 CtCDPI_ends = simd_or(CtCDPI_ends,PI_Cursor); 612 } 613 else 614 { 615 carry_set_0.CarryDequeueEnqueue(4,4); 616 } 617 if (bitblock::any(simd_or(CD_Cursor,carry_set_0.CarryRange(8,1)))) 618 { 619 ctCDPI_Callouts.CD_starts = simd_or(ctCDPI_Callouts.CD_starts,CD_Cursor); 620 CD_Cursor = carry_set_0.BitBlock_scanthru_ci_co(CD_Cursor,simd_not(CD_closer),carry_set_0.GetCarry(8),8); 621 ctCDPI_Callouts.CD_ends = simd_or(ctCDPI_Callouts.CD_ends,CD_Cursor); 622 CtCDPI_ends = simd_or(CtCDPI_ends,CD_Cursor); 623 } 624 else 625 { 626 carry_set_0.CarryDequeueEnqueue(8,1); 627 } 628 if (bitblock::any(simd_or(Ct_Cursor,carry_set_0.CarryRange(9,5)))) 629 { 630 ctCDPI_Callouts.Ct_starts = simd_or(ctCDPI_Callouts.Ct_starts,Ct_Cursor); 631 Ct_Cursor = carry_set_0.BitBlock_advance_ci_co(Ct_Cursor,carry_set_0.GetCarry(9),9); 632 BitBlock Ct_error = simd_andc(Ct_Cursor,lex.Hyphen); 633 Ct_Cursor = carry_set_0.BitBlock_advance_ci_co(carry_set_0.BitBlock_advance_ci_co(Ct_Cursor,carry_set_0.GetCarry(10),10),carry_set_0.GetCarry(11),11); 634 Ct_Cursor = carry_set_0.BitBlock_advance_ci_co(carry_set_0.BitBlock_scanthru_ci_co(Ct_Cursor,simd_not(DoubleHyphen),carry_set_0.GetCarry(12),12),carry_set_0.GetCarry(13),13); 635 if (bitblock::any(simd_or(Ct_error,simd_andc(Ct_Cursor,lex.RAngle)))) 636 { 637 assert_0_error("Error in comment syntax",simd_or(Ct_error,simd_andc(Ct_Cursor,lex.RAngle))); 638 } 639 ctCDPI_Callouts.Ct_ends = simd_or(ctCDPI_Callouts.Ct_ends,Ct_Cursor); 640 CtCDPI_ends = simd_or(CtCDPI_ends,Ct_Cursor); 641 } 642 else 643 { 644 carry_set_0.CarryDequeueEnqueue(9,5); 645 } 646 CtCDPI_Cursor = simd_or(simd_or(PI_Cursor,CD_Cursor),Ct_Cursor); 647 ctCDPI_mask = carry_set_0.BitBlock_inclusive_span(CtCDPI_starts,CtCDPI_ends,carry_set_0.GetCarry(14),14); 648 if (bitblock::any(simd<1>::constant<0>())) 649 { 650 assert_0_error("Error in comment, CDATA or processing instruction syntax",simd<1>::constant<0>()); 651 } 652 CtCDPI_Cursor = carry_set_0.BitBlock_scanthru_ci_co(CtCDPI_Cursor,simd_not(CtCDPI_opener),carry_set_0.GetCarry(15),15); 653 while (bitblock::any(CtCDPI_Cursor)) 654 { 655 CarryDeclare(carry_set_1,13,0); 656 CtCDPI_starts = simd_or(CtCDPI_starts,CtCDPI_Cursor); 657 BitBlock PI_Cursor = simd_and(CtCDPI_Cursor,PI_opener); 658 BitBlock CD_Ct_Cursor = carry_set_1.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor,PI_Cursor),simd<1>::constant<0>(),0); 659 BitBlock CD_Cursor = simd_and(CD_Ct_Cursor,lex.LBracket); 660 BitBlock Ct_Cursor = simd_and(CD_Ct_Cursor,lex.Hyphen); 661 if (bitblock::any(PI_Cursor)) 662 { 663 ctCDPI_Callouts.PI_starts = simd_or(ctCDPI_Callouts.PI_starts,PI_Cursor); 664 PI_Cursor = carry_set_1.BitBlock_advance_ci_co(PI_Cursor,simd<1>::constant<0>(),1); 665 ctCDPI_Callouts.PI_name_starts = simd_or(ctCDPI_Callouts.PI_name_starts,PI_Cursor); 666 BitBlock PI_name_end = carry_set_1.BitBlock_scanthru_ci_co(PI_Cursor,lex.NameScan,simd<1>::constant<0>(),2); 667 BitBlock PI_error = simd_and(PI_Cursor,PI_name_end); 668 BitBlock PI_noWS = simd_andc(PI_name_end,lex.WS); 669 PI_error = simd_or(PI_error,simd_or(simd_andc(PI_noWS,lex.QMark),simd_andc(carry_set_1.BitBlock_advance_ci_co(PI_noWS,simd<1>::constant<0>(),3),PI_closer))); 670 if (bitblock::any(PI_error)) 671 { 672 assert_0_error("Error in PI syntax",PI_error); 673 } 674 ctCDPI_Callouts.PI_name_ends = simd_or(ctCDPI_Callouts.PI_name_ends,PI_name_end); 675 PI_Cursor = carry_set_1.BitBlock_scanthru_ci_co(PI_name_end,simd_not(PI_closer),simd<1>::constant<0>(),4); 676 ctCDPI_Callouts.PI_ends = simd_or(ctCDPI_Callouts.PI_ends,PI_Cursor); 677 CtCDPI_ends = simd_or(CtCDPI_ends,PI_Cursor); 678 } 679 if (bitblock::any(CD_Cursor)) 680 { 681 ctCDPI_Callouts.CD_starts = simd_or(ctCDPI_Callouts.CD_starts,CD_Cursor); 682 CD_Cursor = carry_set_1.BitBlock_scanthru_ci_co(CD_Cursor,simd_not(CD_closer),simd<1>::constant<0>(),5); 683 ctCDPI_Callouts.CD_ends = simd_or(ctCDPI_Callouts.CD_ends,CD_Cursor); 684 CtCDPI_ends = simd_or(CtCDPI_ends,CD_Cursor); 685 } 686 if (bitblock::any(Ct_Cursor)) 687 { 688 ctCDPI_Callouts.Ct_starts = simd_or(ctCDPI_Callouts.Ct_starts,Ct_Cursor); 689 Ct_Cursor = carry_set_1.BitBlock_advance_ci_co(Ct_Cursor,simd<1>::constant<0>(),6); 690 BitBlock Ct_error = simd_andc(Ct_Cursor,lex.Hyphen); 691 Ct_Cursor = carry_set_1.BitBlock_advance_ci_co(carry_set_1.BitBlock_advance_ci_co(Ct_Cursor,simd<1>::constant<0>(),7),simd<1>::constant<0>(),8); 692 Ct_Cursor = carry_set_1.BitBlock_advance_ci_co(carry_set_1.BitBlock_scanthru_ci_co(Ct_Cursor,simd_not(DoubleHyphen),simd<1>::constant<0>(),9),simd<1>::constant<0>(),10); 693 if (bitblock::any(simd_or(Ct_error,simd_andc(Ct_Cursor,lex.RAngle)))) 694 { 695 assert_0_error("Error in comment syntax",simd_or(Ct_error,simd_andc(Ct_Cursor,lex.RAngle))); 696 } 697 ctCDPI_Callouts.Ct_ends = simd_or(ctCDPI_Callouts.Ct_ends,Ct_Cursor); 698 CtCDPI_ends = simd_or(CtCDPI_ends,Ct_Cursor); 699 } 700 CtCDPI_Cursor = simd_or(simd_or(PI_Cursor,CD_Cursor),Ct_Cursor); 701 ctCDPI_mask = carry_set_1.BitBlock_inclusive_span(CtCDPI_starts,CtCDPI_ends,simd<1>::constant<0>(),11); 702 if (bitblock::any(simd<1>::constant<0>())) 703 { 704 assert_0_error("Error in comment, CDATA or processing instruction syntax",simd<1>::constant<0>()); 705 } 706 CtCDPI_Cursor = carry_set_1.BitBlock_scanthru_ci_co(CtCDPI_Cursor,simd_not(CtCDPI_opener),simd<1>::constant<0>(),12); 707 LocalCarryCombine(carry_set_0,carry_set_1,3,13); 708 } 709 } 710 else 711 { 712 carry_set_0.CarryDequeueEnqueue(3,13); 713 } 714 check_streams.misc_mask = simd_and(simd_or(simd_or(simd_or(lex.WS,lex.LAngle),carry_set_0.BitBlock_inclusive_span(simd_or(ctCDPI_Callouts.Ct_starts,ctCDPI_Callouts.PI_starts),simd_or(ctCDPI_Callouts.Ct_ends,ctCDPI_Callouts.PI_ends),carry_set_0.GetCarry(16),16)),CtCDPI_starts),EOF_mask); 715 marker.LAngle_scope = simd_andc(LAngle_scope,ctCDPI_mask); 716 marker.Ref_opener = simd_andc(lex.RefStart,ctCDPI_mask); 717 marker.CD_closer = simd_andc(CD_closer,ctCDPI_mask); 718 carry_set_0.CarryAdjust(17); 719 } 720 721 void do_final_block(struct Lex & lex,struct Marker & marker,struct CtCDPI_Callouts & ctCDPI_Callouts,struct Check_streams & check_streams,BitBlock & EOF_mask) 722 { 723 ctCDPI_Callouts.Ct_starts = simd<1>::constant<0>(); 724 ctCDPI_Callouts.Ct_ends = simd<1>::constant<0>(); 725 ctCDPI_Callouts.CD_starts = simd<1>::constant<0>(); 726 ctCDPI_Callouts.CD_ends = simd<1>::constant<0>(); 727 ctCDPI_Callouts.PI_starts = simd<1>::constant<0>(); 728 ctCDPI_Callouts.PI_name_starts = simd<1>::constant<0>(); 729 ctCDPI_Callouts.PI_name_ends = simd<1>::constant<0>(); 730 ctCDPI_Callouts.PI_ends = simd<1>::constant<0>(); 731 BitBlock CtCDPI_starts = simd<1>::constant<0>(); 732 BitBlock CtCDPI_ends = simd<1>::constant<0>(); 733 BitBlock ctCDPI_mask = simd<1>::constant<0>(); 734 BitBlock v = simd_or(lex.LAngle,lex.Hyphen); 735 BitBlock w = simd_or(lex.Hyphen,lex.QMark); 736 BitBlock v1 = carry_set_0.BitBlock_advance_n_<1>(v,carry_set_0.Pending64(0),0); 737 BitBlock w1 = carry_set_0.BitBlock_advance_n_<1>(w,carry_set_0.Pending64(1),1); 738 BitBlock LAngle_scope = simd_andc(v1,w1); 739 BitBlock PI_opener = simd_and(LAngle_scope,lex.QMark); 740 BitBlock CtCD_opener = simd_and(LAngle_scope,lex.Exclam); 741 BitBlock CtCDPI_opener = simd_or(PI_opener,CtCD_opener); 742 BitBlock CD_closer = simd<1>::constant<0>(); 743 BitBlock DoubleHyphen = simd_and(simd_and(v1,w1),lex.Hyphen); 744 if (bitblock::any(simd_or(lex.RBracket,carry_set_0.CarryRange(0,2)))) 745 { 746 BitBlock DoubleRBracket = simd_and(carry_set_0.BitBlock_advance_ci_co(lex.RBracket,carry_set_0.GetCarry(0),0),lex.RBracket); 747 CD_closer = simd_and(carry_set_0.BitBlock_advance_ci_co(DoubleRBracket,carry_set_0.GetCarry(1),1),lex.RAngle); 748 } 749 else 750 { 751 carry_set_0.CarryDequeueEnqueue(0,2); 752 } 753 BitBlock PI_closer = simd_and(simd_andc(w1,v1),lex.RAngle); 754 BitBlock CtCDPI_Cursor = carry_set_0.BitBlock_scantofirst(CtCDPI_opener,carry_set_0.GetCarry(2),2); 755 if (bitblock::any(simd_or(simd_and(CtCDPI_Cursor,EOF_mask),carry_set_0.CarryRange(3,13)))) 756 { 757 CtCDPI_starts = simd_or(CtCDPI_starts,CtCDPI_Cursor); 758 BitBlock PI_Cursor = simd_and(CtCDPI_Cursor,PI_opener); 759 BitBlock CD_Ct_Cursor = carry_set_0.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor,PI_Cursor),carry_set_0.GetCarry(3),3); 760 BitBlock CD_Cursor = simd_and(CD_Ct_Cursor,lex.LBracket); 761 BitBlock Ct_Cursor = simd_and(CD_Ct_Cursor,lex.Hyphen); 762 if (bitblock::any(simd_or(PI_Cursor,carry_set_0.CarryRange(4,4)))) 763 { 764 ctCDPI_Callouts.PI_starts = simd_or(ctCDPI_Callouts.PI_starts,PI_Cursor); 765 PI_Cursor = carry_set_0.BitBlock_advance_ci_co(PI_Cursor,carry_set_0.GetCarry(4),4); 766 ctCDPI_Callouts.PI_name_starts = simd_or(ctCDPI_Callouts.PI_name_starts,PI_Cursor); 767 BitBlock PI_name_end = carry_set_0.BitBlock_scanthru_ci_co(PI_Cursor,lex.NameScan,carry_set_0.GetCarry(5),5); 768 BitBlock PI_error = simd_and(PI_Cursor,PI_name_end); 769 BitBlock PI_noWS = simd_andc(PI_name_end,lex.WS); 770 PI_error = simd_or(PI_error,simd_or(simd_andc(PI_noWS,lex.QMark),simd_andc(carry_set_0.BitBlock_advance_ci_co(PI_noWS,carry_set_0.GetCarry(6),6),PI_closer))); 771 if (bitblock::any(PI_error)) 772 { 773 assert_0_error("Error in PI syntax",PI_error); 774 } 775 ctCDPI_Callouts.PI_name_ends = simd_or(ctCDPI_Callouts.PI_name_ends,PI_name_end); 776 PI_Cursor = carry_set_0.BitBlock_scanthru_ci_co(PI_name_end,simd_andc(EOF_mask,PI_closer),carry_set_0.GetCarry(7),7); 777 ctCDPI_Callouts.PI_ends = simd_or(ctCDPI_Callouts.PI_ends,PI_Cursor); 778 CtCDPI_ends = simd_or(CtCDPI_ends,PI_Cursor); 779 } 780 else 781 { 782 carry_set_0.CarryDequeueEnqueue(4,4); 783 } 784 if (bitblock::any(simd_or(CD_Cursor,carry_set_0.CarryRange(8,1)))) 785 { 786 ctCDPI_Callouts.CD_starts = simd_or(ctCDPI_Callouts.CD_starts,CD_Cursor); 787 CD_Cursor = carry_set_0.BitBlock_scanthru_ci_co(CD_Cursor,simd_andc(EOF_mask,CD_closer),carry_set_0.GetCarry(8),8); 788 ctCDPI_Callouts.CD_ends = simd_or(ctCDPI_Callouts.CD_ends,CD_Cursor); 789 CtCDPI_ends = simd_or(CtCDPI_ends,CD_Cursor); 790 } 791 else 792 { 793 carry_set_0.CarryDequeueEnqueue(8,1); 794 } 795 if (bitblock::any(simd_or(Ct_Cursor,carry_set_0.CarryRange(9,5)))) 796 { 797 ctCDPI_Callouts.Ct_starts = simd_or(ctCDPI_Callouts.Ct_starts,Ct_Cursor); 798 Ct_Cursor = carry_set_0.BitBlock_advance_ci_co(Ct_Cursor,carry_set_0.GetCarry(9),9); 799 BitBlock Ct_error = simd_andc(Ct_Cursor,lex.Hyphen); 800 Ct_Cursor = carry_set_0.BitBlock_advance_ci_co(carry_set_0.BitBlock_advance_ci_co(Ct_Cursor,carry_set_0.GetCarry(10),10),carry_set_0.GetCarry(11),11); 801 Ct_Cursor = carry_set_0.BitBlock_advance_ci_co(carry_set_0.BitBlock_scanthru_ci_co(Ct_Cursor,simd_andc(EOF_mask,DoubleHyphen),carry_set_0.GetCarry(12),12),carry_set_0.GetCarry(13),13); 802 if (bitblock::any(simd_or(Ct_error,simd_andc(Ct_Cursor,lex.RAngle)))) 803 { 804 assert_0_error("Error in comment syntax",simd_or(Ct_error,simd_andc(Ct_Cursor,lex.RAngle))); 805 } 806 ctCDPI_Callouts.Ct_ends = simd_or(ctCDPI_Callouts.Ct_ends,Ct_Cursor); 807 CtCDPI_ends = simd_or(CtCDPI_ends,Ct_Cursor); 808 } 809 else 810 { 811 carry_set_0.CarryDequeueEnqueue(9,5); 812 } 813 CtCDPI_Cursor = simd_or(simd_or(PI_Cursor,CD_Cursor),Ct_Cursor); 814 ctCDPI_mask = carry_set_0.BitBlock_inclusive_span(CtCDPI_starts,CtCDPI_ends,carry_set_0.GetCarry(14),14); 815 if (bitblock::any(simd_andc(ctCDPI_mask,EOF_mask))) 816 { 817 assert_0_error("Error in comment, CDATA or processing instruction syntax",simd_andc(ctCDPI_mask,EOF_mask)); 818 } 819 CtCDPI_Cursor = carry_set_0.BitBlock_scanthru_ci_co(CtCDPI_Cursor,simd_andc(EOF_mask,CtCDPI_opener),carry_set_0.GetCarry(15),15); 820 while (bitblock::any(simd_and(CtCDPI_Cursor,EOF_mask))) 821 { 822 CarryDeclare(carry_set_1,13,0); 823 CtCDPI_starts = simd_or(CtCDPI_starts,CtCDPI_Cursor); 824 BitBlock PI_Cursor = simd_and(CtCDPI_Cursor,PI_opener); 825 BitBlock CD_Ct_Cursor = carry_set_1.BitBlock_advance_ci_co(simd_andc(CtCDPI_Cursor,PI_Cursor),simd<1>::constant<0>(),0); 826 BitBlock CD_Cursor = simd_and(CD_Ct_Cursor,lex.LBracket); 827 BitBlock Ct_Cursor = simd_and(CD_Ct_Cursor,lex.Hyphen); 828 if (bitblock::any(PI_Cursor)) 829 { 830 ctCDPI_Callouts.PI_starts = simd_or(ctCDPI_Callouts.PI_starts,PI_Cursor); 831 PI_Cursor = carry_set_1.BitBlock_advance_ci_co(PI_Cursor,simd<1>::constant<0>(),1); 832 ctCDPI_Callouts.PI_name_starts = simd_or(ctCDPI_Callouts.PI_name_starts,PI_Cursor); 833 BitBlock PI_name_end = carry_set_1.BitBlock_scanthru_ci_co(PI_Cursor,lex.NameScan,simd<1>::constant<0>(),2); 834 BitBlock PI_error = simd_and(PI_Cursor,PI_name_end); 835 BitBlock PI_noWS = simd_andc(PI_name_end,lex.WS); 836 PI_error = simd_or(PI_error,simd_or(simd_andc(PI_noWS,lex.QMark),simd_andc(carry_set_1.BitBlock_advance_ci_co(PI_noWS,simd<1>::constant<0>(),3),PI_closer))); 837 if (bitblock::any(PI_error)) 838 { 839 assert_0_error("Error in PI syntax",PI_error); 840 } 841 ctCDPI_Callouts.PI_name_ends = simd_or(ctCDPI_Callouts.PI_name_ends,PI_name_end); 842 PI_Cursor = carry_set_1.BitBlock_scanthru_ci_co(PI_name_end,simd_andc(EOF_mask,PI_closer),simd<1>::constant<0>(),4); 843 ctCDPI_Callouts.PI_ends = simd_or(ctCDPI_Callouts.PI_ends,PI_Cursor); 844 CtCDPI_ends = simd_or(CtCDPI_ends,PI_Cursor); 845 } 846 if (bitblock::any(CD_Cursor)) 847 { 848 ctCDPI_Callouts.CD_starts = simd_or(ctCDPI_Callouts.CD_starts,CD_Cursor); 849 CD_Cursor = carry_set_1.BitBlock_scanthru_ci_co(CD_Cursor,simd_andc(EOF_mask,CD_closer),simd<1>::constant<0>(),5); 850 ctCDPI_Callouts.CD_ends = simd_or(ctCDPI_Callouts.CD_ends,CD_Cursor); 851 CtCDPI_ends = simd_or(CtCDPI_ends,CD_Cursor); 852 } 853 if (bitblock::any(Ct_Cursor)) 854 { 855 ctCDPI_Callouts.Ct_starts = simd_or(ctCDPI_Callouts.Ct_starts,Ct_Cursor); 856 Ct_Cursor = carry_set_1.BitBlock_advance_ci_co(Ct_Cursor,simd<1>::constant<0>(),6); 857 BitBlock Ct_error = simd_andc(Ct_Cursor,lex.Hyphen); 858 Ct_Cursor = carry_set_1.BitBlock_advance_ci_co(carry_set_1.BitBlock_advance_ci_co(Ct_Cursor,simd<1>::constant<0>(),7),simd<1>::constant<0>(),8); 859 Ct_Cursor = carry_set_1.BitBlock_advance_ci_co(carry_set_1.BitBlock_scanthru_ci_co(Ct_Cursor,simd_andc(EOF_mask,DoubleHyphen),simd<1>::constant<0>(),9),simd<1>::constant<0>(),10); 860 if (bitblock::any(simd_or(Ct_error,simd_andc(Ct_Cursor,lex.RAngle)))) 861 { 862 assert_0_error("Error in comment syntax",simd_or(Ct_error,simd_andc(Ct_Cursor,lex.RAngle))); 863 } 864 ctCDPI_Callouts.Ct_ends = simd_or(ctCDPI_Callouts.Ct_ends,Ct_Cursor); 865 CtCDPI_ends = simd_or(CtCDPI_ends,Ct_Cursor); 866 } 867 CtCDPI_Cursor = simd_or(simd_or(PI_Cursor,CD_Cursor),Ct_Cursor); 868 ctCDPI_mask = carry_set_1.BitBlock_inclusive_span(CtCDPI_starts,CtCDPI_ends,simd<1>::constant<0>(),11); 869 if (bitblock::any(simd_andc(ctCDPI_mask,EOF_mask))) 870 { 871 assert_0_error("Error in comment, CDATA or processing instruction syntax",simd_andc(ctCDPI_mask,EOF_mask)); 872 } 873 CtCDPI_Cursor = carry_set_1.BitBlock_scanthru_ci_co(CtCDPI_Cursor,simd_andc(EOF_mask,CtCDPI_opener),simd<1>::constant<0>(),12); 874 LocalCarryCombine(carry_set_0,carry_set_1,3,13); 875 } 876 } 877 else 878 { 879 carry_set_0.CarryDequeueEnqueue(3,13); 880 } 881 check_streams.misc_mask = simd_and(simd_or(simd_or(simd_or(lex.WS,lex.LAngle),carry_set_0.BitBlock_inclusive_span(simd_or(ctCDPI_Callouts.Ct_starts,ctCDPI_Callouts.PI_starts),simd_or(ctCDPI_Callouts.Ct_ends,ctCDPI_Callouts.PI_ends),carry_set_0.GetCarry(16),16)),CtCDPI_starts),EOF_mask); 882 marker.LAngle_scope = simd_andc(LAngle_scope,ctCDPI_mask); 883 marker.Ref_opener = simd_andc(lex.RefStart,ctCDPI_mask); 884 marker.CD_closer = simd_andc(CD_closer,ctCDPI_mask); 885 } 886 887 CarryDeclare(carry_set_0,17,2); 888 }; 889 890 struct Parse_tags 891 { 892 Parse_tags() 100 void do_final_block() 893 101 { 894 102 895 }896 897 IDISA_INLINE void do_block(struct Lex & lex,struct Marker & marker,struct Tag_Callouts & tag_Callouts)898 {899 BitBlock EqExpected = simd<1>::constant<0>();900 BitBlock AttListEnd = simd<1>::constant<0>();901 BitBlock DQuoteDelim = simd_or(lex.DQuote,lex.LAngle);902 BitBlock SQuoteDelim = simd_or(lex.SQuote,lex.LAngle);903 BitBlock AttListDelim = simd_or(lex.Slash,lex.RAngle);904 tag_Callouts.ElemName_starts = simd_andc(marker.LAngle_scope,lex.Slash);905 tag_Callouts.EndTag_marks = simd_and(marker.LAngle_scope,lex.Slash);906 tag_Callouts.ElemName_ends = carry_set_0.BitBlock_scanthru_ci_co(tag_Callouts.ElemName_starts,lex.NameScan,carry_set_0.GetCarry(0),0);907 BitBlock ParseError = simd_and(tag_Callouts.ElemName_starts,tag_Callouts.ElemName_ends);908 tag_Callouts.AttName_starts = simd<1>::constant<0>();909 tag_Callouts.AttName_ends = simd<1>::constant<0>();910 tag_Callouts.AttVal_starts = simd<1>::constant<0>();911 tag_Callouts.AttVal_ends = simd<1>::constant<0>();912 if (bitblock::any(simd_or(simd_and(tag_Callouts.ElemName_ends,lex.WS),carry_set_0.CarryRange(1,8))))913 {914 BitBlock AfterWS = carry_set_0.BitBlock_scanthru_ci_co(tag_Callouts.ElemName_ends,lex.WS,carry_set_0.GetCarry(1),1);915 AttListEnd = simd_and(AfterWS,AttListDelim);916 BitBlock AttNameStart = simd_andc(AfterWS,AttListDelim);917 if (bitblock::any(simd_or(AttNameStart,carry_set_0.CarryRange(2,7))))918 {919 ParseError = simd_or(ParseError,simd_andc(AttNameStart,lex.NameScan));920 tag_Callouts.AttName_starts = simd_or(tag_Callouts.AttName_starts,AttNameStart);921 BitBlock AttNameFollow = carry_set_0.BitBlock_scanthru_ci_co(AttNameStart,lex.NameScan,carry_set_0.GetCarry(2),2);922 tag_Callouts.AttName_ends = simd_or(tag_Callouts.AttName_ends,AttNameFollow);923 if (bitblock::any(simd_or(simd_and(AttNameFollow,lex.WS),carry_set_0.CarryRange(3,1))))924 {925 EqExpected = carry_set_0.BitBlock_scanthru_ci_co(AttNameFollow,lex.WS,carry_set_0.GetCarry(3),3);926 }927 else928 {929 EqExpected = AttNameFollow;930 carry_set_0.CarryDequeueEnqueue(3,1);931 }932 ParseError = simd_or(ParseError,simd_andc(EqExpected,lex.Equals));933 BitBlock AttValPos = carry_set_0.BitBlock_advance_then_scanthru(EqExpected,lex.WS,carry_set_0.GetCarry(4),4);934 tag_Callouts.AttVal_starts = simd_or(tag_Callouts.AttVal_starts,AttValPos);935 BitBlock DQuoteAttVal = simd_and(AttValPos,lex.DQuote);936 BitBlock SQuoteAttVal = simd_and(AttValPos,lex.SQuote);937 BitBlock DQuoteAttEnd = carry_set_0.BitBlock_advance_then_scanthru(DQuoteAttVal,simd_not(DQuoteDelim),carry_set_0.GetCarry(5),5);938 BitBlock SQuoteAttEnd = carry_set_0.BitBlock_advance_then_scanthru(SQuoteAttVal,simd_not(SQuoteDelim),carry_set_0.GetCarry(6),6);939 BitBlock AttValEnd = simd_or(DQuoteAttEnd,SQuoteAttEnd);940 ParseError = simd_or(ParseError,simd_andc(simd_or(AttValPos,AttValEnd),simd_or(lex.DQuote,lex.SQuote)));941 BitBlock AttValFollow = carry_set_0.BitBlock_advance_ci_co(AttValEnd,carry_set_0.GetCarry(7),7);942 tag_Callouts.AttVal_ends = simd_or(tag_Callouts.AttVal_ends,AttValFollow);943 if (bitblock::any(simd_or(simd_and(AttValFollow,lex.WS),carry_set_0.CarryRange(8,1))))944 {945 AfterWS = carry_set_0.BitBlock_scanthru_ci_co(AttValFollow,lex.WS,carry_set_0.GetCarry(8),8);946 AttListEnd = simd_or(AttListEnd,simd_and(AfterWS,AttListDelim));947 AttNameStart = simd_andc(AfterWS,AttListDelim);948 }949 else950 {951 AttListEnd = simd_or(AttListEnd,simd_and(AttValFollow,AttListDelim));952 AttNameStart = simd_andc(AttValFollow,AttListDelim);953 carry_set_0.CarryDequeueEnqueue(8,1);954 }955 ParseError = simd_or(ParseError,simd_and(AttValFollow,AttNameStart));956 while (bitblock::any(AttNameStart))957 {958 CarryDeclare(carry_set_1,7,0);959 ParseError = simd_or(ParseError,simd_andc(AttNameStart,lex.NameScan));960 tag_Callouts.AttName_starts = simd_or(tag_Callouts.AttName_starts,AttNameStart);961 BitBlock AttNameFollow = carry_set_1.BitBlock_scanthru_ci_co(AttNameStart,lex.NameScan,simd<1>::constant<0>(),0);962 tag_Callouts.AttName_ends = simd_or(tag_Callouts.AttName_ends,AttNameFollow);963 if (bitblock::any(simd_and(AttNameFollow,lex.WS)))964 {965 EqExpected = carry_set_1.BitBlock_scanthru_ci_co(AttNameFollow,lex.WS,simd<1>::constant<0>(),1);966 }967 else968 {969 EqExpected = AttNameFollow;970 }971 ParseError = simd_or(ParseError,simd_andc(EqExpected,lex.Equals));972 BitBlock AttValPos = carry_set_1.BitBlock_advance_then_scanthru(EqExpected,lex.WS,simd<1>::constant<0>(),2);973 tag_Callouts.AttVal_starts = simd_or(tag_Callouts.AttVal_starts,AttValPos);974 BitBlock DQuoteAttVal = simd_and(AttValPos,lex.DQuote);975 BitBlock SQuoteAttVal = simd_and(AttValPos,lex.SQuote);976 BitBlock DQuoteAttEnd = carry_set_1.BitBlock_advance_then_scanthru(DQuoteAttVal,simd_not(DQuoteDelim),simd<1>::constant<0>(),3);977 BitBlock SQuoteAttEnd = carry_set_1.BitBlock_advance_then_scanthru(SQuoteAttVal,simd_not(SQuoteDelim),simd<1>::constant<0>(),4);978 BitBlock AttValEnd = simd_or(DQuoteAttEnd,SQuoteAttEnd);979 ParseError = simd_or(ParseError,simd_andc(simd_or(AttValPos,AttValEnd),simd_or(lex.DQuote,lex.SQuote)));980 BitBlock AttValFollow = carry_set_1.BitBlock_advance_ci_co(AttValEnd,simd<1>::constant<0>(),5);981 tag_Callouts.AttVal_ends = simd_or(tag_Callouts.AttVal_ends,AttValFollow);982 if (bitblock::any(simd_and(AttValFollow,lex.WS)))983 {984 AfterWS = carry_set_1.BitBlock_scanthru_ci_co(AttValFollow,lex.WS,simd<1>::constant<0>(),6);985 AttListEnd = simd_or(AttListEnd,simd_and(AfterWS,AttListDelim));986 AttNameStart = simd_andc(AfterWS,AttListDelim);987 }988 else989 {990 AttListEnd = simd_or(AttListEnd,simd_and(AttValFollow,AttListDelim));991 AttNameStart = simd_andc(AttValFollow,AttListDelim);992 }993 ParseError = simd_or(ParseError,simd_and(AttValFollow,AttNameStart));994 LocalCarryCombine(carry_set_0,carry_set_1,2,7);995 }996 }997 else998 {999 carry_set_0.CarryDequeueEnqueue(2,7);1000 }1001 }1002 else1003 {1004 AttListEnd = simd_and(tag_Callouts.ElemName_ends,AttListDelim);1005 ParseError = simd_or(ParseError,simd_andc(tag_Callouts.ElemName_ends,AttListDelim));1006 carry_set_0.CarryDequeueEnqueue(1,8);1007 }1008 BitBlock STagEnds = simd_and(AttListEnd,lex.RAngle);1009 tag_Callouts.EmptyTag_marks = carry_set_0.BitBlock_advance_ci_co(simd_and(AttListEnd,lex.Slash),carry_set_0.GetCarry(9),9);1010 ParseError = simd_or(ParseError,simd_andc(tag_Callouts.EmptyTag_marks,lex.RAngle));1011 BitBlock EndTagEnds = carry_set_0.BitBlock_advance_then_scanthru(tag_Callouts.EndTag_marks,lex.NameScan,carry_set_0.GetCarry(10),10);1012 if (bitblock::any(simd_or(simd_and(EndTagEnds,lex.WS),carry_set_0.CarryRange(11,1))))1013 {1014 EndTagEnds = carry_set_0.BitBlock_scanthru_ci_co(EndTagEnds,lex.WS,carry_set_0.GetCarry(11),11);1015 }1016 else1017 {1018 carry_set_0.CarryDequeueEnqueue(11,1);1019 }1020 ParseError = simd_or(ParseError,simd_andc(EndTagEnds,lex.RAngle));1021 if (bitblock::any(ParseError))1022 {1023 assert_0_error("Tag parsing error found",ParseError);1024 }1025 tag_Callouts.AttVal_spans = carry_set_0.BitBlock_span_upto(tag_Callouts.AttVal_starts,tag_Callouts.AttVal_ends,carry_set_0.GetCarry(12),12);1026 carry_set_0.CarryAdjust(13);1027 }1028 1029 void do_final_block(struct Lex & lex,struct Marker & marker,struct Tag_Callouts & tag_Callouts,BitBlock & EOF_mask)1030 {1031 BitBlock EqExpected = simd<1>::constant<0>();1032 BitBlock AttListEnd = simd<1>::constant<0>();1033 BitBlock DQuoteDelim = simd_or(lex.DQuote,lex.LAngle);1034 BitBlock SQuoteDelim = simd_or(lex.SQuote,lex.LAngle);1035 BitBlock AttListDelim = simd_or(lex.Slash,lex.RAngle);1036 tag_Callouts.ElemName_starts = simd_andc(marker.LAngle_scope,lex.Slash);1037 tag_Callouts.EndTag_marks = simd_and(marker.LAngle_scope,lex.Slash);1038 tag_Callouts.ElemName_ends = carry_set_0.BitBlock_scanthru_ci_co(tag_Callouts.ElemName_starts,lex.NameScan,carry_set_0.GetCarry(0),0);1039 BitBlock ParseError = simd_and(tag_Callouts.ElemName_starts,tag_Callouts.ElemName_ends);1040 tag_Callouts.AttName_starts = simd<1>::constant<0>();1041 tag_Callouts.AttName_ends = simd<1>::constant<0>();1042 tag_Callouts.AttVal_starts = simd<1>::constant<0>();1043 tag_Callouts.AttVal_ends = simd<1>::constant<0>();1044 if (bitblock::any(simd_or(simd_and(tag_Callouts.ElemName_ends,lex.WS),carry_set_0.CarryRange(1,8))))1045 {1046 BitBlock AfterWS = carry_set_0.BitBlock_scanthru_ci_co(tag_Callouts.ElemName_ends,lex.WS,carry_set_0.GetCarry(1),1);1047 AttListEnd = simd_and(AfterWS,AttListDelim);1048 BitBlock AttNameStart = simd_andc(AfterWS,AttListDelim);1049 if (bitblock::any(simd_or(simd_and(AttNameStart,EOF_mask),carry_set_0.CarryRange(2,7))))1050 {1051 ParseError = simd_or(ParseError,simd_andc(AttNameStart,lex.NameScan));1052 tag_Callouts.AttName_starts = simd_or(tag_Callouts.AttName_starts,AttNameStart);1053 BitBlock AttNameFollow = carry_set_0.BitBlock_scanthru_ci_co(AttNameStart,lex.NameScan,carry_set_0.GetCarry(2),2);1054 tag_Callouts.AttName_ends = simd_or(tag_Callouts.AttName_ends,AttNameFollow);1055 if (bitblock::any(simd_or(simd_and(AttNameFollow,lex.WS),carry_set_0.CarryRange(3,1))))1056 {1057 EqExpected = carry_set_0.BitBlock_scanthru_ci_co(AttNameFollow,lex.WS,carry_set_0.GetCarry(3),3);1058 }1059 else1060 {1061 EqExpected = AttNameFollow;1062 carry_set_0.CarryDequeueEnqueue(3,1);1063 }1064 ParseError = simd_or(ParseError,simd_andc(EqExpected,lex.Equals));1065 BitBlock AttValPos = carry_set_0.BitBlock_advance_then_scanthru(EqExpected,lex.WS,carry_set_0.GetCarry(4),4);1066 tag_Callouts.AttVal_starts = simd_or(tag_Callouts.AttVal_starts,AttValPos);1067 BitBlock DQuoteAttVal = simd_and(AttValPos,lex.DQuote);1068 BitBlock SQuoteAttVal = simd_and(AttValPos,lex.SQuote);1069 BitBlock DQuoteAttEnd = carry_set_0.BitBlock_advance_then_scanthru(DQuoteAttVal,simd_andc(EOF_mask,DQuoteDelim),carry_set_0.GetCarry(5),5);1070 BitBlock SQuoteAttEnd = carry_set_0.BitBlock_advance_then_scanthru(SQuoteAttVal,simd_andc(EOF_mask,SQuoteDelim),carry_set_0.GetCarry(6),6);1071 BitBlock AttValEnd = simd_or(DQuoteAttEnd,SQuoteAttEnd);1072 ParseError = simd_or(ParseError,simd_andc(simd_or(AttValPos,AttValEnd),simd_or(lex.DQuote,lex.SQuote)));1073 BitBlock AttValFollow = carry_set_0.BitBlock_advance_ci_co(AttValEnd,carry_set_0.GetCarry(7),7);1074 tag_Callouts.AttVal_ends = simd_or(tag_Callouts.AttVal_ends,AttValFollow);1075 if (bitblock::any(simd_or(simd_and(AttValFollow,lex.WS),carry_set_0.CarryRange(8,1))))1076 {1077 AfterWS = carry_set_0.BitBlock_scanthru_ci_co(AttValFollow,lex.WS,carry_set_0.GetCarry(8),8);1078 AttListEnd = simd_or(AttListEnd,simd_and(AfterWS,AttListDelim));1079 AttNameStart = simd_andc(AfterWS,AttListDelim);1080 }1081 else1082 {1083 AttListEnd = simd_or(AttListEnd,simd_and(AttValFollow,AttListDelim));1084 AttNameStart = simd_andc(AttValFollow,AttListDelim);1085 carry_set_0.CarryDequeueEnqueue(8,1);1086 }1087 ParseError = simd_or(ParseError,simd_and(AttValFollow,AttNameStart));1088 while (bitblock::any(simd_and(AttNameStart,EOF_mask)))1089 {1090 CarryDeclare(carry_set_1,7,0);1091 ParseError = simd_or(ParseError,simd_andc(AttNameStart,lex.NameScan));1092 tag_Callouts.AttName_starts = simd_or(tag_Callouts.AttName_starts,AttNameStart);1093 BitBlock AttNameFollow = carry_set_1.BitBlock_scanthru_ci_co(AttNameStart,lex.NameScan,simd<1>::constant<0>(),0);1094 tag_Callouts.AttName_ends = simd_or(tag_Callouts.AttName_ends,AttNameFollow);1095 if (bitblock::any(simd_and(AttNameFollow,lex.WS)))1096 {1097 EqExpected = carry_set_1.BitBlock_scanthru_ci_co(AttNameFollow,lex.WS,simd<1>::constant<0>(),1);1098 }1099 else1100 {1101 EqExpected = AttNameFollow;1102 }1103 ParseError = simd_or(ParseError,simd_andc(EqExpected,lex.Equals));1104 BitBlock AttValPos = carry_set_1.BitBlock_advance_then_scanthru(EqExpected,lex.WS,simd<1>::constant<0>(),2);1105 tag_Callouts.AttVal_starts = simd_or(tag_Callouts.AttVal_starts,AttValPos);1106 BitBlock DQuoteAttVal = simd_and(AttValPos,lex.DQuote);1107 BitBlock SQuoteAttVal = simd_and(AttValPos,lex.SQuote);1108 BitBlock DQuoteAttEnd = carry_set_1.BitBlock_advance_then_scanthru(DQuoteAttVal,simd_andc(EOF_mask,DQuoteDelim),simd<1>::constant<0>(),3);1109 BitBlock SQuoteAttEnd = carry_set_1.BitBlock_advance_then_scanthru(SQuoteAttVal,simd_andc(EOF_mask,SQuoteDelim),simd<1>::constant<0>(),4);1110 BitBlock AttValEnd = simd_or(DQuoteAttEnd,SQuoteAttEnd);1111 ParseError = simd_or(ParseError,simd_andc(simd_or(AttValPos,AttValEnd),simd_or(lex.DQuote,lex.SQuote)));1112 BitBlock AttValFollow = carry_set_1.BitBlock_advance_ci_co(AttValEnd,simd<1>::constant<0>(),5);1113 tag_Callouts.AttVal_ends = simd_or(tag_Callouts.AttVal_ends,AttValFollow);1114 if (bitblock::any(simd_and(AttValFollow,lex.WS)))1115 {1116 AfterWS = carry_set_1.BitBlock_scanthru_ci_co(AttValFollow,lex.WS,simd<1>::constant<0>(),6);1117 AttListEnd = simd_or(AttListEnd,simd_and(AfterWS,AttListDelim));1118 AttNameStart = simd_andc(AfterWS,AttListDelim);1119 }1120 else1121 {1122 AttListEnd = simd_or(AttListEnd,simd_and(AttValFollow,AttListDelim));1123 AttNameStart = simd_andc(AttValFollow,AttListDelim);1124 }1125 ParseError = simd_or(ParseError,simd_and(AttValFollow,AttNameStart));1126 LocalCarryCombine(carry_set_0,carry_set_1,2,7);1127 }1128 }1129 else1130 {1131 carry_set_0.CarryDequeueEnqueue(2,7);1132 }1133 }1134 else1135 {1136 AttListEnd = simd_and(tag_Callouts.ElemName_ends,AttListDelim);1137 ParseError = simd_or(ParseError,simd_andc(tag_Callouts.ElemName_ends,AttListDelim));1138 carry_set_0.CarryDequeueEnqueue(1,8);1139 }1140 BitBlock STagEnds = simd_and(AttListEnd,lex.RAngle);1141 tag_Callouts.EmptyTag_marks = carry_set_0.BitBlock_advance_ci_co(simd_and(AttListEnd,lex.Slash),carry_set_0.GetCarry(9),9);1142 ParseError = simd_or(ParseError,simd_andc(tag_Callouts.EmptyTag_marks,lex.RAngle));1143 BitBlock EndTagEnds = carry_set_0.BitBlock_advance_then_scanthru(tag_Callouts.EndTag_marks,lex.NameScan,carry_set_0.GetCarry(10),10);1144 if (bitblock::any(simd_or(simd_and(EndTagEnds,lex.WS),carry_set_0.CarryRange(11,1))))1145 {1146 EndTagEnds = carry_set_0.BitBlock_scanthru_ci_co(EndTagEnds,lex.WS,carry_set_0.GetCarry(11),11);1147 }1148 else1149 {1150 carry_set_0.CarryDequeueEnqueue(11,1);1151 }1152 ParseError = simd_or(ParseError,simd_andc(EndTagEnds,lex.RAngle));1153 if (bitblock::any(ParseError))1154 {1155 assert_0_error("Tag parsing error found",ParseError);1156 }1157 tag_Callouts.AttVal_spans = carry_set_0.BitBlock_span_upto(tag_Callouts.AttVal_starts,tag_Callouts.AttVal_ends,carry_set_0.GetCarry(12),12);1158 }1159 1160 CarryDeclare(carry_set_0,13,0);1161 };1162 1163 struct Parse_refs1164 {1165 Parse_refs()1166 {1167 1168 }1169 1170 IDISA_INLINE void do_block(struct Lex & lex,struct Marker & marker,struct Ref_Callouts & ref_Callouts)1171 {1172 ref_Callouts.GenRef_starts = simd<1>::constant<0>();1173 ref_Callouts.GenRef_ends = simd<1>::constant<0>();1174 ref_Callouts.DecRef_starts = simd<1>::constant<0>();1175 ref_Callouts.DecRef_ends = simd<1>::constant<0>();1176 ref_Callouts.HexRef_starts = simd<1>::constant<0>();1177 ref_Callouts.HexRef_ends = simd<1>::constant<0>();1178 BitBlock ref_error = simd<1>::constant<0>();1179 if (bitblock::any(simd_or(marker.Ref_opener,carry_set_0.CarryRange(0,6))))1180 {1181 BitBlock Ref_scope = carry_set_0.BitBlock_advance_ci_co(marker.Ref_opener,carry_set_0.GetCarry(0),0);1182 BitBlock NumRef2 = simd_and(Ref_scope,lex.Hash);1183 ref_Callouts.GenRef_starts = simd_andc(Ref_scope,lex.Hash);1184 BitBlock NumRef3 = carry_set_0.BitBlock_advance_ci_co(NumRef2,carry_set_0.GetCarry(1),1);1185 BitBlock HexRef3 = simd_and(NumRef3,lex.x);1186 ref_Callouts.DecRef_starts = simd_andc(NumRef3,lex.x);1187 ref_Callouts.HexRef_starts = carry_set_0.BitBlock_advance_ci_co(HexRef3,carry_set_0.GetCarry(2),2);1188 ref_Callouts.GenRef_ends = carry_set_0.BitBlock_scanthru_ci_co(ref_Callouts.GenRef_starts,lex.NameScan,carry_set_0.GetCarry(3),3);1189 ref_Callouts.DecRef_ends = carry_set_0.BitBlock_scanthru_ci_co(ref_Callouts.DecRef_starts,lex.Digit,carry_set_0.GetCarry(4),4);1190 ref_Callouts.HexRef_ends = carry_set_0.BitBlock_scanthru_ci_co(ref_Callouts.HexRef_starts,lex.Hex,carry_set_0.GetCarry(5),5);1191 BitBlock ref_error1 = simd_andc(ref_Callouts.DecRef_starts,lex.Digit);1192 BitBlock ref_error2 = simd_andc(ref_Callouts.HexRef_starts,lex.Hex);1193 BitBlock ref_ends = simd_or(simd_or(ref_Callouts.GenRef_ends,ref_Callouts.DecRef_ends),ref_Callouts.HexRef_ends);1194 BitBlock ref_error3 = simd_andc(ref_ends,lex.Semicolon);1195 if (bitblock::any(simd_or(simd_or(ref_error1,ref_error2),ref_error3)))1196 {1197 assert_0_error("Reference error found",simd_or(simd_or(ref_error1,ref_error2),ref_error3));1198 }1199 }1200 else1201 {1202 carry_set_0.CarryDequeueEnqueue(0,6);1203 }1204 carry_set_0.CarryAdjust(6);1205 }1206 1207 void do_final_block(struct Lex & lex,struct Marker & marker,struct Ref_Callouts & ref_Callouts,BitBlock & EOF_mask)1208 {1209 ref_Callouts.GenRef_starts = simd<1>::constant<0>();1210 ref_Callouts.GenRef_ends = simd<1>::constant<0>();1211 ref_Callouts.DecRef_starts = simd<1>::constant<0>();1212 ref_Callouts.DecRef_ends = simd<1>::constant<0>();1213 ref_Callouts.HexRef_starts = simd<1>::constant<0>();1214 ref_Callouts.HexRef_ends = simd<1>::constant<0>();1215 BitBlock ref_error = simd<1>::constant<0>();1216 if (bitblock::any(simd_or(marker.Ref_opener,carry_set_0.CarryRange(0,6))))1217 {1218 BitBlock Ref_scope = carry_set_0.BitBlock_advance_ci_co(marker.Ref_opener,carry_set_0.GetCarry(0),0);1219 BitBlock NumRef2 = simd_and(Ref_scope,lex.Hash);1220 ref_Callouts.GenRef_starts = simd_andc(Ref_scope,lex.Hash);1221 BitBlock NumRef3 = carry_set_0.BitBlock_advance_ci_co(NumRef2,carry_set_0.GetCarry(1),1);1222 BitBlock HexRef3 = simd_and(NumRef3,lex.x);1223 ref_Callouts.DecRef_starts = simd_andc(NumRef3,lex.x);1224 ref_Callouts.HexRef_starts = carry_set_0.BitBlock_advance_ci_co(HexRef3,carry_set_0.GetCarry(2),2);1225 ref_Callouts.GenRef_ends = carry_set_0.BitBlock_scanthru_ci_co(ref_Callouts.GenRef_starts,lex.NameScan,carry_set_0.GetCarry(3),3);1226 ref_Callouts.DecRef_ends = carry_set_0.BitBlock_scanthru_ci_co(ref_Callouts.DecRef_starts,lex.Digit,carry_set_0.GetCarry(4),4);1227 ref_Callouts.HexRef_ends = carry_set_0.BitBlock_scanthru_ci_co(ref_Callouts.HexRef_starts,lex.Hex,carry_set_0.GetCarry(5),5);1228 BitBlock ref_error1 = simd_andc(ref_Callouts.DecRef_starts,lex.Digit);1229 BitBlock ref_error2 = simd_andc(ref_Callouts.HexRef_starts,lex.Hex);1230 BitBlock ref_ends = simd_or(simd_or(ref_Callouts.GenRef_ends,ref_Callouts.DecRef_ends),ref_Callouts.HexRef_ends);1231 BitBlock ref_error3 = simd_andc(ref_ends,lex.Semicolon);1232 if (bitblock::any(simd_or(simd_or(ref_error1,ref_error2),ref_error3)))1233 {1234 assert_0_error("Reference error found",simd_or(simd_or(ref_error1,ref_error2),ref_error3));1235 }1236 }1237 else1238 {1239 carry_set_0.CarryDequeueEnqueue(0,6);1240 }1241 }1242 1243 CarryDeclare(carry_set_0,6,0);1244 };1245 1246 struct Validate_xml_names1247 {1248 Validate_xml_names()1249 {1250 1251 }1252 1253 IDISA_INLINE void do_block(struct CtCDPI_Callouts & ctCDPI_Callouts,struct Ref_Callouts & ref_Callouts,struct Tag_Callouts & tag_Callouts,struct Lex & lex,struct U8 & u8,struct Check_streams & check_streams)1254 {1255 BitBlock PI_names = carry_set_0.BitBlock_span_upto(ctCDPI_Callouts.PI_name_starts,ctCDPI_Callouts.PI_name_ends,carry_set_0.GetCarry(0),0);1256 BitBlock GenRefs = carry_set_0.BitBlock_span_upto(ref_Callouts.GenRef_starts,ref_Callouts.GenRef_ends,carry_set_0.GetCarry(1),1);1257 BitBlock ElemNames = carry_set_0.BitBlock_span_upto(tag_Callouts.ElemName_starts,tag_Callouts.ElemName_ends,carry_set_0.GetCarry(2),2);1258 BitBlock AttNames = carry_set_0.BitBlock_span_upto(tag_Callouts.AttName_starts,tag_Callouts.AttName_ends,carry_set_0.GetCarry(3),3);1259 BitBlock qname_stream = simd_or(ElemNames,AttNames);1260 BitBlock ncname_stream = simd_or(PI_names,GenRefs);1261 BitBlock name_stream = simd_or(qname_stream,ncname_stream);1262 BitBlock name_start = simd_andc(name_stream,carry_set_0.BitBlock_advance_ci_co(name_stream,carry_set_0.GetCarry(4),4));1263 BitBlock name_cursor = simd_andc(name_stream,carry_set_0.BitBlock_advance_ci_co(name_stream,carry_set_0.GetCarry(5),5));1264 BitBlock void_prefix_err = simd_and(name_cursor,lex.Colon);1265 BitBlock namespace_sep = simd_and(carry_set_0.BitBlock_scanthru_ci_co(name_cursor,simd_andc(lex.NameScan,lex.Colon),carry_set_0.GetCarry(6),6),lex.Colon);1266 BitBlock local_part_start = carry_set_0.BitBlock_advance_ci_co(namespace_sep,carry_set_0.GetCarry(7),7);1267 BitBlock local_part_err = simd_andc(local_part_start,lex.NameScan);1268 BitBlock colon2_err = simd_and(carry_set_0.BitBlock_scanthru_ci_co(local_part_start,simd_andc(lex.NameScan,lex.Colon),carry_set_0.GetCarry(8),8),lex.Colon);1269 BitBlock ncname_err = simd_and(ncname_stream,lex.Colon);1270 if (bitblock::any(simd_or(simd_or(simd_or(void_prefix_err,local_part_err),colon2_err),ncname_err)))1271 {1272 assert_0_error("name syntax error",simd_or(simd_or(simd_or(void_prefix_err,local_part_err),colon2_err),ncname_err));1273 }1274 check_streams.non_ascii_name_starts = simd_andc(name_start,lex.ASCII_name_start);1275 check_streams.non_ascii_names = simd_andc(simd_andc(simd_andc(name_stream,name_start),lex.ASCII_name_char),u8.suffix);1276 carry_set_0.CarryAdjust(9);1277 }1278 1279 void do_final_block(struct CtCDPI_Callouts & ctCDPI_Callouts,struct Ref_Callouts & ref_Callouts,struct Tag_Callouts & tag_Callouts,struct Lex & lex,struct U8 & u8,struct Check_streams & check_streams,BitBlock & EOF_mask)1280 {1281 BitBlock PI_names = carry_set_0.BitBlock_span_upto(ctCDPI_Callouts.PI_name_starts,ctCDPI_Callouts.PI_name_ends,carry_set_0.GetCarry(0),0);1282 BitBlock GenRefs = carry_set_0.BitBlock_span_upto(ref_Callouts.GenRef_starts,ref_Callouts.GenRef_ends,carry_set_0.GetCarry(1),1);1283 BitBlock ElemNames = carry_set_0.BitBlock_span_upto(tag_Callouts.ElemName_starts,tag_Callouts.ElemName_ends,carry_set_0.GetCarry(2),2);1284 BitBlock AttNames = carry_set_0.BitBlock_span_upto(tag_Callouts.AttName_starts,tag_Callouts.AttName_ends,carry_set_0.GetCarry(3),3);1285 BitBlock qname_stream = simd_or(ElemNames,AttNames);1286 BitBlock ncname_stream = simd_or(PI_names,GenRefs);1287 BitBlock name_stream = simd_or(qname_stream,ncname_stream);1288 BitBlock name_start = simd_andc(name_stream,carry_set_0.BitBlock_advance_ci_co(name_stream,carry_set_0.GetCarry(4),4));1289 BitBlock name_cursor = simd_andc(name_stream,carry_set_0.BitBlock_advance_ci_co(name_stream,carry_set_0.GetCarry(5),5));1290 BitBlock void_prefix_err = simd_and(name_cursor,lex.Colon);1291 BitBlock namespace_sep = simd_and(carry_set_0.BitBlock_scanthru_ci_co(name_cursor,simd_andc(lex.NameScan,lex.Colon),carry_set_0.GetCarry(6),6),lex.Colon);1292 BitBlock local_part_start = carry_set_0.BitBlock_advance_ci_co(namespace_sep,carry_set_0.GetCarry(7),7);1293 BitBlock local_part_err = simd_andc(local_part_start,lex.NameScan);1294 BitBlock colon2_err = simd_and(carry_set_0.BitBlock_scanthru_ci_co(local_part_start,simd_andc(lex.NameScan,lex.Colon),carry_set_0.GetCarry(8),8),lex.Colon);1295 BitBlock ncname_err = simd_and(ncname_stream,lex.Colon);1296 if (bitblock::any(simd_or(simd_or(simd_or(void_prefix_err,local_part_err),colon2_err),ncname_err)))1297 {1298 assert_0_error("name syntax error",simd_or(simd_or(simd_or(void_prefix_err,local_part_err),colon2_err),ncname_err));1299 }1300 check_streams.non_ascii_name_starts = simd_andc(name_start,lex.ASCII_name_start);1301 check_streams.non_ascii_names = simd_andc(simd_andc(simd_andc(name_stream,name_start),lex.ASCII_name_char),u8.suffix);1302 }1303 1304 CarryDeclare(carry_set_0,9,0);1305 };1306 1307 struct Do_check_streams1308 {1309 Do_check_streams()1310 {1311 1312 }1313 1314 IDISA_INLINE void do_block(struct Marker & marker,struct Tag_Callouts & tag_Callouts,struct Check_streams & check_streams)1315 {1316 if (bitblock::any(simd_andc(marker.CD_closer,tag_Callouts.AttVal_spans)))1317 {1318 assert_0_error("Error: ]]> in text",simd_andc(marker.CD_closer,tag_Callouts.AttVal_spans));1319 }1320 check_streams.tag_marks = simd_or(simd_or(simd_or(tag_Callouts.EmptyTag_marks,tag_Callouts.ElemName_starts),tag_Callouts.EndTag_marks),tag_Callouts.AttName_starts);1321 check_streams.name_follows = simd_or(tag_Callouts.ElemName_ends,tag_Callouts.AttName_ends);1322 check_streams.att_refs = simd_and(tag_Callouts.AttVal_spans,marker.Ref_opener);1323 }1324 1325 void do_final_block(struct Marker & marker,struct Tag_Callouts & tag_Callouts,struct Check_streams & check_streams,BitBlock & EOF_mask)1326 {1327 if (bitblock::any(simd_andc(marker.CD_closer,tag_Callouts.AttVal_spans)))1328 {1329 assert_0_error("Error: ]]> in text",simd_andc(marker.CD_closer,tag_Callouts.AttVal_spans));1330 }1331 check_streams.tag_marks = simd_or(simd_or(simd_or(tag_Callouts.EmptyTag_marks,tag_Callouts.ElemName_starts),tag_Callouts.EndTag_marks),tag_Callouts.AttName_starts);1332 check_streams.name_follows = simd_or(tag_Callouts.ElemName_ends,tag_Callouts.AttName_ends);1333 check_streams.att_refs = simd_and(tag_Callouts.AttVal_spans,marker.Ref_opener);1334 103 } 1335 104
Note: See TracChangeset
for help on using the changeset viewer.