
Parrot::H2inc - Subroutines used in tools/build/h2inc.pl

This package exports on demand only four subroutines used in tools/build/h2inc.pl.

parse_file()$directive = parse_file($in_file, $out_file);
List of 2 elements: string holding name of incoming file; string holding name of outgoing file.
If successful, returns a hash reference.
perform_directive()$defs_ref = perform_directive($directive);
Single hash reference (which is the return value from a successful run of parse_file().
Array reference.
const_to_parrot()$gen = join "\n", const_to_parrot(@defs);
List.
String.
const_to_perl()$gen = join "\n", const_to_perl(@defs);
List.
String.
transform_name() transform_name( sub { $prefix . $_[0] }, @_ );
List of two or more elements, the first element of which is a subroutine reference.
List which is a mapping of the transformations executed by the first argument upon the remaining arguments.
prepend_prefix() @defs = prepend_prefix $d->{prefix}, @{ $d->{defs} };
List of two or more elements, the first element of which is a string.
List.
generate_text()$generated_text = generate_text($directive, \@defs);
List of two arguments: Directive hashref; reference to array of definitions.
String holding main text to be printed to new file.
print_generated_file() print_generated_file( {
in => $in_file,
out => $out_file,
script => $0,
gen => $generated_text,
} );
Hash reference. Elements pertain to file being read, file being created, calling program (typically, tools/build/h2inc.pl) and string of text to be printed to file.
Implicitly returns true upon success.