Changeset 3066


Ignore:
Timestamp:
Apr 22, 2013, 3:01:18 PM (6 years ago)
Author:
lindanl
Message:

New comment and string parsing

Location:
proto/PDF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/PDF/cb_pablo.py

    r3065 r3066  
    360360        # as definite comment delimiters.
    361361        comment_start = line_ends1 & lex.Percent
    362         out_Callouts.mask = pablo.InclusiveSpan(comment_start, pablo.ScanTo(comment_start, lex.EOL))
     362        comment_end = pablo.ScanTo(comment_start, lex.EOL)
     363        out_Callouts.mask = pablo.InclusiveSpan(comment_start, comment_end)
     364        out_Callouts.mask |= instring
    363365        #
    364366        # Any closing paren that was not actually used to close
     
    366368        marker.starts = pablo.Advance(~instring) & instring
    367369        marker.ends = pablo.ScanThru(marker.starts, instring)
    368         marker.error |= escape_Callouts.RParen &~ closed_RParen &~ pablo.SpanUpTo(matches.comment_start, matches.comment_end)
     370        marker.error |= escape_Callouts.RParen &~ closed_RParen &~ pablo.SpanUpTo(comment_start, comment_end)
    369371
    370372
     
    569571
    570572def Main(basis_bits, lex, escape_Callouts, out_Callouts):
    571 
    572         Classify_bytes(basis_bits, lex)
    573 
    574         Parse_Escaped(lex, parity, escape_Callouts, out_Callouts)
    575 
    576         Match_Parens_With_Comments(lex, escape_Callouts, marker, out_Callouts)
    577        
    578         Parse_HexStrings(lex, marker, out_Callouts)
    579 
    580         Normalize_WS(lex, out_Callouts)
    581 
    582         Prepare_content_buffer(basis_bits, lex, escape_Callouts, out_Callouts)
    583 
    584 
    585 
     573  pass
     574
     575
     576
     577
  • proto/PDF/cb_template.cpp

    r2957 r3066  
    364364    for (int i = 0; i < BLOCKS-1; i++){
    365365      parse_Escaped.do_block(lex[i], parity, escape_Callouts, out_Callouts, lex[i+1]);
    366       parse_Comment.do_block(lex[i], escape_Callouts, marker[i], out_Callouts);
    367       parse_String.do_block(escape_Callouts, marker[i], out_Callouts);
     366      match_Parens_With_Comments.do_block(lex[i], escape_Callouts, marker[i], out_Callouts);
     367//       parse_Comment.do_block(lex[i], escape_Callouts, marker[i], out_Callouts);
     368//       parse_String.do_block(escape_Callouts, marker[i], out_Callouts);
    368369      parse_HexStrings.do_block(lex[i], marker[i], out_Callouts);
    369370      parse_Names.do_block(lex[i], marker[i], out_Callouts, lex[i+1]);
     
    378379    classify_bytes.do_block(basis_bits[0], lex[0]);   
    379380    parse_Escaped.do_block(lex[BLOCKS-1], parity, escape_Callouts, out_Callouts, lex[0]);
    380     parse_Comment.do_block(lex[BLOCKS-1], escape_Callouts, marker[BLOCKS-1], out_Callouts);
    381     parse_String.do_block(escape_Callouts, marker[BLOCKS-1], out_Callouts);
     381    match_Parens_With_Comments.do_block(lex[BLOCKS-1], escape_Callouts, marker[BLOCKS-1], out_Callouts);
     382//     parse_Comment.do_block(lex[BLOCKS-1], escape_Callouts, marker[BLOCKS-1], out_Callouts);
     383//     parse_String.do_block(escape_Callouts, marker[BLOCKS-1], out_Callouts);
    382384    parse_HexStrings.do_block(lex[BLOCKS-1], marker[BLOCKS-1], out_Callouts);
    383385    parse_Names.do_block(lex[BLOCKS-1], marker[BLOCKS-1], out_Callouts, lex[0]);
     
    408410    for (int i = 0; i < BLOCKS-1; i++){
    409411      parse_Escaped.do_block(lex[i], parity, escape_Callouts, out_Callouts, lex[i+1]);
    410       parse_Comment.do_block(lex[i], escape_Callouts, marker[i], out_Callouts);
    411       parse_String.do_block(escape_Callouts, marker[i], out_Callouts);
     412      match_Parens_With_Comments.do_block(lex[i], escape_Callouts, marker[i], out_Callouts);
     413//       parse_Comment.do_block(lex[i], escape_Callouts, marker[i], out_Callouts);
     414//       parse_String.do_block(escape_Callouts, marker[i], out_Callouts);
    412415      parse_HexStrings.do_block(lex[i], marker[i], out_Callouts);
    413416      parse_Names.do_block(lex[i], marker[i], out_Callouts, lex[i+1]);
     
    423426    EOF_mask = bitblock::srl(simd<1>::constant<1>(), convert(BLOCK_SIZE-chars_avail));
    424427    parse_Escaped.do_final_block(lex[BLOCKS-1], parity, escape_Callouts, out_Callouts, EOF_mask);
    425     parse_Comment.do_final_block(lex[BLOCKS-1], escape_Callouts, marker[BLOCKS-1], out_Callouts, EOF_mask);
    426     parse_String.do_final_block(escape_Callouts, marker[BLOCKS-1], out_Callouts, EOF_mask);
     428    match_Parens_With_Comments.do_final_block(lex[BLOCKS-1], escape_Callouts, marker[BLOCKS-1], out_Callouts, EOF_mask);
     429//     parse_Comment.do_final_block(lex[BLOCKS-1], escape_Callouts, marker[BLOCKS-1], out_Callouts, EOF_mask);
     430//     parse_String.do_final_block(escape_Callouts, marker[BLOCKS-1], out_Callouts, EOF_mask);
    427431    parse_HexStrings.do_final_block(lex[BLOCKS-1], marker[BLOCKS-1], out_Callouts, EOF_mask);
    428432    parse_Names.do_final_block(lex[BLOCKS-1], marker[BLOCKS-1], out_Callouts, EOF_mask);
     
    443447//       printf("%i,%i\n",numbers[i],dec_pl[i]);
    444448/*   
    445     for(int i=0; i<10;i++){
     449    for(int i=0; i<100;i++){
    446450      if(tokenArray[i].type==str_token){
    447451        printf("String: ");
     
    472476          printf("%c",tokenArray[i].token.char_ptr[j]);
    473477        printf("\n");
    474       }
    475 
    476     }*/
     478      }*/
     479
     480    }
    477481     
    478482
Note: See TracChangeset for help on using the changeset viewer.