Mercurial > hg > GearsTemplate
changeset 251:0ab52d6e2fd9
fix sub generateStub
author | mir3636 |
---|---|
date | Thu, 26 Jan 2017 09:38:09 +0900 |
parents | 8a8963ce9858 |
children | 682b1195e604 |
files | src/parallel_execution/generate_stub.pl |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/generate_stub.pl Wed Jan 25 21:22:56 2017 +0900 +++ b/src/parallel_execution/generate_stub.pl Thu Jan 26 09:38:09 2017 +0900 @@ -96,11 +96,11 @@ } sub generateStub { - my($fd,$prevCodeGearName) = @_; + my($fd,$prevCodeGearName,$dataGearName) = @_; print $fd "__code ", $prevCodeGearName ,"_stub (struct Context* context) {\n"; - print $fd $dataGearName{$codeGearName}; + print $fd $dataGearName; print $fd "\n} \n\n"; - $stub{$prevCodeGearName."_stub"} = 1; + return 1; } sub generateDataGear { @@ -118,12 +118,13 @@ my $prevCodeGearName; my $inTypedef = 0; my %stub; + my $codeGearName; while (<$in>) { if (! $inTypedef) { if (/^typedef struct (\w+) {/) { $inTypedef = 1; } elsif (/^\_\_code (\w+)/) { - my $codeGearName = $1; + $codeGearName = $1; if ($codeGearName =~ /_stub$/) { $stub{$codeGearName} = 1; print $fd $_; @@ -135,7 +136,7 @@ print $fd $_; next; } - &generateStub; + $stub{$prevCodeGearName."_stub"} = &generateStub($fd,$prevCodeGearName,$dataGearName{$codeGearName}); } $prevCodeGearName = $codeGearName; } elsif (/^(.*)goto next\(\.\.\.(.*)\);/) { @@ -155,7 +156,7 @@ } if (defined $prevCodeGearName) { if (!defined $stub{$prevCodeGearName."_stub"}) { - &generateStub; + $stub{$prevCodeGearName."_stub"} = &generateStub($fd,$prevCodeGearName,$dataGearName{$codeGearName}); } } }