develooper Front page | perl.cvs.parrot | Postings from May 2008

[svn:parrot] r27413 - in branches/pdd25cx: . compilers/imcc compilers/nqp/src compilers/pct/src/PAST compilers/pct/src/PCT compilers/pct/src/POST compilers/pge/PGE compilers/tge/TGE config/auto config/auto/pcre config/gen config/gen/call_list config/gen/m

From:
allison
Date:
May 10, 2008 07:13
Subject:
[svn:parrot] r27413 - in branches/pdd25cx: . compilers/imcc compilers/nqp/src compilers/pct/src/PAST compilers/pct/src/PCT compilers/pct/src/POST compilers/pge/PGE compilers/tge/TGE config/auto config/auto/pcre config/gen config/gen/call_list config/gen/m
Author: allison
Date: Sat May 10 07:12:21 2008
New Revision: 27413

Added:
   branches/pdd25cx/config/auto/pcre/
      - copied from r27411, /trunk/config/auto/pcre/
   branches/pdd25cx/config/auto/pcre.pm
      - copied unchanged from r27411, /trunk/config/auto/pcre.pm
   branches/pdd25cx/config/auto/pcre/pcre.in
      - copied unchanged from r27411, /trunk/config/auto/pcre/pcre.in
   branches/pdd25cx/config/gen/call_list/
      - copied from r27411, /trunk/config/gen/call_list/
   branches/pdd25cx/config/gen/call_list.pm
      - copied unchanged from r27411, /trunk/config/gen/call_list.pm
   branches/pdd25cx/config/gen/call_list/core.in
      - copied unchanged from r27411, /trunk/config/gen/call_list/core.in
   branches/pdd25cx/config/gen/call_list/misc.in
      - copied unchanged from r27411, /trunk/config/gen/call_list/misc.in
   branches/pdd25cx/config/gen/call_list/opengl.in
      - copied unchanged from r27411, /trunk/config/gen/call_list/opengl.in
   branches/pdd25cx/languages/cardinal/src/builtins/cmp.pir
      - copied unchanged from r27411, /trunk/languages/cardinal/src/builtins/cmp.pir
   branches/pdd25cx/languages/eclectus/src/builtins/   (props changed)
      - copied from r27411, /trunk/languages/eclectus/src/builtins/
   branches/pdd25cx/languages/eclectus/src/builtins/all.pir
      - copied unchanged from r27411, /trunk/languages/eclectus/src/builtins/all.pir
   branches/pdd25cx/languages/eclectus/t/io.pl
      - copied unchanged from r27411, /trunk/languages/eclectus/t/io.pl
   branches/pdd25cx/languages/eclectus/t/io.t
      - copied unchanged from r27411, /trunk/languages/eclectus/t/io.t
   branches/pdd25cx/languages/lua/luac2pir.pir
      - copied unchanged from r27411, /trunk/languages/lua/luac2pir.pir
   branches/pdd25cx/languages/lua/luad.pir
      - copied unchanged from r27411, /trunk/languages/lua/luad.pir
   branches/pdd25cx/languages/lua/src/build/
      - copied from r27411, /trunk/languages/lua/src/build/
   branches/pdd25cx/languages/lua/src/build/translator.pl
      - copied unchanged from r27411, /trunk/languages/lua/src/build/translator.pl
   branches/pdd25cx/languages/lua/src/lib/luabytecode.pir
      - copied unchanged from r27411, /trunk/languages/lua/src/lib/luabytecode.pir
   branches/pdd25cx/languages/lua/src/lib/luabytecode.rules
      - copied unchanged from r27411, /trunk/languages/lua/src/lib/luabytecode.rules
   branches/pdd25cx/languages/lua/src/pmc/luabytecode.pmc
      - copied unchanged from r27411, /trunk/languages/lua/src/pmc/luabytecode.pmc
   branches/pdd25cx/languages/lua/t/Parrot/Test/Luad.pm
      - copied unchanged from r27411, /trunk/languages/lua/t/Parrot/Test/Luad.pm
   branches/pdd25cx/languages/lua/t/luad.t
      - copied unchanged from r27411, /trunk/languages/lua/t/luad.t
   branches/pdd25cx/languages/perl6/src/classes/Grammar.pir
      - copied unchanged from r27411, /trunk/languages/perl6/src/classes/Grammar.pir
   branches/pdd25cx/languages/plumhead/src/common/driver_nqp.pir
      - copied unchanged from r27411, /trunk/languages/plumhead/src/common/driver_nqp.pir
   branches/pdd25cx/languages/plumhead/src/phc/past_xml_to_past_nqp.xsl
      - copied unchanged from r27411, /trunk/languages/plumhead/src/phc/past_xml_to_past_nqp.xsl
   branches/pdd25cx/t/steps/auto_pcre-01.t
      - copied unchanged from r27411, /trunk/t/steps/auto_pcre-01.t
   branches/pdd25cx/t/steps/auto_pcre-02.t
      - copied unchanged from r27411, /trunk/t/steps/auto_pcre-02.t
   branches/pdd25cx/t/steps/auto_pcre-03.t
      - copied unchanged from r27411, /trunk/t/steps/auto_pcre-03.t
   branches/pdd25cx/t/steps/gen_call_list-01.t
      - copied unchanged from r27411, /trunk/t/steps/gen_call_list-01.t
Removed:
   branches/pdd25cx/config/auto/python.pm
   branches/pdd25cx/docs/strings.pod
   branches/pdd25cx/src/call_list.txt
   branches/pdd25cx/t/steps/auto_python-01.t
Modified:
   branches/pdd25cx/   (props changed)
   branches/pdd25cx/CREDITS
   branches/pdd25cx/ChangeLog
   branches/pdd25cx/DEPRECATED.pod
   branches/pdd25cx/MANIFEST
   branches/pdd25cx/MANIFEST.SKIP
   branches/pdd25cx/MANIFEST.generated
   branches/pdd25cx/README_win32.pod
   branches/pdd25cx/compilers/imcc/pbc.c
   branches/pdd25cx/compilers/imcc/pcc.c
   branches/pdd25cx/compilers/nqp/src/Grammar.pg
   branches/pdd25cx/compilers/pct/src/PAST/Compiler.pir
   branches/pdd25cx/compilers/pct/src/PAST/Node.pir
   branches/pdd25cx/compilers/pct/src/PCT/HLLCompiler.pir
   branches/pdd25cx/compilers/pct/src/POST/Compiler.pir
   branches/pdd25cx/compilers/pct/src/POST/Node.pir
   branches/pdd25cx/compilers/pge/PGE/Exp.pir
   branches/pdd25cx/compilers/pge/PGE/OPTable.pir
   branches/pdd25cx/compilers/pge/PGE/Perl6Regex.pir
   branches/pdd25cx/compilers/tge/TGE/Parser.pg
   branches/pdd25cx/config/auto/warnings.pm
   branches/pdd25cx/config/gen/makefiles/root.in
   branches/pdd25cx/docs/art/pp001-intro.pod
   branches/pdd25cx/docs/art/pp002-pmc.pod
   branches/pdd25cx/docs/art/pp003-oop.pod
   branches/pdd25cx/docs/pdds/pdd28_strings.pod
   branches/pdd25cx/docs/project/debian_packaging_guide.pod
   branches/pdd25cx/docs/project/metacommitter_guide.pod
   branches/pdd25cx/include/parrot/stacks.h
   branches/pdd25cx/include/parrot/string.h
   branches/pdd25cx/languages/APL/src/parser/grammar.pg
   branches/pdd25cx/languages/abc/src/grammar.pg
   branches/pdd25cx/languages/cardinal/cardinal.pir
   branches/pdd25cx/languages/cardinal/config/makefiles/root.in
   branches/pdd25cx/languages/cardinal/src/builtins/say.pir
   branches/pdd25cx/languages/cardinal/src/parser/actions.pm
   branches/pdd25cx/languages/cardinal/src/parser/grammar.pg
   branches/pdd25cx/languages/cardinal/t/00-sanity.t
   branches/pdd25cx/languages/cardinal/t/01-stmts.t
   branches/pdd25cx/languages/cardinal/t/02-functions.t
   branches/pdd25cx/languages/eclectus/   (props changed)
   branches/pdd25cx/languages/eclectus/compiler.scm
   branches/pdd25cx/languages/eclectus/config/makefiles/root.in
   branches/pdd25cx/languages/eclectus/docs/eclectus.pod
   branches/pdd25cx/languages/eclectus/driver_nqp.pir
   branches/pdd25cx/languages/eclectus/t/   (props changed)
   branches/pdd25cx/languages/eclectus/t/begin.t
   branches/pdd25cx/languages/eclectus/t/binary_primitives.t
   branches/pdd25cx/languages/eclectus/t/characters.t
   branches/pdd25cx/languages/eclectus/t/conditionals.t
   branches/pdd25cx/languages/eclectus/t/empty_list.t
   branches/pdd25cx/languages/eclectus/t/local_variables.t
   branches/pdd25cx/languages/eclectus/t/pair.t
   branches/pdd25cx/languages/eclectus/t/procedures.t
   branches/pdd25cx/languages/eclectus/t/unary_primitives.t
   branches/pdd25cx/languages/eclectus/tests-driver.scm
   branches/pdd25cx/languages/lolcode/src/parser/grammar.pg
   branches/pdd25cx/languages/lua/config/makefiles/root.in
   branches/pdd25cx/languages/lua/src/lib/   (props changed)
   branches/pdd25cx/languages/lua/src/lua51.pg
   branches/pdd25cx/languages/lua/src/pmc/lua.pmc
   branches/pdd25cx/languages/perl6/ROADMAP
   branches/pdd25cx/languages/perl6/Test.pm
   branches/pdd25cx/languages/perl6/config/makefiles/root.in
   branches/pdd25cx/languages/perl6/docs/STATUS
   branches/pdd25cx/languages/perl6/perl6.pir
   branches/pdd25cx/languages/perl6/src/builtins/guts.pir
   branches/pdd25cx/languages/perl6/src/builtins/named-unary.pir
   branches/pdd25cx/languages/perl6/src/classes/Int.pir
   branches/pdd25cx/languages/perl6/src/classes/Junction.pir
   branches/pdd25cx/languages/perl6/src/classes/Num.pir
   branches/pdd25cx/languages/perl6/src/classes/Object.pir
   branches/pdd25cx/languages/perl6/src/classes/Pair.pir
   branches/pdd25cx/languages/perl6/src/classes/Str.pir
   branches/pdd25cx/languages/perl6/src/classes/Subset.pir
   branches/pdd25cx/languages/perl6/src/parser/actions.pm
   branches/pdd25cx/languages/perl6/src/parser/expression.pir
   branches/pdd25cx/languages/perl6/src/parser/grammar-oper.pg
   branches/pdd25cx/languages/perl6/src/parser/grammar.pg
   branches/pdd25cx/languages/perl6/t/01-sanity/07-defined.t
   branches/pdd25cx/languages/plumhead/   (props changed)
   branches/pdd25cx/languages/plumhead/config/makefiles/root.in
   branches/pdd25cx/languages/plumhead/src/common/builtins.pir
   branches/pdd25cx/languages/plumhead/src/common/plumhead.pir
   branches/pdd25cx/languages/plumhead/src/phc/past_xml_to_past_pir.xsl
   branches/pdd25cx/languages/punie/src/parser/grammar.pg
   branches/pdd25cx/languages/pynie/src/parser/Grammar.pg
   branches/pdd25cx/languages/tcl/README.pod
   branches/pdd25cx/languages/tcl/TODO
   branches/pdd25cx/languages/tcl/docs/hacks.pod
   branches/pdd25cx/languages/tcl/t/cmd_inline.t
   branches/pdd25cx/lib/Parrot/Configure/Options/Conf.pm
   branches/pdd25cx/lib/Parrot/Configure/Step/List.pm
   branches/pdd25cx/lib/Parrot/Docs/File.pm
   branches/pdd25cx/lib/Parrot/Docs/Section/Docs.pm
   branches/pdd25cx/lib/Parrot/Docs/Section/Languages.pm
   branches/pdd25cx/lib/Parrot/Vtable.pm
   branches/pdd25cx/ports/debian/control.in
   branches/pdd25cx/runtime/parrot/library/PGE/Perl6Grammar.pir
   branches/pdd25cx/runtime/parrot/library/pcre.pir
   branches/pdd25cx/src/dynext.c
   branches/pdd25cx/src/exceptions.c
   branches/pdd25cx/src/gc/gc_ims.c
   branches/pdd25cx/src/io/   (props changed)
   branches/pdd25cx/src/io/io.c
   branches/pdd25cx/src/jit/arm/exec_dep.c
   branches/pdd25cx/src/jit/arm/exec_dep.h
   branches/pdd25cx/src/jit/i386/exec_dep.c
   branches/pdd25cx/src/jit/i386/exec_dep.h
   branches/pdd25cx/src/jit/i386/jit_emit.h
   branches/pdd25cx/src/jit/ppc/exec_dep.c
   branches/pdd25cx/src/jit/ppc/exec_dep.h
   branches/pdd25cx/src/key.c
   branches/pdd25cx/src/oo.c
   branches/pdd25cx/src/ops/core.ops
   branches/pdd25cx/src/ops/experimental.ops
   branches/pdd25cx/src/ops/object.ops
   branches/pdd25cx/src/ops/set.ops
   branches/pdd25cx/src/packfile.c
   branches/pdd25cx/src/pbc_merge.c
   branches/pdd25cx/src/pmc/default.pmc
   branches/pdd25cx/src/pmc/env.pmc
   branches/pdd25cx/src/pmc/integer.pmc
   branches/pdd25cx/src/pmc_freeze.c
   branches/pdd25cx/src/stack_common.c
   branches/pdd25cx/src/stacks.c
   branches/pdd25cx/src/string.c
   branches/pdd25cx/t/compilers/pge/perl6regex/rx_captures
   branches/pdd25cx/t/compilers/pge/perl6regex/rx_subrules
   branches/pdd25cx/t/compilers/pge/pge.t
   branches/pdd25cx/t/compilers/pge/pge_util.t
   branches/pdd25cx/t/pmc/namespace.t
   branches/pdd25cx/tools/dev/mk_language_shell.pl

Log:
[pdd25cx] Bringing the pdd25cx branch up-to-date with trunk r27411.


Modified: branches/pdd25cx/CREDITS
==============================================================================
--- branches/pdd25cx/CREDITS	(original)
+++ branches/pdd25cx/CREDITS	Sat May 10 07:12:21 2008
@@ -340,9 +340,9 @@
 
 N: Jonathan Worthington
 D: Bits of Win32 support, PBC utilities, debug segment work, .Net
-D: to PIR translator and various patches
-E: jonathan@jwcs.net
-W: http://www.jwcs.net/~jonathan/
+D: to PIR translator, some Rakudo stuff and various other patches
+E: jnthn@jnthn.net
+W: http://www.jnthn.net/
 
 N: Jos Visser
 D: fortytwo opcode
@@ -650,6 +650,10 @@
 
 N: Zach Lipton
 
+N: Zach Morgan
+E: zpmorgan@gmail.com
+D: Rakudo patch
+
 N: Norman Nunley
 D: Shaving a Ponie
 E: nnunley@gmail.com

Modified: branches/pdd25cx/ChangeLog
==============================================================================
--- branches/pdd25cx/ChangeLog	(original)
+++ branches/pdd25cx/ChangeLog	Sat May 10 07:12:21 2008
@@ -1,6 +1,6 @@
 #1 $Id$
 
-2008.04.15    particle<F2>
+2008.04.15    particle
 	* Released 0.6.1
 	See NEWS for more.
 

Modified: branches/pdd25cx/DEPRECATED.pod
==============================================================================
--- branches/pdd25cx/DEPRECATED.pod	(original)
+++ branches/pdd25cx/DEPRECATED.pod	Sat May 10 07:12:21 2008
@@ -102,7 +102,36 @@
 =item * Keyed access to exception attributes [post 0.5.1]
 
 See RT #48012. Attributes on exception objects will no longer be accessible
-by integer or string key, use C<getattribute> and C<setattribute> instead.
+by integer key, use C<getattribute> and C<setattribute> instead.
+
+=item * 'push_exception' function [post 0.6.2]
+
+Is deprecated, replaced by C<Parrot_cx_add_handler> (a method call to
+C<add_handler> on the concurrency scheduler object).
+
+=item * 'pop_exception' function [post 0.6.2]
+
+Is deprecated, replaced by C<Parrot_cx_delete_handler_typed> (a method call to
+C<delete_handler> on the concurrency scheduler object).
+
+=item * 'count_exception_handlers' function [post 0.6.2]
+
+Is deprecated, replaced by C<Parrot_cx_count_handlers_typed> (a method call to
+C<count_handlers> on the concurrency scheduler object).
+
+=item * 'get_exception_handler' function and 'get_eh' opcode [post 0.6.2]
+
+Are deprecated, exception handler lookup by index is no longer supported.
+
+=item * 'get_all_exception_handlers' function and 'get_all_eh' opcode [post 0.6.2]
+
+Are deprecated, access to the exception handler list should be performed
+through the concurrency scheduler.
+
+=item * 'throwcc' opcode [post 0.6.2]
+
+Is deprecated, replaced by the C<throw> opcode (the single argument form of
+'throwcc' was already identical to 'throw').
 
 =back
 
@@ -147,6 +176,34 @@
 
 =head1 Parrot Compiler tools
 
