Cody Brocious
public text v1 · immutable@_ = <STDIN>;
$_ = join("", @_);
$W = /[ \t]*/;
$WR = /[ \t]+/;
# preprocessor directives
s/^\#.*$//gm;
# comments
s/\/\*.*?\*\///gs;
# whitespace
s/\n//gs;
s/\t/ /;
s/ / /gs while(/ /);
s/; /;/gs;
# externs
s/extern.*?\{//gs;
# typedefs
s/typedef$WR[^{};]+;//gs;
s/typedef$WR//gs;
# clean for output
s/;/;\n/gs;
print $_;