Mercurial > hg > Applications > Grep
diff regexParser/determinize.cc @ 167:3bf2c6d6d53e pairPro
move regexparser dir
author | masa |
---|---|
date | Sat, 19 Dec 2015 15:38:45 +0900 |
parents | c/regexParser/determinize.cc@166136236891 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/regexParser/determinize.cc Sat Dec 19 15:38:45 2015 +0900 @@ -0,0 +1,16 @@ +#include "determinize.h" + +TransitionPtr determinize(TransitionPtr cond, TransitionPtr list) { + TransitionPtr x0 = createTransition(x->condition, x->nextState); + TransitionPtr x1 = x0; + for(;;) { + if (x->next == NULL) { + x1->next = y; + return x0; + } + x = x->next; + x1->next = createTransition(x->condition, x->nextState); + x1 = x1->next; + } + return x0; +}