diff c/regexParser/node.cc @ 134:dbafc753078e pairPro

fix concatination & selection & grouping
author masa
date Fri, 04 Dec 2015 17:45:09 +0900
parents a436526756b9
children e1a262ec75f0
line wrap: on
line diff
--- a/c/regexParser/node.cc	Thu Dec 03 20:47:11 2015 +0900
+++ b/c/regexParser/node.cc	Fri Dec 04 17:45:09 2015 +0900
@@ -2,9 +2,9 @@
 #include "node.h"
 
 static void descendTree(NodePtr n, int d) {
-    if (n->right != NULL) {
+    if (n->left != NULL) {
         d++;
-        descendTree(n->right, d);
+        descendTree(n->left, d);
         d--;
     }
     if (n->tokenType != 'a') {
@@ -17,9 +17,9 @@
         printf("(%lu)\n",n->nodeNumber);
     }
 
-    if (n->left != NULL) {
+    if (n->right != NULL) {
         d++;
-        descendTree(n->left, d);
+        descendTree(n->right, d);
         d--;
     }
 }