changeset 938:d2882cb4cc80

fix parser
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Mon, 01 Feb 2021 20:07:38 +0900
parents df8d197cc560
children 2a5a348d82c6
files src/parallel_execution/ModelChecking/MCWorker.cbc src/parallel_execution/examples/DPPMC/McDPP.cbc src/parallel_execution/examples/DPPMC/McDPP.h src/parallel_execution/generate_context.pl src/parallel_execution/generate_stub.pl
diffstat 5 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/ModelChecking/MCWorker.cbc	Mon Feb 01 19:00:19 2021 +0900
+++ b/src/parallel_execution/ModelChecking/MCWorker.cbc	Mon Feb 01 20:07:38 2021 +0900
@@ -1,8 +1,8 @@
 #include "../../context.h"
-#include <stdio.h> 
-#include <stdlib.h> 
-#include <time.h> 
-#include "ModelChecking/state_db.h" 
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include "../../ModelChecking/state_db.h"
 
 #interface "TaskManager.h"
 #interface "Worker.h"
@@ -124,7 +124,7 @@
               exit(0);
             } else if (! mcWorker->change ) {
                 mcWorker->checking = 1;
-            } 
+            }
             mcWorker->change = 0;
             mcWorker->visit++;
             // start from root state and iterator
--- a/src/parallel_execution/examples/DPPMC/McDPP.cbc	Mon Feb 01 19:00:19 2021 +0900
+++ b/src/parallel_execution/examples/DPPMC/McDPP.cbc	Mon Feb 01 20:07:38 2021 +0900
@@ -3,15 +3,15 @@
 
 void mcDPP(struct MCTaskManagerImpl* mcti, struct MCWorker* mcWorker, StateDB now,StateDB next, int check) {
   PhilsImpl* phils = (PhilsImpl*)GearImpl(mcWorker->mcContext, Phils, phils);
-  int prev_now = now->flag; 
-  int prev_next = next->flag; 
+  int prev_now = now->flag;
+  int prev_next = next->flag;
   if (phils->self != 1) return;
   enum Code nextc = mcWorker->mcContext->next;
   if (nextc == C_putdown_rforkPhilsImpl ) {
-    next->flag |= t_eating; 
+    next->flag |= t_eating;
   }
   if ((next->flag & t_eating )||(next->flag & t_F_eating) ) {
-    now->flag |= t_F_eating; 
+    now->flag |= t_F_eating;
   }
   if ( prev_now != now->flag || prev_next != next->flag )
      mcWorker->change = 1;
--- a/src/parallel_execution/examples/DPPMC/McDPP.h	Mon Feb 01 19:00:19 2021 +0900
+++ b/src/parallel_execution/examples/DPPMC/McDPP.h	Mon Feb 01 20:07:38 2021 +0900
@@ -1,11 +1,11 @@
 #ifndef MCDPP_H
 #define MCDPP_H 0
 
-#include "context.h"
-#include "ModelChecking/state_db.h"
+#include "../../context.h"
+#include "../../ModelChecking/state_db.h"
 
 /*
-   00  don't care 
+   00  don't care
    01  true
    11  false
  */
--- a/src/parallel_execution/generate_context.pl	Mon Feb 01 19:00:19 2021 +0900
+++ b/src/parallel_execution/generate_context.pl	Mon Feb 01 20:07:38 2021 +0900
@@ -422,7 +422,6 @@
 
 sub check_use_generics {
   my ($input_typed_variables, $generics, $cfile_generics_list) = @_;
-
   my $typed_variables = {};
   my $typed_instances = {};
 
@@ -596,9 +595,8 @@
     }
   }
 
-
-  # for my $type (keys %$typed_variables) {
-  #   #my @cfiles = grep { /\.c$/ } keys  %{$typed_variables->{$type}->{_caller}};
+  #for my $type (keys %$typed_variables) {
+  #   my @cfiles = grep { /\.c$/ } keys  %{$typed_variables->{$type}->{_caller}};
   #   for my $file (@cfiles) {
   #     p $type;
   #   }
--- a/src/parallel_execution/generate_stub.pl	Mon Feb 01 19:00:19 2021 +0900
+++ b/src/parallel_execution/generate_stub.pl	Mon Feb 01 20:07:38 2021 +0900
@@ -154,7 +154,8 @@
                 $var{$name}      = {};
                 $code{$name}     = {};
                 $generic{$name}  = [];
-            } elsif (/^(\w+)(\*)+ create(\w+)\(/) { # this case implementation constructor
+      #AtomicT<T> *createAtomicTImpl(struct Context* context, T init){
+            } elsif (/^(\w+)(?:<(\w+)>)?\s*(\*)\s*create(\w+)\(/) { # this case implementation constructor
                 debug_print("getDataGear",__LINE__, $_) if $opt_debug;
                 my $interfaceName = $1;
 
@@ -170,7 +171,7 @@
                 }
                 $implInterfaceInfo->{isImpl} = 1;
                 $implInterfaceInfo->{interface} = $interfaceName;
-                $implInterfaceInfo->{implementation} = $3;
+                $implInterfaceInfo->{implementation} = $4;
                 my $cbc_source_path = $searchCbCFromCodeGearNameWCurrentFrileName->($interfaceName, $filename);
                 if ($cbc_source_path) {
                   # Probably not executed
@@ -399,10 +400,11 @@
     open my $fd,"<",$filename or die("can't open $filename $!");
     my ($name,$impln);
     while (<$fd>) {
-        if (/^(\w+)\s*(\*)+ create(\w+)\(/) {
+      #AtomicT<T> *createAtomicTImpl(struct Context* context, T init){
+        if (/^(\w+)(<\w+>)?\s*(\*)+ create(\w+)\(/) {
             debug_print("getCodeGear",__LINE__, $_) if $opt_debug;
             $name = $1;
-            $impln = $3;
+            $impln = $4;
         } elsif(/^typedef struct (\w+)\s*<.*>\s*{/) {
             debug_print("getCodeGear",__LINE__, $_) if $opt_debug;
             $name = $1;