-Currently there are no deprecations.
+=head2 Parser Grammar Engine (PGE)
+
+=over 4
+
+=item Non-capturing C<< <?foo> >> is now C<< <.foo> >>
+
+(See RT#53834)
+
+Synopsis 5 changes the syntax for non-capturing subrules from
+C<< <?foo> >> to C<< <.foo> >>.  According to S05, the
+C<< <?foo> >> syntax is now used to indicate a zero-width
+assertion.  So, grammars that have been using C<< <?foo> >>
+for non-capturing subrules need to convert to the new syntax.
+
+PGE will continue to support the non-capture interpretation
+of C<< <?foo> >> until the May 2008 release, after which it
+will be removed.
+
+=item Change argument handling of C<< <foo: text> >>
+
+Synopsis 5 changes the handling of arguments after a colon
+in subrule invocations so that  C<< <foo: text> >> must
+now be written as C<< <foo: 'text'> >>.
+
+For the foreseeable future PGE will support both syntaxes,
+but the obsolete C<< <foo: text> >> syntax may disappear
+at any time after June 2008.
+
+=back
 
 =cut

Modified: branches/pdd25cx/MANIFEST
==============================================================================
--- branches/pdd25cx/MANIFEST	(original)
+++ branches/pdd25cx/MANIFEST	Sat May 10 07:12:21 2008
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Sat Apr 26 09:15:04 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu May  8 17:01:54 2008 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -271,9 +271,10 @@
 config/auto/opengl/opengl.in                                []
 config/auto/ops.pm                                          []
 config/auto/pack.pm                                         []
+config/auto/pcre.pm                                         []
+config/auto/pcre/pcre.in                                    []
 config/auto/perldoc.pm                                      []
 config/auto/pmc.pm                                          []
-config/auto/python.pm                                       []
 config/auto/readline.pm                                     []
 config/auto/readline/readline.in                            []
 config/auto/revision.pm                                     []
@@ -291,6 +292,10 @@
 config/auto/va_ptr/test_c.in                                []
 config/auto/warnings.pm                                     []
 config/auto/warnings/test_c.in                              []
+config/gen/call_list.pm                                     []
+config/gen/call_list/core.in                                []
+config/gen/call_list/misc.in                                []
+config/gen/call_list/opengl.in                              []
 config/gen/config_h.pm                                      []
 config/gen/config_h/config_h.in                             []
 config/gen/config_h/feature_h.in                            []
@@ -517,7 +522,6 @@
 docs/stm/internals.pod                                      [main]doc
 docs/stm/stm_frontend.pod                                   [main]doc
 docs/stm/thread-issues.pod                                  [main]doc
-docs/strings.pod                                            [main]doc
 docs/submissions.pod                                        [main]doc
 docs/tests.pod                                              [main]doc
 docs/vtables.pod                                            [main]doc
@@ -1169,6 +1173,7 @@
 languages/c99/t/spi.t                                       [c99]
 languages/cardinal/cardinal.pir                             [cardinal]
 languages/cardinal/config/makefiles/root.in                 [cardinal]
+languages/cardinal/src/builtins/cmp.pir                     [cardinal]
 languages/cardinal/src/builtins/say.pir                     [cardinal]
 languages/cardinal/src/parser/actions.pm                    [cardinal]
 languages/cardinal/src/parser/grammar.pg                    [cardinal]
@@ -1330,6 +1335,7 @@
 languages/eclectus/riaxpander/synrules.scm                  [eclectus]
 languages/eclectus/riaxpander/taxonomy.scm                  [eclectus]
 languages/eclectus/riaxpander/transform.scm                 [eclectus]
+languages/eclectus/src/builtins/all.pir                     [eclectus]
 languages/eclectus/src/pmc/eclectusboolean.pmc              [eclectus]
 languages/eclectus/src/pmc/eclectuscharacter.pmc            [eclectus]
 languages/eclectus/src/pmc/eclectusemptylist.pmc            [eclectus]
@@ -1354,6 +1360,8 @@
 languages/eclectus/t/harness                                [eclectus]
 languages/eclectus/t/integers.pl                            [eclectus]
 languages/eclectus/t/integers.t                             [eclectus]
+languages/eclectus/t/io.pl                                  [eclectus]
+languages/eclectus/t/io.t                                   [eclectus]
 languages/eclectus/t/learning_scheme.pl                     [eclectus]
 languages/eclectus/t/learning_scheme.t                      [eclectus]
 languages/eclectus/t/local_variables.pl                     [eclectus]
@@ -1571,9 +1579,12 @@
 languages/lua/doc/status.pod                                [lua]
 languages/lua/lua.pir                                       [lua]
 languages/lua/luac.pl                                       [lua]
+languages/lua/luac2pir.pir                                  [lua]
+languages/lua/luad.pir                                      [lua]
 languages/lua/luap.pir                                      [lua]
 languages/lua/src/PASTGrammar.tg                            [lua]
 languages/lua/src/POSTGrammar.tg                            [lua]
+languages/lua/src/build/translator.pl                       [lua]
 languages/lua/src/dumplex.tg                                [lua]
 languages/lua/src/grammar51.pir                             [lua]
 languages/lua/src/lib/alarm.pir                             [lua]
@@ -1583,6 +1594,8 @@
 languages/lua/src/lib/lfs.pir                               [lua]
 languages/lua/src/lib/luaaux.pir                            [lua]
 languages/lua/src/lib/luabasic.pir                          [lua]
+languages/lua/src/lib/luabytecode.pir                       [lua]
+languages/lua/src/lib/luabytecode.rules                     [lua]
 languages/lua/src/lib/luacoroutine.pir                      [lua]
 languages/lua/src/lib/luadebug.pir                          [lua]
 languages/lua/src/lib/luafile.pir                           [lua]
@@ -1606,6 +1619,7 @@
 languages/lua/src/pmc/lua_private.h                         [lua]
 languages/lua/src/pmc/luaany.pmc                            [lua]
 languages/lua/src/pmc/luaboolean.pmc                        [lua]
+languages/lua/src/pmc/luabytecode.pmc                       [lua]
 languages/lua/src/pmc/luaclosure.pmc                        [lua]
 languages/lua/src/pmc/luafunction.pmc                       [lua]
 languages/lua/src/pmc/luanil.pmc                            [lua]
@@ -1623,6 +1637,7 @@
 languages/lua/src/yapp/Lua/symbtab.pm                       [lua]
 languages/lua/t/Parrot/Test/Lua.pm                          [lua]
 languages/lua/t/Parrot/Test/Lua_lex.pm                      [lua]
+languages/lua/t/Parrot/Test/Luad.pm                         [lua]
 languages/lua/t/alarm.t                                     [lua]
 languages/lua/t/assign.t                                    [lua]
 languages/lua/t/base64.t                                    [lua]
@@ -1646,6 +1661,7 @@
 languages/lua/t/iterator.t                                  [lua]
 languages/lua/t/lexico.t                                    [lua]
 languages/lua/t/lfs.t                                       [lua]
+languages/lua/t/luad.t                                      [lua]
 languages/lua/t/math.t                                      [lua]
 languages/lua/t/md5.t                                       [lua]
 languages/lua/t/metatable.t                                 [lua]
@@ -1862,6 +1878,7 @@
 languages/perl6/src/classes/Bool.pir                        [perl6]
 languages/perl6/src/classes/Capture.pir                     [perl6]
 languages/perl6/src/classes/Code.pir                        [perl6]
+languages/perl6/src/classes/Grammar.pir                     [perl6]
 languages/perl6/src/classes/Hash.pir                        [perl6]
 languages/perl6/src/classes/IO.pir                          [perl6]
 languages/perl6/src/classes/Int.pir                         [perl6]
@@ -1976,10 +1993,12 @@
 languages/plumhead/src/antlr3/PlumheadLexer.java            [plumhead]
 languages/plumhead/src/antlr3/PlumheadParser.java           [plumhead]
 languages/plumhead/src/common/builtins.pir                  [plumhead]
+languages/plumhead/src/common/driver_nqp.pir                [plumhead]
 languages/plumhead/src/common/plumhead.pir                  [plumhead]
 languages/plumhead/src/pct/Plumhead.pg                      [plumhead]
 languages/plumhead/src/pct/Plumhead/Grammar.pir             [plumhead]
 languages/plumhead/src/pct/PlumheadPAST.tg                  [plumhead]
+languages/plumhead/src/phc/past_xml_to_past_nqp.xsl         [plumhead]
 languages/plumhead/src/phc/past_xml_to_past_pir.xsl         [plumhead]
 languages/plumhead/src/phc/phc_xml_to_past_xml.xsl          [plumhead]
 languages/plumhead/t/harness                                [plumhead]
@@ -2688,7 +2707,6 @@
 src/bignum.h                                                []
 src/builtin.c                                               []
 src/byteorder.c                                             []
-src/call_list.txt                                           [devel]doc
 src/charset.c                                               []
 src/charset/ascii.c                                         []
 src/charset/ascii.h                                         []
@@ -3492,13 +3510,15 @@
 t/steps/auto_opengl-03.t                                    []
 t/steps/auto_ops-01.t                                       []
 t/steps/auto_pack-01.t                                      []
+t/steps/auto_pcre-01.t                                      []
+t/steps/auto_pcre-02.t                                      []
+t/steps/auto_pcre-03.t                                      []
 t/steps/auto_perldoc-01.t                                   []
 t/steps/auto_perldoc-02.t                                   []
 t/steps/auto_pmc-01.t                                       []
 t/steps/auto_pmc-02.t                                       []
 t/steps/auto_pmc-03.t                                       []
 t/steps/auto_pmc-04.t                                       []
-t/steps/auto_python-01.t                                    []
 t/steps/auto_readline-01.t                                  []
 t/steps/auto_readline-02.t                                  []
 t/steps/auto_revision-01.t                                  []
@@ -3521,6 +3541,7 @@
 t/steps/auto_warnings-06.t                                  []
 t/steps/auto_warnings-07.t                                  []
 t/steps/auto_warnings-08.t                                  []
+t/steps/gen_call_list-01.t                                  []
 t/steps/gen_config_h-01.t                                   []
 t/steps/gen_config_pm-01.t                                  []
 t/steps/gen_core_pmcs-01.t                                  []

Modified: branches/pdd25cx/MANIFEST.SKIP
==============================================================================
--- branches/pdd25cx/MANIFEST.SKIP	(original)
+++ branches/pdd25cx/MANIFEST.SKIP	Sat May 10 07:12:21 2008
@@ -1,6 +1,6 @@
 # ex: set ro:
 # $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Tue Apr 29 00:47:45 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Tue May  6 22:22:57 2008 UT
 #
 # This file should contain a transcript of the svn:ignore properties
 # of the directories in the Parrot subversion repository. (Needed for
@@ -17,22 +17,10 @@
 # generated from svn:ignore of './'
 ^.*\.core$
 ^.*\.core/
-^.*\.def$
-^.*\.def/
 ^.*\.exe$
 ^.*\.exe/
-^.*\.exp$
-^.*\.exp/
-^.*\.ilk$
-^.*\.ilk/
-^.*\.lib$
-^.*\.lib/
-^.*\.manifest$
-^.*\.manifest/
 ^.*\.ncb$
 ^.*\.ncb/
-^.*\.obj$
-^.*\.obj/
 ^.*\.patch$
 ^.*\.patch/
 ^.*\.pdb$
@@ -45,8 +33,6 @@
 ^.*\.tmp/
 ^.*\.vcproj.*$
 ^.*\.vcproj.*/
-^\.parrot_current_rev$
-^\.parrot_current_rev/
 ^CFLAGS$
 ^CFLAGS/
 ^MANIFEST\.configure\.generated$
@@ -61,8 +47,6 @@
 ^blib/
 ^config_lib\.pasm$
 ^config_lib\.pasm/
-^cover_db$
-^cover_db/
 ^disassemble$
 ^disassemble/
 ^install_config\.fpmc$
@@ -81,8 +65,6 @@
 ^parrot/
 ^parrot\.ilk$
 ^parrot\.ilk/
-^parrot\.iss$
-^parrot\.iss/
 ^parrot\.pc$
 ^parrot\.pc/
 ^parrot\.pdb$
@@ -91,16 +73,18 @@
 ^pbc_info/
 ^pbc_merge$
 ^pbc_merge/
-^pbc_to_exe$
-^pbc_to_exe/
-^pbc_to_exe\..*$
-^pbc_to_exe\..*/
 ^pdb$
 ^pdb/
 ^pdump$
 ^pdump/
-^perl6$
-^perl6/
+^plumhead_past\.nqp$
+^plumhead_past\.nqp/
+^plumhead_past\.pir$
+^plumhead_past\.pir/
+^plumhead_past\.xml$
+^plumhead_past\.xml/
+^plumhead_phc_ast\.xml$
+^plumhead_phc_ast\.xml/
 ^smoke\.html$
 ^smoke\.html/
 ^tags$
@@ -662,12 +646,13 @@
 # generated from svn:ignore of 'languages/eclectus/'
 ^languages/eclectus/Makefile$
 ^languages/eclectus/Makefile/
-^languages/eclectus/gen_past\.pir$
-^languages/eclectus/gen_past\.pir/
+^languages/eclectus/driver_nqp\.pbc$
+^languages/eclectus/driver_nqp\.pbc/
 ^languages/eclectus/stst\.out$
 ^languages/eclectus/stst\.out/
-^languages/eclectus/stst\.pir$
-^languages/eclectus/stst\.pir/
+# generated from svn:ignore of 'languages/eclectus/src/builtins/'
+^languages/eclectus/src/builtins/.*\.pbc$
+^languages/eclectus/src/builtins/.*\.pbc/
 # generated from svn:ignore of 'languages/eclectus/src/pmc/'
 ^languages/eclectus/src/pmc/.*\.bundle$
 ^languages/eclectus/src/pmc/.*\.bundle/
@@ -695,6 +680,11 @@
 ^languages/eclectus/src/pmc/.*\.pdb/
 ^languages/eclectus/src/pmc/.*\.so$
 ^languages/eclectus/src/pmc/.*\.so/
+# generated from svn:ignore of 'languages/eclectus/t/'
+^languages/eclectus/t/.*\.nqp$
+^languages/eclectus/t/.*\.nqp/
+^languages/eclectus/t/.*\.pir$
+^languages/eclectus/t/.*\.pir/
 # generated from svn:ignore of 'languages/ecmascript/'
 ^languages/ecmascript/Makefile$
 ^languages/ecmascript/Makefile/
@@ -825,6 +815,8 @@
 # generated from svn:ignore of 'languages/lua/src/lib/'
 ^languages/lua/src/lib/.*\.pbc$
 ^languages/lua/src/lib/.*\.pbc/
+^languages/lua/src/lib/luabytecode_gen\.pir$
+^languages/lua/src/lib/luabytecode_gen\.pir/
 ^languages/lua/src/lib/sha1\.pir$
 ^languages/lua/src/lib/sha1\.pir/
 # generated from svn:ignore of 'languages/lua/src/pmc/'
@@ -998,6 +990,8 @@
 # generated from svn:ignore of 'languages/plumhead/'
 ^languages/plumhead/Makefile$
 ^languages/plumhead/Makefile/
+^languages/plumhead/driver_nqp\.pbc$
+^languages/plumhead/driver_nqp\.pbc/
 ^languages/plumhead/plumhead\.log$
 ^languages/plumhead/plumhead\.log/
 ^languages/plumhead/plumhead\.pbc$
@@ -1635,6 +1629,8 @@
 ^src/io/.*\.o/
 ^src/io/.*\.obj$
 ^src/io/.*\.obj/
+^src/io/.*\.str$
+^src/io/.*\.str/
 # generated from svn:ignore of 'src/ops/'
 ^src/ops/.*\.c$
 ^src/ops/.*\.c/

Modified: branches/pdd25cx/MANIFEST.generated
==============================================================================
--- branches/pdd25cx/MANIFEST.generated	(original)
+++ branches/pdd25cx/MANIFEST.generated	Sat May 10 07:12:21 2008
@@ -285,6 +285,7 @@
 languages/squaak/squaak.pbc                       [main]
 languages/tcl/tcl.pbc                             [main]
 languages/tcl/runtime/tcllib.pbc                  [main]
+src/call_list.txt                                 [devel]doc
 src/glut_callbacks.c                              [main]
 src/jit_emit.h                                    [main]include
 src/nci.c                                         [main]

Modified: branches/pdd25cx/README_win32.pod
==============================================================================
--- branches/pdd25cx/README_win32.pod	(original)
+++ branches/pdd25cx/README_win32.pod	Sat May 10 07:12:21 2008
@@ -112,15 +112,9 @@
 B<antlr> - ANother Tool for Language Recognition
 L<http://www.antlr.org/>
 
-B<bc> - arbitrary-precision arithmetic language and calculator
-L<http://gnuwin32.sourceforge.net/>
-
 B<m4> - macro language processor
 L<http://gnuwin32.sourceforge.net/>
 
-B<Python> - an interpreted, interactive, object-oriented programming language
-L<http://www.python.org/>
-
 B<SVN::Client> - Perl wrapper of Subversion client functions
 L<http://subversion.tigris.org/> (svn-win32-1.4.x_pl.zip)
 

Modified: branches/pdd25cx/compilers/imcc/pbc.c
==============================================================================
--- branches/pdd25cx/compilers/imcc/pbc.c	(original)
+++ branches/pdd25cx/compilers/imcc/pbc.c	Sat May 10 07:12:21 2008
@@ -653,7 +653,7 @@
                     SymReg * const nam = mk_const(interp, fixup->name,
                             fixup->type & VT_ENCODED ? 'U' : 'S');
 
-                    op = interp->op_lib->op_code("find_name_p_sc", 1);
+                    op = interp->op_lib->op_code("find_sub_not_null_p_sc", 1);
                     PARROT_ASSERT(op);
 
                     interp->code->base.data[addr] = op;

Modified: branches/pdd25cx/compilers/imcc/pcc.c
==============================================================================
--- branches/pdd25cx/compilers/imcc/pcc.c	(original)
+++ branches/pdd25cx/compilers/imcc/pcc.c	Sat May 10 07:12:21 2008
@@ -339,12 +339,12 @@
         return;
 
     if (unit->last_ins->type != (ITPCCSUB|ITLABEL) &&
-            strcmp(unit->last_ins->opname, "ret") &&
-            strcmp(unit->last_ins->opname, "exit") &&
-            strcmp(unit->last_ins->opname, "end") &&
-            strcmp(unit->last_ins->opname, "branch") &&
+            STRNEQ(unit->last_ins->opname, "ret") &&
+            STRNEQ(unit->last_ins->opname, "exit") &&
+            STRNEQ(unit->last_ins->opname, "end") &&
+            STRNEQ(unit->last_ins->opname, "branch") &&
             /* was adding rets multiple times... */
-            strcmp(unit->last_ins->opname, "returncc")) {
+            STRNEQ(unit->last_ins->opname, "returncc")) {
         Instruction *tmp;
 
         /* check to make sure the sub is ok before we try to use it */
@@ -570,7 +570,7 @@
 
     called_sub = sub->pcc_sub->sub;
 
-    if (strcmp(this_sub->name, called_sub->name))
+    if (STRNEQ(this_sub->name, called_sub->name))
         return 0;
 
     if (sub->pcc_sub->nargs != this_sub->pcc_sub->nargs)

Modified: branches/pdd25cx/compilers/nqp/src/Grammar.pg
==============================================================================
--- branches/pdd25cx/compilers/nqp/src/Grammar.pg	(original)
+++ branches/pdd25cx/compilers/nqp/src/Grammar.pg	Sat May 10 07:12:21 2008
@@ -22,7 +22,7 @@
 
 token TOP {
   <statement_block>
-  [ $ || <panic: Syntax error> ]
+  [ $ || <panic: 'Syntax error'> ]
   {*}
 }
 
@@ -85,7 +85,7 @@
 ##  Parse a list of statements.
 rule statement_list {
     [ <statement>
-        [  <.statement_end> || <panic: Statement not terminated properly> ]
+        [  <.statement_end> || <panic: 'Statement not terminated properly'> ]
     ]*
     {*}
 }
@@ -174,13 +174,13 @@
 
 rule return_statement {
     $<sym>=['return']
-    [ <EXPR> || <panic: Unable to parse argument to 'return'> ]
+    [ <EXPR> || <panic: 'Unable to parse argument to "return"'> ]
     {*}
 }
 
 rule make_statement {
     $<sym>=['make']
-    [ <EXPR> || <panic: Unable to parse argument to 'make'> ]
+    [ <EXPR> || <panic: 'Unable to parse argument to "make"'> ]
     {*}
 }
 
@@ -205,7 +205,7 @@
 token block {
     '{'
     <statement_block>
-    [ '}' || <panic: Missing '}'> ]
+    [ '}' || <panic: 'Missing "}"'> ]
     [ \h* [ \# \N* ]? \n  <.MARK_STATEMENT_END> ]?
     {*}
 }
@@ -262,7 +262,7 @@
 token methodop {
     '.' <ident>
     '(' <arglist>
-    [ <.ws> ')' || <panic: Missing ')'> ]
+    [ <.ws> ')' || <panic: "Missing ')'"> ]
     {*}                                                    #= methodop
 }
 
@@ -270,7 +270,7 @@
     | '(' <arglist> ')' {*}                                #= ( )
     | '[' <EXPR> <.ws> ']' {*}                             #= [ ]
     | '{' <EXPR> <.ws> '}' {*}                             #= { }
-    | '<' <string_literal: \>> '>' {*}                     #= < >
+    | '<' <string_literal: '>' > '>' {*}                     #= < >
 }
 
 rule arglist {
@@ -337,9 +337,9 @@
 }
 
 token quote {
-    [ \'  <string_literal: '> \'
-    | '"' <string_literal: "> '"'
-    | 'q' <.ws> '<' <string_literal: \>> '>'
+    [ \'  <string_literal: '\''> \'
+    | '"' <string_literal: '"'> '"'
+    | 'q' <.ws> '<' <string_literal: '>'> '>'
     ]
     {*}
 }

Modified: branches/pdd25cx/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- branches/pdd25cx/compilers/pct/src/PAST/Compiler.pir	(original)
+++ branches/pdd25cx/compilers/pct/src/PAST/Compiler.pir	Sat May 10 07:12:21 2008
@@ -342,9 +342,11 @@
     goto children_done
 
   children_compiler:
-    ##  set the compiler to use for the POST::Sub node, and
-    ##  add this block's child to it.
+    ##  set the compiler to use for the POST::Sub node, pass on
+    ##  and compiler arguments and add this block's child to it.
     bpost.'compiler'(compiler)
+    $P0 = node.'compiler_args'()
+    bpost.'compiler_args'($P0)
     $P0 = node[0]
     bpost.'push'($P0)
 
@@ -490,17 +492,14 @@
 
 =item call(PAST::Op node)
 
-=item callmethod(PAST::Op node)
-
 Return the POST representation of a C<PAST::Op> node
-with a 'pasttype' attribute of either 'call' or 'callmethod'.
+for calling a sub.
 
 =cut
 
 .sub 'call' :method :multi(_, ['PAST::Op'])
     .param pmc node
     .param pmc options         :slurpy :named
-
     .local string pasttype
     pasttype = node.'pasttype'()
     if pasttype goto have_pasttype
@@ -508,25 +507,27 @@
   have_pasttype:
 
     .local string signature
-    signature = ':'
-    unless pasttype == 'callmethod' goto have_signature
-    signature = 'P:'
+    signature = 'v:'
+    ## for callmethod, the invocant (child) must be a PMC
+    if pasttype != 'callmethod' goto have_signature
+    signature = 'vP:'
   have_signature:
 
     .local pmc ops, posargs, namedargs
     .local string name
     name = node.'name'()
-    unless name goto call_first_arg
-    signature = concat 'v', signature
+    if name goto call_by_name
+    ##  our first child is the thing to be invoked, so make sure it's a PMC
+    substr signature, 1, 0, 'P'
     (ops, posargs, namedargs) = self.'post_children'(node, 'signature'=>signature)
-    name = ops.'escape'(name)
-    unshift posargs, name
     goto children_done
-  call_first_arg:
-    signature = concat 'vP', signature
+  call_by_name:
     (ops, posargs, namedargs) = self.'post_children'(node, 'signature'=>signature)
+    $S0 = ops.'escape'(name)
+    unshift posargs, $S0
   children_done:
 
+    ##  generate the call itself
     .local string result, rtype
     result = ''
     rtype = options['rtype']
@@ -539,6 +540,14 @@
     .return (ops)
 .end
 
+
+=item callmethod(PAST::Op node)
+
+Return the POST representation of a C<PAST::Op> node
+to invoke a method on a PMC.
+
+=cut
+
 .sub 'callmethod' :method :multi(_, ['PAST::Op'])
     .param pmc node
     .param pmc options         :slurpy :named

Modified: branches/pdd25cx/compilers/pct/src/PAST/Node.pir
==============================================================================
--- branches/pdd25cx/compilers/pct/src/PAST/Node.pir	(original)
+++ branches/pdd25cx/compilers/pct/src/PAST/Node.pir	Sat May 10 07:12:21 2008
@@ -549,6 +549,20 @@
     .return self.'attr'('compiler', value, has_value)
 .end
 
+=item compiler_args()
+
+Specify named arguments to be passed to the compiler set
+through the compiler attribute. Not used if compiler is
+not set.
+
+=cut
+
+.sub 'compiler_args' :method
+    .param pmc value           :named :slurpy
+    .local int have_value
+    have_value = elements value
+    .return self.'attr'('compiler_args', value, have_value)
+.end
 
 =item pirflags([pirflags])
 

Modified: branches/pdd25cx/compilers/pct/src/PCT/HLLCompiler.pir
==============================================================================
--- branches/pdd25cx/compilers/pct/src/PCT/HLLCompiler.pir	(original)
+++ branches/pdd25cx/compilers/pct/src/PCT/HLLCompiler.pir	Sat May 10 07:12:21 2008
@@ -29,7 +29,7 @@
     $P0 = split ' ', 'parse past post pir evalpmc'
     setattribute self, '@stages', $P0
 
-    $P0 = split ' ', 'e=s help|h target=s trace|t=s encoding=s output|o=s combine each version|v'
+    $P0 = split ' ', 'e=s help|h target=s trace|t=s encoding=s output|o=s combine version|v'
     setattribute self, '@cmdoptions', $P0
 
     $P1 = new 'String'

Modified: branches/pdd25cx/compilers/pct/src/POST/Compiler.pir
==============================================================================
--- branches/pdd25cx/compilers/pct/src/POST/Compiler.pir	(original)
+++ branches/pdd25cx/compilers/pct/src/POST/Compiler.pir	Sat May 10 07:12:21 2008
@@ -266,7 +266,11 @@
     $P0 = node.'compiler'()
     unless $P0 goto subpir_post
   subpir_compiler:
-    $P0 = self.'hll_pir'(node, 'name'=>name, 'namespace'=>ns, 'pirflags'=>pirflags)
+    $P0 = node.'compiler_args'()
+    if $P0 goto have_compiler_args
+    $P0 = new 'Hash'
+  have_compiler_args:
+    $P0 = self.'hll_pir'(node, 'name'=>name, 'namespace'=>ns, 'pirflags'=>pirflags, $P0 :named :flat)
     code .= $P0
     goto subpir_done
 

Modified: branches/pdd25cx/compilers/pct/src/POST/Node.pir
==============================================================================
--- branches/pdd25cx/compilers/pct/src/POST/Node.pir	(original)
+++ branches/pdd25cx/compilers/pct/src/POST/Node.pir	Sat May 10 07:12:21 2008
@@ -209,6 +209,13 @@
 .end
 
 
+.sub 'compiler_args' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .return self.'attr'('compiler_args', value, has_value)
+.end
+
+
 .sub 'add_param' :method
     .param pmc pname
     .param pmc adverbs         :slurpy :named

Modified: branches/pdd25cx/compilers/pge/PGE/Exp.pir
==============================================================================
--- branches/pdd25cx/compilers/pge/PGE/Exp.pir	(original)
+++ branches/pdd25cx/compilers/pge/PGE/Exp.pir	Sat May 10 07:12:21 2008
@@ -817,8 +817,8 @@
         CODE
 
   subrule_match:
-    $I0 = self['isnegated']
-    if $I0 goto subrule_negated
+    $I0 = self['iszerowidth']
+    if $I0 goto subrule_zerowidth
     $S0 = concat label, '_3'
     $I0 = self['backtrack']
     if $I0 != PGE_BACKTRACK_NONE goto subrule_match_1
@@ -861,18 +861,24 @@
     goto end
     .return()
 
-  subrule_negated:
-    ##   This handles negative subrule matches; if a subrule fails, then
-    ##   record a zero-width match and continue to the next node.
-    code.emit(<<"        CODE", PGE_CUT_MATCH, next, subarg)
-          captob = $P0(captob%2)
+  subrule_zerowidth:
+    ##  this handles zero-width subrule matches, either positive
+    ##  or negative.
+    .local string test
+    test = 'if'
+    $I0 = self['isnegated']
+    unless $I0 goto have_test
+    test = 'unless'
+  have_test:
+    code.emit(<<"        CODE", PGE_CUT_MATCH, test, next, subarg)
+          captob = $P0(captob%3)
           $P1 = getattribute captob, '$.pos'
           if $P1 <= %0 goto fail_match
-          if $P1 >= 0 goto fail
+          %1 $P1 < 0 goto fail
           $P1 = pos
           $P1 = getattribute captob, '$.from'
           $P1 = pos
-          goto %1
+          goto %2
         CODE
   end:
     .return()

Modified: branches/pdd25cx/compilers/pge/PGE/OPTable.pir
==============================================================================
--- branches/pdd25cx/compilers/pge/PGE/OPTable.pir	(original)
+++ branches/pdd25cx/compilers/pge/PGE/OPTable.pir	Sat May 10 07:12:21 2008
@@ -279,6 +279,12 @@
   with_tighter:
 
     ws = getattribute self, '&!ws'
+    unless null ws goto have_ws
+    $I0 = can mob, 'ws'
+    unless $I0 goto have_ws
+    ws = find_method mob, 'ws'
+  have_ws:
+
     tokenstack = new 'ResizablePMCArray'
     operstack = new 'ResizablePMCArray'
     termstack = new 'ResizablePMCArray'

Modified: branches/pdd25cx/compilers/pge/PGE/Perl6Regex.pir
==============================================================================
--- branches/pdd25cx/compilers/pge/PGE/Perl6Regex.pir	(original)
+++ branches/pdd25cx/compilers/pge/PGE/Perl6Regex.pir	Sat May 10 07:12:21 2008
@@ -729,27 +729,36 @@
     (mob, pos, target) = mob.'new'(mob, 'grammar'=>'PGE::Exp::Subrule')
     lastpos = length target
 
-    .local string subname
-    (subname, pos) = 'parse_subname'(target, pos)
-    mob['subname'] = subname
-    $S0 = substr target, pos, 1
+    ##  default to non-capturing rule
+    .local int iscapture
 
-    ##   see what type of subrule this is
-    mob['iscapture'] = 1
-    if key == '<?' goto nocapture
-    if key == '<.' goto nocapture
+    ##  see what type of subrule this is
+    if key == '<.' goto scan_subname
+    if key == '<?' goto scan_subname             ## FIXME: RT#53834
     if key == '<!' goto negated
 
-    ##   if the next character is +/-, this is really an enumcharclass
-    $I0 = index '+-', $S0
-    if $I0 == -1 goto subrule_arg
-    .return 'parse_enumcharclass'(mobsave)
+    ##  capturing subrule, get its name/alias
+    iscapture = 1
+    .local string subname, cname
+    (subname, pos) = 'parse_subname'(target, pos)
+    cname = subname
+    $S0 = substr target, pos, 1
+    unless $S0 == '=' goto subrule_arg
+    ##  aliased subrule, skip the '=' and get the real name
+    inc pos
+    goto scan_subname
 
   negated:
     mob['isnegated'] = 1
-  nocapture:
-    mob['iscapture'] = 0
+  zerowidth:
+    mob['iszerowidth'] = 1
+
+  scan_subname:
+    (subname, pos) = 'parse_subname'(target, pos)
+
   subrule_arg:
+    mob['subname'] = subname
+    $S0 = substr target, pos, 1
     if $S0 == ':' goto subrule_text_arg
     if $S0 != ' ' goto subrule_end
   subrule_pattern_arg:
@@ -765,17 +774,28 @@
     mob.'to'(-1)
     goto subrule_end
   subrule_text_arg:
-    pos += 2
-    .local string textarg
+    $I0 = pos + 1
+    pos = find_not_cclass .CCLASS_WHITESPACE, target, $I0, lastpos
+    if pos == $I0 goto end
+    if pos >= lastpos goto end
+    .local string textarg, closedelim
     textarg = ''
+    closedelim = '>'
+    $S0 = substr target, pos, 1
+    if $S0 == '"' goto subrule_text_quote
+    if $S0 != "'" goto subrule_text_loop
+  subrule_text_quote:
+    closedelim = $S0
+    inc pos
   subrule_text_loop:
+    if pos >= lastpos goto end
     $S0 = substr target, pos, 1
-    if $S0 == '>' goto subrule_text_end
+    if $S0 == closedelim goto subrule_text_end
     if $S0 != "\\" goto subrule_text_add
     inc pos
     $S0 = substr target, pos, 1
-    $I0 = index "\\>", $S0
-    if $I0 >= 0 goto subrule_text_add
+    if $S0 == closedelim goto subrule_text_add
+    if $S0 == "\\" goto subrule_text_add
     textarg .= "\\"
   subrule_text_add:
     textarg .= $S0
@@ -783,14 +803,17 @@
     goto subrule_text_loop
   subrule_text_end:
     mob['arg'] = textarg
+    if closedelim == '>' goto subrule_end
+    inc pos
+    pos = find_not_cclass .CCLASS_WHITESPACE, target, pos, lastpos
   subrule_end:
     $S0 = substr target, pos, 1
     if $S0 != '>' goto end
     inc pos
     mob.'to'(pos)
-    $I0 = mob['iscapture']
-    if $I0 == 0 goto end
-    $S0 = escape subname
+    mob['iscapture'] = iscapture
+    unless iscapture goto end
+    $S0 = escape cname
     $S0 = concat '"', $S0
     $S0 = concat $S0, '"'
     mob['cname'] = $S0

Modified: branches/pdd25cx/compilers/tge/TGE/Parser.pg
==============================================================================
--- branches/pdd25cx/compilers/tge/TGE/Parser.pg	(original)
+++ branches/pdd25cx/compilers/tge/TGE/Parser.pg	Sat May 10 07:12:21 2008
@@ -44,7 +44,7 @@
 token ws {
     [ \s+
     | \# \N*
-    | <?pod_comment>
+    | <.pod_comment>
     ]*
 }
 
@@ -57,4 +57,4 @@
            [\n|$]
 }
 
-token syntax_error { <?die: Syntax error> }
+token syntax_error { <?die: 'Syntax error'> }

Modified: branches/pdd25cx/config/auto/warnings.pm
==============================================================================
--- branches/pdd25cx/config/auto/warnings.pm	(original)
+++ branches/pdd25cx/config/auto/warnings.pm	Sat May 10 07:12:21 2008
@@ -113,6 +113,7 @@
         -Wno-import
         -Wno-multichar
         -Wno-pointer-sign
+        -Wold-style-definition
         -Wpadded
         -Wredundant-decls
         -Wswitch-enum

Modified: branches/pdd25cx/config/gen/makefiles/root.in
==============================================================================
--- branches/pdd25cx/config/gen/makefiles/root.in	(original)
+++ branches/pdd25cx/config/gen/makefiles/root.in	Sat May 10 07:12:21 2008
@@ -604,6 +604,7 @@
     $(SRC_DIR)/inter_cb.str \
     $(SRC_DIR)/inter_create.str \
     $(SRC_DIR)/inter_misc.str \
+    $(SRC_DIR)/io/io.str \
     $(SRC_DIR)/key.str \
     $(SRC_DIR)/library.str \
     $(SRC_DIR)/mmd.str \
@@ -1120,7 +1121,7 @@
 
 $(SRC_DIR)/inter_run$(O) : $(SRC_DIR)/inter_run.c $(GENERAL_H_FILES)
 
-$(IO_DIR)/io$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
+$(IO_DIR)/io$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h $(IO_DIR)/io.str
 
 $(IO_DIR)/io_buf$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
 
@@ -1623,7 +1624,7 @@
 	$(PERL) $(BUILD_TOOLS_DIR)/c2str.pl --init
 	$(RM_F) \
     $(SRC_DIR)/string_private_cstring.h \
-    "$(SRC_DIR)/*.str" "src/pmc/*.str" \
+    $(STR_FILES) \
     "src/pmc/*.c" "src/pmc/pmc_*.h" "src/pmc/*.dump" \
     vtable.dump "*.def" "*.lib" "*.exp"
 

Modified: branches/pdd25cx/docs/art/pp001-intro.pod
==============================================================================
--- branches/pdd25cx/docs/art/pp001-intro.pod	(original)
+++ branches/pdd25cx/docs/art/pp001-intro.pod	Sat May 10 07:12:21 2008
@@ -79,10 +79,10 @@
 Note that I am using a relative path to parrot given that I didn't
 install it into the system.
 
-The keywords starting with a dot (C<.sub> and C<.end>) are PIR macros.
+The keywords starting with a dot (C<.sub> and C<.end>) are PIR directives.
 They are used together to define subroutines. After the C<.sub> keyword
 I use the name of the subroutine. The keyword that starts with a colon
-(C<:main>) is a attribute (more on those later) that tells parrot that
+(C<:main>) is an attribute (more on those later) that tells parrot that
 this is the main body of the program and that it should start by
 executing this subroutine. By the way, I could use C<.sub foo :main> and
 Parrot will use the C<foo> subroutine as the main body of the program.
@@ -124,7 +124,7 @@
 registers as needed and handle whatever manipulations are needed for
 optimization.
 
-Another PIR perk is that local variable names may be declared and used 
+Another PIR perk is that local variable names may be declared and used
 instead of register names. For that I just need to declare the
 variable using the C<.local> keyword:
 
@@ -231,7 +231,7 @@
 When calling the function, I need to pass the names of the
 arguments. For that there are two syntaxes as well:
 
-  func( 10 :named("foo") )	  # or
+  func( 10 :named("foo") )    # or
   func( "foo" => 10 )
 
 Note that with named arguments, you may rearrange the order of your
@@ -239,7 +239,7 @@
 
   .sub foo
     .param string "name"    => a
-    .param int    "age"	    => b
+    .param int    "age"     => b
     .param string "gender"  => c
     # ...
   .end

Modified: branches/pdd25cx/docs/art/pp002-pmc.pod
==============================================================================
--- branches/pdd25cx/docs/art/pp002-pmc.pod	(original)
+++ branches/pdd25cx/docs/art/pp002-pmc.pod	Sat May 10 07:12:21 2008
@@ -13,8 +13,7 @@
 
 As mentioned by Alberto Manuel Simões in TPR 2.3, Parrot is
 a register-based virtual machine with 4 register types:
-Integer, String, Number, PMC. There are 32 registers for
-each register type (0 through 31) and registers are
+Integer, String, Number, PMC. Registers are
 referenced by a capital letter signifying the register type
 followed by the register number (C<S15> is String register
 number 15). Parrot programs consist of lines of text where
@@ -24,12 +23,19 @@
 Intermediate Representation) you may obtain an arbitrary
 number of each register type by prefixing the register with
 a C<$> (For example, the virtual register C<$I51> is
-perfectly valid). PIR also provides for a more "natural"
-syntax for opcodes. Rather than saying C<set I1, 0> to
-assign a zero to the I1 register, you may say instead C<I1 =
-0>. PIR also provides syntax for easily creating named
-variables and constants, subroutines, passing parameters to
-subroutines, accessing parameters by name, etc.
+perfectly valid). Each subroutine will have as many registers
+available as necessary; a simple subroutine will only need
+a few whereas complex subroutines with many calculations will
+need a larger number of registers. This is a fundamental
+difference from the original design of Parrot, in which there
+were 32 registers for each of the built-in types (int, num,
+pmc, string).
+PIR also provides for a more "natural" syntax for opcodes.
+Rather than saying C<set I1, 0> to assign a zero to the I1
+register, you may say instead C<I1 = 0>.
+PIR also provides syntax for easily creating named variables
+and constants, subroutines, passing parameters to subroutines,
+accessing parameters by name, etc.
 
 Now, on to business ...
 
@@ -53,7 +59,7 @@
     .sub _ :main
         $I0 = 1                         # The first PMC
       loop:
-        $I1 = valid_type $I0            
+        $I1 = valid_type $I0
         unless $I1 goto end_loop        # stop on invalid PMC number
         $S0 = typeof $I0                # get PMC type name
         print $I0                       # output PMC number
@@ -91,7 +97,7 @@
 
 Before I take a closer look at some of these PMC types,
 let's look at a common thing that people want to know how to
-do-- read command line arguments. The subroutine designated
+do -- read command line arguments. The subroutine designated
 as the main program (by the C<:main> modifier) has an
 implicit parameter passed to it that is the command line
 arguments. Since previous examples never had such a
@@ -205,10 +211,7 @@
 need to create a PMC of type C<Env>. This is accomplished by
 the C<new> opcode like so: C<$P0 = new 'Env'> After that
 statement, C<$P0> will contain a hash consisting of all of
-the environment variables at that time. All built-in types
-are prefixed with a dot, so if the PMC type is
-C<OrderedHash>, to create a new one you'd do C<$P0 = new
-.OrderedHash>.
+the environment variables at that time.
 
 But, both the keys and values the C<Env> hash are strings,
 so how do I iterate over them as I did for the command

Modified: branches/pdd25cx/docs/art/pp003-oop.pod
==============================================================================
--- branches/pdd25cx/docs/art/pp003-oop.pod	(original)
+++ branches/pdd25cx/docs/art/pp003-oop.pod	Sat May 10 07:12:21 2008
@@ -249,7 +249,7 @@
 Immediately after I create the class called "Dog", I use the
 PMC handle returned from C<newclass> to add an attribute called
 "name" to the class.  This just allocates a slot in the class for
-the value, it does nothing more.  
+the value, it does nothing more.
 
 Next, I create a new Dog and give it a name. Because
 attributes may only be PMCs, in order to give the Dog a
@@ -295,7 +295,7 @@
 
 Each subclass will contain an attribute called "name" that can be
 used to store the name of the animal.  The C<setname> method
-abstracts out the process of creating a C<.String> PMC and
+abstracts out the process of creating a C<String> PMC and
 calling C<setattribute> on it.  And finally the C<getname> method
 becomes a wrapper around C<getattribute>.
 
@@ -315,7 +315,7 @@
 opportunity to read and experiment and learn more about OOP
 in Parrot.
 
-=head2 Acknowledgements 
+=head2 Acknowledgements
 
 =over 4
 
@@ -391,7 +391,7 @@
         dog.'setname'("Snoopy")
         pig   = new "Pig"
         pig.'setname'("Porky")
-        
+
         cow.'speak'()
         dog.'speak'()
         pig.'speak'()

Modified: branches/pdd25cx/docs/pdds/pdd28_strings.pod
==============================================================================
--- branches/pdd25cx/docs/pdds/pdd28_strings.pod	(original)
+++ branches/pdd25cx/docs/pdds/pdd28_strings.pod	Sat May 10 07:12:21 2008
@@ -9,7 +9,7 @@
 
 This PDD describes the conventions for strings in Parrot,
 including but not limited to support for multiple character sets,
-encodings and languages.
+encodings, and languages.
 
 =head1 VERSION
 
@@ -355,18 +355,6 @@
 characters in non-NFG strings). This conversion effectively uses an
 intermediate NFG representation.
 
