Mercurial > hg > Members > masakoha > testcode
comparison c/regexParser/node.cc @ 144:d8a4922eceae pairPro
remove some errors (not working)
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 14 Dec 2015 17:14:33 +0900 |
parents | 6c258910cacb |
children | 50217a0545e8 |
comparison
equal
deleted
inserted
replaced
143:32977f5a2ed0 | 144:d8a4922eceae |
---|---|
2 #include "node.h" | 2 #include "node.h" |
3 | 3 |
4 static void printCharacterClass(CharClassPtr cc, long nodeNumber,int d) { | 4 static void printCharacterClass(CharClassPtr cc, long nodeNumber,int d) { |
5 if (cc->type == 'r') { | 5 if (cc->type == 'r') { |
6 printf("%*c",d*4, ' '); | 6 printf("%*c",d*4, ' '); |
7 for (RangeListPtr range = cc->cond->range; range; range = range->next) { | 7 for (RangeList range = cc->cond.range; range.begin != 0; range = *range.next) { |
8 printf("[%c-%c] ",*range->begin,*range->end); | 8 printf("[%c-%c] ",(unsigned char)range.begin,(unsigned char)range.end); |
9 } | 9 } |
10 printf("(%lu)\n",nodeNumber); | 10 printf("(%lu)\n",nodeNumber); |
11 } | 11 } |
12 } | 12 } |
13 | 13 |
17 descendTree(n->left, d); | 17 descendTree(n->left, d); |
18 d--; | 18 d--; |
19 } | 19 } |
20 if (n->tokenType == 'a') { | 20 if (n->tokenType == 'a') { |
21 printf("%*c",d*4, ' '); | 21 printf("%*c",d*4, ' '); |
22 for (int i = 0; i < n->cc->cond->w->length; i++) { | 22 for (int i = 0; i < n->cc->cond.w.length; i++) { |
23 putchar(n->cc->cond->w->word[i]); | 23 putchar(n->cc->cond.w.word[i]); |
24 } | 24 } |
25 printf("(%lu)\n",n->nodeNumber); | 25 printf("(%lu)\n",n->nodeNumber); |
26 } else if (n->tokenType == 'c') { | 26 } else if (n->tokenType == 'c') { |
27 printCharacterClass(n->cc,n->nodeNumber,d); | 27 printCharacterClass(n->cc,n->nodeNumber,d); |
28 } else { | 28 } else { |