The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

pmc2c.pl - PMC compiler

SYNOPSIS

perl pmc2c.pl foo.pmc

DESCRIPTION

Compile the PMC file listed on the command line, producing a corresponding .c file.

PMC FILE SYNTAX

The basic syntax of a PMC file is

  1. A preamble, consisting of code to be copied directly to the .c file

  2. pmclass PMCNAME [extends PMCNAME] {

  3. A list of vtable method implementations

  4. The final close }

METHOD BODY SUBSTITUTIONS

The vtable method bodies can use the following substitutions:

  • SELF - Converted to the current PMC object of type PMC*.

  • INTERP - Converted to the interpreter object.

  • SELF.method(a,b,c) - calls the vtable method 'method' using the static type of SELF (in other words, calls another method defined in the same file).

  • DYNSELF.method(a,b,c) - calls the vtable method 'method' using the dynamic type of SELF

  • DYNSELF(a,b,c) - same as above, but calls the current method

  • SUPER(a,b,c) - calls the overridden implementation of the current method in the nearest superclass, using the static type of SELF.

  • DYNSUPER(a,b,c) - as above, but uses the actual dynamic type of SELF.

LICENSE

This program is free software. It is subject to the same license as the Parrot interpreter.