# HG changeset patch # User Masataka Kohagura # Date 1450523682 -32400 # Node ID de2438d4146af4c919c1e1ff206fd95236e8673e # Parent 313f1c17632889f2a630becb2ba3247e50527cbe fix diff -r 313f1c176328 -r de2438d4146a regexParser/subsetConstraction.cc --- 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; diff -r 313f1c176328 -r de2438d4146a regexParser/subsetConstraction.h --- 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 {