annotate mc-h-renum.pl @ 421:ab58eea5e032

Non aligned bit field (not yet complete)
author kono
date Fri, 29 Oct 2004 04:18:39 +0900
parents 3902240d4930
children 1e5ca85d3f97
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
171
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
1 #!/usr/local/bin/perl
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
2
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
3 my $mode = 0;
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
4
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
5 my $reserve = -1;
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
6 my $tags = 1;
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
7 my $error = 1;
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
8 my $modnum = 0;
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
9
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
10 while(<>) {
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
11 if(m+/\* reserved word start \*/+) { $mode = 1; }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
12 elsif(m+/\* reserved word end \*/+) { $mode = 0; }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
13 elsif(m+/\* tree node tags start \*/+) { $mode = 2; }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
14 elsif(m+/\* tree node tags end \*/+) { $mode = 0; }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
15 elsif(m+/\* error number start \*/+) { $mode = 3; }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
16 elsif(m+/\* error number end \*/+) { $mode = 0; }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
17 elsif(m+/\* mode start \*/+) { $mode = 4; }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
18 elsif(m+/\* mode end \*/+) { $mode = 0; }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
19 else {
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
20 if ($mode==0) { ; }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
21 elsif ($mode==1) {
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
22 s/-(\d+)/$reserve--/e;
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
23 } elsif ($mode==2) {
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
24 s/\s(\d+)/"\t".$tags++/e;
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
25 } elsif ($mode==3) {
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
26 s/(\d+)/$error++/e;
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
27 } elsif ($mode==4) {
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
28 s/(\d+)/$modenum++/e;
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
29 }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
30 }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
31 print;
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
32 }
3902240d4930 *** empty log message ***
kono
parents:
diff changeset
33