Ticket #677: tt677_toolsdirs.48639.diff

File tt677_toolsdirs.48639.diff, 174.8 KB (added by jkeenan, 11 years ago)

diff of tt677_toolsdir against trunk at branch point

  • docs/project/release_manager_guide.pod

     
    8484 
    8585=item c 
    8686 
    87 Update release-related information in F<tools/util/release.json>. This will be 
     87Update release-related information in F<tools/release/release.json>. This will be 
    8888used later when making release announcements.  There are a few essential 
    8989fields that must be updated at each release: 
    9090 
     
    251251 
    252252=item 9. 
    253253 
    254 Compose the release announcement.  Use F<tools/util/crow.pir> to make 
     254Compose the release announcement.  Use F<tools/release/crow.pir> to make 
    255255this part easier.  You can specify the format of your announcements like so: 
    256256 
    257   $ ./parrot tools/util/crow.pir --type=text 
    258   $ ./parrot tools/util/crow.pir --type=html 
     257  $ ./parrot tools/release/crow.pir --type=text 
     258  $ ./parrot tools/release/crow.pir --type=html 
    259259 
    260260Take the screen output and paste it into the application you need.  HTML 
    261261works well for use Perl and PerlMonks, and text for the rest.  It is not a 
  • tools/build/addopstags.pl

     
    1 #!perl 
    2  
    3 # Copyright (C) 2004-2006, Parrot Foundation. 
    4 # $Id$ 
    5  
    6 use strict; 
    7 use warnings; 
    8  
    9 =head1 NAME 
    10  
    11 tools/build/addopstags.pl - add src/ops/*.ops to tags 
    12  
    13 =head1 SYNOPSIS 
    14  
    15  perl tools/build/addopstags.pl src/ops/*.ops 
    16  
    17 =head1 DESCRIPTION 
    18  
    19 Add src/ops/*.ops to tags file. 
    20  
    21 =cut 
    22  
    23 my %seen; 
    24 my @tags; 
    25  
    26 # Pull ops tags 
    27 while (<>) { 
    28     if (/\bop \s+ (\w+) \s* \(/x) { 
    29         next if $seen{$1}++; 
    30  
    31         # tag file excmd xflags 
    32         push @tags, join( "\t", $1, $ARGV, qq{$.;"}, "f" ) . "\n"; 
    33     } 
    34 } 
    35 continue { 
    36     close ARGV if eof;    # reset $. 
    37 } 
    38  
    39 # Pull existing tags 
    40 open my $T, '<', 'tags'; 
    41 push @tags, <$T>; 
    42 close $T; 
    43  
    44 # Spit 'em out sorted 
    45 open $T, '>', 'tags'; 
    46 print $T sort @tags; 
    47 close $T; 
    48  
    49 # Local Variables: 
    50 #   mode: cperl 
    51 #   cperl-indent-level: 4 
    52 #   fill-column: 100 
    53 # End: 
    54 # vim: expandtab shiftwidth=4: 
  • tools/build/headerizer.pl

     
    1 #! perl 
    2 # Copyright (C) 2001-2010, Parrot Foundation. 
    3 # $Id$ 
    4  
    5 =head1 NAME 
    6  
    7 tools/build/headerizer.pl - Generates the function header parts of .h 
    8 files from .c files 
    9  
    10 =head1 SYNOPSIS 
    11  
    12   $ perl tools/build/headerizer.pl [object files] 
    13  
    14 Generates C function declarations based on the function definitions in 
    15 the C source code. 
    16  
    17 =head1 DESCRIPTION 
    18  
    19 The headerizer works off of directives in the source and header files. 
    20  
    21 One source file's public declarations can only go into one header file. 
    22 However, one header file can have declarations from multiple source files. 
    23 In other words, headers-to-source is one-to-many. 
    24  
    25 =over 4 
    26  
    27 =item C<HEADERIZER BEGIN:> F<source-filename> / C<HEADERIZER END:> F<source-filename> 
    28  
    29 Marks the beginning and end of a block of declarations in a header file. 
    30  
    31     # In file foo.h 
    32     /* HEADERIZER BEGIN: src/foo.c */ 
    33     /* HEADERIZER END: src/foo.c */ 
    34  
    35     /* HEADERIZER BEGIN: src/bar.c */ 
    36     /* HEADERIZER END: src/bar.c */ 
    37  
    38 =item C<HEADERIZER HFILE:> F<header-filename> 
    39  
    40 Tells the headerizer where the declarations for the functions should go 
    41  
    42     # In file foo.c 
    43     /* HEADERIZER HFILE: foo.h */ 
    44  
    45     # In file bar.c 
    46     /* HEADERIZER HFILE: foo.h */ 
    47  
    48 =back 
    49  
    50 =head1 COMMAND-LINE OPTIONS 
    51  
    52 =over 4 
    53  
    54 =item C<--macro=X> 
    55  
    56 Print a list of all functions that have macro X.  For example, --macro=PARROT_EXPORT. 
    57  
    58 =back 
    59  
    60 =cut 
    61  
    62 use strict; 
    63 use warnings; 
    64  
    65 use Getopt::Long; 
    66 use lib qw( lib ); 
    67 use Parrot::Config; 
    68 use Parrot::Headerizer; 
    69  
    70 my $headerizer = Parrot::Headerizer->new; 
    71  
    72 main(); 
    73  
    74 =head1 FUNCTIONS 
    75  
    76 =head2 extract_function_declaration_and_update_source( $cfile_name ) 
    77  
    78 Extract all the function declarations from the C file specified by 
    79 I<$cfile_name>, and update the comment blocks within. 
    80  
    81 =cut 
    82  
    83 sub extract_function_declarations_and_update_source { 
    84     my $cfile_name = shift; 
    85  
    86     open( my $fhin, '<', $cfile_name ) or die "Can't open $cfile_name: $!"; 
    87     my $text = join( '', <$fhin> ); 
    88     close $fhin; 
    89  
    90     my @func_declarations = $headerizer->extract_function_declarations( $text ); 
    91     for my $decl ( @func_declarations ) { 
    92         my $specs = $headerizer->function_components_from_declaration( $cfile_name, $decl ); 
    93         my $name = $specs->{name}; 
    94  
    95         my $heading = $headerizer->generate_documentation_signature($decl); 
    96  
    97         $text =~ s/=item C<[^>]*\b$name\b[^>]*>\n+/$heading\n\n/sm or do { 
    98             warn "$cfile_name: $name has no POD\n" unless $name =~ /^yy/; # lexer funcs don't have to have POD 
    99         } 
    100     } 
    101     open( my $fhout, '>', $cfile_name ) or die "Can't create $cfile_name: $!"; 
    102     print {$fhout} $text; 
    103     close $fhout; 
    104  
    105     return @func_declarations; 
    106 } 
    107  
    108  
    109 sub attrs_from_args { 
    110     my $func = shift; 
    111     my @args = @_; 
    112  
    113     my @attrs = (); 
    114     my @mods  = (); 
    115  
    116     my $name = $func->{name}; 
    117     my $file = $func->{file}; 
    118     my $n = 0; 
    119     for my $arg (@args) { 
    120         ++$n; 
    121         if ( $arg =~ m{ARG(?:MOD|OUT)(?:_NULLOK)?\((.+?)\)} ) { 
    122             my $modified = $1; 
    123             if ( $modified =~ s/.*\*/*/ ) { 
    124                 # We're OK 
    125             } 
    126             else { 
    127                 $modified =~ s/.* (\w+)$/$1/ or die qq{Unable to figure out the modified parm out of "$modified"}; 
    128             } 
    129             push( @mods, "FUNC_MODIFIES($modified)" ); 
    130         } 
    131         if ( $arg =~ m{(ARGIN|ARGOUT|ARGMOD|ARGFREE_NOTNULL|NOTNULL)\(} || $arg eq 'PARROT_INTERP' ) { 
    132             push( @attrs, "__attribute__nonnull__($n)" ); 
    133         } 
    134         if ( ( $arg =~ m{\*} ) && ( $arg !~ /\b(SHIM|((ARGIN|ARGOUT|ARGMOD)(_NULLOK)?)|ARGFREE(_NOTNULL)?)\b/ ) ) { 
    135             if ( $name !~ /^yy/ ) { # Don't complain about the lexer auto-generated funcs 
    136                 $headerizer->squawk( $file, $name, qq{"$arg" isn't protected with an ARGIN, ARGOUT or ARGMOD (or a _NULLOK variant), or ARGFREE} ); 
    137             } 
    138         } 
    139         if ( ($arg =~ /\bconst\b/) && ($arg =~ /\*/) && ($arg !~ /\*\*/) && ($arg =~ /\b(ARG(MOD|OUT))\b/) ) { 
    140             $headerizer->squawk( $file, $name, qq{"$arg" is const, but that $1 conflicts with const} ); 
    141         } 
    142     } 
    143  
    144     return (@attrs,@mods); 
    145 } 
    146  
    147 sub asserts_from_args { 
    148     my @args = @_; 
    149     my @asserts; 
    150  
    151     for my $arg (@args) { 
    152         if ( $arg =~ m{(ARGIN|ARGOUT|ARGMOD|ARGFREE_NOTNULL|NOTNULL)\((.+)\)} ) { 
    153             my $var = $2; 
    154             if($var =~ /\(*\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\)\s*\(/) { 
    155                 # argument is a function pointer 
    156                 $var = $1; 
    157             } 
    158             else { 
    159                 # try to isolate the variable's name; 
    160                 # strip off everything before the final space or asterisk. 
    161                 $var =~ s{.+[* ]([^* ]+)$}{$1}; 
    162                 # strip off a trailing "[]", if any. 
    163                 $var =~ s{\[\]$}{}; 
    164             } 
    165             push( @asserts, "PARROT_ASSERT_ARG($var)" ); 
    166         } 
    167         if( $arg eq 'PARROT_INTERP' ) { 
    168             push( @asserts, "PARROT_ASSERT_ARG(interp)" ); 
    169         } 
    170     } 
    171  
    172     return (@asserts); 
    173 } 
    174  
    175 sub make_function_decls { 
    176     my @funcs = @_; 
    177  
    178     my @decls; 
    179     foreach my $func (@funcs) { 
    180         my $multiline = 0; 
    181  
    182         my $return = $func->{return_type}; 
    183         my $alt_void = ' '; 
    184  
    185         # Splint can't handle /*@alt void@*/ on pointers, although this page 
    186         # http://www.mail-archive.com/lclint-interest@virginia.edu/msg00139.html 
    187         # seems to say that we can. 
    188         if ( $func->{is_ignorable} && ($return !~ /\*/) ) { 
    189             $alt_void = " /*\@alt void@*/\n"; 
    190         } 
    191  
    192         my $decl = sprintf( "%s%s%s(", $return, $alt_void, $func->{name} ); 
    193         $decl = "static $decl" if $func->{is_static}; 
    194  
    195         my @args    = @{ $func->{args} }; 
    196         my @attrs   = attrs_from_args( $func, @args ); 
    197  
    198         for my $arg (@args) { 
    199             if ( $arg =~ m{SHIM\((.+)\)} ) { 
    200                 $arg = $1; 
    201                 if ( $func->{is_static} || ( $arg =~ /\*/ ) ) { 
    202                     $arg = "SHIM($arg)"; 
    203                 } 
    204                 else { 
    205                     $arg = "NULLOK($arg)"; 
    206                 } 
    207             } 
    208         } 
    209  
    210         my $argline = join( ", ", @args ); 
    211         if ( length( $decl . $argline ) <= 75 ) { 
    212             $decl = "$decl$argline)"; 
    213         } 
    214         else { 
    215             if ( $args[0] =~ /^((SHIM|PARROT)_INTERP|Interp)\b/ ) { 
    216                 $decl .= ( shift @args ); 
    217                 $decl .= "," if @args; 
    218             } 
    219             $argline   = join( ",", map { "\n\t$_" } @args ); 
    220             $decl      = "$decl$argline)"; 
    221             $multiline = 1; 
    222         } 
    223  
    224         my $attrs = join( "", map { "\n\t\t$_" } @attrs ); 
    225         if ($attrs) { 
    226             $decl .= $attrs; 
    227             $multiline = 1; 
    228         } 
    229         my @macros = @{ $func->{macros} }; 
    230         $multiline = 1 if @macros; 
    231  
    232         $decl .= $multiline ? ";\n" : ";"; 
    233         $decl = join( "\n", @macros, $decl ); 
    234         $decl =~ s/\t/    /g; 
    235         push( @decls, $decl ); 
    236     } 
    237  
    238     foreach my $func (@funcs) { 
    239         my @args    = @{ $func->{args} }; 
    240         my @asserts = asserts_from_args( @args ); 
    241  
    242         my $assert = "#define ASSERT_ARGS_" . $func->{name}; 
    243         if(length($func->{name}) > 29) { 
    244             $assert .= " \\\n    "; 
    245         } 
    246         $assert .= " __attribute__unused__ int _ASSERT_ARGS_CHECK = ("; 
    247         if(@asserts) { 
    248             $assert .= "\\\n       "; 
    249             $assert .= join(" \\\n    , ", @asserts); 
    250         } 
    251         else { 
    252             $assert .= "0"; 
    253         } 
    254         $assert .= ")"; 
    255         push(@decls, $assert); 
    256     } 
    257  
    258     return @decls; 
    259 } 
    260  
    261 sub read_file { 
    262     my $filename = shift; 
    263  
    264     open my $fh, '<', $filename or die "couldn't read '$filename': $!"; 
    265     my $text = do { local $/ = undef; <$fh> }; 
    266     close $fh; 
    267  
    268     return $text; 
    269 } 
    270  
    271 sub write_file { 
    272     my $filename = shift; 
    273     my $text     = shift; 
    274  
    275     open my $fh, '>', $filename or die "couldn't write '$filename': $!"; 
    276     print {$fh} $text; 
    277     close $fh; 
    278 } 
    279  
    280 sub replace_headerized_declarations { 
    281     my $source_code = shift; 
    282     my $sourcefile = shift; 
    283     my $hfile       = shift; 
    284     my @funcs       = @_; 
    285  
    286     # Allow a way to not headerize statics 
    287     if ( $source_code =~ m{/\*\s*HEADERIZER NONE:\s*$sourcefile\s*\*/} ) { 
    288         return $source_code; 
    289     } 
    290  
    291     @funcs = sort api_first_then_alpha @funcs; 
    292  
    293     my @function_decls = make_function_decls(@funcs); 
    294  
    295     my $function_decls = join( "\n", @function_decls ); 
    296     my $STARTMARKER    = qr{/\* HEADERIZER BEGIN: $sourcefile \*/\n}; 
    297     my $ENDMARKER      = qr{/\* HEADERIZER END: $sourcefile \*/\n?}; 
    298     my $DO_NOT_TOUCH   = q{/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */}; 
    299  
    300     $source_code =~ 
    301         s{($STARTMARKER)(?:.*?)($ENDMARKER)} 
    302          {$1$DO_NOT_TOUCH\n\n$function_decls\n$DO_NOT_TOUCH\n$2}s 
    303         or die "Need begin/end HEADERIZER markers for $sourcefile in $hfile\n"; 
    304  
    305     return $source_code; 
    306 } 
    307  
    308 sub api_first_then_alpha { 
    309     return ( ( $b->{is_api} || 0 ) <=> ( $a->{is_api} || 0 ) ) 
    310         || ( lc $a->{name} cmp lc $b->{name} ); 
    311 } 
    312  
    313 sub main { 
    314     my $macro_match; 
    315     GetOptions( 
    316         'macro=s' => \$macro_match, 
    317     ) or exit(1); 
    318  
    319     die 'No files specified.' unless @ARGV; 
    320     my %ofiles; 
    321     ++$ofiles{$_} for @ARGV; 
    322     my @ofiles = sort keys %ofiles; 
    323     for (@ofiles) { 
    324         print "$_ is specified more than once.\n" if $ofiles{$_} > 1; 
    325     } 
    326     my %sourcefiles; 
    327     my %sourcefiles_with_statics; 
    328     my %api; 
    329  
    330     # Walk the object files and find corresponding source (either .c or .pmc) 
    331     for my $ofile (@ofiles) { 
    332         next if $ofile =~ m/^\Qsrc$PConfig{slash}ops\E/; 
    333  
    334         $ofile =~ s/\\/\//g; 
    335  
    336         my $is_yacc = ($ofile =~ /\.y$/); 
    337         if ( !$is_yacc ) { 
    338             my $sfile = $ofile; 
    339             $sfile    =~ s/\Q$PConfig{o}\E$/.s/; 
    340             next if -f $sfile; 
    341         } 
    342  
    343         my $cfile = $ofile; 
    344         $cfile =~ s/\Q$PConfig{o}\E$/.c/ or $is_yacc 
    345             or die "$cfile doesn't look like an object file"; 
    346  
    347         my $pmcfile = $ofile; 
    348         $pmcfile =~ s/\Q$PConfig{o}\E$/.pmc/; 
    349  
    350         my $from_pmc = -f $pmcfile && !$is_yacc; 
    351  
    352         my $sourcefile = $from_pmc ? $pmcfile : $cfile; 
    353  
    354         my $source_code = read_file( $sourcefile ); 
    355         die qq{can't find HEADERIZER HFILE directive in "$sourcefile"} 
    356             unless $source_code =~ 
    357                 m{ /\* \s+ HEADERIZER\ HFILE: \s+ ([^*]+?) \s+ \*/ }sx; 
    358  
    359         my $hfile = $1; 
    360         if ( ( $hfile ne 'none' ) && ( not -f $hfile ) ) { 
    361             die qq{"$hfile" not found (referenced from "$sourcefile")}; 
    362         } 
    363  
    364         my @decls; 
    365         if ( $macro_match ) { 
    366             @decls = $headerizer->extract_function_declarations( $source_code ); 
    367         } 
    368         else { 
    369             @decls = extract_function_declarations_and_update_source( $sourcefile ); 
    370         } 
    371  
    372         for my $decl (@decls) { 
    373             my $components = $headerizer->function_components_from_declaration( $sourcefile, $decl ); 
    374             push( @{ $sourcefiles{$hfile}->{$sourcefile} }, $components ) unless $hfile eq 'none'; 
    375             push( @{ $sourcefiles_with_statics{$sourcefile} }, $components ) if $components->{is_static}; 
    376             if ( $macro_match ) { 
    377                 if ( grep { $_ eq $macro_match } @{$components->{macros}} ) { 
    378                     push( @{ $api{$sourcefile} }, $components ); 
    379                 } 
    380             } 
    381         } 
    382     }    # for @cfiles 
    383  
    384     if ( $macro_match ) { 
    385         my $nfuncs = 0; 
    386         for my $cfile ( sort keys %api ) { 
    387             my @funcs = sort { $a->{name} cmp $b->{name} } @{$api{$cfile}}; 
    388             print "$cfile\n"; 
    389             for my $func ( @funcs ) { 
    390                 print "    $func->{name}\n"; 
    391                 ++$nfuncs; 
    392             } 
    393         } 
    394         my $s = $nfuncs == 1 ? '' : 's'; 
    395         print "$nfuncs $macro_match function$s\n"; 
    396     } 
    397     else { # Normal headerization and updating 
    398         # Update all the .h files 
    399         for my $hfile ( sort keys %sourcefiles ) { 
    400             my $sourcefiles = $sourcefiles{$hfile}; 
    401  
    402             my $header = read_file($hfile); 
    403  
    404             for my $cfile ( sort keys %{$sourcefiles} ) { 
    405                 my @funcs = @{ $sourcefiles->{$cfile} }; 
    406                 @funcs = grep { not $_->{is_static} } @funcs;    # skip statics 
    407  
    408                 $header = replace_headerized_declarations( $header, $cfile, $hfile, @funcs ); 
    409             } 
    410  
    411             write_file( $hfile, $header ); 
    412         } 
    413  
    414         # Update all the .c files in place 
    415         for my $cfile ( sort keys %sourcefiles_with_statics ) { 
    416             my @funcs = @{ $sourcefiles_with_statics{$cfile} }; 
    417             @funcs = grep { $_->{is_static} } @funcs; 
    418  
    419             my $source = read_file($cfile); 
    420             $source = replace_headerized_declarations( $source, 'static', $cfile, @funcs ); 
    421  
    422             write_file( $cfile, $source ); 
    423         } 
    424         print "Headerization complete.\n"; 
    425     } 
    426  
    427     my %warnings = %{$headerizer->{warnings}}; 
    428     if ( keys %warnings ) { 
    429         my $nwarnings     = 0; 
    430         my $nwarningfuncs = 0; 
    431         my $nwarningfiles = 0; 
    432         for my $file ( sort keys %warnings ) { 
    433             ++$nwarningfiles; 
    434             print "$file\n"; 
    435             my $funcs = $warnings{$file}; 
    436             for my $func ( sort keys %{$funcs} ) { 
    437                 ++$nwarningfuncs; 
    438                 for my $error ( @{ $funcs->{$func} } ) { 
    439                     print "    $func: $error\n"; 
    440                     ++$nwarnings; 
    441                 } 
    442             } 
    443         } 
    444  
    445         print "$nwarnings warnings in $nwarningfuncs funcs in $nwarningfiles C files\n"; 
    446     } 
    447  
    448     return; 
    449 } 
    450  
    451 # From earlier documentation: 
    452 # * Generate docs from funcs 
    453 # * Somehow handle static functions in the source file 
    454 # * the .c files MUST have a /* HEADERIZER HFILE: foo/bar.h */ directive in them 
    455 # * Support for multiple .c files pointing at the same .h file 
    456 # * Does NOT remove all blocks in the .h file, so if a .c file 
    457 #   disappears, its block is "orphaned" and will remain there. 
    458  
    459 # Local Variables: 
    460 #   mode: cperl 
    461 #   cperl-indent-level: 4 
    462 #   fill-column: 100 
    463 # End: 
    464 # vim: expandtab shiftwidth=4: 
  • tools/build/README

     
     1# $Id$ 
     2README for tools/build/ 
     3 
     4This directory is intended to hold programs, templates and configuration files 
     5invoked by the default 'make' target ('make all'), with or without 
     6command-line options, during the Parrot build process. 
     7 
     8Programs, templates and configuration files invoked by 'make install' or 
     9'make install-dev' should be placed in tools/release/. 
     10 
     11Other things being equal, programs, templates and configuration files invoked 
     12by all other 'make' targets (e.g., 'make headerizer') should be placed in 
     13tools/dev/. 
  • tools/release/crow.pir

    Property changes on: tools/build/README
    ___________________________________________________________________
    Added: svn:mergeinfo
    Added: svn:eol-style
       + native
    Added: svn:keywords
       + Author Date Id Revision
    
     
     1#! ./parrot 
     2# Copyright (C) 2007-2008, Parrot Foundation. 
     3# $Id$ 
     4 
     5=head1 TITLE 
     6 
     7crow.pir -- Make noise about the new Parrot release 
     8 
     9=head1 DESCRIPTION 
     10 
     11This utility is used to help Release Managers format announcement messages. 
     12It uses a *very* simple and fast templating system, described in the related 
     13module, L<runtime/parrot/library/Crow.pir>. 
     14 
     15=head1 SYNOPSIS 
     16 
     17  # see 
     18  % parrot tools/release/crow.pir --help 
     19 
     20=cut 
     21 
     22 
     23.sub 'main' :main 
     24    .param pmc args 
     25 
     26    load_bytecode 'Crow.pbc' 
     27 
     28    .local pmc exports, curr_namespace, test_namespace 
     29    curr_namespace = get_namespace 
     30    test_namespace = get_namespace ['Crow'] 
     31    exports = split ' ', 'get_news get_args process' 
     32    test_namespace.'export_to'(curr_namespace, exports) 
     33 
     34    .local pmc opts 
     35    opts = get_args(args) 
     36 
     37    unless null opts goto got_opts 
     38    opts = new 'Hash' 
     39  got_opts: 
     40 
     41    .local pmc templates 
     42    templates = 'get_json'('tools/release/templates.json') 
     43 
     44    .local string template, type 
     45    type = opts['type'] 
     46    if type != '' goto got_type 
     47    type = 'text' 
     48 
     49got_type: 
     50    template = 'get_template'(templates, type) 
     51 
     52    .local pmc data 
     53    data = 'get_json'('tools/release/release.json') 
     54 
     55    .local string version 
     56    version = data['release.version'] 
     57 
     58    $S0 = concat type, '.news' 
     59    $I0 = templates[$S0] 
     60    if $I0 goto get_news 
     61    data['NEWS'] = '' 
     62    goto process 
     63  get_news: 
     64    $S0 = 'get_news'(version) 
     65    data['NEWS'] = $S0 
     66 
     67 
     68  process: 
     69    .local string result 
     70    result = process(template, data) 
     71    say result 
     72.end 
     73 
     74 
     75.sub 'get_json' 
     76    .param string filename 
     77 
     78    load_bytecode 'Config/JSON.pbc' 
     79 
     80     .local pmc exports, curr_namespace, test_namespace 
     81    curr_namespace = get_namespace 
     82    test_namespace = get_namespace [ 'Config';'JSON' ] 
     83    exports = split ' ', 'ReadConfig' 
     84    test_namespace.'export_to'(curr_namespace, exports) 
     85 
     86    .local pmc result 
     87    result = ReadConfig(filename) 
     88 
     89    .return (result) 
     90.end 
     91 
     92 
     93.sub 'get_template' 
     94    .param pmc templates 
     95    .param string type 
     96 
     97    $S0 = concat type, '.text' 
     98    $S1 = templates[$S0] 
     99    .return ($S1) 
     100.end 
     101 
     102 
     103# Local Variables: 
     104#   mode: pir 
     105#   fill-column: 100 
     106# End: 
     107# vim: expandtab shiftwidth=4 ft=pir: 
  • tools/release/templates.json

    Property changes on: tools/release/crow.pir
    ___________________________________________________________________
    Added: svn:keywords
       + Author Date Id Revision
    Added: svn:mergeinfo
       Merged /branches/tt_696/tools/util/crow.pir:r39055-39086
       Merged /branches/vtable_massacre/tools/util/crow.pir:r43827-43920
       Merged /branches/gc-refactor/tools/util/crow.pir:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/util/crow.pir:r43520-43704
       Merged /branches/fix_icc_failures/tools/util/crow.pir:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/util/crow.pir:r44790-44875
       Merged /branches/noalignptrs/tools/util/crow.pir:r43151-43489
       Merged /branches/headercleanup/tools/util/crow.pir:r37946-38257
       Merged /branches/no_pmc_install/tools/util/crow.pir:r45100-45105
       Merged /branches/RELEASE_1_3_0/tools/util/crow.pir:r39592-39598
       Merged /branches/auto_format_no_Config/tools/util/crow.pir:r42352-42410
       Merged /branches/stringnull/tools/util/crow.pir:r45492-45618
       Merged /branches/ns_func_cleanup/tools/util/crow.pir:r47026-47677
       Merged /branches/dynop_mapping/tools/util/crow.pir:r47504-48410
       Merged /branches/RELEASE_0_8_2/tools/util/crow.pir:r34004-34020
       Merged /branches/tt_1449/tools/util/crow.pir:r44021-44101
       Merged /branches/tt1452_configure_debug/tools/util/crow.pir:r47168-47317
       Merged /branches/pmc_sans_unionval/tools/util/crow.pir:r40531-40725
       Merged /branches/bsr_jsr_ret/tools/util/crow.pir:r40212-40267
       Merged /branches/one_make/tools/util/crow.pir:r43277-43591
       Merged /branches/tt1393_retcon/tools/util/crow.pir:r43652-43720
       Merged /branches/opengl_dynamic_nci/tools/util/crow.pir:r43840-44139
       Merged /branches/tt362/tools/util/crow.pir:r43955-44212
       Merged /branches/platform_determine_earlier/tools/util/crow.pir:r42413-42432
       Merged /branches/ucs4_encoding/tools/util/crow.pir:r46803-46997
       Merged /branches/cfunctionsdocs/tools/util/crow.pir:r47551-47916
       Merged /branches/pmc_freeze_cleanup/tools/util/crow.pir:r43031-43433
       Merged /branches/remove-next_for_GC/tools/util/crow.pir:r41487-41507
       Merged /branches/configtests/tools/util/crow.pir:r42236-42574
       Merged /branches/auto_frames_refactor/tools/util/crow.pir:r41426-41455
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/crow.pir:r43163-43440
       Merged /branches/op_pmcs/tools/util/crow.pir:r43820-44044
       Merged /branches/pmc_func_cleanup/tools/util/crow.pir:r43978-44189
       Merged /branches/kill_stacks/tools/util/crow.pir:r40284-40287
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/crow.pir:r43337-43339
       Merged /branches/no_running_make_test/tools/util/crow.pir:r43474-43545
       Merged /branches/gc_internals/tools/util/crow.pir:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/crow.pir:r48343-48374
       Merged /branches/removing_stm/tools/util/crow.pir:r35464-35502
       Merged /branches/io_rewiring/tools/util/crow.pir:r39195-39460
       Merged /branches/assert_args/tools/util/crow.pir:r34776-34857
       Merged /branches/ops_massacre/tools/util/crow.pir:r46812-47047
       Merged /branches/jit_h_files/tools/util/crow.pir:r34166-35215
       Merged /branches/runcore_purge/tools/util/crow.pir:r45837-45948
       Merged /branches/pbc_frozen_strings1/tools/util/crow.pir:r46081-46225
       Merged /branches/convert_OSNAME/tools/util/crow.pir:r42258-42340
       Merged /branches/gc_api/tools/util/crow.pir:r38521-38653
       Merged /branches/tt528_vtinit/tools/util/crow.pir:r38444-38470
       Merged /branches/library_files/tools/util/crow.pir:r41458-41848
       Merged /branches/hash_faster/tools/util/crow.pir:r47841-47862
       Merged /branches/parrot_call_dep/tools/util/crow.pir:r44134-44188
    Added: svn:eol-style
       + native
    
     
     1{ 
     2    "text.news" : true, 
     3    "text.text" : " 
     4 
     5On behalf of the Parrot team, I'm proud to announce Parrot @release.version@ 
     6\"@release.name@.\" Parrot (@web.root@) is a virtual machine aimed 
     7at running all dynamic languages. 
     8 
     9Parrot @release.version@ is available on Parrot's FTP site, or follow the 
     10download instructions at @web.root@@web.source@.  For those who would like to 
     11develop on Parrot, or help develop Parrot itself, we recommend using Subversion 
     12on the source code repository to get the latest and best Parrot code. 
     13 
     14Parrot @release.version@ News: 
     15@NEWS@ 
     16 
     17Many thanks to all our contributors for making this possible, and our sponsors 
     18for supporting this project.  Our next scheduled release is @release.nextdate@. 
     19 
     20Enjoy! 
     21 
     22", 
     23 
     24    "html.news" : true, 
     25    "html.text" : " 
     26<p>On behalf of the Parrot team, I'm proud to announce Parrot @release.version@ 
     27&quot;@release.name@.&quot; <a href=\"@web.root@\">Parrot</a> 
     28is a virtual machine aimed at running all dynamic languages.</p> 
     29 
     30<p>Parrot @release.version@ is available on <a href=\"@ftp.path@\">Parrot's FTP 
     31site</a>, or <a href=\"@web.root@@web.source@\">follow the download 
     32instructions</a>.  For those who would like to develop on Parrot, or help 
     33develop Parrot itself, we recommend using <a 
     34href=\"@subversion.root@\">Subversion</a>  on <a href=\"@web.repository@\">our 
     35source code repository</a> to get the latest and best Parrot code.</p> 
     36 
     37<p>Parrot @release.version@ News:<br/> 
     38<pre>@NEWS@</pre></p> 
     39 
     40<p>Thanks to all our contributors for making this possible, and our sponsors 
     41for supporting this project.  Our next release is @release.nextdate@.</p> 
     42 
     43<p>Enjoy!</p> 
     44", 
     45 
     46    "bugday.news" : false, 
     47    "bugday.text" : " 
     48Bug Day 
     49 
     50On @bugday.day@, @bugday.date@, please join us on IRC in #parrot 
     51(irc.parrot.org) to work on closing out as many Trac tickets 
     52(https://trac.parrot.org) tickets as possible in the parrot queue. This will 
     53help us get ready for the next release of parrot: @release.version@, scheduled 
     54for @release.day@, @release.date@. You'll find C, parrot assembly, perl, 
     55documentation, and plenty of tasks to go around. Core developers will be 
     56available most of the day (starting at around 10am GMT) to answer questions. 
     57 
     58No experience with parrot necessary. 
     59 
     60--From: @wiki.root@@wiki.bugday@-- 
     61 
     62Check the list at: 
     63 
     64https://trac.parrot.org/parrot/report/3 
     65 
     66Which contains all the tickets I'd like to see resolved in @version@. To 
     67see all the open tickets, use: 
     68 
     69https://trac.parrot.org/parrot/report 
     70 
     71If you've got something you're working on that you think you'll be 
     72getting done before the release, please 
     73- add a ticket for it (if necessary); 
     74- set its milestone to this release. 
     75 
     76Thanks in advance for your patches and commits. ^_^ 
     77 
     78... Speaking of patches, we should also get through as many of these 
     79(accept or reject) as possible. 
     80 
     81@web.root@@web.openpatches@ 
     82" 
     83} 
  • tools/release/release.json

    Property changes on: tools/release/templates.json
    ___________________________________________________________________
    Added: svn:keywords
       + Author Date Id Revision
    Added: svn:mergeinfo
       Merged /branches/parrot_call_dep/tools/util/templates.json:r44134-44188
       Merged /branches/tt_696/tools/util/templates.json:r39055-39086
       Merged /branches/vtable_massacre/tools/util/templates.json:r43827-43920
       Merged /branches/gc-refactor/tools/util/templates.json:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/util/templates.json:r43520-43704
       Merged /branches/fix_icc_failures/tools/util/templates.json:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/util/templates.json:r44790-44875
       Merged /branches/noalignptrs/tools/util/templates.json:r43151-43489
       Merged /branches/headercleanup/tools/util/templates.json:r37946-38257
       Merged /branches/no_pmc_install/tools/util/templates.json:r45100-45105
       Merged /branches/RELEASE_1_3_0/tools/util/templates.json:r39592-39598
       Merged /branches/auto_format_no_Config/tools/util/templates.json:r42352-42410
       Merged /branches/stringnull/tools/util/templates.json:r45492-45618
       Merged /branches/ns_func_cleanup/tools/util/templates.json:r47026-47677
       Merged /branches/dynop_mapping/tools/util/templates.json:r47504-48410
       Merged /branches/RELEASE_0_8_2/tools/util/templates.json:r34004-34020
       Merged /branches/tt_1449/tools/util/templates.json:r44021-44101
       Merged /branches/tt1452_configure_debug/tools/util/templates.json:r47168-47317
       Merged /branches/pmc_sans_unionval/tools/util/templates.json:r40531-40725
       Merged /branches/bsr_jsr_ret/tools/util/templates.json:r40212-40267
       Merged /branches/one_make/tools/util/templates.json:r43277-43591
       Merged /branches/tt1393_retcon/tools/util/templates.json:r43652-43720
       Merged /branches/opengl_dynamic_nci/tools/util/templates.json:r43840-44139
       Merged /branches/tt362/tools/util/templates.json:r43955-44212
       Merged /branches/platform_determine_earlier/tools/util/templates.json:r42413-42432
       Merged /branches/ucs4_encoding/tools/util/templates.json:r46803-46997
       Merged /branches/cfunctionsdocs/tools/util/templates.json:r47551-47916
       Merged /branches/pmc_freeze_cleanup/tools/util/templates.json:r43031-43433
       Merged /branches/remove-next_for_GC/tools/util/templates.json:r41487-41507
       Merged /branches/configtests/tools/util/templates.json:r42236-42574
       Merged /branches/auto_frames_refactor/tools/util/templates.json:r41426-41455
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/templates.json:r43163-43440
       Merged /branches/op_pmcs/tools/util/templates.json:r43820-44044
       Merged /branches/pmc_func_cleanup/tools/util/templates.json:r43978-44189
       Merged /branches/kill_stacks/tools/util/templates.json:r40284-40287
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/templates.json:r43337-43339
       Merged /branches/no_running_make_test/tools/util/templates.json:r43474-43545
       Merged /branches/gc_internals/tools/util/templates.json:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/templates.json:r48343-48374
       Merged /branches/removing_stm/tools/util/templates.json:r35464-35502
       Merged /branches/io_rewiring/tools/util/templates.json:r39195-39460
       Merged /branches/assert_args/tools/util/templates.json:r34776-34857
       Merged /branches/ops_massacre/tools/util/templates.json:r46812-47047
       Merged /branches/jit_h_files/tools/util/templates.json:r34166-35215
       Merged /branches/runcore_purge/tools/util/templates.json:r45837-45948
       Merged /branches/pbc_frozen_strings1/tools/util/templates.json:r46081-46225
       Merged /branches/convert_OSNAME/tools/util/templates.json:r42258-42340
       Merged /branches/gc_api/tools/util/templates.json:r38521-38653
       Merged /branches/tt528_vtinit/tools/util/templates.json:r38444-38470
       Merged /branches/library_files/tools/util/templates.json:r41458-41848
       Merged /branches/hash_faster/tools/util/templates.json:r47841-47862
    Added: svn:eol-style
       + native
    
     
     1{ 
     2    "release.version"  : "2.7.0", 
     3    "release.name"     : "Australian King", 
     4    "release.day"      : "Tuesday", 
     5    "release.date"     : "17 August 2010", 
     6    "release.nextdate" : "21 September 2010", 
     7 
     8    "web.root"         : "http://parrot.org/", 
     9    "web.source"       : "download", 
     10    "web.openpatches"  : "openpatches.html", 
     11    "web.repository"   : "https://svn.parrot.org/parrot/trunk/", 
     12 
     13    "bugday.day"       : "Saturday", 
     14    "bugday.date"      : "18 September 2010", 
     15 
     16    "wiki.root"        : "https://trac.parrot.org/parrot/wiki/", 
     17    "wiki.bugday"      : "bug_day_2010_09_18", 
     18 
     19    "ftp.path"         : "ftp://ftp.parrot.org/pub/parrot/releases/devel/2.7.0/", 
     20    "subversion.root"  : "http://subversion.apache.org/" 
     21} 
  • tools/release/README

    Property changes on: tools/release/release.json
    ___________________________________________________________________
    Added: svn:keywords
       + Author Date Id Revision
    Added: svn:mergeinfo
       Merged /branches/no_running_make_test/tools/util/release.json:r43474-43545
       Merged /branches/gc_internals/tools/util/release.json:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/release.json:r48343-48374
       Merged /branches/removing_stm/tools/util/release.json:r35464-35502
       Merged /branches/io_rewiring/tools/util/release.json:r39195-39460
       Merged /branches/assert_args/tools/util/release.json:r34776-34857
       Merged /branches/ops_massacre/tools/util/release.json:r46812-47047
       Merged /branches/jit_h_files/tools/util/release.json:r34166-35215
       Merged /branches/runcore_purge/tools/util/release.json:r45837-45948
       Merged /branches/pbc_frozen_strings1/tools/util/release.json:r46081-46225
       Merged /branches/convert_OSNAME/tools/util/release.json:r42258-42340
       Merged /branches/gc_api/tools/util/release.json:r38521-38653
       Merged /branches/tt528_vtinit/tools/util/release.json:r38444-38470
       Merged /branches/library_files/tools/util/release.json:r41458-41848
       Merged /branches/hash_faster/tools/util/release.json:r47841-47862
       Merged /branches/parrot_call_dep/tools/util/release.json:r44134-44188
       Merged /branches/vtable_massacre/tools/util/release.json:r43827-43920
       Merged /branches/tt_696/tools/util/release.json:r39055-39086
       Merged /branches/pmc_freeze_with_pmcs/tools/util/release.json:r43520-43704
       Merged /branches/gc-refactor/tools/util/release.json:r41010-41302
       Merged /branches/rm_dynoplibs_make/tools/util/release.json:r44790-44875
       Merged /branches/fix_icc_failures/tools/util/release.json:r44593-44838
       Merged /branches/headercleanup/tools/util/release.json:r37946-38257
       Merged /branches/noalignptrs/tools/util/release.json:r43151-43489
       Merged /branches/stringnull/tools/util/release.json:r45492-45618
       Merged /branches/auto_format_no_Config/tools/util/release.json:r42352-42410
       Merged /branches/RELEASE_1_3_0/tools/util/release.json:r39592-39598
       Merged /branches/no_pmc_install/tools/util/release.json:r45100-45105
       Merged /branches/ns_func_cleanup/tools/util/release.json:r47026-47677
       Merged /branches/dynop_mapping/tools/util/release.json:r47504-48410
       Merged /branches/RELEASE_0_8_2/tools/util/release.json:r34004-34020
       Merged /branches/tt_1449/tools/util/release.json:r44021-44101
       Merged /branches/tt1452_configure_debug/tools/util/release.json:r47168-47317
       Merged /branches/one_make/tools/util/release.json:r43277-43591
       Merged /branches/bsr_jsr_ret/tools/util/release.json:r40212-40267
       Merged /branches/pmc_sans_unionval/tools/util/release.json:r40531-40725
       Merged /branches/opengl_dynamic_nci/tools/util/release.json:r43840-44139
       Merged /branches/tt1393_retcon/tools/util/release.json:r43652-43720
       Merged /branches/tt362/tools/util/release.json:r43955-44212
       Merged /branches/platform_determine_earlier/tools/util/release.json:r42413-42432
       Merged /branches/cfunctionsdocs/tools/util/release.json:r47551-47916
       Merged /branches/ucs4_encoding/tools/util/release.json:r46803-46997
       Merged /branches/pmc_freeze_cleanup/tools/util/release.json:r43031-43433
       Merged /branches/configtests/tools/util/release.json:r42236-42574
       Merged /branches/remove-next_for_GC/tools/util/release.json:r41487-41507
       Merged /branches/auto_frames_refactor/tools/util/release.json:r41426-41455
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/release.json:r43163-43440
       Merged /branches/op_pmcs/tools/util/release.json:r43820-44044
       Merged /branches/pmc_func_cleanup/tools/util/release.json:r43978-44189
       Merged /branches/kill_stacks/tools/util/release.json:r40284-40287
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/release.json:r43337-43339
    Added: svn:eol-style
       + native
    
     
     1# $Id$ 
     2README for tools/release/ 
     3 
     4This directory is intended to hold programs, templates and configuration files 
     5useful during the release process. 
  • tools/release/gen_release_info.pl

    Property changes on: tools/release/README
    ___________________________________________________________________
    Added: svn:keywords
       + Author Date Id Revision
    Added: svn:eol-style
       + native
    
     
     1#! perl 
     2# Copyright (C) 2008, Parrot Foundation. 
     3# $Id$ 
     4 
     5use strict; 
     6use warnings; 
     7 
     8=head1 NAME 
     9 
     10tools/release/gen_release_info.pl - generate release info for graphs and charts 
     11 
     12=head1 DESCRIPTION 
     13 
     14This utility generates release information from subversion in csv format, 
     15suitable for graphs, charts, and reports. 
     16 
     17=cut 
     18 
     19 
     20my $repo_url = 'https://svn.parrot.org/parrot/tags'; 
     21 
     22##  create a release information data structure 
     23my $r = { 
     24    map { $_->{number} => $_ } 
     25    map { m{^(RELEASE_)(.*)/} 
     26            ? { 
     27                tag => "$1$2", 
     28                number => sub{$a = shift; $a =~ y/_/./; $a }->($2), 
     29            } 
     30            : () 
     31        } 
     32    qx  { svn ls $repo_url } 
     33}; 
     34 
     35##  gather interesting release-related information from the tag 
     36map { 
     37    ##  ask subversion for info about the tag 
     38    my $readme = $repo_url . '/' . $r->{$_}{tag}; 
     39    warn "retrieving info on $readme\n"; 
     40    my $info = qx{ LANG=C svn info $readme }; 
     41 
     42    ##  pull the interesting items 
     43    $info =~ m{Author: (\S+)} and $r->{$_}{author}   = $1; 
     44    $info =~ m{Rev: (\S+)}    and $r->{$_}{revision} = $1; 
     45    $info =~ m{Date: (\S+)}   and $r->{$_}{date}     = $1; 
     46} keys %{ $r }; 
     47 
     48 
     49##  output info in csv format 
     50print 
     51    map { "$_\n" } 
     52    map { my $n = $_; join ',' => 
     53        map { $r->{$n}{$_} || '' } 
     54        qw{ tag number author revision date  } 
     55    } 
     56    sort keys %$r; 
     57 
     58# Local Variables: 
     59#   mode: cperl 
     60#   cperl-indent-level: 4 
     61#   fill-column: 100 
     62# End: 
     63# vim: expandtab shiftwidth=4: 
  • tools/release/inc_ver.pir

    Property changes on: tools/release/gen_release_info.pl
    ___________________________________________________________________
    Added: svn:keywords
       + Author Date Id Revision
    Added: svn:mergeinfo
       Merged /branches/noalignptrs/tools/util/gen_release_info.pl:r43151-43489
       Merged /branches/headercleanup/tools/util/gen_release_info.pl:r37946-38257
       Merged /branches/pmc_func_cleanup/tools/util/gen_release_info.pl:r43978-44189
       Merged /branches/ns_func_cleanup/tools/util/gen_release_info.pl:r47026-47677
       Merged /branches/kill_stacks/tools/util/gen_release_info.pl:r40284-40287
       Merged /branches/dynop_mapping/tools/util/gen_release_info.pl:r47504-48410
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/gen_release_info.pl:r43337-43339
       Merged /branches/tt_1449/tools/util/gen_release_info.pl:r44021-44101
       Merged /branches/removing_stm/tools/util/gen_release_info.pl:r35464-35502
       Merged /branches/tt1452_configure_debug/tools/util/gen_release_info.pl:r47168-47317
       Merged /branches/io_rewiring/tools/util/gen_release_info.pl:r39195-39460
       Merged /branches/assert_args/tools/util/gen_release_info.pl:r34776-34857
       Merged /branches/one_make/tools/util/gen_release_info.pl:r43277-43591
       Merged /branches/bsr_jsr_ret/tools/util/gen_release_info.pl:r40212-40267
       Merged /branches/pmc_sans_unionval/tools/util/gen_release_info.pl:r40531-40725
       Merged /branches/runcore_purge/tools/util/gen_release_info.pl:r45837-45948
       Merged /branches/jit_h_files/tools/util/gen_release_info.pl:r34166-35215
       Merged /branches/ops_massacre/tools/util/gen_release_info.pl:r46812-47047
       Merged /branches/pbc_frozen_strings1/tools/util/gen_release_info.pl:r46081-46225
       Merged /branches/tt362/tools/util/gen_release_info.pl:r43955-44212
       Merged /branches/tt528_vtinit/tools/util/gen_release_info.pl:r38444-38470
       Merged /branches/ucs4_encoding/tools/util/gen_release_info.pl:r46803-46997
       Merged /branches/cfunctionsdocs/tools/util/gen_release_info.pl:r47551-47916
       Merged /branches/pmc_freeze_cleanup/tools/util/gen_release_info.pl:r43031-43433
       Merged /branches/hash_faster/tools/util/gen_release_info.pl:r47841-47862
       Merged /branches/remove-next_for_GC/tools/util/gen_release_info.pl:r41487-41507
       Merged /branches/configtests/tools/util/gen_release_info.pl:r42236-42574
       Merged /branches/auto_frames_refactor/tools/util/gen_release_info.pl:r41426-41455
       Merged /branches/vtable_massacre/tools/util/gen_release_info.pl:r43827-43920
       Merged /branches/tt_696/tools/util/gen_release_info.pl:r39055-39086
       Merged /branches/op_pmcs/tools/util/gen_release_info.pl:r43820-44044
       Merged /branches/no_pmc_install/tools/util/gen_release_info.pl:r45100-45105
       Merged /branches/RELEASE_1_3_0/tools/util/gen_release_info.pl:r39592-39598
       Merged /branches/auto_format_no_Config/tools/util/gen_release_info.pl:r42352-42410
       Merged /branches/stringnull/tools/util/gen_release_info.pl:r45492-45618
       Merged /branches/RELEASE_0_8_2/tools/util/gen_release_info.pl:r34004-34020
       Merged /branches/no_running_make_test/tools/util/gen_release_info.pl:r43474-43545
       Merged /branches/gc_internals/tools/util/gen_release_info.pl:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/gen_release_info.pl:r48343-48374
       Merged /branches/opengl_dynamic_nci/tools/util/gen_release_info.pl:r43840-44139
       Merged /branches/tt1393_retcon/tools/util/gen_release_info.pl:r43652-43720
       Merged /branches/convert_OSNAME/tools/util/gen_release_info.pl:r42258-42340
       Merged /branches/gc_api/tools/util/gen_release_info.pl:r38521-38653
       Merged /branches/platform_determine_earlier/tools/util/gen_release_info.pl:r42413-42432
       Merged /branches/library_files/tools/util/gen_release_info.pl:r41458-41848
       Merged /branches/parrot_call_dep/tools/util/gen_release_info.pl:r44134-44188
       Merged /branches/gc-refactor/tools/util/gen_release_info.pl:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/util/gen_release_info.pl:r43520-43704
       Merged /branches/fix_icc_failures/tools/util/gen_release_info.pl:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/util/gen_release_info.pl:r44790-44875
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/gen_release_info.pl:r43163-43440
    Added: svn:eol-style
       + native
    
     
     1#!/usr/bin/env parrot 
     2# Copyright (C) 2010, Parrot Foundation. 
     3# $Id$ 
     4 
     5.sub 'main' :main 
     6    .local string version_file_name 
     7    version_file_name = 'VERSION' 
     8 
     9    # read the version 
     10    $P0 = new 'FileHandle' 
     11    $P0.'open'( version_file_name, 'r' ) 
     12    $S0 = $P0.'readline'() 
     13    $P0.'close'() 
     14 
     15    print 'version: ' 
     16    print $S0 
     17 
     18    # split the version 
     19    $P1 = split '.', $S0 
     20 
     21    # increment version 
     22    $I0 = $P1[1] 
     23    inc $I0 
     24    if $I0 != 12 goto NOT_NILL 
     25    $I0 = $P1[0] 
     26    inc $I0 
     27    $P1[0] = $I0 
     28    $I0 = 0 
     29NOT_NILL: 
     30    $P1[1] = $I0 
     31 
     32    # join the incremented version 
     33    $S0 = join '.', $P1 
     34 
     35    print 'new version: ' 
     36    print $S0 
     37 
     38    # write the new version to the version_file 
     39    $P0.'open'( version_file_name, 'w' ) 
     40    $P0.'print'( $S0 ) 
     41    $P0.'close'() 
     42.end 
     43 
     44# Local Variables: 
     45#   mode: pir 
     46#   fill-column: 100 
     47# End: 
     48# vim: expandtab shiftwidth=4 ft=pir: 
  • tools/util/perltidy.conf

    Property changes on: tools/release/inc_ver.pir
    ___________________________________________________________________
    Added: svn:eol_style
       + native
    Added: svn:keywords
       + Author Date Id Revision
    Added: svn:mergeinfo
       Merged /branches/opengl_dynamic_nci/tools/util/inc_ver.pir:r43840-44139
       Merged /branches/tt1393_retcon/tools/util/inc_ver.pir:r43652-43720
       Merged /branches/convert_OSNAME/tools/util/inc_ver.pir:r42258-42340
       Merged /branches/gc_api/tools/util/inc_ver.pir:r38521-38653
       Merged /branches/platform_determine_earlier/tools/util/inc_ver.pir:r42413-42432
       Merged /branches/library_files/tools/util/inc_ver.pir:r41458-41848
       Merged /branches/parrot_call_dep/tools/util/inc_ver.pir:r44134-44188
       Merged /branches/gc-refactor/tools/util/inc_ver.pir:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/util/inc_ver.pir:r43520-43704
       Merged /branches/fix_icc_failures/tools/util/inc_ver.pir:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/util/inc_ver.pir:r44790-44875
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/inc_ver.pir:r43163-43440
       Merged /branches/noalignptrs/tools/util/inc_ver.pir:r43151-43489
       Merged /branches/headercleanup/tools/util/inc_ver.pir:r37946-38257
       Merged /branches/pmc_func_cleanup/tools/util/inc_ver.pir:r43978-44189
       Merged /branches/ns_func_cleanup/tools/util/inc_ver.pir:r47026-47677
       Merged /branches/kill_stacks/tools/util/inc_ver.pir:r40284-40287
       Merged /branches/dynop_mapping/tools/util/inc_ver.pir:r47504-48410
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/inc_ver.pir:r43337-43339
       Merged /branches/tt_1449/tools/util/inc_ver.pir:r44021-44101
       Merged /branches/removing_stm/tools/util/inc_ver.pir:r35464-35502
       Merged /branches/tt1452_configure_debug/tools/util/inc_ver.pir:r47168-47317
       Merged /branches/assert_args/tools/util/inc_ver.pir:r34776-34857
       Merged /branches/io_rewiring/tools/util/inc_ver.pir:r39195-39460
       Merged /branches/pmc_sans_unionval/tools/util/inc_ver.pir:r40531-40725
       Merged /branches/bsr_jsr_ret/tools/util/inc_ver.pir:r40212-40267
       Merged /branches/one_make/tools/util/inc_ver.pir:r43277-43591
       Merged /branches/runcore_purge/tools/util/inc_ver.pir:r45837-45948
       Merged /branches/jit_h_files/tools/util/inc_ver.pir:r34166-35215
       Merged /branches/ops_massacre/tools/util/inc_ver.pir:r46812-47047
       Merged /branches/pbc_frozen_strings1/tools/util/inc_ver.pir:r46081-46225
       Merged /branches/tt362/tools/util/inc_ver.pir:r43955-44212
       Merged /branches/tt528_vtinit/tools/util/inc_ver.pir:r38444-38470
       Merged /branches/cfunctionsdocs/tools/util/inc_ver.pir:r47551-47916
       Merged /branches/ucs4_encoding/tools/util/inc_ver.pir:r46803-46997
       Merged /branches/pmc_freeze_cleanup/tools/util/inc_ver.pir:r43031-43433
       Merged /branches/hash_faster/tools/util/inc_ver.pir:r47841-47862
       Merged /branches/configtests/tools/util/inc_ver.pir:r42236-42574
       Merged /branches/remove-next_for_GC/tools/util/inc_ver.pir:r41487-41507
       Merged /branches/auto_frames_refactor/tools/util/inc_ver.pir:r41426-41455
       Merged /branches/tt_696/tools/util/inc_ver.pir:r39055-39086
       Merged /branches/vtable_massacre/tools/util/inc_ver.pir:r43827-43920
       Merged /branches/op_pmcs/tools/util/inc_ver.pir:r43820-44044
       Merged /branches/no_pmc_install/tools/util/inc_ver.pir:r45100-45105
       Merged /branches/RELEASE_1_3_0/tools/util/inc_ver.pir:r39592-39598
       Merged /branches/auto_format_no_Config/tools/util/inc_ver.pir:r42352-42410
       Merged /branches/stringnull/tools/util/inc_ver.pir:r45492-45618
       Merged /branches/RELEASE_0_8_2/tools/util/inc_ver.pir:r34004-34020
       Merged /branches/no_running_make_test/tools/util/inc_ver.pir:r43474-43545
       Merged /branches/gc_internals/tools/util/inc_ver.pir:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/inc_ver.pir:r48343-48374
    Added: svn:eol-style
       + native
    
     
    1 # A declarative version of PDD07 for perl. 
    2  
    3 # Must apply... 
    4  
    5 -l=100 # Source line width is limited to 100 characters. 
    6 -i=4   # must be indented four columns (no tabs) 
    7 -ola   # Labels (including case labels) must be outdented two columns 
    8 -ci=4  # Long lines, when split, must use at least one extra level of indentation on the continued line. 
    9 -ce   # Cuddled elses are forbidden: i.e. avoid } else { . 
    10  
    11 # Nice to haves... 
    12  
    13 # Freeze new lines; some really short lines look good the way they 
    14 # are, this should stop perltidy from merging them together 
    15 -fnl 
  • tools/util/perlcritic-cage.conf

     
    1 # A more stringent set of rules for cage cleaners 
    2  
    3 [-CodeLayout::ProhibitParensWithBuiltins] 
    4 [CodeLayout::ProhibitHardTabs] 
    5 allow_leading_tabs = 0 
    6   
    7 [-CodeLayout::RequireTidyCode] 
    8  
    9 [-ControlStructures::ProhibitPostfixControls] 
    10 [-ControlStructures::ProhibitUnlessBlocks] 
    11  
    12 [-Documentation::PodSpelling] 
    13 [-Documentation::RequirePodAtEnd] 
    14 [-Documentation::RequirePodSections] 
    15  
    16 [-ErrorHandling::RequireCarping] 
    17  
    18 [-InputOutput::ProhibitBacktickOperators] 
    19 [-InputOutput::ProhibitInteractiveTest] 
    20 [-InputOutput::RequireCheckedSyscalls] 
    21 functions = :builtins 
    22 exclude_functions = print 
    23  
    24 [-Miscellanea::RequireRcsKeywords] 
    25  
    26 [-Modules::RequireVersionVar] 
    27  
    28 [-RegularExpressions::ProhibitEscapedMetacharacters] 
    29 [-RegularExpressions::RequireDotMatchAnything] 
    30 [-RegularExpressions::RequireExtendedFormatting] 
    31 [-RegularExpressions::RequireLineBoundaryMatching] 
    32  
    33 [-ValuesAndExpressions::ProhibitConstantPragma] 
    34 [-ValuesAndExpressions::ProhibitEmptyQuotes] 
    35 [-ValuesAndExpressions::ProhibitMagicNumbers] 
    36  
    37 [-Variables::ProhibitPunctuationVars] 
  • tools/util/crow.pir

     
    1 #! ./parrot 
    2 # Copyright (C) 2007-2008, Parrot Foundation. 
    3 # $Id$ 
    4  
    5 =head1 TITLE 
    6  
    7 crow.pir -- Make noise about the new Parrot release 
    8  
    9 =head1 DESCRIPTION 
    10  
    11 This utility is used to help Release Managers format announcement messages. 
    12 It uses a *very* simple and fast templating system, described in the related 
    13 module, L<runtime/parrot/library/Crow.pir>. 
    14  
    15 =head1 SYNOPSIS 
    16  
    17   # see 
    18   % parrot tools/util/crow.pir --help 
    19  
    20 =cut 
    21  
    22  
    23 .sub 'main' :main 
    24     .param pmc args 
    25  
    26     load_bytecode 'Crow.pbc' 
    27  
    28     .local pmc exports, curr_namespace, test_namespace 
    29     curr_namespace = get_namespace 
    30     test_namespace = get_namespace ['Crow'] 
    31     exports = split ' ', 'get_news get_args process' 
    32     test_namespace.'export_to'(curr_namespace, exports) 
    33  
    34     .local pmc opts 
    35     opts = get_args(args) 
    36  
    37     unless null opts goto got_opts 
    38     opts = new 'Hash' 
    39   got_opts: 
    40  
    41     .local pmc templates 
    42     templates = 'get_json'('tools/util/templates.json') 
    43  
    44     .local string template, type 
    45     type = opts['type'] 
    46     if type != '' goto got_type 
    47     type = 'text' 
    48  
    49 got_type: 
    50     template = 'get_template'(templates, type) 
    51  
    52     .local pmc data 
    53     data = 'get_json'('tools/util/release.json') 
    54  
    55     .local string version 
    56     version = data['release.version'] 
    57  
    58     $S0 = concat type, '.news' 
    59     $I0 = templates[$S0] 
    60     if $I0 goto get_news 
    61     data['NEWS'] = '' 
    62     goto process 
    63   get_news: 
    64     $S0 = 'get_news'(version) 
    65     data['NEWS'] = $S0 
    66  
    67  
    68   process: 
    69     .local string result 
    70     result = process(template, data) 
    71     say result 
    72 .end 
    73  
    74  
    75 .sub 'get_json' 
    76     .param string filename 
    77  
    78     load_bytecode 'Config/JSON.pbc' 
    79  
    80      .local pmc exports, curr_namespace, test_namespace 
    81     curr_namespace = get_namespace 
    82     test_namespace = get_namespace [ 'Config';'JSON' ] 
    83     exports = split ' ', 'ReadConfig' 
    84     test_namespace.'export_to'(curr_namespace, exports) 
    85  
    86     .local pmc result 
    87     result = ReadConfig(filename) 
    88  
    89     .return (result) 
    90 .end 
    91  
    92  
    93 .sub 'get_template' 
    94     .param pmc templates 
    95     .param string type 
    96  
    97     $S0 = concat type, '.text' 
    98     $S1 = templates[$S0] 
    99     .return ($S1) 
    100 .end 
    101  
    102  
    103 # Local Variables: 
    104 #   mode: pir 
    105 #   fill-column: 100 
    106 # End: 
    107 # vim: expandtab shiftwidth=4 ft=pir: 
  • tools/util/dump_pbc.pl

     
    1 #! perl 
    2  
    3 # Copyright (C) 2008, Parrot Foundation. 
    4 # $Id$ 
    5  
    6 =head1 NAME 
    7  
    8 tools/util/dump_pbc.pl - Weave together PBC disassembly with PIR source 
    9  
    10 =head1 SYNOPSIS 
    11  
    12  perl tools/util/dump_pbc.pl foo.pbc 
    13  
    14 =head1 DESCRIPTION 
    15  
    16 dump_pbc.pl uses Parrot's F<pbc_disassemble> program to disassemble the opcodes 
    17 in a PBC (Parrot ByteCode) file, then weaves the disassembly together with 
    18 the original PIR source file(s).  This makes it easier to see how the PIR 
    19 syntactic sugar is desugared into raw Parrot opcodes. 
    20  
    21 =head1 BUGS 
    22  
    23 This program has only been tested for a few simple cases.  Also, the name 
    24 might suggest a different use than its actual purpose. 
    25  
    26 While it is not a bug in F<dump_pbc.pl> per se, there is a line numbering 
    27 bug for some PBC opcode sequences that will result in the disassembled 
    28 opcodes appearing just before the source lines they represent, rather 
    29 than just after.  There does not appear to be consensus yet about where 
    30 this bug actually resides. 
    31  
    32 =cut 
    33  
    34 use strict; 
    35 use warnings; 
    36 use Cwd; 
    37 use FindBin; 
    38  
    39 my ($PARROT_ROOT, $RUNTIME_DIR); 
    40 BEGIN { 
    41     $PARROT_ROOT = Cwd::abs_path("$FindBin::Bin/../.."); 
    42     $RUNTIME_DIR = "$PARROT_ROOT/runtime/parrot"; 
    43 } 
    44  
    45 use lib "$PARROT_ROOT/lib"; 
    46 use Parrot::Config '%PConfig'; 
    47  
    48 my $DISASSEMBLER = "$PConfig{build_dir}$PConfig{slash}pbc_disassemble$PConfig{exe}"; 
    49  
    50 go(@ARGV); 
    51  
    52 sub go { 
    53     my $pbc = shift; 
    54  
    55     # The following mess brought to you by Win32, where pipe open doesn't work, 
    56     # and thus its greater security and cleaner error handling are unavailable. 
    57  
    58     -f $pbc && -r _ 
    59         or die "PBC file '$pbc' does not exist or is not readable.\n"; 
    60  
    61     -f $DISASSEMBLER && -x _ 
    62         or die  "Can't find disassembler '$DISASSEMBLER';" 
    63               . "did you remember to make parrot first?\n"; 
    64  
    65     my @dis = `$DISASSEMBLER $pbc`; 
    66     die "No disassembly; errors: $?, $!" unless @dis; 
    67  
    68     my $cur_file = ''; 
    69     my $cur_line = -1; 
    70     my %cache; 
    71  
    72     foreach (@dis) { 
    73         if (/^(?:# )?Current Source Filename (.*)/) { 
    74             my $found = $1; 
    75             $found =~ s/^'//; 
    76             $found =~ s/'$//; 
    77             if ($cur_file ne $found) { 
    78                 $cur_file           = $found; 
    79                 $cache{$cur_file} ||= slurp_file($cur_file); 
    80                 $cur_line           = -1; 
    81  
    82                 print "\n#### $cur_file\n"; 
    83             } 
    84         } 
    85         elsif (my ($info, $seq, $pc, $line, $code) = /^((\d+)-(\d+) (\d+): )(.*)/) { 
    86             my $int_line = int    $line; 
    87             my $len_line = length $line; 
    88             if ($cur_line != $int_line) { 
    89                 $cur_line = 0 if $cur_line == -1; 
    90                 print "\n"; 
    91                 foreach my $i ($cur_line + 1 .. $int_line) { 
    92                     my $source_code = $cache{$cur_file}[$i-1]; 
    93                     # next    unless $source_code =~ /\S/; 
    94                     printf "# %*d:   %s", $len_line, $i, $source_code; 
    95                     print  "\n" if $source_code =~ /^\.end/; 
    96                 } 
    97                 $cur_line  = $int_line; 
    98             } 
    99  
    100             print ' ' x ($len_line + 4), "$code\n"; 
    101         } 
    102     } 
    103 } 
    104  
    105 sub slurp_file { 
    106     my $file = shift; 
    107     my $source; 
    108  
    109        open $source, '<', $file 
    110     or open $source, '<', "$PARROT_ROOT/$file" 
    111     or open $source, '<', "$RUNTIME_DIR/$file" 
    112     or die "Could not open source file '$file': $!"; 
    113  
    114     my @lines = <$source>; 
    115  
    116     return \@lines; 
    117 } 
    118  
    119  
    120 # Local Variables: 
    121 #   mode: cperl 
    122 #   cperl-indent-level: 4 
    123 #   fill-column: 100 
    124 # End: 
    125 # vim: expandtab shiftwidth=4: 
  • tools/util/parrot-config.pir

     
    1 #!/usr/bin/env parrot 
    2 # $Id$ 
    3  
    4 =head1 NAME 
    5  
    6 config.pir - Print a Parrot configuration item 
    7  
    8 =head1 VERSION 
    9  
    10 version 0.01 
    11  
    12 =head1 SYNOPSIS 
    13  
    14   ./parrot parrot-config.pir VERSION 
    15   ./parrot parrot-config.pir ccflags 
    16   ./parrot parrot-config.pir --dump 
    17  
    18 =head1 DESCRIPTION 
    19  
    20 Print out configuration items. 
    21  
    22 =head1 AUTHOR 
    23  
    24 Leopold Toetsch E<lt>lt@toetsch.atE<gt>. 
    25  
    26 =head1 COPYRIGHT 
    27  
    28 Copyright (C) 2004-2009, Parrot Foundation. 
    29  
    30 =cut 
    31  
    32 .sub _main :main 
    33     .param pmc argv 
    34     .local int argc 
    35     argc = argv 
    36     if argc < 2 goto usage 
    37     .local pmc interp, conf_hash 
    38     .local string key 
    39     .include "iglobals.pasm" 
    40     interp = getinterp 
    41     conf_hash = interp[.IGLOBALS_CONFIG_HASH] 
    42     .local int i 
    43     i = 1 
    44 loop: 
    45     key = argv[i] 
    46     if key == '--help' goto usage 
    47     if key == '--dump' goto dump 
    48     $I0 = defined conf_hash[key] 
    49     unless $I0 goto failkey 
    50     dec argc 
    51     if i < argc goto dumpsome 
    52     $S0 = conf_hash[key] 
    53     print $S0 
    54     inc i 
    55     if i < argc goto loop 
    56     print "\n" 
    57     end 
    58 dumpsome: 
    59     key = argv[i] 
    60     $I0 = defined conf_hash[key] 
    61     unless $I0 goto failkey 
    62     print key 
    63     print " => '" 
    64     $S1 = conf_hash[key] 
    65     print $S1 
    66     say "'" 
    67     inc i 
    68     if i <= argc goto dumpsome 
    69     end 
    70 failkey: 
    71     print " no such key: '" 
    72     print key 
    73     print "'\n" 
    74     end 
    75 dump: 
    76    .local pmc iterator 
    77     iterator = iter conf_hash 
    78 iter_loop: 
    79     unless iterator goto iter_end 
    80     shift $S0, iterator 
    81     print $S0 
    82     print " => '" 
    83     $S1 = conf_hash[$S0] 
    84     print $S1 
    85     say "'" 
    86     goto iter_loop 
    87 iter_end: 
    88     end 
    89 usage: 
    90     $S0 = argv[0] 
    91     $P0 = getinterp 
    92     .include 'stdio.pasm' 
    93     $P1 = $P0.'stdhandle'(.PIO_STDERR_FILENO) 
    94     $P1.'print'($S0) 
    95     $P1.'print'(" [ <config-key> [ <config-key> ... ] | --dump | --help ]\n") 
    96     exit 1 
    97 .end 
    98  
    99 # Local Variables: 
    100 #   mode: pir 
    101 #   fill-column: 100 
    102 # End: 
    103 # vim: expandtab shiftwidth=4 ft=pir: 
  • tools/util/perlcritic.conf

     
    1 verbose = 3 
    2  
    3 # not all the profiles listed here are installed by default, even if you have 
    4 # Perl::Critic. Shhhh. 
    5 profile-strictness = quiet 
    6  
    7 [BuiltinFunctions::ProhibitStringySplit] 
    8 add_themes = parrot 
    9  
    10 [CodeLayout::ProhibitDuplicateCoda] 
    11 add_themes = parrot 
    12  
    13 [CodeLayout::ProhibitHardTabs] 
    14 allow_leading_tabs = 0 
    15 add_themes = parrot 
    16  
    17 [CodeLayout::ProhibitTrailingWhitespace] 
    18 add_themes = parrot 
    19  
    20 [CodeLayout::RequireTidyCode] 
    21 perltidyrc = tools/util/perltidy.conf 
    22 add_themes = extra 
    23  
    24 [CodeLayout::UseParrotCoda] 
    25 add_themes = parrot 
    26  
    27 [InputOutput::ProhibitBarewordFileHandles] 
    28 add_themes = parrot 
    29  
    30 [InputOutput::ProhibitTwoArgOpen] 
    31 add_themes = parrot 
    32  
    33 [NamingConventions::ProhibitAmbiguousNames] 
    34 # remove abstract from the list of forbidden names 
    35 forbid = bases close contract last left no record right second set 
    36 add_themes = extra 
    37  
    38 [Subroutines::ProhibitBuiltinHomonyms] 
    39 add_themes = extra 
    40  
    41 [Subroutines::ProhibitExplicitReturnUndef] 
    42 add_themes = parrot 
    43  
    44 [Subroutines::ProhibitSubroutinePrototypes] 
    45 add_themes = parrot 
    46  
    47 [Subroutines::RequireFinalReturn] 
    48 add_themes = extra 
    49  
    50 [TestingAndDebugging::MisplacedShebang] 
    51 add_themes = parrot 
    52  
    53 [TestingAndDebugging::ProhibitShebangWarningsArg] 
    54 add_themes = parrot 
    55  
    56 [TestingAndDebugging::RequirePortableShebang] 
    57 add_themes = parrot 
    58  
    59 [TestingAndDebugging::RequireUseStrict] 
    60 add_themes = parrot 
    61  
    62 [TestingAndDebugging::RequireUseWarnings] 
    63 add_themes = parrot 
    64  
    65 [ValuesAndExpressions::ProhibitInterpolationOfLiterals] 
    66 add_themes = extra 
    67  
    68 [Variables::ProhibitConditionalDeclarations] 
    69 add_themes = parrot 
    70  
    71 [Bangs::ProhibitFlagComments] 
    72 add_themes = extra 
    73  
    74 [Bangs::ProhibitRefProtoOrProto] 
    75 add_themes = extra 
  • tools/util/update_copyright.pl

     
    1 #! perl 
    2 # $Id$ 
    3  
    4 # Copyright (C) 2008, Parrot Foundation. 
    5  
    6 use strict; 
    7 use warnings; 
    8 use Fatal qw( open close ); 
    9  
    10 =head1 NAME 
    11  
    12 F<tools/util/update_copyright.pl> 
    13  
    14 =head1 DESCRIPTION 
    15  
    16 Given a list of files as command line arguments, update the copyright 
    17 notice to go from the earliest year noted to the current year. 
    18  
    19 Edits the files in place. You should update the copyright on a modified 
    20 file before you commit it back to the repository. 
    21  
    22 =cut 
    23  
    24 use lib 'lib'; 
    25 use Parrot::Test; 
    26  
    27 # Accept a little fuzz in the original copyright notice.. 
    28 my $copyright_re = qr/ 
    29   Copyright \s+ \(C\) \s+ 
    30   (\d\d\d\d)\s*(?:-\s*\d\d\d\d)? \s* ,? \s* 
    31   The \s+ Perl \s+ Foundation\.? 
    32 /xi; 
    33  
    34 my $year = (localtime())[5]+1900; 
    35  
    36 # loop over all the files specified on the command line 
    37 foreach my $file (@ARGV) { 
    38     my $contents = Parrot::Test::slurp_file( $file ); 
    39     if ( $contents =~ $copyright_re) { 
    40         my $old_year = $1; 
    41         if ($old_year eq $year) { 
    42             warn "$file already up to date.\n"; 
    43             next; 
    44         } 
    45         else { 
    46             $contents =~ s/$copyright_re/Copyright (C) $old_year-$year, Parrot Foundation./; 
    47             open my $ofh, '>', $file; 
    48             print {$ofh} $contents; 
    49             close $ofh; 
    50         } 
    51     } 
    52     else { 
    53         warn "$file doesn't have a valid copyright line.\n"; 
    54     } 
    55 } 
    56  
    57  
    58 # Local Variables: 
    59 #   mode: cperl 
    60 #   cperl-indent-level: 4 
    61 #   fill-column: 100 
    62 # End: 
    63 # vim: expandtab shiftwidth=4: 
  • tools/util/ncidef2pasm.pl

     
    1 #! perl 
    2  
    3 # Copyright (C) 2003-2007, Parrot Foundation. 
    4 # $Id$ 
    5  
    6 =head1 NAME 
    7  
    8 tools/util/ncidef2asm.pl - Turn an NCI library definition file into PASM 
    9  
    10 =head1 SYNOPSIS 
    11  
    12     perl tools/util/ncidef2asm.pl path/to/from_file [ path/to/to_file ] 
    13  
    14 =head1 DESCRIPTION 
    15  
    16 This program takes an NCI library definition file and turns it into PASM. 
    17  
    18 An NCI library definition file provides the information needed to 
    19 generate a parrot wrapper for the named library (or libraries). Its 
    20 format is simple, and looks like: 
    21  
    22   [package] 
    23   ncurses 
    24  
    25   [lib] 
    26   libform.so 
    27  
    28   [defs] 
    29   p new_field i i i i i i 
    30  
    31   [lib] 
    32   libncurses.so 
    33  
    34   [defs] 
    35   i is_term_resized i i 
    36  
    37 Note that the assembly file is generated in the order you specify, so 
    38 if there are library dependencies, make sure you have them in the 
    39 correct order. 
    40  
    41 =head2 package 
    42  
    43 Declares the package that all subsequent sub PMCs will be put 
    44 into. The name is a simple concatenation of the package name, double 
    45 colon, and the routine name, with no preceding punctuation. 
    46  
    47 =head2 lib 
    48  
    49 The name of the library to be loaded. Should be as qualified as 
    50 necessary for your platform--generally the full filename is required, 
    51 though the directory generally isn't. 
    52  
    53 You may load multiple libraries here, but only the last one loaded 
    54 will be exposed to subsequent defs. 
    55  
    56 =head2 defs 
    57  
    58 This section holds the definitions of functions. Each function is 
    59 assumed to be in the immediate preceding library. The definition of 
    60 the function is: 
    61  
    62   return_type name [param [param [param ...]]] 
    63  
    64 The param and return_type parameters use the NCI standard, which for 
    65 reference is: 
    66  
    67 =over 4 
    68  
    69 =item p 
    70  
    71 Parameter is a void pointer, taken from the PMC's data pointer. PMC is 
    72 assumed to be an unmanagedstruct or child class. 
    73  
    74 Taken from a P register 
    75  
    76 =item c 
    77  
    78 Parameter is a character. 
    79  
    80 Taken from an I register 
    81  
    82 =item s 
    83  
    84 Parameter is a short 
    85  
    86 Taken from an I register 
    87  
    88 =item i 
    89  
    90 Parameter is an int 
    91  
    92 Taken from an I register 
    93  
    94 =item l 
    95  
    96 Parameter is a long 
    97  
    98 Taken from an I register 
    99  
    100 =item f 
    101  
    102 Paramter is a float 
    103  
    104 Taken from an N register. 
    105  
    106 =item d 
    107  
    108 Parameter is a double. 
    109  
    110 Taken from an N register. 
    111  
    112 =item t 
    113  
    114 Paramter is a char *, presumably a C string 
    115  
    116 Taken from an S register 
    117  
    118 =item v 
    119  
    120 Void. Only valid as a return type, noting that the function returns no data. 
    121  
    122 =item I 
    123  
    124 Interpreter pointer. The current interpreter pointer is passed in 
    125  
    126 =item P 
    127  
    128 PMC. 
    129  
    130 =item 2 
    131  
    132 Pointer to short. 
    133  
    134 Taken from an I register. 
    135  
    136 =item 3 
    137  
    138 Pointer to int. 
    139  
    140 Taken from an I register 
    141  
    142 =item 4 
    143  
    144 Pointer to long 
    145  
    146 Taken from an I register 
    147  
    148 =back 
    149  
    150 =cut 
    151  
    152 use strict; 
    153 use warnings; 
    154  
    155 my ( $from_file, $to_file ) = @ARGV; 
    156  
    157 # If there is no destination file, strip off the extension of the 
    158 # source file and add a .pasm to it 
    159 if ( !defined $to_file ) { 
    160     $to_file = $from_file; 
    161     $to_file =~ s/\..*$//; 
    162     $to_file .= ".pasm"; 
    163 } 
    164  
    165 open my $INPUT,  '<', "$from_file" or die "Can't open up $from_file, error $!"; 
    166 open my $OUTPUT, '>', "$to_file"   or die "Can't open up $to_file, error $!"; 
    167  
    168 # To start, save all the registers, just in case 
    169 print $OUTPUT "saveall\n"; 
    170  
    171 my @libs; 
    172 my ( $cur_package, $line, $cur_section ); 
    173  
    174 # Our dispatch table 
    175 my (%dispatch) = ( 
    176     package => \&package_line, 
    177     lib     => \&lib_line, 
    178     defs    => \&def_line, 
    179 ); 
    180  
    181 while ( $line = <$INPUT> ) { 
    182  
    183     # Throw away trailing newlines, comments, and whitespace. If the 
    184     # line's empty, then off to the next line 
    185     chomp $line; 
    186     $line =~ s/#.*//; 
    187     $line =~ s/\s*$//; 
    188     next unless $line; 
    189  
    190     # Is it a section line? If so, extract the section and set it. 
    191     if ( $line =~ /\[(\w+)\]/ ) { 
    192         $cur_section = $1; 
    193         next; 
    194     } 
    195  
    196     # Everything else goes to the handler 
    197     $dispatch{$cur_section}->($line); 
    198  
    199 } 
    200  
    201 # Put the registers back and end 
    202 print $OUTPUT "restoreall\n"; 
    203 print $OUTPUT "end\n"; 
    204 close $OUTPUT; 
    205  
    206 sub package_line { 
    207     my $line = shift; 
    208  
    209     # Trim leading and trailing spaces 
    210     $line =~ s/^\s*//; 
    211     $line =~ s/\s*$//; 
    212  
    213     # Set the global current package 
    214     $cur_package = $line; 
    215  
    216 } 
    217  
    218 sub lib_line { 
    219     my $line = shift; 
    220     print $OUTPUT "loadlib P1, '$line'\n"; 
    221 } 
    222  
    223 sub def_line { 
    224     my $line = shift; 
    225     my ( $return_type, $name, @params ) = split ' ', $line; 
    226     unshift @params, $return_type; 
    227     my $signature = join( "", @params ); 
    228     print $OUTPUT "dlfunc P2, P1, '$name', '$signature'\n"; 
    229     print $OUTPUT "store_global '${cur_package}::${name}', P2\n"; 
    230 } 
    231  
    232 # Local Variables: 
    233 #   mode: cperl 
    234 #   cperl-indent-level: 4 
    235 #   fill-column: 100 
    236 # End: 
    237 # vim: expandtab shiftwidth=4: 
  • tools/util/templates.json

     
    1 { 
    2     "text.news" : true, 
    3     "text.text" : " 
    4  
    5 On behalf of the Parrot team, I'm proud to announce Parrot @release.version@ 
    6 \"@release.name@.\" Parrot (@web.root@) is a virtual machine aimed 
    7 at running all dynamic languages. 
    8  
    9 Parrot @release.version@ is available on Parrot's FTP site, or follow the 
    10 download instructions at @web.root@@web.source@.  For those who would like to 
    11 develop on Parrot, or help develop Parrot itself, we recommend using Subversion 
    12 on the source code repository to get the latest and best Parrot code. 
    13  
    14 Parrot @release.version@ News: 
    15 @NEWS@ 
    16  
    17 Many thanks to all our contributors for making this possible, and our sponsors 
    18 for supporting this project.  Our next scheduled release is @release.nextdate@. 
    19  
    20 Enjoy! 
    21  
    22 ", 
    23  
    24     "html.news" : true, 
    25     "html.text" : " 
    26 <p>On behalf of the Parrot team, I'm proud to announce Parrot @release.version@ 
    27 &quot;@release.name@.&quot; <a href=\"@web.root@\">Parrot</a> 
    28 is a virtual machine aimed at running all dynamic languages.</p> 
    29  
    30 <p>Parrot @release.version@ is available on <a href=\"@ftp.path@\">Parrot's FTP 
    31 site</a>, or <a href=\"@web.root@@web.source@\">follow the download 
    32 instructions</a>.  For those who would like to develop on Parrot, or help 
    33 develop Parrot itself, we recommend using <a 
    34 href=\"@subversion.root@\">Subversion</a>  on <a href=\"@web.repository@\">our 
    35 source code repository</a> to get the latest and best Parrot code.</p> 
    36  
    37 <p>Parrot @release.version@ News:<br/> 
    38 <pre>@NEWS@</pre></p> 
    39  
    40 <p>Thanks to all our contributors for making this possible, and our sponsors 
    41 for supporting this project.  Our next release is @release.nextdate@.</p> 
    42  
    43 <p>Enjoy!</p> 
    44 ", 
    45  
    46     "bugday.news" : false, 
    47     "bugday.text" : " 
    48 Bug Day 
    49  
    50 On @bugday.day@, @bugday.date@, please join us on IRC in #parrot 
    51 (irc.parrot.org) to work on closing out as many Trac tickets 
    52 (https://trac.parrot.org) tickets as possible in the parrot queue. This will 
    53 help us get ready for the next release of parrot: @release.version@, scheduled 
    54 for @release.day@, @release.date@. You'll find C, parrot assembly, perl, 
    55 documentation, and plenty of tasks to go around. Core developers will be 
    56 available most of the day (starting at around 10am GMT) to answer questions. 
    57  
    58 No experience with parrot necessary. 
    59  
    60 --From: @wiki.root@@wiki.bugday@-- 
    61  
    62 Check the list at: 
    63  
    64 https://trac.parrot.org/parrot/report/3 
    65  
    66 Which contains all the tickets I'd like to see resolved in @version@. To 
    67 see all the open tickets, use: 
    68  
    69 https://trac.parrot.org/parrot/report 
    70  
    71 If you've got something you're working on that you think you'll be 
    72 getting done before the release, please 
    73 - add a ticket for it (if necessary); 
    74 - set its milestone to this release. 
    75  
    76 Thanks in advance for your patches and commits. ^_^ 
    77  
    78 ... Speaking of patches, we should also get through as many of these 
    79 (accept or reject) as possible. 
    80  
    81 @web.root@@web.openpatches@ 
    82 " 
    83 } 
  • tools/util/release.json

     
    1 { 
    2     "release.version"  : "2.7.0", 
    3     "release.name"     : "Australian King", 
    4     "release.day"      : "Tuesday", 
    5     "release.date"     : "17 August 2010", 
    6     "release.nextdate" : "21 September 2010", 
    7  
    8     "web.root"         : "http://parrot.org/", 
    9     "web.source"       : "download", 
    10     "web.openpatches"  : "openpatches.html", 
    11     "web.repository"   : "https://svn.parrot.org/parrot/trunk/", 
    12  
    13     "bugday.day"       : "Saturday", 
    14     "bugday.date"      : "18 September 2010", 
    15  
    16     "wiki.root"        : "https://trac.parrot.org/parrot/wiki/", 
    17     "wiki.bugday"      : "bug_day_2010_09_18", 
    18  
    19     "ftp.path"         : "ftp://ftp.parrot.org/pub/parrot/releases/devel/2.7.0/", 
    20     "subversion.root"  : "http://subversion.apache.org/" 
    21 } 
  • tools/util/pgegrep

     
    1 #! parrot 
    2  
    3 =head1 NAME 
    4  
    5 pgegrep - A simple grep using PGE for matching 
    6  
    7 =head1 SYNOPSIS 
    8  
    9 B<pgegrep> [I<OPTIONS>] B<PATTERN> [I<FILE...>] 
    10  
    11 =head1 DESCRIPTION 
    12  
    13 pgegrep aims to be a small and easy to use program in replacement of the 
    14 standard grep utility.  Regex support is whatever PGE will allow.  It 
    15 searches through files line by line and tests if the given pattern matches. 
    16  
    17 =head1 OPTIONS 
    18  
    19 =over 4 
    20  
    21 =item -v 
    22  
    23 =item --invert-match 
    24  
    25 print lines not matching PATTERN 
    26  
    27 =item -V 
    28  
    29 =item --version 
    30  
    31 print the version and exit 
    32  
    33 =item --help 
    34  
    35 show this help and exit 
    36  
    37 =item -r 
    38  
    39 =item --recursive 
    40  
    41 recursively descend into directories 
    42  
    43 =item -L 
    44  
    45 =item --files-without-matches 
    46  
    47 print a list of files that do not match PATTERN 
    48  
    49 =item -l 
    50  
    51 =item --files-with-matches 
    52  
    53 print a list of files that do match PATTERN 
    54  
    55 =item -a 
    56  
    57 =item --text 
    58  
    59 treat binary files as text. 
    60  
    61 This uses a basic heuristic to discover if a file is binary or not.  Files are 
    62 read line by line, and it keeps processing "normally" until a control character 
    63 is found, and then stops and goes onto the next file is that line matches. 
    64  
    65 =item -n 
    66  
    67 =item --line-number 
    68  
    69 print the line number for each match 
    70  
    71 =item -H 
    72  
    73 =item --with-filename 
    74  
    75 print the filename for each match 
    76  
    77 =back 
    78  
    79 =cut 
    80  
    81 # Readability improved! 
    82 .include 'hllmacros.pir' 
    83  
    84 # for getstdin and friends 
    85 .loadlib 'io_ops' 
    86  
    87 .sub main :main 
    88         .param pmc argv # the script name, then our options. 
    89         .local string progname 
    90         progname = shift argv 
    91         load_bytecode 'Getopt/Obj.pbc' 
    92         load_bytecode 'PGE.pbc' 
    93         .local pmc getopts 
    94         getopts = new [ 'Getopt';'Obj' ] 
    95         getopts.'notOptStop'(1) 
    96         push getopts, 'with-filename|H' 
    97         push getopts, 'files-with-matches|l' 
    98         push getopts, 'files-without-matches|L' 
    99         push getopts, 'line-number|n' 
    100         push getopts, 'text|a' 
    101         push getopts, 'recursive|r' 
    102         push getopts, 'invert-match|v' 
    103         push getopts, 'version|V' 
    104         push getopts, 'help' 
    105         push_eh handler 
    106         .local pmc opts 
    107         opts = getopts.'get_options'(argv) 
    108         $I0 = defined opts['help'] 
    109         .If($I0, { 
    110                 showhelp() 
    111         }) 
    112         $I0 = defined opts['version'] 
    113         .If($I0, { 
    114                 showversion() 
    115         }) 
    116  
    117         .local int argc 
    118         argc = elements argv 
    119         .Unless(argc>1, { showhelp() }) # need rule and at least one file 
    120  
    121         .local string rule 
    122         .local pmc p6rule_compile, matchsub 
    123         rule = shift argv 
    124         p6rule_compile = compreg 'PGE::Perl6Regex' 
    125         matchsub = p6rule_compile(rule) 
    126         .If(null matchsub, { die 'Unable to compile regex' }) 
    127  
    128         .local int i, filecount 
    129         .local string filename 
    130         .local pmc File, OS, files, handle 
    131         files = new 'ResizableStringArray' 
    132         files = argv 
    133         filecount = files 
    134         # define with-filename if there's more than one file 
    135         .If(filecount >= 2, { opts['with-filename'] = 1 }) 
    136         $P0 = loadlib 'file' 
    137         File = new 'File' 
    138         $P0 = loadlib 'os' 
    139         OS = new 'OS' 
    140         # This must be here, or else it'll get filled with junk data we use stdin... 
    141         i = 0 
    142  
    143         .Unless(filecount, { 
    144                 # no args, use stdin 
    145         stdindashhack: 
    146                 handle = getstdin 
    147                 filename = '(standard input)' 
    148                 goto stdinhack 
    149         }) 
    150         .For(, i < filecount, inc i, { 
    151                 filename = files[i] 
    152                 .If(filename == '-', { 
    153                         goto stdindashhack 
    154                 }) 
    155                 $I1 = File.'is_file'(filename) 
    156                 .IfElse($I1, { 
    157                         # Is a file 
    158                         handle = open filename, 'r' 
    159                 },{ 
    160                         # Not a file, hopefully a directory 
    161                         $I1 = File.'is_dir'(filename) 
    162                         $I0 = defined opts['recursive'] 
    163                         $I1 &= $I0 
    164                         .Unless($I1, { 
    165                                 printerr "pgegrep: '" 
    166                                 printerr filename 
    167                                 printerr "': Operation not supported.\n" 
    168                                 goto nextfor_0 
    169                         }) 
    170                         $P0 = OS.'readdir'(filename) 
    171                         .Foreach($S0, $P0, { 
    172                                 .If($S0 != '.', { 
    173                                 .If($S0 != '..', { 
    174                                         $S1 = filename . '/' 
    175                                         $S0 = $S1 . $S0 
    176                                         $P1 = new 'ResizableStringArray' 
    177                                         $P1[0] = $S0 
    178                                         $I0 = i + 1 
    179                                         splice files, $P1, $I0, 0 
    180                                 }) }) 
    181                         }) 
    182                         filecount = files 
    183                         goto nextfor_0 
    184                 }) 
    185         stdinhack: 
    186                 checkfile(handle, filename, matchsub, opts) 
    187                 close handle 
    188         nextfor_0: 
    189         }) 
    190  
    191         end 
    192 handler: 
    193         .local pmc exception, pmcmsg 
    194         .local string message 
    195         .get_results (exception) 
    196         pmcmsg = getattribute exception, 'message' 
    197         pop_eh 
    198         message = pmcmsg 
    199         message  = "pgegrep: " . message 
    200         die message 
    201 .end 
    202  
    203 .sub checkfile 
    204         .param pmc handle 
    205         .param string filename 
    206         .param pmc matchsub 
    207         .param pmc opts 
    208  
    209         .local pmc match 
    210         .local string line 
    211         .local int lineno, linelen, matched 
    212         lineno = 1 
    213         matched = 0 # Only used for --files-without-matches 
    214         line = readline handle 
    215         linelen = length line 
    216  
    217         .local pmc p6rule_compile, cntrlchar 
    218         $S0 = '<+cntrl-[\t\r\n]>' 
    219         p6rule_compile = compreg 'PGE::Perl6Regex' 
    220         cntrlchar = p6rule_compile($S0) 
    221  
    222         .For(, linelen, { 
    223                 line = readline handle 
    224                 linelen = length line 
    225                 inc lineno 
    226         }, { 
    227                 match = matchsub(line) 
    228                 $I1 = istrue match 
    229                 match = cntrlchar(line) 
    230  
    231                 $I2 = istrue match 
    232                 $I0 = defined opts['files-without-matches'] 
    233                 .If($I0, { 
    234                         .If($I1, { matched = 1 }) 
    235                         goto next 
    236                 }) 
    237                 $I0 = defined opts['files-with-matches'] 
    238                 $I0 = $I0 && $I1 
    239                 .If($I0, { 
    240                         say filename 
    241                         .return() 
    242                 }) 
    243  
    244                 $I0 = defined opts['invert-match'] 
    245                 not $I0 
    246                 $I1 = xor $I1, $I0 
    247                 .Unless($I1, { 
    248                         $I0 = defined opts['text'] 
    249                         $I0 = xor $I0, $I2 
    250                         .If($I0, { 
    251                                 print 'Binary file ' 
    252                                 print filename 
    253                                 say   ' matches' 
    254                                 .return() 
    255                         }) 
    256                         $I0 = defined opts['with-filename'] 
    257                         $I1 = defined opts['recursive'] 
    258                         $I0 = $I0 || $I1 
    259                         .If($I0, { 
    260                                 print filename 
    261                                 print ':' 
    262                         }) 
    263                         $I0 = defined opts['line-number'] 
    264                         .If($I0, { 
    265                                 print lineno 
    266                                 print ':' 
    267                         }) 
    268                         print line 
    269                 }) 
    270                 #--------- 
    271         next: 
    272         }) 
    273         $I0 = defined opts['files-without-matches'] 
    274         .If($I0, { say filename }) 
    275         .return() 
    276 .end 
    277  
    278 .sub showhelp 
    279         print <<'HELP' 
    280 Usage: pgegrep [OPTIONS] PATTERN [FILE...] 
    281 Search for the Perl 6 Rule PATTERN in each file. 
    282  
    283   -v --invert-match          print lines not matching PATTERN 
    284   -V --version               print the version and exit 
    285      --help                  show this help and exit 
    286   -r --recursive             recursively descend into directories 
    287   -L --files-without-matches print a list of files that do not match PATTERN 
    288   -l --files-with-matches    print a list of files that do match PATTERN 
    289   -a --text                  treat binary files as text 
    290   -n --line-number           print the line number for each match 
    291   -H --with-filename         print the filename for each match 
    292  
    293 HELP 
    294         end 
    295 .end 
    296  
    297 .sub showversion 
    298         print <<'VERSION' 
    299 pgegrep v0.0.1 
    300 VERSION 
    301         end 
    302 .end 
    303  
    304 # Local Variables: 
    305 #   mode: pir 
    306 #   fill-column: 100 
    307 # End: 
    308 # vim: expandtab shiftwidth=4 ft=pir: 
  • tools/util/gen_release_info.pl

     
    1 #! perl 
    2 # Copyright (C) 2008, Parrot Foundation. 
    3 # $Id$ 
    4  
    5 use strict; 
    6 use warnings; 
    7  
    8 =head1 NAME 
    9  
    10 tools/util/gen_release_info.pl - generate release info for graphs and charts 
    11  
    12 =head1 DESCRIPTION 
    13  
    14 This utility generates release information from subversion in csv format, 
    15 suitable for graphs, charts, and reports. 
    16  
    17 =cut 
    18  
    19  
    20 my $repo_url = 'https://svn.parrot.org/parrot/tags'; 
    21  
    22 ##  create a release information data structure 
    23 my $r = { 
    24     map { $_->{number} => $_ } 
    25     map { m{^(RELEASE_)(.*)/} 
    26             ? { 
    27                 tag => "$1$2", 
    28                 number => sub{$a = shift; $a =~ y/_/./; $a }->($2), 
    29             } 
    30             : () 
    31         } 
    32     qx  { svn ls $repo_url } 
    33 }; 
    34  
    35 ##  gather interesting release-related information from the tag 
    36 map { 
    37     ##  ask subversion for info about the tag 
    38     my $readme = $repo_url . '/' . $r->{$_}{tag}; 
    39     warn "retrieving info on $readme\n"; 
    40     my $info = qx{ LANG=C svn info $readme }; 
    41  
    42     ##  pull the interesting items 
    43     $info =~ m{Author: (\S+)} and $r->{$_}{author}   = $1; 
    44     $info =~ m{Rev: (\S+)}    and $r->{$_}{revision} = $1; 
    45     $info =~ m{Date: (\S+)}   and $r->{$_}{date}     = $1; 
    46 } keys %{ $r }; 
    47  
    48  
    49 ##  output info in csv format 
    50 print 
    51     map { "$_\n" } 
    52     map { my $n = $_; join ',' => 
    53         map { $r->{$n}{$_} || '' } 
    54         qw{ tag number author revision date  } 
    55     } 
    56     sort keys %$r; 
    57  
    58 # Local Variables: 
    59 #   mode: cperl 
    60 #   cperl-indent-level: 4 
    61 #   fill-column: 100 
    62 # End: 
    63 # vim: expandtab shiftwidth=4: 
  • tools/util/inc_ver.pir

     
    1 #!/usr/bin/env parrot 
    2 # Copyright (C) 2010, Parrot Foundation. 
    3 # $Id$ 
    4  
    5 .sub 'main' :main 
    6     .local string version_file_name 
    7     version_file_name = 'VERSION' 
    8  
    9     # read the version 
    10     $P0 = new 'FileHandle' 
    11     $P0.'open'( version_file_name, 'r' ) 
    12     $S0 = $P0.'readline'() 
    13     $P0.'close'() 
    14  
    15     print 'version: ' 
    16     print $S0 
    17  
    18     # split the version 
    19     $P1 = split '.', $S0 
    20  
    21     # increment version 
    22     $I0 = $P1[1] 
    23     inc $I0 
    24     if $I0 != 12 goto NOT_NILL 
    25     $I0 = $P1[0] 
    26     inc $I0 
    27     $P1[0] = $I0 
    28     $I0 = 0 
    29 NOT_NILL: 
    30     $P1[1] = $I0 
    31  
    32     # join the incremented version 
    33     $S0 = join '.', $P1 
    34  
    35     print 'new version: ' 
    36     print $S0 
    37  
    38     # write the new version to the version_file 
    39     $P0.'open'( version_file_name, 'w' ) 
    40     $P0.'print'( $S0 ) 
    41     $P0.'close'() 
    42 .end 
    43  
    44 # Local Variables: 
    45 #   mode: pir 
    46 #   fill-column: 100 
    47 # End: 
    48 # vim: expandtab shiftwidth=4 ft=pir: 
  • tools/dev/perltidy.conf

     
     1# A declarative version of PDD07 for perl. 
     2 
     3# Must apply... 
     4 
     5-l=100 # Source line width is limited to 100 characters. 
     6-i=4   # must be indented four columns (no tabs) 
     7-ola   # Labels (including case labels) must be outdented two columns 
     8-ci=4  # Long lines, when split, must use at least one extra level of indentation on the continued line. 
     9-ce   # Cuddled elses are forbidden: i.e. avoid } else { . 
     10 
     11# Nice to haves... 
     12 
     13# Freeze new lines; some really short lines look good the way they 
     14# are, this should stop perltidy from merging them together 
     15-fnl 
  • tools/dev/update_copyright.pl

    Property changes on: tools/dev/perltidy.conf
    ___________________________________________________________________
    Added: svn:mergeinfo
       Merged /branches/opengl_dynamic_nci/tools/util/perltidy.conf:r43840-44139
       Merged /branches/tt1393_retcon/tools/util/perltidy.conf:r43652-43720
       Merged /branches/convert_OSNAME/tools/util/perltidy.conf:r42258-42340
       Merged /branches/gc_api/tools/util/perltidy.conf:r38521-38653
       Merged /branches/platform_determine_earlier/tools/util/perltidy.conf:r42413-42432
       Merged /branches/library_files/tools/util/perltidy.conf:r41458-41848
       Merged /branches/parrot_call_dep/tools/util/perltidy.conf:r44134-44188
       Merged /branches/gc-refactor/tools/util/perltidy.conf:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/util/perltidy.conf:r43520-43704
       Merged /branches/fix_icc_failures/tools/util/perltidy.conf:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/util/perltidy.conf:r44790-44875
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/perltidy.conf:r43163-43440
       Merged /branches/noalignptrs/tools/util/perltidy.conf:r43151-43489
       Merged /branches/headercleanup/tools/util/perltidy.conf:r37946-38257
       Merged /branches/pmc_func_cleanup/tools/util/perltidy.conf:r43978-44189
       Merged /branches/ns_func_cleanup/tools/util/perltidy.conf:r47026-47677
       Merged /branches/kill_stacks/tools/util/perltidy.conf:r40284-40287
       Merged /branches/dynop_mapping/tools/util/perltidy.conf:r47504-48410
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/perltidy.conf:r43337-43339
       Merged /branches/tt_1449/tools/util/perltidy.conf:r44021-44101
       Merged /branches/removing_stm/tools/util/perltidy.conf:r35464-35502
       Merged /branches/tt1452_configure_debug/tools/util/perltidy.conf:r47168-47317
       Merged /branches/assert_args/tools/util/perltidy.conf:r34776-34857
       Merged /branches/io_rewiring/tools/util/perltidy.conf:r39195-39460
       Merged /branches/pmc_sans_unionval/tools/util/perltidy.conf:r40531-40725
       Merged /branches/bsr_jsr_ret/tools/util/perltidy.conf:r40212-40267
       Merged /branches/one_make/tools/util/perltidy.conf:r43277-43591
       Merged /branches/runcore_purge/tools/util/perltidy.conf:r45837-45948
       Merged /branches/jit_h_files/tools/util/perltidy.conf:r34166-35215
       Merged /branches/ops_massacre/tools/util/perltidy.conf:r46812-47047
       Merged /branches/pbc_frozen_strings1/tools/util/perltidy.conf:r46081-46225
       Merged /branches/tt362/tools/util/perltidy.conf:r43955-44212
       Merged /branches/tt528_vtinit/tools/util/perltidy.conf:r38444-38470
       Merged /branches/cfunctionsdocs/tools/util/perltidy.conf:r47551-47916
       Merged /branches/ucs4_encoding/tools/util/perltidy.conf:r46803-46997
       Merged /branches/pmc_freeze_cleanup/tools/util/perltidy.conf:r43031-43433
       Merged /branches/hash_faster/tools/util/perltidy.conf:r47841-47862
       Merged /branches/configtests/tools/util/perltidy.conf:r42236-42574
       Merged /branches/remove-next_for_GC/tools/util/perltidy.conf:r41487-41507
       Merged /branches/auto_frames_refactor/tools/util/perltidy.conf:r41426-41455
       Merged /branches/tt_696/tools/util/perltidy.conf:r39055-39086
       Merged /branches/vtable_massacre/tools/util/perltidy.conf:r43827-43920
       Merged /branches/op_pmcs/tools/util/perltidy.conf:r43820-44044
       Merged /branches/no_pmc_install/tools/util/perltidy.conf:r45100-45105
       Merged /branches/RELEASE_1_3_0/tools/util/perltidy.conf:r39592-39598
       Merged /branches/auto_format_no_Config/tools/util/perltidy.conf:r42352-42410
       Merged /branches/stringnull/tools/util/perltidy.conf:r45492-45618
       Merged /branches/RELEASE_0_8_2/tools/util/perltidy.conf:r34004-34020
       Merged /branches/no_running_make_test/tools/util/perltidy.conf:r43474-43545
       Merged /branches/gc_internals/tools/util/perltidy.conf:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/perltidy.conf:r48343-48374
    Added: svn:eol-style
       + native
    Added: svn:keywords
       + Author Date Id Revision
    
     
     1#! perl 
     2# $Id$ 
     3 
     4# Copyright (C) 2008, Parrot Foundation. 
     5 
     6use strict; 
     7use warnings; 
     8use Fatal qw( open close ); 
     9 
     10=head1 NAME 
     11 
     12F<tools/dev/update_copyright.pl> 
     13 
     14=head1 DESCRIPTION 
     15 
     16Given a list of files as command line arguments, update the copyright 
     17notice to go from the earliest year noted to the current year. 
     18 
     19Edits the files in place. You should update the copyright on a modified 
     20file before you commit it back to the repository. 
     21 
     22=cut 
     23 
     24use lib 'lib'; 
     25use Parrot::Test; 
     26 
     27# Accept a little fuzz in the original copyright notice.. 
     28my $copyright_re = qr/ 
     29  Copyright \s+ \(C\) \s+ 
     30  (\d\d\d\d)\s*(?:-\s*\d\d\d\d)? \s* ,? \s* 
     31  The \s+ Perl \s+ Foundation\.? 
     32/xi; 
     33 
     34my $year = (localtime())[5]+1900; 
     35 
     36# loop over all the files specified on the command line 
     37foreach my $file (@ARGV) { 
     38    my $contents = Parrot::Test::slurp_file( $file ); 
     39    if ( $contents =~ $copyright_re) { 
     40        my $old_year = $1; 
     41        if ($old_year eq $year) { 
     42            warn "$file already up to date.\n"; 
     43            next; 
     44        } 
     45        else { 
     46            $contents =~ s/$copyright_re/Copyright (C) $old_year-$year, Parrot Foundation./; 
     47            open my $ofh, '>', $file; 
     48            print {$ofh} $contents; 
     49            close $ofh; 
     50        } 
     51    } 
     52    else { 
     53        warn "$file doesn't have a valid copyright line.\n"; 
     54    } 
     55} 
     56 
     57 
     58# Local Variables: 
     59#   mode: cperl 
     60#   cperl-indent-level: 4 
     61#   fill-column: 100 
     62# End: 
     63# vim: expandtab shiftwidth=4: 
  • tools/dev/pgegrep

    Property changes on: tools/dev/update_copyright.pl
    ___________________________________________________________________
    Added: svn:mergeinfo
       Merged /branches/opengl_dynamic_nci/tools/util/update_copyright.pl:r43840-44139
       Merged /branches/tt1393_retcon/tools/util/update_copyright.pl:r43652-43720
       Merged /branches/convert_OSNAME/tools/util/update_copyright.pl:r42258-42340
       Merged /branches/gc_api/tools/util/update_copyright.pl:r38521-38653
       Merged /branches/platform_determine_earlier/tools/util/update_copyright.pl:r42413-42432
       Merged /branches/library_files/tools/util/update_copyright.pl:r41458-41848
       Merged /branches/parrot_call_dep/tools/util/update_copyright.pl:r44134-44188
       Merged /branches/gc-refactor/tools/util/update_copyright.pl:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/util/update_copyright.pl:r43520-43704
       Merged /branches/fix_icc_failures/tools/util/update_copyright.pl:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/util/update_copyright.pl:r44790-44875
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/update_copyright.pl:r43163-43440
       Merged /branches/noalignptrs/tools/util/update_copyright.pl:r43151-43489
       Merged /branches/headercleanup/tools/util/update_copyright.pl:r37946-38257
       Merged /branches/pmc_func_cleanup/tools/util/update_copyright.pl:r43978-44189
       Merged /branches/ns_func_cleanup/tools/util/update_copyright.pl:r47026-47677
       Merged /branches/kill_stacks/tools/util/update_copyright.pl:r40284-40287
       Merged /branches/dynop_mapping/tools/util/update_copyright.pl:r47504-48410
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/update_copyright.pl:r43337-43339
       Merged /branches/tt_1449/tools/util/update_copyright.pl:r44021-44101
       Merged /branches/removing_stm/tools/util/update_copyright.pl:r35464-35502
       Merged /branches/tt1452_configure_debug/tools/util/update_copyright.pl:r47168-47317
       Merged /branches/assert_args/tools/util/update_copyright.pl:r34776-34857
       Merged /branches/io_rewiring/tools/util/update_copyright.pl:r39195-39460
       Merged /branches/pmc_sans_unionval/tools/util/update_copyright.pl:r40531-40725
       Merged /branches/bsr_jsr_ret/tools/util/update_copyright.pl:r40212-40267
       Merged /branches/one_make/tools/util/update_copyright.pl:r43277-43591
       Merged /branches/runcore_purge/tools/util/update_copyright.pl:r45837-45948
       Merged /branches/jit_h_files/tools/util/update_copyright.pl:r34166-35215
       Merged /branches/ops_massacre/tools/util/update_copyright.pl:r46812-47047
       Merged /branches/pbc_frozen_strings1/tools/util/update_copyright.pl:r46081-46225
       Merged /branches/tt362/tools/util/update_copyright.pl:r43955-44212
       Merged /branches/tt528_vtinit/tools/util/update_copyright.pl:r38444-38470
       Merged /branches/cfunctionsdocs/tools/util/update_copyright.pl:r47551-47916
       Merged /branches/ucs4_encoding/tools/util/update_copyright.pl:r46803-46997
       Merged /branches/pmc_freeze_cleanup/tools/util/update_copyright.pl:r43031-43433
       Merged /branches/hash_faster/tools/util/update_copyright.pl:r47841-47862
       Merged /branches/configtests/tools/util/update_copyright.pl:r42236-42574
       Merged /branches/remove-next_for_GC/tools/util/update_copyright.pl:r41487-41507
       Merged /branches/auto_frames_refactor/tools/util/update_copyright.pl:r41426-41455
       Merged /branches/tt_696/tools/util/update_copyright.pl:r39055-39086
       Merged /branches/vtable_massacre/tools/util/update_copyright.pl:r43827-43920
       Merged /branches/op_pmcs/tools/util/update_copyright.pl:r43820-44044
       Merged /branches/no_pmc_install/tools/util/update_copyright.pl:r45100-45105
       Merged /branches/RELEASE_1_3_0/tools/util/update_copyright.pl:r39592-39598
       Merged /branches/auto_format_no_Config/tools/util/update_copyright.pl:r42352-42410
       Merged /branches/stringnull/tools/util/update_copyright.pl:r45492-45618
       Merged /branches/RELEASE_0_8_2/tools/util/update_copyright.pl:r34004-34020
       Merged /branches/no_running_make_test/tools/util/update_copyright.pl:r43474-43545
       Merged /branches/gc_internals/tools/util/update_copyright.pl:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/update_copyright.pl:r48343-48374
    Added: svn:eol-style
       + native
    Added: svn:keywords
       + Author Date Id Revision
    
     
     1#! parrot 
     2 
     3=head1 NAME 
     4 
     5pgegrep - A simple grep using PGE for matching 
     6 
     7=head1 SYNOPSIS 
     8 
     9B<pgegrep> [I<OPTIONS>] B<PATTERN> [I<FILE...>] 
     10 
     11=head1 DESCRIPTION 
     12 
     13pgegrep aims to be a small and easy to use program in replacement of the 
     14standard grep utility.  Regex support is whatever PGE will allow.  It 
     15searches through files line by line and tests if the given pattern matches. 
     16 
     17=head1 OPTIONS 
     18 
     19=over 4 
     20 
     21=item -v 
     22 
     23=item --invert-match 
     24 
     25print lines not matching PATTERN 
     26 
     27=item -V 
     28 
     29=item --version 
     30 
     31print the version and exit 
     32 
     33=item --help 
     34 
     35show this help and exit 
     36 
     37=item -r 
     38 
     39=item --recursive 
     40 
     41recursively descend into directories 
     42 
     43=item -L 
     44 
     45=item --files-without-matches 
     46 
     47print a list of files that do not match PATTERN 
     48 
     49=item -l 
     50 
     51=item --files-with-matches 
     52 
     53print a list of files that do match PATTERN 
     54 
     55=item -a 
     56 
     57=item --text 
     58 
     59treat binary files as text. 
     60 
     61This uses a basic heuristic to discover if a file is binary or not.  Files are 
     62read line by line, and it keeps processing "normally" until a control character 
     63is found, and then stops and goes onto the next file is that line matches. 
     64 
     65=item -n 
     66 
     67=item --line-number 
     68 
     69print the line number for each match 
     70 
     71=item -H 
     72 
     73=item --with-filename 
     74 
     75print the filename for each match 
     76 
     77=back 
     78 
     79=cut 
     80 
     81# Readability improved! 
     82.include 'hllmacros.pir' 
     83 
     84# for getstdin and friends 
     85.loadlib 'io_ops' 
     86 
     87.sub main :main 
     88        .param pmc argv # the script name, then our options. 
     89        .local string progname 
     90        progname = shift argv 
     91        load_bytecode 'Getopt/Obj.pbc' 
     92        load_bytecode 'PGE.pbc' 
     93        .local pmc getopts 
     94        getopts = new [ 'Getopt';'Obj' ] 
     95        getopts.'notOptStop'(1) 
     96        push getopts, 'with-filename|H' 
     97        push getopts, 'files-with-matches|l' 
     98        push getopts, 'files-without-matches|L' 
     99        push getopts, 'line-number|n' 
     100        push getopts, 'text|a' 
     101        push getopts, 'recursive|r' 
     102        push getopts, 'invert-match|v' 
     103        push getopts, 'version|V' 
     104        push getopts, 'help' 
     105        push_eh handler 
     106        .local pmc opts 
     107        opts = getopts.'get_options'(argv) 
     108        $I0 = defined opts['help'] 
     109        .If($I0, { 
     110                showhelp() 
     111        }) 
     112        $I0 = defined opts['version'] 
     113        .If($I0, { 
     114                showversion() 
     115        }) 
     116 
     117        .local int argc 
     118        argc = elements argv 
     119        .Unless(argc>1, { showhelp() }) # need rule and at least one file 
     120 
     121        .local string rule 
     122        .local pmc p6rule_compile, matchsub 
     123        rule = shift argv 
     124        p6rule_compile = compreg 'PGE::Perl6Regex' 
     125        matchsub = p6rule_compile(rule) 
     126        .If(null matchsub, { die 'Unable to compile regex' }) 
     127 
     128        .local int i, filecount 
     129        .local string filename 
     130        .local pmc File, OS, files, handle 
     131        files = new 'ResizableStringArray' 
     132        files = argv 
     133        filecount = files 
     134        # define with-filename if there's more than one file 
     135        .If(filecount >= 2, { opts['with-filename'] = 1 }) 
     136        $P0 = loadlib 'file' 
     137        File = new 'File' 
     138        $P0 = loadlib 'os' 
     139        OS = new 'OS' 
     140        # This must be here, or else it'll get filled with junk data we use stdin... 
     141        i = 0 
     142 
     143        .Unless(filecount, { 
     144                # no args, use stdin 
     145        stdindashhack: 
     146                handle = getstdin 
     147                filename = '(standard input)' 
     148                goto stdinhack 
     149        }) 
     150        .For(, i < filecount, inc i, { 
     151                filename = files[i] 
     152                .If(filename == '-', { 
     153                        goto stdindashhack 
     154                }) 
     155                $I1 = File.'is_file'(filename) 
     156                .IfElse($I1, { 
     157                        # Is a file 
     158                        handle = open filename, 'r' 
     159                },{ 
     160                        # Not a file, hopefully a directory 
     161                        $I1 = File.'is_dir'(filename) 
     162                        $I0 = defined opts['recursive'] 
     163                        $I1 &= $I0 
     164                        .Unless($I1, { 
     165                                printerr "pgegrep: '" 
     166                                printerr filename 
     167                                printerr "': Operation not supported.\n" 
     168                                goto nextfor_0 
     169                        }) 
     170                        $P0 = OS.'readdir'(filename) 
     171                        .Foreach($S0, $P0, { 
     172                                .If($S0 != '.', { 
     173                                .If($S0 != '..', { 
     174                                        $S1 = filename . '/' 
     175                                        $S0 = $S1 . $S0 
     176                                        $P1 = new 'ResizableStringArray' 
     177                                        $P1[0] = $S0 
     178                                        $I0 = i + 1 
     179                                        splice files, $P1, $I0, 0 
     180                                }) }) 
     181                        }) 
     182                        filecount = files 
     183                        goto nextfor_0 
     184                }) 
     185        stdinhack: 
     186                checkfile(handle, filename, matchsub, opts) 
     187                close handle 
     188        nextfor_0: 
     189        }) 
     190 
     191        end 
     192handler: 
     193        .local pmc exception, pmcmsg 
     194        .local string message 
     195        .get_results (exception) 
     196        pmcmsg = getattribute exception, 'message' 
     197        pop_eh 
     198        message = pmcmsg 
     199        message  = "pgegrep: " . message 
     200        die message 
     201.end 
     202 
     203.sub checkfile 
     204        .param pmc handle 
     205        .param string filename 
     206        .param pmc matchsub 
     207        .param pmc opts 
     208 
     209        .local pmc match 
     210        .local string line 
     211        .local int lineno, linelen, matched 
     212        lineno = 1 
     213        matched = 0 # Only used for --files-without-matches 
     214        line = readline handle 
     215        linelen = length line 
     216 
     217        .local pmc p6rule_compile, cntrlchar 
     218        $S0 = '<+cntrl-[\t\r\n]>' 
     219        p6rule_compile = compreg 'PGE::Perl6Regex' 
     220        cntrlchar = p6rule_compile($S0) 
     221 
     222        .For(, linelen, { 
     223                line = readline handle 
     224                linelen = length line 
     225                inc lineno 
     226        }, { 
     227                match = matchsub(line) 
     228                $I1 = istrue match 
     229                match = cntrlchar(line) 
     230 
     231                $I2 = istrue match 
     232                $I0 = defined opts['files-without-matches'] 
     233                .If($I0, { 
     234                        .If($I1, { matched = 1 }) 
     235                        goto next 
     236                }) 
     237                $I0 = defined opts['files-with-matches'] 
     238                $I0 = $I0 && $I1 
     239                .If($I0, { 
     240                        say filename 
     241                        .return() 
     242                }) 
     243 
     244                $I0 = defined opts['invert-match'] 
     245                not $I0 
     246                $I1 = xor $I1, $I0 
     247                .Unless($I1, { 
     248                        $I0 = defined opts['text'] 
     249                        $I0 = xor $I0, $I2 
     250                        .If($I0, { 
     251                                print 'Binary file ' 
     252                                print filename 
     253                                say   ' matches' 
     254                                .return() 
     255                        }) 
     256                        $I0 = defined opts['with-filename'] 
     257                        $I1 = defined opts['recursive'] 
     258                        $I0 = $I0 || $I1 
     259                        .If($I0, { 
     260                                print filename 
     261                                print ':' 
     262                        }) 
     263                        $I0 = defined opts['line-number'] 
     264                        .If($I0, { 
     265                                print lineno 
     266                                print ':' 
     267                        }) 
     268                        print line 
     269                }) 
     270                #--------- 
     271        next: 
     272        }) 
     273        $I0 = defined opts['files-without-matches'] 
     274        .If($I0, { say filename }) 
     275        .return() 
     276.end 
     277 
     278.sub showhelp 
     279        print <<'HELP' 
     280Usage: pgegrep [OPTIONS] PATTERN [FILE...] 
     281Search for the Perl 6 Rule PATTERN in each file. 
     282 
     283  -v --invert-match          print lines not matching PATTERN 
     284  -V --version               print the version and exit 
     285     --help                  show this help and exit 
     286  -r --recursive             recursively descend into directories 
     287  -L --files-without-matches print a list of files that do not match PATTERN 
     288  -l --files-with-matches    print a list of files that do match PATTERN 
     289  -a --text                  treat binary files as text 
     290  -n --line-number           print the line number for each match 
     291  -H --with-filename         print the filename for each match 
     292 
     293HELP 
     294        end 
     295.end 
     296 
     297.sub showversion 
     298        print <<'VERSION' 
     299pgegrep v0.0.1 
     300VERSION 
     301        end 
     302.end 
     303 
     304# Local Variables: 
     305#   mode: pir 
     306#   fill-column: 100 
     307# End: 
     308# vim: expandtab shiftwidth=4 ft=pir: 
  • tools/dev/headerizer.pl

    Property changes on: tools/dev/pgegrep
    ___________________________________________________________________
    Added: svn:mergeinfo
       Merged /branches/RELEASE_0_8_2/tools/util/pgegrep:r34004-34020
       Merged /branches/no_running_make_test/tools/util/pgegrep:r43474-43545
       Merged /branches/gc_internals/tools/util/pgegrep:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/pgegrep:r48343-48374
       Merged /branches/opengl_dynamic_nci/tools/util/pgegrep:r43840-44139
       Merged /branches/tt1393_retcon/tools/util/pgegrep:r43652-43720
       Merged /branches/convert_OSNAME/tools/util/pgegrep:r42258-42340
       Merged /branches/gc_api/tools/util/pgegrep:r38521-38653
       Merged /branches/platform_determine_earlier/tools/util/pgegrep:r42413-42432
       Merged /branches/library_files/tools/util/pgegrep:r41458-41848
       Merged /branches/parrot_call_dep/tools/util/pgegrep:r44134-44188
       Merged /branches/gc-refactor/tools/util/pgegrep:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/util/pgegrep:r43520-43704
       Merged /branches/fix_icc_failures/tools/util/pgegrep:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/util/pgegrep:r44790-44875
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/pgegrep:r43163-43440
       Merged /branches/headercleanup/tools/util/pgegrep:r37946-38257
       Merged /branches/noalignptrs/tools/util/pgegrep:r43151-43489
       Merged /branches/pmc_func_cleanup/tools/util/pgegrep:r43978-44189
       Merged /branches/ns_func_cleanup/tools/util/pgegrep:r47026-47677
       Merged /branches/kill_stacks/tools/util/pgegrep:r40284-40287
       Merged /branches/dynop_mapping/tools/util/pgegrep:r47504-48410
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/pgegrep:r43337-43339
       Merged /branches/tt_1449/tools/util/pgegrep:r44021-44101
       Merged /branches/removing_stm/tools/util/pgegrep:r35464-35502
       Merged /branches/tt1452_configure_debug/tools/util/pgegrep:r47168-47317
       Merged /branches/assert_args/tools/util/pgegrep:r34776-34857
       Merged /branches/io_rewiring/tools/util/pgegrep:r39195-39460
       Merged /branches/pmc_sans_unionval/tools/util/pgegrep:r40531-40725
       Merged /branches/bsr_jsr_ret/tools/util/pgegrep:r40212-40267
       Merged /branches/one_make/tools/util/pgegrep:r43277-43591
       Merged /branches/ops_massacre/tools/util/pgegrep:r46812-47047
       Merged /branches/jit_h_files/tools/util/pgegrep:r34166-35215
       Merged /branches/runcore_purge/tools/util/pgegrep:r45837-45948
       Merged /branches/pbc_frozen_strings1/tools/util/pgegrep:r46081-46225
       Merged /branches/tt362/tools/util/pgegrep:r43955-44212
       Merged /branches/tt528_vtinit/tools/util/pgegrep:r38444-38470
       Merged /branches/cfunctionsdocs/tools/util/pgegrep:r47551-47916
       Merged /branches/ucs4_encoding/tools/util/pgegrep:r46803-46997
       Merged /branches/pmc_freeze_cleanup/tools/util/pgegrep:r43031-43433
       Merged /branches/hash_faster/tools/util/pgegrep:r47841-47862
       Merged /branches/configtests/tools/util/pgegrep:r42236-42574
       Merged /branches/remove-next_for_GC/tools/util/pgegrep:r41487-41507
       Merged /branches/auto_frames_refactor/tools/util/pgegrep:r41426-41455
       Merged /branches/tt_696/tools/util/pgegrep:r39055-39086
       Merged /branches/vtable_massacre/tools/util/pgegrep:r43827-43920
       Merged /branches/op_pmcs/tools/util/pgegrep:r43820-44044
       Merged /branches/no_pmc_install/tools/util/pgegrep:r45100-45105
       Merged /branches/RELEASE_1_3_0/tools/util/pgegrep:r39592-39598
       Merged /branches/auto_format_no_Config/tools/util/pgegrep:r42352-42410
       Merged /branches/stringnull/tools/util/pgegrep:r45492-45618
    Added: svn:eol-style
       + native
    Added: svn:executable
       + *
    Added: svn:keywords
       + Author Date Id Revision
    
     
     1#! perl 
     2# Copyright (C) 2001-2010, Parrot Foundation. 
     3# $Id$ 
     4 
     5=head1 NAME 
     6 
     7tools/dev/headerizer.pl - Generates the function header parts of .h 
     8files from .c files 
     9 
     10=head1 SYNOPSIS 
     11 
     12  $ perl tools/dev/headerizer.pl [object files] 
     13 
     14Generates C function declarations based on the function definitions in 
     15the C source code. 
     16 
     17=head1 DESCRIPTION 
     18 
     19The headerizer works off of directives in the source and header files. 
     20 
     21One source file's public declarations can only go into one header file. 
     22However, one header file can have declarations from multiple source files. 
     23In other words, headers-to-source is one-to-many. 
     24 
     25=over 4 
     26 
     27=item C<HEADERIZER BEGIN:> F<source-filename> / C<HEADERIZER END:> F<source-filename> 
     28 
     29Marks the beginning and end of a block of declarations in a header file. 
     30 
     31    # In file foo.h 
     32    /* HEADERIZER BEGIN: src/foo.c */ 
     33    /* HEADERIZER END: src/foo.c */ 
     34 
     35    /* HEADERIZER BEGIN: src/bar.c */ 
     36    /* HEADERIZER END: src/bar.c */ 
     37 
     38=item C<HEADERIZER HFILE:> F<header-filename> 
     39 
     40Tells the headerizer where the declarations for the functions should go 
     41 
     42    # In file foo.c 
     43    /* HEADERIZER HFILE: foo.h */ 
     44 
     45    # In file bar.c 
     46    /* HEADERIZER HFILE: foo.h */ 
     47 
     48=back 
     49 
     50=head1 COMMAND-LINE OPTIONS 
     51 
     52=over 4 
     53 
     54=item C<--macro=X> 
     55 
     56Print a list of all functions that have macro X.  For example, --macro=PARROT_EXPORT. 
     57 
     58=back 
     59 
     60=cut 
     61 
     62use strict; 
     63use warnings; 
     64 
     65use Getopt::Long; 
     66use lib qw( lib ); 
     67use Parrot::Config; 
     68use Parrot::Headerizer; 
     69 
     70my $headerizer = Parrot::Headerizer->new; 
     71 
     72main(); 
     73 
     74=head1 FUNCTIONS 
     75 
     76=head2 extract_function_declaration_and_update_source( $cfile_name ) 
     77 
     78Extract all the function declarations from the C file specified by 
     79I<$cfile_name>, and update the comment blocks within. 
     80 
     81=cut 
     82 
     83sub extract_function_declarations_and_update_source { 
     84    my $cfile_name = shift; 
     85 
     86    open( my $fhin, '<', $cfile_name ) or die "Can't open $cfile_name: $!"; 
     87    my $text = join( '', <$fhin> ); 
     88    close $fhin; 
     89 
     90    my @func_declarations = $headerizer->extract_function_declarations( $text ); 
     91    for my $decl ( @func_declarations ) { 
     92        my $specs = $headerizer->function_components_from_declaration( $cfile_name, $decl ); 
     93        my $name = $specs->{name}; 
     94 
     95        my $heading = $headerizer->generate_documentation_signature($decl); 
     96 
     97        $text =~ s/=item C<[^>]*\b$name\b[^>]*>\n+/$heading\n\n/sm or do { 
     98            warn "$cfile_name: $name has no POD\n" unless $name =~ /^yy/; # lexer funcs don't have to have POD 
     99        } 
     100    } 
     101    open( my $fhout, '>', $cfile_name ) or die "Can't create $cfile_name: $!"; 
     102    print {$fhout} $text; 
     103    close $fhout; 
     104 
     105    return @func_declarations; 
     106} 
     107 
     108 
     109sub attrs_from_args { 
     110    my $func = shift; 
     111    my @args = @_; 
     112 
     113    my @attrs = (); 
     114    my @mods  = (); 
     115 
     116    my $name = $func->{name}; 
     117    my $file = $func->{file}; 
     118    my $n = 0; 
     119    for my $arg (@args) { 
     120        ++$n; 
     121        if ( $arg =~ m{ARG(?:MOD|OUT)(?:_NULLOK)?\((.+?)\)} ) { 
     122            my $modified = $1; 
     123            if ( $modified =~ s/.*\*/*/ ) { 
     124                # We're OK 
     125            } 
     126            else { 
     127                $modified =~ s/.* (\w+)$/$1/ or die qq{Unable to figure out the modified parm out of "$modified"}; 
     128            } 
     129            push( @mods, "FUNC_MODIFIES($modified)" ); 
     130        } 
     131        if ( $arg =~ m{(ARGIN|ARGOUT|ARGMOD|ARGFREE_NOTNULL|NOTNULL)\(} || $arg eq 'PARROT_INTERP' ) { 
     132            push( @attrs, "__attribute__nonnull__($n)" ); 
     133        } 
     134        if ( ( $arg =~ m{\*} ) && ( $arg !~ /\b(SHIM|((ARGIN|ARGOUT|ARGMOD)(_NULLOK)?)|ARGFREE(_NOTNULL)?)\b/ ) ) { 
     135            if ( $name !~ /^yy/ ) { # Don't complain about the lexer auto-generated funcs 
     136                $headerizer->squawk( $file, $name, qq{"$arg" isn't protected with an ARGIN, ARGOUT or ARGMOD (or a _NULLOK variant), or ARGFREE} ); 
     137            } 
     138        } 
     139        if ( ($arg =~ /\bconst\b/) && ($arg =~ /\*/) && ($arg !~ /\*\*/) && ($arg =~ /\b(ARG(MOD|OUT))\b/) ) { 
     140            $headerizer->squawk( $file, $name, qq{"$arg" is const, but that $1 conflicts with const} ); 
     141        } 
     142    } 
     143 
     144    return (@attrs,@mods); 
     145} 
     146 
     147sub asserts_from_args { 
     148    my @args = @_; 
     149    my @asserts; 
     150 
     151    for my $arg (@args) { 
     152        if ( $arg =~ m{(ARGIN|ARGOUT|ARGMOD|ARGFREE_NOTNULL|NOTNULL)\((.+)\)} ) { 
     153            my $var = $2; 
     154            if($var =~ /\(*\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\)\s*\(/) { 
     155                # argument is a function pointer 
     156                $var = $1; 
     157            } 
     158            else { 
     159                # try to isolate the variable's name; 
     160                # strip off everything before the final space or asterisk. 
     161                $var =~ s{.+[* ]([^* ]+)$}{$1}; 
     162                # strip off a trailing "[]", if any. 
     163                $var =~ s{\[\]$}{}; 
     164            } 
     165            push( @asserts, "PARROT_ASSERT_ARG($var)" ); 
     166        } 
     167        if( $arg eq 'PARROT_INTERP' ) { 
     168            push( @asserts, "PARROT_ASSERT_ARG(interp)" ); 
     169        } 
     170    } 
     171 
     172    return (@asserts); 
     173} 
     174 
     175sub make_function_decls { 
     176    my @funcs = @_; 
     177 
     178    my @decls; 
     179    foreach my $func (@funcs) { 
     180        my $multiline = 0; 
     181 
     182        my $return = $func->{return_type}; 
     183        my $alt_void = ' '; 
     184 
     185        # Splint can't handle /*@alt void@*/ on pointers, although this page 
     186        # http://www.mail-archive.com/lclint-interest@virginia.edu/msg00139.html 
     187        # seems to say that we can. 
     188        if ( $func->{is_ignorable} && ($return !~ /\*/) ) { 
     189            $alt_void = " /*\@alt void@*/\n"; 
     190        } 
     191 
     192        my $decl = sprintf( "%s%s%s(", $return, $alt_void, $func->{name} ); 
     193        $decl = "static $decl" if $func->{is_static}; 
     194 
     195        my @args    = @{ $func->{args} }; 
     196        my @attrs   = attrs_from_args( $func, @args ); 
     197 
     198        for my $arg (@args) { 
     199            if ( $arg =~ m{SHIM\((.+)\)} ) { 
     200                $arg = $1; 
     201                if ( $func->{is_static} || ( $arg =~ /\*/ ) ) { 
     202                    $arg = "SHIM($arg)"; 
     203                } 
     204                else { 
     205                    $arg = "NULLOK($arg)"; 
     206                } 
     207            } 
     208        } 
     209 
     210        my $argline = join( ", ", @args ); 
     211        if ( length( $decl . $argline ) <= 75 ) { 
     212            $decl = "$decl$argline)"; 
     213        } 
     214        else { 
     215            if ( $args[0] =~ /^((SHIM|PARROT)_INTERP|Interp)\b/ ) { 
     216                $decl .= ( shift @args ); 
     217                $decl .= "," if @args; 
     218            } 
     219            $argline   = join( ",", map { "\n\t$_" } @args ); 
     220            $decl      = "$decl$argline)"; 
     221            $multiline = 1; 
     222        } 
     223 
     224        my $attrs = join( "", map { "\n\t\t$_" } @attrs ); 
     225        if ($attrs) { 
     226            $decl .= $attrs; 
     227            $multiline = 1; 
     228        } 
     229        my @macros = @{ $func->{macros} }; 
     230        $multiline = 1 if @macros; 
     231 
     232        $decl .= $multiline ? ";\n" : ";"; 
     233        $decl = join( "\n", @macros, $decl ); 
     234        $decl =~ s/\t/    /g; 
     235        push( @decls, $decl ); 
     236    } 
     237 
     238    foreach my $func (@funcs) { 
     239        my @args    = @{ $func->{args} }; 
     240        my @asserts = asserts_from_args( @args ); 
     241 
     242        my $assert = "#define ASSERT_ARGS_" . $func->{name}; 
     243        if(length($func->{name}) > 29) { 
     244            $assert .= " \\\n    "; 
     245        } 
     246        $assert .= " __attribute__unused__ int _ASSERT_ARGS_CHECK = ("; 
     247        if(@asserts) { 
     248            $assert .= "\\\n       "; 
     249            $assert .= join(" \\\n    , ", @asserts); 
     250        } 
     251        else { 
     252            $assert .= "0"; 
     253        } 
     254        $assert .= ")"; 
     255        push(@decls, $assert); 
     256    } 
     257 
     258    return @decls; 
     259} 
     260 
     261sub read_file { 
     262    my $filename = shift; 
     263 
     264    open my $fh, '<', $filename or die "couldn't read '$filename': $!"; 
     265    my $text = do { local $/ = undef; <$fh> }; 
     266    close $fh; 
     267 
     268    return $text; 
     269} 
     270 
     271sub write_file { 
     272    my $filename = shift; 
     273    my $text     = shift; 
     274 
     275    open my $fh, '>', $filename or die "couldn't write '$filename': $!"; 
     276    print {$fh} $text; 
     277    close $fh; 
     278} 
     279 
     280sub replace_headerized_declarations { 
     281    my $source_code = shift; 
     282    my $sourcefile = shift; 
     283    my $hfile       = shift; 
     284    my @funcs       = @_; 
     285 
     286    # Allow a way to not headerize statics 
     287    if ( $source_code =~ m{/\*\s*HEADERIZER NONE:\s*$sourcefile\s*\*/} ) { 
     288        return $source_code; 
     289    } 
     290 
     291    @funcs = sort api_first_then_alpha @funcs; 
     292 
     293    my @function_decls = make_function_decls(@funcs); 
     294 
     295    my $function_decls = join( "\n", @function_decls ); 
     296    my $STARTMARKER    = qr{/\* HEADERIZER BEGIN: $sourcefile \*/\n}; 
     297    my $ENDMARKER      = qr{/\* HEADERIZER END: $sourcefile \*/\n?}; 
     298    my $DO_NOT_TOUCH   = q{/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */}; 
     299 
     300    $source_code =~ 
     301        s{($STARTMARKER)(?:.*?)($ENDMARKER)} 
     302         {$1$DO_NOT_TOUCH\n\n$function_decls\n$DO_NOT_TOUCH\n$2}s 
     303        or die "Need begin/end HEADERIZER markers for $sourcefile in $hfile\n"; 
     304 
     305    return $source_code; 
     306} 
     307 
     308sub api_first_then_alpha { 
     309    return ( ( $b->{is_api} || 0 ) <=> ( $a->{is_api} || 0 ) ) 
     310        || ( lc $a->{name} cmp lc $b->{name} ); 
     311} 
     312 
     313sub main { 
     314    my $macro_match; 
     315    GetOptions( 
     316        'macro=s' => \$macro_match, 
     317    ) or exit(1); 
     318 
     319    die 'No files specified.' unless @ARGV; 
     320    my %ofiles; 
     321    ++$ofiles{$_} for @ARGV; 
     322    my @ofiles = sort keys %ofiles; 
     323    for (@ofiles) { 
     324        print "$_ is specified more than once.\n" if $ofiles{$_} > 1; 
     325    } 
     326    my %sourcefiles; 
     327    my %sourcefiles_with_statics; 
     328    my %api; 
     329 
     330    # Walk the object files and find corresponding source (either .c or .pmc) 
     331    for my $ofile (@ofiles) { 
     332        next if $ofile =~ m/^\Qsrc$PConfig{slash}ops\E/; 
     333 
     334        $ofile =~ s/\\/\//g; 
     335 
     336        my $is_yacc = ($ofile =~ /\.y$/); 
     337        if ( !$is_yacc ) { 
     338            my $sfile = $ofile; 
     339            $sfile    =~ s/\Q$PConfig{o}\E$/.s/; 
     340            next if -f $sfile; 
     341        } 
     342 
     343        my $cfile = $ofile; 
     344        $cfile =~ s/\Q$PConfig{o}\E$/.c/ or $is_yacc 
     345            or die "$cfile doesn't look like an object file"; 
     346 
     347        my $pmcfile = $ofile; 
     348        $pmcfile =~ s/\Q$PConfig{o}\E$/.pmc/; 
     349 
     350        my $from_pmc = -f $pmcfile && !$is_yacc; 
     351 
     352        my $sourcefile = $from_pmc ? $pmcfile : $cfile; 
     353 
     354        my $source_code = read_file( $sourcefile ); 
     355        die qq{can't find HEADERIZER HFILE directive in "$sourcefile"} 
     356            unless $source_code =~ 
     357                m{ /\* \s+ HEADERIZER\ HFILE: \s+ ([^*]+?) \s+ \*/ }sx; 
     358 
     359        my $hfile = $1; 
     360        if ( ( $hfile ne 'none' ) && ( not -f $hfile ) ) { 
     361            die qq{"$hfile" not found (referenced from "$sourcefile")}; 
     362        } 
     363 
     364        my @decls; 
     365        if ( $macro_match ) { 
     366            @decls = $headerizer->extract_function_declarations( $source_code ); 
     367        } 
     368        else { 
     369            @decls = extract_function_declarations_and_update_source( $sourcefile ); 
     370        } 
     371 
     372        for my $decl (@decls) { 
     373            my $components = $headerizer->function_components_from_declaration( $sourcefile, $decl ); 
     374            push( @{ $sourcefiles{$hfile}->{$sourcefile} }, $components ) unless $hfile eq 'none'; 
     375            push( @{ $sourcefiles_with_statics{$sourcefile} }, $components ) if $components->{is_static}; 
     376            if ( $macro_match ) { 
     377                if ( grep { $_ eq $macro_match } @{$components->{macros}} ) { 
     378                    push( @{ $api{$sourcefile} }, $components ); 
     379                } 
     380            } 
     381        } 
     382    }    # for @cfiles 
     383 
     384    if ( $macro_match ) { 
     385        my $nfuncs = 0; 
     386        for my $cfile ( sort keys %api ) { 
     387            my @funcs = sort { $a->{name} cmp $b->{name} } @{$api{$cfile}}; 
     388            print "$cfile\n"; 
     389            for my $func ( @funcs ) { 
     390                print "    $func->{name}\n"; 
     391                ++$nfuncs; 
     392            } 
     393        } 
     394        my $s = $nfuncs == 1 ? '' : 's'; 
     395        print "$nfuncs $macro_match function$s\n"; 
     396    } 
     397    else { # Normal headerization and updating 
     398        # Update all the .h files 
     399        for my $hfile ( sort keys %sourcefiles ) { 
     400            my $sourcefiles = $sourcefiles{$hfile}; 
     401 
     402            my $header = read_file($hfile); 
     403 
     404            for my $cfile ( sort keys %{$sourcefiles} ) { 
     405                my @funcs = @{ $sourcefiles->{$cfile} }; 
     406                @funcs = grep { not $_->{is_static} } @funcs;    # skip statics 
     407 
     408                $header = replace_headerized_declarations( $header, $cfile, $hfile, @funcs ); 
     409            } 
     410 
     411            write_file( $hfile, $header ); 
     412        } 
     413 
     414        # Update all the .c files in place 
     415        for my $cfile ( sort keys %sourcefiles_with_statics ) { 
     416            my @funcs = @{ $sourcefiles_with_statics{$cfile} }; 
     417            @funcs = grep { $_->{is_static} } @funcs; 
     418 
     419            my $source = read_file($cfile); 
     420            $source = replace_headerized_declarations( $source, 'static', $cfile, @funcs ); 
     421 
     422            write_file( $cfile, $source ); 
     423        } 
     424        print "Headerization complete.\n"; 
     425    } 
     426 
     427    my %warnings = %{$headerizer->{warnings}}; 
     428    if ( keys %warnings ) { 
     429        my $nwarnings     = 0; 
     430        my $nwarningfuncs = 0; 
     431        my $nwarningfiles = 0; 
     432        for my $file ( sort keys %warnings ) { 
     433            ++$nwarningfiles; 
     434            print "$file\n"; 
     435            my $funcs = $warnings{$file}; 
     436            for my $func ( sort keys %{$funcs} ) { 
     437                ++$nwarningfuncs; 
     438                for my $error ( @{ $funcs->{$func} } ) { 
     439                    print "    $func: $error\n"; 
     440                    ++$nwarnings; 
     441                } 
     442            } 
     443        } 
     444 
     445        print "$nwarnings warnings in $nwarningfuncs funcs in $nwarningfiles C files\n"; 
     446    } 
     447 
     448    return; 
     449} 
     450 
     451# From earlier documentation: 
     452# * Generate docs from funcs 
     453# * Somehow handle static functions in the source file 
     454# * the .c files MUST have a /* HEADERIZER HFILE: foo/bar.h */ directive in them 
     455# * Support for multiple .c files pointing at the same .h file 
     456# * Does NOT remove all blocks in the .h file, so if a .c file 
     457#   disappears, its block is "orphaned" and will remain there. 
     458 
     459# Local Variables: 
     460#   mode: cperl 
     461#   cperl-indent-level: 4 
     462#   fill-column: 100 
     463# End: 
     464# vim: expandtab shiftwidth=4: 
  • tools/dev/dump_pbc.pl

    Property changes on: tools/dev/headerizer.pl
    ___________________________________________________________________
    Added: svn:mergeinfo
       Merged /branches/pbc_frozen_strings1/tools/build/headerizer.pl:r46081-46225
       Merged /branches/convert_OSNAME/tools/build/headerizer.pl:r42258-42340
       Merged /branches/gc_api/tools/build/headerizer.pl:r38521-38653
       Merged /branches/tt528_vtinit/tools/build/headerizer.pl:r38444-38470
       Merged /branches/library_files/tools/build/headerizer.pl:r41458-41848
       Merged /branches/hash_faster/tools/build/headerizer.pl:r47841-47862
       Merged /branches/parrot_call_dep/tools/build/headerizer.pl:r44134-44188
       Merged /branches/tt_696/tools/build/headerizer.pl:r39055-39086
       Merged /branches/vtable_massacre/tools/build/headerizer.pl:r43827-43920
       Merged /branches/gc-refactor/tools/build/headerizer.pl:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/build/headerizer.pl:r43520-43704
       Merged /branches/fix_icc_failures/tools/build/headerizer.pl:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/build/headerizer.pl:r44790-44875
       Merged /branches/noalignptrs/tools/build/headerizer.pl:r43151-43489
       Merged /branches/headercleanup/tools/build/headerizer.pl:r37946-38257
       Merged /branches/stringnull/tools/build/headerizer.pl:r45492-45618
       Merged /branches/auto_format_no_Config/tools/build/headerizer.pl:r42352-42410
       Merged /branches/RELEASE_1_3_0/tools/build/headerizer.pl:r39592-39598
       Merged /branches/no_pmc_install/tools/build/headerizer.pl:r45100-45105
       Merged /branches/ns_func_cleanup/tools/build/headerizer.pl:r47026-47677
       Merged /branches/dynop_mapping/tools/build/headerizer.pl:r47504-48410
       Merged /branches/RELEASE_0_8_2/tools/build/headerizer.pl:r34004-34020
       Merged /branches/tt_1449/tools/build/headerizer.pl:r44021-44101
       Merged /branches/tt1452_configure_debug/tools/build/headerizer.pl:r47168-47317
       Merged /branches/pmc_sans_unionval/tools/build/headerizer.pl:r40531-40725
       Merged /branches/bsr_jsr_ret/tools/build/headerizer.pl:r40212-40267
       Merged /branches/one_make/tools/build/headerizer.pl:r43277-43591
       Merged /branches/tt1393_retcon/tools/build/headerizer.pl:r43652-43720
       Merged /branches/opengl_dynamic_nci/tools/build/headerizer.pl:r43840-44139
       Merged /branches/tt362/tools/build/headerizer.pl:r43955-44212
       Merged /branches/platform_determine_earlier/tools/build/headerizer.pl:r42413-42432
       Merged /branches/cfunctionsdocs/tools/build/headerizer.pl:r47551-47916
       Merged /branches/ucs4_encoding/tools/build/headerizer.pl:r46803-46997
       Merged /branches/pmc_freeze_cleanup/tools/build/headerizer.pl:r43031-43433
       Merged /branches/configtests/tools/build/headerizer.pl:r42236-42574
       Merged /branches/remove-next_for_GC/tools/build/headerizer.pl:r41487-41507
       Merged /branches/auto_frames_refactor/tools/build/headerizer.pl:r41426-41455
       Merged /branches/tt473_remove_memcpy_aligned/tools/build/headerizer.pl:r43163-43440
       Merged /branches/op_pmcs/tools/build/headerizer.pl:r43820-44044
       Merged /branches/pmc_func_cleanup/tools/build/headerizer.pl:r43978-44189
       Merged /branches/kill_stacks/tools/build/headerizer.pl:r40284-40287
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/build/headerizer.pl:r43337-43339
       Merged /branches/no_running_make_test/tools/build/headerizer.pl:r43474-43545
       Merged /branches/gc_internals/tools/build/headerizer.pl:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/build/headerizer.pl:r48343-48374
       Merged /branches/removing_stm/tools/build/headerizer.pl:r35464-35502
       Merged /branches/io_rewiring/tools/build/headerizer.pl:r39195-39460
       Merged /branches/assert_args/tools/build/headerizer.pl:r34776-34857
       Merged /branches/ops_massacre/tools/build/headerizer.pl:r46812-47047
       Merged /branches/jit_h_files/tools/build/headerizer.pl:r34166-35215
       Merged /branches/runcore_purge/tools/build/headerizer.pl:r45837-45948
    Added: svn:eol-style
       + native
    Added: svn:keywords
       + Author Date Id Revision
    
     
     1#! perl 
     2 
     3# Copyright (C) 2008, Parrot Foundation. 
     4# $Id$ 
     5 
     6=head1 NAME 
     7 
     8tools/dev/dump_pbc.pl - Weave together PBC disassembly with PIR source 
     9 
     10=head1 SYNOPSIS 
     11 
     12 perl tools/dev/dump_pbc.pl foo.pbc 
     13 
     14=head1 DESCRIPTION 
     15 
     16dump_pbc.pl uses Parrot's F<pbc_disassemble> program to disassemble the opcodes 
     17in a PBC (Parrot ByteCode) file, then weaves the disassembly together with 
     18the original PIR source file(s).  This makes it easier to see how the PIR 
     19syntactic sugar is desugared into raw Parrot opcodes. 
     20 
     21=head1 BUGS 
     22 
     23This program has only been tested for a few simple cases.  Also, the name 
     24might suggest a different use than its actual purpose. 
     25 
     26While it is not a bug in F<dump_pbc.pl> per se, there is a line numbering 
     27bug for some PBC opcode sequences that will result in the disassembled 
     28opcodes appearing just before the source lines they represent, rather 
     29than just after.  There does not appear to be consensus yet about where 
     30this bug actually resides. 
     31 
     32=cut 
     33 
     34use strict; 
     35use warnings; 
     36use Cwd; 
     37use FindBin; 
     38 
     39my ($PARROT_ROOT, $RUNTIME_DIR); 
     40BEGIN { 
     41    $PARROT_ROOT = Cwd::abs_path("$FindBin::Bin/../.."); 
     42    $RUNTIME_DIR = "$PARROT_ROOT/runtime/parrot"; 
     43} 
     44 
     45use lib "$PARROT_ROOT/lib"; 
     46use Parrot::Config '%PConfig'; 
     47 
     48my $DISASSEMBLER = "$PConfig{build_dir}$PConfig{slash}pbc_disassemble$PConfig{exe}"; 
     49 
     50go(@ARGV); 
     51 
     52sub go { 
     53    my $pbc = shift; 
     54 
     55    # The following mess brought to you by Win32, where pipe open doesn't work, 
     56    # and thus its greater security and cleaner error handling are unavailable. 
     57 
     58    -f $pbc && -r _ 
     59        or die "PBC file '$pbc' does not exist or is not readable.\n"; 
     60 
     61    -f $DISASSEMBLER && -x _ 
     62        or die  "Can't find disassembler '$DISASSEMBLER';" 
     63              . "did you remember to make parrot first?\n"; 
     64 
     65    my @dis = `$DISASSEMBLER $pbc`; 
     66    die "No disassembly; errors: $?, $!" unless @dis; 
     67 
     68    my $cur_file = ''; 
     69    my $cur_line = -1; 
     70    my %cache; 
     71 
     72    foreach (@dis) { 
     73        if (/^(?:# )?Current Source Filename (.*)/) { 
     74            my $found = $1; 
     75            $found =~ s/^'//; 
     76            $found =~ s/'$//; 
     77            if ($cur_file ne $found) { 
     78                $cur_file           = $found; 
     79                $cache{$cur_file} ||= slurp_file($cur_file); 
     80                $cur_line           = -1; 
     81 
     82                print "\n#### $cur_file\n"; 
     83            } 
     84        } 
     85        elsif (my ($info, $seq, $pc, $line, $code) = /^((\d+)-(\d+) (\d+): )(.*)/) { 
     86            my $int_line = int    $line; 
     87            my $len_line = length $line; 
     88            if ($cur_line != $int_line) { 
     89                $cur_line = 0 if $cur_line == -1; 
     90                print "\n"; 
     91                foreach my $i ($cur_line + 1 .. $int_line) { 
     92                    my $source_code = $cache{$cur_file}[$i-1]; 
     93                    # next    unless $source_code =~ /\S/; 
     94                    printf "# %*d:   %s", $len_line, $i, $source_code; 
     95                    print  "\n" if $source_code =~ /^\.end/; 
     96                } 
     97                $cur_line  = $int_line; 
     98            } 
     99 
     100            print ' ' x ($len_line + 4), "$code\n"; 
     101        } 
     102    } 
     103} 
     104 
     105sub slurp_file { 
     106    my $file = shift; 
     107    my $source; 
     108 
     109       open $source, '<', $file 
     110    or open $source, '<', "$PARROT_ROOT/$file" 
     111    or open $source, '<', "$RUNTIME_DIR/$file" 
     112    or die "Could not open source file '$file': $!"; 
     113 
     114    my @lines = <$source>; 
     115 
     116    return \@lines; 
     117} 
     118 
     119 
     120# Local Variables: 
     121#   mode: cperl 
     122#   cperl-indent-level: 4 
     123#   fill-column: 100 
     124# End: 
     125# vim: expandtab shiftwidth=4: 
  • tools/dev/ncidef2pasm.pl

    Property changes on: tools/dev/dump_pbc.pl
    ___________________________________________________________________
    Added: svn:mergeinfo
       Merged /branches/tt_696/tools/util/dump_pbc.pl:r39055-39086
       Merged /branches/vtable_massacre/tools/util/dump_pbc.pl:r43827-43920
       Merged /branches/op_pmcs/tools/util/dump_pbc.pl:r43820-44044
       Merged /branches/no_pmc_install/tools/util/dump_pbc.pl:r45100-45105
       Merged /branches/RELEASE_1_3_0/tools/util/dump_pbc.pl:r39592-39598
       Merged /branches/auto_format_no_Config/tools/util/dump_pbc.pl:r42352-42410
       Merged /branches/stringnull/tools/util/dump_pbc.pl:r45492-45618
       Merged /branches/RELEASE_0_8_2/tools/util/dump_pbc.pl:r34004-34020
       Merged /branches/no_running_make_test/tools/util/dump_pbc.pl:r43474-43545
       Merged /branches/gc_internals/tools/util/dump_pbc.pl:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/dump_pbc.pl:r48343-48374
       Merged /branches/opengl_dynamic_nci/tools/util/dump_pbc.pl:r43840-44139
       Merged /branches/tt1393_retcon/tools/util/dump_pbc.pl:r43652-43720
       Merged /branches/convert_OSNAME/tools/util/dump_pbc.pl:r42258-42340
       Merged /branches/gc_api/tools/util/dump_pbc.pl:r38521-38653
       Merged /branches/platform_determine_earlier/tools/util/dump_pbc.pl:r42413-42432
       Merged /branches/library_files/tools/util/dump_pbc.pl:r41458-41848
       Merged /branches/parrot_call_dep/tools/util/dump_pbc.pl:r44134-44188
       Merged /branches/pmc_freeze_with_pmcs/tools/util/dump_pbc.pl:r43520-43704
       Merged /branches/gc-refactor/tools/util/dump_pbc.pl:r41010-41302
       Merged /branches/rm_dynoplibs_make/tools/util/dump_pbc.pl:r44790-44875
       Merged /branches/fix_icc_failures/tools/util/dump_pbc.pl:r44593-44838
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/dump_pbc.pl:r43163-43440
       Merged /branches/headercleanup/tools/util/dump_pbc.pl:r37946-38257
       Merged /branches/noalignptrs/tools/util/dump_pbc.pl:r43151-43489
       Merged /branches/pmc_func_cleanup/tools/util/dump_pbc.pl:r43978-44189
       Merged /branches/ns_func_cleanup/tools/util/dump_pbc.pl:r47026-47677
       Merged /branches/kill_stacks/tools/util/dump_pbc.pl:r40284-40287
       Merged /branches/dynop_mapping/tools/util/dump_pbc.pl:r47504-48410
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/dump_pbc.pl:r43337-43339
       Merged /branches/tt_1449/tools/util/dump_pbc.pl:r44021-44101
       Merged /branches/removing_stm/tools/util/dump_pbc.pl:r35464-35502
       Merged /branches/tt1452_configure_debug/tools/util/dump_pbc.pl:r47168-47317
       Merged /branches/io_rewiring/tools/util/dump_pbc.pl:r39195-39460
       Merged /branches/assert_args/tools/util/dump_pbc.pl:r34776-34857
       Merged /branches/one_make/tools/util/dump_pbc.pl:r43277-43591
       Merged /branches/bsr_jsr_ret/tools/util/dump_pbc.pl:r40212-40267
       Merged /branches/pmc_sans_unionval/tools/util/dump_pbc.pl:r40531-40725
       Merged /branches/ops_massacre/tools/util/dump_pbc.pl:r46812-47047
       Merged /branches/jit_h_files/tools/util/dump_pbc.pl:r34166-35215
       Merged /branches/runcore_purge/tools/util/dump_pbc.pl:r45837-45948
       Merged /branches/pbc_frozen_strings1/tools/util/dump_pbc.pl:r46081-46225
       Merged /branches/tt362/tools/util/dump_pbc.pl:r43955-44212
       Merged /branches/tt528_vtinit/tools/util/dump_pbc.pl:r38444-38470
       Merged /branches/cfunctionsdocs/tools/util/dump_pbc.pl:r47551-47916
       Merged /branches/ucs4_encoding/tools/util/dump_pbc.pl:r46803-46997
       Merged /branches/pmc_freeze_cleanup/tools/util/dump_pbc.pl:r43031-43433
       Merged /branches/hash_faster/tools/util/dump_pbc.pl:r47841-47862
       Merged /branches/configtests/tools/util/dump_pbc.pl:r42236-42574
       Merged /branches/remove-next_for_GC/tools/util/dump_pbc.pl:r41487-41507
       Merged /branches/auto_frames_refactor/tools/util/dump_pbc.pl:r41426-41455
    Added: svn:eol-style
       + native
    Added: svn:executable
       + *
    Added: svn:keywords
       + Author Date Id Revision
    
     
     1#! perl 
     2 
     3# Copyright (C) 2003-2007, Parrot Foundation. 
     4# $Id$ 
     5 
     6=head1 NAME 
     7 
     8tools/dev/ncidef2asm.pl - Turn an NCI library definition file into PASM 
     9 
     10=head1 SYNOPSIS 
     11 
     12    perl tools/dev/ncidef2asm.pl path/to/from_file [ path/to/to_file ] 
     13 
     14=head1 DESCRIPTION 
     15 
     16This program takes an NCI library definition file and turns it into PASM. 
     17 
     18An NCI library definition file provides the information needed to 
     19generate a parrot wrapper for the named library (or libraries). Its 
     20format is simple, and looks like: 
     21 
     22  [package] 
     23  ncurses 
     24 
     25  [lib] 
     26  libform.so 
     27 
     28  [defs] 
     29  p new_field i i i i i i 
     30 
     31  [lib] 
     32  libncurses.so 
     33 
     34  [defs] 
     35  i is_term_resized i i 
     36 
     37Note that the assembly file is generated in the order you specify, so 
     38if there are library dependencies, make sure you have them in the 
     39correct order. 
     40 
     41=head2 package 
     42 
     43Declares the package that all subsequent sub PMCs will be put 
     44into. The name is a simple concatenation of the package name, double 
     45colon, and the routine name, with no preceding punctuation. 
     46 
     47=head2 lib 
     48 
     49The name of the library to be loaded. Should be as qualified as 
     50necessary for your platform--generally the full filename is required, 
     51though the directory generally isn't. 
     52 
     53You may load multiple libraries here, but only the last one loaded 
     54will be exposed to subsequent defs. 
     55 
     56=head2 defs 
     57 
     58This section holds the definitions of functions. Each function is 
     59assumed to be in the immediate preceding library. The definition of 
     60the function is: 
     61 
     62  return_type name [param [param [param ...]]] 
     63 
     64The param and return_type parameters use the NCI standard, which for 
     65reference is: 
     66 
     67=over 4 
     68 
     69=item p 
     70 
     71Parameter is a void pointer, taken from the PMC's data pointer. PMC is 
     72assumed to be an unmanagedstruct or child class. 
     73 
     74Taken from a P register 
     75 
     76=item c 
     77 
     78Parameter is a character. 
     79 
     80Taken from an I register 
     81 
     82=item s 
     83 
     84Parameter is a short 
     85 
     86Taken from an I register 
     87 
     88=item i 
     89 
     90Parameter is an int 
     91 
     92Taken from an I register 
     93 
     94=item l 
     95 
     96Parameter is a long 
     97 
     98Taken from an I register 
     99 
     100=item f 
     101 
     102Paramter is a float 
     103 
     104Taken from an N register. 
     105 
     106=item d 
     107 
     108Parameter is a double. 
     109 
     110Taken from an N register. 
     111 
     112=item t 
     113 
     114Paramter is a char *, presumably a C string 
     115 
     116Taken from an S register 
     117 
     118=item v 
     119 
     120Void. Only valid as a return type, noting that the function returns no data. 
     121 
     122=item I 
     123 
     124Interpreter pointer. The current interpreter pointer is passed in 
     125 
     126=item P 
     127 
     128PMC. 
     129 
     130=item 2 
     131 
     132Pointer to short. 
     133 
     134Taken from an I register. 
     135 
     136=item 3 
     137 
     138Pointer to int. 
     139 
     140Taken from an I register 
     141 
     142=item 4 
     143 
     144Pointer to long 
     145 
     146Taken from an I register 
     147 
     148=back 
     149 
     150=cut 
     151 
     152use strict; 
     153use warnings; 
     154 
     155my ( $from_file, $to_file ) = @ARGV; 
     156 
     157# If there is no destination file, strip off the extension of the 
     158# source file and add a .pasm to it 
     159if ( !defined $to_file ) { 
     160    $to_file = $from_file; 
     161    $to_file =~ s/\..*$//; 
     162    $to_file .= ".pasm"; 
     163} 
     164 
     165open my $INPUT,  '<', "$from_file" or die "Can't open up $from_file, error $!"; 
     166open my $OUTPUT, '>', "$to_file"   or die "Can't open up $to_file, error $!"; 
     167 
     168# To start, save all the registers, just in case 
     169print $OUTPUT "saveall\n"; 
     170 
     171my @libs; 
     172my ( $cur_package, $line, $cur_section ); 
     173 
     174# Our dispatch table 
     175my (%dispatch) = ( 
     176    package => \&package_line, 
     177    lib     => \&lib_line, 
     178    defs    => \&def_line, 
     179); 
     180 
     181while ( $line = <$INPUT> ) { 
     182 
     183    # Throw away trailing newlines, comments, and whitespace. If the 
     184    # line's empty, then off to the next line 
     185    chomp $line; 
     186    $line =~ s/#.*//; 
     187    $line =~ s/\s*$//; 
     188    next unless $line; 
     189 
     190    # Is it a section line? If so, extract the section and set it. 
     191    if ( $line =~ /\[(\w+)\]/ ) { 
     192        $cur_section = $1; 
     193        next; 
     194    } 
     195 
     196    # Everything else goes to the handler 
     197    $dispatch{$cur_section}->($line); 
     198 
     199} 
     200 
     201# Put the registers back and end 
     202print $OUTPUT "restoreall\n"; 
     203print $OUTPUT "end\n"; 
     204close $OUTPUT; 
     205 
     206sub package_line { 
     207    my $line = shift; 
     208 
     209    # Trim leading and trailing spaces 
     210    $line =~ s/^\s*//; 
     211    $line =~ s/\s*$//; 
     212 
     213    # Set the global current package 
     214    $cur_package = $line; 
     215 
     216} 
     217 
     218sub lib_line { 
     219    my $line = shift; 
     220    print $OUTPUT "loadlib P1, '$line'\n"; 
     221} 
     222 
     223sub def_line { 
     224    my $line = shift; 
     225    my ( $return_type, $name, @params ) = split ' ', $line; 
     226    unshift @params, $return_type; 
     227    my $signature = join( "", @params ); 
     228    print $OUTPUT "dlfunc P2, P1, '$name', '$signature'\n"; 
     229    print $OUTPUT "store_global '${cur_package}::${name}', P2\n"; 
     230} 
     231 
     232# Local Variables: 
     233#   mode: cperl 
     234#   cperl-indent-level: 4 
     235#   fill-column: 100 
     236# End: 
     237# vim: expandtab shiftwidth=4: 
  • tools/dev/perlcritic-cage.conf

    Property changes on: tools/dev/ncidef2pasm.pl
    ___________________________________________________________________
    Added: svn:mergeinfo
       Merged /branches/parrot_call_dep/tools/util/ncidef2pasm.pl:r44134-44188
       Merged /branches/tt_696/tools/util/ncidef2pasm.pl:r39055-39086
       Merged /branches/vtable_massacre/tools/util/ncidef2pasm.pl:r43827-43920
       Merged /branches/gc-refactor/tools/util/ncidef2pasm.pl:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/util/ncidef2pasm.pl:r43520-43704
       Merged /branches/fix_icc_failures/tools/util/ncidef2pasm.pl:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/util/ncidef2pasm.pl:r44790-44875
       Merged /branches/noalignptrs/tools/util/ncidef2pasm.pl:r43151-43489
       Merged /branches/headercleanup/tools/util/ncidef2pasm.pl:r37946-38257
       Merged /branches/no_pmc_install/tools/util/ncidef2pasm.pl:r45100-45105
       Merged /branches/RELEASE_1_3_0/tools/util/ncidef2pasm.pl:r39592-39598
       Merged /branches/auto_format_no_Config/tools/util/ncidef2pasm.pl:r42352-42410
       Merged /branches/stringnull/tools/util/ncidef2pasm.pl:r45492-45618
       Merged /branches/ns_func_cleanup/tools/util/ncidef2pasm.pl:r47026-47677
       Merged /branches/dynop_mapping/tools/util/ncidef2pasm.pl:r47504-48410
       Merged /branches/RELEASE_0_8_2/tools/util/ncidef2pasm.pl:r34004-34020
       Merged /branches/tt_1449/tools/util/ncidef2pasm.pl:r44021-44101
       Merged /branches/tt1452_configure_debug/tools/util/ncidef2pasm.pl:r47168-47317
       Merged /branches/pmc_sans_unionval/tools/util/ncidef2pasm.pl:r40531-40725
       Merged /branches/bsr_jsr_ret/tools/util/ncidef2pasm.pl:r40212-40267
       Merged /branches/one_make/tools/util/ncidef2pasm.pl:r43277-43591
       Merged /branches/tt1393_retcon/tools/util/ncidef2pasm.pl:r43652-43720
       Merged /branches/opengl_dynamic_nci/tools/util/ncidef2pasm.pl:r43840-44139
       Merged /branches/tt362/tools/util/ncidef2pasm.pl:r43955-44212
       Merged /branches/platform_determine_earlier/tools/util/ncidef2pasm.pl:r42413-42432
       Merged /branches/ucs4_encoding/tools/util/ncidef2pasm.pl:r46803-46997
       Merged /branches/cfunctionsdocs/tools/util/ncidef2pasm.pl:r47551-47916
       Merged /branches/pmc_freeze_cleanup/tools/util/ncidef2pasm.pl:r43031-43433
       Merged /branches/remove-next_for_GC/tools/util/ncidef2pasm.pl:r41487-41507
       Merged /branches/configtests/tools/util/ncidef2pasm.pl:r42236-42574
       Merged /branches/auto_frames_refactor/tools/util/ncidef2pasm.pl:r41426-41455
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/ncidef2pasm.pl:r43163-43440
       Merged /branches/op_pmcs/tools/util/ncidef2pasm.pl:r43820-44044
       Merged /branches/pmc_func_cleanup/tools/util/ncidef2pasm.pl:r43978-44189
       Merged /branches/kill_stacks/tools/util/ncidef2pasm.pl:r40284-40287
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/ncidef2pasm.pl:r43337-43339
       Merged /branches/no_running_make_test/tools/util/ncidef2pasm.pl:r43474-43545
       Merged /branches/gc_internals/tools/util/ncidef2pasm.pl:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/ncidef2pasm.pl:r48343-48374
       Merged /branches/removing_stm/tools/util/ncidef2pasm.pl:r35464-35502
       Merged /branches/io_rewiring/tools/util/ncidef2pasm.pl:r39195-39460
       Merged /branches/assert_args/tools/util/ncidef2pasm.pl:r34776-34857
       Merged /branches/ops_massacre/tools/util/ncidef2pasm.pl:r46812-47047
       Merged /branches/jit_h_files/tools/util/ncidef2pasm.pl:r34166-35215
       Merged /branches/runcore_purge/tools/util/ncidef2pasm.pl:r45837-45948
       Merged /branches/pbc_frozen_strings1/tools/util/ncidef2pasm.pl:r46081-46225
       Merged /branches/convert_OSNAME/tools/util/ncidef2pasm.pl:r42258-42340
       Merged /branches/gc_api/tools/util/ncidef2pasm.pl:r38521-38653
       Merged /branches/tt528_vtinit/tools/util/ncidef2pasm.pl:r38444-38470
       Merged /branches/library_files/tools/util/ncidef2pasm.pl:r41458-41848
       Merged /branches/hash_faster/tools/util/ncidef2pasm.pl:r47841-47862
    Added: svn:eol-style
       + native
    Added: svn:keywords
       + Author Date Id Revision
    Added: cvs2svn:cvs-rev
       + 1.1
    
     
     1# A more stringent set of rules for cage cleaners 
     2 
     3[-CodeLayout::ProhibitParensWithBuiltins] 
     4[CodeLayout::ProhibitHardTabs] 
     5allow_leading_tabs = 0 
     6  
     7[-CodeLayout::RequireTidyCode] 
     8 
     9[-ControlStructures::ProhibitPostfixControls] 
     10[-ControlStructures::ProhibitUnlessBlocks] 
     11 
     12[-Documentation::PodSpelling] 
     13[-Documentation::RequirePodAtEnd] 
     14[-Documentation::RequirePodSections] 
     15 
     16[-ErrorHandling::RequireCarping] 
     17 
     18[-InputOutput::ProhibitBacktickOperators] 
     19[-InputOutput::ProhibitInteractiveTest] 
     20[-InputOutput::RequireCheckedSyscalls] 
     21functions = :builtins 
     22exclude_functions = print 
     23 
     24[-Miscellanea::RequireRcsKeywords] 
     25 
     26[-Modules::RequireVersionVar] 
     27 
     28[-RegularExpressions::ProhibitEscapedMetacharacters] 
     29[-RegularExpressions::RequireDotMatchAnything] 
     30[-RegularExpressions::RequireExtendedFormatting] 
     31[-RegularExpressions::RequireLineBoundaryMatching] 
     32 
     33[-ValuesAndExpressions::ProhibitConstantPragma] 
     34[-ValuesAndExpressions::ProhibitEmptyQuotes] 
     35[-ValuesAndExpressions::ProhibitMagicNumbers] 
     36 
     37[-Variables::ProhibitPunctuationVars] 
  • tools/dev/perlcritic.conf

    Property changes on: tools/dev/perlcritic-cage.conf
    ___________________________________________________________________
    Added: svn:mergeinfo
       Merged /branches/io_rewiring/tools/util/perlcritic-cage.conf:r39195-39460
       Merged /branches/ops_massacre/tools/util/perlcritic-cage.conf:r46812-47047
       Merged /branches/runcore_purge/tools/util/perlcritic-cage.conf:r45837-45948
       Merged /branches/pbc_frozen_strings1/tools/util/perlcritic-cage.conf:r46081-46225
       Merged /branches/convert_OSNAME/tools/util/perlcritic-cage.conf:r42258-42340
       Merged /branches/gc_api/tools/util/perlcritic-cage.conf:r38521-38653
       Merged /branches/tt528_vtinit/tools/util/perlcritic-cage.conf:r38444-38470
       Merged /branches/library_files/tools/util/perlcritic-cage.conf:r41458-41848
       Merged /branches/hash_faster/tools/util/perlcritic-cage.conf:r47841-47862
       Merged /branches/parrot_call_dep/tools/util/perlcritic-cage.conf:r44134-44188
       Merged /branches/tt_696/tools/util/perlcritic-cage.conf:r39055-39086
       Merged /branches/vtable_massacre/tools/util/perlcritic-cage.conf:r43827-43920
       Merged /branches/pmc_freeze_with_pmcs/tools/util/perlcritic-cage.conf:r43520-43704
       Merged /branches/gc-refactor/tools/util/perlcritic-cage.conf:r41010-41302
       Merged /branches/fix_icc_failures/tools/util/perlcritic-cage.conf:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/util/perlcritic-cage.conf:r44790-44875
       Merged /branches/noalignptrs/tools/util/perlcritic-cage.conf:r43151-43489
       Merged /branches/stringnull/tools/util/perlcritic-cage.conf:r45492-45618
       Merged /branches/auto_format_no_Config/tools/util/perlcritic-cage.conf:r42352-42410
       Merged /branches/RELEASE_1_3_0/tools/util/perlcritic-cage.conf:r39592-39598
       Merged /branches/no_pmc_install/tools/util/perlcritic-cage.conf:r45100-45105
       Merged /branches/ns_func_cleanup/tools/util/perlcritic-cage.conf:r47026-47677
       Merged /branches/dynop_mapping/tools/util/perlcritic-cage.conf:r47504-48410
       Merged /branches/tt_1449/tools/util/perlcritic-cage.conf:r44021-44101
       Merged /branches/tt1452_configure_debug/tools/util/perlcritic-cage.conf:r47168-47317
       Merged /branches/bsr_jsr_ret/tools/util/perlcritic-cage.conf:r40212-40267
       Merged /branches/one_make/tools/util/perlcritic-cage.conf:r43277-43591
       Merged /branches/pmc_sans_unionval/tools/util/perlcritic-cage.conf:r40531-40725
       Merged /branches/tt1393_retcon/tools/util/perlcritic-cage.conf:r43652-43720
       Merged /branches/opengl_dynamic_nci/tools/util/perlcritic-cage.conf:r43840-44139
       Merged /branches/tt362/tools/util/perlcritic-cage.conf:r43955-44212
       Merged /branches/platform_determine_earlier/tools/util/perlcritic-cage.conf:r42413-42432
       Merged /branches/cfunctionsdocs/tools/util/perlcritic-cage.conf:r47551-47916
       Merged /branches/pmc_freeze_cleanup/tools/util/perlcritic-cage.conf:r43031-43433
       Merged /branches/remove-next_for_GC/tools/util/perlcritic-cage.conf:r41487-41507
       Merged /branches/configtests/tools/util/perlcritic-cage.conf:r42236-42574
       Merged /branches/auto_frames_refactor/tools/util/perlcritic-cage.conf:r41426-41455
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/perlcritic-cage.conf:r43163-43440
       Merged /branches/op_pmcs/tools/util/perlcritic-cage.conf:r43820-44044
       Merged /branches/pmc_func_cleanup/tools/util/perlcritic-cage.conf:r43978-44189
       Merged /branches/kill_stacks/tools/util/perlcritic-cage.conf:r40284-40287
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/perlcritic-cage.conf:r43337-43339
       Merged /branches/no_running_make_test/tools/util/perlcritic-cage.conf:r43474-43545
       Merged /branches/gc_internals/tools/util/perlcritic-cage.conf:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/perlcritic-cage.conf:r48343-48374
       Merged /branches/removing_stm/tools/util/perlcritic-cage.conf:r35464-35502
    Added: svn:eol-style
       + native
    Added: svn:keywords
       + Author Date Id Revision
    
     
     1verbose = 3 
     2 
     3# not all the profiles listed here are installed by default, even if you have 
     4# Perl::Critic. Shhhh. 
     5profile-strictness = quiet 
     6 
     7[BuiltinFunctions::ProhibitStringySplit] 
     8add_themes = parrot 
     9 
     10[CodeLayout::ProhibitDuplicateCoda] 
     11add_themes = parrot 
     12 
     13[CodeLayout::ProhibitHardTabs] 
     14allow_leading_tabs = 0 
     15add_themes = parrot 
     16 
     17[CodeLayout::ProhibitTrailingWhitespace] 
     18add_themes = parrot 
     19 
     20[CodeLayout::RequireTidyCode] 
     21perltidyrc = tools/dev/perltidy.conf 
     22add_themes = extra 
     23 
     24[CodeLayout::UseParrotCoda] 
     25add_themes = parrot 
     26 
     27[InputOutput::ProhibitBarewordFileHandles] 
     28add_themes = parrot 
     29 
     30[InputOutput::ProhibitTwoArgOpen] 
     31add_themes = parrot 
     32 
     33[NamingConventions::ProhibitAmbiguousNames] 
     34# remove abstract from the list of forbidden names 
     35forbid = bases close contract last left no record right second set 
     36add_themes = extra 
     37 
     38[Subroutines::ProhibitBuiltinHomonyms] 
     39add_themes = extra 
     40 
     41[Subroutines::ProhibitExplicitReturnUndef] 
     42add_themes = parrot 
     43 
     44[Subroutines::ProhibitSubroutinePrototypes] 
     45add_themes = parrot 
     46 
     47[Subroutines::RequireFinalReturn] 
     48add_themes = extra 
     49 
     50[TestingAndDebugging::MisplacedShebang] 
     51add_themes = parrot 
     52 
     53[TestingAndDebugging::ProhibitShebangWarningsArg] 
     54add_themes = parrot 
     55 
     56[TestingAndDebugging::RequirePortableShebang] 
     57add_themes = parrot 
     58 
     59[TestingAndDebugging::RequireUseStrict] 
     60add_themes = parrot 
     61 
     62[TestingAndDebugging::RequireUseWarnings] 
     63add_themes = parrot 
     64 
     65[ValuesAndExpressions::ProhibitInterpolationOfLiterals] 
     66add_themes = extra 
     67 
     68[Variables::ProhibitConditionalDeclarations] 
     69add_themes = parrot 
     70 
     71[Bangs::ProhibitFlagComments] 
     72add_themes = extra 
     73 
     74[Bangs::ProhibitRefProtoOrProto] 
     75add_themes = extra 
  • tools/dev/README

    Property changes on: tools/dev/perlcritic.conf
    ___________________________________________________________________
    Added: svn:mergeinfo
       Merged /branches/tt1452_configure_debug/tools/util/perlcritic.conf:r47168-47317
       Merged /branches/io_rewiring/tools/util/perlcritic.conf:r39195-39460
       Merged /branches/assert_args/tools/util/perlcritic.conf:r34776-34857
       Merged /branches/one_make/tools/util/perlcritic.conf:r43277-43591
       Merged /branches/bsr_jsr_ret/tools/util/perlcritic.conf:r40212-40267
       Merged /branches/pmc_sans_unionval/tools/util/perlcritic.conf:r40531-40725
       Merged /branches/ops_massacre/tools/util/perlcritic.conf:r46812-47047
       Merged /branches/jit_h_files/tools/util/perlcritic.conf:r34166-35215
       Merged /branches/runcore_purge/tools/util/perlcritic.conf:r45837-45948
       Merged /branches/pbc_frozen_strings1/tools/util/perlcritic.conf:r46081-46225
       Merged /branches/tt362/tools/util/perlcritic.conf:r43955-44212
       Merged /branches/tt528_vtinit/tools/util/perlcritic.conf:r38444-38470
       Merged /branches/cfunctionsdocs/tools/util/perlcritic.conf:r47551-47916
       Merged /branches/ucs4_encoding/tools/util/perlcritic.conf:r46803-46997
       Merged /branches/pmc_freeze_cleanup/tools/util/perlcritic.conf:r43031-43433
       Merged /branches/hash_faster/tools/util/perlcritic.conf:r47841-47862
       Merged /branches/remove-next_for_GC/tools/util/perlcritic.conf:r41487-41507
       Merged /branches/configtests/tools/util/perlcritic.conf:r42236-42574
       Merged /branches/auto_frames_refactor/tools/util/perlcritic.conf:r41426-41455
       Merged /branches/vtable_massacre/tools/util/perlcritic.conf:r43827-43920
       Merged /branches/tt_696/tools/util/perlcritic.conf:r39055-39086
       Merged /branches/op_pmcs/tools/util/perlcritic.conf:r43820-44044
       Merged /branches/stringnull/tools/util/perlcritic.conf:r45492-45618
       Merged /branches/auto_format_no_Config/tools/util/perlcritic.conf:r42352-42410
       Merged /branches/RELEASE_1_3_0/tools/util/perlcritic.conf:r39592-39598
       Merged /branches/no_pmc_install/tools/util/perlcritic.conf:r45100-45105
       Merged /branches/RELEASE_0_8_2/tools/util/perlcritic.conf:r34004-34020
       Merged /branches/tt1726_pmc_pod/tools/util/perlcritic.conf:r48343-48374
       Merged /branches/gc_internals/tools/util/perlcritic.conf:r39002-39024
       Merged /branches/no_running_make_test/tools/util/perlcritic.conf:r43474-43545
       Merged /branches/tt1393_retcon/tools/util/perlcritic.conf:r43652-43720
       Merged /branches/opengl_dynamic_nci/tools/util/perlcritic.conf:r43840-44139
       Merged /branches/convert_OSNAME/tools/util/perlcritic.conf:r42258-42340
       Merged /branches/gc_api/tools/util/perlcritic.conf:r38521-38653
       Merged /branches/platform_determine_earlier/tools/util/perlcritic.conf:r42413-42432
       Merged /branches/library_files/tools/util/perlcritic.conf:r41458-41848
       Merged /branches/parrot_call_dep/tools/util/perlcritic.conf:r44134-44188
       Merged /branches/gc-refactor/tools/util/perlcritic.conf:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/util/perlcritic.conf:r43520-43704
       Merged /branches/fix_icc_failures/tools/util/perlcritic.conf:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/util/perlcritic.conf:r44790-44875
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/perlcritic.conf:r43163-43440
       Merged /branches/noalignptrs/tools/util/perlcritic.conf:r43151-43489
       Merged /branches/headercleanup/tools/util/perlcritic.conf:r37946-38257
       Merged /branches/pmc_func_cleanup/tools/util/perlcritic.conf:r43978-44189
       Merged /branches/ns_func_cleanup/tools/util/perlcritic.conf:r47026-47677
       Merged /branches/kill_stacks/tools/util/perlcritic.conf:r40284-40287
       Merged /branches/dynop_mapping/tools/util/perlcritic.conf:r47504-48410
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/perlcritic.conf:r43337-43339
       Merged /branches/tt_1449/tools/util/perlcritic.conf:r44021-44101
       Merged /branches/removing_stm/tools/util/perlcritic.conf:r35464-35502
    Added: svn:eol-style
       + native
    Added: svn:keywords
       + Author Date Id Revision
    
     
     1# $Id$ 
     2README for tools/dev/ 
     3 
     4This directory is intended to hold programs, templates and configuration files 
     5found useful by Parrot developed other than those (a) invoked by the default 
     6'make' target ('make all'), with or without command-line options, during the 
     7Parrot build process; or (b) invoked by 'make install' or 'make install-dev'. 
  • tools/dev/addopstags.pl

    Property changes on: tools/dev/README
    ___________________________________________________________________
    Added: svn:mergeinfo
    Added: svn:eol-style
       + native
    Added: svn:keywords
       + Author Date Id Revision
    
     
     1#!perl 
     2 
     3# Copyright (C) 2004-2006, Parrot Foundation. 
     4# $Id$ 
     5 
     6use strict; 
     7use warnings; 
     8 
     9=head1 NAME 
     10 
     11tools/dev/addopstags.pl - add src/ops/*.ops to tags 
     12 
     13=head1 SYNOPSIS 
     14 
     15 perl tools/dev/addopstags.pl src/ops/*.ops 
     16 
     17=head1 DESCRIPTION 
     18 
     19Add src/ops/*.ops to tags file. 
     20 
     21=cut 
     22 
     23my %seen; 
     24my @tags; 
     25 
     26# Pull ops tags 
     27while (<>) { 
     28    if (/\bop \s+ (\w+) \s* \(/x) { 
     29        next if $seen{$1}++; 
     30 
     31        # tag file excmd xflags 
     32        push @tags, join( "\t", $1, $ARGV, qq{$.;"}, "f" ) . "\n"; 
     33    } 
     34} 
     35continue { 
     36    close ARGV if eof;    # reset $. 
     37} 
     38 
     39# Pull existing tags 
     40open my $T, '<', 'tags'; 
     41push @tags, <$T>; 
     42close $T; 
     43 
     44# Spit 'em out sorted 
     45open $T, '>', 'tags'; 
     46print $T sort @tags; 
     47close $T; 
     48 
     49# Local Variables: 
     50#   mode: cperl 
     51#   cperl-indent-level: 4 
     52#   fill-column: 100 
     53# End: 
     54# vim: expandtab shiftwidth=4: 
  • tools/dev/parrot-config.pir

    Property changes on: tools/dev/addopstags.pl
    ___________________________________________________________________
    Added: svn:mergeinfo
       Merged /branches/tt1452_configure_debug/tools/build/addopstags.pl:r47168-47317
       Merged /branches/one_make/tools/build/addopstags.pl:r43277-43591
       Merged /branches/bsr_jsr_ret/tools/build/addopstags.pl:r40212-40267
       Merged /branches/pmc_sans_unionval/tools/build/addopstags.pl:r40531-40725
       Merged /branches/opengl_dynamic_nci/tools/build/addopstags.pl:r43840-44139
       Merged /branches/tt1393_retcon/tools/build/addopstags.pl:r43652-43720
       Merged /branches/tt362/tools/build/addopstags.pl:r43955-44212
       Merged /branches/platform_determine_earlier/tools/build/addopstags.pl:r42413-42432
       Merged /branches/cfunctionsdocs/tools/build/addopstags.pl:r47551-47916
       Merged /branches/ucs4_encoding/tools/build/addopstags.pl:r46803-46997
       Merged /branches/pmc_freeze_cleanup/tools/build/addopstags.pl:r43031-43433
       Merged /branches/configtests/tools/build/addopstags.pl:r42236-42574
       Merged /branches/remove-next_for_GC/tools/build/addopstags.pl:r41487-41507
       Merged /branches/auto_frames_refactor/tools/build/addopstags.pl:r41426-41455
       Merged /branches/tt473_remove_memcpy_aligned/tools/build/addopstags.pl:r43163-43440
       Merged /branches/op_pmcs/tools/build/addopstags.pl:r43820-44044
       Merged /branches/pmc_func_cleanup/tools/build/addopstags.pl:r43978-44189
       Merged /branches/kill_stacks/tools/build/addopstags.pl:r40284-40287
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/build/addopstags.pl:r43337-43339
       Merged /branches/tt1726_pmc_pod/tools/build/addopstags.pl:r48343-48374
       Merged /branches/gc_internals/tools/build/addopstags.pl:r39002-39024
       Merged /branches/no_running_make_test/tools/build/addopstags.pl:r43474-43545
       Merged /branches/removing_stm/tools/build/addopstags.pl:r35464-35502
       Merged /branches/assert_args/tools/build/addopstags.pl:r34776-34857
       Merged /branches/io_rewiring/tools/build/addopstags.pl:r39195-39460
       Merged /branches/runcore_purge/tools/build/addopstags.pl:r45837-45948
       Merged /branches/jit_h_files/tools/build/addopstags.pl:r34166-35215
       Merged /branches/ops_massacre/tools/build/addopstags.pl:r46812-47047
       Merged /branches/pbc_frozen_strings1/tools/build/addopstags.pl:r46081-46225
       Merged /branches/gc_api/tools/build/addopstags.pl:r38521-38653
       Merged /branches/convert_OSNAME/tools/build/addopstags.pl:r42258-42340
       Merged /branches/tt528_vtinit/tools/build/addopstags.pl:r38444-38470
       Merged /branches/library_files/tools/build/addopstags.pl:r41458-41848
       Merged /branches/hash_faster/tools/build/addopstags.pl:r47841-47862
       Merged /branches/parrot_call_dep/tools/build/addopstags.pl:r44134-44188
       Merged /branches/tt_696/tools/build/addopstags.pl:r39055-39086
       Merged /branches/vtable_massacre/tools/build/addopstags.pl:r43827-43920
       Merged /branches/gc-refactor/tools/build/addopstags.pl:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/build/addopstags.pl:r43520-43704
       Merged /branches/fix_icc_failures/tools/build/addopstags.pl:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/build/addopstags.pl:r44790-44875
       Merged /branches/noalignptrs/tools/build/addopstags.pl:r43151-43489
       Merged /branches/headercleanup/tools/build/addopstags.pl:r37946-38257
       Merged /branches/no_pmc_install/tools/build/addopstags.pl:r45100-45105
       Merged /branches/RELEASE_1_3_0/tools/build/addopstags.pl:r39592-39598
       Merged /branches/auto_format_no_Config/tools/build/addopstags.pl:r42352-42410
       Merged /branches/stringnull/tools/build/addopstags.pl:r45492-45618
       Merged /branches/ns_func_cleanup/tools/build/addopstags.pl:r47026-47677
       Merged /branches/dynop_mapping/tools/build/addopstags.pl:r47504-48410
       Merged /branches/RELEASE_0_8_2/tools/build/addopstags.pl:r34004-34020
       Merged /branches/tt_1449/tools/build/addopstags.pl:r44021-44101
    Added: svn:eol-style
       + native
    Added: svn:keywords
       + Author Date Id Revision
    Added: cvs2svn:cvs-rev
       + 1.1
    
     
     1#!/usr/bin/env parrot 
     2# $Id$ 
     3 
     4=head1 NAME 
     5 
     6config.pir - Print a Parrot configuration item 
     7 
     8=head1 VERSION 
     9 
     10version 0.01 
     11 
     12=head1 SYNOPSIS 
     13 
     14  ./parrot parrot-config.pir VERSION 
     15  ./parrot parrot-config.pir ccflags 
     16  ./parrot parrot-config.pir --dump 
     17 
     18=head1 DESCRIPTION 
     19 
     20Print out configuration items. 
     21 
     22=head1 AUTHOR 
     23 
     24Leopold Toetsch E<lt>lt@toetsch.atE<gt>. 
     25 
     26=head1 COPYRIGHT 
     27 
     28Copyright (C) 2004-2009, Parrot Foundation. 
     29 
     30=cut 
     31 
     32.sub _main :main 
     33    .param pmc argv 
     34    .local int argc 
     35    argc = argv 
     36    if argc < 2 goto usage 
     37    .local pmc interp, conf_hash 
     38    .local string key 
     39    .include "iglobals.pasm" 
     40    interp = getinterp 
     41    conf_hash = interp[.IGLOBALS_CONFIG_HASH] 
     42    .local int i 
     43    i = 1 
     44loop: 
     45    key = argv[i] 
     46    if key == '--help' goto usage 
     47    if key == '--dump' goto dump 
     48    $I0 = defined conf_hash[key] 
     49    unless $I0 goto failkey 
     50    dec argc 
     51    if i < argc goto dumpsome 
     52    $S0 = conf_hash[key] 
     53    print $S0 
     54    inc i 
     55    if i < argc goto loop 
     56    print "\n" 
     57    end 
     58dumpsome: 
     59    key = argv[i] 
     60    $I0 = defined conf_hash[key] 
     61    unless $I0 goto failkey 
     62    print key 
     63    print " => '" 
     64    $S1 = conf_hash[key] 
     65    print $S1 
     66    say "'" 
     67    inc i 
     68    if i <= argc goto dumpsome 
     69    end 
     70failkey: 
     71    print " no such key: '" 
     72    print key 
     73    print "'\n" 
     74    end 
     75dump: 
     76   .local pmc iterator 
     77    iterator = iter conf_hash 
     78iter_loop: 
     79    unless iterator goto iter_end 
     80    shift $S0, iterator 
     81    print $S0 
     82    print " => '" 
     83    $S1 = conf_hash[$S0] 
     84    print $S1 
     85    say "'" 
     86    goto iter_loop 
     87iter_end: 
     88    end 
     89usage: 
     90    $S0 = argv[0] 
     91    $P0 = getinterp 
     92    .include 'stdio.pasm' 
     93    $P1 = $P0.'stdhandle'(.PIO_STDERR_FILENO) 
     94    $P1.'print'($S0) 
     95    $P1.'print'(" [ <config-key> [ <config-key> ... ] | --dump | --help ]\n") 
     96    exit 1 
     97.end 
     98 
     99# Local Variables: 
     100#   mode: pir 
     101#   fill-column: 100 
     102# End: 
     103# vim: expandtab shiftwidth=4 ft=pir: 
  • lib/Parrot/Docs/Section/Tools.pm

    Property changes on: tools/dev/parrot-config.pir
    ___________________________________________________________________
    Added: svn:keywords
       + Author Date Id Revision
    Added: cvs2svn:cvs-rev
       + 1.2
    Added: svn:mergeinfo
       Merged /branches/gc-refactor/tools/util/parrot-config.pir:r41010-41302
       Merged /branches/pmc_freeze_with_pmcs/tools/util/parrot-config.pir:r43520-43704
       Merged /branches/fix_icc_failures/tools/util/parrot-config.pir:r44593-44838
       Merged /branches/rm_dynoplibs_make/tools/util/parrot-config.pir:r44790-44875
       Merged /branches/tt473_remove_memcpy_aligned/tools/util/parrot-config.pir:r43163-43440
       Merged /branches/noalignptrs/tools/util/parrot-config.pir:r43151-43489
       Merged /branches/headercleanup/tools/util/parrot-config.pir:r37946-38257
       Merged /branches/pmc_func_cleanup/tools/util/parrot-config.pir:r43978-44189
       Merged /branches/ns_func_cleanup/tools/util/parrot-config.pir:r47026-47677
       Merged /branches/kill_stacks/tools/util/parrot-config.pir:r40284-40287
       Merged /branches/dynop_mapping/tools/util/parrot-config.pir:r47504-48410
       Merged /branches/remove_Parrot_ex_calc_handler_offset/tools/util/parrot-config.pir:r43337-43339
       Merged /branches/tt_1449/tools/util/parrot-config.pir:r44021-44101
       Merged /branches/removing_stm/tools/util/parrot-config.pir:r35464-35502
       Merged /branches/tt1452_configure_debug/tools/util/parrot-config.pir:r47168-47317
       Merged /branches/assert_args/tools/util/parrot-config.pir:r34776-34857
       Merged /branches/io_rewiring/tools/util/parrot-config.pir:r39195-39460
       Merged /branches/pmc_sans_unionval/tools/util/parrot-config.pir:r40531-40725
       Merged /branches/bsr_jsr_ret/tools/util/parrot-config.pir:r40212-40267
       Merged /branches/one_make/tools/util/parrot-config.pir:r43277-43591
       Merged /branches/runcore_purge/tools/util/parrot-config.pir:r45837-45948
       Merged /branches/jit_h_files/tools/util/parrot-config.pir:r34166-35215
       Merged /branches/ops_massacre/tools/util/parrot-config.pir:r46812-47047
       Merged /branches/pbc_frozen_strings1/tools/util/parrot-config.pir:r46081-46225
       Merged /branches/tt362/tools/util/parrot-config.pir:r43955-44212
       Merged /branches/tt528_vtinit/tools/util/parrot-config.pir:r38444-38470
       Merged /branches/ucs4_encoding/tools/util/parrot-config.pir:r46803-46997
       Merged /branches/cfunctionsdocs/tools/util/parrot-config.pir:r47551-47916
       Merged /branches/pmc_freeze_cleanup/tools/util/parrot-config.pir:r43031-43433
       Merged /branches/hash_faster/tools/util/parrot-config.pir:r47841-47862
       Merged /branches/remove-next_for_GC/tools/util/parrot-config.pir:r41487-41507
       Merged /branches/configtests/tools/util/parrot-config.pir:r42236-42574
       Merged /branches/auto_frames_refactor/tools/util/parrot-config.pir:r41426-41455
       Merged /branches/tt_696/tools/util/parrot-config.pir:r39055-39086
       Merged /branches/vtable_massacre/tools/util/parrot-config.pir:r43827-43920
       Merged /branches/op_pmcs/tools/util/parrot-config.pir:r43820-44044
       Merged /branches/no_pmc_install/tools/util/parrot-config.pir:r45100-45105
       Merged /branches/RELEASE_1_3_0/tools/util/parrot-config.pir:r39592-39598
       Merged /branches/auto_format_no_Config/tools/util/parrot-config.pir:r42352-42410
       Merged /branches/stringnull/tools/util/parrot-config.pir:r45492-45618
       Merged /branches/RELEASE_0_8_2/tools/util/parrot-config.pir:r34004-34020
       Merged /branches/no_running_make_test/tools/util/parrot-config.pir:r43474-43545
       Merged /branches/gc_internals/tools/util/parrot-config.pir:r39002-39024
       Merged /branches/tt1726_pmc_pod/tools/util/parrot-config.pir:r48343-48374
       Merged /branches/opengl_dynamic_nci/tools/util/parrot-config.pir:r43840-44139
       Merged /branches/tt1393_retcon/tools/util/parrot-config.pir:r43652-43720
       Merged /branches/convert_OSNAME/tools/util/parrot-config.pir:r42258-42340
       Merged /branches/gc_api/tools/util/parrot-config.pir:r38521-38653
       Merged /branches/platform_determine_earlier/tools/util/parrot-config.pir:r42413-42432
       Merged /branches/library_files/tools/util/parrot-config.pir:r41458-41848
       Merged /branches/parrot_call_dep/tools/util/parrot-config.pir:r44134-44188
    Added: svn:eol-style
       + native
    Added: svn:executable
       + ON
    
     
    8585            $self->new_item( '', 'tools/dev/list_unjitted.pl' ), 
    8686            $self->new_item( '', 'tools/dev/gen_class.pl' ), 
    8787            $self->new_item( '', 'tools/dev/nm.pl' ), 
    88             $self->new_item( '', 'tools/util/ncidef2pasm.pl' ), 
     88            $self->new_item( '', 'tools/dev/ncidef2pasm.pl' ), 
    8989            $self->new_item( '', 'tools/dev/pbc_header.pl' ), 
    9090        ), 
    9191        $self->new_group( 
  • MANIFEST

     
    11# ex: set ro: 
    22# $Id$ 
    33# 
    4 # generated by tools/dev/mk_manifest_and_skip.pl Tue Aug 24 15:05:33 2010 UT 
     4# generated by tools/dev/mk_manifest_and_skip.pl Tue Aug 24 23:10:21 2010 UT 
    55# 
    66# See below for documentation on the format of this file. 
    77# 
     
    20902090t/tools/pmc2cutils/08-pmc-pm.t                              [test] 
    20912091t/tools/pmc2cutils/README                                   []doc 
    20922092t/tools/testdata                                            [test] 
    2093 tools/build/addopstags.pl                                   [] 
     2093tools/build/README                                          []doc 
    20942094tools/build/c2str.pl                                        [] 
    20952095tools/build/fixup_gen_file.pl                               [] 
    20962096tools/build/h2inc.pl                                        [] 
    2097 tools/build/headerizer.pl                                   [] 
    20982097tools/build/ops2c.pl                                        [devel] 
    20992098tools/build/parrot_config_c.pl                              [] 
    21002099tools/build/pbcversion_h.pl                                 [] 
     
    21022101tools/build/vtable_extend.pl                                [] 
    21032102tools/build/vtable_h.pl                                     [] 
    21042103tools/dev/.gdbinit                                          [] 
     2104tools/dev/README                                            []doc 
     2105tools/dev/addopstags.pl                                     [] 
    21052106tools/dev/as2c.pl                                           [] 
    21062107tools/dev/bench_op.pir                                      [] 
    21072108tools/dev/branch_status.pl                                  [] 
    21082109tools/dev/checkdepend.pl                                    [] 
    21092110tools/dev/create_language.pl                                [devel] 
    21102111tools/dev/debian_docs.sh                                    [] 
     2112tools/dev/dump_pbc.pl                                       [] 
    21112113tools/dev/faces.pl                                          [] 
    21122114tools/dev/fetch_languages.pl                                [] 
    21132115tools/dev/gen_charset_tables.pl                             [] 
    21142116tools/dev/gen_class.pl                                      [] 
    21152117tools/dev/gen_makefile.pl                                   [devel] 
    21162118tools/dev/gen_valgrind_suppressions.pl                      [] 
     2119tools/dev/headerizer.pl                                     [] 
    21172120tools/dev/install_dev_files.pl                              [] 
    21182121tools/dev/install_doc_files.pl                              [] 
    21192122tools/dev/install_files.pl                                  [] 
     
    21312134tools/dev/mk_rpm_manifests.pl                               [] 
    21322135tools/dev/nci_test_gen.pl                                   [] 
    21332136tools/dev/nci_thunk_gen.pir                                 [] 
     2137tools/dev/ncidef2pasm.pl                                    [] 
    21342138tools/dev/nm.pl                                             [] 
    21352139tools/dev/nopaste.pl                                        [] 
    21362140tools/dev/ops_not_tested.pl                                 [] 
     2141tools/dev/parrot-config.pir                                 [] 
    21372142tools/dev/parrot-fuzzer                                     [] 
    21382143tools/dev/parrot.supp                                       [] 
    21392144tools/dev/parrot_api.pl                                     [] 
     
    21422147tools/dev/parrotbench.pl                                    [] 
    21432148tools/dev/pbc_header.pl                                     [] 
    21442149tools/dev/pbc_to_exe.pir                                    [devel] 
     2150tools/dev/perlcritic-cage.conf                              [] 
     2151tools/dev/perlcritic.conf                                   [] 
     2152tools/dev/perltidy.conf                                     [] 
     2153tools/dev/pgegrep                                           [] 
    21452154tools/dev/pmcrenumber.pl                                    [] 
    21462155tools/dev/pmctree.pl                                        [] 
    21472156tools/dev/pprof2cg.pl                                       [devel] 
     
    21492158tools/dev/search-ops.pl                                     [] 
    21502159tools/dev/svnclobber.pl                                     [] 
    21512160tools/dev/symlink.pl                                        [] 
     2161tools/dev/update_copyright.pl                               [] 
    21522162tools/dev/vgp                                               [] 
    21532163tools/dev/vgp_darwin                                        [] 
    21542164tools/dev/vms-patch                                         [] 
     
    21592169tools/docs/write_docs.pl                                    [] 
    21602170tools/install/smoke.pl                                      [] 
    21612171tools/install/smoke_languages.pl                            [] 
    2162 tools/util/crow.pir                                         [] 
    2163 tools/util/dump_pbc.pl                                      [] 
    2164 tools/util/gen_release_info.pl                              [] 
    2165 tools/util/inc_ver.pir                                      [] 
    2166 tools/util/ncidef2pasm.pl                                   [] 
    2167 tools/util/parrot-config.pir                                [] 
    2168 tools/util/perlcritic-cage.conf                             [] 
    2169 tools/util/perlcritic.conf                                  [] 
    2170 tools/util/perltidy.conf                                    [] 
    2171 tools/util/pgegrep                                          [] 
    2172 tools/util/release.json                                     [] 
    2173 tools/util/templates.json                                   [] 
    2174 tools/util/update_copyright.pl                              [] 
     2172tools/release/README                                        []doc 
     2173tools/release/crow.pir                                      [] 
     2174tools/release/gen_release_info.pl                           [] 
     2175tools/release/inc_ver.pir                                   [] 
     2176tools/release/release.json                                  [] 
     2177tools/release/templates.json                                [] 
    21752178# Local variables: 
    21762179#   mode: text 
    21772180#   buffer-read-only: t 
  • ports/debian/rules

     
    4242        dh_testdir 
    4343        $(MAKE) installable LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}`pwd`/blib/lib 
    4444        pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" docs/running.pod debian/parrot.1 
    45         pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" tools/util/parrot-config.pir debian/parrot_config.1 
     45        pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" tools/dev/parrot-config.pir debian/parrot_config.1 
    4646        pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_dump.c debian/pbc_dump.1 
    4747        pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_disassemble.c debian/pbc_disassemble.1 
    4848        pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/parrot_debugger.c debian/parrot_debugger.1 
  • t/tools/dump_pbc.t

     
    44 
    55=head1 NAME 
    66 
    7 t/tools/dumb_pbc.t - test the script tools/utils/dump_pbc.pl 
     7t/tools/dumb_pbc.t - test the script tools/dev/dump_pbc.pl 
    88 
    99=head1 SYNOPSIS 
    1010 
     
    3434 
    3535    my $PARROT   = ".$PConfig{slash}$PConfig{test_prog}"; 
    3636    system( "$PARROT --output $pbc_fn $pir_fn" ); 
    37     my $cmd = File::Spec->catfile( qw{. tools util dump_pbc.pl} ); 
     37    my $cmd = File::Spec->catfile( qw{. tools dev dump_pbc.pl} ); 
    3838    my $out = `$PConfig{perl} $cmd $pbc_fn`; 
    3939 
    4040    like( $out, $snippet, $desc ); 
  • t/tools/pgegrep.t

     
    44 
    55=head1 NAME 
    66 
    7 t/tools/pgegrep.t - test the script tools/utils/pgegrep 
     7t/tools/pgegrep.t - test the script tools/dev/pgegrep 
    88 
    99=head1 SYNOPSIS 
    1010 
     
    3434    my ($options, $snippet, $desc)  = @_; 
    3535 
    3636    my $PARROT  = ".$PConfig{slash}$PConfig{test_prog}"; 
    37     my $pgegrep = File::Spec->catfile( qw{. tools util pgegrep} ); 
     37    my $pgegrep = File::Spec->catfile( qw{. tools dev pgegrep} ); 
    3838    my $out     = `$PARROT $pgegrep $options`; 
    3939 
    4040    like( $out, $snippet, $desc ); 
  • t/codingstd/perlcritic.t

     
    2222violations. 
    2323 
    2424This test uses a standard perlcriticrc file, located in 
    25 F<tools/utils/perlcritic.conf> 
     25F<tools/dev/perlcritic.conf> 
    2626 
    2727If you wish to run a specific policy, the easiest way to do so is to 
    2828temporarily add a custom theme to the configuration file and then specify 
     
    6262    'theme=s'   => \$theme 
    6363); 
    6464 
    65 my $config = File::Spec->catfile( $PConfig{build_dir}, qw{tools util perlcritic.conf} ); 
     65my $config = File::Spec->catfile( $PConfig{build_dir}, qw{tools dev perlcritic.conf} ); 
    6666 
    6767Test::Perl::Critic->import( 
    6868    -profile => $config, 
  • config/gen/makefiles/root.in

     
    4747# where we're building parrot from (needed for pbc_to_exe) 
    4848BUILD_DIR = @build_dir@ 
    4949 
    50 # directory for build tools 
     50# directory for build tools: 
     51# programs, templates, configuration files invoked by 'make all' 
     52# (with or without command-line options) 
    5153BUILD_TOOLS_DIR = tools/build 
     54# directory for developers' tools 
     55# programs, templates, configuration files NOT invoked by 'make all' 
     56DEV_TOOLS_DIR = tools/dev 
    5257 
    5358# directory for header files 
    5459INC_DIR         = @inc@ 
     
    116121NONGEN_HEADERS   = @TEMP_nongen_headers@ 
    117122 
    118123# The headerizer 
    119 HEADERIZER       = $(PERL) $(BUILD_TOOLS_DIR)/headerizer.pl 
     124HEADERIZER       = $(PERL) $(DEV_TOOLS_DIR)/headerizer.pl 
    120125 
    121126include src/dynpmc/Defines.mak 
    122127include src/dynoplibs/Defines.mak 
     
    841846        @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC) 
    842847#IF(win32):     if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 
    843848 
    844 $(PBC_TO_EXE) : tools/dev/pbc_to_exe.pir runtime/parrot/library/config.pir $(PARROT) $(DYNEXT_DIR)/os$(LOAD_EXT) $(DYNEXT_DIR)/file$(LOAD_EXT) 
    845         $(PARROT) -o pbc_to_exe.pbc tools/dev/pbc_to_exe.pir 
     849$(PBC_TO_EXE) : $(DEV_TOOLS_DIR)/pbc_to_exe.pir runtime/parrot/library/config.pir $(PARROT) $(DYNEXT_DIR)/os$(LOAD_EXT) $(DYNEXT_DIR)/file$(LOAD_EXT) 
     850        $(PARROT) -o pbc_to_exe.pbc $(DEV_TOOLS_DIR)/pbc_to_exe.pir 
    846851        $(PARROT) pbc_to_exe.pbc pbc_to_exe.pbc 
    847852 
    848 parrot_nci_thunk_gen.pbc : tools/dev/nci_thunk_gen.pir $(DATA_JSON_LIB_PBCS) $(PARROT) 
    849         $(PARROT) -o parrot_nci_thunk_gen.pbc tools/dev/nci_thunk_gen.pir 
     853parrot_nci_thunk_gen.pbc : $(DEV_TOOLS_DIR)/nci_thunk_gen.pir $(DATA_JSON_LIB_PBCS) $(PARROT) 
     854        $(PARROT) -o parrot_nci_thunk_gen.pbc $(DEV_TOOLS_DIR)/nci_thunk_gen.pir 
    850855 
    851856$(NCI_THUNK_GEN) : parrot_nci_thunk_gen.pbc $(PBC_TO_EXE) 
    852857        $(PBC_TO_EXE) parrot_nci_thunk_gen.pbc 
     
    857862$(PROVE) : parrot-prove.pbc $(PARROT) $(PBC_TO_EXE) 
    858863        $(PBC_TO_EXE) parrot-prove.pbc 
    859864 
    860 $(PARROT_CONFIG) : tools/util/parrot-config.pir $(PARROT) $(PBC_TO_EXE) 
    861         $(PARROT) -o parrot_config.pbc tools/util/parrot-config.pir 
     865$(PARROT_CONFIG) : $(DEV_TOOLS_DIR)/parrot-config.pir $(PARROT) $(PBC_TO_EXE) 
     866        $(PARROT) -o parrot_config.pbc $(DEV_TOOLS_DIR)/parrot-config.pir 
    862867        $(PARROT) pbc_to_exe.pbc parrot_config.pbc 
    863868 
    864869$(MINIPARROT) : src/main$(O) $(GEN_HEADERS) $(LIBPARROT) \ 
     
    935940    $(IMCC_O_FILES) 
    936941 
    937942lib_deps_object : $(O_FILES) 
    938         $(PERL) tools/dev/lib_deps.pl object $(O_FILES) 
     943        $(PERL) $(DEV_TOOLS_DIR)/lib_deps.pl object $(O_FILES) 
    939944 
    940945lib_deps_source : $(GENERAL_H_FILES) 
    941         $(PERL) tools/dev/lib_deps.pl source all_source 
     946        $(PERL) $(DEV_TOOLS_DIR)/lib_deps.pl source all_source 
    942947 
    943948lib_deps : lib_deps_object lib_deps_source 
    944949 
     
    968973 
    969974 
    970975$(INSTALLABLECONFIG) : src/install_config$(O) $(PARROT_CONFIG) $(PBC_TO_EXE) 
    971         $(PARROT) -o parrot_config.pbc tools/util/parrot-config.pir 
     976        $(PARROT) -o parrot_config.pbc $(DEV_TOOLS_DIR)/parrot-config.pir 
    972977        $(PBC_TO_EXE) parrot_config.pbc --install 
    973978 
    974979$(INSTALLABLEPBCTOEXE) : $(PBC_TO_EXE) src/install_config$(O) 
     
    19962001# Require .svn to exist first 
    19972002# Otherwise it'll remove every last file 
    19982003svnclobber : .svn 
    1999         $(PERL) tools/dev/svnclobber.pl 
     2004        $(PERL) $(DEV_TOOLS_DIR)/svnclobber.pl 
    20002005 
    20012006reconfig : realclean 
    20022007        $(PERL) Configure.pl $(CONFIG_ARGS) 
    20032008 
    20042009manitest : 
    2005         $(PERL) tools/dev/manicheck.pl 
     2010        $(PERL) $(DEV_TOOLS_DIR)/manicheck.pl 
    20062011 
    20072012opsrenumber : 
    2008         $(PERL) tools/dev/opsrenumber.pl $(OPS_FILES) 
     2013        $(PERL) $(DEV_TOOLS_DIR)/opsrenumber.pl $(OPS_FILES) 
    20092014 
    20102015pmcrenumber : 
    2011         $(PERL) tools/dev/pmcrenumber.pl src/pmc/pmc.num 
     2016        $(PERL) $(DEV_TOOLS_DIR)/pmcrenumber.pl src/pmc/pmc.num 
    20122017 
    20132018############################################################################### 
    20142019# 
     
    23602365install-dev: install 
    23612366 
    23622367install-bin: installable 
    2363         $(PERL) tools/dev/install_files.pl \ 
     2368        $(PERL) $(DEV_TOOLS_DIR)/install_files.pl \ 
    23642369    --buildprefix=$(BUILDPREFIX) \ 
    23652370    --prefix=$(PREFIX) \ 
    23662371    --exec-prefix=$(EXEC_PREFIX) \ 
     
    23742379    MANIFEST MANIFEST.generated 
    23752380 
    23762381install-dev-only: installable 
    2377         $(PERL) tools/dev/install_dev_files.pl \ 
     2382        $(PERL) $(DEV_TOOLS_DIR)/install_dev_files.pl \ 
    23782383    --buildprefix=$(BUILDPREFIX) \ 
    23792384    --prefix=$(PREFIX) \ 
    23802385    --exec-prefix=$(EXEC_PREFIX) \ 
     
    23892394    MANIFEST MANIFEST.generated 
    23902395 
    23912396install-doc: 
    2392         $(PERL) tools/dev/install_doc_files.pl \ 
     2397        $(PERL) $(DEV_TOOLS_DIR)/install_doc_files.pl \ 
    23932398    --buildprefix=$(BUILDPREFIX) \ 
    23942399    --prefix=$(PREFIX) \ 
    23952400    --docdir=$(DOC_DIR) \ 
     
    24182423        rm parrot-$(VERSION) 
    24192424 
    24202425win32-inno-installer : world installable 
    2421         $(PERL) tools/dev/mk_inno.pl 
     2426        $(PERL) $(DEV_TOOLS_DIR)/mk_inno.pl 
    24222427        $(INNO_SETUP) parrot.iss 
    24232428 
    24242429############################################################################### 
     
    25122517        --languages=c,perl --langmap=c:+.h,c:+.pmc,c:+.ops \ 
    25132518        -I NOTNULL,NULLOK,ARGIN,ARGMOD,ARGOUT,ARGINOUT,ARGIN_NULLOK,ARGOUT_NULLOK,ARGMOD_NULLOK,ARGFREE,ARGFREE_NOTNULL \ 
    25142519        . 
    2515         $(PERL) $(BUILD_TOOLS_DIR)/addopstags.pl $(OPS_FILES) 
     2520        $(PERL) $(DEV_TOOLS_DIR)/addopstags.pl $(OPS_FILES) 
    25162521 
    25172522tags.vi.dummy: 
    25182523 
     
    25242529CRITIC_FILES = 'lib/Parrot' 
    25252530 
    25262531perlcritic: 
    2527         perlcritic --profile tools/util/perlcritic.conf $(CRITIC_FILES) 
     2532        perlcritic --profile $(DEV_TOOLS_DIR)/perlcritic.conf $(CRITIC_FILES) 
    25282533 
    25292534# Andy's extra-cranky Perl::Critic checking for cage cleaners 
    25302535cagecritic: 
    25312536        @perl -MPerl::Critic::Bangs -e'$$min=q{1.04};die qq{You need Bangs $$min} unless $$Perl::Critic::Bangs::VERSION ge $$min' 
    2532         perlcritic -1 --profile tools/util/perlcritic-cage.conf $(CRITIC_FILES) 
     2537        perlcritic -1 --profile $(DEV_TOOLS_DIR)/perlcritic-cage.conf $(CRITIC_FILES) 
    25332538 
    25342539# This target will eventually create all the headers automatically.  If you 
    25352540# are having problems with linkage in Win32 (or elsewhere), because something