-=head2 String Subsystem
-
-The following functions are used internally to initialise and terminate the
-string allocation and garbage collection subsystem.
-
-=head3 Parrot_string_system_init (was string_init)
-
-Initialize Parrot's string subsystem.
-
-=head3 Parrot_string_system_end (was string_deinit)
-
-Terminate Parrot's string subsystem (clean up).
 
 =head2 String Interface Functions
 
@@ -418,12 +406,6 @@
 {{NOTE: the integer length isn't really necessary, and is under consideration
 for deprecation.}}
 
-=head3 Parrot_constant_string_new (was const_string)
-
-Creates and returns a new Parrot constant string. Takes one C string (a C<char
-*>) as an argument, the value of the constant string. The length of the C
-string is calculated internally.
-
 =head3 Parrot_string_new
 
 Return a new string with the default encoding and character set. Accepts one
@@ -448,6 +430,12 @@
 C<Parrot_find_encoding> and C<Parrot_find_charset> can be called to look up the
 encoding or character set structs.}}
 
+=head3 Parrot_constant_string_new (was const_string)
+
+Creates and returns a new Parrot constant string. Takes one C string (a C<char
+*>) as an argument, the value of the constant string. The length of the C
+string is calculated internally.
+
 =head3 Parrot_string_resize (was string_grow)
 
 Resize the string buffer of the given string adding the number of bytes passed
