Mercurial > hg > CbC > CbC_xv6
changeset 236:0a74a7bbe765
tweak...
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 28 Jan 2020 15:10:22 +0900 |
parents | 98aea649e37b |
children | 21a5761e3e7a |
files | src/gearsTools/gen_Stub.pl src/gearsTools/lib/Gears/Stub.pm |
diffstat | 2 files changed, 5 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gearsTools/gen_Stub.pl Tue Jan 28 14:23:29 2020 +0900 +++ b/src/gearsTools/gen_Stub.pl Tue Jan 28 15:10:22 2020 +0900 @@ -15,4 +15,4 @@ my $target_cbc_file = shift; my $stubManager = Gears::Stub->new(file_name => File::Spec->rel2abs($target_cbc_file)); -$stubManager->findInterfacewImpl($stubManager->slup()); +$stubManager->findInterfacewImpl(File::Spec->rel2abs($target_cbc_file));
--- a/src/gearsTools/lib/Gears/Stub.pm Tue Jan 28 14:23:29 2020 +0900 +++ b/src/gearsTools/lib/Gears/Stub.pm Tue Jan 28 15:10:22 2020 +0900 @@ -18,35 +18,12 @@ } -sub slup { - my $self = shift; - my @contents = (); - open my $fh, '<', $self->{file_name}; - while (my $line = <$fh>) { - push(@contents,$line); - } - close $fh; - return \@contents; -} - sub findInterfacewImpl { - my ($self, $cbc_file_content) = @_; - my %findInterfaces; - - extraction_dg_compile_sources - #for my $i (0..$#{$cbc_file_content}) { - # my $line = $cbc_file_content->[$i]; - # if ($line =~ /#interface\s*"([\w.]+)"/) { - # push(@{$findInterfaces{$1}},[$i, $line]); - # next; - # } - - # if ($line =~ /data_gear\s*"([\w.]+)"/) { - # push(@{$findInterfaces{$1}},[$i, $line]); - # } - #} - p %findInterfaces; + my $self = shift; + my $cbc_file = shift // $self->{file_name}; + my $findInterfaces = Gears::Context->extraction_dg_compile_sources([$cbc_file]); + p $findInterfaces; } 1;