comparison src/parallel_execution/generate_stub.pl @ 497:809974b25ecb

Genrate stub for MultiDimIterator
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Mon, 01 Jan 2018 06:37:29 +0900
parents 82f0c49750f1
children 62a77785cb2b
comparison
equal deleted inserted replaced
495:2e7ea81e5943 497:809974b25ecb
124 # gather type name and type 124 # gather type name and type
125 $dataGear{$name} .= $_; 125 $dataGear{$name} .= $_;
126 if (/^\s*(.*)\s+(\w+);$/ ) { 126 if (/^\s*(.*)\s+(\w+);$/ ) {
127 my $ttype = $1; 127 my $ttype = $1;
128 my $tname = $2; 128 my $tname = $2;
129 if ($ttype =~ /^(union|struct) (\w+)/) { 129 if ($ttype =~ /^(union|struct)?\s*(\w+)/) {
130 $ttype = $2; 130 $ttype = $2;
131 } 131 }
132 $var{$name}->{$tname} = $ttype; 132 $var{$name}->{$tname} = $ttype;
133 } 133 }
134 if (/^}/) { 134 if (/^}/) {
186 } 186 }
187 if ($args =~ s/^(\s)*\_\_code\s+(\w+)\((.*?)\)//) { 187 if ($args =~ s/^(\s)*\_\_code\s+(\w+)\((.*?)\)//) {
188 $inputIncFlag = 0; 188 $inputIncFlag = 0;
189 $outputCount = split(/,/,$3); 189 $outputCount = split(/,/,$3);
190 $outputCount--; 190 $outputCount--;
191 } elsif ($args =~ s/^(struct|union) (\w+)(\*)+\s(\w+)//) { 191 } elsif ($args =~ s/^(struct|union)?\s*(\w+)(\*)+\s(\w+)//) {
192 if($inputIncFlag) { 192 if($inputIncFlag) {
193 $inputCount++; 193 $inputCount++;
194 } 194 }
195 } elsif ($args =~ s/(.*,)//) { 195 } elsif ($args =~ s/(.*,)//) {
196 } else { 196 } else {
348 # output arguments are defined in the Interface take the pointer of these 348 # output arguments are defined in the Interface take the pointer of these
349 # output arguments are put into the Interface DataGear just before the goto 349 # output arguments are put into the Interface DataGear just before the goto
350 for my $arg (@args) { 350 for my $arg (@args) {
351 $arg =~ s/^\s*//; 351 $arg =~ s/^\s*//;
352 last if ($arg =~ /\.\.\./); 352 last if ($arg =~ /\.\.\./);
353 $arg =~ s/^(struct|union)? (\w+)(\**)\s(\w+)//; 353 $arg =~ s/^(struct|union)?\s*(\w+)(\**)\s(\w+)//;
354 my $structType = $1; 354 my $structType = $1;
355 my $typeName = $2; 355 my $typeName = $2;
356 my $ptrType = $3; 356 my $ptrType = $3;
357 my $varName = $4; 357 my $varName = $4;
358 my $typeField = lcfirst($typeName); 358 my $typeField = lcfirst($typeName);
359 push(@{$outputArgs{$codeGearName}->{$next}}, $varName); 359 push(@{$outputArgs{$codeGearName}->{$next}}, $varName);
360 if (&generateStubArgs($codeGearName, $varName, $typeName, $ptrType, $typeField, $interface,1)) { 360 if (&generateStubArgs($codeGearName, $varName, $typeName, $ptrType, $typeField, $interface,1)) {
361 $newArgs .= ",$structType $typeName **O_$varName"; 361 $newArgs .= ",$structType $typeName **O_$varName";
362 } 362 }
363 } 363 }
364 } elsif ($args =~ s/^(struct|union)? (\w+)(\**)\s(\w+)//) { 364 } elsif ($args =~ s/^(struct|union)?\s*(\w+)(\**)\s(\w+)//) {
365 my $structType = $1; 365 my $structType = $1;
366 my $typeName = $2; 366 my $typeName = $2;
367 my $ptrType = $3; 367 my $ptrType = $3;
368 my $varName = $4; 368 my $varName = $4;
369 my $typeField = lcfirst($typeName); 369 my $typeField = lcfirst($typeName);