parrotcode: PMC to C Code Generation | |
Contents | Perl Modules |
Parrot::Pmc2c - PMC to C Code Generation
use Parrot::Pmc2c;
Parrot::Pmc2c
(and the subclasses defined in this file) is used by classes/pmc2c2.pl to generate C code from PMC files.
does_write($method, $section)
count_newlines($string)
\n
) in $string
.dont_edit($pmcfile)
$pmcfile
is the name of the original source *.pmc file.gen_ret($method, $body)
return
statement, if the body is empty then make a cast if needed.class_name($self, $class)
Parrot::Pmc2c
subclass for the PMC ($self->{class}
). $self
is the hash reference passed to new()
, and $class
is Parrot::Pmc2c
.dynext_load_code($library_name, %classes)
$library_name
is the name of the dynamic library to be created.%classes
is a map from the PMC names for which code is to be generated, to dump info (PMC metadata).new($self, $opt)
$self
as a new instance.$self
is a hash reference eval
-ed from a *.dump file generated by classes/pmc2c.pl from a *.pmc file. It is bless
-ed either into Parrot::Pmc2c::::Standard
, or into one of the other special PMCs: default, delegate
, Null
, Ref
or SharedRef
.$opt
is a hash reference.line_directive($self,$line,$file)
$self-
{opt}{nolines}> is true.line_directive_here($self,$output,$file)
get_vtable_section()
init()
.make_const($class)
const_too
flag set then this method is called in init()
to to create the read-only set methods.init($class)
$class
is its class.decl($classname, $method, $for_header)
$for_header
indicates whether the code is for a header or implementation file.includes()
#include
for the header file of each of the PMC's superclasses.full_arguments($args)
INTERP, SELF
to $args
.proto($type,$parameters)
rewrite_nci_method($class, $method, $super, $super_table)
rewrite_vtable_method($class, $method, $super, $super_table)
body($method, $line, $out_name)
$line
is used to accumulate the number of lines, $out_name
is the name of the output file we are generating.methods($line, $out_name)
$line
is used to accumulate the number of lines, $out_name
is the name of the output file we are generating.lib_load_code()
pmc_is_dynpmc
init_func()
no_init
flag.gen_c($out_name)
$out_name
is the name of the output file we are generating.hdecls()
gen_h($out_name)
$out_name
is the name of the output file we are generating.implements($method)
$method
.Standard behavior.
body($method, $line, $out_name)
$line
is used to accumulate the number of lines, $out_name
is the name of the output file we are generating.Returns the C code for the method body.
body($method, $line, $out_name)
$line
is used to accumulate the number of lines, $out_name
is the name of the output file we are generating.implements($method)
body($method, $line, $out_name)
$line
is used to accumulate the number of lines, $out_name
is the name of the output file we are generating.SharedRef
is like Ref
but with locking.
implements($method)
gen_ret($type)
return
statement.body($method, $line, $out_name)
$line
is used to accumulate the number of lines, $out_name
is the name of the output file we are generating.implements($method)
body($method, $line, $out_name)
$line
is used to accumulate the number of lines, $out_name
is the name of the output file we are generating.implements($method)
body($method, $line, $out_name)
$line
is used to accumulate the number of lines, $out_name
is the name of the output file we are generating.Null
PMC throws an execption for all methods.implements($method)
trans($type)
signature()
to normalize argument types.signature($params)
$params
.gen_ret($type)
return
statement.body($method, $line, $out_name)
$line
is used to accumulate the number of lines, $out_name
is the name of the output file we are generating.delegate
PMC redirects all methods to bytecode.implements($method)
body($method, $line, $out_name)
$line
is used to accumulate the number of lines, $out_name
is the name of the output file we are generating.
|