#!/usr/bin/perl my $call; open(INLINE,">test/code-gen-inline.c"); print "#include \"code-gen.c\"\n"; $call .= "int main() {\n"; while(<>) { if (/^(\w+)(\(.*)/) { $call .= "\t$1(".");\n"; print INLINE "inline $1$2"; } elsif (/^#/) { $call .= $_; print INLINE; } else { print INLINE; } } $call .= "return 0; }\n"; print $call; print INLINE $call; # end