changeset 791:9c1fcef040c0

fix AtomicT
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 12 Jan 2021 19:09:53 +0900
parents 3ad18e80b9e3
children 0e0a31493199
files src/parallel_execution/generate_context.pl src/parallel_execution/lib/Gears/Context.pm src/parallel_execution/lib/Gears/Interface.pm
diffstat 3 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/generate_context.pl	Tue Jan 12 18:54:12 2021 +0900
+++ b/src/parallel_execution/generate_context.pl	Tue Jan 12 19:09:53 2021 +0900
@@ -103,9 +103,12 @@
   my $gears      = Gears::Context->new(compile_sources => \@cbc_files, find_root => "$FindBin::Bin/../", output => $output, template => $project->{template});
   my $data_gears = $gears->extraction_dg_compile_sources($gears->{compile_sources});
   my $g          = $gears->set_data_gear_header_path(keys %{$data_gears->{impl}},keys %{$data_gears->{interfaces}});
+  use DDP {deparse => 1};
 
   my $dg2path    = $gears->update_dg_each_header_path($data_gears,$g);
   my $tree = $gears->createImplTree_from_header($dg2path);
+  p $dg2path;
+  p $tree;
   $gears->tree2create_context_h($tree);
 }
 
--- a/src/parallel_execution/lib/Gears/Context.pm	Tue Jan 12 18:54:12 2021 +0900
+++ b/src/parallel_execution/lib/Gears/Context.pm	Tue Jan 12 19:09:53 2021 +0900
@@ -57,10 +57,12 @@
        }
 
 
-       if ($line =~ /^(\w+)\*\s*create(\w+)\(([*\w\s]+)\)/) {
+       if ($line =~ /^(\w+)(<(.*)>)?\*\s*create(\w+)\(([,*\w\s]+)\)/) {
+         #AtomicT<T>* createAtomicT(struct Context* context,T init) {
           my $interface      = $1;
-          my $implementation = $2;
-          my $arg            = $3;
+          my $generics       = $3;
+          my $implementation = $4;
+          my $arg            = $5;
           if ($arg eq "") {
             next;
           }
--- a/src/parallel_execution/lib/Gears/Interface.pm	Tue Jan 12 18:54:12 2021 +0900
+++ b/src/parallel_execution/lib/Gears/Interface.pm	Tue Jan 12 19:09:53 2021 +0900
@@ -38,12 +38,12 @@
     $line = <$fh>;
   }
 
-  my $typed_variable = undef;
+  my $typed_variable = {};
 
   if ($line =~ /typedef struct (\w+)\s?<(.*)>([\s\w{]+)/) {
-    my $vname      = $1;
-    $typed_variable      = $2;
-    my $annotation = $3;
+    my $vname            = $1;
+    my $v_typed_variable = $2;
+    my $annotation       = $3;
 
     unless ($vname) {
       cluck "[WARN] invalied struct name from $file";
@@ -51,8 +51,8 @@
     }
     $ir->{name}    = $vname;
 
-    if ($typed_variable) {
-      $typed_variable = parse_header_typed_variable($typed_variable);
+    if ($v_typed_variable) {
+      $typed_variable = parse_header_typed_variable($v_typed_variable);
     }
 
     if ($annotation =~ m|\s*impl\s*([\w+]+)\s*{|) {