comparison c/regexParser/node.cc @ 131:a436526756b9 pairPro

fix printTree
author masa
date Wed, 02 Dec 2015 18:01:32 +0900
parents 7925e9abb078
children dbafc753078e
comparison
equal deleted inserted replaced
130:7925e9abb078 131:a436526756b9
8 d--; 8 d--;
9 } 9 }
10 if (n->tokenType != 'a') { 10 if (n->tokenType != 'a') {
11 printf("%*c%c(%lu)\n",d*4, ' ',n->tokenType,n->nodeNumber); 11 printf("%*c%c(%lu)\n",d*4, ' ',n->tokenType,n->nodeNumber);
12 } else { 12 } else {
13 printf("%*c%s(%lu)\n",d*4, ' ',n->cc->cond->w->word,n->nodeNumber); 13 printf("%*c",d*4, ' ');
14 for (int i = 0; i < n->cc->cond->w->length; i++) {
15 putchar(n->cc->cond->w->word[i]);
16 }
17 printf("(%lu)\n",n->nodeNumber);
14 } 18 }
15 19
16 if (n->left != NULL) { 20 if (n->left != NULL) {
17 d++; 21 d++;
18 descendTree(n->left, d); 22 descendTree(n->left, d);