comparison regexParser/cerium/ppe/Exec.cc @ 303:cc770cd8d000

parallel retrying seach worked
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 08 Feb 2016 11:56:13 +0900
parents 27414e6fb33c
children c48a8671ce34
comparison
equal deleted inserted replaced
302:27414e6fb33c 303:cc770cd8d000
8 #include "CeriumMain.h" 8 #include "CeriumMain.h"
9 9
10 /* これは必須 */ 10 /* これは必須 */
11 SchedDefineTask1(Exec,blockedGrep); 11 SchedDefineTask1(Exec,blockedGrep);
12 12
13 TSValue blockSearch(TransitionGeneratorPtr tg,Buffer buff,int task_spawned) { 13 TSValue blockSearch(TSValue tsv,Buffer buff,int task_spawned) {
14 TSValue tsv = createTSValue(tg,buff); 14 tsv.current = tsv.tg->stateStart->tState;
15 BlockOutput blk;
16 tsv.blk = &blk;
17 tsv.current = tg->stateStart->tState;
18 tsv.blk->result = NULL; 15 tsv.blk->result = NULL;
19 ResultPtr result = NULL; 16 ResultPtr result = NULL;
20 tsv.blk->resultEnd = &result; 17 tsv.blk->resultEnd = &result;
21 unsigned char *end = tsv.buff.buffend; 18 tsv.blk->blockBegin = tsv.current;
22 tsv.buff.buffend = end;
23 tsv = tSearch(tsv); 19 tsv = tSearch(tsv);
24 tsv.blk->blockEnd = tsv.current; 20 tsv.blk->blockEnd = tsv.current;
25 addResult(tsv,true,buff.buff,buff.buffend); // entire buffer 21 addResult(tsv,true,buff.buff,buff.buffend); // entire buffer
26 if (tsv.blk->blockEnd->state->bitState.bitContainer != 1) { 22 if (tsv.blk->blockEnd->state->bitState.bitContainer != 1) {
27 if (tsv.matchBegin != tsv.buff.buffptr) { 23 if (tsv.matchBegin != tsv.buff.buffptr) {
54 } 50 }
55 TransitionGeneratorPtr tg = (TransitionGeneratorPtr)w->global; 51 TransitionGeneratorPtr tg = (TransitionGeneratorPtr)w->global;
56 Buffer buff; 52 Buffer buff;
57 buff.buff = buff.buffptr = i_data; 53 buff.buff = buff.buffptr = i_data;
58 buff.buffend = buff.buff + length; 54 buff.buffend = buff.buff + length;
59 TSValue tsv = blockSearch(tg,buff,task_spawned); 55 BlockOutput blk;
56 TSValue tsv = createTSValue(tg,buff);
57 tsv.blk = &blk;
58 tsv = blockSearch(tsv,buff,task_spawned);
60 // resultPrint(tsv.result,"Exec"); 59 // resultPrint(tsv.result,"Exec");
61 o_data[0] = (unsigned long)tsv.blk->result; 60 o_data[0] = (unsigned long)tsv.blk->result;
62 o_data[1] = (unsigned long)tsv.blk->blockBegin->state; 61 o_data[1] = (unsigned long)tsv.blk->blockBegin->state; // never used now
63 o_data[2] = (unsigned long)tsv.blk->blockEnd->state; 62 o_data[2] = (unsigned long)tsv.blk->blockEnd->state;
64 return 0; 63 return 0;
65 } 64 }
66 65
67 /* end */ 66 /* end */