Changeset 1681 for proto


Ignore:
Timestamp:
Nov 13, 2011, 1:54:30 PM (8 years ago)
Author:
ksherdy
Message:

Consolidated iterator objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/pablo_template.cpp

    r1624 r1681  
    4949ErrorTracker error_tracker;
    5050BitBlock EOF_mask = simd<1>::constant<1>();
    51 
    5251
    5352static inline int NameStrt_check(int pos);
     
    242241static inline void validate_block(BitBlockForwardIterator & start, int block_base, int is_valid(int)) {
    243242
     243        int pos, block_pos;
    244244        BitBlockForwardIterator end;
    245         int pos, block_pos;
    246 
    247245        while(start != end) {
    248246
     
    262260static inline void validate_block(BitBlockForwardIterator & start, int block_base, int buffer_base, int is_valid(int,int)) {
    263261
     262        int pos, block_pos, file_pos;
    264263        BitBlockForwardIterator end;
    265         int pos, block_pos, file_pos;
    266 
    267264        while(start != end) {
    268265
     
    284281
    285282static inline void postprocess_do_block(Lex & lex, CtCDPI_Callouts & ctCDPI_Callouts, Ref_Callouts & ref_Callouts, Check_streams & check_streams, int chars_avail){
    286             tracker.StoreNewlines(lex.LF);
    287 
    288                 if (bitblock_has_bit(simd_or(check_streams.non_ascii_name_starts, check_streams.non_ascii_names))) {
    289                     BitBlockForwardIterator iter_NameStrt_check(&check_streams.non_ascii_name_starts);
    290                         validate_block(iter_NameStrt_check, block_base, NameStrt_check);
    291                         BitBlockForwardIterator iter_Name_check(&check_streams.non_ascii_names);
    292                         validate_block(iter_Name_check, block_base, Name_check);
    293                 }
    294             if (bitblock_has_bit(ctCDPI_Callouts.PI_name_starts)){
    295                 BitBlockForwardIterator iter_PI_name_starts(&(ctCDPI_Callouts.PI_name_starts));
    296                 validate_block(iter_PI_name_starts, block_base, buffer_base, PIName_check);
    297             }
    298             if (bitblock_has_bit(ctCDPI_Callouts.CD_starts)){
    299                 BitBlockForwardIterator iter_CD_check(&ctCDPI_Callouts.CD_starts);
    300                 validate_block(iter_CD_check, block_base, CD_check);
    301             }
    302             if(bitblock_has_bit(ref_Callouts.GenRef_starts)){
    303                 BitBlockForwardIterator iter_GenRef_check(&ref_Callouts.GenRef_starts);
    304                 validate_block(iter_GenRef_check, block_base, GenRef_check);
    305             }
    306             if(bitblock_has_bit(ref_Callouts.DecRef_starts)){
    307                 BitBlockForwardIterator iter_DecRef_check(&ref_Callouts.DecRef_starts);
    308                 validate_block(iter_DecRef_check, block_base, DecRef_check);
    309             }
    310             if(bitblock_has_bit(ref_Callouts.HexRef_starts)){
    311                 BitBlockForwardIterator iter_HexRef_check(&ref_Callouts.HexRef_starts);
    312                 validate_block(iter_HexRef_check, block_base, HexRef_check);
    313             }
    314             if(bitblock_has_bit(check_streams.att_refs)){
    315                 BitBlockForwardIterator iter_AttRef_check(&check_streams.att_refs);
    316                 validate_block(iter_AttRef_check, block_base, AttRef_check);
    317             }
    318 
    319                 if(error_tracker.Has_Noted_Error()){
    320                         int error_line, error_column;
    321                         tracker.get_Line_and_Column(error_tracker.Noted_Pos_In_Block(), error_line, error_column);
    322                         ReportError(error_tracker.Noted_Error_Msg(), error_line, error_column);
    323                         exit(-1);
    324                 }
    325 
    326                 matcher.store_streams(check_streams.tag_marks, check_streams.name_follows, check_streams.misc_mask, chars_avail);
    327                 tracker.AdvanceBlock();
     283BitBlockForwardIterator iter;
     284
     285tracker.StoreNewlines(lex.LF);
     286
     287if (bitblock_has_bit(simd_or(check_streams.non_ascii_name_starts, check_streams.non_ascii_names))) {
     288        iter.init(&check_streams.non_ascii_name_starts);
     289        validate_block(iter, block_base, NameStrt_check);
     290        iter.init(&check_streams.non_ascii_names);
     291        validate_block(iter, block_base, Name_check);
     292}
     293if (bitblock_has_bit(ctCDPI_Callouts.PI_name_starts)){
     294        iter.init(&(ctCDPI_Callouts.PI_name_starts));
     295        validate_block(iter, block_base, buffer_base, PIName_check);
     296}
     297if (bitblock_has_bit(ctCDPI_Callouts.CD_starts)){
     298        iter.init(&ctCDPI_Callouts.CD_starts);
     299        validate_block(iter, block_base, CD_check);
     300}
     301if(bitblock_has_bit(ref_Callouts.GenRef_starts)){
     302        iter.init(&ref_Callouts.GenRef_starts);
     303        validate_block(iter, block_base, GenRef_check);
     304}
     305if(bitblock_has_bit(ref_Callouts.DecRef_starts)){
     306        iter.init(&ref_Callouts.DecRef_starts);
     307        validate_block(iter, block_base, DecRef_check);
     308}
     309if(bitblock_has_bit(ref_Callouts.HexRef_starts)){
     310        iter.init(&ref_Callouts.HexRef_starts);
     311        validate_block(iter, block_base, HexRef_check);
     312}
     313if(bitblock_has_bit(check_streams.att_refs)){
     314        iter.init(&check_streams.att_refs);
     315        validate_block(iter, block_base, AttRef_check);
     316}
     317
     318if(error_tracker.Has_Noted_Error()){
     319        int error_line, error_column;
     320        tracker.get_Line_and_Column(error_tracker.Noted_Pos_In_Block(), error_line, error_column);
     321        ReportError(error_tracker.Noted_Error_Msg(), error_line, error_column);
     322        exit(-1);
     323}
     324
     325matcher.store_streams(check_streams.tag_marks, check_streams.name_follows, check_streams.misc_mask, chars_avail);
     326tracker.AdvanceBlock();
    328327
    329328}
Note: See TracChangeset for help on using the changeset viewer.