Mercurial > hg > Members > masakoha > testcode
changeset 287:2f3e7bba038e
fix \
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 31 Jan 2016 22:59:59 +0900 |
parents | 555ca452f031 |
children | f2491681914e |
files | regexParser/TODO regexParser/regexParser.cc regexParser/subsetConstruction.cc |
diffstat | 3 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/regexParser/TODO Sun Jan 31 22:07:53 2016 +0900 +++ b/regexParser/TODO Sun Jan 31 22:59:59 2016 +0900 @@ -3,6 +3,11 @@ (mili|have) のsubset construction のミス tSearch の segv + '(main|int) ' + '(main|int)\(' + + とかが動かない。 + Sat Jan 2 15:29:16 JST 2016 kono stateよりもstate transitionの方が大きいので、subset contructionで CharClassWalkするのは良くない。
--- a/regexParser/regexParser.cc Sun Jan 31 22:07:53 2016 +0900 +++ b/regexParser/regexParser.cc Sun Jan 31 22:59:59 2016 +0900 @@ -207,6 +207,11 @@ \\ \utf-8 etc... */ + ri->ptr++; + ri->tokenType = 'a'; + ri->tokenValue = ri->ptr; + ri->ptr++; + return; } else if (ri->ptr[0] == '[') { ri->ptr++; ri->tokenType = 'c'; @@ -215,9 +220,9 @@ } else { ri->tokenType = 'a'; ri->tokenValue = ri->ptr; - if (isalnum(ri->ptr[0])) { + // if (isalnum(ri->ptr[0])) { ri->ptr++; - } + // } return; } } @@ -237,6 +242,8 @@ n = regex(ri); if (ri->tokenType != ')') { // error + fprintf(stderr,"unclosed ')' before %s \n", ri->ptr); + return createNode(ri,0,0,0,0); } token(ri); }
--- a/regexParser/subsetConstruction.cc Sun Jan 31 22:07:53 2016 +0900 +++ b/regexParser/subsetConstruction.cc Sun Jan 31 22:59:59 2016 +0900 @@ -288,6 +288,7 @@ return tgvLeft; } else if (n->tokenType == '|') { TGValue tgv1 = generateTransition(n->left,tgv,pass); + tgv1.endState = tgv.endState; TGValue tgv2 = generateTransition(n->right,tgv1,pass); return tgv2; } else if (n->tokenType == '*') {