Changeset 2900
 Timestamp:
 Feb 5, 2013, 2:48:38 PM (6 years ago)
 Location:
 proto/PDF
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

proto/PDF/cb_pablo.py
r2899 r2900 275 275 hexString_ends = pablo.ScanThru(pablo.Advance(hexString_starts),lex.Hexlex.WS) 276 276 #error = hexString_ends &~ lex.RAngle 277 out_Callouts.hexString_mask = pablo. InclusiveSpan(hexString_starts,hexString_ends)277 out_Callouts.hexString_mask = pablo.ExclusiveSpan(hexString_starts,hexString_ends) 278 278 marker.hex_opener = hexString_starts 279 279 … … 291 291 292 292 293 def Prepare_content_buffer(basis_bits, lex, escape_Callouts, out_Callouts):293 def Prepare_content_buffer(basis_bits, lex, marker, parity, escape_Callouts, out_Callouts): 294 294 295 295 out_Callouts.bit_0 = basis_bits.bit_0 … … 304 304 names_escapes_scope1 = pablo.Advance(out_Callouts.names_escapes) 305 305 names_escapes_scope2 = pablo.Advance(names_escapes_scope1) 306 out_Callouts.hexString_mask =names_escapes_scope1  names_escapes_scope2307 308 if out_Callouts.hexString_mask:306 hexstring_nameescape_mask = out_Callouts.hexString_mask  names_escapes_scope1  names_escapes_scope2 307 308 if hexstring_nameescape_mask: 309 309 310 310 out_Callouts.delmask = out_Callouts.hexString_mask & lex.WS 311 311 312 312 NondigitHexString = lex.Hex &~ lex.Digit 313 out_Callouts.bit_0 &= ~ out_Callouts.hexString_mask314 out_Callouts.bit_1 &= ~ out_Callouts.hexString_mask315 out_Callouts.bit_2 &= ~ out_Callouts.hexString_mask316 out_Callouts.bit_3 &= ~ out_Callouts.hexString_mask317 out_Callouts.bit_4 = ( out_Callouts.hexString_mask & NondigitHexString)318 carry7 = out_Callouts.bit_7 & NondigitHexString & out_Callouts.hexString_mask319 out_Callouts.bit_7 ^= NondigitHexString & out_Callouts.hexString_mask313 out_Callouts.bit_0 &= ~hexstring_nameescape_mask 314 out_Callouts.bit_1 &= ~hexstring_nameescape_mask 315 out_Callouts.bit_2 &= ~hexstring_nameescape_mask 316 out_Callouts.bit_3 &= ~hexstring_nameescape_mask 317 out_Callouts.bit_4 = (hexstring_nameescape_mask & NondigitHexString) 318 carry7 = out_Callouts.bit_7 & NondigitHexString & hexstring_nameescape_mask 319 out_Callouts.bit_7 ^= NondigitHexString & hexstring_nameescape_mask 320 320 carry6 = out_Callouts.bit_6 & carry7 321 321 out_Callouts.bit_6 ^= carry7 322 322 out_Callouts.bit_5 ^= carry6 323 324 if out_Callouts.hexString_mask: 325 hexsting_partial_start = marker.hex_opener 326 hexsting_partial_odd_start = hexsting_partial_start & parity.odd 327 hexsting_partial_even_start = hexsting_partial_start & parity.even 328 hexsting_partial_odd_end = pablo.ScanThru(pablo.Advance(hexsting_partial_odd_start),lex.Hex) 329 hexsting_partial_even_end = pablo.ScanThru(pablo.Advance(hexsting_partial_even_start),lex.Hex) 330 hexsting_partial_odd_mask = pablo.ExclusiveSpan(hexsting_partial_odd_start,hexsting_partial_odd_end)  (hexsting_partial_odd_end & parity.odd) 331 hexsting_partial_even_mask = pablo.ExclusiveSpan(hexsting_partial_even_start,hexsting_partial_even_end)  (hexsting_partial_even_end & parity.even) 332 333 out_Callouts.delmask = (hexsting_partial_odd_mask & parity.even)  (hexsting_partial_even_mask & parity.odd) 334 kept_position = (hexsting_partial_odd_mask & parity.odd)  (hexsting_partial_even_mask & parity.even) 335 336 337 hexsting_partial_ends = hexsting_partial_odd_end  hexsting_partial_even_end 338 hexsting_partial_masks = hexsting_partial_odd_mask  hexsting_partial_even_mask 339 kept_positions = kept_position 340 #while ~(hexsting_partial_end & lex.RBracket): 341 342 out_Callouts.bit_4 &= ~hexsting_partial_ends 343 out_Callouts.bit_5 &= ~hexsting_partial_ends 344 out_Callouts.bit_6 &= ~hexsting_partial_ends 345 out_Callouts.bit_7 &= ~hexsting_partial_ends 346 347 out_Callouts.bit_0 = pablo.Advance(out_Callouts.delmask & hexsting_partial_masks & out_Callouts.bit_4)  (out_Callouts.bit_0 & ~kept_positions) 348 out_Callouts.bit_1 = pablo.Advance(out_Callouts.delmask & hexsting_partial_masks & out_Callouts.bit_5)  (out_Callouts.bit_1 & ~kept_positions) 349 out_Callouts.bit_2 = pablo.Advance(out_Callouts.delmask & hexsting_partial_masks & out_Callouts.bit_6)  (out_Callouts.bit_2 & ~kept_positions) 350 out_Callouts.bit_3 = pablo.Advance(out_Callouts.delmask & hexsting_partial_masks & out_Callouts.bit_7)  (out_Callouts.bit_3 & ~kept_positions) 351 323 352 324 353 
proto/PDF/cb_template.cpp
r2899 r2900 258 258 parse_HexStrings.do_block(lex[i], marker, out_Callouts); 259 259 parse_Names.do_block(lex[i], marker, out_Callouts, lex[i+1]); 260 prepare_content_buffer.do_block(basis_bits[i], lex[i], escape_Callouts, out_Callouts);260 prepare_content_buffer.do_block(basis_bits[i], lex[i], marker, parity, escape_Callouts, out_Callouts); 261 261 Build_ContentBuffer(out_Callouts, content_buf, &content_buf_ptr); 262 262 } … … 266 266 parse_HexStrings.do_final_block(lex[BLOCKS1], marker, out_Callouts, EOF_mask); 267 267 parse_Names.do_final_block(lex[BLOCKS1], marker, out_Callouts, EOF_mask); 268 prepare_content_buffer.do_final_block(basis_bits[BLOCKS1], lex[BLOCKS1], escape_Callouts, out_Callouts, EOF_mask);268 prepare_content_buffer.do_final_block(basis_bits[BLOCKS1], lex[BLOCKS1], marker, parity, escape_Callouts, out_Callouts, EOF_mask); 269 269 out_Callouts.delmask = ~EOF_mask; 270 270 Build_ContentBuffer(out_Callouts, content_buf, &content_buf_ptr);
Note: See TracChangeset
for help on using the changeset viewer.