view paper/src/parsedOutputStub.pl @ 46:03a8903d40d7

...
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Mon, 01 Feb 2021 15:15:41 +0900
parents
children
line wrap: on
line source

  } elsif (/^(.*)goto (\w+)\-\>(\w+)\((.*)\);/) {
    debug_print("getDataGear",__LINE__, $_) if $opt_debug;
    # handling goto statement
    # determine the interface you are using, and in the case of a goto CodeGear with output, create a special stub flag
    my $prev = $1;
    my $instance = $2;
    my $method = $3;
    my $tmpArgs = $4;
    my $typeName = $codeGearInfo->{$currentCodeGear}->{arg}->{$instance};
    my $nextOutPutArgs = findExistsOutputDataGear($typeName, $method);
    my $outputStubElem = { modifyEnumCode => $currentCodeGear, createStubName => $tmpArgs };

    if ($nextOutPutArgs) {
      my $tmpArgHash = {};
      for my $vname (@$nextOutPutArgs) {
        $tmpArgHash->{$vname} = $typeName;
      }

      $outputStubElem->{args} = $tmpArgHash;

      #We're assuming that $tmpArgs only contains the name of the next CodeGear.
      #Eventually we need to parse the contents of the argument. (eg. @parsedArgs)
      my @parsedArgs = split /,/ , $tmpArgs; #

      $generateHaveOutputStub->{counter}->{$tmpArgs}++;
      $outputStubElem->{counter} = $generateHaveOutputStub->{counter}->{$tmpArgs};
      $generateHaveOutputStub->{list}->{$currentCodeGear} = $outputStubElem;
    }