blob: 93fd22f97fd0b9db5bc6d74af72ceefd5f795c3e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#!/bin/perl
#/*@@
# @file c_file_processor.pl
# @date Fri Jan 22 18:09:47 1999
# @author Tom Goodale
# @desc
# Processes a c file replacing certain strings which can't be dealt
# with by the normal c preprocessor.
# @enddesc
#@@*/
$home = shift(@ARGV);
if (! -e "$home/fortran_name.pl" )
{
die "Unable to get fortran name file!";
}
require "$home/fortran_name.pl";
$/ = ";";
$*=1;
while(<>)
{
$line = $_;
while($line =~ m:FORTRAN_NAME\s*\(([^\)]*)\):)
{
$arglist = $1;
$arglist =~ s:[\s\n\t]+::g;
@args = split(",", $arglist );
$new = &fortran_name($args[$#args]);
$line =~ s:FORTRAN_NAME\s*\(([^\)]*)\):$new:;
}
while($line =~ m:FORTRAN_COMMON_NAME\s*\(([^\)]*)\):)
{
$arglist = $1;
$arglist =~ s:[\s\n\t]+::g;
@args = split(",", $arglist );
$new = &fortran_common_name($args[$#args]);
$line =~ s:FORTRAN_COMMON_NAME\s*\(([^\)]*)\):$new:;
}
print $line;
}
|