Mercurial > hg > GearsTemplate
changeset 245:308368406fe7
Merge
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 25 Jan 2017 03:04:39 +0900 |
parents | d1567718f12c (current diff) 6a80ab36181c (diff) |
children | 421ea91dd76c |
files | |
diffstat | 1 files changed, 14 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/generate_stub.pl Wed Jan 25 01:48:47 2017 +0900 +++ b/src/parallel_execution/generate_stub.pl Wed Jan 25 03:04:39 2017 +0900 @@ -32,9 +32,16 @@ } if (/^\_\_code (\w+)/) { $codeGearName = $1; - while (/struct (\w+)/g) { - $dataGearName{$codeGearName} .= "\t\tGearef(context, " . $1 . ")"; - $dataGearName{$codeGearName} .= ",\n"; + while (/struct (\w+)\*\s(\w+)/g) { + $tmp = lcfirst($1); + if ($tmp ne $2) { + $tmp = ucfirst($2); + $dataGearName{$codeGearName} .= "\t\t(" . $1 . "*)GearImpl(context, " . $tmp . ", " . $2 . ")"; + $dataGearName{$codeGearName} .= ",\n"; + } else { + $dataGearName{$codeGearName} .= "\t\tGearef(context, " . $1 . ")"; + $dataGearName{$codeGearName} .= ",\n"; + } } next; } @@ -76,11 +83,10 @@ open my $fd,">","d/stub.h" or die("can't open d/stub.h $!"); for my $codeGearName ( sort keys %dataGearName ) { print $fd "__code ", $codeGearName ,"_stub (struct Context* context) {\n"; - #print $fd "\tgoto meta(context, \n"; - print $fd "\tgoto meta("; - chomp($dataGearName{$codeGearName}); - chop($dataGearName{$codeGearName}); - print $fd $dataGearName{$codeGearName},"); \n} \n\n"; + print $fd "\tgoto " . $codeGearName . "("; + #print $fd "\tgoto " . $codeGearName . "(context,\n"; + print $fd substr($dataGearName{$codeGearName},2,-2); + print $fd "); \n} \n\n"; } print $fd "\n"; }