Changeset 2899


Ignore:
Timestamp:
Feb 5, 2013, 12:44:24 PM (6 years ago)
Author:
lindanl
Message:

Add octal processing

Location:
proto/PDF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/PDF/cb_pablo.py

    r2898 r2899  
    214214        escape_Callouts.UERParen = lex.RParen &~ escape
    215215        escape_Callouts.Nonoct = lex.Nonoct & escape   
    216         #escape_Callouts.Oct1 = lex.Oct & escape
    217         #escape_Callouts.Oct2 = lex.Oct & pablo.Advance(escape_Callouts.Oct1)
    218         #escape_Callouts.Oct3 = lex.Oct & pablo.Advance(escape_Callouts.Oct2)
     216        escape_Callouts.Oct1 = lex.Oct & escape
     217        escape_Callouts.Oct2 = escape_Callouts.Oct1 & pablo.Lookahead(lex.Oct)
     218        escape_Callouts.Oct1 &= ~escape_Callouts.Oct2
     219        escape_Callouts.Oct3 = escape_Callouts.Oct2 & pablo.Lookahead(lex.Oct, 2)
     220        escape_Callouts.Oct2 &= ~escape_Callouts.Oct3
    219221        out_Callouts.delmask = escape_char
    220222
     
    332334    if out_Callouts.names_escapes:
    333335        out_Callouts.delmask |= out_Callouts.names_escapes | names_escapes_scope1
    334         out_Callouts.bit_0 = (out_Callouts.bit_0 &~ names_escapes_scope2) #| pablo.Advance(out_Callouts.bit_4 & names_escapes_scope1)
    335         out_Callouts.bit_1 = (out_Callouts.bit_1 &~ names_escapes_scope2) #| pablo.Advance(out_Callouts.bit_5 & names_escapes_scope1)
    336         out_Callouts.bit_2 = (out_Callouts.bit_2 &~ names_escapes_scope2) #| pablo.Advance(out_Callouts.bit_6 & names_escapes_scope1)
    337         out_Callouts.bit_3 = (out_Callouts.bit_3 &~ names_escapes_scope2) #| pablo.Advance(out_Callouts.bit_7 & names_escapes_scope1)
     336        out_Callouts.bit_0 = (out_Callouts.bit_0 &~ names_escapes_scope2)
     337        out_Callouts.bit_1 = (out_Callouts.bit_1 &~ names_escapes_scope2)
     338        out_Callouts.bit_2 = (out_Callouts.bit_2 &~ names_escapes_scope2)
     339        out_Callouts.bit_3 = (out_Callouts.bit_3 &~ names_escapes_scope2)
    338340        out_Callouts.bit_0 |= pablo.Advance(out_Callouts.bit_4 & names_escapes_scope1)
    339341        out_Callouts.bit_1 |= pablo.Advance(out_Callouts.bit_5 & names_escapes_scope1)
    340342        out_Callouts.bit_2 |= pablo.Advance(out_Callouts.bit_6 & names_escapes_scope1)
    341343        out_Callouts.bit_3 |= pablo.Advance(out_Callouts.bit_7 & names_escapes_scope1)
     344       
     345    if escape_Callouts.Oct1:
     346        out_Callouts.bit_0 = (out_Callouts.bit_0 &~ escape_Callouts.Oct1)
     347        out_Callouts.bit_1 = (out_Callouts.bit_1 &~ escape_Callouts.Oct1)
     348        out_Callouts.bit_2 = (out_Callouts.bit_2 &~ escape_Callouts.Oct1)
     349        out_Callouts.bit_3 = (out_Callouts.bit_3 &~ escape_Callouts.Oct1)
     350     
     351    if escape_Callouts.Oct2:
     352        out_Callouts.delmask |= escape_Callouts.Oct2
     353        Oct2_scope1 = pablo.Advance(escape_Callouts.Oct2)
     354        out_Callouts.bit_2 = (out_Callouts.bit_2 &~ Oct2_scope1) | pablo.Advance(out_Callouts.bit_5 & escape_Callouts.Oct2)
     355        out_Callouts.bit_3 = (out_Callouts.bit_3 &~ Oct2_scope1) | pablo.Advance(out_Callouts.bit_6 & escape_Callouts.Oct2)
     356        out_Callouts.bit_4 = (out_Callouts.bit_4 &~ Oct2_scope1) | pablo.Advance(out_Callouts.bit_7 & escape_Callouts.Oct2)
     357       
     358    if escape_Callouts.Oct3:
     359        Oct3_scope1 = pablo.Advance(escape_Callouts.Oct3)
     360        Oct3_scope2 = pablo.Advance(Oct3_scope1)
     361        out_Callouts.delmask |= escape_Callouts.Oct3 | Oct3_scope1
     362        temp0 = pablo.Advance(out_Callouts.bit_6 & escape_Callouts.Oct3)
     363        temp1 = pablo.Advance(out_Callouts.bit_7 & escape_Callouts.Oct3)
     364        out_Callouts.bit_0 = (out_Callouts.bit_0 &~ Oct3_scope2) | pablo.Advance(temp0)
     365        out_Callouts.bit_1 = (out_Callouts.bit_1 &~ Oct3_scope2) | pablo.Advance(temp1)
     366        out_Callouts.bit_2 = (out_Callouts.bit_2 &~ Oct3_scope2) | pablo.Advance(out_Callouts.bit_5 & Oct3_scope1)
     367        out_Callouts.bit_3 = (out_Callouts.bit_3 &~ Oct3_scope2) | pablo.Advance(out_Callouts.bit_6 & Oct3_scope1)
     368        out_Callouts.bit_4 = (out_Callouts.bit_4 &~ Oct3_scope2) | pablo.Advance(out_Callouts.bit_7 & Oct3_scope1)       
    342369     
    343370 
  • proto/PDF/cb_template.cpp

    r2896 r2899  
    255255   
    256256    for (int i = 0; i < BLOCKS-1; i++){
    257       parse_Escaped.do_block(lex[i], parity, escape_Callouts, out_Callouts);
     257      parse_Escaped.do_block(lex[i], parity, escape_Callouts, out_Callouts, lex[i+1]);
    258258      parse_HexStrings.do_block(lex[i], marker, out_Callouts);
    259       parse_Names.do_block(lex[i], marker, out_Callouts,lex[i+1]);
     259      parse_Names.do_block(lex[i], marker, out_Callouts, lex[i+1]);
    260260      prepare_content_buffer.do_block(basis_bits[i], lex[i], escape_Callouts, out_Callouts);
    261261      Build_ContentBuffer(out_Callouts, content_buf, &content_buf_ptr);
Note: See TracChangeset for help on using the changeset viewer.