view paper/src/IsInterface.pm @ 84:88ae1e4d83c6

update
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Fri, 05 Feb 2021 11:01:56 +0900
parents
children
line wrap: on
line source

sub isThisFileInterface {
  my ($class, $filename) = @_;

  open my $fh, '<', $filename;
  my $line = <$fh>; #read top line  ex Typedef struct Stack<Type, Impl> {

  return 0 unless ($line =~ /typedef struct \w+\s?<.*>([\s\w{]+)/);

  my $annotation = $1;
  return 0 if ($annotation =~ /impl/);

  return 1;
}