Changeset 842 for proto/parabix2/src


Ignore:
Timestamp:
Dec 18, 2010, 3:45:01 PM (9 years ago)
Author:
lindanl
Message:

Report error positions with line/column

Location:
proto/parabix2/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/src/LineColTracker.h

    r840 r842  
    2323  public:
    2424    LineColTracker();
    25     int getLineNumber(BitBlock marker);
    26     int getColNumber(BitBlock marker);
     25    int getLineNumber(int mark_pos);
     26    int getColNumber(int mark_pos);
    2727    inline void AdvanceBlock();
    2828    inline void StoreNewlines(BitBlock newline);
    29     void UpdateFromNewLineBuffer(BitBlock[] newline_strm; int blk_count);
    3029  private:
    3130    BitBlock BitParallelCounter[MAX_COUNTER_BITS];
     
    5958}
    6059
    61 int LineColTracker::getLineNumber(BitBlock marker){
     60int LineColTracker::getLineNumber(int mark_pos){
    6261  int lines = 1;
    63   int mark_pos = count_forward_zeroes(marker);
    6462  cur_newline = simd_andc(cur_newline, sisd_sfl(simd_const_1(1),sisd_from_int(mark_pos)));
    6563 
     
    7371}
    7472
    75 int LineColTracker::getColNumber(BitBlock marker){
    76   int mark_pos = count_forward_zeroes(marker);
     73int LineColTracker::getColNumber(int mark_pos){
    7774  cur_newline = simd_andc(cur_newline, sisd_sfl(simd_const_1(1),sisd_from_int(mark_pos)));
    7875  if(bitblock_has_bit(cur_newline))
    79     return mark_pos - (BLOCK_SIZE-count_backward_zeroes(cur_newline));
     76    return mark_pos - (BLOCK_SIZE-count_backward_zeroes(cur_newline))+1;
    8077  else
    8178    return BLOCK_SIZE*blocks_after_last_newline_block +
     
    8784}
    8885
    89 void LineColTracker::UpdateFromNewLineBuffer(BitBlock[] newline_strm; int blk_count) {
    90   int i, j, k;
    91   int last_blk = blk_count - 1;
    92   /* in case we find no newlines within the buffer, the
    93      number of blocks after the last newline grows by the
    94      full blk_count. */
    95   blocks_after_last_newline_block += blk_count;
    96   for (i = last_blk; i >= 0; i--) {
    97     if (bitblock_has_bit(newline_strm[i]) {
    98       last_block_with_newline = newline_strm[i];
    99       blocks_after_last_newline_block = last_blk - i;
    100       break;
    101     }
    102   last_blk = i; /* No newlines after this block. */
    103   j = 0;
    104   /* Process 7 blocks of the newline stream at a time. */
    105   while (j + 7 <= last_blk) {
    106     BitBlock s1, s2, c1, c2, t0, t1, t2;
    107     bitwise_full_add(newline_strm[j], newline_strm[j+1], newline_strm[j+2], s1, c1);
    108     bitwise_full_add(newline_strm[j+3], newline_strm[j+4], newline_strm[j+5], s2, c2);
    109     bitwise_half_add(s1, s2, newline_strm[j+6], t0, c3);  /* t0 is bit0 of 7 block sum */
    110     bitwise_full_add(c1, c2, c3, t1, t2); /*t1 and t2 are bits 1 and 2  of 7 block sum. */
    111     bitwise_half_add(t0, BitParallelCounter[0], BitParallelCounter[0], carry);
    112     bitwise_full_add(t1, BitParallelCounter[1], carry, BitParallelCounter[1], carry);
    113     bitwise_full_add(t2, BitParallelCounter[2], carry, BitParallelCounter[2], carry);
    114     bitwise_half_add(BitParallelCounter[3], carry, BitParallelCounter[3], carry);
    115     k = 3;
    116     while(bitblock_has_bit(carry)){
    117       k++;
    118       bitwise_half_add(carry,BitParallelCounter[k],BitParallelCounter[k],carry);
    119     }
    120   }
    121   while (j <= last_blk) {
    122     bitwise_half_add(newline_strm[j], BitParallelCounter[0], BitParallelCounter[0], carry);
    123     k = 0;
    124     while(bitblock_has_bit(carry)){
    125       k++;
    126       bitwise_half_add(carry,BitParallelCounter[k],BitParallelCounter[k],carry);
    127     }
    128   }
    129 }
    13086
    131 
  • proto/parabix2/src/perf_script.py

    r812 r842  
    44
    55
    6 testfile_home = "../../../../TD/"
     6testfile_home = "../../../../../TD/"
    77#programs = ['xmlwf','expat','Xerces_SAX','Xerces_DOM']
    8 programs = ['xmlwf']
     8programs = ['xmlwf','xmlwf_old']
    99testfiles = ['dew.xml','jaw.xml','arw.xml','po.xml','roads-2.gml','soap.xml']
    1010#testfiles = ['dew.u16','jaw.u16','po.u16','roads-2.u16','soap.u16']
Note: See TracChangeset for help on using the changeset viewer.