Mercurial > hg > Members > masakoha > testcode
comparison c/regexParser/subsetConstraction.cc @ 142:de0f332d560c pairPro
insert charClassMerge function
author | masa |
---|---|
date | Fri, 11 Dec 2015 14:54:00 +0900 |
parents | 71f36a59cf6a |
children | 32977f5a2ed0 |
comparison
equal
deleted
inserted
replaced
141:71f36a59cf6a | 142:de0f332d560c |
---|---|
10 if (ts->next == NULL) break; | 10 if (ts->next == NULL) break; |
11 ts = ts->next; | 11 ts = ts->next; |
12 } | 12 } |
13 } | 13 } |
14 | 14 |
15 TGValuePtr generateTransition(NodePtr n,TransitionGeneratorPtr tg) { | 15 TGValue generateTransition(NodePtr n,TransitionGenerator tg) { |
16 TGValuePtr tgv0 = NULL; | |
17 TGValuePtr tgv1 = NULL; | |
18 | 16 |
19 if (n->tokenType == '+') { | 17 if (n->tokenType == '+') { |
20 tgv0 = generateTransition(n->left,tg); | 18 TGValue tgv = generateTransition(n->left,tg); |
21 tgv1 = generateTransition(n->right,tg); | 19 if (tgv.asterisk) { |
20 TGValue tgv1 = generateTransition(n->right,tg); | |
21 tgv.state |= tgv1.state; | |
22 return tgv; | |
23 } | |
24 tgv.state = n->right->nodeNumber; | |
25 return tgv; | |
22 } else if (n->tokenType == '|') { | 26 } else if (n->tokenType == '|') { |
23 tgv0 = generateTransition(n->left,tg); | 27 tgv0 = generateTransition(n->left,tg); |
24 tgv1 = generateTransition(n->right,tg); | 28 tgv1 = generateTransition(n->right,tg); |
25 tg->state->transition = appendTransition(tgv0->ts,tgv1->ts); | 29 tg->state->transition = appendTransition(tgv0->ts,tgv1->ts); |
26 } else if (n->tokenType == '*') { | 30 } else if (n->tokenType == '*') { |