NAME ^

Parrot::Pmc2c::PMCEmitter - PMC to C Code Generation

SYNOPSIS ^

    use Parrot::Pmc2c::PMCEmitter;

DESCRIPTION ^

Parrot::Pmc2c::PMCEmitter is used by tools/build/pmc2c.pl to generate C code from PMC files.

Functions ^

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.

TODO include MMD variants.

Instance Methods ^

init()

Initializes the instance.

gen_includes()

Returns the C #include for the header file of each of the PMC's superclasses.

proto($type,$parameters)

Determines the prototype (argument signature) for a method body (see src/call_list).

gen_methods()

Returns the C code for the pmc methods.

gen_attributes()

Returns the C code for the attribute struct definition.

find_mmd_methods()

Returns three values:

The first is an arrayref of <[ mmd_number, left, right, implementation_func]> suitable for initializing the MMD list.

The second is a arrayref listing dynamic PMCs which will need to be looked up.

The third is a list of [index, dynamic PMC] pairs of right entries in the MMD table that will need to be resolved at runtime.

vtable_decl($name)

Returns the C code for the declaration of a vtable temporary named $name with the functions for this class.

init_func()

Returns the C code for the PMC's initialization method, or an empty string if the PMC has a no_init flag.


parrot