#!/usr//bin/perl $[ = 1; # set array base to 1 $, = ' '; # set output field separator $\ = "\n"; # set output record separator line: while (<>) { chop; # strip record separator @Fld = split(' ', $_, 9999); if (/ENDMODEL/) { next line; } if (/MODEL/) { print 'interface ' . $Fld[2]; next line; } if (/TYPE/ .. /ENDTYPE/) { if ($_ =~ /\=|TYPE/) { next if(/^\s*inv(.*?)/) ; print "$1" if(/^(\s*\w*)\s*=/); print if(/TYPE/); } next line; } if (/FUNC/ || /func/) { print $_; next line; } if (/^;/) { print $_; next line; } if (/STATE [ a-zA-Z0-9]*:/) { print $_; next line; } }