comparison regexParser/threadedSearch.cc @ 283:fbdb94df9eac

TState atomic update
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Sun, 31 Jan 2016 20:08:04 +0900
parents 87a801c14117
children 3ea12df96bcf
comparison
equal deleted inserted replaced
282:87a801c14117 283:fbdb94df9eac
27 } 27 }
28 28
29 TStatePtr generateTState(StatePtr state, TransitionGeneratorPtr tg) { 29 TStatePtr generateTState(StatePtr state, TransitionGeneratorPtr tg) {
30 TStatePtr tState = NEW(TState); 30 TStatePtr tState = NEW(TState);
31 tState->state = state; 31 tState->state = state;
32 state->tState = tState;
33 int ccvSize = 0; 32 int ccvSize = 0;
34 CharClassWalkerPtr ccw = createCharClassWalker(state->cc); 33 CharClassWalkerPtr ccw = createCharClassWalker(state->cc);
35 while (hasNext(ccw)) { 34 while (hasNext(ccw)) {
36 getNext(ccw); 35 getNext(ccw);
37 ccvSize++; 36 ccvSize++;
60 ccv->tState = NULL; 59 ccv->tState = NULL;
61 ccv->state = cc->nextState; 60 ccv->state = cc->nextState;
62 ccv->w = cc->cond.w; 61 ccv->w = cc->cond.w;
63 } 62 }
64 free(ccw); 63 free(ccw);
64 state->tState = tState;
65 return tState; 65 return tState;
66 } 66 }
67 67
68 TStatePtr nextTState(BitVector bi,TransitionGeneratorPtr tg) { 68 TStatePtr nextTState(BitVector bi,TransitionGeneratorPtr tg) {
69 // create tSearch in next state. 69 // create tSearch in next state.