Mercurial > hg > Members > masakoha > testcode
changeset 170:de2438d4146a pairPro
fix
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 19 Dec 2015 20:14:42 +0900 |
parents | 313f1c176328 |
children | 684363c44d6f |
files | regexParser/subsetConstraction.cc regexParser/subsetConstraction.h |
diffstat | 2 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/regexParser/subsetConstraction.cc Sat Dec 19 19:06:35 2015 +0900 +++ b/regexParser/subsetConstraction.cc Sat Dec 19 20:14:42 2015 +0900 @@ -176,16 +176,17 @@ TGValue generateTransition(NodePtr n,TransitionGenerator tg) { TGValue tgv2; if (n->tokenType == '+') { - TGValue tgv = generateTransition(n->left,tg); + TGValue tgv = generateTransition(n->right,tg); + TGValue tgv1 = generateTransition(n->left,tgv.tg); if (tgv.asterisk) { - TGValue tgv1 = generateTransition(n->right,tg); tgv1.ts = mergeTransition(tgv.ts,tgv1.ts); return tgv1; } return tgv; } else if (n->tokenType == '|') { TGValue tgv = generateTransition(n->left,tg); - TGValue tgv1 = generateTransition(n->right,tg); + TGValue tgv1 = generateTransition(n->right,tgv.tg); + tgv.tg = tgv1.tg; tgv.ts = mergeTransition(tgv.ts,tgv1.ts); tgv.asterisk |= tgv1.asterisk; return tgv;
--- a/regexParser/subsetConstraction.h Sat Dec 19 19:06:35 2015 +0900 +++ b/regexParser/subsetConstraction.h Sat Dec 19 20:14:42 2015 +0900 @@ -1,14 +1,21 @@ #include "transition.h" +typedef struct stateStack { + BitVector state; + struct stateStack *next; +} StateStack, *StateStackPtr; + typedef struct transitionGenerator { TransitionPtr ts; StatePtr state; long stateMax; + StateStack stack; } TransitionGenerator, *TransitionGeneratorPtr; typedef struct tgValue { TransitionPtr ts; bool asterisk; + TransitionGeneratorPtr tg; } TGValue, *TGValuePtr; typedef struct charClassStack {