comparison regexParser/threadedSearch.cc @ 246:58de1744d7a9

fix
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Thu, 21 Jan 2016 19:57:48 +0900
parents d34de5edaa96
children 96c2507fd22d
comparison
equal deleted inserted replaced
245:d34de5edaa96 246:58de1744d7a9
1 #include "regexParser.h"
2 #include "subsetConstruction.h"
3
1 struct tsValue; 4 struct tsValue;
2 5
3 typedef struct tState { 6 typedef struct tState {
4 State *state; 7 State *state;
5 void stateSkip(struct TSValue); 8 void stateSkip(struct tsValue);
6 int ccvSize; 9 int ccvSize;
7 struct ccv{ 10 struct ccv{
8 unsigned long begin; 11 unsigned long begin;
9 unsigned long end; 12 unsigned long end;
10 BitVector state; 13 BitVector state;
26 TState *blockEnd; 29 TState *blockEnd;
27 } TSValue, *TSValuePtr; 30 } TSValue, *TSValuePtr;
28 31
29 void stateSkip(TSValue tsv) { 32 void stateSkip(TSValue tsv) {
30 tsv.buff.matchBegin = tsv.buff.buffptr; 33 tsv.buff.matchBegin = tsv.buff.buffptr;
31 tsv.(tsv); 34 tsv.current->stateSkip(tsv);
32 } 35 }
33 36
34 void tSearch(TSValue tsv) { 37 void tSearch(TSValue tsv) {
35 next; while (buff.buffptr < buff.buffend) { 38 next: while (buff.buffptr < buff.buffend) {
36 unsigned char c = *buff.buffptr++; 39 unsigned char c = *buff.buffptr++;
37 for (int i = 0; i < tsv.current->ccvSize; i++) { 40 for (int i = 0; i < tsv.current->ccvSize; i++) {
38 if (c<tsv.current->ccv[i].begin) tsv.current->stateSkip(tsv); 41 if (c<tsv.current->ccv[i].begin) tsv.current->stateSkip(tsv);
39 else if (c<=tsv.current->ccv[i].end) { 42 else if (c<=tsv.current->ccv[i].end) {
40 TStatePtr current = tsv.current->ccv[i].tState; 43 TStatePtr current = tsv.current->ccv[i].tState;