inslist.pl: deal with the new encoding format

Make it possible for inslist.pl to understand the new encoding format;
fix a few minor buglets.
This commit is contained in:
H. Peter Anvin 2008-05-20 18:33:40 -07:00
parent 2d31ec106a
commit 21513e822f

View file

@ -35,28 +35,31 @@ $line = 0;
$insns = 0; $insns = 0;
while (<F>) { while (<F>) {
$line++; $line++;
if ( /^\s*;/ ) # comments next if (/^\s*$/); # blank lines
if ( /^\s*;/ ) # comments
{ {
if ( /^\s*;\#\s*(.+)/ ) # section subheader if ( /^\s*;\#\s*(.+)/ ) # section subheader
{ {
print S "\n\\S{} $1\n\n"; print S "\n\\S{} $1\n\n";
} }
next; next;
} }
chomp; chomp;
my @entry = split; unless (/^\s*(\S+)\s+(\S+)\s+(\S+|\[.*\])\s+(\S+)\s*$/) {
next if $#entry == -1; # blank lines warn "line $line does not contain four fields\n";
(warn "line $line does not contain four fields\n"), next if $#entry != 3; next;
}
my @entry = ($1, $2, $3, $4);
@entry[1] =~ s/ignore//; $entry[1] =~ s/ignore//;
@entry[1] =~ s/void//; $entry[1] =~ s/void//;
@entry[3] =~ s/ignore//; $entry[3] =~ s/ignore//;
@entry[3] =~ s/,SB//; $entry[3] =~ s/,SB//;
@entry[3] =~ s/,SM//; $entry[3] =~ s/,SM//;
@entry[3] =~ s/,SM2//; $entry[3] =~ s/,SM2//;
@entry[3] =~ s/,SQ//; $entry[3] =~ s/,SQ//;
@entry[3] =~ s/,AR2//; $entry[3] =~ s/,AR2//;
printf S "\\c %-16s %-24s %s\n",@entry[0],@entry[1],@entry[3]; printf S "\\c %-16s %-24s %s\n",$entry[0],$entry[1],$entry[3];
$insns++; $insns++;
} }
print S "\n"; print S "\n";