Mercurial > hg > Gears > Gears
changeset 769:829d14b36e4e
insert check generics
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 07 Jan 2021 15:04:15 +0900 |
parents | 0216990e111b |
children | 3f62541b7b22 |
files | src/parallel_execution/examples/DPP/PhilsImpl.h src/parallel_execution/lib/Gears/Interface.pm src/parallel_execution/tools/check_convert_context_struct.pl |
diffstat | 3 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/examples/DPP/PhilsImpl.h Thu Jan 07 11:19:59 2021 +0900 +++ b/src/parallel_execution/examples/DPP/PhilsImpl.h Thu Jan 07 15:04:15 2021 +0900 @@ -1,6 +1,6 @@ typedef struct PhilsImpl <Isa> impl Phils { - __code next(...); + int self; AtomicT<int> Leftfork; Atomic<int> Rightfork; - int self; + __code next(...); } PhilsImpl;
--- a/src/parallel_execution/lib/Gears/Interface.pm Thu Jan 07 11:19:59 2021 +0900 +++ b/src/parallel_execution/lib/Gears/Interface.pm Thu Jan 07 15:04:15 2021 +0900 @@ -98,6 +98,7 @@ #this is a case of writing field variables one line at a time $line =~ s/^\s+//; + parse_generics($line); push(@data_gears,$line); $static_data_gear_write_mode = 1; } @@ -211,6 +212,11 @@ return 1; } +sub parse_generics { + my $line = shift; + return unless ($line =~ /([\w\*]+)\s*<([\w\*]+)>/); + print "[INFO] use generics $1 $2 at $line\n"; +} sub collect_interfaces_from_all_headers { my ($class, $find_path) = @_;
--- a/src/parallel_execution/tools/check_convert_context_struct.pl Thu Jan 07 11:19:59 2021 +0900 +++ b/src/parallel_execution/tools/check_convert_context_struct.pl Thu Jan 07 15:04:15 2021 +0900 @@ -26,7 +26,7 @@ die "require header file"; } my $h2context = Gears::Interface->parse($interface_file); -my $context = Gears::Context->h2context_str($h2context); +my $context = Gears::Context->h2context_str($h2context); print "$context";