Changeset 8 for trunk/src/bitlex.c


Ignore:
Timestamp:
Dec 22, 2007, 7:27:46 PM (11 years ago)
Author:
cameron
Message:

Sentinels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bitlex.c

    r7 r8  
    114114#endif
    115115}
     116#if BYTE_ORDER == BIG_ENDIAN
     117#define sisd_sfl(blk, n) sisd_srl(blk, n)
     118#endif
     119#if BYTE_ORDER == LITTLE_ENDIAN
     120#define sisd_sfl(blk, n) sisd_sll(blk, n)
     121#endif
     122
     123
     124void Lexer::EstablishSentinels(int code_units) {
     125  if (code_units < BUFFER_BLOCKS * BLOCKSIZE + LOOKAHEAD_POSITIONS) {
     126    ((unsigned char *) parsing_engine_data->x8data)[code_units] = '\0';
     127    if (code_units < BUFFER_BLOCKS * BLOCKSIZE) {
     128      BitBlock bitstream_sentinel =
     129        sisd_sfl(simd_const_1(1), sisd_from_int(code_units % BLOCKSIZE));
     130      int lastblk = code_units/BLOCKSIZE;
     131      for (int j = MarkupStart; j < LexicalItemCount; j++) {
     132        parsing_engine_data->item_stream[j][lastblk] =
     133          simd_or(parsing_engine_data->item_stream[j][lastblk], bitstream_sentinel);
     134      }
     135    }
     136  }
     137}
Note: See TracChangeset for help on using the changeset viewer.