comparison c/regexParser/subsetConstraction.cc @ 139:6c258910cacb pairPro

remove some warning and error
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Mon, 07 Dec 2015 02:20:13 +0900
parents c292c67b3100
children 71f36a59cf6a
comparison
equal deleted inserted replaced
138:ea2810db8d87 139:6c258910cacb
1 #include <stdio.h> 1 #include <stdio.h>
2 #include <stdlib.h> 2 #include <stdlib.h>
3 #include <ctype.h> 3 #include <ctype.h>
4 #include "subsetConstraction.h" 4 #include "subsetConstraction.h"
5 5
6 typedef struct transitionGenerator { 6 TGValuePtr generateTransition(NodePtr n,TransitionGeneratorPtr tg) {
7 TransitionListPtr tl; 7 TGValuePtr t = NULL;
8 StatePtr state;
9 long stateMax;
10 } TransitionGenerator, *TransitionGeneratorPtr;
11
12 typedef struct tgValue {
13 TransitionListPtr tl;
14 bool asterisk;
15 } TGValue, *TGValuePtr;
16
17 TGValue generateTransitionList(NodePtr n,TransitionGeneretorPtr tg) {
18
19 if (n->left != NULL) { 8 if (n->left != NULL) {
20 TGValue tl = generateTransitionList(n->left, tg); 9 t = generateTransition(n->left, tg);
21 } 10 }
22 if (n->tokenType == 'a') { 11 if (n->tokenType == 'a') {
23 printf("%*c",d*4, ' '); 12
24 for (int i = 0; i < n->cc->cond->w->length; i++) {
25 putchar(n->cc->cond->w->word[i]);
26 }
27 printf("(%lu)\n",n->nodeNumber);
28 } else if (n->tokenType == 'c') { 13 } else if (n->tokenType == 'c') {
29 TGValue tl = generateTransitionList(n->cc,tg); 14 t = generateTransition(n,tg);
30 } else { 15 } else {
31 printf("%*c%c(%lu)\n",d*4, ' ',n->tokenType,n->nodeNumber); 16
32 } 17 }
33 18
34 if (n->right != NULL) { 19 if (n->right != NULL) {
35 TGValue tl = generateTransitionList(n->right, tg); 20 t = generateTransition(n->right, tg);
36 } 21 }
22 return t;
37 } 23 }