 Timestamp:
 Nov 7, 2012, 1:49:55 PM (6 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

proto/PDF/pdf_demo.py
r2617 r2618 28 28 Slash = 0 29 29 Regular = 0 30 Delimiter = 031 30 LAngle = 0 32 31 RAngle = 0 … … 91 90 92 91 def Classify_bytes(basis_bits, lex): 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 lex.Delimiter= (temp40  temp42)139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 lex.Regular = ~lex.Delimiter&~lex.WS 181 182 #TEMPORARY! 183 lex.Special = lex.LParen  lex.RParen  lex.Backslash  lex.LAngle  lex.RAngle  lex.RBracket  lex.LBracket 184 lex. Hash = lex.Period92 temp1 = (basis_bits.bit_0  basis_bits.bit_1) 93 temp2 = (basis_bits.bit_2 &~ basis_bits.bit_3) 94 temp3 = (temp2 &~ temp1) 95 temp4 = (basis_bits.bit_4 &~ basis_bits.bit_5) 96 temp5 = (basis_bits.bit_6  basis_bits.bit_7) 97 temp6 = (temp4 &~ temp5) 98 lex.LParen = (temp3 & temp6) 99 temp7 = (basis_bits.bit_7 &~ basis_bits.bit_6) 100 temp8 = (temp4 & temp7) 101 lex.RParen = (temp3 & temp8) 102 temp9 = (basis_bits.bit_1 &~ basis_bits.bit_0) 103 temp10 = (basis_bits.bit_3 &~ basis_bits.bit_2) 104 temp11 = (temp9 & temp10) 105 temp12 = (basis_bits.bit_4 & basis_bits.bit_5) 106 temp13 = (temp12 &~ temp5) 107 lex.Backslash = (temp11 & temp13) 108 temp14 = (temp5 &~ temp7) 109 temp15 = (temp4 &~ temp14) 110 temp16 = (temp3 & temp15) 111 temp17 = (basis_bits.bit_2 & basis_bits.bit_3) 112 temp18 = (temp17 &~ temp1) 113 temp19 = (temp18 & temp13) 114 temp20 = (temp16  temp19) 115 temp21 = (basis_bits.bit_6 &~ basis_bits.bit_7) 116 temp22 = (temp12 & temp21) 117 temp23 = (temp18 & temp22) 118 temp24 = (temp20  temp23) 119 temp25 = (basis_bits.bit_6 & basis_bits.bit_7) 120 temp26 = (temp4 & temp25) 121 temp27 = (temp11 & temp26) 122 temp28 = (temp24  temp27) 123 temp29 = (temp12 & temp7) 124 temp30 = (temp11 & temp29) 125 temp31 = (temp28  temp30) 126 temp32 = (temp9 & temp17) 127 temp33 = (temp32 & temp26) 128 temp34 = (temp31  temp33) 129 temp35 = (temp32 & temp29) 130 temp36 = (temp34  temp35) 131 temp37 = (basis_bits.bit_5 &~ basis_bits.bit_4) 132 temp38 = (temp37 & temp7) 133 temp39 = (temp3 & temp38) 134 temp40 = (temp36  temp39) 135 temp41 = (temp12 & temp25) 136 temp42 = (temp3 & temp41) 137 lex.Special = (temp40  temp42) 138 lex.Percent = (temp3 & temp38) 139 lex.Period = (temp3 & temp22) 140 lex.LAngle = (temp18 & temp13) 141 lex.RAngle = (temp18 & temp22) 142 lex.LBracket = (temp11 & temp26) 143 lex.RBracket = (temp11 & temp29) 144 lex.Slash = (temp3 & temp41) 145 temp43 = (basis_bits.bit_2  basis_bits.bit_3) 146 temp44 = (temp1  temp43) 147 temp45 = (temp4 & temp21) 148 temp46 = (temp29  temp45) 149 lex.EOL = (temp46 &~ temp44) 150 temp47 = (basis_bits.bit_4  basis_bits.bit_5) 151 temp48 = (temp47  temp5) 152 temp49 = (temp44  temp48) 153 temp50 = (temp13 &~ temp44) 154 temp51 = (temp49 &~ temp50) 155 temp52 = (temp29 &~ temp44) 156 temp53 = (temp51 &~ temp52) 157 temp54 = (temp45 &~ temp44) 158 temp55 = (temp53 &~ temp54) 159 temp56 = (temp8 &~ temp44) 160 temp57 = (temp55 &~ temp56) 161 temp58 = (temp3 &~ temp48) 162 temp59 = (temp57 &~ temp58) 163 lex.WS = (~temp59) 164 temp60 = (basis_bits.bit_5  basis_bits.bit_6) 165 temp61 = (basis_bits.bit_4 & temp60) 166 lex.Digit = (temp18 &~ temp61) 167 temp62 = (temp29  temp26) 168 lex.Sign = (temp3 & temp62) 169 temp63 = (temp9 &~ temp43) 170 temp64 = (temp63 &~ basis_bits.bit_4) 171 temp65 = (~temp25) 172 temp66 = ((basis_bits.bit_5 & temp65)(~(basis_bits.bit_5) & temp5)) 173 temp67 = (temp64 & temp66) 174 temp68 = (lex.Digit  temp67) 175 temp69 = (temp9 & temp2) 176 temp70 = (temp69 &~ basis_bits.bit_4) 177 temp71 = (temp70 & temp66) 178 lex.Hex = (temp68  temp71) 179 temp72 = (temp25 &~ temp47) 180 lex.Hash = (temp3 & temp72) 181 lex.CR = (temp29 &~ temp44) 182 lex.LF = (temp45 &~ temp44) 183 lex.Regular = ~lex.Special&~lex.WS 185 184 186 185 def simd_const_4(hexdigit, EOF_mask): … … 318 317 names_Callouts.follows = pablo.ScanThru(firstCharacter, lex.Regular) 319 318 names_Callouts.escapes = (pablo.Advance(pablo.Advance(lex.Hash))&pablo.Advance(lex.Hex)&lex.Hex)&pablo.SpanUpTo(names_Callouts.starts, names_Callouts.follows) 320 marker.mask =firstCharacter&~names_Callouts.follows 319 marker.mask =names_Callouts.starts(firstCharacter&~names_Callouts.follows) 320 321 321 322 322 def Parse_HexStrings(lex, marker, hexStrings_Callouts) : … … 484 484 if data[position+1]==chr(0x0A): 485 485 startpos+=1 486 startpos=position487 486 stream = scan_to_next(stream) 488 487 … … 562 561 i+=1 563 562 return outstring 564 #def Parse_GetObj(lex, marker) :565 # cursor = ( (lex.WS &~ marker.mask)  () )566 563 567 564 basis_bits = Basis_bits()
Note: See TracChangeset
for help on using the changeset viewer.