Changeset 766
 Timestamp:
 Dec 2, 2010, 1:44:34 PM (8 years ago)
 Location:
 proto
 Files:

 1 added
 1 deleted
 5 edited
Legend:
 Unmodified
 Added
 Removed

proto/Compiler/workspace/template.c
r751 r766 77 77 78 78 if (bitblock_has_bit(error_mask)){ 79 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) ;79 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) + 1; 80 80 fprintf(stderr, "Error at position %i.\n", err_pos); 81 81 exit(1); … … 108 108 109 109 if(bitblock_has_bit(error_mask)) { 110 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) ;110 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) + 1; 111 111 fprintf(stderr, "Error at position %i.\n", err_pos); 112 112 exit(1); 
proto/JSON/json_compilable.py
r755 r766 13 13 14 14 def main(u8data): 15 # Transpose to parallel bit streams and prepare an EOF mask.15 ### Transpose to parallel bit streams and prepare an EOF mask. 16 16 (bit, EOF_mask) = bitutil.transpose_streams(u8data) 17 17 18 # Classify bytes for UTF8 processing, whitespace control processing, and JSON lexical analysis.18 ### Classify bytes for UTF8 processing, whitespace control processing, and JSON lexical analysis. 19 19 u8.unibyte = (~bit[0]); 20 20 u8.prefix = (bit[0] & bit[1]); … … 158 158 Lex.Null = (temp89  Lex.l); 159 159 160 # Start parse_escape  manual inline 160 ### Start parse_escape 161 # 161 162 # Odd = simd_const_2(1) 162 163 # Even = simd_const_2(2) … … 173 174 Escape = (EvenEscape  OddEscape) 174 175 UnescapedDQuotes = (Lex.DQuote &~ Escape) 175 176 # End parse_escape  manual inline 177 178 # parallel_prefix_mask()  we currently manually insert this method into the JSON template.c 179 180 # Start Generate String Mask  176 # 177 ### End parse_escape 178 179 ### parallel_prefix_mask()  we currently manually insert this method into the JSON template.c 180 181 ### Start Generate String Mask  182 # 181 183 StringMask = ParityMask & bitutil.Advance(ParityMask) 182 # End Generate String Mask  183 184 # Start atom_starts  manual inline 184 # 185 ### End Generate String Mask  186 187 ### Start atom_starts 188 # 185 189 StringSpans = StringMask  UnescapedDQuotes 186 190 … … 193 197 FalseStarts = AtomStarts & (Lex.f) 194 198 NullStarts = AtomStarts & (Lex.n) 195 # End atom_starts  manual inline 196 197 # Start validate_string  manual inline 199 # 200 ### End atom_starts 201 202 ### Start validate_string 203 # 198 204 # (1) Validate escape characters 199 StringEscapeChars = Escape Chars& StringMask205 StringEscapeChars = Escape & StringMask 200 206 StringErrors = (StringEscapeChars &~ Lex.Escape) 201 207 … … 216 222 # (2.2) '\' are either correctly escaped or the character following an odd length run is escaped. 217 223 218 StringNotEscapedChars = (~(Escape Chars  Lex.RSolidus)) & StringMask # TODO  Verify logic.224 StringNotEscapedChars = (~(Escape  Lex.RSolidus)) & StringMask 219 225 StringErrors = (StringNotEscapedChars & Ctrl.x00_x1F) 220 226 … … 223 229 StringEnds = bitutil.ScanThru(StringCursor, StringMask) 224 230 StringErrors = StringEnds &~ UnescapedDQuotes 225 StringSpans = (StringEnds  StringStarts)  StringEnds 226 227 # End validate_string  manual inline 228 231 # 232 ### End validate_string 233 234 ### Start validate_number 235 # 236 M0 = NumberStarts # Initialize marker stream 237 238 M1 = bitutil.ScanThru(M0, Lex.Minus & M0) # ? Optional character class [] 239 E1 = M1 &~(Lex.ZeroLex.Digit1_9) 240 M1 = M1 &~ E1 # Remove cursors at error positions so as to report a single error position 241 242 M1a = M1 & Lex.Zero # Split 243 M1b = M1 & Lex.Digit1_9 244 M2a = bitutil.Advance(M1a) 245 M2b = bitutil.Advance(M1b) 246 M3b = bitutil.ScanThru(M2b,Lex.Digit0_9) 247 M4 = M2a  M3b # Join 248 249 M4a = M4 &~(Lex.DecimalPoint) # Split 250 M4b = M4 & (Lex.DecimalPoint) 251 M5b = bitutil.Advance(M4b) 252 E5b = M5b &~(Lex.Digit0_9) # + [09]+ 253 M5b = M5b &~E5b # Remove cursors at error positions so as to report a single error position 254 255 M6 = bitutil.ScanThru(M5b,Lex.Digit0_9) 256 M7 = M4a  M6 # Join 257 258 M7a = M7 &~(Lex.Ee) # Split 259 M7b = M7 &(Lex.Ee) 260 M8b = bitutil.Advance(M7b) 261 M9b = bitutil.ScanThru(M8b, Lex.PlusMinus & M8b) # ? Optional character class [+] 262 E9b = M9b &~(Lex.Digit0_9) # + [09]+ 263 M9b = M9b &~ E9b # Remove cursors at error positions so as to report a single error position 264 M10b = bitutil.ScanThru(M9b,Lex.Digit0_9) 265 266 M11 = M7a  M10b 267 268 NumberErrors = E1  E5b  E9b 269 # 270 ### End validate_number 271 272 ### Start validate_true 273 # 274 Scope1 = bitutil.Advance(TrueStarts) 275 Scope2 = bitutil.Advance(Scope1) 276 Scope3 = bitutil.Advance(Scope2) 277 278 TrueErrors = Scope1 &~ Lex.r 279 TrueErrors = Scope2 &~ Lex.u 280 TrueErrors = Scope3 &~ Lex.e 281 282 Follows = bitutil.Advance(Scope3) 283 TrueSpans = Follows  TrueStarts 284 # 285 ### End validate_true 286 287 ### Start validate_false 288 # 289 Scope1 = bitutil.Advance(FalseStarts) 290 Scope2 = bitutil.Advance(Scope1) 291 Scope3 = bitutil.Advance(Scope2) 292 Scope4 = bitutil.Advance(Scope3) 293 294 FalseErrors = Scope1 &~ Lex.a 295 FalseErrors = Scope2 &~ Lex.l 296 FalseErrors = Scope3 &~ Lex.s 297 FalseErrors = Scope4 &~ Lex.e 298 299 Follows = bitutil.Advance(Scope4) 300 FalseSpans = Follows  FalseStarts 301 # 302 ### End validate_false 303 304 ### Start validate_null 305 # 306 Scope1 = bitutil.Advance(NullStarts) 307 Scope2 = bitutil.Advance(Scope1) 308 Scope3 = bitutil.Advance(Scope2) 309 310 NullErrors = Scope1 &~ Lex.u 311 NullErrors = Scope2 &~ Lex.l 312 NullErrors = Scope3 &~ Lex.l 313 314 Follows = bitutil.Advance(Scope3) 315 NullSpans = Follows  NullStarts 316 # 317 ### End validate_null 318 319 # AtomSpans & AtomsStarts serve as the basic interface to ANTLR 320 AtomsSpans = StringSpans  NumberSpans  TrueSpans  FalseSpans  NullSpans 321 229 322 # Consolidate errors 230 error_mask = StringErrors 323 error_mask = StringErrors  NumberErrors  TrueErrors  FalseErrors  NullErrors 231 324 232 325 return (u8,Lex,Ctrl,EOF_mask) 
proto/JSON/json_prototype.py
r755 r766 203 203 204 204 205 def validate_true( Starts, Lex):205 def validate_true(TrueStarts, Lex): 206 206 r""" 207 207 RFC 4627  JavaScript Object Notation (JSON) … … 209 209 true = %x74.72.75.65 ; true 210 210 211 """ 212 Errors = 0 213 214 Scope1 = bitutil.Advance(Starts) 211 """ 212 Scope1 = bitutil.Advance(TrueStarts) 215 213 Scope2 = bitutil.Advance(Scope1) 216 214 Scope3 = bitutil.Advance(Scope2) 217 215 218 Errors = Scope1 &~ Lex.r219 Errors = Scope2 &~ Lex.u220 Errors = Scope3 &~ Lex.e216 TrueErrors = Scope1 &~ Lex.r 217 TrueErrors = Scope2 &~ Lex.u 218 TrueErrors = Scope3 &~ Lex.e 221 219 222 220 Follows = bitutil.Advance(Scope3) 223 Spans = Follows Starts224 225 return ( Errors,Spans)226 227 def validate_false( Starts, Lex):221 TrueSpans = Follows  TrueStarts 222 223 return (TrueErrors, TrueSpans) 224 225 def validate_false(FalseStarts, Lex): 228 226 r""" 229 227 RFC 4627  JavaScript Object Notation (JSON) … … 231 229 false = %x66.61.6c.73.65 ; false 232 230 233 """ 234 Errors = 0 235 236 Scope1 = bitutil.Advance(Starts) 231 """ 232 Scope1 = bitutil.Advance(FalseStarts) 237 233 Scope2 = bitutil.Advance(Scope1) 238 234 Scope3 = bitutil.Advance(Scope2) 239 235 Scope4 = bitutil.Advance(Scope3) 240 236 241 Errors = Scope1 &~ Lex.a242 Errors = Scope2 &~ Lex.l243 Errors = Scope3 &~ Lex.s244 Errors = Scope4 &~ Lex.e237 FalseErrors = Scope1 &~ Lex.a 238 FalseErrors = Scope2 &~ Lex.l 239 FalseErrors = Scope3 &~ Lex.s 240 FalseErrors = Scope4 &~ Lex.e 245 241 246 242 Follows = bitutil.Advance(Scope4) 247 Spans = Follows Starts248 249 return ( Errors,Spans)250 251 def validate_null( Starts, Lex):243 FalseSpans = Follows  FalseStarts 244 245 return (FalseErrors, FalseSpans) 246 247 def validate_null(NullStarts, Lex): 252 248 r""" 253 249 RFC 4627  JavaScript Object Notation (JSON) … … 256 252 257 253 """ 258 Errors = 0 259 260 Scope1 = bitutil.Advance(Starts) 254 Scope1 = bitutil.Advance(NullStarts) 261 255 Scope2 = bitutil.Advance(Scope1) 262 256 Scope3 = bitutil.Advance(Scope2) 263 257 264 Errors = Scope1 &~ Lex.u265 Errors = Scope2 &~ Lex.l266 Errors = Scope3 &~ Lex.l258 NullErrors = Scope1 &~ Lex.u 259 NullErrors = Scope2 &~ Lex.l 260 NullErrors = Scope3 &~ Lex.l 267 261 268 262 Follows = bitutil.Advance(Scope3) 269 Spans = Follows Starts270 271 return ( Errors,Spans)272 273 def validate_number( Starts, Lex, EOF_mask):263 NullSpans = Follows  NullStarts 264 265 return (NullErrors, NullSpans) 266 267 def validate_number(NumberStarts, Lex, EOF_mask): 274 268 r""" 275 269 RFC 4627  JavaScript Object Notation (JSON) … … 292 286 global lgth 293 287 294 Errors = 0 295 M0 = Starts # Initialize marker stream 288 M0 = NumberStarts # Initialize marker stream 296 289 297 290 M1 = bitutil.ScanThru(M0, Lex.Minus & M0) # ? Optional character class [] … … 325 318 M11 = M7a  M10b 326 319 327 Errors = E1  E5b  E9b320 NumberErrors = E1  E5b  E9b 328 321 329 322 NumberSpans = M11  M0 … … 354 347 #('E10b', bitutil.bitstream2string(E10b, lgth)), 355 348 ('M11', bitutil.bitstream2string(M11, lgth+1)), 356 (' Starts', bitutil.bitstream2string(Starts, lgth)),349 ('NumberStarts', bitutil.bitstream2string(NumberStarts, lgth)), 357 350 ('NumberSpans', bitutil.bitstream2string(NumberSpans, lgth)), 358 (' Errors', bitutil.bitstream2string(Errors, lgth+1))])359 360 return ( Errors, NumberSpans)351 ('NumberErrors', bitutil.bitstream2string(NumberErrors, lgth+1))]) 352 353 return (NumberErrors, NumberSpans) 361 354 362 355 def demo_validate_number(u8data): … … 372 365 PlusMinus : _1_11_1_____1___1___1____1_______1_______1______1_____1____________ 373 366 NumberSpans : _11_11_11___11__1111_1111_1111___11111111__11111__1111__1__________ 374 Errors: __1_1__1___________1___1____1_______________________________________367 NumberErrors: __1_1__1___________1___1____1_______________________________________ 375 368 EOF_Mask : 1111111111111111111111111111111111111111111111111111111111111111111_ 376 369 <BLANKLINE> … … 386 379 PlusMinus : _________________________________1_________1_____1______________1________________________1_______________1__________________ 387 380 NumberSpans : _111_1111_11111_1111_111_11111_1111_1111_11111_11111_1111111111_111111111111_111111111111111_111111111111111_11111111111111_ 388 Errors: _____________________________________________________________________________________________________________________________381 NumberErrors: _____________________________________________________________________________________________________________________________ 389 382 EOF_Mask : 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111_ 390 383 <BLANKLINE> … … 400 393 PlusMinus : ___________________1__1___ 401 394 NumberSpans : _1______11111_1_1__11_11__ 402 Errors: ___________________________395 NumberErrors: ___________________________ 403 396 EOF_Mask : 11111111111111111111111111_ 404 397 <BLANKLINE> … … 419 412 (StringStarts, NumberStarts, TrueStarts, FalseStarts, NullStarts) = atom_starts(Lex, StringSpans) 420 413 421 ( Errors, NumberSpans) = validate_number(NumberStarts, Lex, EOF_mask)414 (NumberErrors, NumberSpans) = validate_number(NumberStarts, Lex, EOF_mask) 422 415 423 416 bitutil.print_aligned_streams([('Input Data', u8data), … … 430 423 ('PlusMinus', bitutil.bitstream2string(Lex.PlusMinus, lgth)), 431 424 ('NumberSpans', bitutil.bitstream2string(NumberSpans, lgth)), 432 (' Errors', bitutil.bitstream2string(Errors, lgth+1)),425 ('NumberErrors', bitutil.bitstream2string(NumberErrors, lgth+1)), 433 426 ('EOF_Mask', bitutil.bitstream2string(EOF_mask, lgth+1))]) 434 427 … … 595 588 NullStarts, NullSpans, NullErrors) = validate_json_atoms(u8data) 596 589 590 AtomSpans = (StringSpansNumberSpansTrueSpansFalseSpansNullSpans) 591 597 592 bitutil.print_aligned_streams([('Input Data', u8data), 598 593 ('StringStarts', bitutil.bitstream2string(StringStarts, lgth)), … … 610 605 ('NullStarts', bitutil.bitstream2string(NullStarts, lgth)), 611 606 ('NullSpans', bitutil.bitstream2string(NullSpans, lgth)), 612 ('NullErrors', bitutil.bitstream2string(NullErrors, lgth))]) 607 ('NullErrors', bitutil.bitstream2string(NullErrors, lgth)), 608 ('AtomSpans', bitutil.bitstream2string(AtomSpans, lgth))]) 613 609 614 610 return … … 628 624 # demo_atom_starts(u8data) 629 625 # demo_validate_number(u8data) 630 demo_validate_string(u8data)631 #demo_validate_json_atoms(u8data)626 # demo_validate_string(u8data) 627 demo_validate_json_atoms(u8data) 
proto/JSON/src/json.c
r755 r766 39 39 BitBlock temp41; 40 40 BitBlock strct_Lex__RSquareBracket_; 41 BitBlock strct_Lex__Ee_;41 BitBlock temp43; 42 42 BitBlock temp44; 43 43 BitBlock temp45; … … 47 47 BitBlock temp49; 48 48 BitBlock temp42; 49 BitBlock StringErrors_1; 50 BitBlock strct_u8__xF4_; 51 BitBlock StringErrors_3; 52 BitBlock temp43; 53 BitBlock StringErrors_5; 54 BitBlock StringErrors_4; 55 BitBlock strct_Lex__True_; 49 BitBlock FalseErrors_1; 50 BitBlock M4b; 51 BitBlock M4a; 52 BitBlock TrueSpans; 56 53 BitBlock strct_Lex__DecimalPoint_; 57 54 BitBlock strct_Lex__Null_; 58 BitBlock temp10;59 55 BitBlock array_bit__2_; 60 56 BitBlock strct_u8__suffix_; 61 BitBlock StringSpans_6; 57 BitBlock Scope3; 58 BitBlock strct_Lex__n_; 59 BitBlock EvenEscape; 60 BitBlock StringEscapeChars; 61 BitBlock OddFinal; 62 BitBlock Temp40; 63 BitBlock Temp41; 64 BitBlock Temp42; 65 BitBlock strct_u8__unibyte_; 66 BitBlock temp81; 67 BitBlock NullSpans; 68 BitBlock strct_u8__xED_; 69 BitBlock temp28; 70 BitBlock temp29; 71 BitBlock temp22; 72 BitBlock temp23; 73 BitBlock temp20; 74 BitBlock temp21; 75 BitBlock temp26; 76 BitBlock temp27; 77 BitBlock temp24; 78 BitBlock temp25; 79 BitBlock M4; 80 BitBlock M7; 81 BitBlock M6; 82 BitBlock M1; 83 BitBlock M0; 84 BitBlock strct_Lex__a_; 85 BitBlock M2b; 86 BitBlock strct_u8__x80_x8F_; 87 BitBlock TrueErrors_5; 88 BitBlock AtomSpans; 89 BitBlock array_bit__0_; 90 BitBlock strct_Lex__Minus_; 91 BitBlock strct_u8__prefix4_; 92 BitBlock strct_Lex__LCurlyBrace_; 93 BitBlock ParityMask; 94 BitBlock temp36; 95 BitBlock AllZero = simd_const_1(0); 96 BitBlock Temp28; 97 BitBlock Temp29; 98 BitBlock EvenFinal; 99 BitBlock Temp22; 100 BitBlock Temp23; 101 BitBlock Temp20; 102 BitBlock Temp21; 103 BitBlock Temp26; 104 BitBlock Temp27; 105 BitBlock Temp24; 106 BitBlock Temp25; 107 BitBlock Escape; 108 BitBlock StringMask; 109 BitBlock strct_u8__x90_xBF_; 110 BitBlock M3b; 111 BitBlock M9b; 112 BitBlock Scope3_6; 113 BitBlock Scope3_7; 114 BitBlock strct_Lex__Comma_; 115 BitBlock array_bit__7_; 116 BitBlock strct_Lex__Colon_; 117 BitBlock OddStart; 118 BitBlock Scope2; 119 BitBlock StringNotEscapedChars; 120 BitBlock Scope1; 121 BitBlock Scope4; 122 BitBlock strct_Lex__e_; 123 BitBlock TrueErrors_4; 124 BitBlock strct_u8__xA0_xBF_; 125 BitBlock strct_u8__prefix3_; 126 BitBlock FalseSpans; 127 BitBlock strct_Lex__PlusMinus_; 128 BitBlock M9b_10; 129 BitBlock M5b_0; 130 BitBlock strct_u8__x80_x9F_; 131 BitBlock StringErrors_20; 132 BitBlock StringErrors_21; 133 BitBlock StringErrors_22; 134 BitBlock StringEnds; 135 BitBlock temp75; 136 BitBlock temp74; 137 BitBlock temp77; 138 BitBlock E9b; 139 BitBlock temp71; 140 BitBlock temp70; 141 BitBlock temp73; 142 BitBlock temp72; 143 BitBlock strct_Lex__LSquareBracket_; 144 BitBlock temp79; 145 BitBlock temp78; 146 BitBlock M7b; 147 BitBlock M7a; 148 BitBlock strct_u8__prefix_; 149 BitBlock strct_Lex__s_; 150 BitBlock strct_Lex__WS_; 151 BitBlock AllOne = simd_const_1(1); 152 BitBlock strct_Lex__t_; 153 BitBlock strct_Ctrl__LF_; 154 BitBlock StringSpans; 155 BitBlock Follows_8; 156 BitBlock Follows_9; 157 BitBlock strct_Ctrl__CR_; 158 BitBlock strct_u8__badprefix_; 159 BitBlock strct_Lex__Zero_; 160 BitBlock strct_Lex__RCurlyBrace_; 161 BitBlock strct_Lex__Ee_; 162 BitBlock strct_u8__xF4_; 163 BitBlock strct_Lex__Digit1_9_; 164 BitBlock strct_Lex__True_; 165 BitBlock temp10; 166 BitBlock EvenStart; 167 BitBlock NullErrors_12; 168 BitBlock NullErrors_11; 62 169 BitBlock strct_u8__xE0_; 63 170 BitBlock temp59; … … 67 174 BitBlock temp55; 68 175 BitBlock temp54; 69 BitBlock strct_Lex__LSquareBracket_;176 BitBlock temp53; 70 177 BitBlock temp52; 71 178 BitBlock temp51; 72 179 BitBlock temp50; 73 BitBlock Temp9; 74 BitBlock strct_Ctrl__CR_; 180 BitBlock Temp43; 75 181 BitBlock strct_Lex__f_; 182 BitBlock M5b; 76 183 BitBlock UnescapedDQuotes; 77 BitBlock StringEscapeChars; 78 BitBlock OddFinal; 79 BitBlock strct_u8__unibyte_; 80 BitBlock StringErrors_0; 184 BitBlock AtomsSpans; 81 185 BitBlock TrueStarts; 82 BitBlock StringErrors_2;186 BitBlock FalseErrors; 83 187 BitBlock array_bit__3_; 84 BitBlock strct_u8__xED_;85 188 BitBlock strct_Ctrl__HT_; 86 BitBlock temp28; 87 BitBlock temp29; 88 BitBlock temp22; 89 BitBlock strct_Ctrl__SP_; 90 BitBlock temp20; 91 BitBlock temp21; 92 BitBlock temp26; 93 BitBlock temp27; 94 BitBlock temp24; 95 BitBlock temp25; 189 BitBlock uScope2; 190 BitBlock strct_Ctrl__x00_x1F_; 191 BitBlock temp30; 192 BitBlock uScope1; 193 BitBlock uScope4; 96 194 BitBlock temp3; 97 195 BitBlock temp2; 98 196 BitBlock temp1; 99 BitBlock OddEscape;197 BitBlock temp76; 100 198 BitBlock temp7; 101 199 BitBlock temp6; … … 104 202 BitBlock temp9; 105 203 BitBlock temp8; 106 BitBlock strct_Lex__a_;107 204 BitBlock StringStarts; 108 BitBlock strct_u8__x80_x8F_;205 BitBlock TrueErrors; 109 206 BitBlock StringCursor; 110 207 BitBlock NullStarts; 111 BitBlock StringMask; 112 BitBlock strct_Lex__Digit1_9_; 208 BitBlock M10b; 113 209 BitBlock strct_u8__prefix2_; 114 BitBlock AtomSpans;115 BitBlock array_bit__0_;210 BitBlock Scope1_15; 211 BitBlock E1; 116 212 BitBlock temp39; 117 213 BitBlock temp38; 118 BitBlock strct_Lex__Minus_;119 BitBlock strct_u8__prefix4_;120 214 BitBlock temp31; 121 BitBlock temp30;215 BitBlock array_bit__5_; 122 216 BitBlock temp33; 123 217 BitBlock temp32; 124 BitBlock strct_Lex__LCurlyBrace_;218 BitBlock temp35; 125 219 BitBlock temp34; 126 220 BitBlock temp37; 127 BitBlock temp36; 128 BitBlock ParityMask; 129 BitBlock AllZero = simd_const_1(0); 130 BitBlock temp35; 131 BitBlock EvenFinal; 132 BitBlock AtomStarts; 221 BitBlock E5b; 222 BitBlock NumberSpans; 133 223 BitBlock strct_Lex__DQuote_; 134 BitBlock Temp20;135 BitBlock Temp21;136 224 BitBlock strct_Lex__RSolidus_; 137 BitBlock Escape;138 225 BitBlock array_bit__1_; 139 226 BitBlock Even; 227 BitBlock Follows; 140 228 BitBlock array_bit__6_; 229 BitBlock error_mask; 141 230 BitBlock strct_Lex__r_; 142 231 BitBlock Start; 232 BitBlock Scope2_13; 233 BitBlock M1_23; 234 BitBlock Scope1_16; 143 235 BitBlock strct_u8__xF0_; 144 BitBlock temp14; 145 BitBlock strct_Ctrl__x00_x1F_; 146 BitBlock strct_u8__x90_xBF_; 147 BitBlock uScope2; 148 BitBlock strct_u8__badprefix_; 149 BitBlock EvenStart; 236 BitBlock Scope2_14; 237 BitBlock M1a; 238 BitBlock Temp38; 239 BitBlock M1b; 240 BitBlock Temp31; 241 BitBlock Temp30; 242 BitBlock Temp33; 243 BitBlock Temp32; 244 BitBlock Temp35; 245 BitBlock Temp34; 246 BitBlock Temp37; 247 BitBlock Temp36; 248 BitBlock strct_Ctrl__SP_; 150 249 BitBlock strct_Lex__False_; 151 BitBlock temp23;152 BitBlock uScope1;153 250 BitBlock strct_Lex__Digit0_9_; 154 BitBlock strct_Lex__Comma_; 155 BitBlock array_bit__7_; 156 BitBlock strct_Lex__Colon_; 157 BitBlock uScope4; 158 BitBlock temp53; 251 BitBlock NullErrors; 159 252 BitBlock FalseStarts; 160 BitBlock error_mask; 253 BitBlock FalseErrors_2; 254 BitBlock FalseErrors_3; 161 255 BitBlock NumberStarts; 162 BitBlock StringNotEscapedChars;163 BitBlock EscapeChars;164 256 BitBlock temp88; 165 257 BitBlock temp89; 166 BitBlock strct_Lex__e_;167 258 BitBlock temp84; 168 259 BitBlock temp85; … … 170 261 BitBlock temp87; 171 262 BitBlock temp80; 172 BitBlock temp81;263 BitBlock AtomStarts; 173 264 BitBlock temp82; 174 265 BitBlock temp83; 175 BitBlock strct_u8__xA0_xBF_;266 BitBlock M11; 176 267 BitBlock StringErrors; 177 BitBlock strct_u8__prefix3_; 268 BitBlock OddEscape; 269 BitBlock NumberErrors; 178 270 BitBlock Odd; 179 271 BitBlock temp66; … … 198 290 BitBlock Temp18; 199 291 BitBlock strct_Lex__u_; 200 BitBlock strct_u8__x80_x9F_;201 292 BitBlock uScope3; 202 BitBlock strct_Lex__Zero_; 203 BitBlock strct_Lex__WS_; 293 BitBlock M2a; 204 294 BitBlock temp13; 205 295 BitBlock temp12; … … 209 299 BitBlock temp16; 210 300 BitBlock temp15; 211 BitBlock StringEnds;301 BitBlock temp14; 212 302 BitBlock Temp7; 213 303 BitBlock temp19; 214 304 BitBlock temp18; 215 BitBlock temp75;216 BitBlock temp74;217 BitBlock temp77;218 BitBlock temp76;219 BitBlock temp71;220 BitBlock temp70;221 BitBlock temp73;222 BitBlock temp72;223 305 BitBlock strct_Lex__Number_; 224 BitBlock strct_Lex__n_;225 306 BitBlock strct_Lex__l_; 226 BitBlock temp79; 227 BitBlock temp78; 228 BitBlock strct_u8__prefix_; 229 BitBlock strct_Lex__s_; 230 BitBlock Temp5; 231 BitBlock EvenEscape; 232 BitBlock array_bit__5_; 233 BitBlock AllOne = simd_const_1(1); 234 BitBlock strct_Lex__t_; 235 BitBlock strct_Ctrl__LF_; 236 BitBlock StringSpans; 307 BitBlock StringErrors_17; 237 308 BitBlock strct_Lex__Escape_; 309 BitBlock StringErrors_19; 310 BitBlock StringErrors_18; 238 311 BitBlock Temp3; 239 312 BitBlock Temp2; … … 241 314 BitBlock u; 242 315 BitBlock Temp6; 243 BitBlock strct_Lex__PlusMinus_;316 BitBlock Temp5; 244 317 BitBlock Temp4; 245 318 BitBlock strct_Lex__HexDigit_; 246 BitBlock strct_Lex__RCurlyBrace_;319 BitBlock Temp9; 247 320 BitBlock Temp8; 248 BitBlock OddStart; 321 BitBlock M8b; 322 BitBlock Temp39; 323 CarryType carry28 = Carry0; 324 CarryType carry29 = Carry0; 325 CarryType carry20 = Carry0; 326 CarryType carry21 = Carry0; 327 CarryType carry22 = Carry0; 328 CarryType carry23 = Carry0; 329 CarryType carry24 = Carry0; 330 CarryType carry25 = Carry0; 331 CarryType carry26 = Carry0; 332 CarryType carry27 = Carry0; 249 333 CarryType carry1 = Carry0; 250 334 CarryType carry0 = Carry0; … … 257 341 CarryType carry9 = Carry0; 258 342 CarryType carry8 = Carry0; 343 CarryType carry15 = Carry0; 344 CarryType carry14 = Carry0; 345 CarryType carry17 = Carry0; 346 CarryType carry16 = Carry0; 347 CarryType carry11 = Carry0; 348 CarryType carry10 = Carry0; 349 CarryType carry13 = Carry0; 350 CarryType carry12 = Carry0; 351 CarryType carry19 = Carry0; 352 CarryType carry18 = Carry0; 353 CarryType carry_brw2 = Carry0; 354 CarryType carry_brw1 = Carry0; 259 355 CarryType carry_brw0 = Carry0; 260 CarryType carry10 = Carry0; 261 262 263 // BitBlock error_mask; // PyBit compiler auto declares this variables 356 CarryType carry32 = Carry0; 357 CarryType carry31 = Carry0; 358 CarryType carry30 = Carry0; 359 360 361 // BitBlock error_mask; // PyBit compiler auto declares this variable 264 362 BitBlock EOF_mask = simd_const_1(1); 265 363 … … 271 369 BitBlock high_bit_mask = sisd_high_bit_mask; 272 370 BitBlock high_bit_is_set; 273 // BitBlock ParityMask = simd_const_1(0); // P arityMask declaration via PyBit371 // BitBlock ParityMask = simd_const_1(0); // PyBit compiler auto declares this variable 274 372 BitBlock bitblock_parity_mask; 275 373 … … 465 563 Escape = simd_or(EvenEscape,OddEscape); 466 564 UnescapedDQuotes = simd_andc(strct_Lex__DQuote_,Escape); 565 566 /* Generate Parity Mask */ 567 high_bit_mask = sisd_high_bit_mask; 568 high_bit_is_set = simd_and(high_bit_mask, bitblock_parity_mask); 569 bitblock_parity_mask = sisd_add( simd_not(sisd_srl(high_bit_is_set, sisd_from_int(BLOCK_SIZE1))) , sisd_low_bit_mask); 570 ParityMask = bitblock_parallel_prefix_parity(UnescapedDQuotes, bitblock_parity_mask); 571 467 572 advance_with_carry(ParityMask, carry3, Temp8); 468 573 StringMask = simd_and(ParityMask,Temp8); 469 StringSpans _6= simd_or(StringMask,UnescapedDQuotes);574 StringSpans = simd_or(StringMask,UnescapedDQuotes); 470 575 Temp9 = simd_or(strct_Lex__True_,strct_Lex__False_); 471 576 Temp10 = simd_or(Temp9,strct_Lex__Null_); 472 577 Temp11 = simd_or(Temp10,strct_Lex__Number_); 473 AtomSpans = simd_or(Temp11,StringSpans _6);578 AtomSpans = simd_or(Temp11,StringSpans); 474 579 advance_with_carry(AtomSpans, carry4, Temp12); 475 580 AtomStarts = simd_andc(AtomSpans,Temp12); … … 479 584 FalseStarts = simd_and(AtomStarts,temp62); 480 585 NullStarts = simd_and(AtomStarts,temp64); 481 StringEscapeChars = simd_and(Escape Chars,StringMask);482 StringErrors_ 0= simd_andc(StringEscapeChars,strct_Lex__Escape_);586 StringEscapeChars = simd_and(Escape,StringMask); 587 StringErrors_17 = simd_andc(StringEscapeChars,strct_Lex__Escape_); 483 588 u = simd_and(StringEscapeChars,strct_Lex__u_); 484 589 advance_with_carry(u, carry5, uScope1); … … 487 592 advance_with_carry(uScope3, carry8, uScope4); 488 593 Temp13 = simd_andc(uScope1,strct_Lex__HexDigit_); 489 StringErrors_1 = simd_or(StringErrors_0,Temp13);594 StringErrors_18 = simd_or(StringErrors_17,Temp13); 490 595 Temp14 = simd_andc(uScope2,strct_Lex__HexDigit_); 491 StringErrors_ 2 = simd_or(StringErrors_1,Temp14);596 StringErrors_19 = simd_or(StringErrors_18,Temp14); 492 597 Temp15 = simd_andc(uScope3,strct_Lex__HexDigit_); 493 StringErrors_ 3 = simd_or(StringErrors_2,Temp15);598 StringErrors_20 = simd_or(StringErrors_19,Temp15); 494 599 Temp16 = simd_andc(uScope4,strct_Lex__HexDigit_); 495 StringErrors_ 4 = simd_or(StringErrors_3,Temp16);496 Temp17 = simd_or(Escape Chars,strct_Lex__RSolidus_);600 StringErrors_21 = simd_or(StringErrors_20,Temp16); 601 Temp17 = simd_or(Escape,strct_Lex__RSolidus_); 497 602 StringNotEscapedChars = simd_andc(StringMask,Temp17); 498 603 Temp18 = simd_and(StringNotEscapedChars,strct_Ctrl__x00_x1F_); 499 StringErrors_ 5 = simd_or(StringErrors_4,Temp18);604 StringErrors_22 = simd_or(StringErrors_21,Temp18); 500 605 advance_with_carry(StringStarts, carry9, StringCursor); 501 606 adc128(StringCursor, StringMask, carry10, Temp19); 502 607 StringEnds = simd_andc(Temp19,StringMask); 503 608 Temp20 = simd_andc(StringEnds,UnescapedDQuotes); 504 StringErrors = simd_or(StringErrors_5,Temp20); 505 sbb128(StringEnds, StringStarts, carry_brw0, Temp21); 506 StringSpans = simd_or(Temp21,StringEnds); 507 error_mask = StringErrors; 508 509 510 /* Generate Parity Mask */ 511 high_bit_mask = sisd_high_bit_mask; 512 high_bit_is_set = simd_and(high_bit_mask, bitblock_parity_mask); 513 bitblock_parity_mask = sisd_add( simd_not(sisd_srl(high_bit_is_set, sisd_from_int(BLOCK_SIZE1))) , sisd_low_bit_mask); 514 ParityMask = bitblock_parallel_prefix_parity(UnescapedDQuotes, bitblock_parity_mask); 609 StringErrors = simd_or(StringErrors_22,Temp20); 610 M0 = NumberStarts; 611 Temp21 = simd_and(strct_Lex__Minus_,NumberStarts); 612 adc128(NumberStarts, Temp21, carry11, Temp22); 613 M1_23 = simd_andc(Temp22,Temp21); 614 Temp23 = simd_or(strct_Lex__Zero_,strct_Lex__Digit1_9_); 615 E1 = simd_andc(M1_23,Temp23); 616 M1 = simd_andc(M1_23,E1); 617 M1a = simd_and(M1,strct_Lex__Zero_); 618 M1b = simd_and(M1,strct_Lex__Digit1_9_); 619 advance_with_carry(M1a, carry12, M2a); 620 advance_with_carry(M1b, carry13, M2b); 621 adc128(M2b, strct_Lex__Digit0_9_, carry14, Temp24); 622 M3b = simd_andc(Temp24,strct_Lex__Digit0_9_); 623 M4 = simd_or(M2a,M3b); 624 M4a = simd_andc(M4,strct_Lex__DecimalPoint_); 625 M4b = simd_and(M4,strct_Lex__DecimalPoint_); 626 advance_with_carry(M4b, carry15, M5b_0); 627 E5b = simd_andc(M5b_0,strct_Lex__Digit0_9_); 628 M5b = simd_andc(M5b_0,E5b); 629 adc128(M5b, strct_Lex__Digit0_9_, carry16, Temp25); 630 M6 = simd_andc(Temp25,strct_Lex__Digit0_9_); 631 M7 = simd_or(M4a,M6); 632 M7a = simd_andc(M7,strct_Lex__Ee_); 633 M7b = simd_and(M7,strct_Lex__Ee_); 634 advance_with_carry(M7b, carry17, M8b); 635 Temp26 = simd_and(strct_Lex__PlusMinus_,M8b); 636 adc128(M8b, Temp26, carry18, Temp27); 637 M9b_10 = simd_andc(Temp27,Temp26); 638 E9b = simd_andc(M9b_10,strct_Lex__Digit0_9_); 639 M9b = simd_andc(M9b_10,E9b); 640 adc128(M9b, strct_Lex__Digit0_9_, carry19, Temp28); 641 M10b = simd_andc(Temp28,strct_Lex__Digit0_9_); 642 M11 = simd_or(M7a,M10b); 643 Temp29 = simd_or(E1,E5b); 644 NumberErrors = simd_or(Temp29,E9b); 645 advance_with_carry(TrueStarts, carry20, Scope1_15); 646 advance_with_carry(Scope1_15, carry21, Scope2_13); 647 advance_with_carry(Scope2_13, carry22, Scope3_6); 648 TrueErrors_4 = simd_andc(Scope1_15,temp66); 649 Temp30 = simd_andc(Scope2_13,strct_Lex__u_); 650 TrueErrors_5 = simd_or(TrueErrors_4,Temp30); 651 Temp31 = simd_andc(Scope3_6,temp50); 652 TrueErrors = simd_or(TrueErrors_5,Temp31); 653 advance_with_carry(Scope3_6, carry23, Follows_8); 654 sbb128(Follows_8, TrueStarts, carry_brw0, TrueSpans); 655 advance_with_carry(FalseStarts, carry24, Scope1_16); 656 advance_with_carry(Scope1_16, carry25, Scope2_14); 657 advance_with_carry(Scope2_14, carry26, Scope3_7); 658 advance_with_carry(Scope3_7, carry27, Scope4); 659 FalseErrors_1 = simd_andc(Scope1_16,strct_Lex__a_); 660 Temp32 = simd_andc(Scope2_14,strct_Lex__l_); 661 FalseErrors_2 = simd_or(FalseErrors_1,Temp32); 662 Temp33 = simd_andc(Scope3_7,strct_Lex__s_); 663 FalseErrors_3 = simd_or(FalseErrors_2,Temp33); 664 Temp34 = simd_andc(Scope4,temp50); 665 FalseErrors = simd_or(FalseErrors_3,Temp34); 666 advance_with_carry(Scope4, carry28, Follows_9); 667 sbb128(Follows_9, FalseStarts, carry_brw1, FalseSpans); 668 advance_with_carry(NullStarts, carry29, Scope1); 669 advance_with_carry(Scope1, carry30, Scope2); 670 advance_with_carry(Scope2, carry31, Scope3); 671 Temp35 = simd_andc(Scope1,strct_Lex__u_); 672 NullErrors_11 = simd_or(NullErrors,Temp35); 673 Temp36 = simd_andc(Scope2,strct_Lex__l_); 674 NullErrors_12 = simd_or(NullErrors_11,Temp36); 675 Temp37 = simd_andc(Scope3,strct_Lex__l_); 676 NullErrors = simd_or(NullErrors_12,Temp37); 677 advance_with_carry(Scope3, carry32, Follows); 678 sbb128(Follows, NullStarts, carry_brw2, NullSpans); 679 Temp38 = simd_or(StringSpans,NumberSpans); 680 Temp39 = simd_or(Temp38,TrueSpans); 681 Temp40 = simd_or(Temp39,FalseSpans); 682 AtomsSpans = simd_or(Temp40,NullSpans); 683 Temp41 = simd_or(StringErrors,NumberErrors); 684 Temp42 = simd_or(Temp41,TrueErrors); 685 Temp43 = simd_or(Temp42,FalseErrors); 686 error_mask = simd_or(Temp43,NullErrors); 687 515 688 516 689 #ifdef DEBUG … … 533 706 print_simd_register("FalseStarts", FalseStarts); 534 707 print_simd_register("NullStarts", NullStarts); 708 print_simd_register("AtomSpans", AtomSpans); 535 709 536 710 #endif 537 711 538 712 if (bitblock_has_bit(error_mask)){ 539 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) ;540 fprintf(stderr, "Error at position %i \n.", err_pos);713 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) + 1; 714 fprintf(stderr, "Error at position %i.\n", err_pos); 541 715 exit(1); 542 716 } … … 730 904 advance_with_carry(ParityMask, carry3, Temp8); 731 905 StringMask = simd_and(ParityMask,Temp8); 732 StringSpans _6= simd_or(StringMask,UnescapedDQuotes);906 StringSpans = simd_or(StringMask,UnescapedDQuotes); 733 907 Temp9 = simd_or(strct_Lex__True_,strct_Lex__False_); 734 908 Temp10 = simd_or(Temp9,strct_Lex__Null_); 735 909 Temp11 = simd_or(Temp10,strct_Lex__Number_); 736 AtomSpans = simd_or(Temp11,StringSpans _6);910 AtomSpans = simd_or(Temp11,StringSpans); 737 911 advance_with_carry(AtomSpans, carry4, Temp12); 738 912 AtomStarts = simd_andc(AtomSpans,Temp12); … … 742 916 FalseStarts = simd_and(AtomStarts,temp62); 743 917 NullStarts = simd_and(AtomStarts,temp64); 744 745 918 StringEscapeChars = simd_and(Escape,StringMask); 746 StringErrors_ 0= simd_andc(StringEscapeChars,strct_Lex__Escape_);919 StringErrors_17 = simd_andc(StringEscapeChars,strct_Lex__Escape_); 747 920 u = simd_and(StringEscapeChars,strct_Lex__u_); 748 921 advance_with_carry(u, carry5, uScope1); … … 751 924 advance_with_carry(uScope3, carry8, uScope4); 752 925 Temp13 = simd_andc(uScope1,strct_Lex__HexDigit_); 753 StringErrors_1 = simd_or(StringErrors_0,Temp13);926 StringErrors_18 = simd_or(StringErrors_17,Temp13); 754 927 Temp14 = simd_andc(uScope2,strct_Lex__HexDigit_); 755 StringErrors_ 2 = simd_or(StringErrors_1,Temp14);928 StringErrors_19 = simd_or(StringErrors_18,Temp14); 756 929 Temp15 = simd_andc(uScope3,strct_Lex__HexDigit_); 757 StringErrors_ 3 = simd_or(StringErrors_2,Temp15);930 StringErrors_20 = simd_or(StringErrors_19,Temp15); 758 931 Temp16 = simd_andc(uScope4,strct_Lex__HexDigit_); 759 StringErrors_ 4 = simd_or(StringErrors_3,Temp16);932 StringErrors_21 = simd_or(StringErrors_20,Temp16); 760 933 Temp17 = simd_or(Escape,strct_Lex__RSolidus_); 761 934 StringNotEscapedChars = simd_andc(StringMask,Temp17); 762 935 Temp18 = simd_and(StringNotEscapedChars,strct_Ctrl__x00_x1F_); 763 StringErrors_ 5 = simd_or(StringErrors_4,Temp18);936 StringErrors_22 = simd_or(StringErrors_21,Temp18); 764 937 advance_with_carry(StringStarts, carry9, StringCursor); 765 938 adc128(StringCursor, StringMask, carry10, Temp19); 766 939 StringEnds = simd_andc(Temp19,StringMask); 767 940 Temp20 = simd_andc(StringEnds,UnescapedDQuotes); 768 StringErrors = simd_or(StringErrors_5,Temp20); 769 sbb128(StringEnds, StringStarts, carry_brw0, Temp21); 770 StringSpans = simd_or(Temp21,StringEnds); 771 error_mask = StringErrors; 941 StringErrors = simd_or(StringErrors_22,Temp20); 942 M0 = NumberStarts; 943 Temp21 = simd_and(strct_Lex__Minus_,NumberStarts); 944 adc128(NumberStarts, Temp21, carry11, Temp22); 945 M1_23 = simd_andc(Temp22,Temp21); 946 Temp23 = simd_or(strct_Lex__Zero_,strct_Lex__Digit1_9_); 947 E1 = simd_andc(M1_23,Temp23); 948 M1 = simd_andc(M1_23,E1); 949 M1a = simd_and(M1,strct_Lex__Zero_); 950 M1b = simd_and(M1,strct_Lex__Digit1_9_); 951 advance_with_carry(M1a, carry12, M2a); 952 advance_with_carry(M1b, carry13, M2b); 953 adc128(M2b, strct_Lex__Digit0_9_, carry14, Temp24); 954 M3b = simd_andc(Temp24,strct_Lex__Digit0_9_); 955 M4 = simd_or(M2a,M3b); 956 M4a = simd_andc(M4,strct_Lex__DecimalPoint_); 957 M4b = simd_and(M4,strct_Lex__DecimalPoint_); 958 advance_with_carry(M4b, carry15, M5b_0); 959 E5b = simd_andc(M5b_0,strct_Lex__Digit0_9_); 960 M5b = simd_andc(M5b_0,E5b); 961 adc128(M5b, strct_Lex__Digit0_9_, carry16, Temp25); 962 M6 = simd_andc(Temp25,strct_Lex__Digit0_9_); 963 M7 = simd_or(M4a,M6); 964 M7a = simd_andc(M7,strct_Lex__Ee_); 965 M7b = simd_and(M7,strct_Lex__Ee_); 966 advance_with_carry(M7b, carry17, M8b); 967 Temp26 = simd_and(strct_Lex__PlusMinus_,M8b); 968 adc128(M8b, Temp26, carry18, Temp27); 969 M9b_10 = simd_andc(Temp27,Temp26); 970 E9b = simd_andc(M9b_10,strct_Lex__Digit0_9_); 971 M9b = simd_andc(M9b_10,E9b); 972 adc128(M9b, strct_Lex__Digit0_9_, carry19, Temp28); 973 M10b = simd_andc(Temp28,strct_Lex__Digit0_9_); 974 M11 = simd_or(M7a,M10b); 975 Temp29 = simd_or(E1,E5b); 976 NumberErrors = simd_or(Temp29,E9b); 977 advance_with_carry(TrueStarts, carry20, Scope1_15); 978 advance_with_carry(Scope1_15, carry21, Scope2_13); 979 advance_with_carry(Scope2_13, carry22, Scope3_6); 980 TrueErrors_4 = simd_andc(Scope1_15,temp66); 981 Temp30 = simd_andc(Scope2_13,strct_Lex__u_); 982 TrueErrors_5 = simd_or(TrueErrors_4,Temp30); 983 Temp31 = simd_andc(Scope3_6,temp50); 984 TrueErrors = simd_or(TrueErrors_5,Temp31); 985 advance_with_carry(Scope3_6, carry23, Follows_8); 986 sbb128(Follows_8, TrueStarts, carry_brw0, TrueSpans); 987 advance_with_carry(FalseStarts, carry24, Scope1_16); 988 advance_with_carry(Scope1_16, carry25, Scope2_14); 989 advance_with_carry(Scope2_14, carry26, Scope3_7); 990 advance_with_carry(Scope3_7, carry27, Scope4); 991 FalseErrors_1 = simd_andc(Scope1_16,strct_Lex__a_); 992 Temp32 = simd_andc(Scope2_14,strct_Lex__l_); 993 FalseErrors_2 = simd_or(FalseErrors_1,Temp32); 994 Temp33 = simd_andc(Scope3_7,strct_Lex__s_); 995 FalseErrors_3 = simd_or(FalseErrors_2,Temp33); 996 Temp34 = simd_andc(Scope4,temp50); 997 FalseErrors = simd_or(FalseErrors_3,Temp34); 998 advance_with_carry(Scope4, carry28, Follows_9); 999 sbb128(Follows_9, FalseStarts, carry_brw1, FalseSpans); 1000 advance_with_carry(NullStarts, carry29, Scope1); 1001 advance_with_carry(Scope1, carry30, Scope2); 1002 advance_with_carry(Scope2, carry31, Scope3); 1003 Temp35 = simd_andc(Scope1,strct_Lex__u_); 1004 NullErrors_11 = simd_or(NullErrors,Temp35); 1005 Temp36 = simd_andc(Scope2,strct_Lex__l_); 1006 NullErrors_12 = simd_or(NullErrors_11,Temp36); 1007 Temp37 = simd_andc(Scope3,strct_Lex__l_); 1008 NullErrors = simd_or(NullErrors_12,Temp37); 1009 advance_with_carry(Scope3, carry32, Follows); 1010 sbb128(Follows, NullStarts, carry_brw2, NullSpans); 1011 Temp38 = simd_or(StringSpans,NumberSpans); 1012 Temp39 = simd_or(Temp38,TrueSpans); 1013 Temp40 = simd_or(Temp39,FalseSpans); 1014 AtomsSpans = simd_or(Temp40,NullSpans); 1015 Temp41 = simd_or(StringErrors,NumberErrors); 1016 Temp42 = simd_or(Temp41,TrueErrors); 1017 Temp43 = simd_or(Temp42,FalseErrors); 1018 error_mask = simd_or(Temp43,NullErrors); 772 1019 773 1020 #ifdef DEBUG … … 790 1037 print_simd_register("FalseStarts", FalseStarts); 791 1038 print_simd_register("NullStarts", NullStarts); 792 793 print_simd_register("u", u); 794 print_simd_register("StringErrors", StringErrors); 795 1039 print_simd_register("AtomSpans", AtomSpans); 1040 796 1041 #endif 797 1042 798 1043 if(bitblock_has_bit(error_mask)) { 799 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) ;800 fprintf(stderr, "Error at position %i \n.", err_pos);1044 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) + 1; 1045 fprintf(stderr, "Error at position %i.\n", err_pos); 801 1046 exit(1); 802 1047 } 
proto/JSON/template.c
r755 r766 113 113 print_simd_register("FalseStarts", FalseStarts); 114 114 print_simd_register("NullStarts", NullStarts); 115 print_simd_register("AtomSpans", AtomSpans); 115 116 116 117 #endif 117 118 118 119 if (bitblock_has_bit(error_mask)){ 119 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) ;120 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) + 1; 120 121 fprintf(stderr, "Error at position %i.\n", err_pos); 121 122 exit(1); … … 172 173 print_simd_register("FalseStarts", FalseStarts); 173 174 print_simd_register("NullStarts", NullStarts); 174 175 print_simd_register("AtomSpans", AtomSpans); 176 175 177 #endif 176 178 177 179 if(bitblock_has_bit(error_mask)) { 178 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) ;179 fprintf(stderr, "Error at position %i \n.", err_pos);180 err_pos = src_pos + buf_pos + count_forward_zeroes(error_mask) + 1; 181 fprintf(stderr, "Error at position %i.\n", err_pos); 180 182 exit(1); 181 183 }
Note: See TracChangeset
for help on using the changeset viewer.