Mercurial > hg > Applications > Grep
changeset 146:1c74ac7d56ec pairPro
fix
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 15 Dec 2015 16:20:35 +0900 |
parents | 50217a0545e8 |
children | 84d32375383a |
files | c/regexParser/main.cc c/regexParser/subsetConstraction.cc |
diffstat | 2 files changed, 6 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/c/regexParser/main.cc Mon Dec 14 19:39:16 2015 +0900 +++ b/c/regexParser/main.cc Tue Dec 15 16:20:35 2015 +0900 @@ -20,5 +20,6 @@ printf("regex : %s\n",ri->ptr); NodePtr n = regex(ri); printTree(n); + TransitionGenerator tg = generateTransitionList(n); return 0; }
--- a/c/regexParser/subsetConstraction.cc Mon Dec 14 19:39:16 2015 +0900 +++ b/c/regexParser/subsetConstraction.cc Tue Dec 15 16:20:35 2015 +0900 @@ -5,6 +5,11 @@ static CharClassPtr createCharClassWord(unsigned char *w, CharClassPtr cc1, CharClassPtr cc2) { + CharClassPtr cc = NEW(CharClass); + cc->type = 'a'; + cc->cond.w.word = ri->tokenValue; + cc->cond.w.length = ri->ptr - ri->tokenValue; + cc->nextState.bitContainer = 0; return cc1; } @@ -60,28 +65,8 @@ } } -StatePtr createStateList(NodePtr n) { - StatePtr s0 = NULL; - if (n->left != NULL) { - s0 = createStateList(n->left); - } - - if (n->tokenType == 'a') { - BitVectorPtr bi = createBitVector(n); - StatePtr s1 = createState(bi,0,0); - } else if (n->tokenType == '+' || n->tokenType == '|') { - - } - - if (n->right != NULL) { - s0 = createStateList(n->right); - } - return s0; -} - TransitionGenerator generateTransitionList(NodePtr n) { TransitionGenerator tg; - tg.state = createStateList(n); generateTransition(n,tg); return tg; }