@@ -550,9 +538,21 @@
 modifying the original string.
 
 
-
 =head2 Internal String Functions
 
+The following functions are used internally and are not part of the public
+interface.
+
+=head3 string_system_init (was string_init)
+
+Initialize Parrot's string subsystem, including string allocation and garbage
+collection.
+
+=head3 string_system_end (was string_deinit)
+
+Terminate Parrot's string subsystem (clean up), including string allocation and
+garbage collection.
+
 =head3 string_max_bytes
 
 Calculate the number of bytes needed to contain a given number of characters in

Modified: branches/pdd25cx/docs/project/debian_packaging_guide.pod
==============================================================================
--- branches/pdd25cx/docs/project/debian_packaging_guide.pod	(original)
+++ branches/pdd25cx/docs/project/debian_packaging_guide.pod	Sat May 10 07:12:21 2008
@@ -115,6 +115,22 @@
 Commit all changes made to the files in the debian/ directory to the Parrot
 repository. (Skip the generated debian/control file.)
 
+=item 12.
+
+Upload the packages to http://alioth.debian.org. (If you don't have admin
+privileges, ask someone who does.) From any of the project pages, click on the
+"Admin" tab, then the "FRS Admin" link on the bottom of the page, then the link
+to "quick-release a file".
+
+Select the appropriate "Package ID" for the file (the same as the filename
+without the version). For the "Release Name" use the current version number
+(e.g.  0.6.1). For the "Release Date" use the date and time you listed in the
+debian changelog file (the date and time the debian package was created, not
+Parrot's release date for that version). For the "Release Notes" use the
+standard release text (the email/website/press announcement) without the change
+list.  For the "Change Log" use the change list from the standard release text.
+Also check "Preserve my pre-formatted text".
+
 =back
 
 =head1 SEE ALSO

Modified: branches/pdd25cx/docs/project/metacommitter_guide.pod
==============================================================================
--- branches/pdd25cx/docs/project/metacommitter_guide.pod	(original)
+++ branches/pdd25cx/docs/project/metacommitter_guide.pod	Sat May 10 07:12:21 2008
@@ -28,7 +28,9 @@
 
 Login to L<https://rt.perl.org/rt3/> with the id, so the user name is available
 in RT for assigning tickets, and so it is registered in the list of users
-eligible for parrot commit bit
+eligible for parrot commit bit. Your login id is shown at the top of the 
+page, e.g. C<Logged in as coke>. B<This> is the id you must provide to the
+metacommitter so they can add you.
 
 =item 3
 

Modified: branches/pdd25cx/include/parrot/stacks.h
==============================================================================
--- branches/pdd25cx/include/parrot/stacks.h	(original)
+++ branches/pdd25cx/include/parrot/stacks.h	Sat May 10 07:12:21 2008
@@ -33,7 +33,7 @@
     Parrot_UInt         refcount;
     union { /* force appropriate alignment of 'data'.  If alignment
                is necessary, assume double is good enough.  27-04-2007. */
-        void *data;
+        Stack_Entry_t data;
 #if PARROT_PTR_ALIGNMENT > 1
         double d_dummy;
 #endif
@@ -171,7 +171,7 @@
 PARROT_API
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-void* stack_prepare_pop(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p))
+Stack_Entry_t* stack_prepare_pop(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*stack_p);
@@ -179,7 +179,7 @@
 PARROT_API
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-void* stack_prepare_push(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p))
+Stack_Entry_t* stack_prepare_push(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*stack_p);

Modified: branches/pdd25cx/include/parrot/string.h
==============================================================================
--- branches/pdd25cx/include/parrot/string.h	(original)
+++ branches/pdd25cx/include/parrot/string.h	Sat May 10 07:12:21 2008
@@ -38,7 +38,8 @@
     void (*set_position)(PARROT_INTERP, struct string_iterator_t *i, UINTVAL pos);
 } String_iter;
 
-#define STREQ(x, y) (strcmp((x), (y))==0)
+#define STREQ(x, y)  (strcmp((x), (y))==0)
+#define STRNEQ(x, y) (strcmp((x), (y))!=0)
 
 /* stringinfo parameters */
 

Modified: branches/pdd25cx/languages/APL/src/parser/grammar.pg
==============================================================================
--- branches/pdd25cx/languages/APL/src/parser/grammar.pg	(original)
+++ branches/pdd25cx/languages/APL/src/parser/grammar.pg	Sat May 10 07:12:21 2008
@@ -5,7 +5,7 @@
 
 token statement_list { ^<statement> [ \n <statement> ]* {*} }
 
