view paper/src/IsInterface.pm @ 131:988b3024d685

update
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Mon, 08 Feb 2021 05:49:37 +0900
parents 88ae1e4d83c6
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;
}