Mercurial > hg > Applications > Grep
comparison c/regexParser/printTree.cc @ 89:50a146c05192
add NodeNumber in Regex Parser tree
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 23 Oct 2015 17:20:54 +0900 |
parents | 52da06c3f050 |
children | d139af3bbd67 |
comparison
equal
deleted
inserted
replaced
88:7809fb223dc9 | 89:50a146c05192 |
---|---|
6 if (n->right != NULL) { | 6 if (n->right != NULL) { |
7 d++; | 7 d++; |
8 descendTree(n->right); | 8 descendTree(n->right); |
9 d--; | 9 d--; |
10 } | 10 } |
11 printf("%*c%c\n",d*4, ' ',n->Value.character); | 11 if (n->tokenType == 'a') { |
12 printf("%*c(%d)%c\n",d*4, ' ',n->nodeNumber,n->Value.character); | |
13 } else { | |
14 printf("%*c%c\n",d*4, ' ',n->Value.character); | |
15 } | |
16 | |
12 if (n->left != NULL) { | 17 if (n->left != NULL) { |
13 d++; | 18 d++; |
14 descendTree(n->left); | 19 descendTree(n->left); |
15 d--; | 20 d--; |
16 } | 21 } |