200
|
1 #!/usr/bin/perl
|
|
2
|
550
|
3 my $inline;
|
526
|
4 my $call;
|
|
5
|
550
|
6 open(INLINE,">test/code-gen-inline.c") if ($inline);
|
526
|
7
|
200
|
8 print "#include \"code-gen.c\"\n";
|
526
|
9
|
|
10 $call .= "int main() {\n";
|
200
|
11
|
|
12 while(<>)
|
|
13 {
|
526
|
14 if (/^(\w+)(\(.*)/) {
|
|
15 $call .= "\t$1(".");\n";
|
550
|
16 print INLINE "inline $1$2" if ($inline);
|
235
|
17 } elsif (/^#/) {
|
526
|
18 $call .= $_;
|
550
|
19 print INLINE if ($inline);
|
526
|
20 } else {
|
550
|
21 print INLINE if ($inline);
|
200
|
22 }
|
|
23 }
|
526
|
24 $call .= "return 0; }\n";
|
|
25
|
|
26 print $call;
|
|
27
|
550
|
28 print INLINE $call if ($inline);
|
526
|
29
|
|
30 # end
|