Flávio Soibelmann Glock > v6-0.024 > HACKING

Download:
v6-0.024.tar.gz

Annotate this POD

CPAN RT

Open  1
View Bugs
Report a bug
Source   Latest Release: v6-0.032

INTRODUCTION ^

v6.pm hacking how-to

Links ^

#perl6 jargon ^

v6 Environment variables ^

v6 Compilation cycle ^

  Source file ->
  Parser -> 
  Emitter ->
  Execute

There is currently no intermediate AST processing phase - the match capture is sent directly to the emitter.

Implementing new syntax ^

  1. set the V6DUMPAST environment variable
  2. try a simple test with the new syntax:
      perl -Ilib lib/v6.pm --compile-only ' say 42 '
  3. if the syntax tree looks ok, the new syntax can be implemented in the emitter file - see the Emitter section below.
  4. in order to implement of fix syntax tree nodes, see the Parsing section for choosing which file to edit.

Source file processors ^

Parsing ^

The syntax is mostly implemented using perl 6 rules, which are provided by the Pugs::Compiler::Rule module.

A few "terms" are implemented using perl 5 modules, such as Pugs::Grammar::Precedence (called from Expression.pm), and Text::Balanced (called from Term.pm)

lib/Pugs/Grammar/*

Code Emitter ^

lib/Pugs/Emitter/Perl6/Perl5.pm

Execute (Runtime) ^

lib/Pugs/Runtime/Perl6.pm

lib/Pugs/Runtime/Perl6Prelude.pm

Writing new tests ^

For consistency, we share tests with the Haskell implementation. Instead of duplicating the tests in our tree, we copy the tests over when "perl Makefile.PL" is run. This is done by analyzing the MANIFEST to decide which files to copy.

The exceptions are when we need to modify a test script to be different, perhaps because the feature needs to be marked TODO in this implementation but not the other.

As of 07/09/06, this test suite is still in transition to this model.

COPYRIGHT ^

Copyright 2006 by Flavio Soibelmann Glock and others.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html