Changeset 1984


Ignore:
Timestamp:
Mar 28, 2012, 2:13:26 AM (7 years ago)
Author:
ksherdy
Message:

Updated resolve arbitrary symbol length logic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/symbol_table/src/id_symbol_table.hpp

    r1980 r1984  
    1818static void print_symbol_debug(const uint8_t buffer [], const uint32_t spos, const uint32_t epos, const uint32_t lgth) {
    1919    cout << "Symbol(";
    20     cout << "Start: " << spos;
    21     cout << ",End: " << epos;
    22     cout << ",Lgth: " << lgth;
     20    cout << "Start:" << spos;
     21    cout << ",End:" << epos;
     22    cout << ",Lgth:" << lgth;
    2323    cout << ",Value:'" << string((char *)&(buffer[spos]), lgth);
    2424    cout << "')" << endl;
     
    120120        }
    121121        if(bitblock::any(ends_gte_17[blk])) {
    122             print_register("s",starts[blk]);
    123             print_register("e",ends_gte_17[blk]);
    124122        do_block<hash_table<identity_strategy_d, hash_strategy_d, ALLOCATOR> >(hash_table_gte_17, &starts[blk], &ends_gte_17[blk], &buffer[blk*BLOCK_SIZE], (uint8_t *)&h0[blk], (uint8_t *)&h1[blk], BLOCK_SIZE/8);
    125123        }
     
    212210                                  uint8_t h0 [], uint8_t h1 [], const uint32_t h_block_size) {
    213211
     212
    214213    uint32_t lgth;
    215214    ReverseScanner<BitBlock, scanword_t> ends_rscanner(ends);
    216215    ReverseScanner<BitBlock, scanword_t> starts_rscanner(starts);
    217216
    218     cout << ends_rscanner.scan_to_next() << ",";
    219     cout << starts_rscanner.scan_to_next() << endl;
    220 
    221     while(!starts_rscanner.is_done() && (starts_rscanner.get_pos() > ends_rscanner.get_pos())) { // synchronize
    222          cout << starts_rscanner.scan_to_next() << endl;
     217    ends_rscanner.scan_to_next();
     218    starts_rscanner.scan_to_next();
     219
     220    while(starts_rscanner.get_pos() > ends_rscanner.get_pos()) { // synchronize
     221        starts_rscanner.scan_to_next();
    223222    }
    224223
    225224    while((!ends_rscanner.is_done()) && (!starts_rscanner.is_done())) {
    226         lgth = ends_rscanner.get_pos() - starts_rscanner.get_pos();
     225        lgth = ends_rscanner.get_pos() - starts_rscanner.get_pos();
     226
    227227        h_table.lookup_or_insert(buffer, starts_rscanner.get_pos(), lgth, h0, h1, lgth);
    228228
     
    231231#endif
    232232
    233 
    234 
    235         cout << ends_rscanner.scan_to_next() << ",";
    236         cout << starts_rscanner.scan_to_next() << endl;
    237 
    238 
    239     }
    240 
    241     if((!ends_rscanner.is_done()) && (starts_rscanner.is_done())) { // block boundary case, previous block
     233        ends_rscanner.scan_to_next();
     234        starts_rscanner.scan_to_next();
     235
     236        while(starts_rscanner.get_pos() > ends_rscanner.get_pos()) { // synchronize
     237            starts_rscanner.scan_to_next();
     238        }
     239
     240    }
     241
     242    if((!ends_rscanner.is_done()) && (starts_rscanner.is_done())) { // block boundary case, goto previous block
    242243
    243244        uint32_t lb_blk = 0;
    244245        while(1) {
     246
    245247            starts_rscanner.init(--starts);
    246248            starts_rscanner.scan_to_next();
Note: See TracChangeset for help on using the changeset viewer.