The current classes/pmc2c.pl PMC compiler has some drawbacks:
- does multiple scanning of source files
- a lot of code duplication
- no multiple PMC inheritance
- hard to hack and expand

So I started to reimplement it with a new scheme:
* parse files only once:
  A Makefile rule creates classes/foo.dump from classes/foo.pmc
  with the help of Data::Dumper[1]
* Generating foo.{c.h} uses these dumps

Dump of classes and $default (vtable.tbl) is already working.

Comments welcome
leo

[1] snipped from orderedhash.dump
$OrderedHash = {
  'flags' => {
    'need_ext' => 1,
    'does' => {
      'hash' => 1,
      'array' => 1
    },
    'extends' => {
      'PerlArray' => 1
    }
  },
  'post' => '

/*
 * Local variables:
 * c-indentation-style: bsd
 * c-basic-offset: 4
 * indent-tabs-mode: nil
 * End:
 *
 * vim: expandtab shiftwidth=4:
*/

',
  'methods' => [
    {
      'parameters' => '',
      'body' => '{
        SUPER();
        PerlHash.SUPER();
    }',
      'meth' => 'init',
      'type' => 'void',
      'line' => 32
    },
...



Reply via email to