NAME
Clownfish::Binding::Core - Generate core C code for a Clownfish::Hierarchy.
SYNOPSIS
my $hierarchy = Clownfish::Hierarchy->new(
source => '/path/to/clownfish/files',
dest => 'autogen',
);
$hierarchy->build;
my $core_binding = Clownfish::Binding::Core->new(
hierarchy => $hierarchy,
dest => 'autogen',
header => "/* Auto-generated file. */\n",
footer => $copyfoot,
);
my $modified = $core_binding->write_all_modified($modified);
DESCRIPTION
A Clownfish::Hierarchy describes an abstract specifiction for a class hierarchy; Clownfish::Binding::Core is responsible for auto-generating C code which implements that specification.
METHODS
new
my $binding = Clownfish::Binding::Core->new(
hierarchy => $hierarchy, # required
dest => '/path/to/autogen', # required
header => $header, # required
footer => $footer, # required
);
hierarchy - A Clownfish::Hierarchy.
dest - The directory where C output files will be written.
header - Text which will be prepended to each generated C file -- typically, an "autogenerated file" warning.
footer - Text to be appended to the end of each generated C file -- typically copyright information.
write_all_modified
Call $hierarchy->propagate_modified
to establish which classes do not have up-to-date generated .c and .h files, then traverse the hierarchy writing all necessary files.
COPYRIGHT AND LICENSE
Copyright 2008-2011 Marvin Humphrey
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.