-token statement { <expression> [ \s*? $$ | <panic: Syntax error> ] {*} }
+token statement { <expression> [ \s*? $$ | <panic: 'Syntax error'> ] {*} }
 
 token expression {
     | <target> '←' <expression> {*}                             #= assign

Modified: branches/pdd25cx/languages/abc/src/grammar.pg
==============================================================================
--- branches/pdd25cx/languages/abc/src/grammar.pg	(original)
+++ branches/pdd25cx/languages/abc/src/grammar.pg	Sat May 10 07:12:21 2008
@@ -20,7 +20,7 @@
 
 rule TOP {
     ^ <statement_list>
-    [ $ || <panic: parse error> ]
+    [ $ || <panic: 'parse error'> ]
     {*}
 }
 
@@ -68,7 +68,7 @@
 
 
 token string {
-    '"' <string_literal: "> '"'
+    '"' <string_literal: '"'> '"'
     {*}
 }
 

Modified: branches/pdd25cx/languages/cardinal/cardinal.pir
==============================================================================
--- branches/pdd25cx/languages/cardinal/cardinal.pir	(original)
+++ branches/pdd25cx/languages/cardinal/cardinal.pir	Sat May 10 07:12:21 2008
@@ -52,6 +52,9 @@
      ##  create a list of END blocks to be run
     $P0 = new 'List'
     set_hll_global ['cardinal'], '@?END_BLOCKS', $P0
+
+    $P0 = new 'List'
+    set_hll_global ['cardinal';'Grammar';'Actions'], '@?BLOCK', $P0
 .end
 
 =item main(args :slurpy)  :main

Modified: branches/pdd25cx/languages/cardinal/config/makefiles/root.in
==============================================================================
--- branches/pdd25cx/languages/cardinal/config/makefiles/root.in	(original)
+++ branches/pdd25cx/languages/cardinal/config/makefiles/root.in	Sat May 10 07:12:21 2008
@@ -39,6 +39,7 @@
 
 BUILTINS_PIR = \
   src/builtins/say.pir \
+  src/builtins/cmp.pir \
 
 # PMCS = cardinal
 # PMC_SOURCES = $(PMC_DIR)/cardinal.pmc

Modified: branches/pdd25cx/languages/cardinal/src/builtins/say.pir
==============================================================================
--- branches/pdd25cx/languages/cardinal/src/builtins/say.pir	(original)
+++ branches/pdd25cx/languages/cardinal/src/builtins/say.pir	Sat May 10 07:12:21 2008
@@ -18,10 +18,14 @@
     print $P0
     goto iter_loop
   iter_end:
-    print "\n"
     .return ()
 .end
 
+.sub 'puts'
+    .param pmc args            :slurpy
+    'print'(args :flat, "\n")
+.end
+
 .namespace ["Array"]
 
 .sub 'new' :method

Modified: branches/pdd25cx/languages/cardinal/src/parser/actions.pm
==============================================================================
--- branches/pdd25cx/languages/cardinal/src/parser/actions.pm	(original)
+++ branches/pdd25cx/languages/cardinal/src/parser/actions.pm	Sat May 10 07:12:21 2008
@@ -18,13 +18,31 @@
 class cardinal::Grammar::Actions;
 
 method TOP($/) {
-    my $past := PAST::Block.new( :blocktype('declaration'), :node( $/ ) );
-    $past.push( $( $<comp_stmt> ) );
+    my $past := $( $<comp_stmt> );
+    $past.blocktype('declaration');
     make $past;
 }
 
-method comp_stmt($/) {
-    make $( $<stmts> );
+method comp_stmt($/,$key) {
+    our $?BLOCK;
+    our @?BLOCK;
+    our $?BLOCK_SIGNATURED;
+    if $key eq 'open' {
+        if $?BLOCK_SIGNATURED {
+            $?BLOCK := $?BLOCK_SIGNATURED;
+            $?BLOCK_SIGNATURED := 0;
+        }
+        else {
+            $?BLOCK := PAST::Block.new( PAST::Stmts.new(), :node($/));
+        }
+        @?BLOCK.unshift($?BLOCK);
+    }
+    if $key eq 'close' {
+        my $past := @?BLOCK.shift();
+        $?BLOCK := @?BLOCK[0];
+        $past.push( $( $<stmts> ) );
+        make $past;
+    }
 }
 
 method stmts($/) {
@@ -115,11 +133,7 @@
     make PAST::Op.new( $lhs, $rhs, :pasttype('bind'), :node($/) );
 }
 
-method mlhs($/) {
-    make $( $<mlhs_item> );
-}
-
-method mlhs_item($/, $key) {
+method mlhs($/, $key) {
     make $( $/{$key} );
 }
 
@@ -154,24 +168,49 @@
 }
 
 method local_variable($/) {
-    make PAST::Var.new( :name(~$/), :scope('lexical'), :node($/), :viviself('Undef') );
+    our $?BLOCK;
+    my $past := PAST::Var.new( :name(~$/), :scope('lexical'), :node($/), :viviself('Undef') );
+    unless $?BLOCK.symbol($<ident>) {
+        our @?BLOCK;
+        my $exists := 0;
+        for @?BLOCK {
+            if $_ {
+                my $sym_table := $_.symbol(~$<ident>);
+                if $sym_table {
+                    $exists := 1;
+                }
+            }
+        }
+        if $exists == 0 {
+            $past.isdecl(1);
+        }
+        my $scope := 'lexical';
+        $?BLOCK.symbol(~$<ident>, :scope($scope));
+    }
+    make $past;
 }
 
 
 method if_stmt($/) {
     my $cond := +$<expr> - 1;
+    my $comp := $( $<comp_stmt>[$cond] );
+    $comp.blocktype('immediate');
     my $past := PAST::Op.new( $( $<expr>[$cond] ),
-                              $( $<comp_stmt>[$cond] ),
+                              $comp,
                               :pasttype('if'),
                               :node( $/ )
                             );
     if ( $<else> ) {
-        $past.push( $( $<else>[0] ) );
+        my $else := $( $<else>[0] ) ;
+        $else.blocktype('immediate');
+        $past.push( $else );
     }
     while ($cond != 0) {
         $cond := $cond - 1;
+        $comp := $( $<comp_stmt>[$cond] );
+        $comp.blocktype('immediate');
         $past := PAST::Op.new( $( $<expr>[$cond] ),
-                               $( $<comp_stmt>[$cond] ),
+                               $comp,
                                $past,
                                :pasttype('if'),
                                :node( $/ )
@@ -183,6 +222,7 @@
 method unless_stmt($/) {
     my $cond := $( $<expr> );
     my $body := $( $<comp_stmt> );
+    $body.blocktype('immediate');
     my $past := PAST::Op.new( $cond, $body, :pasttype('unless'), :node($/) );
     if $<else> {
         $past.push( $( $<else>[0] ) );
@@ -205,7 +245,7 @@
 }
 
 method module($/) {
-    my $past := PAST::Block.new( $( $<comp_stmt> ), :node($/) );
+    my $past := $( $<comp_stmt> );
     my $name := $( $<module_identifier> );
     $past.namespace( $name.name() );
     $past.blocktype('declaration');
@@ -214,36 +254,39 @@
 
 method begin_end($/) {
     my $past := $( $<comp_stmt> );
-    $past := PAST::Block.new( $past, :node($/) );
     # XXX handle resque and ensure clauses
     make $past;
 }
 
 method functiondef($/) {
-    my $past := PAST::Block.new( :blocktype('declaration'), :node($/) );
+    my $past := $( $<comp_stmt> );
     my $name := $<fname>;
-    my $args := $( $<argdecl> );
-    $past.name($name);
-    my $body := $( $<comp_stmt> );
-    $past.push($args);
-    $past.push($body);
+    #my $args := $( $<argdecl> );
+    #$past.push($args);
+    $past.name(~$name);
+    our $?BLOCK;
+    $?BLOCK.symbol(~$name, :scope('package'));
     make $past;
 }
 
 method argdecl($/) {
-    my $past := PAST::Stmts.new( :node($/) );
+    my $params := PAST::Stmts.new( :node($/) );
+    my $past := PAST::Block.new($params, :blocktype('declaration'));
     for $<identifier> {
-        my $param := $( $_ );
-        $param.scope('parameter');
-        $past.push($param);
+        my $parameter := $( $_ );
+        $past.symbol($parameter.name(), :scope('lexical'));
+        $parameter.scope('parameter');
+        $params.push($parameter);
     }
     if $<slurpy_param> {
-        $past.push( $( $<slurpy_param>[0] ) );
+        $params.push( $( $<slurpy_param>[0] ) );
     }
 
     if $<block_param> {
 
     }
+    $params.arity( +$<identifier> );
+    our $?BLOCK_SIGNATURED := $past;
     make $past;
 }
 
@@ -286,7 +329,7 @@
         $past.unshift($invocant);
     }
 
-    $past.name($op);
+    $past.name(~$op);
     make $past;
 }
 

Modified: branches/pdd25cx/languages/cardinal/src/parser/grammar.pg
==============================================================================
--- branches/pdd25cx/languages/cardinal/src/parser/grammar.pg	(original)
+++ branches/pdd25cx/languages/cardinal/src/parser/grammar.pg	Sat May 10 07:12:21 2008
@@ -22,17 +22,18 @@
 }
 
 token comp_stmt {
+    {*}                        #= open
     <stmts>
-    {*}
+    {*}                        #= close
 }
 
 rule stmts {
     <.term>?[ <stmt> <.term>+]* {*}
 }
 
-rule term { \n | ';' }
+token term { \n | ';' }
 
-rule basic_stmt {
+token basic_stmt {
     | <alias> {*}           #= alias
     | <expr> {*}            #= expr
     | <begin> {*}           #= begin
@@ -44,13 +45,13 @@
     {*}
 }
 
-rule stmt {
-    <basic_stmt> <stmt_mod>*
+token stmt {
+    <basic_stmt> <.ws> <stmt_mod>*
     {*}
 }
 
-rule stmt_mod {
-    $<sym>=[if|while|unless|until] <expr>
+token stmt_mod {
+    $<sym>=[if|while|unless|until] <.ws> <expr>
     {*}
 }
 
@@ -61,11 +62,11 @@
 }
 
 
-rule basic_expr {
+token basic_expr {
     | <assignment> {*}      #= assignment
-    | <command> {*}         #= command
+    #| <command> {*}         #= command
     | <arg> {*}             #= arg
-    | <not_command> {*}     #= not_command
+    #| <not_command> {*}     #= not_command
     | <not_expr> {*}        #= not_expr
 }
 
@@ -85,21 +86,16 @@
 }
 
 rule assignment {
-    <mlhs> '=' <mrhs>
+    <mlhs=lhs> '=' <mrhs=arg>       #XXX need to figure out multiple assignment
     {*}
 }
 
 rule mlhs {
-    <mlhs_item>
-    {*}
-}
-
-rule mlhs_item {
     | <lhs> {*}               #= lhs
     | '(' <mlhs> ')' {*}      #= mlhs
 }
 
-rule lhs {
+token lhs {
     | <variable> {*}            #= variable
     | <indexed_variable> {*}    #= indexed_variable
     | <member_variable> {*}     #= member_variable
@@ -121,7 +117,7 @@
 }
 
 rule call {
-    [ <primary> $<dot>=['.'|'::'] ]?
+    # [ <primary> $<dot>=['.'|'::'] ]?
     <operation> <call_args>
     {*}
 }
@@ -145,13 +141,13 @@
     | '(' <.ws> <args> <.ws> ')' {*}
 }
 
-rule variable {
+token variable {
     | <varname> {*}      #= varname
     | 'nil'              #= nil
     | 'self'             #= self
 }
 
-rule varname {
+token varname {
     <!reserved_word>
     [ <global> {*}             #= global
     | <instance_variable> {*}  #= instance_variable
@@ -159,7 +155,7 @@
     ]
 }
 
-rule mrhs {
+token mrhs {
     <args> {*}
 }
 
@@ -174,8 +170,10 @@
 
 
 
-rule basic_primary {
+token basic_primary {
     | <literal> {*}                         #= literal
+    | <command> {*}                         #= command
+    | <not_command> {*}                         #= command
     | <variable> {*}                        #= variable
     | <array> {*}                           #= array
     | <hash> {*}                            #= hash
@@ -220,7 +218,7 @@
     {*}
 }
 
-rule then { ':' | 'then' | <term> ['then']? }
+token then { ':' | 'then' | <term> ['then']? }
 
 rule while_stmt {
     $<sym>=['while'|'until'] <expr> <.do>
@@ -380,7 +378,7 @@
 }
 
 token string {
-    [ \' <string_literal: '> \' | \" <string_literal: "> \" ]
+    [ \' <string_literal: "'"> \' | \" <string_literal: '"'> \" ]
     {*}
 }
 
@@ -405,37 +403,37 @@
 
 proto 'prefix:defined?' is looser('infix:=') { ... }
 
-proto 'infix:+=' is equal('infix:=')
+proto 'infix:+=' is equiv('infix:=')
                  is pirop('add')        { ... }
 
-proto 'infix:-=' is equal('infix:=')
+proto 'infix:-=' is equiv('infix:=')
                  is pirop('sub')        { ... }
 
-proto 'infix:/=' is equal('infix:=')
+proto 'infix:/=' is equiv('infix:=')
                  is pirop('div')        { ... }
 
-proto 'infix:*=' is equal('infix:=')
+proto 'infix:*=' is equiv('infix:=')
                  is pirop('mul')        { ... }
 
-proto 'infix:%=' is equal('infix:=')
+proto 'infix:%=' is equiv('infix:=')
                  is pirop('mul')        { ... }
 
-proto 'infix:|=' is equal('infix:=')    { ... }
+proto 'infix:|=' is equiv('infix:=')    { ... }
 
-proto 'infix:&=' is equal('infix:=')    { ... }
+proto 'infix:&=' is equiv('infix:=')    { ... }
 
-proto 'infix:~=' is equal('infix:=')    { ... }
+proto 'infix:~=' is equiv('infix:=')    { ... }
 
-proto infix:«>>=» is equal('infix:=')
+proto infix:«>>=» is equiv('infix:=')
                   is pirop('rsh')       { ... }
 
-proto infix:«<<=» is equal('infix:=')
+proto infix:«<<=» is equiv('infix:=')
                   is pirop('lsh')       { ... }
 
-proto 'infix:&&=' is equal('infix:=')
+proto 'infix:&&=' is equiv('infix:=')
                   is pirop('and')       { ... }
 
-proto 'infix:**=' is equal('infix:=')
+proto 'infix:**=' is equiv('infix:=')
                   is pirop('pow')       { ... }
 
 proto 'ternary:? :' is tighter('infix:=')
@@ -444,7 +442,7 @@
 proto 'infix:..' is tighter('ternary:? :')
                  is pirop('n_add')      { ... }
 
-proto 'infix:...' is equal('infix:...') { ... }
+proto 'infix:...' is equiv('infix:...') { ... }
 
 proto 'infix:||' is tighter('infix:..')
                  is past('unless')      { ... }
@@ -461,10 +459,10 @@
 proto infix:«<=>» is equiv('infix:==') { ... }
 
 
-proto 'infix:«<=»' is tighter('infix:=') { ... }
-proto infix:«=>» is equiv(infix:«<=») { ... }
-proto infix:«>»  is equiv(infix:«<=») { ... }
-proto infix:«<»  is equiv(infix:«<=») { ... }
+proto 'infix:«<=»' is tighter('infix:===') { ... }
+proto infix:«=>» is tighter('infix:===') { ... }
+proto infix:«>»  is tighter('infix:===') { ... }
+proto infix:«<»  is tighter('infix:===') { ... }
 
 proto 'infix:|' is tighter('infix:«<=»')  { ... }
 proto 'infix:^' is equiv('infix:|')  { ... }
@@ -477,22 +475,22 @@
 proto 'infix:+' is tighter(infix:«<<»)
                 is pirop('n_add')       { ... }
 
-proto 'infix:-' is equal('infix:+')
+proto 'infix:-' is equiv('infix:+')
                 is pirop('n_sub')       { ... }
 
 proto 'infix:*' is tighter('infix:+')
                 is pirop('n_mul')       { ... }
 
-proto 'infix:/' is equal('infix:*')
+proto 'infix:/' is equiv('infix:*')
                 is pirop('n_div')       { ... }
 
-proto 'infix:%' is equal('infix:*')
+proto 'infix:%' is equiv('infix:*')
                 is pirop('n_mod')       { ... }
 
-proto 'prefix:+' is tighter('infix:*')  { ... }
-proto 'prefix:-' is equal('prefix:+')  { ... }
-proto 'prefix:!' is equal('prefix:+')  { ... }
-proto 'prefix:~' is equal('prefix:+')  { ... }
+#proto 'prefix:+' is tighter('infix:*')  { ... }
+#proto 'prefix:-' is equiv('prefix:+')  { ... }
+#proto 'prefix:!' is equiv('prefix:+')  { ... }
+#proto 'prefix:~' is equiv('prefix:+')  { ... }
 
-proto 'term:'   is tighter('prefix:+')
+proto 'term:'   is tighter('infix:*')
                 is parsed(&primary)     { ... }

Modified: branches/pdd25cx/languages/cardinal/t/00-sanity.t
==============================================================================
--- branches/pdd25cx/languages/cardinal/t/00-sanity.t	(original)
+++ branches/pdd25cx/languages/cardinal/t/00-sanity.t	Sat May 10 07:12:21 2008
@@ -1,15 +1,15 @@
-print "1..6" if 1
+puts "1..6" if 1
 
-print "ok 1\n"
+puts "ok 1"
 
-print "ok \
-       2\n"
+puts "ok \
+       2"
 
-print "ok 3\n" ; print "ok 4\n"
+puts "ok 3" ; puts "ok 4"
 
 print "ok "; print 1 + 4; print "\n"
 
-print "ok "; print 2 * 3
+print "ok "; puts 2 * 3
 
 
 

Modified: branches/pdd25cx/languages/cardinal/t/01-stmts.t
==============================================================================
--- branches/pdd25cx/languages/cardinal/t/01-stmts.t	(original)
+++ branches/pdd25cx/languages/cardinal/t/01-stmts.t	Sat May 10 07:12:21 2008
@@ -1,13 +1,13 @@
-print "1..2\n"
+puts "1..2"
 
 if 1 then
-  print "ok 1\n"
+  puts "ok 1"
 else
-  print "nok 1\n"
+  puts "nok 1"
 end
 
 unless 0
-  print "ok 2\n"
+  puts "ok 2"
 end
 
 

Modified: branches/pdd25cx/languages/cardinal/t/02-functions.t
==============================================================================
--- branches/pdd25cx/languages/cardinal/t/02-functions.t	(original)
+++ branches/pdd25cx/languages/cardinal/t/02-functions.t	Sat May 10 07:12:21 2008
@@ -1,11 +1,11 @@
-print "1..4\n"
+puts "1..5"
 
 def first
-    print "ok 1"
+    puts "ok 1"
 end
 
 def second(n)
-    print "ok ", n
+    puts "ok ", n
 end
 
 def third(a,b)
@@ -13,6 +13,15 @@
     second(b)
 end
 
+def fib(n)
+  if n<2
+    n
+  else
+    fib(n-2)+fib(n-1)
+  end
+end
+
 first()
 second(2)
 third(3,4)
+second fib(6) - 3;

Modified: branches/pdd25cx/languages/eclectus/compiler.scm
==============================================================================
--- branches/pdd25cx/languages/eclectus/compiler.scm	(original)
+++ branches/pdd25cx/languages/eclectus/compiler.scm	Sat May 10 07:12:21 2008
@@ -1,170 +1,23 @@
 ; $Id$
 
-; Generate driver and PAST for Eclectus
+; Generate PAST for Eclectus
 
-;; Helpers that emit PIR
-
-; unique ids for registers
-(define counter 1000)
-(define (gen-unique-id)
-  (set! counter (+ 1 counter))
-  counter)
+;; Helpers for generating PAST
 
 (define (make-past-conser type)
   (let ((type-symbol (string->symbol type)))
     (lambda args
       (cons type-symbol args))))
 
-(define past::op (make-past-conser "PAST::Op"))
-(define past::val (make-past-conser "PAST::Val"))
-(define past::var (make-past-conser "PAST::Var"))
+(define past::op    (make-past-conser "PAST::Op"))
+(define past::val   (make-past-conser "PAST::Val"))
+(define past::var   (make-past-conser "PAST::Var"))
 (define past::block (make-past-conser "PAST::Block"))
 (define past::stmts
   (let ((type-symbol (string->symbol "PAST::Stmts")))
     (lambda (stmts)
       (cons type-symbol stmts))))
 
-; Emit PIR that loads libs
-(define emit-init
-  (lambda ()
-    (emit "
-          # PIR generated by compiler.scm
-          
-          # The dynamics PMCs used by Eclectus are loaded
-          .loadlib 'eclectus_group'
-          
-          # for devel
-          .include 'library/dumper.pir'
-          
-          .namespace
-          
-          .sub '__onload' :init
-              load_bytecode 'PGE.pbc'
-              load_bytecode 'PGE/Text.pbc'
-              load_bytecode 'PGE/Util.pbc'
-              load_bytecode 'PGE/Dumper.pbc'
-              load_bytecode 'PCT.pbc'
-          .end
-          ")))
-
-; Emit PIR that prints the value returned by scheme_entry()
-(define emit-driver
-  (lambda ()
-    (emit "
-          .sub drive :main
-          
-              .local pmc stmts
-              ( stmts ) = scheme_entry()
-              # _dumper( stmts, 'stmts' )
-          
-              # compile and evaluate
-              .local pmc past_compiler
-              past_compiler = new [ 'PCT::HLLCompiler' ]
-              $P0 = split ' ', 'post pir'
-              past_compiler.'stages'( $P0 )
-              $P1 = past_compiler.'eval'(stmts)
-              #_dumper ($P1)
-              $P0 = split ' ', 'evalpmc'
-              past_compiler.'stages'( $P0 )
-              past_compiler.'eval'( $P1 )
-          .end
-          ")))
-
-; emit the PIR library
-(define emit-builtins
-  (lambda ()
-    (emit "
-          .sub '__initconst' :init
-              $P0 = new 'EclectusBoolean'
-              $P0 = 1
-              set_root_global ['_eclectus'], '#t', $P0
-              $P0 = new 'EclectusBoolean'
-              set_root_global ['_eclectus'], '#f', $P0
-              $P0 = new 'EclectusEmptyList'
-              set_root_global ['_eclectus'], '()', $P0
-          .end
-
-          .sub 'say'
-              .param pmc args :slurpy
-              if null args goto end
-              .local pmc iter
-              iter = new 'Iterator', args
-          loop:
-              unless iter goto end
-              $P0 = shift iter
-              print $P0
-              goto loop
-          end:
-              say ''
-              .return ()
-          .end
-          
-          .sub 'infix:<'
-              .param num a
-              .param num b
-              $I0 = islt a, b
-
-              .return ($I0)
-          .end
-
-          .sub 'infix:<='
-              .param num a
-              .param num b
-              $I0 = isle a, b
-
-              .return ($I0)
-          .end
-
-          .sub 'infix:=='
-              .param pmc a
-              .param pmc b
-              $I0 = cmp_num a, b
-              $I0 = iseq $I0, 0
-          
-              .return ($I0)
-          .end
-
-          .sub 'infix:>='
-              .param num a
-              .param num b
-              $I0 = isge a, b
-
-              .return ($I0)
-          .end
-
-          .sub 'infix:>'
-              .param num a
-              .param num b
-              $I0 = isgt a, b
-
-              .return ($I0)
-          .end
-
-          .sub 'eq?'
-              .param pmc a
-              .param pmc b
-              $I0 = issame a, b
-
-              .return ($I0)
-          .end
-
-          .sub 'eqv?'
-              .param pmc a
-              .param pmc b
-              $I0 = iseq a, b
-
-              .return ($I0)
-          .end
-
-          .sub 'equal?'
-              .param pmc a
-              .param pmc b
-              $I0 = iseq a, b
-
-              .return ($I0)
-          .end
-          ")))
-
 ; recognition of forms
 (define make-combination-predicate
   (lambda (name)
@@ -214,7 +67,7 @@
   (lambda (x)
     (and (pair? x) (lookup-primitive (car x)))))
 
-; implementatus of primitive functions are added
+; implementations of primitive functions are added
 ; with 'define-primitive'
 (define-syntax define-primitive
   (syntax-rules ()
@@ -224,69 +77,59 @@
                      (make-primitive (length '(arg* ...))
                                      (lambda (arg* ...) b b* ...))))))
 
-; implementation of fxadd1
+;; arithmetic forms
 (define-primitive (fxadd1 arg)
   (past::op '(@ (pirop "n_add"))
             (emit-expr arg)
             (emit-expr 1)))
 
-; implementation of fx+
 (define-primitive (fx+ arg1 arg2)
   (past::op '(@ (pirop "n_add"))
             (emit-expr arg1)
             (emit-expr arg2)))
 
-; implementation of fxsub1
 (define-primitive (fxsub1 arg)
-  (past::op
-        '(@ (pirop "n_sub"))
-        (emit-expr arg)
-        (emit-expr 1)))
+  (past::op '(@ (pirop "n_sub"))
+            (emit-expr arg)
+            (emit-expr 1)))
 
-; implementation of fx-
 (define-primitive (fx- arg1 arg2)
   (past::op '(@ (pirop "n_sub"))
             (emit-expr arg1)
             (emit-expr arg2)))
 
-; implementation of fxlogand
 (define-primitive (fxlogand arg1 arg2)
   (past::op '(@ (pirop "n_band"))
             (emit-expr arg1)
             (emit-expr arg2)))
 
-; implementation of fxlogor
 (define-primitive (fxlogor arg1 arg2)
   (past::op '(@ (pirop "n_bor"))
             (emit-expr arg1)
             (emit-expr arg2)))
 
-; implementation of char->fixnum
 (define-primitive (char->fixnum arg)
   (past::op '(@ (pasttype "inline")
                 (inline "new %r, 'EclectusFixnum'\\nassign %r, %0\\n"))
             (emit-expr arg)))
 
-; implementation of fixnum->char
 (define-primitive (fixnum->char arg)
   (past::op '(@ (pasttype "inline")
                 (inline "new %r, 'EclectusCharacter'\\nassign %r, %0\\n"))
             (emit-expr arg)))
 
-; implementation of cons
+;; list forms
 (define-primitive (cons arg1 arg2)
   (past::op '(@ (pasttype "inline")
                 (inline "new %r, 'EclectusPair'\\nset %r[%0], %1\\n"))
             (emit-expr arg1)
             (emit-expr arg2)))
 
-; implementation of car
 (define-primitive (car arg)
   (past::op '(@ (pasttype "inline")
                 (inline "%r = %0.'key'()\\n"))
             (emit-expr arg)))
 
-; implementation of cdr
 (define-primitive (cdr arg)
   (past::op '(@ (pasttype "inline")
                 (inline "%r = %0.'value'()\\n"))
@@ -302,49 +145,39 @@
               (emit-expr #t)
               (emit-expr #f))))
 
-; implementation of char<
+;; comparison forms
 (define-primitive (char< arg1 arg2)
-  (emit-comparison "infix:<" arg1 arg2))
+  (emit-comparison "eclectus:<" arg1 arg2))
 
-; implementation of char<=
 (define-primitive (char<= arg1 arg2)
-  (emit-comparison "infix:<=" arg1 arg2))
+  (emit-comparison "eclectus:<=" arg1 arg2))
 
-; implementation of char=
 (define-primitive (char= arg1 arg2)
-  (emit-comparison "infix:==" arg1 arg2))
+  (emit-comparison "eclectus:==" arg1 arg2))
 
-; implementation of char>
 (define-primitive (char> arg1 arg2)
-  (emit-comparison "infix:>" arg1 arg2))
+  (emit-comparison "eclectus:>" arg1 arg2))
 
-; implementation of char>=
 (define-primitive (char>= arg1 arg2)
-  (emit-comparison "infix:>=" arg1 arg2))
+  (emit-comparison "eclectus:>=" arg1 arg2))
 
-; implementation of fxzero?
 (define-primitive (fxzero? arg)
-  (emit-comparison "infix:==" arg 0))
+  (emit-comparison "eclectus:==" arg 0))
 
-; implementation of fx<
 (define-primitive (fx< arg1 arg2)
-  (emit-comparison "infix:<" arg1 arg2))
+  (emit-comparison "eclectus:<" arg1 arg2))
 
-; implementation of fx<=
 (define-primitive (fx<= arg1 arg2)
-  (emit-comparison "infix:<=" arg1 arg2))
+  (emit-comparison "eclectus:<=" arg1 arg2))
 
-; implementation of fx=
 (define-primitive (fx= arg1 arg2)
-  (emit-comparison "infix:==" arg1 arg2))
+  (emit-comparison "eclectus:==" arg1 arg2))
 
-; implementation of fx>=
 (define-primitive (fx>= arg1 arg2)
-  (emit-comparison "infix:>=" arg1 arg2))
+  (emit-comparison "eclectus:>=" arg1 arg2))
 
-; implementation of fx>
 (define-primitive (fx> arg1 arg2)
-  (emit-comparison "infix:>" arg1 arg2))
+  (emit-comparison "eclectus:>" arg1 arg2))
 
 (define-primitive (eq? arg1 arg2)
   (emit-comparison "eq?" arg1 arg2))
@@ -362,14 +195,15 @@
 (define emit-typequery
   (lambda (typename arg)
     (past::op
-     '(@ (pasttype "if"))
-     (past::op
-      `(@ (pasttype "inline")
-          (inline ,(format #f "new %r, 'EclectusBoolean'\\nisa $I1, %0, '~a'\\n %r = $I1" typename)))
-      (emit-expr arg))
-     (emit-expr #t)
-     (emit-expr #f))))
+      '(@ (pasttype "if"))
+      (past::op
+        `(@ (pasttype "inline")
+            (inline ,(format #f "new %r, 'EclectusBoolean'\\nisa $I1, %0, '~a'\\n %r = $I1" typename)))
+        (emit-expr arg))
+      (emit-expr #t)
+      (emit-expr #f))))
    
+;; type queries
 (define-primitive (boolean? arg)
   (emit-typequery "EclectusBoolean" arg))
 
@@ -385,18 +219,10 @@
 (define-primitive (pair? arg)
   (emit-typequery "EclectusPair" arg))
 
-
-
-(define emit-function-header
-  (lambda (function-name)
-    (emit (string-append ".sub " function-name))))
-
-(define emit-function-footer
-  (lambda (reg)
-    (emit "
-            .return( reg_~a )
-          .end
-          " reg)))
+;; inout and output
+(define-primitive (newline)
+  (past::op '(@ (pasttype "call")
+                (name "say"))))
 
 (define emit-primcall
   (lambda (x)
@@ -499,32 +325,6 @@
       ((primcall? x)        (emit-primcall x))
       (else                 (emit-functional-application x)))))
 
-; eventually this will become a PIR generator
-; for PAST as SXML
-; currently it only handles the pushes
-(define past-sxml->past-pir
-  (lambda (past)
-    (let ((uid (gen-unique-id)))
-      ;(diag (format "to_pir: ~a" past))
-      (emit "
-            .local pmc reg_~a
-            reg_~a = new '~a'
-            " uid uid (symbol->string (car past)))
-      (for-each
-        (lambda (daughter)
-          (if (eq? '@ (car daughter))
-            (for-each
-              (lambda (key_val)
-                (emit "
-                      reg_~a.init( '~a' => \"~a\" )
-                      " uid (car key_val) (cadr key_val)))
-                (cdr daughter))
-              (emit "
-                    reg_~a.push( reg_~a )
-                    " uid (past-sxml->past-pir daughter))))
-        (cdr past))
-      uid)))
-
 ; eventually this will become a NQP generator
 ; for PAST as SXML
 ; currently it only handles the pushes
@@ -543,7 +343,9 @@
                      :~a(\"~a\"),
                      " (car key_val) (cadr key_val)))
              (cdr daughter))
-           (past-sxml->past-nqp daughter)))
+           (begin
+             (past-sxml->past-nqp daughter)
+             (emit ","))))
        (cdr past))
     (emit ")")))
 
@@ -551,27 +353,15 @@
 (define wrap-say
   (lambda (past)
     (past::op
-     '(@ (pasttype "call")
-         (name "say"))
-     past)))
+      '(@ (pasttype "call")
+          (name "say"))
+      past)))
 
 ;; Macro-expansion and alpha-conversion
 (define (normalize-syntax program)
   (sexp/expand program (make-sexp-environment)))
 
-; the current compiler, emitting PAST set up in PIR
-(define compile-program-old
-  (lambda (program)
-    (emit-init)
-    (emit-driver)
-    (emit-builtins)
-    (emit-function-header "scheme_entry")
-    (emit-function-footer
-      (past-sxml->past-pir
-        (wrap-say
-          (emit-expr (normalize-syntax program)))))))
-
-; the future compiler, emitting PAST set up in PIR
+; emit the PAST as a NQP subroutine
 (define compile-program
   (lambda (program)
     (emit "sub scheme_entry () { " ) 

Modified: branches/pdd25cx/languages/eclectus/config/makefiles/root.in
==============================================================================
--- branches/pdd25cx/languages/eclectus/config/makefiles/root.in	(original)
+++ branches/pdd25cx/languages/eclectus/config/makefiles/root.in	Sat May 10 07:12:21 2008
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, The Perl Foundation.
+# Copyright (C) 2007-2008, The Perl Foundation.
 # $Id$
 
 # Makefile for languages/eclectus
@@ -9,6 +9,7 @@
 O               = @o@
 
 # Set up commands
+PARROT          = ../../parrot@exe@
 PERL            = @perl@
 RM_F            = @rm_f@
 RECONFIGURE     = $(PERL) @build_dir@/tools/dev/reconfigure.pl
@@ -60,7 +61,7 @@
 	cd $(BUILD_DIR) && $(RECONFIGURE) --step=gen::languages --languages=eclectus
 
 # Compilation:
-build: $(ECLECTUS_GROUP)
+build: $(ECLECTUS_GROUP) driver_nqp.pbc
 
 $(ECLECTUS_GROUP): $(PARROT) $(PMC_SOURCES)
 	cd $(PMC_DIR) && $(BUILD_DYNPMC) generate $(PMCS)
@@ -68,14 +69,19 @@
 	cd $(PMC_DIR) && $(BUILD_DYNPMC) linklibs $(PMCS)
 	cd $(PMC_DIR) && $(BUILD_DYNPMC) copy --destination=$(PARROT_DYNEXT) $(PMCS)
 
+driver_nqp.pbc: src/builtins/all.pbc driver_nqp.pir
+	$(PARROT) -o driver_nqp.pbc driver_nqp.pir
+
+src/builtins/all.pbc: src/builtins/all.pir
+	$(PARROT) -o src/builtins/all.pbc src/builtins/all.pir
+
 # cleaning up
 
-clean: dynext-clean
+clean: dynext-clean test-clean
 	$(RM_F) \
-  "*.out" \
-  stst.pir \
-  gen_past.nqp \
-  gen_past.pir
+  stst.out \
+  driver_nqp.pbc \
+  src/builtins/all.pbc
 
 dynext-clean:
 	$(RM_F) \
@@ -97,3 +103,7 @@
 # testing
 test: build
 	$(PERL) t/harness
+
+test-clean:
+	$(RM_F) t/*.nqp
+	$(RM_F) t/*.pir

Modified: branches/pdd25cx/languages/eclectus/docs/eclectus.pod
==============================================================================
--- branches/pdd25cx/languages/eclectus/docs/eclectus.pod	(original)
+++ branches/pdd25cx/languages/eclectus/docs/eclectus.pod	Sat May 10 07:12:21 2008
@@ -5,6 +5,17 @@
 Eclectus aims to be a Scheme to PIR compiler implemented in Scheme.
 It is based on Abdulaziz Ghuloums compiler tutorial.
 
+=head1 Design
+
+Scheme code is compiled into a cons representing a Parrot Abstract Syntax Tree.
+This compilation is done with the help of riaxpander.
+This cons PAST is in the form of a S-XML data structure.
+The cons PAST is being emitted as NQP code.
+The emitted code is compiled to PIR and is being run with a PIR wrapper.
+Library functions are implemented in PIR.
+
+There is a lot of room for improvements.
+
 =head1 Status
 
 Going through the tutorial.
@@ -21,10 +32,13 @@
 unified languages testing the Eclectus tests are skipped, when
 the is no 'gauche 0.8' around.
 
+Run individual test scripts with e.g.:
+
+   gosh -fcase-fold -I .  -I riaxpander -l gauche/prelude.scm t/unary_primitives.t
+
 =head1 TODO
 
 - Bring Eclectus back to unified languages testing
-- Switch to NQP as the PAST generating code
 - support for strings
 - support for pairs
 - support for 'letrec
@@ -33,7 +47,7 @@
 
 =head1 AUTHOR
 
-Bernhard Schmalhofer
+Bernhard Schmalhofer, Andreas Rottmann
 
 =head1 SEE ALSO
 
@@ -50,3 +64,7 @@
 L<http://www-pu.informatik.uni-tuebingen.de/users/sperber/info-i-9900/material/konstruktion/konstruktion-10.ps>
 
 L<http://okmij.org/ftp/Scheme/SXML.html>
+
+L<http://www.canonical.org/~kragen/sw/urscheme/>
+
+=cut

Modified: branches/pdd25cx/languages/eclectus/driver_nqp.pir
==============================================================================
--- branches/pdd25cx/languages/eclectus/driver_nqp.pir	(original)
+++ branches/pdd25cx/languages/eclectus/driver_nqp.pir	Sat May 10 07:12:21 2008
@@ -5,7 +5,6 @@
 
 # for devel
 .include 'library/dumper.pir'
-.include 'gen_past.pir'
 
 .namespace
 
@@ -15,16 +14,39 @@
     load_bytecode 'PGE/Util.pbc'
     load_bytecode 'PGE/Dumper.pbc'
     load_bytecode 'PCT.pbc'
+
+    load_bytecode 'languages/eclectus/src/builtins/all.pbc'
 .end
 
 
 .sub drive :main
 
+    .param pmc argv
+
+    .local string program_name, nqp_fn
+    program_name = shift argv
+    nqp_fn       = shift argv
+
+    # compile NQP to PIR
+    .local string pir_fn, cmd
+    .local int ret
+    clone pir_fn, nqp_fn
+    substr pir_fn, -3, 3, 'pir'
+    cmd = "../../parrot ../../compilers/nqp/nqp.pbc --target=pir --output="
+    concat cmd, pir_fn
+    concat cmd, " "
+    concat cmd, nqp_fn
+    # say cmd
+    ret = spawnw cmd
+
+    # load the generated PIR
+    $S1 = concat "languages/eclectus/", pir_fn
+    load_bytecode $S1
+
     .local pmc stmts
     ( stmts ) = scheme_entry()
-    # _dumper( stmts, 'stmts' )
 
-    # compile and evaluate
+    # compile and evaluate the PAST returned from scheme_entry()
     .local pmc past_compiler
     past_compiler = new [ 'PCT::HLLCompiler' ]
     $P0 = split ' ', 'post pir'
@@ -47,86 +69,6 @@
     set_root_global ['_eclectus'], '()', $P0
 .end
 
-.sub 'say'
-    .param pmc args :slurpy
-    if null args goto end
-    .local pmc iter
-    iter = new 'Iterator', args
-loop:
-    unless iter goto end
-    $P0 = shift iter
-    print $P0
-    goto loop
-end:
-    say ''
-    .return ()
-.end
-
-.sub 'infix:<'
-    .param num a
-    .param num b
-    $I0 = islt a, b
-
-    .return ($I0)
-.end
-
-.sub 'infix:<='
-    .param num a
-    .param num b
-    $I0 = isle a, b
-
-    .return ($I0)
-.end
-
-.sub 'infix:=='
-    .param pmc a
-    .param pmc b
-    $I0 = cmp_num a, b
-    $I0 = iseq $I0, 0
-
-    .return ($I0)
-.end
-
-.sub 'infix:>='
-    .param num a
-    .param num b
-    $I0 = isge a, b
-
-    .return ($I0)
-.end
-
-.sub 'infix:>'
-    .param num a
-    .param num b
-    $I0 = isgt a, b
-
-    .return ($I0)
-.end
-
-.sub 'eq?'
-    .param pmc a
-    .param pmc b
-    $I0 = issame a, b
-
-    .return ($I0)
-.end
-
-.sub 'eqv?'
-    .param pmc a
-    .param pmc b
-    $I0 = iseq a, b
-
-    .return ($I0)
-.end
-
-.sub 'equal?'
-    .param pmc a
-    .param pmc b
-    $I0 = iseq a, b
-
-    .return ($I0)
-.end
-
 # Local Variables:
 #   mode: pir
 #   fill-column: 100

Modified: branches/pdd25cx/languages/eclectus/t/begin.t
==============================================================================
--- branches/pdd25cx/languages/eclectus/t/begin.t	(original)
+++ branches/pdd25cx/languages/eclectus/t/begin.t	Sat May 10 07:12:21 2008
@@ -3,9 +3,10 @@
 (load "tests-driver.scm") ; this should come first
 
 (add-tests-with-string-output "begin"
-  ((begin)       => "\n")
-  ((begin 42)    => "42\n")
-  ((begin 1 2 3) => "3\n")
+  ((begin)                 => "\n")
+  ((begin 42)              => "42\n")
+  ((begin 1 2 3)           => "3\n")
+  ((begin (begin 1 2 3 4)) => "4\n")
 )
 
 (load "compiler.scm")

Modified: branches/pdd25cx/languages/eclectus/t/binary_primitives.t
==============================================================================
--- branches/pdd25cx/languages/eclectus/t/binary_primitives.t	(original)
+++ branches/pdd25cx/languages/eclectus/t/binary_primitives.t	Sat May 10 07:12:21 2008
@@ -3,7 +3,7 @@
 (load "tests-driver.scm")
 (load "compiler.scm")
 
-(add-tests-with-string-output "binary primitives"      
+(add-tests-with-string-output "binary_primitives"      
   ((fx+ 1 13)                                   => "14\n" )
   ((fx+ 1 (fx+ 7 6))                            => "14\n" )
   ((fx+ 1 (fx+ 7 (fxadd1 5)))                   => "14\n" )

Modified: branches/pdd25cx/languages/eclectus/t/characters.t
==============================================================================
--- branches/pdd25cx/languages/eclectus/t/characters.t	(original)
+++ branches/pdd25cx/languages/eclectus/t/characters.t	Sat May 10 07:12:21 2008
@@ -2,7 +2,7 @@
 
 (load "tests-driver.scm") ; this should come first
 
-(add-tests-with-string-output "booleans"      
+(add-tests-with-string-output "characters"      
   (#\a  => "#\\a\n")                    
   (#\A  => "#\\A\n")                    
   (#\z  => "#\\z\n")                    

Modified: branches/pdd25cx/languages/eclectus/t/conditionals.t
==============================================================================
--- branches/pdd25cx/languages/eclectus/t/conditionals.t	(original)
+++ branches/pdd25cx/languages/eclectus/t/conditionals.t	Sat May 10 07:12:21 2008
@@ -3,7 +3,7 @@
 (load "tests-driver.scm")
 (load "compiler.scm")
 
-(add-tests-with-string-output "conditional expressions"      
+(add-tests-with-string-output "conditionals"      
   ((if #t 1 0)                                   => "1\n" )
   ((if #f 1 0)                                   => "0\n" )
   ((if 0 1 0)                                    => "1\n" )

Modified: branches/pdd25cx/languages/eclectus/t/empty_list.t
==============================================================================
--- branches/pdd25cx/languages/eclectus/t/empty_list.t	(original)
+++ branches/pdd25cx/languages/eclectus/t/empty_list.t	Sat May 10 07:12:21 2008
@@ -2,7 +2,7 @@
 
 (load "tests-driver.scm") ; this should come first
 
-(add-tests-with-string-output "empty list"
+(add-tests-with-string-output "empty_list"
   ('()  => "()\n"))
 
 (load "compiler.scm")

Modified: branches/pdd25cx/languages/eclectus/t/local_variables.t
==============================================================================
--- branches/pdd25cx/languages/eclectus/t/local_variables.t	(original)
+++ branches/pdd25cx/languages/eclectus/t/local_variables.t	Sat May 10 07:12:21 2008
@@ -2,7 +2,7 @@
 
 (load "tests-driver.scm") ; this should come first
 
-(add-tests-with-string-output "local variables"
+(add-tests-with-string-output "local_variables"
   ((let () 13)                                             => "13\n")     
   ((let (($var_a 17)) 13)                                  => "13\n")     
   ((let ((var-a 17)) 13)                                   => "13\n")     

Modified: branches/pdd25cx/languages/eclectus/t/pair.t
==============================================================================
--- branches/pdd25cx/languages/eclectus/t/pair.t	(original)
+++ branches/pdd25cx/languages/eclectus/t/pair.t	Sat May 10 07:12:21 2008
@@ -2,7 +2,7 @@
 
 (load "tests-driver.scm") ; this should come first
 
-(add-tests-with-string-output "booleans"      
+(add-tests-with-string-output "pair"      
   ((pair? '())                   => "#f\n")
   ((pair? #\A)                   => "#f\n")
   ((pair? (fx+ 1 2))             => "#f\n")

Modified: branches/pdd25cx/languages/eclectus/t/procedures.t
==============================================================================
--- branches/pdd25cx/languages/eclectus/t/procedures.t	(original)
+++ branches/pdd25cx/languages/eclectus/t/procedures.t	Sat May 10 07:12:21 2008
@@ -2,7 +2,7 @@
 
 (load "tests-driver.scm") ; this should come first
 
-(add-tests-with-string-output "local variables"
+(add-tests-with-string-output "procedures"
   (((lambda () 18))                                       => "18\n")     
   (((lambda () (fx- 20 2)))                               => "18\n")     
   (((lambda () (fx- 36 (fx- 20 2))))                      => "18\n")     

Modified: branches/pdd25cx/languages/eclectus/t/unary_primitives.t
==============================================================================
--- branches/pdd25cx/languages/eclectus/t/unary_primitives.t	(original)
+++ branches/pdd25cx/languages/eclectus/t/unary_primitives.t	Sat May 10 07:12:21 2008
@@ -3,7 +3,7 @@
 (load "tests-driver.scm")
 (load "compiler.scm")
 
-(add-tests-with-string-output "unary primitives"      
+(add-tests-with-string-output "unary_primitives"      
   ((fxadd1 -2)                            => "-1\n" )
   ((fxadd1 -1)                            => "0\n" )
   ((fxadd1 0)                             => "1\n" )

Modified: branches/pdd25cx/languages/eclectus/tests-driver.scm
==============================================================================
--- branches/pdd25cx/languages/eclectus/tests-driver.scm	(original)
+++ branches/pdd25cx/languages/eclectus/tests-driver.scm	Sat May 10 07:12:21 2008
@@ -10,14 +10,13 @@
 ; Choose which scheme implementation should be tested.
 ; Choosing 'gauche' is meant for checking the test suite.
 ;(define implementation "gauche" )
-(define implementation "gen_past_in_pir" )          ; current default implementation
-;(define implementation "gen_past_in_nqp" )         ; future default implementation
+(define implementation "gen_past_in_nqp" )         ; future default implementation
 
 (define-syntax add-tests-with-string-output
   (syntax-rules (=>)
     ((_ test-name (expr => output-string) ...)
      (set! all-tests
-        (cons 
+        (cons
            '(test-name (expr string  output-string) ...)
             all-tests)))))
 
@@ -57,22 +56,16 @@
          (error 'compile-port "not an output port ~s" p))
        p)))
 
-(define (run-compile expr)
+(define (run-compile expr nqp-fn)
   (cond 
     ( (string=? implementation "gauche")
       (with-output-to-file "stst.scm" (lambda () (write expr))))
-    ( (string=? implementation "gen_past_in_nqp")
-      (let ((p (open-output-file "gen_past.nqp" 'replace)))
-        (parameterize ((compile-port p))
-           (compile-program expr))
-        (close-output-port p))
-      (unless (zero? (system (string-append *path-to-parrot* " ../../compilers/nqp/nqp.pbc --output=gen_past.pir --target=pir gen_past.nqp")))
-        (error 'execute "produced program exited abnormally")))
     (else
-      (let ((p (open-output-file "stst.pir" 'replace)))
-        (parameterize ((compile-port p))
-           (compile-program-old expr))
-        (close-output-port p)))))
+      ; compile to NQP
+      (let ((nqp-port (open-output-file nqp-fn 'replace)))
+        (parameterize ((compile-port nqp-port))
+          (compile-program expr))
+        (close-output-port nqp-port)))))
 
 ; TODO: can I use (directory-separator) in gauche?
 (define *path-to-parrot*
@@ -80,16 +73,14 @@
     "../../parrot"
     "..\\..\\parrot"))
 
-(define (execute)
+(define (execute nqp-fn)
   (cond
     ( (string=? implementation "gauche")
       (unless (zero? (system "gosh -fcase-fold -I .  -l gauche/prelude.scm stst.scm > stst.out"))
         (error 'execute "produced program exited abnormally")))
-    ( (string=? implementation "gen_past_in_nqp")
-      (unless (zero? (system (string-append *path-to-parrot* " driver_nqp.pir > stst.out")))
-        (error 'execute "produced program exited abnormally")))
     (else
-      (unless (zero? (system (string-append *path-to-parrot* " stst.pir > stst.out")))
+      ; run NQP with driver_nqp.pbc
+      (unless (zero? (system (string-append *path-to-parrot* " driver_nqp.pbc " nqp-fn " > stst.out")))
         (error 'execute "produced program exited abnormally")))))
 
 (define (get-string)
@@ -105,13 +96,14 @@
                 (f))))))))))
 
 (define (test-with-string-output test-id expr expected-output test-name)
-   (run-compile expr)
-   (execute)
-   (let ((actual-output (get-string)))
-     (if (string=? expected-output actual-output)
-         (pass ( + test-id 1 ) (format #f "~a: ~a" test-name expr))
-         (fail ( + test-id 1 ) (format #f "~a: expected ~s, got ~s"
-                                       test-name expected-output actual-output)))))
+  (let ((nqp-fn (string-append "t/" test-name "_" (number->string test-id) ".nqp" )))
+    (run-compile expr nqp-fn)
+    (execute nqp-fn))
+  (let ((actual-output (get-string)))
+    (if (string=? expected-output actual-output)
+      (pass ( + test-id 1 ) (format #f "~a: ~a" test-name expr))
+      (fail ( + test-id 1 ) (format #f "~a: expected ~s, got ~s"
+                                     test-name expected-output actual-output)))))
 
 (define (emit . args)
   (apply fprintf (compile-port) args)

Modified: branches/pdd25cx/languages/lolcode/src/parser/grammar.pg
==============================================================================
--- branches/pdd25cx/languages/lolcode/src/parser/grammar.pg	(original)
+++ branches/pdd25cx/languages/lolcode/src/parser/grammar.pg	Sat May 10 07:12:21 2008
@@ -12,7 +12,7 @@
     'HAI' <version> <statement_terminator>
     <block>
     'KTHXBYE' <statement_terminator>
-    [ $ || <panic: Syntax error> ]
+    [ $ || <panic: 'Syntax error'> ]
     {*}
 }
 

Modified: branches/pdd25cx/languages/lua/config/makefiles/root.in
==============================================================================
--- branches/pdd25cx/languages/lua/config/makefiles/root.in	(original)
+++ branches/pdd25cx/languages/lua/config/makefiles/root.in	Sat May 10 07:12:21 2008
@@ -26,6 +26,7 @@
  lua \
  luaany \
  luaboolean \
+ luabytecode \
  luaclosure \
  luafunction \
  luanil \
@@ -39,6 +40,7 @@
  $(PMCDIR)/lua.pmc \
  $(PMCDIR)/luaany.pmc \
  $(PMCDIR)/luaboolean.pmc \
+ $(PMCDIR)/luabytecode.pmc \
  $(PMCDIR)/luaclosure.pmc \
  $(PMCDIR)/luafunction.pmc \
  $(PMCDIR)/luanil.pmc \
@@ -81,7 +83,8 @@
  src/dumplex_gen.pir \
  src/lua51_gen.pir \
  src/PASTGrammar_gen.pir \
- src/POSTGrammar_gen.pir
+ src/POSTGrammar_gen.pir \
+ $(LIBPATH)/luabytecode_gen.pir
 
 GEN_PBC = \
  lua.pbc
@@ -201,6 +204,9 @@
 $(LIBPATH)/uuid.pbc: $(LIBPATH)/uuid.pir
 	$(PARROT) --output=$(LIBPATH)/uuid.pbc $(LIBPATH)/uuid.pir
 
+$(LIBPATH)/luabytecode_gen.pir: $(LIBPATH)/luabytecode.rules src/build/translator.pl
+	$(PERL) src/build/translator.pl $(LIBPATH)/luabytecode.rules --output $(LIBPATH)/luabytecode_gen.pir
+
 src/yapp/Lua/parser.pm: src/yapp/Lua/lua51.yp
 	yapp -v -m Lua::parser -o src/yapp/Lua/parser.pm src/yapp/Lua/lua51.yp
 
@@ -235,6 +241,7 @@
  "t/pmc/*.pir" \
  "t/*.pir" \
  "t/*.lua" \
+ "t/*.luac" \
  "t/*.orig_out" \
  "t/*.parrot_out"
 

Modified: branches/pdd25cx/languages/lua/src/lua51.pg
==============================================================================
--- branches/pdd25cx/languages/lua/src/lua51.pg	(original)
+++ branches/pdd25cx/languages/lua/src/lua51.pg	Sat May 10 07:12:21 2008
@@ -54,11 +54,11 @@
 
 
 rule if_stat {
-    'if' <expression> <?then> <block> <elseif_block>* <else_block>? <?end>
+    'if' <expression> <.then> <block> <elseif_block>* <else_block>? <.end>
 }
 
 rule elseif_block {
-    'elseif' <expression> <?then> <block>
+    'elseif' <expression> <.then> <block>
 }
 
 rule else_block {
@@ -67,12 +67,12 @@
 
 
 rule while_stat {
-    'while' <expression> <?do> <block> <?end>
+    'while' <expression> <.do> <block> <.end>
 }
 
 
 rule do_block {
-    'do' <block> <?end>
+    'do' <block> <.end>
 }
 
 
@@ -81,20 +81,20 @@
 }
 
 rule fornum {
-    <Name> '=' <expression> <?comma> <expression> [ ',' <expression> ]?
+    <Name> '=' <expression> <.comma> <expression> [ ',' <expression> ]?
 }
 
 rule forlist {
-    <name_list> <?in> <expression_list>
+    <name_list> <.in> <expression_list>
 }
 
 rule for_body {
-    <?do> <block> <?end>
+    <.do> <block> <.end>
 }
 
 
 rule repeat_stat {
-    'repeat' <block> <?until> <expression>
+    'repeat' <block> <.until> <expression>
 }
 
 
@@ -107,7 +107,7 @@
 }
 
 rule function_body {
-    '(' <parameter_list> <?closeparen> <block> <?end>
+    '(' <parameter_list> <.closeparen> <block> <.end>
 }
 
 rule parameter_list {
@@ -144,7 +144,7 @@
 
 
 rule constructor {
-    '{' <tablefieldlist>? <?closebrace>
+    '{' <tablefieldlist>? <.closebrace>
 }
 
 rule tablefieldlist {
@@ -160,7 +160,7 @@
 }
 
 rule index {
-    '[' <expression> <?closebracket>
+    '[' <expression> <.closebracket>
 }
 
 
@@ -174,7 +174,7 @@
 }
 
 rule parenthesed_expression {
-    '(' <expression> <?closeparen>
+    '(' <expression> <.closeparen>
 }
 
 rule slice_expression {
@@ -185,7 +185,7 @@
 }
 
 rule function_args {
-    | '(' <expression_list>? <?closeparen>
+    | '(' <expression_list>? <.closeparen>
     | <constructor>
     | <string>
 }
@@ -212,39 +212,39 @@
 =cut
 
 rule do {
-    'do' | <syntaxerror: 'do' expected>
+    'do' | <syntaxerror: "'do' expected">
 }
 
 rule then {
-    'then' | <syntaxerror: 'then' expected>
+    'then' | <syntaxerror: "'then' expected">
 }
 
 rule end {
-    'end' | <syntaxerror: 'end' expected>
+    'end' | <syntaxerror: "'end' expected">
 }
 
 rule until {
-    'until' | <syntaxerror: 'until' expected>
+    'until' | <syntaxerror: "'until' expected">
 }
 
 rule comma {
-    ',' | <syntaxerror: ',' expected>
+    ',' | <syntaxerror: "',' expected">
 }
 
 rule in {
-    'in' | <syntaxerror: 'in' expected>
+    'in' | <syntaxerror: "'in' expected">
 }
 
 rule closebracket {
-    ']'  | <syntaxerror: ']' expected>
+    ']'  | <syntaxerror: "']' expected">
 }
 
 rule closebrace {
-    '}' | <syntaxerror: '}' expected>
+    '}' | <syntaxerror: "'}' expected">
 }
 
 rule closeparen {
-    ')' | <syntaxerror: ')' expected>
+    ')' | <syntaxerror: "')' expected">
 }
 
 
@@ -256,8 +256,8 @@
 =cut
 
 token string {
-    | \" <quoted_literal: "> \"
-    | \' <quoted_literal: '> \'
+    | \" <quoted_literal: "\""> \"
+    | \' <quoted_literal: "'"> \'
     | <long_string>
 }
 
@@ -285,7 +285,7 @@
 }
 
 token eof {
-    $ | <syntaxerror: 'eof' expected>
+    $ | <syntaxerror: "'eof' expected">
 }
 
 token shebang {

Modified: branches/pdd25cx/languages/lua/src/pmc/lua.pmc
==============================================================================
--- branches/pdd25cx/languages/lua/src/pmc/lua.pmc	(original)
+++ branches/pdd25cx/languages/lua/src/pmc/lua.pmc	Sat May 10 07:12:21 2008
@@ -434,6 +434,7 @@
         retval = const_string(INTERP, "_._:0:");
         RETURN(STRING *retval);
     }
+
 }
 
 /*

Modified: branches/pdd25cx/languages/perl6/ROADMAP
==============================================================================
--- branches/pdd25cx/languages/perl6/ROADMAP	(original)
+++ branches/pdd25cx/languages/perl6/ROADMAP	Sat May 10 07:12:21 2008
@@ -12,6 +12,7 @@
 * regex, token, rule, grammar
 * selected libraries written in Perl 6
 * modules
+* I/O
 * junctions
 * hyper, reduction operators
 * lazy lists

Modified: branches/pdd25cx/languages/perl6/Test.pm
==============================================================================
--- branches/pdd25cx/languages/perl6/Test.pm	(original)
+++ branches/pdd25cx/languages/perl6/Test.pm	Sat May 10 07:12:21 2008
@@ -89,11 +89,15 @@
 
 sub diag($message) { say '# '~$message; }
 
+
+multi sub flunk($reason) { proclaim(0, "flunk $reason")}
+
+
 ## 'private' subs
 
 sub proclaim($cond, $desc) {
     $testing_started  = 1;
-    $desc = $todo_reason
+    $desc = $desc ~ $todo_reason
         if $todo_reason and $num_of_tests_run < $todo_upto_test_num;
     $num_of_tests_run = $num_of_tests_run + 1;
 

Modified: branches/pdd25cx/languages/perl6/config/makefiles/root.in
==============================================================================
--- branches/pdd25cx/languages/perl6/config/makefiles/root.in	(original)
+++ branches/pdd25cx/languages/perl6/config/makefiles/root.in	Sat May 10 07:12:21 2008
@@ -34,6 +34,7 @@
   src/gen_grammar.pir \
   src/gen_actions.pir \
   src/gen_builtins.pir \
+  src/parser/expression.pir \
   src/parser/quote_expression.pir \
   $(PERL6_GROUP)
 
@@ -56,6 +57,7 @@
   src/classes/Whatever.pir \
   src/classes/Capture.pir \
   src/classes/Subset.pir \
+  src/classes/Grammar.pir \
   src/builtins/assign.pir \
   src/builtins/cmp.pir \
   src/builtins/control.pir \

Modified: branches/pdd25cx/languages/perl6/docs/STATUS
==============================================================================
--- branches/pdd25cx/languages/perl6/docs/STATUS	(original)
+++ branches/pdd25cx/languages/perl6/docs/STATUS	Sat May 10 07:12:21 2008
@@ -48,6 +48,12 @@
 * open function for getting a file handle; supports some open modes
 * .say, .print and .close methods on file handles
 * iterating over file handles
+* conditional modifier + loop modifier
+* grammars
+* postcircumfix:<> for colonpairs
+* WHAT, HOW, WHENCE
+* .perl method on junctions, Num, Int and Str
+
 
 To do
 -----

Modified: branches/pdd25cx/languages/perl6/perl6.pir
==============================================================================
--- branches/pdd25cx/languages/perl6/perl6.pir	(original)
+++ branches/pdd25cx/languages/perl6/perl6.pir	Sat May 10 07:12:21 2008
@@ -48,7 +48,7 @@
     setattribute self, '@stages', $P0
 
     ##  set the command line options
-    $P0 = split ' ', 'c e=s help|h target=s trace|t=s encoding=s output|o=s combine each version|v'
+    $P0 = split ' ', 'c e=s help|h target=s trace|t=s encoding=s output|o=s version|v'
     setattribute self, '@cmdoptions', $P0
 
     ##  set the $usage attribute
@@ -107,6 +107,10 @@
     $P0 = new 'List'
     set_hll_global ['Perl6';'Grammar';'Actions'], '@?ROLE', $P0
 
+    ## create a list for holding the stack of nested grammars
+    $P0 = new 'List'
+    set_hll_global ['Perl6';'Grammar';'Actions'], '@?GRAMMAR', $P0
+
     ##  create a list of END blocks to be run
     $P0 = new 'List'
     set_hll_global ['Perl6'], '@?END_BLOCKS', $P0
@@ -197,6 +201,7 @@
 
 
 .include 'src/gen_grammar.pir'
+.include 'src/parser/expression.pir'
 .include 'src/parser/quote_expression.pir'
 .include 'src/gen_actions.pir'
 

Modified: branches/pdd25cx/languages/perl6/src/builtins/guts.pir
==============================================================================
--- branches/pdd25cx/languages/perl6/src/builtins/guts.pir	(original)
+++ branches/pdd25cx/languages/perl6/src/builtins/guts.pir	Sat May 10 07:12:21 2008
@@ -20,20 +20,31 @@
     .param pmc value
 
     # Any type information?
-    .local pmc type_info
+    .local pmc props, type_info
     push_eh do_assign
-    type_info = getattribute assignee, 'vartype'
+    props = getattribute assignee, '%!properties'
+    type_info = props['vartype']
     pop_eh
     if null type_info goto do_assign
     $I0 = type_info.ACCEPTS(value)
     if $I0 goto do_assign
+    $I0 = value.'isa'('Failure')
+    if $I0 goto do_assign_failure
     'die'("Type check failed")
 
-do_assign:
+  do_assign_failure:
+    # If it's a class type, we want to assign it's proto-object.
+    push_eh do_assign
+    $I0 = isa type_info, 'Perl6Protoobject'
+    unless $I0 goto do_assign
+    value = type_info
+    goto do_assign
+
+  do_assign:
     eq_addr assignee, value, no_copy
     copy assignee, value
     push_eh no_copy
-    setattribute assignee, 'vartype', type_info
+    setattribute assignee, '%!properties', props
     pop_eh
 no_copy:
     .return(assignee)

Modified: branches/pdd25cx/languages/perl6/src/builtins/named-unary.pir
==============================================================================
--- branches/pdd25cx/languages/perl6/src/builtins/named-unary.pir	(original)
+++ branches/pdd25cx/languages/perl6/src/builtins/named-unary.pir	Sat May 10 07:12:21 2008
@@ -25,6 +25,21 @@
 .end
 
 
+=item undefine $x
+
+Sets $x to an undefined value
+
+=cut
+
+.sub 'undefine'
+    .param pmc x
+    $P0 = new 'Undef'
+    copy x, $P0
+.end
+
+
+
+
 =item rand($x)
 
 Returns a random floating point number greater than or equal to zero and less

Modified: branches/pdd25cx/languages/perl6/src/classes/Int.pir
==============================================================================
--- branches/pdd25cx/languages/perl6/src/classes/Int.pir	(original)
+++ branches/pdd25cx/languages/perl6/src/classes/Int.pir	Sat May 10 07:12:21 2008
@@ -8,6 +8,15 @@
 
 .namespace [ 'Int' ]
 
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item onload
+
+=cut
+
 .sub 'onload' :anon :init :load
     $P0 = subclass 'Integer', 'Int'
     $P1 = get_hll_global 'Any'
@@ -19,12 +28,20 @@
 .end
 
 
+=item ACCEPTS()
+
+=cut
+
 .sub 'ACCEPTS' :method
     .param num topic
     .return 'infix:=='(topic, self)
 .end
 
 
+=item clone()
+
+=cut
+
 .sub 'clone' :method :vtable
     .local pmc clone_type
     clone_type = self.HOW()
@@ -34,6 +51,22 @@
 .end
 
 
+=item perl()
+
+Returns a Perl representation of the Int.
+
+=cut
+
+.sub 'perl' :method
+    $S0 = self
+    .return($S0)
+.end
+
+
+=back
+
+=cut
+
 # Local Variables:
 #   mode: pir
 #   fill-column: 100

Modified: branches/pdd25cx/languages/perl6/src/classes/Junction.pir
==============================================================================
--- branches/pdd25cx/languages/perl6/src/classes/Junction.pir	(original)
+++ branches/pdd25cx/languages/perl6/src/classes/Junction.pir	Sat May 10 07:12:21 2008
@@ -92,6 +92,61 @@
 .end
 
 
+=item perl()
+
+Returns a Perl representation of a junction.
+
+=cut
+
+.sub 'perl' :method
+    # Emit junction type.
+    .local int type
+    .local string res
+    type = self.'!type'()
+    if type == JUNCTION_TYPE_ALL goto all
+    if type == JUNCTION_TYPE_ANY goto any
+    if type == JUNCTION_TYPE_ONE goto one
+    if type == JUNCTION_TYPE_NONE goto none
+
+  all:
+    res = 'all'
+    goto okay
+  any:
+    res = 'any'
+    goto okay
+  one:
+    res = 'one'
+    goto okay
+  none:
+    res = 'none'
+    goto okay
+  okay:
+    concat res, '('
+
+    # Now emit .perl of all the values.
+    .local pmc values, iter, value
+    .local int first
+    first = 1
+    values = self.'values'()
+    iter = new 'Iterator', values
+  iter_loop:
+    unless iter goto iter_loop_end
+    if first goto first_time
+    concat res, ", "
+  first_time:
+    first = 0
+    value = shift iter
+    $S0 = value.perl()
+    concat res, $S0
+    goto iter_loop
+  iter_loop_end:
+
+    # Done.
+    concat res, ')'
+    .return (res)
+.end
+
+
 =back
 
 =head1 Functions

Modified: branches/pdd25cx/languages/perl6/src/classes/Num.pir
==============================================================================
--- branches/pdd25cx/languages/perl6/src/classes/Num.pir	(original)
+++ branches/pdd25cx/languages/perl6/src/classes/Num.pir	Sat May 10 07:12:21 2008
@@ -8,6 +8,15 @@
 
 .namespace [ 'Num' ]
 
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item onload()
+
+=cut
+
 .sub 'onload' :anon :init :load
     $P0 = subclass 'Float', 'Num'
     $P1 = get_hll_global 'Any'
@@ -19,12 +28,32 @@
 .end
 
 
+=item ACCEPTS()
+
+=cut
+
 .sub 'ACCEPTS' :method
     .param num topic
     .return 'infix:=='(topic, self)
 .end
 
 
+=item perl()
+
+Returns a Perl representation of the Num.
+
+=cut
+
+.sub 'perl' :method
+    $S0 = self
+    .return($S0)
+.end
+
+
+=back
+
+=cut
+
 # Local Variables:
 #   mode: pir
 #   fill-column: 100

Modified: branches/pdd25cx/languages/perl6/src/classes/Object.pir
==============================================================================
--- branches/pdd25cx/languages/perl6/src/classes/Object.pir	(original)
+++ branches/pdd25cx/languages/perl6/src/classes/Object.pir	Sat May 10 07:12:21 2008
@@ -33,7 +33,7 @@
     ##  need a place to store variable type, if we have one; this is
     ##  needed per value because we have no container that exists
     ##  between assignments
-    addattribute objectclass, 'vartype'
+    addattribute objectclass, '%!properties'
 
     ##  create a Perl6Protoobject class.  We don't call it 'Protoobject'
     ##  to avoid conflicts with the Protoobject class used by PCT and PGE.
@@ -138,6 +138,33 @@
 .end
 
 
+=item make_grammar_proto(grammar [, 'name'=>name] )
+
+Create protoobjects and mappings for C<grammar>, using C<name>
+as the Perl 6 name for the grammar.  The C<grammar> argument must
+be a Parrot Class object.
+
+=cut
+
+.sub 'make_grammar_proto'
+    .param pmc class
+    .param string name         :optional :named('name')
+    .param int has_name        :opt_flag
+
+    # We check that it has Grammar as a parent, and if not we add it.
+    $I0 = isa class, 'Grammar'
+    if $I0 goto already_grammar
+    $P0 = new 'ResizablePMCArray'
+    $P0 = get_hll_global $P0, 'Grammar'
+    $P0 = $P0.HOW()
+    addparent class, $P0
+  already_grammar:
+
+    # Now let Object's make_proto do the rest of the work.
+    'make_proto'(class, name)
+.end
+
+
 =item !keyword_class(name)
 
 Internal helper method to create a class.
@@ -194,6 +221,30 @@
     .return(role)
 .end
 
+=item !keyword_grammar(name)
+
+Internal helper method to create a grammar.
+
+=cut
+
+.sub '!keyword_grammar' :method
+    .param string name
+    .local pmc info, grammar
+
+    # Need to make sure it ends up attached to the right
+    # namespace.
+    info = new 'Hash'
+    info['name'] = name
+    $P0 = new 'ResizablePMCArray'
+    $P0[0] = name
+    info['namespace'] = $P0
+
+    # Create grammar class..
+    grammar = new 'Class', info
+
+    .return(grammar)
+.end
+
 =item !keyword_does(class, role_name)
 
 Internal helper method to implement the functionality of the does keyword.
@@ -233,15 +284,82 @@
 =cut
 
 .sub 'new' :method
-    .param pmc init_attribs :named :slurpy
+    .param pmc init_parents :slurpy
+    .param pmc init_this    :named :slurpy
 
     # Instantiate.
     $P0 = self.'HOW'()
     $P1 = new $P0
 
-    # Initialize each attribute with an Undef or the supplied value.
+    # If this proto object has a WHENCE auto-vivification, we should use
+    # put any values it contains but that init_this does not into init_this.
+    .local pmc whence
+    whence = self.'WHENCE'()
+    unless whence goto no_whence
+    .local pmc this_whence_iter
+    this_whence_iter = new 'Iterator', whence
+  this_whence_iter_loop:
+    unless this_whence_iter goto no_whence
+    $S0 = shift this_whence_iter
+    $I0 = exists init_this[$S0]
+    if $I0 goto this_whence_iter_loop
+    $P2 = whence[$S0]
+    init_this[$S0] = $P2
+    goto this_whence_iter_loop
+  no_whence:
+
+    # Now we will initialize each attribute in the class itself and it's
+    # parents with an Undef or the specified initialization value. Note that
+    # the all_parents list includes ourself.
+    .local pmc all_parents, class_iter
+    all_parents = inspect $P0, "all_parents"
+    class_iter = new 'Iterator', all_parents
+  class_iter_loop:
+    unless class_iter goto class_iter_loop_end
+    .local pmc cur_class
+    cur_class = shift class_iter
+
+    # If this the current class?
+    .local pmc init_attribs
+    eq_addr cur_class, $P0, current_class
+
+    # If it's not the current class, need to see if we have any attributes.
+    # Go through the provided init_parents to see if we have anything that
+    # matches.
+    .local pmc ip_iter, cur_ip
+    ip_iter = new 'Iterator', init_parents
+  ip_iter_loop:
+    unless ip_iter goto ip_iter_loop_end
+    cur_ip = shift ip_iter
+
+    # We will check if their HOW matches.
+    $P2 = cur_ip.'HOW'()
+    eq_addr cur_class, $P2, found_parent_init
+
+    goto found_init_attribs
+  ip_iter_loop_end:
+
+    # If we get here, found nothing.
+    init_attribs = new 'Hash'
+    goto parent_init_s