diff src/parallel_execution/generate_stub.pl @ 442:481fce540daf

Fix goto implement method of generate_stub
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Tue, 21 Nov 2017 09:16:12 +0900
parents 3c6af75b13d4
children 0c024ea61601
line wrap: on
line diff
--- a/src/parallel_execution/generate_stub.pl	Tue Nov 21 04:28:36 2017 +0900
+++ b/src/parallel_execution/generate_stub.pl	Tue Nov 21 09:16:12 2017 +0900
@@ -68,7 +68,7 @@
 #
 # generated meta level code
 #
-# Gearef(context, Stack)->stack = nodeStack->stack;
+# Gearef(context, Stack)->stack = (union Data*)nodeStack;
 # Gearef(context, Stack)->data = (union Data*)node;
 # Gearef(context, Stack)->next = C_stackTest3;
 # goto meta(context, nodeStack->push);
@@ -102,9 +102,9 @@
                 if ( -f "$interface.cbc") {
                     &getDataGear("$interface.cbc");
                 }
-            } elsif (/^(\s)*(\w+)\-\>(\w+)\s\=\s\((.*)\)create(\w+)\((.*)\);$/) {
+            } elsif (/\s*\=\s*(.*)create(\w+)\((.*)\);$/) {
                 #my $intfn = ucfirst($2);
-                my $impln = $5;
+                my $impln = $2;
                 if ( -f "$impln.cbc") {
                     &getCodeGear("$impln.cbc");
                 }
@@ -393,7 +393,7 @@
                         $ftype = lcfirst($ntype);
                     }
                 }
-                print $fd "\tGearef(context, $ntype)->$ftype = $next->$ftype;\n";
+                print $fd "\tGearef(context, $ntype)->$ftype = (union Data*) $next;\n";
                 # Put interface argument
                 my $prot = $code{$ntype}->{$method};
                 my $i = 1;
@@ -415,7 +415,7 @@
                     }
                     $i++;
                 }
-                print $fd "${prev}goto meta(context, $next->$ftype->$ntype.$method);\n";
+                print $fd "${prev}goto meta(context, $next->$method);\n";
                 next;
             } elsif(/^(.*)par goto (\w+)\((.*)\);/) {
                 # handling par goto statement