Mercurial > hg > Applications > Grep
comparison regexParser/cerium/ppe/Exec.cc @ 298:63213964502a
refactoring ....
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 03 Feb 2016 12:24:34 +0900 |
parents | bcb3b0cd5604 |
children | 27414e6fb33c |
comparison
equal
deleted
inserted
replaced
297:c5a7caa37f61 | 298:63213964502a |
---|---|
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(TransitionGeneratorPtr tg,Buffer buff,int task_spawned) { |
14 TSValue tsv; | 14 TSValue tsv = createTSValue(tg,buff); |
15 BlockOutput blk; | 15 BlockOutput blk; |
16 tsv.buff = buff; | |
17 tsv.tg = tg; | |
18 tsv.blk = &blk; | 16 tsv.blk = &blk; |
19 if (task_spawned == 0) { | 17 if (task_spawned == 0) { |
20 tsv.current = tg->stateStart->tState; | 18 tsv.current = tg->stateStart->tState; |
21 } else { | 19 } else { |
22 tsv.current = tg->anyState->tState; | 20 tsv.current = tg->anyState->tState; |
24 tsv.blk->result = NULL; | 22 tsv.blk->result = NULL; |
25 ResultPtr result = NULL; | 23 ResultPtr result = NULL; |
26 tsv.blk->resultEnd = &result; | 24 tsv.blk->resultEnd = &result; |
27 unsigned char *end = tsv.buff.buffend; | 25 unsigned char *end = tsv.buff.buffend; |
28 tsv.buff.buffend = tsv.buff.buff+1; | 26 tsv.buff.buffend = tsv.buff.buff+1; |
29 tsv.matchBegin = tsv.buff.buffptr; | |
30 tsv.matchEnd = NULL; | |
31 tsv = tSearch(tsv); | 27 tsv = tSearch(tsv); |
32 tsv.blk->blockBegin = tsv.current; | 28 tsv.blk->blockBegin = tsv.current; |
33 tsv.buff.buffend = end; | 29 tsv.buff.buffend = end; |
34 tsv = tSearch(tsv); | 30 tsv = tSearch(tsv); |
35 tsv.blk->blockEnd = tsv.current; | 31 tsv.blk->blockEnd = tsv.current; |
77 o_data[0] = (unsigned long)tsv.blk->result; | 73 o_data[0] = (unsigned long)tsv.blk->result; |
78 o_data[1] = (unsigned long)tsv.blk->blockBegin->state; | 74 o_data[1] = (unsigned long)tsv.blk->blockBegin->state; |
79 o_data[2] = (unsigned long)tsv.blk->blockEnd->state; | 75 o_data[2] = (unsigned long)tsv.blk->blockEnd->state; |
80 return 0; | 76 return 0; |
81 } | 77 } |
78 | |
79 /* end */ |