diff src/parallel_execution/generate_stub.pl @ 462:8d7e5d48cad3

Running CPU examples
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Wed, 20 Dec 2017 22:05:08 +0900
parents 6b71cf5b1c22
children 7d67c9cf09ee
line wrap: on
line diff
--- a/src/parallel_execution/generate_stub.pl	Wed Dec 20 17:54:15 2017 +0900
+++ b/src/parallel_execution/generate_stub.pl	Wed Dec 20 22:05:08 2017 +0900
@@ -162,7 +162,7 @@
                         my $next = $2;
                         my @args = split(/,/,$3);
                         push(@{$code{$name}->{$method}},"\_\_code $next");
-                    } elsif ($args =~ s/^(struct|union)?\s*(\w+)(\*)?+\s(\w+)//) {
+                    } elsif ($args =~ s/^(struct|union)?\s*(\w+)(\*)*+\s(\w+)//) {
                         my $structType = $1;
                         my $typeName = $2;
                         my $varName = $4;
@@ -294,6 +294,10 @@
                 $inTypedef = 1;
             } elsif (/^int main\((.*)\) \{/) {
                 $inMain = 1;
+            } elsif(/^#include "(.*)"/) {
+                my $interfaceHeader = $1;
+                # interface include not write
+                next unless ($interfaceHeader =~ /context.h/);
             } elsif (/^\_\_code (\w+)\((.*)\)(.*)/) {
                 %localVarType = {};
                 $codeGearName = $1;
@@ -539,8 +543,7 @@
                 my $varName = $3;
                 $localVarType{$varName} = $type;
                 s/new\s+(\w+)\(\)/\&ALLOCATE(context, \1)->\1/g;   # replacing new
-            }
-            elsif(/^}/) {
+            } elsif(/^}/) {
                 $inParGoto = 0;
             } else {
                 s/new\s+(\w+)\(\)/\&ALLOCATE(context, \1)->\1/g;   # replacing new