# HG changeset patch # User kono # Date 1069673299 -32400 # Node ID 3902240d493073c5890b46800eab3f5a7b008a65 # Parent 6e0f67b7d200ac6e65b3ce9c98fe9f43bad0ea5b *** empty log message *** diff -r 6e0f67b7d200 -r 3902240d4930 mc-h-renum.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mc-h-renum.pl Mon Nov 24 20:28:19 2003 +0900 @@ -0,0 +1,33 @@ +#!/usr/local/bin/perl + +my $mode = 0; + +my $reserve = -1; +my $tags = 1; +my $error = 1; +my $modnum = 0; + +while(<>) { + if(m+/\* reserved word start \*/+) { $mode = 1; } + elsif(m+/\* reserved word end \*/+) { $mode = 0; } + elsif(m+/\* tree node tags start \*/+) { $mode = 2; } + elsif(m+/\* tree node tags end \*/+) { $mode = 0; } + elsif(m+/\* error number start \*/+) { $mode = 3; } + elsif(m+/\* error number end \*/+) { $mode = 0; } + elsif(m+/\* mode start \*/+) { $mode = 4; } + elsif(m+/\* mode end \*/+) { $mode = 0; } + else { + if ($mode==0) { ; } + elsif ($mode==1) { + s/-(\d+)/$reserve--/e; + } elsif ($mode==2) { + s/\s(\d+)/"\t".$tags++/e; + } elsif ($mode==3) { + s/(\d+)/$error++/e; + } elsif ($mode==4) { + s/(\d+)/$modenum++/e; + } + } + print; +} +