NAME
Parrot::Pmc2c::PMC - PMC model object
SYNOPSIS
use Parrot::Pmc2c::PMC;
DESCRIPTION
Parrot::Pmc2c::PMC
is used by tools/build/pmc2c.pl to generate C code from PMC files.
Functions
is_dynpmc
-
Determines if a given PMC type is dynamically loaded or not.
implements_vtable($method)
-
True if pmc generates code for vtable
$method
. vtable_method_does_write($method)
-
Returns true if the vtable
$method
writes our value.
inherit_attrs()
$class = inherit_attrs($class, $meth);
Purpose: Modify $attrs to inherit attrs from $super_attrs as appropriate.
Arguments: List of two arguments:
Method name.
Return Values: Reference to hash holding the data structure being built up within dump_pmc()
.
Comments: Called within gen_super_meths()
.
These are auxiliary subroutines called inside the methods described above.
dump_is_current()
dump_is_current($existing);
Purpose: Determines whether the dump of a file is newer than the PMC file. (If it's not, then the PMC file has changed and the dump has not been updated.)
Arguments: String holding filename.
Return Values: Returns true if timestamp of existing is more recent than that of PMC.
Comments: Called within dump_pmc()
.
generate_c_file()
-
Generates the C implementation file code for the PMC.
generate_h_file()
-
Generates the C header file code for the PMC.
hdecls()
-
Returns the C code function declarations for all the methods for inclusion in the PMC's C header file.
Instance Methods
init()
-
Initializes the instance.
gen_includes()
-
Returns the C
#include
for the header file of each of the PMC's superclasses. pre_method_gen
-
Generate switch-bases VTABLE for MULTI
post_method_gen
-
Generate write barriers.
gen_methods()
-
Returns the C code for the pmc methods.
gen_attributes()
-
Returns the C code for the attribute struct definition.
find_multi_functions()
-
Returns an arrayref of MULTI function names declared in the PMC. Used to initialize the multiple dispatch function list.
vtable_flags()
-
Returns C code to produce a PMC's flags.
vtable_decl($name)
-
Returns the C code for the declaration of a vtable temporary named
$name
with the functions for this class. pmc_class_init_func()
-
Returns the C code for the PMC's class_init function as a static function to be called from the exported class_init.
init_func()
-
Returns the C code for the PMC's initialization method, or an empty string if the PMC has a
no_init
flag. update_vtable_func()
-
Returns the C code for the PMC's update_vtable.
get_mro_func()
-
Returns the C code for the PMC's get_mro function.
get_isa_func()
-
Returns the C code for the PMC's get_isa function.
get_vtable_func()
-
Returns the C code for the PMC's update_vtable.
gen_switch_vtable
-
Generate switch-bases VTABLE for MULTI
generate_start
Generate and emit the C code for the start of an attribute struct.
generate_end
Generate and emit the C code for the end of an attribute struct.
generate_declaration
Generate and emit the C code for an attribute declaration.
generate_accessor
Generate and emit the C code for an attribute get/set accessor pair.