Author: cotto Date: Wed Jan 14 02:08:17 2009 New Revision: 35523 Added: trunk/tools/dev/pmcrenumber.pl Modified: trunk/MANIFEST trunk/config/gen/makefiles/root.in trunk/src/pmc/pmc.num Log: [pmc] add make pmcrenumber to take care of pmc.num when needed Modified: trunk/MANIFEST ============================================================================== --- trunk/MANIFEST (original) +++ trunk/MANIFEST Wed Jan 14 02:08:17 2009 @@ -1,7 +1,7 @@ # ex: set ro: # $Id$ # -# generated by tools/dev/mk_manifest_and_skip.pl Wed Jan 14 09:31:49 2009 UT +# generated by tools/dev/mk_manifest_and_skip.pl Wed Jan 14 10:07:11 2009 UT # # See tools/dev/install_files.pl for documentation on the # format of this file. @@ -3761,6 +3761,7 @@ tools/dev/parrotbench.pl [devel] tools/dev/pbc_header.pl [devel] tools/dev/pbc_to_exe_gen.pl [devel] +tools/dev/pmcrenumber.pl [devel] tools/dev/pmctree.pl [devel] tools/dev/reconfigure.pl [devel] tools/dev/search-ops.pl [devel] Modified: trunk/config/gen/makefiles/root.in ============================================================================== --- trunk/config/gen/makefiles/root.in (original) +++ trunk/config/gen/makefiles/root.in Wed Jan 14 02:08:17 2009 @@ -1775,6 +1775,9 @@ opsrenumber : $(PERL) tools/dev/opsrenumber.pl $(OPS_FILES) +pmcrenumber : + $(PERL) tools/dev/pmcrenumber.pl $(SRC_DIR)/pmc/pmc.num + ############################################################################### # # SVN Targets: Modified: trunk/src/pmc/pmc.num ============================================================================== --- trunk/src/pmc/pmc.num (original) +++ trunk/src/pmc/pmc.num Wed Jan 14 02:08:17 2009 @@ -4,88 +4,88 @@ # default must be 0 -default.pmc 0 +default.pmc 0 # now utility PMCs that don't do MMD -null.pmc 1 -env.pmc 2 -perlenv.pmc 3 -key.pmc 4 -random.pmc 5 -unmanagedstruct.pmc 6 -managedstruct.pmc 7 -delegate.pmc 8 -csub.pmc 9 -compiler.pmc 10 -exception.pmc 11 -version.pmc 12 -parrotio.pmc 13 -parrotlibrary.pmc 14 -constparrotlibrary.pmc 15 -parrotinterpreter.pmc 16 -parrotthread.pmc 17 -lexpad.pmc 18 -timer.pmc 19 -pointer.pmc 20 +null.pmc 1 +env.pmc 2 +perlenv.pmc 3 +key.pmc 4 +random.pmc 5 +unmanagedstruct.pmc 6 +managedstruct.pmc 7 +delegate.pmc 8 +csub.pmc 9 +compiler.pmc 10 +exception.pmc 11 +version.pmc 12 +parrotio.pmc 13 +parrotlibrary.pmc 14 +constparrotlibrary.pmc 15 +parrotinterpreter.pmc 16 +parrotthread.pmc 17 +lexpad.pmc 18 +timer.pmc 19 +pointer.pmc 20 # sub and subroutine like pmcs -sub.pmc 21 -closure.pmc 22 -continuation.pmc 23 -retcontinuation.pmc 24 -exception_handler.pmc 25 -coroutine.pmc 26 -eval.pmc 27 -nci.pmc 28 +sub.pmc 21 +closure.pmc 22 +continuation.pmc 23 +retcontinuation.pmc 24 +exception_handler.pmc 25 +coroutine.pmc 26 +eval.pmc 27 +nci.pmc 28 # scalars # abstract scalar.pmc 28 # base types -float.pmc 29 -integer.pmc 30 -bigint.pmc 31 -complex.pmc 32 -string.pmc 33 +float.pmc 29 +integer.pmc 30 +bigint.pmc 31 +complex.pmc 32 +string.pmc 33 # abstract perlscalar.pmc -perlint.pmc 34 -perlnum.pmc 35 -perlstring.pmc 36 -perlundef.pmc 37 -boolean.pmc 38 +perlint.pmc 34 +perlnum.pmc 35 +perlstring.pmc 36 +perlundef.pmc 37 +boolean.pmc 38 -ref.pmc 39 -sharedref.pmc 40 +ref.pmc 39 +sharedref.pmc 40 # arrays XXX this list isn't complete -array.pmc 41 -fixedintegerarray.pmc 42 -intlist.pmc 43 -iterator.pmc 44 -perlarray.pmc 45 -pmcarray.pmc 46 -sarray.pmc 47 -constsarray.pmc 48 -fixedstringarray.pmc 49 -multiarray.pmc 50 +array.pmc 41 +fixedintegerarray.pmc 42 +intlist.pmc 43 +iterator.pmc 44 +perlarray.pmc 45 +pmcarray.pmc 46 +sarray.pmc 47 +constsarray.pmc 48 +fixedstringarray.pmc 49 +multiarray.pmc 50 # hashes -hash.pmc 51 -perlhash.pmc 52 -orderedhash.pmc 53 +hash.pmc 51 +perlhash.pmc 52 +orderedhash.pmc 53 # other -tqueue.pmc 54 +tqueue.pmc 54 -parrotclass.pmc 55 -parrotobject.pmc 56 +parrotclass.pmc 55 +parrotobject.pmc 56 -os.pmc 57 -file.pmc 58 +os.pmc 57 +file.pmc 58 Added: trunk/tools/dev/pmcrenumber.pl ============================================================================== --- (empty file) +++ trunk/tools/dev/pmcrenumber.pl Wed Jan 14 02:08:17 2009 @@ -0,0 +1,64 @@ +#! perl +# Copyright (C) 2001-2009, The Perl Foundation. +# $Id$ + +use strict; +use warnings; + +my $pmc_num_file = $ARGV[0]; + +my $pmc_order = 0; +my $pmc_num_contents; + +open (PMC_NUM, "<$pmc_num_file"); + +for (<PMC_NUM>) { + if (/^([\w]+)\.pmc\s+\d+$/) { + $pmc_num_contents .= "$1.pmc $pmc_order\n"; + $pmc_order++; + } + else { + $pmc_num_contents .= $_; + } +} + +close PMC_NUM; +open (PMC_NUM, ">$pmc_num_file"); +print PMC_NUM $pmc_num_contents; +close PMC_NUM; + + +################### DOCUMENTATION #################### + +=head1 NAME + +tools/dev/pmcrenumber.pl - Renumber F<src/pmc/pmc.num>. + +=head1 SYNOPSIS + + $ perl tools/dev/pmcrenumber.pl pmc.num + +=head1 DESCRIPTION + +This program should be used when adding or removing PMCs. + +=head1 SEE ALSO + +=over 4 + +=item F<lib/Parrot/OpsRenumber.pm>. + +=back + +=head1 AUTHOR + +Christoph Otto + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: