Mercurial > hg > Members > masakoha > testcode
changeset 198:35608dc85e83
add test
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 26 Dec 2015 17:23:25 +0900 (2015-12-26) |
parents | 9f96223f54aa |
children | b8bc24abaf8a |
files | regexParser/Makefile regexParser/subsetConstraction.cc |
diffstat | 2 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/regexParser/Makefile Sat Dec 26 13:51:11 2015 +0900 +++ b/regexParser/Makefile Sat Dec 26 17:23:25 2015 +0900 @@ -25,6 +25,7 @@ test: ./$(TARGET) -regex 'a' ./$(TARGET) -regex 'ab' + ./$(TARGET) -regex 'a*b' ./$(TARGET) -regex 'ab*' ./$(TARGET) -regex '(ab)*' ./$(TARGET) -regex '(ab)*c'
--- a/regexParser/subsetConstraction.cc Sat Dec 26 13:51:11 2015 +0900 +++ b/regexParser/subsetConstraction.cc Sat Dec 26 17:23:25 2015 +0900 @@ -229,6 +229,7 @@ TGValue stateAllocate(NodePtr n,TGValue tgv) { if (n->tokenType == '+') { TGValue tgvLeft = stateAllocate(n->left,tgv); + n->left->state = createState(tgvLeft,n->left); if (tgvLeft.asterisk) { TGValue tgvRight = tgvLeft; tgvRight.asterisk = false; @@ -339,9 +340,12 @@ printf("state : %lx\n",state->bitState.bitContainer); long nodeNumber = 0; if (state->node) { - printf("node : %c %lx -> %d\n",state->node->tokenType,state->bitState.bitContainer,state->node->nextStateNum); + if (state->node->nextState) { + printf("node : %c %lx -> %lx\n",state->node->tokenType, + state->bitState.bitContainer,state->node->nextState->bitState.bitContainer); if (state->node->state) nodeNumber = state->node->state->bitState.bitContainer; + } } if (state->cc) { printCharacterClass(state->cc,nodeNumber,4);