Mercurial > hg > GearsTemplate
changeset 564:9cca20bcb558
add auto_generate_context.pl
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 23 Nov 2019 16:10:24 +0900 |
parents | 928d01b70e62 |
children | a37ee31c76f0 |
files | src/parallel_execution/auto_generate_context.pl src/parallel_execution/lib/Gears/Util.pm |
diffstat | 2 files changed, 25 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/parallel_execution/auto_generate_context.pl Sat Nov 23 16:10:24 2019 +0900 @@ -0,0 +1,22 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Gears; +use DDP {deparse => 1}; + +my @cbc_files = <DATA>; +chomp @cbc_files; +my $gears = Gears->new(compile_sources => \@cbc_files); +$gears->parse_all(); +p $gears; + +__DATA__ +/Users/anatofuz/src/firefly/hg/Gears/src/parallel_execution/examples/calc/calc.cbc +/Users/anatofuz/src/firefly/hg/Gears/src/parallel_execution/examples/calc/add.cbc +/Users/anatofuz/src/firefly/hg/Gears/src/parallel_execution/examples/calc/mult.cbc +/Users/anatofuz/src/firefly/hg/Gears/src/parallel_execution/examples/calc/initIntegerDataGears.cbc +/Users/anatofuz/src/firefly/hg/Gears/src/parallel_execution/CPUWorker.cbc +/Users/anatofuz/src/firefly/hg/Gears/src/parallel_execution/TaskManagerImpl.cbc +/Users/anatofuz/src/firefly/hg/Gears/src/parallel_execution/SingleLinkedQueue.cbc +/Users/anatofuz/src/firefly/hg/Gears/src/parallel_execution/SynchronizedQueue.cbc +/Users/anatofuz/src/firefly/hg/Gears/src/parallel_execution/AtomicReference.cbc
--- a/src/parallel_execution/lib/Gears/Util.pm Thu Nov 21 21:25:36 2019 +0900 +++ b/src/parallel_execution/lib/Gears/Util.pm Sat Nov 23 16:10:24 2019 +0900 @@ -41,7 +41,7 @@ my ($file,$code_verbose) = @_; my $ir = {}; - _file_checking($file); + Gears::Util->file_checking($file); open my $fh, '<', $file; my $line = <$fh>; @@ -81,8 +81,8 @@ return $ir; } -sub _file_checking { - my $file_name = shift; +sub file_checking { + my ($class, $file_name) = @_; unless (-f $file_name) { croak "invalid filepath :$file_name\n"; }