
v6.pm hacking how-to



V6DUMPAST=1 - tells the code emitter to dump the syntax tree to STDOUT before processing
PERL6LIB=dir;dir - same usage as PERL5LIB

Source file -> Parser -> Emitter -> Execute
There is currently no intermediate AST processing phase - the match capture is sent directly to the emitter.

perl -Ilib lib/v6.pm --compile-only ' say 42 '

subclasses Pugs::Compiler::Rule to implement the "perl 6 compiler"

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/*

lib/Pugs/Emitter/Perl6/Perl5.pm

lib/Pugs/Runtime/Perl6.pm
lib/Pugs/Runtime/Perl6Prelude.pm

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 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.