annotate tools/mc-h-renum.pl @ 466:7c3d8237b625 gcc40

*** empty log message ***
author kono
date Mon, 16 May 2005 11:53:56 +0900
parents
children e055df7c1082
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
466
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
1 #!/usr/local/bin/perl
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
2
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
3 my $mode = 0;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
4
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
5 my $reserve = -1;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
6 my $tags = 1;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
7 my $error = 1;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
8 my $modnum = 0;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
9
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
10 while(<>) {
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
11 if(m+/\* reserved word start \*/+) { $mode = 1; }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
12 elsif(m+/\* reserved word end \*/+) { $mode = 0; }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
13 elsif(m+/\* tree node tags start \*/+) { $mode = 2; }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
14 elsif(m+/\* tree node tags end \*/+) { $mode = 0; }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
15 elsif(m+/\* error number start \*/+) { $mode = 3; }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
16 elsif(m+/\* error number end \*/+) { $mode = 0; }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
17 elsif(m+/\* mode start \*/+) { $mode = 4; }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
18 elsif(m+/\* mode end \*/+) { $mode = 0; }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
19 elsif(m+/\* statement start \*/+) { $mode = 5; }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
20 elsif(m+/\* statement end \*/+) { $mode = 0; }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
21 else {
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
22 if ($mode==0) { ; }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
23 elsif ($mode==1) {
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
24 s/-(\d+)/$reserve--/e;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
25 } elsif ($mode==2) {
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
26 s/\s(\d+)/"\t".$tags++/e;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
27 } elsif ($mode==3) {
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
28 s/(\d+)/$error++/e;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
29 } elsif ($mode==4) {
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
30 s/(\d+)/$modenum++/e;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
31 } elsif ($mode==5) {
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
32 s/(\d+)/$tags++/e;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
33 }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
34 }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
35 print;
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
36 }
7c3d8237b625 *** empty log message ***
kono
parents:
diff changeset
37