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

[svn:parrot] r34623 - in branches/pdd22io_part3: . compilers/imcc compilers/ncigen/src compilers/pct/src/PCT compilers/pge/PGE compilers/pirc compilers/pirc/new compilers/pirc/t compilers/tge config/auto config/gen/makefiles docs docs/book docs/pdds/draft

From:
allison
Date:
December 29, 2008 23:29
Subject:
[svn:parrot] r34623 - in branches/pdd22io_part3: . compilers/imcc compilers/ncigen/src compilers/pct/src/PCT compilers/pge/PGE compilers/pirc compilers/pirc/new compilers/pirc/t compilers/tge config/auto config/gen/makefiles docs docs/book docs/pdds/draft
Message ID:
20081230072907.63DBBCB9FA@x12.develooper.com
Author: allison
Date: Mon Dec 29 23:28:53 2008
New Revision: 34623

Added:
   branches/pdd22io_part3/compilers/pirc/new/pirdefines.h
      - copied unchanged from r34621, /trunk/compilers/pirc/new/pirdefines.h
   branches/pdd22io_part3/languages/ecmascript/lib/
      - copied from r34621, /trunk/languages/ecmascript/lib/
   branches/pdd22io_part3/languages/ecmascript/lib/Parrot/
      - copied from r34621, /trunk/languages/ecmascript/lib/Parrot/
   branches/pdd22io_part3/languages/ecmascript/lib/Parrot/Test/
      - copied from r34621, /trunk/languages/ecmascript/lib/Parrot/Test/
   branches/pdd22io_part3/languages/ecmascript/lib/Parrot/Test/JS/
      - copied from r34621, /trunk/languages/ecmascript/lib/Parrot/Test/JS/
   branches/pdd22io_part3/languages/ecmascript/lib/Parrot/Test/JS.pm
      - copied unchanged from r34621, /trunk/languages/ecmascript/lib/Parrot/Test/JS.pm
   branches/pdd22io_part3/languages/ecmascript/lib/Parrot/Test/JS/PJS.pm
      - copied unchanged from r34621, /trunk/languages/ecmascript/lib/Parrot/Test/JS/PJS.pm
   branches/pdd22io_part3/languages/ecmascript/lib/Parrot/Test/JS/SpiderMonkey.pm
      - copied unchanged from r34621, /trunk/languages/ecmascript/lib/Parrot/Test/JS/SpiderMonkey.pm
   branches/pdd22io_part3/languages/ecmascript/t/js_pt/   (props changed)
      - copied from r34621, /trunk/languages/ecmascript/t/js_pt/
   branches/pdd22io_part3/languages/ecmascript/t/js_pt/10-version.t
      - copied unchanged from r34621, /trunk/languages/ecmascript/t/js_pt/10-version.t
   branches/pdd22io_part3/languages/ecmascript/t/sanity_js/
      - copied from r34621, /trunk/languages/ecmascript/t/sanity_js/
   branches/pdd22io_part3/languages/ecmascript/t/sanity_pt/   (props changed)
      - copied from r34621, /trunk/languages/ecmascript/t/sanity_pt/
   branches/pdd22io_part3/languages/ecmascript/t/sanity_pt/00-literals.t
      - copied unchanged from r34621, /trunk/languages/ecmascript/t/sanity_pt/00-literals.t
   branches/pdd22io_part3/languages/ecmascript/t/sanity_pt/01-vars.t
      - copied unchanged from r34621, /trunk/languages/ecmascript/t/sanity_pt/01-vars.t
   branches/pdd22io_part3/languages/ecmascript/t/sanity_pt/03-boolean.t
      - copied unchanged from r34621, /trunk/languages/ecmascript/t/sanity_pt/03-boolean.t
   branches/pdd22io_part3/languages/ecmascript/t/sanity_pt/05-objects.t
      - copied unchanged from r34621, /trunk/languages/ecmascript/t/sanity_pt/05-objects.t
   branches/pdd22io_part3/languages/lua/CREDITS
      - copied unchanged from r34621, /trunk/languages/lua/CREDITS
   branches/pdd22io_part3/languages/lua/t/bit/
      - copied from r34621, /trunk/languages/lua/t/bit/
   branches/pdd22io_part3/languages/lua/t/bit/bittest.lua
      - copied unchanged from r34621, /trunk/languages/lua/t/bit/bittest.lua
   branches/pdd22io_part3/languages/lua/t/bit/nsievebits.lua
      - copied unchanged from r34621, /trunk/languages/lua/t/bit/nsievebits.lua
   branches/pdd22io_part3/languages/pipp/t/in_php/ops.t
      - copied unchanged from r34621, /trunk/languages/pipp/t/in_php/ops.t
   branches/pdd22io_part3/languages/pipp/t/php/array.t
      - copied unchanged from r34621, /trunk/languages/pipp/t/php/array.t
   branches/pdd22io_part3/t/compilers/pge/perl6regex/rx_goal
      - copied unchanged from r34621, /trunk/t/compilers/pge/perl6regex/rx_goal
Removed:
   branches/pdd22io_part3/languages/ecmascript/t/03-boolean.t
Modified:
   branches/pdd22io_part3/CREDITS
   branches/pdd22io_part3/DEPRECATED.pod
   branches/pdd22io_part3/MANIFEST
   branches/pdd22io_part3/MANIFEST.SKIP
   branches/pdd22io_part3/NEWS
   branches/pdd22io_part3/compilers/imcc/imc.h
   branches/pdd22io_part3/compilers/imcc/imcparser.c
   branches/pdd22io_part3/compilers/imcc/imcparser.h
   branches/pdd22io_part3/compilers/imcc/instructions.c
   branches/pdd22io_part3/compilers/imcc/instructions.h
   branches/pdd22io_part3/compilers/imcc/main.c
   branches/pdd22io_part3/compilers/imcc/optimizer.c
   branches/pdd22io_part3/compilers/imcc/optimizer.h
   branches/pdd22io_part3/compilers/imcc/pbc.c
   branches/pdd22io_part3/compilers/ncigen/src/NCIGENAST.pir
   branches/pdd22io_part3/compilers/pct/src/PCT/Grammar.pir
   branches/pdd22io_part3/compilers/pge/PGE/Exp.pir
   branches/pdd22io_part3/compilers/pge/PGE/OPTable.pir
   branches/pdd22io_part3/compilers/pge/PGE/Perl6Regex.pir
   branches/pdd22io_part3/compilers/pge/PGE/Regex.pir
   branches/pdd22io_part3/compilers/pirc/TODO
   branches/pdd22io_part3/compilers/pirc/new/bcgen.c
   branches/pdd22io_part3/compilers/pirc/new/bcgen.h
   branches/pdd22io_part3/compilers/pirc/new/main.c
   branches/pdd22io_part3/compilers/pirc/new/pir.l
   branches/pdd22io_part3/compilers/pirc/new/pir.y
   branches/pdd22io_part3/compilers/pirc/new/pircompiler.c
   branches/pdd22io_part3/compilers/pirc/new/pircompiler.h
   branches/pdd22io_part3/compilers/pirc/new/pircompunit.c
   branches/pdd22io_part3/compilers/pirc/new/pircompunit.h
   branches/pdd22io_part3/compilers/pirc/new/piremit.c
   branches/pdd22io_part3/compilers/pirc/new/piremit.h
   branches/pdd22io_part3/compilers/pirc/new/pirlexer.c
   branches/pdd22io_part3/compilers/pirc/new/pirlexer.h
   branches/pdd22io_part3/compilers/pirc/new/pirparser.c
   branches/pdd22io_part3/compilers/pirc/new/pirparser.h
   branches/pdd22io_part3/compilers/pirc/new/pirsymbol.c
   branches/pdd22io_part3/compilers/pirc/new/pirsymbol.h
   branches/pdd22io_part3/compilers/pirc/t/basic.t
   branches/pdd22io_part3/compilers/pirc/t/heredoc.t
   branches/pdd22io_part3/compilers/pirc/t/macro.t
   branches/pdd22io_part3/compilers/pirc/t/stmts.t
   branches/pdd22io_part3/compilers/tge/tgc.pir
   branches/pdd22io_part3/config/auto/warnings.pm
   branches/pdd22io_part3/config/gen/makefiles/pirc.in
   branches/pdd22io_part3/config/gen/makefiles/root.in
   branches/pdd22io_part3/docs/book/ch03_pir_basics.pod
   branches/pdd22io_part3/docs/book/ch04_pir_subroutines.pod
   branches/pdd22io_part3/docs/book/ch05_pasm.pod
   branches/pdd22io_part3/docs/book/ch06_library.pod
   branches/pdd22io_part3/docs/book/ch08_architecture.pod
   branches/pdd22io_part3/docs/book/ch09_pct.pod
   branches/pdd22io_part3/docs/book/ch10_hlls.pod
   branches/pdd22io_part3/docs/book/ch12_opcodes.pod
   branches/pdd22io_part3/docs/book/ch13_reference.pod
   branches/pdd22io_part3/docs/glossary.pod
   branches/pdd22io_part3/docs/pdds/draft/pdd14_numbers.pod
   branches/pdd22io_part3/editor/indent_pir.vim
   branches/pdd22io_part3/examples/io/httpd.pir
   branches/pdd22io_part3/examples/library/ncurses_life.pir
   branches/pdd22io_part3/examples/pasm/xml_parser.pasm
   branches/pdd22io_part3/examples/pir/io.pir
   branches/pdd22io_part3/examples/pir/pirric.pir
   branches/pdd22io_part3/examples/pir/quine_ord.pir
   branches/pdd22io_part3/examples/pir/sudoku.pir
   branches/pdd22io_part3/examples/pir/uniq.pir
   branches/pdd22io_part3/examples/streams/FileLines.pir
   branches/pdd22io_part3/examples/streams/ParrotIO.pir
   branches/pdd22io_part3/examples/tge/branch/transform.pir
   branches/pdd22io_part3/examples/tutorial/40_file_ops.pir
   branches/pdd22io_part3/ext/SQLite3/gen_sqlite3.pl
   branches/pdd22io_part3/include/parrot/debugger.h
   branches/pdd22io_part3/include/parrot/encoding.h
   branches/pdd22io_part3/include/parrot/exceptions.h
   branches/pdd22io_part3/include/parrot/hash.h
   branches/pdd22io_part3/include/parrot/multidispatch.h
   branches/pdd22io_part3/include/parrot/register.h
   branches/pdd22io_part3/include/parrot/stacks.h
   branches/pdd22io_part3/include/parrot/string_funcs.h
   branches/pdd22io_part3/languages/Zcode/z3main.pir
   branches/pdd22io_part3/languages/befunge/load.pasm
   branches/pdd22io_part3/languages/bf/bf.pasm
   branches/pdd22io_part3/languages/bf/bfc.pir
   branches/pdd22io_part3/languages/bf/bfco.pir
   branches/pdd22io_part3/languages/ecmascript/config/makefiles/root.in
   branches/pdd22io_part3/languages/ecmascript/src/builtin/builtins.pir
   branches/pdd22io_part3/languages/ecmascript/src/classes/Boolean.pir
   branches/pdd22io_part3/languages/ecmascript/src/parser/actions.pm
   branches/pdd22io_part3/languages/ecmascript/t/harness
   branches/pdd22io_part3/languages/lazy-k/lazy.pir
   branches/pdd22io_part3/languages/lua/lua.pir
   branches/pdd22io_part3/languages/lua/luac.pl
   branches/pdd22io_part3/languages/lua/luac2pir.pir
   branches/pdd22io_part3/languages/lua/luad.pir
   branches/pdd22io_part3/languages/lua/luap.pir
   branches/pdd22io_part3/languages/lua/src/PASTGrammar.tg
   branches/pdd22io_part3/languages/lua/src/POSTGrammar.tg
   branches/pdd22io_part3/languages/lua/src/dumplex.tg
   branches/pdd22io_part3/languages/lua/src/grammar51.pir
   branches/pdd22io_part3/languages/lua/src/lib/_helpers.pir
   branches/pdd22io_part3/languages/lua/src/lib/alarm.pir
   branches/pdd22io_part3/languages/lua/src/lib/base64.pir
   branches/pdd22io_part3/languages/lua/src/lib/bc.pir
   branches/pdd22io_part3/languages/lua/src/lib/bit.pir
   branches/pdd22io_part3/languages/lua/src/lib/bitlib.pir
   branches/pdd22io_part3/languages/lua/src/lib/complex.pir
   branches/pdd22io_part3/languages/lua/src/lib/gl_binding.pir
   branches/pdd22io_part3/languages/lua/src/lib/glut.pir
   branches/pdd22io_part3/languages/lua/src/lib/lfs.pir
   branches/pdd22io_part3/languages/lua/src/lib/lpeg.pir
   branches/pdd22io_part3/languages/lua/src/lib/luaaux.pir
   branches/pdd22io_part3/languages/lua/src/lib/luabasic.pir
   branches/pdd22io_part3/languages/lua/src/lib/luabytecode.pir
   branches/pdd22io_part3/languages/lua/src/lib/luacoroutine.pir
   branches/pdd22io_part3/languages/lua/src/lib/luadebug.pir
   branches/pdd22io_part3/languages/lua/src/lib/luafile.pir
   branches/pdd22io_part3/languages/lua/src/lib/luaio.pir
   branches/pdd22io_part3/languages/lua/src/lib/luamath.pir
   branches/pdd22io_part3/languages/lua/src/lib/luaos.pir
   branches/pdd22io_part3/languages/lua/src/lib/luapackage.pir
   branches/pdd22io_part3/languages/lua/src/lib/luaperl.pir
   branches/pdd22io_part3/languages/lua/src/lib/luaregex.pir
   branches/pdd22io_part3/languages/lua/src/lib/luastring.pir
   branches/pdd22io_part3/languages/lua/src/lib/luatable.pir
   branches/pdd22io_part3/languages/lua/src/lib/markdown.pir
   branches/pdd22io_part3/languages/lua/src/lib/mathx.pir
   branches/pdd22io_part3/languages/lua/src/lib/md5.pir
   branches/pdd22io_part3/languages/lua/src/lib/random.pir
   branches/pdd22io_part3/languages/lua/src/lib/struct.pir
   branches/pdd22io_part3/languages/lua/src/lib/uuid.pir
   branches/pdd22io_part3/languages/lua/src/lua51.pg
   branches/pdd22io_part3/languages/lua/src/lua51.pir
   branches/pdd22io_part3/languages/lua/src/lua51_testlex.pg
   branches/pdd22io_part3/languages/lua/src/pmc/lua.pmc
   branches/pdd22io_part3/languages/lua/src/pmc/luaany.pmc
   branches/pdd22io_part3/languages/lua/src/pmc/luaboolean.pmc
   branches/pdd22io_part3/languages/lua/src/pmc/luabytecode.pmc
   branches/pdd22io_part3/languages/lua/src/pmc/luafunction.pmc
   branches/pdd22io_part3/languages/lua/src/pmc/luanil.pmc
   branches/pdd22io_part3/languages/lua/src/pmc/luanumber.pmc
   branches/pdd22io_part3/languages/lua/src/pmc/luastring.pmc
   branches/pdd22io_part3/languages/lua/src/pmc/luatable.pmc
   branches/pdd22io_part3/languages/lua/src/pmc/luathread.pmc
   branches/pdd22io_part3/languages/lua/src/pmc/luauserdata.pmc
   branches/pdd22io_part3/languages/lua/t/Parrot/Test/Lua.pm
   branches/pdd22io_part3/languages/lua/t/Parrot/Test/Lua_lex.pm
   branches/pdd22io_part3/languages/lua/t/Parrot/Test/Luad.pm
   branches/pdd22io_part3/languages/lua/t/bit.t
   branches/pdd22io_part3/languages/lua/t/harness
   branches/pdd22io_part3/languages/lua/t/io.t
   branches/pdd22io_part3/languages/lua/t/shootout.t
   branches/pdd22io_part3/languages/lua/test_lex.pir
   branches/pdd22io_part3/languages/m4/src/freeze.pir
   branches/pdd22io_part3/languages/perl6/build/gen_junction_pir.pl
   branches/pdd22io_part3/languages/perl6/docs/spectest-progress.csv
   branches/pdd22io_part3/languages/perl6/src/builtins/assign.pir
   branches/pdd22io_part3/languages/perl6/src/builtins/cmp.pir
   branches/pdd22io_part3/languages/perl6/src/builtins/io.pir
   branches/pdd22io_part3/languages/perl6/src/builtins/match.pir
   branches/pdd22io_part3/languages/perl6/src/classes/Junction.pir
   branches/pdd22io_part3/languages/perl6/src/classes/Range.pir
   branches/pdd22io_part3/languages/perl6/src/parser/grammar.pg
   branches/pdd22io_part3/languages/pipp/CREDITS
   branches/pdd22io_part3/languages/pipp/src/common/builtins.pir
   branches/pdd22io_part3/languages/pipp/src/common/php_array.pir
   branches/pdd22io_part3/languages/pipp/src/common/php_file.pir
   branches/pdd22io_part3/languages/pipp/src/pct/actions.pm
   branches/pdd22io_part3/languages/pipp/src/pct/grammar.pg
   branches/pdd22io_part3/languages/pipp/t/php/closures.t
   branches/pdd22io_part3/languages/pipp/t/php/functions.t
   branches/pdd22io_part3/languages/pipp/t/php/oo.t
   branches/pdd22io_part3/languages/regex/regex-compiler.pir
   branches/pdd22io_part3/languages/unlambda/unl.pir
   branches/pdd22io_part3/lib/Parrot/Ops2c/Utils.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/Method.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/MethodEmitter.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/PCCMETHOD.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/Null.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/RO.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/Ref.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/default.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/deleg_pmc.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/PMCEmitter.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/Pmc2cMain.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/UtilFunctions.pm
   branches/pdd22io_part3/lib/Parrot/Pmc2c/VTable.pm
   branches/pdd22io_part3/lib/Parrot/Test.pm
   branches/pdd22io_part3/runtime/parrot/include/DWIM.pir
   branches/pdd22io_part3/runtime/parrot/library/Config/JSON.pir
   branches/pdd22io_part3/runtime/parrot/library/Crow.pir
   branches/pdd22io_part3/runtime/parrot/library/HTTP/Daemon.pir
   branches/pdd22io_part3/runtime/parrot/library/config.pir
   branches/pdd22io_part3/src/debug.c
   branches/pdd22io_part3/src/encoding.c
   branches/pdd22io_part3/src/exceptions.c
   branches/pdd22io_part3/src/gc/register.c
   branches/pdd22io_part3/src/gc/resources.c
   branches/pdd22io_part3/src/global.c
   branches/pdd22io_part3/src/hash.c
   branches/pdd22io_part3/src/hll.c
   branches/pdd22io_part3/src/inter_call.c
   branches/pdd22io_part3/src/io/buffer.c
   branches/pdd22io_part3/src/io/filehandle.c
   branches/pdd22io_part3/src/io/portable.c
   branches/pdd22io_part3/src/jit.c
   branches/pdd22io_part3/src/jit/alpha/jit_defs.c
   branches/pdd22io_part3/src/jit/amd64/jit_defs.c
   branches/pdd22io_part3/src/jit/arm/jit_defs.c
   branches/pdd22io_part3/src/jit/hppa/jit_defs.c
   branches/pdd22io_part3/src/jit/i386/jit_defs.c
   branches/pdd22io_part3/src/jit/ia64/jit_defs.c
   branches/pdd22io_part3/src/jit/mips/jit_defs.c
   branches/pdd22io_part3/src/jit/ppc/jit_defs.c
   branches/pdd22io_part3/src/jit/skeleton/jit_defs.c
   branches/pdd22io_part3/src/jit/sun4/jit_defs.c
   branches/pdd22io_part3/src/list.c
   branches/pdd22io_part3/src/ops/core.ops
   branches/pdd22io_part3/src/ops/experimental.ops
   branches/pdd22io_part3/src/ops/io.ops
   branches/pdd22io_part3/src/pmc/env.pmc
   branches/pdd22io_part3/src/pmc/namespace.pmc
   branches/pdd22io_part3/src/pmc/role.pmc
   branches/pdd22io_part3/src/pmc/slice.pmc
   branches/pdd22io_part3/src/runops_cores.c
   branches/pdd22io_part3/src/stacks.c
   branches/pdd22io_part3/src/stm/waitlist.c
   branches/pdd22io_part3/src/sub.c
   branches/pdd22io_part3/t/compilers/pge/03-optable.t
   branches/pdd22io_part3/t/compilers/pge/p5regex/p5rx.t
   branches/pdd22io_part3/t/compilers/pge/perl6regex/01-regex.t
   branches/pdd22io_part3/t/examples/streams.t
   branches/pdd22io_part3/t/library/streams.t
   branches/pdd22io_part3/t/oo/methods.t
   branches/pdd22io_part3/t/op/sprintf.t
   branches/pdd22io_part3/t/pmc/eval.t
   branches/pdd22io_part3/t/pmc/freeze.t
   branches/pdd22io_part3/t/pmc/io.t
   branches/pdd22io_part3/t/pmc/namespace.t
   branches/pdd22io_part3/t/pmc/packfile.t
   branches/pdd22io_part3/t/pmc/sys.t
   branches/pdd22io_part3/t/tools/dump_pbc.t
   branches/pdd22io_part3/tools/build/ops2c.pl
   branches/pdd22io_part3/tools/dev/bench_op.pir
   branches/pdd22io_part3/tools/dev/pbc_to_exe_gen.pl
   branches/pdd22io_part3/tools/dev/vms-patch

Log:
[pdd22io] Bringing the pdd22io_part3 branch up-to-date with trunk r34621.


Modified: branches/pdd22io_part3/CREDITS
==============================================================================
--- branches/pdd22io_part3/CREDITS	(original)
+++ branches/pdd22io_part3/CREDITS	Mon Dec 29 23:28:53 2008
@@ -1,3 +1,4 @@
+=pod
 # $Id$
 
     Following in the steps of other open source projects that
@@ -6,7 +7,8 @@
     works.  It is sorted by name and formatted to allow easy
     grepping and beautification by scripts.
     The fields are: name (N), email (E), web-address (W),
-    description (D) and snail-mail address (S).
+    description (D), subversion username (U) and snail-mail
+    address (S).
 
         Thanks,
 
@@ -16,6 +18,8 @@
 
 ----------
 N: Aaron Sherman
+U: ajs
+E: ajs@ajs.com
 D: rand and srand ops
 
 N: Abhijit A. Mahabal
@@ -24,15 +28,16 @@
 N: Adam Thomason
 D: Building on various platforms.
 
+N: Ahmed Zawawi
+D: Rakudo builtins
+
 N: Alberto Manuel Brandao Simoes
+U: ambs
 E: ambs@cpan.org
 D: Named arguments support and recovery support on PIR parser
 S: Braga, Portugal
 W: http://alfarrabio.di.uminho.pt/~albie/
 
-N: Ahmed Zawawi
-D: Rakudo builtins
-
 N: Aldo Calpini
 D: Debugging tutorial
 D: Porting to PDA
@@ -43,19 +48,28 @@
 
 N: Alex Gough
 D: bignum
+E: alex@earth.li
+U: ajgough
+
+N: Alexandre Buisse
+U: heimdall
+E: Nattfodd@gmail.com
 
 N: Allison Randal
 D: Lead Designer
 D: TGE, Punie (Perl 1), P6C
 E: allison@perl.org
+U: allison
 
 N: Amir Karger
+U: amirkarger
 D: editor bugfixes
 E: akarger@cgr.harvard.edu
 
 N: Amos Robinson
 D: IMCC Optimizer patches
 D: ParTcl builtins
+U: azuroth
 E: amos@coscom.net
 
 N: Anders Nor Berle
@@ -80,13 +94,17 @@
 D: Documentation
 D: Release manager for 0.8.2
 E: wknight8111@gmail.com
+U: Whiteknight
 
 N: Andy Dougherty
+U: doughera
+E: doughera@lafayette.edu
 D: Config and building.
 
 N: Andy Lester
 D: consting, cleanups, and Chief Cage Cleaner
 E: andy@petdance.com
+U: petdance
 
 N: Angel Faus
 D: CFG and live analysis.
@@ -100,10 +118,15 @@
 N: Arvindh Rajesh Tamilmani
 D: Buffered IO fix
 
-N: Ask Bjoern Hansen
+U: ask
+N: Ask Bjørn Hansen
 D: Keeps us running
+E: ask@develooper.com
 
 N: Audrey Tang
+U: audreyt
+U: autrijus
+E: audreyt@audreyt.org
 D: Pugs, a Perl6->Parrot implementation.
 
 N: Benjamin Goldberg
@@ -113,6 +136,7 @@
 D: Fixes for VMS
 
 N: Bernhard Schmalhofer
+U: bernhard
 D: Bugfixes
 D: Eclectus, Scheme on Parrot
 D: Parrot m4
@@ -128,6 +152,7 @@
 N: Bob Rogers
 D: Random small bug fixes, including one for the linguine bug.
 E: rogers-perl6@rgrjr.dyndns.org
+U: rgrjr
 
 N: Bob Wilkinson
 D: Numerous document typos.
@@ -144,15 +169,20 @@
 D: IMCC documentation update
 E: bgeron@gmail.com
 
+U: brentdax
 N: Brent Royal-Gordon
 D: Configure, Parrot_sprintf, embedding, early regex engine.
 D: Early contributions under the name Brent Dax.
 E: brent@brentdax.com
 W: http://www.brentdax.com/
 
+U: bdwheele
 N: Brian Wheeler
+E: bdwheele@indiana.edu
 
 N: Bruce Gray
+U: util
+E: bruce.gray@acm.org
 D: debugging tutorial remarks
 
 N: Bryan C. Warnock
@@ -161,8 +191,17 @@
 D: And, yes, {sigh}, *that* Warnock.
 E: bwarnock@raba.com
 
+N: Carl Masak
+E: cmasak@gmail.com
+U: masak
+
+N: Charles Reiss
+U: creiss
+E: creiss@cc.gatech.edu
+
 N: Chip Salzenberg
 D: Pumpking (0.4.6 - ... ) and demagogue
+U: chip
 E: chip@pobox.com
 
 N: Chris Davaz
@@ -170,6 +209,7 @@
 E: cdavaz@gmail.com
 
 N: Chris Dolan
+U: cdolan
 D: TAP language author, Parrot Bug fixes and Rakudo patches
 E: cdolan@cpan.org
 
@@ -177,12 +217,14 @@
 D: Rakudo patches
 
 N: Christoph Otto a.k.a. cotto
+U: cotto
 D: Patch for key flags in pdd08
 D: Range check in Env PMC
 D: Pipp
 E: christoph@mksig.org
 
 N: chromatic
+U: chromatic
 D: SDL library and examples; PIR Test::*; test suite cleanup; Parrot::Embed
 D: freaky bugs; cool features; Pheme
 E: chromatic@wgz.org
@@ -192,31 +234,48 @@
 D: Fix for parrot linking issue on Solaris 8
 
 N: Clinton A. Pierce
+U: clintp
+E: clintp@geeksalad.org
 D: Many PIR tests and fixes
 D: A small XML parser in PASM
 D: Interpreter and compiler for BASIC
 
 N: Colin Kuskie
+U: colink
 D: nqp hackery
 D: PIR tutorial updates, docs/test cleanups
 E: ckuskie@sterling.net
 
 N: Cory Spencer
+U: cspencer
 D: Peek opcode and PIO implementation
 D: Rakudo builtins
 E: cspencer@sprocket.org
 
+N: Curtis 'Ovid' Poe
+U: Ovid
+D: docs/test cleanups/Makefile fixes
+E: ovid@cpan.org
+
 N: Curtis Rawls
+U: cgrawls
 D: imcc optimizer and register allocator patches and tests
 E: cgrawls@gmail.com
 
+N: Damian Miles Knopp
+U: dmknopp
+E: dmknopp@loyola.edu
+
 N: Dan Sugalski
+U: dan
 D: The big cheese emeritus
 E: dan@sidhe.org
 W: http://www.sidhe.org/~dan/blog/
 
 N: Daniel Grunblatt
 D: JIT and EXEC subsystems
+E: daniel@grunblatt.com.ar
+U: grunblatt
 
 N: Danny Werner
 D: Test for literals
@@ -225,7 +284,9 @@
 D: Win32 build fixes
 E: dave@woldrich.com
 
-N: David M. Loyd
+N: David M. Lloyd
+U: dmlloyd
+E: dmlloyd@tds.net
 
 N: David Romano
 D: PGE tests and fixes
@@ -262,6 +323,8 @@
 D: SmartLink patch for Moose after 0.43
 
 N: Florian Ragwitz
+U: rafl
+U: flora
 E: rafl@debianforum.de
 W: http://www.tu-chemnitz.de/~rafl/
 D: Debian packaging
@@ -270,6 +333,7 @@
 N: François Perrad
 E: francois.perrad@gadz.org
 W: http://fperrad.googlepages.com/home
+U: fperrad
 D: build fixes for MinGW
 D: a patch to remove slash_exec from config
 D: language Lua
@@ -280,6 +344,8 @@
 D: Fix typo in PARROT_BIGENDIAN case
 
 N: Geoff Broadwell (japhb)
+U: japhb
+E: geoff@broadwell.org
 D: OpenGL binding and examples
 D: Disassembly/source weaver
 D: Miscellaneous fixes
@@ -299,6 +365,7 @@
 N: Greg Bacon
 D: Memory reallocation test and patch
 
+U: gregor
 N: Gregor N. Purdy
 D: Early Parrot core, including packfile and op processing code,
 D: first predereferencing core, first Parrot-targetted compiler
@@ -327,11 +394,15 @@
 D: various Pynie patches
 
 N: James E Keenan (Jim)
+E: jkeenan@cpan.org
+U: jkeenan
 D: Testing of configuration and build tools
 W: http://thenceforward.net/parrot/
-S:  Brooklyn, NY, USA
+S: Brooklyn, NY, USA
 
 N: Jarkko Hietaniemi
+U: jhi
+E: jhi@iki.fi
 D: packfile and Tru64 fixes
 D: lot of general hints and patches to improve portability
 
@@ -342,9 +413,12 @@
 
 N: Jeff Goff
 D: Release pumpking for 0.0.5-0.0.8
+U: jgoff
+E: jgoff@speakeasy.net
 
 N: Jeff Horwitz
 E: jeff@smashing.org
+U: jhorwitz
 D: Various bug fixes and tests
 
 N: Jeffrey Dik
@@ -354,18 +428,25 @@
 D: Several libraries, examples and patches.
 D: Tetris with SDL
 E: parrot@jensbeimsurfen.de
+U: jrieks
 S: Wuppertal, Germany
 
 N: Jerome Quelin
 D: parrotbug, befunge interpreter, ook compiler.
 E: jquelin@cpan.org
+U: jquelin
 S: Lyon, France
 
 N: Jerry Gay a.k.a. particle
+U: particle
 E: Jerry.Gay@gmail.com
 D: test suite, compiler tools, perl6, TAP language, entropy reduction, ECMAScript
 S: Seattle, WA
 
+N: Jesse Vincent
+U: jesse
+E: jesse@fsck.com
+
 N: Jimmy Zhuo
 E: zhuomingliang@yahoo.com.cn
 D: Bugfixes
@@ -377,12 +458,17 @@
 N: John Paul Wallington
 D: pir-mode.el: fix for xemacs plus bugfixes and cleanups
 
+N: Jonathan Scott Duff
+U: duff
+E: duff@pobox.com
+
 N: Jonathan Sillito
 D: Lexical pads, CPS.
 
 N: Jonathan Stowe
 
 N: Jonathan Worthington
+U: jonathan
 D: Bits of Win32 support, PBC utilities, debug segment work, .Net
 D: to PIR translator, some Rakudo stuff and various other patches
 E: jnthn@jnthn.net
@@ -397,27 +483,38 @@
 N: Josh McAdams
 D: Allow git checkouts to pass some tests that require an svn checkout
 
+U: josh
 N: Josh Wilmes
+E: josh-perl6@hitchhiker.org
 
 N: Joshua Gatcomb
 D: updated version of parrotbench.pl
 
 N: Joshua Hoblitt
 E: jhoblitt@cpan.org
+U: jhoblitt
 D: bug wrangling, doc & makefile cleanups, and Pod tests
 D: mucking around with Configure
 
-N: Joshua Isom, a.k.a jisom
+N: Joshua Isom
+E: loneowl@ritalin.shout.net
+U: jisom
 D: Getopt/Obj.pir
 
-N: Juergen Boemmels
-D: Parrot I/O; macro stuff in assembler.
+N: Julian Albo
+U: julianalbo
+E: julian.notfound@gmail.com
 
 N: Julian Fondren
 E: ayrnieu@gmail.com
 D: Standardize and add languages/*/MAINTAINER files
 D: a patch to catch exception in Lua
 
+N: Jürgen Bömmels
+U: boemmels
+E: boemmels@web.de
+D: Parrot I/O; macro stuff in assembler.
+
 N: Karl Forner
 D: shootout examples testing
 E: karl.forner@gmail.com
@@ -431,6 +528,8 @@
 N: Kevin Falcone
 
 N: Kevin Tew
+U: tewk
+E: tewk@tewk.com
 D: Cardinal(Ruby on Parrot), ECMAScript PGE grammar,
 D: Python PGE grammar, C99 PGE Grammar
 D: Various Config Fixes, Compiler Warnings, etc
@@ -440,18 +539,27 @@
 D: compilers/pirc and languages/PIR.
 D: various updates to PCT-based languages (C99,Punie,Cardinal,Ecmascript)
 D: languages/json
+U: kjs
 E: parrotcode@gmail.com
 
+N: Larry Wall
+E: larry@wall.org
+U: larry
+
 N: Lars Balker Rasmussen
 D: FreeBSD and other build fixes
 
 N: Lee Duhem
 D: Debug patch
+U: leed
 E: lee.duhem@gmail.com
 
 N: Leon Brocard
+U: acme
+E: acme@astray.com
 
 N: Leopold Toetsch
+U: leo
 D: Patchmonster & pumpking emeritus (0.0.13 - 0.4.5)
 E: lt@toetsch.at
 S: Herrnbaumgarten, Austria
@@ -460,8 +568,9 @@
 D: fix to make installable
 E: lu_zero@gentoo.org
 
-
 N: Luke Palmer
+E: luke@luqui.org
+U: luqui
 D: Many fixes
 
 N: Marcelo Serra Castilhos
@@ -472,6 +581,7 @@
 D: URM language, bugfixes
 
 N: Mark Glines a.k.a. Infinoid
+U: infinoid
 D: Cage cleaning, random bugfixes, report bugs
 E: mark@glines.org
 S: South Lake Tahoe, CA, USA
@@ -487,6 +597,8 @@
 D: Implementation of the Rational PMC
 
 N: Matt Diephouse
+U: mdiep
+E: matt@diephouse.com
 D: Turn off buffering layer in forth.pasm
 D: Various patches for pmc2c.pl
 D: Run Tcl test suite in partcl, and add various partcl bits
@@ -501,6 +613,7 @@
 D: Win32 fixes, dynamic PMC creation and loading
 
 N: Melvin Smith
+U: mrjoltcola
 D: Parrot core, various ops, IO, subs, continuations, COW stacks
 D: IMCC, Cola
 E: melvin.smith@mindspring.com
@@ -518,6 +631,7 @@
 D: Mac OS X build fixes
 D: HTML documentation for Parrot
 E: michael_scott@mac.com
+U: mikescott
 W: http://xrl.us/sml
 
 N: Michael Stevens
@@ -527,6 +641,8 @@
 D: Pie-thon hammering PIR
 
 N: Mike Lambert
+U: mongo
+E: perl-dev@jall.org
 
 N: Mike Mattie
 E: codermattie@gmail.com
@@ -536,11 +652,14 @@
 
 N: Moritz A Lenz
 E: moritz@faui2k3.org
+U: moritz
 D: Test infrastructure for languages/perl6/ and Perl 6 in general
 
 N: Neil Conway
 
 N: Nicholas Clark
+U: nicholas
+E: nick@ccl4.org
 D: Building and platform compat and more.
 
 N: Nick Glencross
@@ -548,6 +667,7 @@
 D: Build and smoke fixes for HP-UX and cygwin
 D: Some examples, such as circle.pir and MD5.pir
 E: nick.glencross@gmail.com
+U: nickg
 
 N: Nick Kostirya
 D: Win32, FreeBSD build fixes
@@ -567,6 +687,7 @@
 E: julian.notfound@gmail.com
 
 N: Nuno 'smash' Carvalho
+U: smash
 D: PGE/perl6/abc debugging and testing
 E: mestre.smash@gmail.com
 
@@ -588,6 +709,7 @@
 E: pat.eyler@gmail.com
 
 N: Patrick R. Michaud
+U: pmichaud
 D: Parrot Grammar Engine
 D: Perl 6 (Rakudo Perl) pumpking
 D: NQP, PCT, PAST, POST
@@ -596,21 +718,26 @@
 E: pmichaud@pobox.com
 
 N: Paul Cochrane
+U: paultcochrane
 D: Changing the newspaper in the parrot cage
 E: paultcochrane@gmail.com
 
 N: Peter Gibbs
+U: petergibbs
+E: peter@emkel.co.za
 D: String subsystem
 
 N: Philip Taylor
 D: Win32 ICC support
 
 N: Piers Cawley
+U: pdcawley
 D: The Second Perl 6 Summarizer after Bryan C. Warnock
 E: pdcawley@bofh.org.uk
 W: http://www.bofh.org.uk:8080/
 
 N: Reini Urban
+U: rurban
 E: rurban@cpan.org
 D: cygwin fixes
 
@@ -629,40 +756,58 @@
 
 N: Robert Spier
 D: Keeps us running
+U: robert
+E: robert@perl.org
 
 N: Roger Browne
+E: roger@eiffel.demon.co.uk
+U: eiffel
 D: Author of Amber; bug fixes and tests
 
 N: Roland Illing
 D: Building Parrot with pkgsrc
 
 N: Ron Blaschke
+U: rblasch
+E: ron@rblasch.org
 D: Win32 patches
 
 N: Ruben Fonseca
 D: opcode test coverage script
 E: fonseka@gmail.com
 
+N: Saleem Ansari
+E: tuxdna@gmail.com
+D: Fixed typos in documentation
+
 N: Sam Ruby
+E: rubys@intertwingly.net
+U: rubys
 D: Pythonic and OO patches
 
 N: Sam Vilain
 D: Prototype object model and tests
 
 N: Sean O'Rourke
+E: educated_foo@yahoo.com
+U: educated_foo
 D: Original Perl6 compiler
 
 N: Sebastian Riedel
 
 N: Shawn M Moore
+U: sartak
 D: Cage cleaner
 D: ops summary script
 E: sartak@gmail.com
 
 N: Simon Cozens
+U: simon
+E: simon@simon-cozens.org
 D: Release pumpking for 0.0.1-0.0.4
 
 N: Simon Glover
+U: scog
 D: Tests, docs and misc. bugfixes
 E: scog@aip.de
 S: Potsdam, Germany
@@ -677,15 +822,25 @@
 D: Various code fixes and improvements
 
 N: Stéphane Peiry
+U: stephane
+E: stephane@modxml.org
 D: Lot of JIT/sun patches
 
 N: Sterling Hughes
 D: Questions for the FAQ
 
+N: Stephen Weeks
+U: tene
+D: Cardinal, a Ruby compiler
+D: ChitChat, a Smalltalk compiler
+D: Minor Rakudo patches
+E: tene@allalone.org
+
 N: Steve Clark
 D: Bugfixes
 
 N: Steve Fink
+U: sfink
 D: Release pumpking for 0.0.9-0.0.11
 E: steve@fink.com
 S: San Carlos, CA, USA
@@ -705,11 +860,9 @@
 N: Stuart Jansen
 D: lolcode patches
 
-N: tene
-D: Cardinal, a Ruby compiler
-D: ChitChat, a Smalltalk compiler
-D: Minor Rakudo patches
-E: tene@allalone.org
+N: Tanton Gibbs
+U: thgibbs
+E: thgibbs@deltafarms.com
 
 N: Thilo Planz
 D: partcl tests and inspiration
@@ -717,10 +870,16 @@
 N: Thomas Kratz
 D: Fixes for VMS
 
+N: Tim Bunce
+E: Tim.Bunce@pobox.com
+U: timbo
+
 N: TOGoS
 D: Some FAQ questions and answers
 
 N: Tom Hughes
+E: tom@compton.nu
+U: tom
 
 E: tom@nekomimists.ddo.jp
 D: Nicer command line handling in ops2c.pl
@@ -737,12 +896,14 @@
 
 N: Vishal Soni
 E: vishalrsoni@gmail.com
+U: vsoni
 D: Bug fixes in IMCC, ECMAScript
 
 N: Vladimir Lipsky
 D: Win32, IO fixes
 
 N: Will "Coke" Coleda
+U: coke
 E: will@coleda.com
 D: Tcl language (partcl), APL, website, various languages/ upkeep, misc.
 
@@ -751,3 +912,28 @@
 N: Zach Morgan
 E: zpmorgan@gmail.com
 D: Rakudo patch
+
+N: cvsdummy
+U: cvsdummy
+E: cvs@perl.org
+
+N: svn
+U: svn
+E: svn@perl.org
+
+=cut
+
+# This makes a "svn authors" file for git svn
+
+open my $fh, "<", $0 or die "can't open $0: $!";
+my %n;
+while (<$fh>) {
+    #warn "[$_]";
+    if (m/^\s*$/) {
+        printf "%-10s = %s <%s>\n", $n{U}, $n{N}, $n{E} if $n{U};
+        %n = ();
+    }
+    next unless m/^([NEDUSW]): (.*)/;
+    my ($f, $v) = ($1, $2);
+    $n{$f} = $v unless $n{$f};  # doesn't do the right thing for the multiline fields
+}

Modified: branches/pdd22io_part3/DEPRECATED.pod
==============================================================================
--- branches/pdd22io_part3/DEPRECATED.pod	(original)
+++ branches/pdd22io_part3/DEPRECATED.pod	Mon Dec 29 23:28:53 2008
@@ -51,21 +51,10 @@
 
 See RT #58410.
 
-=item * C<open> opcode mode string [post 0.8.2]
-
-The C<open> opcode will change from Perl-style mode-strings to 'r' for read,
-'w' for write, 'a' for append, and 'p' for pipe.
-
 =item * C<infix> and C<n_infix> opcodes [post 0.8.2]
 
 These opcodes were only used by the old MMD system. See TT #7.
 
-=item * C<slice> [post 0.8.2]
-
-The C<slice> opcode's implementation is experimental. Its use cases and
-implementation should be reconsidered. The current implementation will
-be removed.
-
 =back
 
 =head1 Class Features

Modified: branches/pdd22io_part3/MANIFEST
==============================================================================
--- branches/pdd22io_part3/MANIFEST	(original)
+++ branches/pdd22io_part3/MANIFEST	Mon Dec 29 23:28:53 2008
@@ -171,6 +171,7 @@
 compilers/pirc/new/pircompiler.h                            []
 compilers/pirc/new/pircompunit.c                            []
 compilers/pirc/new/pircompunit.h                            []
+compilers/pirc/new/pirdefines.h                             []
 compilers/pirc/new/piremit.c                                []
 compilers/pirc/new/piremit.h                                []
 compilers/pirc/new/pirheredoc.h                             []
@@ -1532,6 +1533,9 @@
 languages/ecmascript/MAINTAINER                             [ecmascript]
 languages/ecmascript/config/makefiles/root.in               [ecmascript]
 languages/ecmascript/js.pir                                 [ecmascript]
+languages/ecmascript/lib/Parrot/Test/JS.pm                  [ecmascript]
+languages/ecmascript/lib/Parrot/Test/JS/PJS.pm              [ecmascript]
+languages/ecmascript/lib/Parrot/Test/JS/SpiderMonkey.pm     [ecmascript]
 languages/ecmascript/src/builtin/builtins.pir               [ecmascript]
 languages/ecmascript/src/classes/Boolean.pir                [ecmascript]
 languages/ecmascript/src/classes/Completion.pir             [ecmascript]
@@ -1548,8 +1552,12 @@
 languages/ecmascript/t/01-literals.t                        [ecmascript]
 languages/ecmascript/t/02-operators.t                       [ecmascript]
 languages/ecmascript/t/02-sanity-var.t                      [ecmascript]
-languages/ecmascript/t/03-boolean.t                         [ecmascript]
 languages/ecmascript/t/harness                              [ecmascript]
+languages/ecmascript/t/js_pt/10-version.t                   [ecmascript]
+languages/ecmascript/t/sanity_pt/00-literals.t              [ecmascript]
+languages/ecmascript/t/sanity_pt/01-vars.t                  [ecmascript]
+languages/ecmascript/t/sanity_pt/03-boolean.t               [ecmascript]
+languages/ecmascript/t/sanity_pt/05-objects.t               [ecmascript]
 languages/forth/MAINTAINER                                  [forth]
 languages/forth/config/makefiles/root.in                    [forth]
 languages/forth/forth.pir                                   [forth]
@@ -1745,6 +1753,7 @@
 languages/lolcode/t/08-switch.t                             [lolcode]
 languages/lolcode/t/99-four-fours.t                         [lolcode]
 languages/lolcode/t/harness                                 [lolcode]
+languages/lua/CREDITS                                       [lua]
 languages/lua/MAINTAINER                                    [lua]
 languages/lua/config/makefiles/root.in                      [lua]
 languages/lua/demo/triangle.lua                             [lua]
@@ -1828,6 +1837,8 @@
 languages/lua/t/basic.t                                     [lua]
 languages/lua/t/bc.t                                        [lua]
 languages/lua/t/bit.t                                       [lua]
+languages/lua/t/bit/bittest.lua                             [lua]
+languages/lua/t/bit/nsievebits.lua                          [lua]
 languages/lua/t/bitlib.t                                    [lua]
 languages/lua/t/boolean.t                                   [lua]
 languages/lua/t/closure.t                                   [lua]
@@ -2382,7 +2393,9 @@
 languages/pipp/t/in_php/01_sea_only.t                       [pipp]
 languages/pipp/t/in_php/02_sanity.t                         [pipp]
 languages/pipp/t/in_php/array.t                             [pipp]
+languages/pipp/t/in_php/ops.t                               [pipp]
 languages/pipp/t/php/arithmetics.t                          [pipp]
+languages/pipp/t/php/array.t                                [pipp]
 languages/pipp/t/php/base64.t                               [pipp]
 languages/pipp/t/php/basic.t                                [pipp]
 languages/pipp/t/php/builtin.t                              [pipp]
@@ -3245,6 +3258,7 @@
 t/compilers/pge/perl6regex/rx_backtrack                     []
 t/compilers/pge/perl6regex/rx_captures                      []
 t/compilers/pge/perl6regex/rx_charclass                     []
+t/compilers/pge/perl6regex/rx_goal                          []
 t/compilers/pge/perl6regex/rx_lookarounds                   []
 t/compilers/pge/perl6regex/rx_metachars                     []
 t/compilers/pge/perl6regex/rx_modifiers                     []

Modified: branches/pdd22io_part3/MANIFEST.SKIP
==============================================================================
--- branches/pdd22io_part3/MANIFEST.SKIP	(original)
+++ branches/pdd22io_part3/MANIFEST.SKIP	Mon Dec 29 23:28:53 2008
@@ -1,6 +1,6 @@
 # ex: set ro:
 # $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Dec 24 13:06:20 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Dec 26 11:40:35 2008 UT
 #
 # This file should contain a transcript of the svn:ignore properties
 # of the directories in the Parrot subversion repository. (Needed for
@@ -752,6 +752,16 @@
 # generated from svn:ignore of 'languages/ecmascript/src/'
 ^languages/ecmascript/src/gen_.*\.pir$
 ^languages/ecmascript/src/gen_.*\.pir/
+# generated from svn:ignore of 'languages/ecmascript/t/js_pt/'
+^languages/ecmascript/t/js_pt/.*\.js$
+^languages/ecmascript/t/js_pt/.*\.js/
+^languages/ecmascript/t/js_pt/.*\.out$
+^languages/ecmascript/t/js_pt/.*\.out/
+# generated from svn:ignore of 'languages/ecmascript/t/sanity_pt/'
+^languages/ecmascript/t/sanity_pt/.*\.js$
+^languages/ecmascript/t/sanity_pt/.*\.js/
+^languages/ecmascript/t/sanity_pt/.*\.out$
+^languages/ecmascript/t/sanity_pt/.*\.out/
 # generated from svn:ignore of 'languages/forth/'
 ^languages/forth/Makefile$
 ^languages/forth/Makefile/

Modified: branches/pdd22io_part3/NEWS
==============================================================================
--- branches/pdd22io_part3/NEWS	(original)
+++ branches/pdd22io_part3/NEWS	Mon Dec 29 23:28:53 2008
@@ -7,8 +7,9 @@
     - removed slice syntax, e.g. $P0[1..2]
     - removed .namespace <ident>/.endnamespace <ident> pair
   + PIRC
-    - refactoring of data structures
+    - refactoring of various data structures
     - various bug fixes and updates
+    - basic bytecode generation for calling conventions
 - Languages
   + Pipp
     - added support for 'elsif'

Modified: branches/pdd22io_part3/compilers/imcc/imc.h
==============================================================================
--- branches/pdd22io_part3/compilers/imcc/imc.h	(original)
+++ branches/pdd22io_part3/compilers/imcc/imc.h	Mon Dec 29 23:28:53 2008
@@ -250,7 +250,7 @@
         FUNC_MODIFIES(*error_message);
 
 int imcc_vfprintf(PARROT_INTERP,
-    ARGMOD(PMC *io),
+    ARGIN(PMC *io),
     ARGIN(const char *format),
     va_list ap)
         __attribute__nonnull__(1)
@@ -294,20 +294,6 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_CAN_RETURN_NULL
-Instruction * multi_keyed(PARROT_INTERP,
-    ARGMOD(IMC_Unit *unit),
-    ARGIN(const char *name),
-    ARGIN(SymReg **r),
-    int nr,
-    int keyvec,
-    int emit)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*unit);
-
 void op_fullname(
     ARGOUT(char *dest),
     ARGIN(const char *name),

Modified: branches/pdd22io_part3/compilers/imcc/imcparser.c
==============================================================================
--- branches/pdd22io_part3/compilers/imcc/imcparser.c	(original)
+++ branches/pdd22io_part3/compilers/imcc/imcparser.c	Mon Dec 29 23:28:53 2008
@@ -1027,7 +1027,7 @@
     SymReg * sr;
     Instruction *i;
 }
-/* Line 187 of yacc.c.  */
+/* Line 193 of yacc.c.  */
 #line 1021 "compilers/imcc/imcparser.c"
 	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */

Modified: branches/pdd22io_part3/compilers/imcc/imcparser.h
==============================================================================
--- branches/pdd22io_part3/compilers/imcc/imcparser.h	(original)
+++ branches/pdd22io_part3/compilers/imcc/imcparser.h	Mon Dec 29 23:28:53 2008
@@ -303,7 +303,7 @@
     SymReg * sr;
     Instruction *i;
 }
-/* Line 1489 of yacc.c.  */
+/* Line 1529 of yacc.c.  */
 #line 297 "compilers/imcc/imcparser.h"
 	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */

Modified: branches/pdd22io_part3/compilers/imcc/instructions.c
==============================================================================
--- branches/pdd22io_part3/compilers/imcc/instructions.c	(original)
+++ branches/pdd22io_part3/compilers/imcc/instructions.c	Mon Dec 29 23:28:53 2008
@@ -50,7 +50,8 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(4);
 
-static int e_file_open(SHIM_INTERP, ARGIN(void *param))
+static int e_file_open(PARROT_INTERP, ARGIN(void *param))
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */

Modified: branches/pdd22io_part3/compilers/imcc/instructions.h
==============================================================================
--- branches/pdd22io_part3/compilers/imcc/instructions.h	(original)
+++ branches/pdd22io_part3/compilers/imcc/instructions.h	Mon Dec 29 23:28:53 2008
@@ -159,9 +159,7 @@
 void imcc_init_tables(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-int ins_print(PARROT_INTERP,
-    ARGIN(PMC *io),
-    ARGIN(const Instruction *ins))
+int ins_print(PARROT_INTERP, ARGIN(PMC *io), ARGIN(const Instruction *ins))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);

Modified: branches/pdd22io_part3/compilers/imcc/main.c
==============================================================================
--- branches/pdd22io_part3/compilers/imcc/main.c	(original)
+++ branches/pdd22io_part3/compilers/imcc/main.c	Mon Dec 29 23:28:53 2008
@@ -45,10 +45,9 @@
 
 static void compile_to_bytecode(PARROT_INTERP,
     ARGIN(const char * const sourcefile),
-    ARGIN(const char * const output_file))
+    ARGIN_NULLOK(const char * const output_file))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+        __attribute__nonnull__(2);
 
 static void determine_input_file_type(PARROT_INTERP,
     ARGIN(const char * const sourcefile))
@@ -77,11 +76,10 @@
 
 static void imcc_run_pbc(PARROT_INTERP,
     int obj_file,
-    ARGIN(const char *output_file),
+    ARGIN_NULLOK(const char *output_file),
     int argc,
     ARGIN(char **argv))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
         __attribute__nonnull__(5);
 
 static void imcc_write_pbc(PARROT_INTERP, ARGIN(const char *output_file))
@@ -764,7 +762,7 @@
 */
 
 static void
-imcc_run_pbc(PARROT_INTERP, int obj_file, ARGIN(const char *output_file),
+imcc_run_pbc(PARROT_INTERP, int obj_file, ARGIN_NULLOK(const char *output_file),
         int argc, ARGIN(char **argv))
 {
     if (IMCC_INFO(interp)->imcc_warn)
@@ -917,7 +915,7 @@
 static void
 compile_to_bytecode(PARROT_INTERP,
                     ARGIN(const char * const sourcefile),
-                    ARGIN(const char * const output_file))
+                    ARGIN_NULLOK(const char * const output_file))
 {
     PackFile *pf;
     yyscan_t  yyscanner = IMCC_INFO(interp)->yyscanner;

Modified: branches/pdd22io_part3/compilers/imcc/optimizer.c
==============================================================================
--- branches/pdd22io_part3/compilers/imcc/optimizer.c	(original)
+++ branches/pdd22io_part3/compilers/imcc/optimizer.c	Mon Dec 29 23:28:53 2008
@@ -83,8 +83,6 @@
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-#if DO_LOOP_OPTIMIZATION
-
 PARROT_WARN_UNUSED_RESULT
 static int _is_ins_save(
     ARGIN(const IMC_Unit *unit),
@@ -95,8 +93,6 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#endif
-
 static int branch_branch(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
@@ -153,8 +149,6 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*unit);
 
-#if DO_LOOP_OPTIMIZATION
-
 PARROT_WARN_UNUSED_RESULT
 static int is_ins_save(PARROT_INTERP,
     ARGIN(const IMC_Unit *unit),
@@ -165,7 +159,29 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
         __attribute__nonnull__(4);
-#endif
+
+static int is_invariant(PARROT_INTERP,
+    ARGIN(const IMC_Unit *unit),
+    ARGIN(const Instruction *ins))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_WARN_UNUSED_RESULT
+static int loop_one(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int bnr)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*unit);
+
+PARROT_WARN_UNUSED_RESULT
+static int loop_optimization(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*unit);
+
+PARROT_WARN_UNUSED_RESULT
+static int max_loop_depth(ARGIN(const IMC_Unit *unit))
+        __attribute__nonnull__(1);
 
 static int strength_reduce(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
         __attribute__nonnull__(1)
@@ -187,8 +203,6 @@
 /* HEADERIZER END: static */
 
 #if DO_LOOP_OPTIMIZATION
-int loop_optimization(Interp *, IMC_Unit *);
-
 PARROT_WARN_UNUSED_RESULT
 int _is_ins_save(
     ARGIN(const IMC_Unit *unit),
@@ -687,12 +701,11 @@
 static int
 constant_propagation(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
 {
-    Instruction *ins, *ins2, *tmp, *prev;
-    int i;
+    Instruction *ins;
     SymReg *c, *o;
     int any = 0;
 
-    o = c = NULL; /* silence compiler uninit warning */
+    o = c = NULL; /* silence compiler uninit warning, but XXX better to handle flow well */
 
     IMCC_info(interp, 2, "\tconstant_propagation\n");
     for (ins = unit->instructions; ins; ins = ins->next) {
@@ -712,9 +725,12 @@
                before it gets to us */
 
         if (found) {
+            Instruction *ins2;
+
             IMCC_debug(interp, DEBUG_OPT2,
                     "propagating constant %I => \n", ins);
             for (ins2 = ins->next; ins2; ins2 = ins2->next) {
+                int i;
                 if (ins2->bbindex != ins->bbindex)
                     /* restrict to within a basic block */
                     goto next_constant;
@@ -725,7 +741,9 @@
                         if (instruction_writes(ins2, ins2->symregs[i]))
                             goto next_constant;
                         else if (instruction_reads(ins2, ins2->symregs[i])) {
+                            Instruction *tmp;
                             SymReg *old;
+
                             IMCC_debug(interp, DEBUG_OPT2,
                                     "\tpropagating into %I register %i",
                                     ins2, i);
@@ -736,7 +754,7 @@
                                 unit, ins2->opname, ins2->symregs, ins2->opsize,
                                 &found);
                             if (found) {
-                                prev = ins2->prev;
+                                const Instruction * const prev = ins2->prev;
                                 if (prev) {
                                     subst_ins(unit, ins2, tmp, 1);
                                     any = 1;
@@ -942,19 +960,14 @@
     int found, branched;
 
     /* construct a FLOATVAL_FMT with needed precision */
-    switch (NUMVAL_SIZE) {
-        case 8:
-            fmt = "%0.16g";
-            break;
-        case 12:
-            fmt = "%0.18Lg";
-            break;
-        default:
-            IMCC_warning(interp, "subs_constants",
-                    "used default FLOATVAL_FMT\n");
-            fmt = FLOATVAL_FMT;
-            break;
-    }
+#if NUMVAL_SIZE == 8
+    fmt = "%0.16g";
+#elif NUMVAL_SIZE == 12
+    fmt = "%0.18Lg";
+#else
+    fmt = FLOATVAL_FMT;
+    IMCC_warning(interp, "subs_constants", "used default FLOATVAL_FMT\n");
+#endif
 
     tmp = NULL;
     found = 0;
@@ -1067,8 +1080,9 @@
                 break;
             case 'S':
             {
-                char *name = string_to_cstring(interp, REG_STR(interp, 0));
-                r[1]       = mk_const(interp, name, r[0]->set);
+                char * const name = string_to_cstring(interp, REG_STR(interp, 0));
+
+                r[1] = mk_const(interp, name, r[0]->set);
 
                 snprintf(b, sizeof (b), "%p", REG_STR(interp, 0));
                 string_cstring_free(name);
@@ -1431,14 +1445,14 @@
                 used = 1;
 #else
             else {
-                Instruction *ins2;
-                SymReg      *addr;
-                int          j;
-
+                int j;
                 for (j=0; unit->bb_list[j]; j++) {
                     /* a branch can be the first ins in a block
                      * (if prev ins was a label)
                      * or the last ins in a block */
+                    Instruction *ins2;
+                    SymReg      *addr;
+
                     ins2 = unit->bb_list[j]->start;
                     if ((ins2->type & ITBRANCH) &&
                             (addr = get_branch_reg(ins2)) != 0) {
@@ -1728,7 +1742,7 @@
 
 /*
 
-=item C<int max_loop_depth>
+=item C<static int max_loop_depth>
 
 RT #48260: Not yet documented!!!
 
@@ -1737,7 +1751,7 @@
 */
 
 PARROT_WARN_UNUSED_RESULT
-int
+static int
 max_loop_depth(ARGIN(const IMC_Unit *unit))
 {
     int i;
@@ -1751,7 +1765,7 @@
 
 /*
 
-=item C<int is_invariant>
+=item C<static int is_invariant>
 
 RT #48260: Not yet documented!!!
 
@@ -1759,26 +1773,24 @@
 
 */
 
-int
+static int
 is_invariant(PARROT_INTERP, ARGIN(const IMC_Unit *unit), ARGIN(const Instruction *ins))
 {
-    int ok = 0;
-    int what = 0;
+    int what;
 
     if (STREQ(ins->opname, "new")) {
-        ok = 1;
         what = CHK_INV_NEW;
     }
     /* only, if once assigned and not changed */
     else if (STREQ(ins->opname, "set") &&
             !(ins->symregs[0]->usage & U_KEYED) &&
             ins->symregs[1]->type & VTCONST) {
-        ok = 1;
         what = CHK_INV_SET;
     }
-    if (ok)
-        return is_ins_save(interp, unit, ins, ins->symregs[0], what);
-    return 0;
+    else {
+        return 0;
+    }
+    return is_ins_save(interp, unit, ins, ins->symregs[0], what);
 }
 
 #  define MOVE_INS_1_BL
@@ -1870,7 +1882,7 @@
 
 /*
 
-=item C<int loop_one>
+=item C<static int loop_one>
 
 RT #48260: Not yet documented!!!
 
@@ -1878,7 +1890,8 @@
 
 */
 
-int
+PARROT_WARN_UNUSED_RESULT
+static int
 loop_one(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int bnr)
 {
     Basic_block * const bb = unit->bb_list[bnr];
@@ -1908,7 +1921,7 @@
 
 /*
 
-=item C<int loop_optimization>
+=item C<static int loop_optimization>
 
 RT #48260: Not yet documented!!!
 
@@ -1916,7 +1929,8 @@
 
 */
 
-int
+PARROT_WARN_UNUSED_RESULT
+static int
 loop_optimization(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
 {
     int l;

Modified: branches/pdd22io_part3/compilers/imcc/optimizer.h
==============================================================================
--- branches/pdd22io_part3/compilers/imcc/optimizer.h	(original)
+++ branches/pdd22io_part3/compilers/imcc/optimizer.h	Mon Dec 29 23:28:53 2008
@@ -63,27 +63,6 @@
         FUNC_MODIFIES(*unit)
         FUNC_MODIFIES(*r);
 
-int is_invariant(PARROT_INTERP,
-    ARGIN(const IMC_Unit *unit),
-    ARGIN(const Instruction *ins))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-int loop_one(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int bnr)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*unit);
-
-int loop_optimization(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*unit);
-
-PARROT_WARN_UNUSED_RESULT
-int max_loop_depth(ARGIN(const IMC_Unit *unit))
-        __attribute__nonnull__(1);
-
 int move_ins_out(PARROT_INTERP,
     ARGMOD(IMC_Unit *unit),
     ARGMOD(Instruction **ins),

Modified: branches/pdd22io_part3/compilers/imcc/pbc.c
==============================================================================
--- branches/pdd22io_part3/compilers/imcc/pbc.c	(original)
+++ branches/pdd22io_part3/compilers/imcc/pbc.c	Mon Dec 29 23:28:53 2008
@@ -126,6 +126,18 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static subs_t * find_sub_by_subid(PARROT_INTERP,
+    ARGIN(const char *lookup),
+    ARGIN(const subs_t *sym),
+    ARGOUT(int *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*pc);
+
 static void fixup_globals(PARROT_INTERP)
         __attribute__nonnull__(1);
 

Modified: branches/pdd22io_part3/compilers/ncigen/src/NCIGENAST.pir
==============================================================================
--- branches/pdd22io_part3/compilers/ncigen/src/NCIGENAST.pir	(original)
+++ branches/pdd22io_part3/compilers/ncigen/src/NCIGENAST.pir	Mon Dec 29 23:28:53 2008
@@ -29,6 +29,15 @@
     .return ()
 .end
 
+.sub 'clone' :method
+    $P0 = clone self
+    .return ($P0)
+.end
+
+.sub 'item' :method
+    .return (self)
+.end
+
 =head1 NCIGENAST Node types
 
 =head2 NCIGENAST::Node

Modified: branches/pdd22io_part3/compilers/pct/src/PCT/Grammar.pir
==============================================================================
--- branches/pdd22io_part3/compilers/pct/src/PCT/Grammar.pir	(original)
+++ branches/pdd22io_part3/compilers/pct/src/PCT/Grammar.pir	Mon Dec 29 23:28:53 2008
@@ -51,6 +51,28 @@
 .end
 
 
+=item FAILGOAL($goal [, 'dba'=>dba])
+
+Invoked when goal matching fails to find the goal.  Builds an appropriate
+error message and delegates the rest to C<panic>.
+
+=cut
+
+.sub 'FAILGOAL' :method
+    .param string goal
+    .param pmc options         :named :slurpy
+    .local string dba
+    dba = options['dba']
+    if dba goto have_dba
+    ##  if no dba supplied, use the name of the caller sub
+    $P0 = getinterp
+    $P0 = $P0['sub';1]
+    dba = $P0
+  have_dba:
+    .tailcall self.'panic'("Unable to parse ", dba, "; couldn't find final ", goal)
+.end
+
+
 =item item()
 
 Here we overload the item() method from PGE::Match to

Modified: branches/pdd22io_part3/compilers/pge/PGE/Exp.pir
==============================================================================
--- branches/pdd22io_part3/compilers/pge/PGE/Exp.pir	(original)
+++ branches/pdd22io_part3/compilers/pge/PGE/Exp.pir	Mon Dec 29 23:28:53 2008
@@ -780,11 +780,18 @@
     .local string subarg
     subarg = ''
     $I0 = exists self['arg']
-    if $I0 == 0 goto subarg_end
+    if $I0 == 0 goto subarg_dba
     subarg = self['arg']
     subarg = code.'escape'(subarg)
     subarg = concat ', ', subarg
     args['A'] = $S0
+  subarg_dba:
+    $I0 = exists self['dba']
+    if $I0 == 0 goto subarg_end
+    $S0 = self['dba']
+    $S0 = code.'escape'($S0)
+    subarg .= ", 'dba'=>"
+    subarg .= $S0
   subarg_end:
 
     .local string cname, captgen, captsave, captback

Modified: branches/pdd22io_part3/compilers/pge/PGE/OPTable.pir
==============================================================================
--- branches/pdd22io_part3/compilers/pge/PGE/OPTable.pir	(original)
+++ branches/pdd22io_part3/compilers/pge/PGE/OPTable.pir	Mon Dec 29 23:28:53 2008
@@ -128,6 +128,15 @@
     token['wb'] = 1
   with_wb:
 
+    ##  handle key scanning
+    unless key goto with_skipkey
+    $I0 = exists token['skipkey']
+    if $I0 goto with_skipkey
+    $P0 = token['parsed']
+    if null $P0 goto with_skipkey
+    token['skipkey'] = 1
+  with_skipkey:
+
     $S0 = token['match']
     if $S0 > '' goto with_match
     token['match'] = 'PGE::Match'
@@ -547,10 +556,13 @@
     goto token_match_success
   token_match_sub:
     $P0 = token['parsed']
-    $I0 = length key
-    $I0 += pos
     mob['KEY'] = key
-    mpos = $I0
+    mpos = pos
+    $I0 = token['skipkey']
+    unless $I0 goto token_match_sub_1
+    $I0 = length key
+    mpos += $I0
+  token_match_sub_1:
     oper = $P0(mob, 'action'=>action)
     delete mob['KEY']
     $P0 = oper.'from'()

Modified: branches/pdd22io_part3/compilers/pge/PGE/Perl6Regex.pir
==============================================================================
--- branches/pdd22io_part3/compilers/pge/PGE/Perl6Regex.pir	(original)
+++ branches/pdd22io_part3/compilers/pge/PGE/Perl6Regex.pir	Mon Dec 29 23:28:53 2008
@@ -130,15 +130,16 @@
     .param pmc mob
     .param pmc adverbs         :slurpy :named
 
-    .local string stop
+    .local string stop, tighter
     .local pmc stopstack, optable, match
 
     stopstack = get_global '@!stopstack'
     optable = get_global '$optable'
 
     stop = adverbs['stop']
+    tighter = adverbs['tighter']
     push stopstack, stop
-    match = optable.'parse'(mob, 'stop'=>stop)
+    match = optable.'parse'(mob, 'stop'=>stop, 'tighter'=>tighter)
     $S0 = pop stopstack
 
     .return (match)
@@ -212,6 +213,9 @@
     $P0 = get_global 'parse_quoted_literal'
     optable.'newtok'("term:'",  'equiv'=>'term:', 'nows'=>1, 'parsed'=>$P0)
 
+    $P0 = get_global 'parse_goal'
+    optable.'newtok'('term:~', 'equiv'=>'term:', 'parsed'=>$P0)
+
     optable.'newtok'('term:::',  'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::Cut')
     optable.'newtok'('term::::', 'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::Cut')
     optable.'newtok'('term:<cut>',    'equiv'=>'term:', 'nows'=>1, 'match'=>'PGE::Exp::Cut')
@@ -251,7 +255,7 @@
     optable.'newtok'('infix:=', 'tighter'=>'infix:', 'assoc'=>'right', 'match'=>'PGE::Exp::Alias')
 
     $P0 = get_global 'parse_modifier'
-    optable.'newtok'('prefix::', 'looser'=>'infix:|', 'nows'=>1, 'parsed'=>$P0)
+    optable.'newtok'('prefix::', 'looser'=>'infix:|', 'parsed'=>$P0)
 
     optable.'newtok'('close:}',  'precedence'=>'<', 'nows'=>1)
 
@@ -337,8 +341,13 @@
     .tailcall 'parse_term_ws'(mob)
 
   end_noterm:
+    $S0 = substr target, pos, 1
+    if $S0 == ':' goto err_cut
     (mob) = mob.'new'(mob, 'grammar'=>'PGE::Exp::Literal')
     .return (mob)
+  err_cut:
+    'parse_error'(mob, pos, 'Quantifier follows nothing in regex')
+    .return (mob)
 .end
 
 
@@ -1032,6 +1041,56 @@
 .end
 
 
+=item C<parse_goal>
+
+Parse a goal.
+
+=cut
+
+.sub 'parse_goal'
+    .param pmc mob
+    .local int pos, lastpos
+    .local string target
+    (mob, pos, target) = mob.'new'(mob, 'grammar'=>'PGE::Exp::Concat')
+    lastpos = length target
+    ##  skip any leading whitespace before goal
+    pos = find_not_cclass .CCLASS_WHITESPACE, target, pos, lastpos
+    .local pmc regex, goal, expr, alt, failsub
+    regex = get_global 'regex'
+    ##  parse the goal, down to concatenation precedence
+    mob.'to'(pos)
+    goal = regex(mob, 'tighter'=>'infix:')
+    unless goal goto fail_goal
+    goal = goal['expr']
+    pos = goal.'to'()
+    ##  skip any leading whitespace before expression
+    pos = find_not_cclass .CCLASS_WHITESPACE, target, pos, lastpos
+    ##  parse the goal, down to concatenation precedence
+    mob.'to'(pos)
+    expr = regex(mob, 'tighter'=>'infix:')
+    unless expr goto fail_expr
+    expr = expr['expr']
+    pos = expr.'to'()
+    mob.'to'(pos)
+    failsub = mob.'new'(mob, 'grammar'=>'PGE::Exp::Subrule')
+    failsub.'to'(pos)
+    failsub['subname'] = 'FAILGOAL'
+    $S0 = goal.'text'()
+    failsub['arg'] = $S0
+    alt = mob.'new'(mob, 'grammar'=>'PGE::Exp::Alt')
+    alt.'to'(pos)
+    push alt, goal
+    push alt, failsub
+    push mob, expr
+    push mob, alt
+    .return (mob)
+  fail_goal:
+    'parse_error'(mob, pos, 'Unable to parse goal after ~')
+  fail_expr:
+    'parse_error'(mob, pos, 'Unable to parse expression after ~')
+.end
+
+
 =item C<parse_modifier>
 
 Parse a modifier.
@@ -1056,7 +1115,7 @@
   name:
     pos = find_not_cclass .CCLASS_WORD, target, pos, lastpos
     $I1 = pos - $I0
-    if $I1 == 0 goto err_null_cut
+    if $I1 == 0 goto fail
     $S0 = substr target, $I0, $I1
     mob['key'] = $S0
     mob.'result_object'(value)
@@ -1072,8 +1131,7 @@
     ### XXX pos = find_not_cclass .CCLASS_WHITESPACE, target, pos, lastpos
     mob.'to'(pos)
     .return (mob)
-  err_null_cut:
-    'parse_quant_error'(mob)
+  fail:
     .return (mob)
 .end
 
@@ -1383,6 +1441,8 @@
     inc $I0
     pad['subpats'] = $I0
   end:
+    $S0 = pad['dba']
+    self['dba'] = $S0
     .return (self)
 .end
 

Modified: branches/pdd22io_part3/compilers/pge/PGE/Regex.pir
==============================================================================
--- branches/pdd22io_part3/compilers/pge/PGE/Regex.pir	(original)
+++ branches/pdd22io_part3/compilers/pge/PGE/Regex.pir	Mon Dec 29 23:28:53 2008
@@ -433,6 +433,29 @@
     .return (mob)
 .end
 
+=item FAILGOAL(pmc mob, string goal [, 'dba'=>dba])
+
+Throw an exception when parsing fails in goal matching.
+
+=cut
+
+.sub 'FAILGOAL' :method
+    .param string goal
+    .param pmc options         :slurpy :named
+    .local string dba
+    dba = options['dba']
+    if dba goto have_dba
+    $P0 = getinterp
+    $P0 = $P0['sub'; 1]
+    dba = $P0
+  have_dba:
+    .local string message
+    message = concat "Unable to parse ", dba
+    message .= ", couldn't find final "
+    message .= goal
+    die message
+.end
+
 =back
 
 =head2  Support subroutines

Modified: branches/pdd22io_part3/compilers/pirc/TODO
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/TODO	(original)
+++ branches/pdd22io_part3/compilers/pirc/TODO	Mon Dec 29 23:28:53 2008
@@ -7,25 +7,30 @@
 
 Fairly randomly sorted, the tasks are:
 
-1.  Emit the actual bytecodes into a PackFile/codesegment.
+[DONE] 1.  Emit the actual bytecodes into a PackFile/codesegment.
 
-2.  Create a PMC constant for strings, numbers, keys and
-    subroutines.
+[DONE] 2.a Create a PMC constant for strings, numbers and
+             subroutines.
+[TODO] 2.b Create a PMC constant for keys
 
-3.  Complete PASM output, so it can actually be parsed and run.
+[TODO] 3.  Complete PASM output, so it can actually be parsed and run.
 
-4.  Handle :multi flag properly.
+[TODO] 4.  Handle :multi flag properly.
 
-5.  Handle nested macro expansions.
+[TODO] 5.  Handle nested macro expansions.
 
-6.  Fix all memory leaks. this should be trivial, given PIR's built-in
-    allocated-memory-pointer-registering infrastructure. In some
-    places this is not used yet, and in others, it's not necessary
-    to use it (but in those mem_sys_free() must be called explicitly).
+[TODO] 6.  Fix all memory leaks. this should be trivial, given PIR's built-in
+           allocated-memory-pointer-registering infrastructure. In some
+           places this is not used yet, and in others, it's not necessary
+           to use it (but in those mem_sys_free() must be called explicitly).
 
-7.  Figure out how :named argument passing works in bytecode.
+[TODO] 7.  Figure out how :named argument passing works in bytecode.
 
-8.  Finish the parrot calling conventions ops in the back-end
-    (var.args must be fixed).
+[DONE] 8.  Finish the parrot calling conventions ops in the back-end
+           (var.args must be fixed).
+
+[TODO] 9.  Handle :slurpy and :flat flags properly in bytecode.
+
+[TODO] 10. Handle indexed assignments in bytecode.
 
 More tasks will be added as I think of them. --kjs

Modified: branches/pdd22io_part3/compilers/pirc/new/bcgen.c
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/bcgen.c	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/bcgen.c	Mon Dec 29 23:28:53 2008
@@ -9,6 +9,7 @@
 
 #include "bcgen.h" /* XXX future maybe parrot/bcgen.h */
 
+#include "pirsymbol.h" /* XXX remove this dependency somehow. */
 
 /*
 
@@ -30,6 +31,9 @@
   // create a bytecode object
   bytecode *bc = new_bytecode(interp, "foo.pir", codesize, bytes);
 
+  // add a subroutine PMC
+  add_sub_pmc(bc, sub->info, sub->needlex);
+
   while ( ... ) {
 
       // write opcodes
@@ -61,7 +65,7 @@
 };
 
 
-static int new_const(bytecode * const bc);
+static int new_pbc_const(bytecode * const bc);
 
 
 /*
@@ -78,7 +82,7 @@
 /*
 
 =item C<static int
-new_const(bytecode * const bc)>
+new_pbc_const(bytecode * const bc)>
 
 Add a new constant to the constant table.
 
@@ -89,16 +93,16 @@
 
 */
 static int
-new_const(bytecode * const bc) {
+new_pbc_const(bytecode * const bc) {
     Interp *interp = bc->interp;
     size_t oldcount;
     size_t newcount;
-    PackFile_Constant *new_constant;
+    PackFile_Constant *new_pbc_constant;
 
     oldcount = interp->code->const_table->const_count;
     newcount = oldcount + 1;
 
-    new_constant = PackFile_Constant_new(interp);
+    new_pbc_constant = PackFile_Constant_new(interp);
 
     /* Update the constant count and reallocate */
     if (interp->code->const_table->constants)
@@ -109,7 +113,7 @@
         interp->code->const_table->constants =
             mem_allocate_n_typed(newcount, PackFile_Constant *);
 
-    interp->code->const_table->constants[oldcount] = new_constant;
+    interp->code->const_table->constants[oldcount] = new_pbc_constant;
     interp->code->const_table->const_count         = newcount;
 
     return oldcount;
@@ -129,7 +133,7 @@
 */
 int
 add_pmc_const(bytecode * const bc, PMC * pmc) {
-    int index                   = new_const(bc);
+    int index                   = new_pbc_const(bc);
     PackFile_Constant *constant = bc->interp->code->const_table->constants[index];
     constant->type              = PFC_PMC;
     constant->u.key             = pmc;
@@ -152,7 +156,7 @@
 */
 int
 add_string_const(bytecode * const bc, char const * const str) {
-    int                index    = new_const(bc);
+    int                index    = new_pbc_const(bc);
     PackFile_Constant *constant = bc->interp->code->const_table->constants[index];
 
     constant->type     = PFC_STRING;
@@ -176,7 +180,7 @@
 */
 int
 add_num_const(bytecode * const bc, double f) {
-    int index                   = new_const(bc);
+    int index                   = new_pbc_const(bc);
     PackFile_Constant *constant = bc->interp->code->const_table->constants[index];
     constant->type              = PFC_NUMBER;
     constant->u.number          = f;
@@ -189,31 +193,105 @@
 add_key_const(bytecode * const bc, PMC *key)>
 
 Add a key constant to the constants list.
-XXX Implement this.
 
 =cut
 
 */
 int
 add_key_const(bytecode * const bc, PMC *key) {
-    return 0;
+    int index                   = new_pbc_const(bc);
+    PackFile_Constant *constant = bc->interp->code->const_table->constants[index];
+    constant->type              = PFC_KEY;
+    constant->u.key             = key;
+    return index;
 }
 
 
 /*
 
-=item C<bytecode *
-new_bytecode(Interp *interp, char const * const filename, int bytes, int codesize)>
+static void
+check_requested_constant(bytecode * const bc, unsigned index, int expectedtype)>
+
+Perform a sanity check on a requested constant. The constant at index C<index>
+is requested; this function checks whether the index is valid. Then, if so, the
+constant is checked for its type, which must be C<expectedtype>. This must be one
+of: PFC_PMC, PFC_NUMBER, PFC_STRING.
+
+=cut
+
+*/
+static void
+check_requested_constant(bytecode * const bc, unsigned index, int expectedtype) {
+    /* make sure the requested PMC exists. */
+    PARROT_ASSERT(index < bc->interp->code->const_table->const_count);
+    /* make sure the requested constant is a PMC */
+    PARROT_ASSERT(bc->interp->code->const_table->constants[index]->type == expectedtype);
+}
+
+/*
+
+=item C<PMC *
+get_pmc_const(bytecode * const bc, unsigned index)>
+
+Get the PMC constant at index C<index> in the PBC constant table.
+
+=cut
+
+*/
+PMC *
+get_pmc_const(bytecode * const bc, unsigned index) {
+    check_requested_constant(bc, index, PFC_PMC);
+    return bc->interp->code->const_table->constants[index]->u.key;
+}
+
+/*
+
+=item C<FLOATVAL
+get_num_const(bytecode * const bc, unsigned index)>
+
+Get the FLOATVAL constant at index C<index> in the PBC constant table.
+
+=cut
+
+*/
+FLOATVAL
+get_num_const(bytecode * const bc, unsigned index) {
+    check_requested_constant(bc, index, PFC_NUMBER);
+    return bc->interp->code->const_table->constants[index]->u.number;
+}
+
+/*
+
+=item C<STRING *
+get_string_const(bytecode * const bc, unsigned index)>
+
+Get the STRING constant at index C<index> in the PBC constant table.
+
+=cut
 
-Create a new bytecode struct, representing the bytecode for file C<filename>
+*/
+STRING *
+get_string_const(bytecode * const bc, unsigned index) {
+    check_requested_constant(bc, index, PFC_STRING);
+    return bc->interp->code->const_table->constants[index]->u.string;
+}
 
-Create a new bytecode struct and return a pointer to it.
+/*
+
+=item C<bytecode *
+new_bytecode(Interp *interp, char const * const filename)>
+
+Create a new bytecode struct, representing the bytecode for file C<filename>.
+The bytecode struct contains a PackFile, which is initialized and
+loaded into the Parrot interpreter C<interp>. Default bytecode segments
+are created, and the interpreter's C<iglobals> field is stored as a constant
+PMC in the bytecode's constant table.
 
 =cut
 
 */
 bytecode *
-new_bytecode(Interp *interp, char const * const filename, int bytes, int codesize) {
+new_bytecode(Interp *interp, char const * const filename) {
     PMC      *self;
     bytecode *bc      = (bytecode *)mem_sys_allocate(sizeof (bytecode));
 
@@ -227,21 +305,25 @@
     bc->interp        = interp;
 
     /* create segments */
+    PARROT_ASSERT(filename != NULL);
     interp->code      = PF_create_default_segs(interp, filename, 1);
 
     /* add interpreter globals to bytecode. XXX Why is this? */
     self              = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_INTERPRETER);
     add_pmc_const(bc, self);
 
-    create_codesegment(bc, codesize);
-
     return bc;
 }
 
 /*
 
+=item C<void
+create_codesegment(bytecode * const bc, int codesize)>
+
 Create a code segment of size C<codesize>.
 
+=cut
+
 */
 void
 create_codesegment(bytecode * const bc, int codesize) {
@@ -286,6 +368,8 @@
 void
 emit_opcode(bytecode * const bc, opcode_t op) {
     *bc->opcursor++ = op;
+    fprintf(stderr, "[%d]", op);
+
 }
 
 /*
@@ -303,124 +387,258 @@
 void
 emit_int_arg(bytecode * const bc, int intval) {
     *bc->opcursor++ = intval;
+    fprintf(stderr, "[%d]", intval);
+
 }
 
+
+
+/* XXX remove or update prototype once the XXX below has been resolved. */
+static STRING *add_string_const_from_cstring(bytecode * const bc, char const * const str);
+
 /*
 
-=item C<void
-emit_op_by_name(bytecode * const bc, char const * const opname)>
+XXX think of better name.
+Add a string constant to the constants list, and return the STRING variant
 
-Emit the opcode by name. C<opname> must be a valid, signatured opname.
-So, C<print> is not valid, whereas C<print_ic> is. The opcode of the
-opname is looked up and written into the bytecode stream. If C<opname>
-is not valid, an error message is written.
+*/
+static STRING *
+add_string_const_from_cstring(bytecode * const bc, char const * const str) {
+    int index = add_string_const(bc, str);
+    return bc->interp->code->const_table->constants[index]->u.string;
+}
+
+
+/*
+
+=item C<PMC *
+generate_multi_signature(bytecode * const bc)>
 
-XXX Possibly bail out if error? No need to continue.
+Generate a PMC for the multi signature, based on the types defined in C<multi_types>
+C<type_count> indicates the number of types in the list.
 
 =cut
 
 */
-void
-emit_op_by_name(bytecode * const bc, char const * const opname) {
-    int op = bc->interp->op_lib->op_code(opname, 1);
-    if (op < 0) {
-        /* error */
-        fprintf(stderr, "Error: '%s' is not an op\n", opname);
+static PMC *
+generate_multi_signature(bytecode * const bc, multi_type * const types, unsigned type_count) {
+    unsigned     i;
+    multi_type * iter;
+    PMC        * multi_signature;
+
+    /* cancel if there's no :multi flag */
+    if (type_count == 0)
+        return NULL;
+
+    /* create a FixedPMCArray to store all multi types */
+    multi_signature = pmc_new(bc->interp, enum_class_FixedPMCArray);
+    /* set its size as specified in type_count */
+    VTABLE_set_integer_native(bc->interp, multi_signature, type_count);
+
+
+    /* A type_count of 1 means there was a :multi flag, but no :multi types.
+     * therefore, create a special signature and return that.
+     */
+    if (type_count == 1) {
+        STRING * const sig     = string_from_literal(bc->interp, "__VOID");
+        PMC    * const sig_pmc = pmc_new(bc->interp, enum_class_String);
+
+        VTABLE_set_string_native(bc->interp, sig_pmc, sig);
+        VTABLE_set_pmc_keyed_int(bc->interp, multi_signature, 0, sig_pmc);
+
+        return multi_signature;
     }
-    else
-        emit_opcode(bc, op);
+
+    iter = types;
+    --type_count; /* type count is 1 too high, fix that now. */
+
+    /* add all multi types to the PMC array */
+    for (i = 0; i < type_count; ++i) {
+        PMC *sig_pmc = NULL;
+
+        switch (iter->entry_type) {
+            case MULTI_TYPE_IDENT: {
+                /* add the string to the constant table, retrieve a pointer to the STRING */
+                STRING * typestring = add_string_const_from_cstring(bc, types[i].u.ident);
+                /* create a new String PMC. */
+                sig_pmc = pmc_new(bc->interp, enum_class_String);
+                /* set the STRING in the String PMC */
+                VTABLE_set_string_native(bc->interp, sig_pmc, typestring);
+                break;
+            }
+            case MULTI_TYPE_KEYED:
+                /* XXX implement this */
+
+                break;
+            default:
+                fprintf(stderr, "invalid multi entry type");
+                break; /* XXX fatal; throw excpetion? */
+        }
+
+        /* store the signature PMC in the array */
+        VTABLE_set_pmc_keyed_int(bc->interp, multi_signature, i, sig_pmc);
+
+    }
+    return multi_signature;
+
 }
 
-/* XXX remove or update prototype once the XXX below has been resolved. */
-static STRING *add_string_const_from_cstring(bytecode * const bc, char const * const str);
+/*
+
+=item C<static PMC *
+create_lexinfo()>
 
+Create a lexinfo PMC for the sub C<sub>. If there are no lexicals,
+but the C<:lex> flag was specified, or the sub has an C<:outer> flag,
+then a lexinfo is created after all. The created lexinfo is returned.
+
+=cut
+
+*/
+static PMC *
+create_lexinfo(bytecode * const bc, PMC * sub, lexical * const lexicals, int lexflag) {
+    lexical      * lexiter     = lexicals;
+    INTVAL   const lex_info_id = Parrot_get_ctx_HLL_type(bc->interp, enum_class_LexInfo);
+    STRING * const method      = string_from_literal(bc->interp, "declare_lex_preg");
+
+    int      outer = 0; /* change type of this */
+
+    /* create a lexinfo PMC */
+    PMC * lex_info             = pmc_new_noinit(bc->interp, lex_info_id);
+    VTABLE_init_pmc(bc->interp, lex_info, sub);
+
+    /* walk through the list of lexicals and register them */
+    while (lexiter) {
+        STRING *lexname = string_from_cstring(bc->interp, lexiter->name, strlen(lexiter->name));
+
+        /* declare the .lex as such */
 /*
+        fprintf(stderr, "Create lexinfo: color of .lex '%s' is: %d\n", lexiter->name,
+                lexiter->info->color);
 
-XXX think of better name.
-Add a string constant to the constants list, and return the STRING variant
+*/
+        Parrot_PCCINVOKE(bc->interp, lex_info, method, "SI->", lexname, lexiter->info->color);
+
+        lexiter = lexiter->next;
+    }
+
+    /* if lex_info is still NULL, that means that the sub has no .lexicals,
+     * and doesn't need a lex_info. If, however, the sub has an :outer or a
+     * :lex flag, then create the lex_info anyway.
+     */
+    if (lex_info == NULL && (outer || lexflag)) {
+        lex_info = pmc_new_noinit(bc->interp, lex_info_id);
+        VTABLE_init_pmc(bc->interp, lex_info, sub);
+    }
+
+    return lex_info;
+}
+
+/*
+
+Find the outer sub that has name C<outername>.
+If not found, NULL is returned.
 
 */
-static STRING *
-add_string_const_from_cstring(bytecode * const bc, char const * const str) {
-    int index = add_string_const(bc, str);
-    return bc->interp->code->const_table->constants[index]->u.string;
+static PMC *
+find_outer_sub(bytecode * const bc, char const * const outername) {
+    PMC    *current;
+    STRING *cur_name;
+    size_t  len;
+
+    /* if sub has no :outer, leave */
+    if (outername == NULL)
+        return NULL;
+
+
+    len = strlen(outername);
+    if (len == 0)
+        return NULL;
+
+
+    /* XXX go here through the global labels, and check whether it can be found */
+
+    /* could be eval too; check if :outer is the current sub */
+    current = CONTEXT(bc->interp)->current_sub;
+
+    if (current == NULL) {
+        fprintf(stderr, "cannot find :outer sub '%s'\n", outername); /* XXX exception ? */
+        return NULL;
+    }
+
+    cur_name = PMC_sub(current)->name;
+
+    if (cur_name->strlen == len && (memcmp((char *)cur_name->strstart, outername, len) == 0))
+        return current;
+
+    return NULL;
 }
 
 
 
+/*
+
+Get the namespace PMC.
+
+*/
+static PMC *
+get_namespace_pmc(bytecode * const bc, multi_type * const ns) {
+
+    return NULL;
+}
+
 
 /*
 
 =item C<void
-add_sub_pmc(bytecode * const bc,
-            char const * const subname,  -- the name of this sub
-            char const * const nsentry,  -- the value of the :nsentry flag
-            char const * const subid,    -- the value of the :subid flag
-            int vtable_index,            -- vtable index, or -1 if no :vtable
-            unsigned regs_used[],        -- register usage of this sub
-            int startoffset,             -- start offset of this sub in bytecode
-            int endoffset)>              -- end offset of this sub in bytecode
+add_sub_pmc(bytecode * const bc, sub_info * const info, int needlex)>
 
 Add a sub PMC to the constant table. This function initializes the sub PMC.
+The index where the PMC is stored in the constant table is returned.
 
 =cut
 
 */
-void
-add_sub_pmc(bytecode * const bc,
-            char const * const subname,
-            char const * const nsentry,
-            char const * const subid,
-            int vtable_index,
-            unsigned regs_used[],
-            int startoffset,
-            int endoffset)
-{
-    PMC               *sub_pmc;
-    Parrot_sub        *sub;
-    int                subconst_index;
-    int                subname_index;
-    int                i;
-    PackFile_Constant *subname_const;
+int
+add_sub_pmc(bytecode * const bc, sub_info * const info, int needlex) {
+    PMC                   * sub_pmc;
+    Parrot_sub            * sub;
+    int                     subconst_index;
+    int                     subname_index;
+    int                     i;
+    PackFile_Constant     * subname_const;
 
 
     /* The .sub is represented by a "Sub" PMC.
      * If that should be changed into something else, fix that here (e.g. "Coroutine").
      */
-    sub_pmc       = pmc_new(bc->interp, enum_class_Sub);
-    sub           = PMC_sub(sub_pmc);
-    subname_index = add_string_const(bc, subname);
-    subname_const = bc->interp->code->const_table->constants[subname_index];
+    sub_pmc               = pmc_new(bc->interp, enum_class_Sub);
+    sub                   = PMC_sub(sub_pmc);
+    subname_index         = add_string_const(bc, info->subname);
+    subname_const         = bc->interp->code->const_table->constants[subname_index];
 
     /* set start and end offset of this sub in the bytecode. This is calculated during
      * the parsing phase.
      */
-    sub->start_offs       = startoffset;
-    sub->end_offs         = endoffset;
+    sub->start_offs       = info->startoffset;
+    sub->end_offs         = info->endoffset;
 
-    /* XXX fix namespace stuff */
-    sub->namespace_name   = NULL;
+    sub->namespace_name   = get_namespace_pmc(bc, info->name_space);
 
-    /* XXX does this work properly? is "current_HLL" really "current"? */
     sub->HLL_id           = CONTEXT(bc->interp)->current_HLL;
-
-    /* XXX fix lex stuff */
-    sub->lex_info         = NULL;
-
-    /* XXX fix outer stuff */
-    sub->outer_sub        = NULL;
+    sub->lex_info         = create_lexinfo(bc, sub_pmc, info->lexicals, needlex);
+    sub->outer_sub        = find_outer_sub(bc, info->outersub);
 
     /* Set the vtable index; if this .sub was declared as :vtable, its vtable
      * index was found during the parse; otherwise it's -1.
      */
-    sub->vtable_index     = vtable_index;
+    sub->vtable_index     = info->vtable_index;
 
-    /* XXX fix multi stuff */
-    sub->multi_signature  = NULL;
+    sub->multi_signature  = generate_multi_signature(bc, info->multi_types, info->num_multi_types);
 
     /* store register usage of this sub. */
     for (i = 0; i < 4; ++i)
-        sub->n_regs_used[i] = regs_used[i];
+        sub->n_regs_used[i] = info->regs_used[i];
 
     /* store the name of this sub; it's stored in the constant table. */
     sub->name = subname_const->u.string;
@@ -428,16 +646,16 @@
     /* If there was a :nsentry, add it to the constants table, and set
      * the ns_entry_name attribute to that STRING. Default value is the sub's name.
      */
-    if (nsentry)
-        sub->ns_entry_name = add_string_const_from_cstring(bc, nsentry);
+    if (info->nsentry)
+        sub->ns_entry_name = add_string_const_from_cstring(bc, info->nsentry);
     else
         sub->ns_entry_name = subname_const->u.string;
 
     /* if there was a :subid, add it to the constants table, and set the subid
      * attribute to that STRING. Default value is the sub's name.
      */
-    if (subid)
-        sub->subid = add_string_const_from_cstring(bc, subid);
+    if (info->subid)
+        sub->subid = add_string_const_from_cstring(bc, info->subid);
     else
         sub->subid = subname_const->u.string;
 
@@ -450,7 +668,10 @@
     subconst_index = add_pmc_const(bc, sub_pmc);
 
     /* Add a new fixup entry in the fixup table for this sub. */
-    PackFile_FixupTable_new_entry(bc->interp, subname, enum_fixup_sub, subconst_index);
+    PackFile_FixupTable_new_entry(bc->interp, info->subname, enum_fixup_sub, subconst_index);
+
+    /* return the index in the constant table where this sub PMC is stored */
+    return subconst_index;
 }
 
 
@@ -462,6 +683,8 @@
 Write the generated bytecode (stored somewhere in a packfile)
 to the file C<filename>.
 
+=cut
+
 */
 void
 write_pbc_file(bytecode * const bc, char const * const filename) {

Modified: branches/pdd22io_part3/compilers/pirc/new/bcgen.h
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/bcgen.h	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/bcgen.h	Mon Dec 29 23:28:53 2008
@@ -8,13 +8,67 @@
 
 #include "parrot/parrot.h"
 #include "parrot/embed.h"
+#include "pirdefines.h"
 
 /* the type name is exported, but not its private bits */
 struct bytecode;
 
 typedef struct bytecode bytecode;
 
-bytecode *new_bytecode(Interp *interp, char const * const filename, int bytes, int codesize);
+/* selector values for multi_union */
+typedef enum multi_entry {
+    MULTI_TYPE_KEYED,
+    MULTI_TYPE_IDENT
+
+} multi_entry;
+
+typedef struct multi_key_type {
+
+    struct multi_key_type * next;
+} multi_key_type;
+
+
+/* for multi-method signature types */
+typedef struct multi_type {
+
+    union multi_union {
+        char const     * ident;
+        multi_key_type   key;
+    } u;
+
+    multi_entry entry_type;
+
+} multi_type;
+
+
+typedef struct lexical {
+    char const     * name;
+    struct syminfo * info;
+    struct lexical * next;
+
+} lexical;
+
+
+/* sub info structure, containing all info about a sub that a bytecode
+ * generator needs to know.
+ */
+typedef struct sub_info {
+    char const         * subname;
+    char const         * nsentry;
+    char const         * subid;
+    char const         * outersub;
+    int                  vtable_index;
+    unsigned             regs_used[NUM_PARROT_TYPES];
+    int                  startoffset;
+    int                  endoffset;
+    unsigned             num_multi_types;
+    multi_type         * multi_types;   /* data types of parameters if this is a multi sub */
+    lexical            * lexicals;
+    multi_type         * name_space; /* can be a string or key */
+
+} sub_info;
+
+bytecode *new_bytecode(Interp *interp, char const * const filename);
 
 
 void create_codesegment(bytecode * const bc, int codesize);
@@ -35,13 +89,7 @@
 
 void emit_int_arg(bytecode * const bc, int argvalue);
 
-/*
-void emit_pmc_arg(bytecode * const bc, int pmc_const_index);
-
-void emit_num_arg(bytecode * const bc, int num_const_index);
-
-void emit_string_arg(bytecode * const bc, int string_const_index);
-*/
+/* storing constants in constant table */
 
 int add_key_const(bytecode * const bc, PMC *key);
 
@@ -51,29 +99,23 @@
 
 int add_pmc_const(bytecode * const bc, PMC * pmc) ;
 
-/* for adding constants */
+PMC *get_pmc_const(bytecode * const bc, unsigned index);
 
-/* returns the id in the constant table */
-/*
-int add_pmc_const(bytecode * const bc);
+FLOATVAL get_num_const(bytecode * const bc, unsigned index);
 
-int add_string_const(bytecode * const bc, STRING *s);
+STRING *get_string_const(bytecode * const bc, unsigned index);
 
-int add_num_const(bytecode * const bc, FLOATVAL f);
 
-int add_int_const(bytecode * const bc, INTVAL i);
-  */
+/*
 
+int add_string_const(bytecode * const bc, STRING *s);
 
-/* XXX todo: define some API functions for finding values, etc. like this: */
-int get_string_const_index(bytecode * const bc, STRING *s);
-/* retrieves the index of s in the constant table */
+int add_num_const(bytecode * const bc, FLOATVAL f);
 
+*/
 
 
-void add_sub_pmc(bytecode * const bc,
-            char const * const subname, char const * const nsentry, char const * const subid,
-            int vtable_index, unsigned regs_used[], int startoffset, int endoffset);
+int add_sub_pmc(bytecode * const bc, sub_info * const info, int needlex);
 
 
 #endif /* PARROT_BCGEN_H_GUARD */

Modified: branches/pdd22io_part3/compilers/pirc/new/main.c
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/main.c	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/main.c	Mon Dec 29 23:28:53 2008
@@ -74,8 +74,7 @@
     "  -H        heredoc preprocessing only\n"
     "  -m <size> specify initial macro buffer size; default is 4096 bytes\n"
     "  -n        no output, only print 'ok' if successful\n"
-    "  -o <file> write output to the specified file. "
-    "Currently only works in combination with '-E' option\n"
+    "  -o <file> write output to the specified file.\n"
     "  -p        pasm output\n"
     "  -r        activate the register allocator for improved register usage\n"
     "  -S        do not perform strength reduction\n"
@@ -136,7 +135,8 @@
 
 This will be the proper declaration after testing for thread-safety:
 
-void parse_file(int flexdebug, FILE *infile, char * const filename, int flags)
+void parse_file(int flexdebug, FILE *infile, char * const filename, int flags,
+                char * const outputfile)
 
 */
 
@@ -144,7 +144,7 @@
 
 void
 parse_file(int flexdebug, FILE *infile, char * const filename, int flags, int thr_id,
-           unsigned macro_size)
+           unsigned macro_size, char * const outputfile)
 {
     yyscan_t     yyscanner;
     lexer_state *lexer     = NULL;
@@ -184,7 +184,7 @@
         if (TEST_FLAG(lexer->flags, LEXER_FLAG_NOOUTPUT)) /* handy for testing the compiler */
             fprintf(stdout, "ok\n");
         else if (TEST_FLAG(lexer->flags, LEXER_FLAG_PREPROCESS))
-            emit_pir_subs(lexer);
+            emit_pir_subs(lexer, outputfile);
         else if (TEST_FLAG(lexer->flags, LEXER_FLAG_OUTPUTPBC))
             emit_pbc(lexer);
         else
@@ -220,6 +220,70 @@
 
 /*
 
+Parse a PIR string.
+
+*/
+void
+parse_string(char *pirstring, int flags, int pasminput, unsigned macro_size) {
+    yyscan_t yyscanner;
+    lexer_state *lexer = NULL;
+
+
+    /* create a yyscan_t object */
+    yypirlex_init(&yyscanner);
+
+    yypirset_debug(0, yyscanner);
+
+
+    /* set the extra parameter in the yyscan_t structure */
+    lexer = new_lexer("<pir string>", flags);
+    lexer->macro_size = macro_size;
+    yypirset_extra(lexer, yyscanner);
+    lexer->yyscanner = yyscanner;
+
+    /* initialize the scanner state */
+    init_scanner_state(yyscanner);
+
+    /* set the scanner to a string buffer and go parse */
+    yypir_scan_string(pirstring, yyscanner);
+
+    if (pasminput) { /* PASM mode */
+        SET_FLAG(lexer->flags, LEXER_FLAG_PASMFILE);
+    }
+
+
+    yypirparse(yyscanner, lexer);
+
+    if (lexer->parse_errors == 0) {
+
+        print_subs(lexer);
+
+        if (TEST_FLAG(lexer->flags, LEXER_FLAG_WARNINGS))
+            check_unused_symbols(lexer);
+    }
+
+    /* there may have been errors during the instruction generation, check again here. */
+    if (lexer->parse_errors > 0)
+        fprintf(stderr, "There were %d errors\n", lexer->parse_errors);
+
+    /* XXX just want to make sure pirc doesn't segfault when doing bytecode stuff. */
+    if (TEST_FLAG(lexer->flags, LEXER_FLAG_OUTPUTPBC)) {
+        emit_pbc(lexer);
+    }
+
+
+    fprintf(stderr, "ok\n");
+    /* clean up after playing */
+    release_resources(lexer);
+
+       /* clean up after playing */
+    yypirlex_destroy(yyscanner);
+
+
+}
+
+/*
+
 temporary function for the thread-testing code.
 Unpack the arguments and invoke parse_file().
 
@@ -236,7 +300,7 @@
     int          thr_id    = args->thr_id;
     int          flags     = args->flags;
 
-    parse_file(flexdebug, infile, filename, flags, thr_id, INIT_MACRO_SIZE);
+    parse_file(flexdebug, infile, filename, flags, thr_id, INIT_MACRO_SIZE, NULL);
 
     return NULL;
 }
@@ -261,6 +325,7 @@
     int                flags        = 0;
     char              *filename     = NULL;
     char              *outputfile   = NULL;
+    char              *hdocoutfile  = NULL;
     unsigned           macrosize    = INIT_MACRO_SIZE;
 
 
@@ -269,6 +334,12 @@
     argv++;
 
 
+    /* XXX test the parse_string() function. */
+    /*
+    parse_string(".sub main :main\nprint 42\n.end\n", LEXER_FLAG_OUTPUTPBC, 0, INIT_MACRO_SIZE);
+    return 0;
+    */
+
 
     /* XXX very basic argument handling; I'm too lazy to check out
      * the standard funtion for that, right now. This is a TODO. */
@@ -399,17 +470,26 @@
         exit(EXIT_FAILURE);
     }
 
-    /* if user requested only to process heredocs, send output to stdout and return. */
-    if (TEST_FLAG(flags, LEXER_FLAG_HEREDOCONLY)) {
+    if (outputfile != NULL && TEST_FLAG(flags, LEXER_FLAG_HEREDOCONLY)) {
+        file = open_file(outputfile, "w");
+        process_heredocs(argv[0], file);
+        fclose(file);
+        return 0;
+    }
+    else if (TEST_FLAG(flags, LEXER_FLAG_HEREDOCONLY)) {
         process_heredocs(argv[0], stdout);
         return 0;
     }
+    else {
+        hdocoutfile = _tempnam(NULL, "hdoc");
+        file = open_file(hdocoutfile, "w");
+        process_heredocs(argv[0], file);
+        fclose(file);
+    }
+
 
-    file = fopen("heredoc.out", "w");
-    process_heredocs(argv[0], file);
-    fclose(file);
     /* done handling arguments, open the file */
-    file     = open_file("heredoc.out", "r");
+    file     = open_file(hdocoutfile, "r");
     filename = argv[0];
 
     if (file == NULL) {
@@ -417,8 +497,8 @@
         exit(EXIT_FAILURE);
     }
 
-    parse_file(flexdebug, file, filename, flags, 0, macrosize);
-
+    parse_file(flexdebug, file, filename, flags, 0, macrosize, outputfile);
+    fprintf(stderr, "done\n");
 }
 #endif
 
@@ -453,14 +533,14 @@
     vfprintf(stderr, message, arg_ptr);
     va_end(arg_ptr);
 
-    ++lexer->parse_errors;
-
     /* print current token if it doesn't contain a newline token. */
     if (!strstr(current_token, "\n"))
         fprintf(stderr, "\n\tcurrent token: '%s'", current_token);
 
     fprintf(stderr, "\n\n");
 
+    ++lexer->parse_errors;
+
     return 0;
 }
 

Modified: branches/pdd22io_part3/compilers/pirc/new/pir.l
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pir.l	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pir.l	Mon Dec 29 23:28:53 2008
@@ -402,8 +402,18 @@
                   }
 
 {IDENT}           { /* identifier; can be a global (sub or const), local or parrot op */
-                    yylval->sval = dupstr(yyget_extra(yyscanner), yytext);
-                    return TK_IDENT;
+                    lexer_state * const lexer = yyget_extra(yyscanner);
+                    constant *c = find_global_constant(lexer, yytext);
+
+                    /* XXX bleh. this is expensive; an const lookup for each identifier */
+                    if (c) {
+                        yylval->cval = c;
+                        return TK_CONST_VALUE;
+                    }
+                    else {
+                        yylval->sval = dupstr(yyget_extra(yyscanner), yytext);
+                        return TK_IDENT;
+                    }
                   }
 
 {FLOATNUM}        { yylval->dval = atof(yytext); return TK_NUMC; }

Modified: branches/pdd22io_part3/compilers/pirc/new/pir.y
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pir.y	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pir.y	Mon Dec 29 23:28:53 2008
@@ -232,6 +232,7 @@
 %union {
     double              dval;
     int                 ival;
+    unsigned            uval;
     char   const       *sval;
     struct constant    *cval;
     struct instruction *instr;
@@ -301,6 +302,7 @@
        <ival> TK_NREG       "number register"
        <ival> TK_SREG       "string register"
        <ival> TK_IREG       "integer register"
+       <cval> TK_CONST_VALUE "constant-value"
 
 %token TK_ARROW             "=>"
        TK_NE                "!="
@@ -441,6 +443,9 @@
              namespace_slice
              method
              op_arg_expr
+             multi_type
+             opt_multi_types
+             multi_types
 
 %type <key>  keys
              keylist
@@ -463,7 +468,8 @@
              augmented_op
              unique_reg_flag
              int_or_num
-             parameters
+
+%type <uval> parameters
 
 %type <invo> long_invocation
              long_invocation_stat
@@ -700,21 +706,21 @@
                   ;
 
 sub_flag          : ":anon"
-                         { set_sub_flag(lexer, SUB_FLAG_ANON);}
+                         { set_sub_flag(lexer, PIRC_SUB_FLAG_ANON);}
                   | ":init"
-                         { set_sub_flag(lexer, SUB_FLAG_INIT); }
+                         { set_sub_flag(lexer, PIRC_SUB_FLAG_INIT); }
                   | ":load"
-                         { set_sub_flag(lexer, SUB_FLAG_LOAD); }
+                         { set_sub_flag(lexer, PIRC_SUB_FLAG_LOAD); }
                   | ":main"
-                         { set_sub_flag(lexer, SUB_FLAG_MAIN); }
+                         { set_sub_flag(lexer, PIRC_SUB_FLAG_MAIN); }
                   | ":lex"
-                         { set_sub_flag(lexer, SUB_FLAG_LEX); }
+                         { set_sub_flag(lexer, PIRC_SUB_FLAG_LEX); }
                   | ":postcomp"
-                         { set_sub_flag(lexer, SUB_FLAG_POSTCOMP); }
+                         { set_sub_flag(lexer, PIRC_SUB_FLAG_POSTCOMP); }
                   | ":immediate"
-                         { set_sub_flag(lexer, SUB_FLAG_IMMEDIATE); }
-                  | ":multi"
-                         { set_sub_flag(lexer, SUB_FLAG_MULTI); }
+                         { set_sub_flag(lexer, PIRC_SUB_FLAG_IMMEDIATE); }
+                  | ":multi" multi_type_list
+                         { set_sub_flag(lexer, PIRC_SUB_FLAG_MULTI); }
                   | ":outer" '(' sub_id ')'
                          { set_sub_outer(lexer, $3); }
                   | ":method" opt_paren_string
@@ -729,25 +735,52 @@
                          { set_sub_nsentry(lexer, $2); }
                   ;
 
+multi_type_list   : '(' opt_multi_types ')'
+                        { set_sub_multi_types(lexer, $2); }
+                  ;
+
+opt_multi_types   : /* empty */
+                        {
+                          CURRENT_SUB(lexer)->info.num_multi_types = 1;
+                          /* n=1 means :multi() -- without any types. */
+                        }
+                  | multi_types
+                        { $$ = $1; }
+                  ;
+
+multi_types       : multi_type
+                        {
+                          CURRENT_SUB(lexer)->info.num_multi_types = 2;
+                          /* start counting multi types; always 1 higher than actual number
+                           * so that n=0 means no :multi, n=1 means :multi(), n=2 means
+                           * :multi(Type1), n=3 means :multi(Type1,Type2), etc.
+                           */
+                           $$ = $1;
+                        }
+                  | multi_types ',' multi_type
+                        {
+                          ++CURRENT_SUB(lexer)->info.num_multi_types;
+                          /* link the multi types in reverse other. That's fine,
+                           * as long as you remember that it's reversed.
+                           */
+                          $3->next = $1;
+                          $$ = $3;
+                        }
+                  ;
+
 multi_type        : identifier
+                        { $$ = expr_from_ident(lexer, $1); }
                   | TK_STRINGC
+                        { $$ = expr_from_string(lexer, $1); }
                   | keylist
+                        { $$ = expr_from_key(lexer, $1); }
                   ;
 
 parameter_list    : parameters
                          {
                            /* if there are parameters, then emit a get_params instruction. */
-                           if ($1 > 0) {
-
-                               set_instr(lexer, "get_params");
-                               /* don't infer the signatured opname from arguments,
-                                * it's always same: get_params_pc
-                                * (this is one of the special 4 instructions for sub invocation).
-                                */
-
-                               update_op(lexer, CURRENT_INSTRUCTION(lexer),
-                                         PARROT_OP_get_params_pc);
-                           }
+                           if ($1 > 0)
+                               generate_parameters_instr(lexer, $1);
                          }
                   ;
 
@@ -1170,7 +1203,8 @@
                                   get_opinfo(yyscanner);
                               }
                               else
-                                  yypirerror(yyscanner, lexer, "indexed object '%s' not declared", $3);
+                                  yypirerror(yyscanner, lexer,
+                                             "indexed object '%s' not declared", $3);
 
                               /* create a symbol node anyway, so we can continue with instr. gen. */
                               sym = new_symbol(lexer, $3, PMC_TYPE);
@@ -1581,7 +1615,7 @@
                                   yypirerror(yyscanner, lexer, "lexical '%s' must be of type 'pmc'",
                                              $4->info->id.name);
                           }
-                          set_lex_flag($4, $2);
+                          set_lex_flag(lexer, $4, $2);
                         }
                   ;
 
@@ -1623,7 +1657,7 @@
                             { $$ = $2; }
                      ;
 
-long_invocation      : ".call" pmc_object opt_ret_cont
+long_invocation      : ".call" sub opt_ret_cont
                            { $$ = invoke(lexer, CALL_PCC, $2, $3); }
                      | ".nci_call" pmc_object
                            { $$ = invoke(lexer, CALL_NCI, $2); }
@@ -1977,6 +2011,7 @@
 constant    : TK_STRINGC     { $$ = new_const(lexer, STRING_TYPE, $1); }
             | TK_INTC        { $$ = new_const(lexer, INT_TYPE, $1); }
             | TK_NUMC        { $$ = new_const(lexer, NUM_TYPE, $1); }
+            | TK_CONST_VALUE { $$ = $1; }
             ;
 
 rel_op      : "!="           { $$ = OP_NE; }
@@ -2003,10 +2038,9 @@
 
 symbol      : reg
             | identifier { /* a symbol must have been declared; check that at this point. */
-                           symbol *sym = find_symbol(lexer, $1);
+                           symbol * sym = find_symbol(lexer, $1);
                            if (sym == NULL) {
                                undeclared_symbol(yyscanner, lexer, $1);
-
                                /* make sure sym is not NULL */
                                sym = new_symbol(lexer, $1, UNKNOWN_TYPE);
                            }
@@ -3294,11 +3328,37 @@
                 *instr_writer++ = '_';
                 *instr_writer++ = 'k';
 
+                /* XXX this switch replaces the messy code below. double-check before delete. */
+                switch (iter->expr.t->key->expr->type) {
+                    case EXPR_TARGET:
+                        switch (iter->expr.t->key->expr->expr.t->info->type) {
+                            case PMC_TYPE:
+                                /* the key is a target, and its type is a PMC. In that
+                                 * case, do not print the signature; 'kp' is not valid.
+                                 */
+                                break;
+                            case INT_TYPE:
+                                *instr_writer++ = 'i';
+                                break;
+                            default:
+                                break;
+                        }
+                        break;
+                    case EXPR_CONSTANT:
+                        *instr_writer++ = 'c';
+                        break;
+                    default:
+                        /* XXX does this ever happen? */
+                        fprintf(stderr, "write_signature: non-constant key\n");
+                        instr_writer = write_signature(iter->expr.t->key->expr, instr_writer);
+                        break;
+                }
+
+
+                /*
                 if ((iter->expr.t->key->expr->type == EXPR_TARGET)
                 &&  (iter->expr.t->key->expr->expr.t->info->type == PMC_TYPE)) {
-                    /* the key is a target, and its type is a PMC. In that case, do not
-                     * print the signature; 'kp' is not valid.
-                     */
+
                 }
                 else {
                     if ((iter->expr.t->key->expr->type == EXPR_TARGET)
@@ -3307,9 +3367,7 @@
                        *instr_writer++ = 'i';
                     }
                     else
-                    /*
-                    instr_writer = write_signature(iter->expr.t->key->expr, instr_writer);
-                    */
+
                     switch (iter->expr.t->key->expr->type) {
                         case EXPR_CONSTANT:
                             *instr_writer++ = 'c';
@@ -3319,7 +3377,8 @@
                             instr_writer = write_signature(iter->expr.t->key->expr, instr_writer);
                             break;
                     }
-                }
+                }*/
+
             }
             break;
         case EXPR_CONSTANT:
@@ -3535,7 +3594,6 @@
         expression *iter = CURRENT_INSTRUCTION(lexer)->operands;
         opinfo           = CURRENT_INSTRUCTION(lexer)->opinfo;
 
-
         PARROT_ASSERT(opinfo);
 
         opcount = opinfo->op_count - 1; /* according to op.h, opcount also counts the op itself. */
@@ -3569,13 +3627,10 @@
                  * which one to fix.
                  */
 
-                /*
-                fprintf(stderr, "setting %dth label flag on instruction %s\n", BIT(i),
-                        CURRENT_INSTRUCTION(lexer)->opname);
-                 */
+                /* fprintf(stderr, "setting %dth label flag on instruction %s\n", BIT(i),
+                        CURRENT_INSTRUCTION(lexer)->opname); */
 
                 SET_FLAG(CURRENT_INSTRUCTION(lexer)->oplabelbits, BIT(i));
-
             }
 
             ++i;

Modified: branches/pdd22io_part3/compilers/pirc/new/pircompiler.c
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pircompiler.c	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pircompiler.c	Mon Dec 29 23:28:53 2008
@@ -185,6 +185,9 @@
     if (TEST_FLAG(flags, LEXER_FLAG_REGALLOC))
         lexer->lsr = new_linear_scan_register_allocator(lexer);
 
+    /* create a bytecode object for bytecode generation */
+    lexer->bc = new_bytecode(lexer->interp, filename);
+
     return lexer;
 }
 

Modified: branches/pdd22io_part3/compilers/pirc/new/pircompiler.h
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pircompiler.h	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pircompiler.h	Mon Dec 29 23:28:53 2008
@@ -14,9 +14,6 @@
 #include "parrot/embed.h"
 
 
-#define TRUE    1
-#define FALSE   0
-
 #include <stdio.h> /* for FILE * */
 
 
@@ -37,7 +34,7 @@
     LEXER_FLAG_NOOUTPUT            = 1 << 6, /* don't print anything on success, except 'ok' */
     LEXER_FLAG_REGALLOC            = 1 << 7, /* use register allocation optimizer */
     LEXER_FLAG_PASMFILE            = 1 << 8, /* the input is PASM, not PIR code */
-    LEXER_FLAG_OUTPUTPBC         = 1 << 9  /* generate PBC file */
+    LEXER_FLAG_OUTPUTPBC           = 1 << 9  /* generate PBC file */
 
 } lexer_flags;
 
@@ -80,6 +77,7 @@
 #endif
 
 /* macros can store up to 4K characters, after which the buffer must be resized.
+ * This value is the default, and can be changed through PIRC's command line option.
  */
 #define INIT_MACRO_SIZE     4096
 
@@ -92,7 +90,7 @@
     int            flags;          /* general flags, e.g. warnings level */
     unsigned       parse_errors;
     char const    *filename;       /* name of input file */
-    FILE          *outfile;        /* name of output file */
+    FILE          *outfile;        /* output file */
 
     subroutine    *subs;           /* list of subs; always points to the current sub. */
 
@@ -101,7 +99,7 @@
     target        *curtarget;      /* access to current target node being parsed, if any */
     argument      *curarg;         /* access to current argument node being parsed, if any */
 
-    int            curregister[4]; /* for register allocation */
+    int            curregister[NUM_PARROT_TYPES]; /* for register allocation */
     int            pir_reg_generator; /* for unique PIR register allocator, for temp. PIR regs. */
 
     unsigned       stmt_counter;   /* to count "logical" statements, even if multi-line. */
@@ -148,7 +146,7 @@
 } lexer_state;
 
 /* accessor for current macro; always first on the list. */
-#define CURRENT_MACRO(X)    X->macros->definitions
+#define CURRENT_MACRO(X)    (X)->macros->definitions
 
 
 /* constructor for a lexer_state object */

Modified: branches/pdd22io_part3/compilers/pirc/new/pircompunit.c
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pircompunit.c	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pircompunit.c	Mon Dec 29 23:28:53 2008
@@ -27,17 +27,20 @@
 #include "pircompiler.h"
 #include "pirsymbol.h"
 #include "piryy.h"
+#include "pirdefines.h"
+#include "bcgen.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
+#include <assert.h>
 
 #include "parrot/oplib/ops.h"
 #include "parrot/string_funcs.h"
 #include "parrot/dynext.h"
 
-#include <assert.h>
+
 
 static unsigned const prime_numbers[] = {113 /* XXX think of more primes */ };
 
@@ -49,7 +52,7 @@
 
 
 =item C<void
-panic(lexer_state * lexer, char * const message)>
+panic(lexer_state * lexer, char const * const message)>
 
 Function to emit a final last cry that something's wrong and exit.
 
@@ -57,8 +60,12 @@
 
 */
 void
-panic(lexer_state * lexer, char const * const message) {
-    fprintf(stderr, "Fatal: %s\n", message);
+panic(lexer_state * lexer, char const * const message, ...) {
+    va_list arg_ptr;
+    fprintf(stderr, "Fatal: ");
+    va_start(arg_ptr, message);
+    vfprintf(stderr, message, arg_ptr);
+    va_end(arg_ptr);
     release_resources(lexer);
     exit(EXIT_FAILURE);
 }
@@ -80,10 +87,9 @@
 void
 reset_register_allocator(lexer_state * const lexer) {
     /* set register allocator to 0 for all register types. */
-    lexer->curregister[INT_TYPE]    = 0;
-    lexer->curregister[NUM_TYPE]    = 0;
-    lexer->curregister[PMC_TYPE]    = 0;
-    lexer->curregister[STRING_TYPE] = 0;
+    int i;
+    for (i = 0; i < NUM_PARROT_TYPES; ++i)
+        lexer->curregister[i] = 0;
 }
 
 
@@ -107,7 +113,7 @@
 /*
 
 =item C<void
-set_sub_outer(lexer_state * const lexer, char * const outersub)>
+set_sub_outer(lexer_state * const lexer, char const * const outersub)>
 
 Set the lexically enclosing sub for the current sub.
 Thus, set the :outer() argument to the current subroutine.
@@ -117,15 +123,64 @@
 */
 void
 set_sub_outer(lexer_state * const lexer, char const * const outersub) {
-    CURRENT_SUB(lexer)->outer_sub = outersub;
-    SET_FLAG(lexer->subs->flags, SUB_FLAG_OUTER);
+    CURRENT_SUB(lexer)->info.outersub = outersub;
+    SET_FLAG(lexer->subs->flags, PIRC_SUB_FLAG_HAS_OUTER);
 }
 
 
+
+/*
+
+=item C<void
+set_sub_multi_type(lexer_state * const lexer, expression * const multitype)>
+
+Add the multi-method signature type in C<multitype> to the current subroutine.
+
+=cut
+
+*/
+void
+set_sub_multi_types(lexer_state * const lexer, expression * const multitype) {
+    /* info.num_types is 1 higher than the actual number of types;
+     * n=1 means :multi() without any types; therefore, subtract 1 for actual number.
+     */
+    unsigned num_types = CURRENT_SUB(lexer)->info.num_multi_types - 1;
+
+    /* create an array of sufficient size, in which the multi type info is copied */
+    CURRENT_SUB(lexer)->info.multi_types
+                          = (multi_type *)pir_mem_allocate(lexer, num_types * sizeof (multi_type));
+
+
+    /* add types from end to beginning, as the list is in reversed order. */
+    while (num_types-- > 0) {
+        /* get a pointer to the multi_type in the current index, for easy reference */
+        multi_type *mtype = &CURRENT_SUB(lexer)->info.multi_types[num_types];
+
+        switch (multitype->type) {
+            case EXPR_CONSTANT:
+                mtype->u.ident    = multitype->expr.c->val.sval;
+                mtype->entry_type = MULTI_TYPE_IDENT;
+                break;
+            case EXPR_IDENT:
+                mtype->u.ident    = multitype->expr.id;
+                mtype->entry_type = MULTI_TYPE_IDENT;
+                break;
+            case EXPR_KEY:
+                /* mtype->u.key      = XXX todo */
+                mtype->entry_type = MULTI_TYPE_KEYED;
+                break;
+            default:
+                break;
+        }
+
+    }
+
+}
+
 /*
 
 =item C<void
-set_sub_vtable(lexer_state * const lexer, char const *vtablename)>
+set_sub_vtable(lexer_state * const lexer, char const * vtablename)>
 
 Set the :vtable() flag argument to the current subroutine. If C<vtablename>
 is NULL, the name of the current sub is taken to be the vtable method name.
@@ -140,7 +195,7 @@
     int vtable_index;
 
     if (vtablename == NULL)  /* the sub's name I<is> the vtablename */
-        vtablename = CURRENT_SUB(lexer)->sub_name;
+        vtablename = CURRENT_SUB(lexer)->info.subname;
 
     /* get the index number of this vtable method */
     vtable_index = Parrot_get_vtable_index(lexer->interp,
@@ -152,15 +207,15 @@
         yypirerror(lexer->yyscanner, lexer,
                    "'%s' is not a vtable method but was used with :vtable flag", vtablename);
     else {
-        CURRENT_SUB(lexer)->vtable_index = vtable_index;
-        SET_FLAG(lexer->subs->flags, SUB_FLAG_VTABLE);
+        CURRENT_SUB(lexer)->info.vtable_index = vtable_index;
+        SET_FLAG(lexer->subs->flags, PIRC_SUB_FLAG_VTABLE);
     }
 }
 
 /*
 
 =item C<void
-set_sub_subid(lexer_state * const lexer, char * const subid)>
+set_sub_subid(lexer_state * const lexer, char const * const subid)>
 
 Set the name specified in the :subid flag on the sub.
 
@@ -169,14 +224,14 @@
 */
 void
 set_sub_subid(lexer_state * const lexer, char const * const subid) {
-    CURRENT_SUB(lexer)->subid = subid;
-    SET_FLAG(lexer->subs->flags, SUB_FLAG_SUBID);
+    CURRENT_SUB(lexer)->info.subid = subid;
+    SET_FLAG(lexer->subs->flags, PIRC_SUB_FLAG_SUBID);
 }
 
 /*
 
 =item C<void
-set_sub_methodname(lexer_state * const lexer, char * const methodname)>
+set_sub_methodname(lexer_state * const lexer, char const * const methodname)>
 
 Set the :method flag on a sub; if C<methodname> is not NULL, then it contains
 the name by which the sub is stored as a method.
@@ -189,15 +244,15 @@
     if (methodname) /* :method("foo") */
         CURRENT_SUB(lexer)->methodname = methodname;
     else /* :method without a value defaults to the subname. */
-        CURRENT_SUB(lexer)->methodname = CURRENT_SUB(lexer)->sub_name;
+        CURRENT_SUB(lexer)->methodname = CURRENT_SUB(lexer)->info.subname;
 
-    SET_FLAG(lexer->subs->flags, SUB_FLAG_METHOD);
+    SET_FLAG(lexer->subs->flags, PIRC_SUB_FLAG_METHOD);
 }
 
 /*
 
 =item C<void
-set_sub_instanceof(lexer_state * const lexer, char * const classname)>
+set_sub_instanceof(lexer_state * const lexer, char const * const classname)>
 
 Set the value of the C<:instanceof> flag on a sub. Note that this flag
 is experimental, and not actually used at this point.
@@ -223,7 +278,7 @@
 */
 void
 set_sub_nsentry(lexer_state * const lexer, char const * const nsentry) {
-    CURRENT_SUB(lexer)->nsentry = nsentry;
+    CURRENT_SUB(lexer)->info.nsentry = nsentry;
 }
 
 /*
@@ -231,7 +286,9 @@
 =item C<void
 set_sub_flag(lexer_state * const lexer, sub_flag flag)>
 
-Set a subroutine flag on the current sub.
+Set a subroutine flag on the current sub. The C<flag> parameter may encode
+multiple flags. If it encodes the C<:vtable> or C<:method> flag, an extra
+parameter named C<self> is added to the current subroutine.
 
 =cut
 
@@ -242,14 +299,14 @@
     SET_FLAG(CURRENT_SUB(lexer)->flags, flag);
 
     /* if the sub is a method or a :vtable method, then also add a "self" parameter */
-    if (TEST_FLAG(flag, (SUB_FLAG_VTABLE | SUB_FLAG_METHOD)))
+    if (TEST_FLAG(flag, (PIRC_SUB_FLAG_VTABLE | PIRC_SUB_FLAG_METHOD)))
         add_param(lexer, PMC_TYPE, "self");
 }
 
 /*
 
 =item C<void
-new_subr(lexer_state * const lexer, char * const subname)>
+new_subr(lexer_state * const lexer, char const * const subname)>
 
 Create a new subroutine node, and set it as the "current"
 subroutine, on which all other sub-related operations do
@@ -260,29 +317,30 @@
 */
 void
 new_subr(lexer_state * const lexer, char const * const subname) {
-    subroutine *newsub  = pir_mem_allocate_zeroed_typed(lexer, subroutine);
-    int index;
+    subroutine *newsub       = pir_mem_allocate_zeroed_typed(lexer, subroutine);
+    int         index;
 
     /* set the sub fields */
-    newsub->sub_name    = subname;
-
+    newsub->info.subname     = subname;
     /* set default lexid */
-    newsub->subid       = subname;
-
+    newsub->info.subid       = subname;
     /* take namespace of this sub of the lexer, which keeps track of that */
-    newsub->name_space  = lexer->current_ns;
+    newsub->name_space       = lexer->current_ns;
 
-    newsub->parameters  = NULL;
-    newsub->statements  = NULL;
-    newsub->flags       = 0;
-    newsub->startoffset = lexer->codesize; /* start offset in bytecode */
+    newsub->parameters       = NULL;
+    newsub->statements       = NULL;
+    newsub->flags            = 0;
+    newsub->info.startoffset = lexer->codesize; /* start offset in bytecode */
 
+
+
+    /* initialize hashtables for .local and label identifiers */
     init_hashtable(lexer, &newsub->symbols, HASHTABLE_SIZE_INIT);
     init_hashtable(lexer, &newsub->labels, HASHTABLE_SIZE_INIT);
 
     for (index = 0; index < NUM_PARROT_TYPES; ++index) {
-        newsub->registers[index] = NULL; /* set all "register" tables to NULL */
-        newsub->regs_used[index] = 0;    /* set all register counts to 0 */
+        newsub->registers[index]      = NULL; /* set all "register" tables to NULL */
+        newsub->info.regs_used[index] = 0;    /* set all register counts to 0 */
     }
 
     /* link the new sub node into the list of subroutines */
@@ -291,8 +349,8 @@
     }
     else { /* there is at least 1 other subroutine */
         /* lexer->subs points to "end of list", to the last added one */
-        newsub->next             = CURRENT_SUB(lexer)->next; /* set newsub's next to the
-                                                                first item in the list */
+        newsub->next = CURRENT_SUB(lexer)->next; /* set newsub's next to the
+                                                    first item in the list */
         CURRENT_SUB(lexer)->next = newsub;    /* set current sub's next to the new sub. */
     }
     CURRENT_SUB(lexer) = newsub;
@@ -303,13 +361,12 @@
     /* vanilla register allocator is reset for each sub */
     reset_register_allocator(lexer);
 
-
 }
 
 /*
 
 =item C<void
-set_sub_name(struct lexer_state * const lexer, char const * const subname)>
+set_sub_name(lexer_state * const lexer, char const * const subname)>
 
 Set the current subroutine's name to C<subname>.
 
@@ -317,15 +374,15 @@
 
 */
 void
-set_sub_name(struct lexer_state * const lexer, char const * const subname) {
-    CURRENT_SUB(lexer)->sub_name = subname;
+set_sub_name(lexer_state * const lexer, char const * const subname) {
+    CURRENT_SUB(lexer)->info.subname = subname;
 }
 
 
 /*
 
 =item C<static instruction *
-new_instruction(char * const opname)>
+new_instruction(lexer_state * const lexer, char const * const opname)>
 
 Create a new instruction node and set C<opname> as the instruction.
 
@@ -345,7 +402,7 @@
 /*
 
 =item C<static void
-new_statement(lexer_state * const lexer)>
+new_statement(lexer_state * const lexer, char const * const opname)>
 
 Constructor for a statement. The newly allocated statement will be inserted
 into the current subroutine's statements list.
@@ -399,7 +456,7 @@
 /*
 
 =item C<argument *
-set_curarg(lexer_state * const lexer, argument *arg)>
+set_curarg(lexer_state * const lexer, argument * const arg)>
 
 Sets the argument C<arg> as the current argument in C<lexer>
 to make it accessible to other parse actions. C<arg> is returned.
@@ -554,7 +611,7 @@
 /*
 
 =item C<target *
-add_param(lexer_state * const lexer, pir_type type, char * const name)>
+add_param(lexer_state * const lexer, pir_type type, char const * const name)>
 
 Add a parameter of type C<type> and named C<name> to the current
 subroutine. The parameter will be declared as a local symbol in the
@@ -603,7 +660,7 @@
 /*
 
 =item C<void
-set_param_alias(lexer_state * const lexer, char * const alias)>
+set_param_alias(lexer_state * const lexer, char const * const alias)>
 
 Set the argument of the :named flag for the current target
 (parameter). Returns the current target (parameter).
@@ -649,12 +706,12 @@
     /* :slurpy can only be set on a PMC parameter */
     if (TEST_FLAG(flag, TARGET_FLAG_SLURPY) && param->info->type != PMC_TYPE)
         yypirerror(lexer->yyscanner, lexer,
-                   "cannot set :slurpy flag on non-pmc %s", param->info->id.name);
+                   "cannot set :slurpy flag on non-pmc parameter '%s'", param->info->id.name);
 
     /* :opt_flag can only be set on a int parameter */
     if (TEST_FLAG(flag, TARGET_FLAG_OPT_FLAG) && param->info->type != INT_TYPE)
         yypirerror(lexer->yyscanner, lexer,
-                   "cannot set :opt_flag flag on non-int %s", param->info->id.name);
+                   "cannot set :opt_flag flag on non-int parameter '%s'", param->info->id.name);
 
     return param;
 }
@@ -662,7 +719,7 @@
 /*
 
 =item C<argument *
-new_argument(expression * const expr)>
+new_argument(lexer_state * const lexer, expression * const expr)>
 
 Create a new argument node which wraps C<expr>.
 
@@ -732,7 +789,7 @@
 /*
 
 =item C<void
-set_arg_alias(lexer_state * const lexer, char * const alias)>
+set_arg_alias(lexer_state * const lexer, char const * const alias)>
 
 Set the alias specified in C<alias> on the current argument, accessible
 through C<lexer>. The alias is the name under which the argument is passed
@@ -755,7 +812,7 @@
 /*
 
 =item C<void
-load_library(lexer_state * const lexer, char * const library)>
+load_library(lexer_state * const lexer, char const * const library)>
 
 Load the library indicated by C<library>.
 
@@ -775,7 +832,7 @@
 /*
 
 =item C<void
-set_label(lexer_state * const lexer, char * const label)>
+set_label(lexer_state * const lexer, char const * const label)>
 
 Set the label C<label> on the current instruction.
 
@@ -1154,6 +1211,8 @@
 get_operand_count(lexer_state * const lexer)>
 
 Returns the number of operands of the I<current> instruction.
+This function assumes there is an instruction in place
+(in CURRENT_INSTRUCTION(lexer)).
 
 =cut
 
@@ -1164,6 +1223,8 @@
     unsigned count = 0;
     expression *first, *operand;
 
+    PARROT_ASSERT(CURRENT_INSTRUCTION(lexer));
+
     /* if no operands, return 0 */
     if (CURRENT_INSTRUCTION(lexer)->operands == NULL)
         return 0;
@@ -1223,7 +1284,6 @@
 
 /*
 
-
 =item C<constant *
 new_named_const(lexer_state * const lexer, pir_type type, char * const name, ...)>
 
@@ -1358,12 +1418,11 @@
 PARROT_CANNOT_RETURN_NULL
 target *
 new_reg(lexer_state * const lexer, pir_type type, int regno) {
-    target *t       = new_target(lexer);
+    target  *t = new_target(lexer);
     pir_reg *reg;
 
     color_reg(lexer, type, regno);
-    reg = find_register(lexer, type, regno);
-    /* XXX t->s.reg = reg; */
+    reg     = find_register(lexer, type, regno);
     t->info = &reg->info;
 
     /* set a flag on this target node saying it's a register */
@@ -1376,7 +1435,8 @@
 =item C<expression *
 expr_from_target(target *t)>
 
-convert a target to an expression node
+Wrap a target in an expression node; the expression node is
+returned.
 
 =cut
 
@@ -1413,6 +1473,62 @@
 /*
 
 =item C<expression *
+expr_from_int(lexer_state * const lexer, int ival)>
+
+Create an expression node from an integer constant. This is a wrapper
+function, which uses C<expr_from_const()> and C<new_const()>.
+Creating an expression from an integer constant is a common operation,
+so using this wrapper function makes the rest of the code slightly cleaner.
+
+=cut
+
+*/
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+expression *
+expr_from_int(lexer_state * const lexer, int ival) {
+    return expr_from_const(lexer, new_const(lexer, INT_TYPE, ival));
+}
+
+/*
+
+=item C<expression *
+expr_from_num(lexer_state * const lexer, double nval)>
+
+Same as C<expr_from_int()>, except it takes a C<double> parameter,
+not an C<int>.
+
+=cut
+
+*/
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+expression *
+expr_from_num(lexer_state * const lexer, double nval) {
+    return expr_from_const(lexer, new_const(lexer, NUM_TYPE, nval));
+}
+
+/*
+
+=item C<expression *
+expr_from_string(lexer_state * const lexer, char const * const sval)>
+
+Same as C<expr_from_int()>, except it takes a C<string> parameter.
+
+=cut
+
+*/
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+expression *
+expr_from_string(lexer_state * const lexer, char const * const sval) {
+    return expr_from_const(lexer, new_const(lexer, STRING_TYPE, sval));
+}
+
+
+/*
+
+=item C<expression *
 expr_from_ident(char * const id)>
 
 Convert a ident to an expression node and returns it.
@@ -1435,13 +1551,33 @@
 set_invocation_args(invocation * const inv, argument * const args)>
 
 Set the args of an invocation onto the current invocation object.
+The number of arguments in the list is counted, and stored in the
+C<inv> object.
 
 =cut
 
 */
 invocation *
 set_invocation_args(invocation * const inv, argument * const args) {
+    argument *count_iter;
+    unsigned  arg_count = 0;
+
     inv->arguments = args;
+
+    if (args) {
+        count_iter = args->next;
+        do {
+            count_iter = count_iter->next;
+            ++arg_count;
+        }
+        while (count_iter != args->next);
+    }
+
+    /* fprintf(stderr, "invocation has %u args\n", arg_count); */
+
+    /* store number of arguments in list in the invocation object */
+    inv->num_arguments = arg_count;
+
     return inv;
 }
 
@@ -1451,13 +1587,31 @@
 set_invocation_results(invocation * const inv, target * const results)>
 
 Set the invocation results on the invocation object C<inv>.
+The number of results is stored in the invocation object.
 
 =cut
 
 */
 invocation *
 set_invocation_results(invocation * const inv, target * const results) {
+    target  *count_iter;
+    unsigned result_count = 0;
+
     inv->results = results;
+
+    if (results) {
+        count_iter = results->next;
+        do {
+            count_iter = count_iter->next;
+            ++result_count;
+        }
+        while (count_iter != results->next);
+    }
+
+    /* fprintf(stderr, "invocation has %u results\n", result_count); */
+
+    inv->num_results = result_count;
+
     return inv;
 }
 
@@ -1533,16 +1687,24 @@
 /*
 
 =item C<void
-set_lex_flag(target *t, char * const name)>
+set_lex_flag(lexer_state * const lexer, target * const t, char const * const name)>
 
-Set the lexical name C<name> on target C<t>.
+Store target C<t> as a lexical in the sub_info struct. The lexical node
+stores a pointer to the target's syminfo structure, so it can access
+the allocated register.
 
 =cut
 
 */
 void
-set_lex_flag(target * const t, char const * const name) {
-    t->lex_name = name;
+set_lex_flag(lexer_state * const lexer, target * const t, char const * const name) {
+    lexical *lex = (lexical *)pir_mem_allocate(lexer, sizeof (lexical));
+    lex->name    = name;
+    lex->info    = t->info;
+
+    /* link this lex node in the list of lexicals */
+    lex->next = CURRENT_SUB(lexer)->info.lexicals;
+    CURRENT_SUB(lexer)->info.lexicals = lex;
 }
 
 /*
@@ -1640,7 +1802,7 @@
 */
 void
 push_operand(lexer_state * const lexer, NOTNULL(expression * const operand)) {
-    PARROT_ASSERT(lexer->subs->statements);
+    PARROT_ASSERT(CURRENT_INSTRUCTION(lexer));
 
     if (CURRENT_INSTRUCTION(lexer)->operands) {
         operand->next = CURRENT_INSTRUCTION(lexer)->operands->next;
@@ -1671,7 +1833,7 @@
 /*
 
 =item C<expression *
-expr_from_key(key * const k)>
+expr_from_key(lexer_state * const lexer, key * const k)>
 
 Wraps the key C<k> in an C<expression> node and returns that.
 The returned expression node has type EXPR_KEY.
@@ -1689,7 +1851,7 @@
 /*
 
 =item C<key *
-new_key(expression * const expr)>
+new_key(lexer_state * const lexer, expression * const expr)>
 
 Wraps the expression C<expr> in a key node and returns that.
 
@@ -1811,114 +1973,162 @@
 
 }
 
+/*
+
+=item C<static int
+generate_signature_pmc(lexer_state * const lexer, unsigned size)>
+
+Create a FixedIntegerArray PMC object that encodes the types and flags
+of parameters and add it to the PBC constant table. The index in that
+PBC constant table is returned.
+
+=cut
+
+*/
+static int
+generate_signature_pmc(lexer_state * const lexer, unsigned size) {
+    PMC *fixed_int_array;
+    int  array_index;
+
+    /* flags and types are encoded in a FixedIntegerArray PMC */
+    fixed_int_array = pmc_new(lexer->interp, enum_class_FixedIntegerArray);
+
+    if (size > 0) /* can't resize a fixed integer array to 0 elements, default size is 0. */
+        VTABLE_set_integer_native(lexer->interp, fixed_int_array, size);
 
+    array_index     = add_pmc_const(lexer->bc, fixed_int_array);
 
+    return array_index;
 
+}
 
 
 /*
 
-=item C<static void
-arguments_to_operands(lexer_state * const lexer, argument * const args)>
+=item C<static int
+calculate_pcc_argument_flags(argument * const arg)>
+
+Calculate the Parrot Calling Conventions flags for the
+argument C<arg>. An int encoding the flags is returned.
+
+=cut
+
+*/
+static int
+calculate_pcc_argument_flags(argument * const arg) {
+    int flag = 0;
+
+    switch (arg->value->type) {
+        case EXPR_TARGET:
+            /* copy the type of the target */
+            SET_FLAG(flag, arg->value->expr.t->info->type);
+            break;
+        case EXPR_CONSTANT:
+            /* copy the type of the constant */
+            SET_FLAG(flag, arg->value->expr.c->type);
+            /* set the flag indicating the argument is a constant literal, not a register. */
+            SET_FLAG(flag, PARROT_ARG_CONSTANT);
+            break;
+        default:
+            break;
+    }
+
+    /* if the argument has a :flat flag, copy that */
+    if (TEST_FLAG(arg->flags, ARG_FLAG_FLAT))
+        SET_FLAG(flag, PARROT_ARG_FLATTEN);
+
+    /* if the argument has a :named flag, copy that */
+    if (TEST_FLAG(arg->flags, ARG_FLAG_NAMED))
+        SET_FLAG(flag, PARROT_ARG_NAME);
+
+    return flag;
+}
+
+
+/*
 
-part of inv->instr conversion.
+=item C<static int
+calculate_pcc_target_flags(target * const result)>
 
-Add arguments as operands on the current instruction.
+Calculate Parrot Calling Conventions flags for the target node
+C<result>.
 
 =cut
 
 */
-static void
-arguments_to_operands(lexer_state * const lexer, argument * const args) {
-    argument *argiter;
+static int
+calculate_pcc_target_flags(target * const result) {
+    int flag = 0;
 
-    /* create a FixedIntegerArray object as first argument, which encodes
-     * the number of arguments and their flags.
-     */
 
-    /* XXX in compilers/imcc/pcc.c there's a maximum number of 15 values;
-     * do the same here to Get Things To Work, but fix later.
-     */
-    int flags_arg[15];
-    int index         = 0;
-    int forindex      = 0;
-    int len;
-    char *flagsstring, *strwriter;
+    SET_FLAG(flag, result->info->type);
 
-    if (args == NULL) {
-        push_operand(lexer, expr_from_const(lexer, new_const(lexer, PMC_TYPE, "")));
-        return;
-    }
-    else {
+    if (TEST_FLAG(result->flags, TARGET_FLAG_SLURPY))
+        SET_FLAG(flag, PARROT_ARG_SLURPY_ARRAY);
 
-        argiter = args;
-        do {
-            int flag = 0;
-            expression *argvalue;
+    if (TEST_FLAG(result->flags, TARGET_FLAG_NAMED))
+        SET_FLAG(flag, PARROT_ARG_NAME);
 
-            argiter  = argiter->next;
-            argvalue = argiter->value;
-            /*
-            fprintf(stderr, "converting arg to operand %d\n", ++numargs);
-            */
-
-
-            switch (argvalue->type) {
-                case EXPR_TARGET:
-                    flag |= argvalue->expr.t->info->type;
-                    break;
-                case EXPR_CONSTANT:
-                    flag |= argvalue->expr.c->type;
-                    break;
-                default:
-                    yypirerror(lexer->yyscanner, lexer, "invalid expression type for argument");
-                    break;
-            }
-            /* store the flag for this argument */
-            flags_arg[index++] = flag;
-        }
-        while (argiter != args);
+    if (TEST_FLAG(result->flags, TARGET_FLAG_OPT_FLAG))
+        SET_FLAG(flag, PARROT_ARG_OPT_FLAG);
 
-        /* allocate space for each flag, + commas (index - 1) and 2 quotes */
-        strwriter = flagsstring = (char *)mem_sys_allocate((index + index - 1 + 2) * sizeof (char));
-        *strwriter++ = '"';
+    if (TEST_FLAG(result->flags, TARGET_FLAG_OPTIONAL))
+        SET_FLAG(flag, PARROT_ARG_OPTIONAL);
 
-        while (forindex < index) {
-            sprintf(strwriter++, "%d", flags_arg[forindex]);
 
-            if (forindex < index - 1) {
-                *strwriter++ = ',';
-            }
+    return flag;
+}
 
-            ++forindex;
-        }
-        /* write closing quote and NULL character */
-        *strwriter++ = '"';
-        *strwriter++ = '\0';
 
-        /*
-        fprintf(stderr, "args2operands: [%s]\n", flagsstring);
-        */
 
-        /* don't add it now, it will break tests. */
-        /*
-        push_operand(lexer, expr_from_const(lexer, new_const(lexer, STRING_TYPE, flagsstring)));
-        */
+/*
+
+=item C<static void
+arguments_to_operands(lexer_state * const lexer, argument * const args)>
 
+Convert a list of C<argument> nodes into operands. Before the operands are
+added to the I<current> instruction, a FixedIntegerArray PMC is created
+which will hold one integer for each argument in the list. The integer
+at index C<i> encodes the type and flags (such as C<:flat>) for operand C<i>.
 
-        /* XXX Yes, this is a hacky attempt. Cleanups will follow. */
-    }
+=cut
 
+*/
+static void
+arguments_to_operands(lexer_state * const lexer, argument * const args, unsigned num_arguments) {
+    argument *argiter;
+    int       array_index;
+    unsigned  i;
+    PMC      *signature_array;
 
-    /* go over the arguments again, and add them as operands */
-    argiter = args;
+    /* create a FixedIntegerArray object as first argument, which encodes
+     * the number of arguments and their flags.
+     */
+    array_index = generate_signature_pmc(lexer, num_arguments);
+    /* add the index (of the signature PMC) in the PBC constant table as operand */
+    push_operand(lexer, expr_from_int(lexer, array_index));
 
-    do {
-        argiter = argiter->next;
-        /* how to handle named args? */
+    /* no need to continue if there's no arguments */
+    if (num_arguments == 0)
+        return;
+
+    /* retrieve the signature array PMC */
+    signature_array = get_pmc_const(lexer->bc, array_index);
+
+    /* initialize the argument iterator for the loop */
+    argiter = args->next;
+
+    for (i = 0; i < num_arguments; ++i) {
+        int flag = calculate_pcc_argument_flags(argiter);
+
+        /* set the flags for this argument in the right position in the array */
+        VTABLE_set_integer_keyed_int(lexer->interp, signature_array, i, flag);
+
+        /* and add the current argument as an operand; operands are always expression nodes. */
         push_operand(lexer, argiter->value);
+
+        argiter = argiter->next;
     }
-    while (argiter != args);
 }
 
 /*
@@ -1926,29 +2136,54 @@
 =item C<static void
 targets_to_operands(lexer_state * const lexer, target * const targets)>
 
-Convert a list of targets pointed to by C<targets> into operands; each
-C<target> node is added as an operand to the current instruction. If
-C<targets> is NULL, an empty string is added as an operand.
+Convert a list of C<target> nodes into operands. Before the operands
+are added to the I<current> instruction, a FixedIntegerArray is created,
+which contains one integer for each target (to be converted into an operand).
+The integer encodes the type of the target (operand) and other flags, such
+as C<:slurpy> etc.
 
 =cut
 
 */
 static void
-targets_to_operands(lexer_state * const lexer, target * const targets) {
-    target *iter;
+targets_to_operands(lexer_state * const lexer, target * const targets, unsigned num_targets) {
+    target  *iter;
+    int      array_index;
+    PMC     *signature_array;
+    unsigned i;
+
+    /* generate a FixedIntegerArray of the right size to encode the signature */
+    array_index = generate_signature_pmc(lexer, num_targets);
+    /* add the index in the constant table of this signature PMC as an operand */
+    push_operand(lexer, expr_from_int(lexer, array_index));
 
-    if (targets == NULL) {
-        push_operand(lexer, expr_from_const(lexer, new_const(lexer, PMC_TYPE, "")));
+    /* no need to continue if there's no target nodes */
+    if (num_targets == 0)
         return;
-    }
 
-    iter = targets;
+    /* retrieve the FixedIntegerArray PMC */
+    signature_array = get_pmc_const(lexer->bc, array_index);
 
-    do {
+    /* initialize the iterator */
+    iter = targets->next;
+
+    for (i = 0; i < num_targets; ++i) {
+        int flag = calculate_pcc_target_flags(iter);
+
+        /* store the flag at position i in the array */
+        VTABLE_set_integer_keyed_int(lexer->interp, signature_array, i, flag);
+
+        /* add the current target as an operand; these targets have already
+         * got an assigned register, so we're emitting that register number.
+         */
+        PARROT_ASSERT(iter->info->color != NO_REG_ALLOCATED);
+
+        push_operand(lexer, expr_from_int(lexer, iter->info->color));
+
+        /* go to next target in list */
         iter = iter->next;
-        push_operand(lexer, expr_from_target(lexer, iter));
     }
-    while (iter != targets);
+
 }
 
 
@@ -1977,7 +2212,8 @@
 /*
 
 =item C<static void
-new_sub_instr(lexer_state * const lexer, int opcode, char * const opname)>
+new_sub_instr(lexer_state * const lexer, int opcode, char const * const opname,
+              unsigned num_var_args)>
 
 Create a new instruction node, and initialize the opcode and opinfo on that
 node. This function can be used to create an instruction of which the signature
@@ -1985,19 +2221,32 @@
 This is useful for generating special subroutine instructions, such as
 C<get_params_pc> etc.
 
+The parameter C<num_var_args> passes the number of variable arguments (if any)
+that C<opcode> has.
+
 =cut
 
 */
 static void
-new_sub_instr(lexer_state * const lexer, int opcode, char const * const opname, ...) {
+new_sub_instr(lexer_state * const lexer, int opcode, char const * const opname,
+              unsigned num_var_args)
+
+{
     new_statement(lexer, opname);
     CURRENT_INSTRUCTION(lexer)->opinfo = &lexer->interp->op_info_table[opcode];
     CURRENT_INSTRUCTION(lexer)->opcode = opcode;
 
-    /* XXX how to calculate size of var-arg ops? */
+    /* The size of a var-arg op (get_params, etc.) is 1 for the op,
+     * 1 for the fixed integer array, and n for the variable number of arguments.
+     * So, 2 + n, where n is the number of arguments.
+     */
 
     /* count number of ints needed to store this instruction in bytecode */
     lexer->codesize += CURRENT_INSTRUCTION(lexer)->opinfo->op_count;
+
+    /* add the var. number of args for the PCC instructions. */
+    lexer->codesize += num_var_args;
+
 }
 
 /*
@@ -2019,6 +2268,10 @@
      */
     if (instr->opinfo)
         lexer->codesize -= instr->opinfo->op_count;
+
+/*
+    fprintf(stderr, "updateop(): %s\n", CURRENT_INSTRUCTION(lexer)->opname);
+*/
     /* else the instruction was already set; decrement the codesize, as it was added already */
 
     /* now get the opinfo structure, update the name, and update the opcode. */
@@ -2031,11 +2284,30 @@
 }
 
 
+/*
+
+=item C<void
+generate_parameters_instr(lexer_state * const lexer, unsigned num_parameters)>
+
+Generate the "get_params" instruction, taking <num_parameters> variable arguments;
+this is the number of parameters of this function.
+
+=cut
+
+*/
+void
+generate_parameters_instr(lexer_state * const lexer, unsigned num_parameters) {
+    new_sub_instr(lexer, PARROT_OP_get_params_pc, "get_params_pc", num_parameters);
+    /* convert the parameter list into operands. Parameters are stored as target nodes. */
+    targets_to_operands(lexer, CURRENT_SUB(lexer)->parameters, num_parameters);
+}
+
 
 /*
 
 =item C<static void
-save_global_reference(lexer_state * const lexer, instruction *instr, char * const label)>
+save_global_reference(lexer_state * const lexer, instruction * const instr,
+                      char const * const label)>
 
 Store the instruction C<instr>, which references the global label C<label> in a list.
 After the parse phase, this instruction can be patched, if C<label> can be resolved
@@ -2045,7 +2317,10 @@
 
 */
 static void
-save_global_reference(lexer_state * const lexer, instruction * const instr, char const * const label) {
+save_global_reference(lexer_state * const lexer, instruction * const instr,
+                      char const * const label)
+
+{
     global_fixup *ref = pir_mem_allocate_zeroed_typed(lexer, global_fixup);
 
     ref->instr = instr;
@@ -2058,131 +2333,263 @@
 
 /*
 
-=item C<void
-convert_inv_to_instr(lexer_state * const lexer, invocation * const inv)>
+=item C<static void
+convert_pcc_call(lexer_state * const lexer, invocation * const inv)>
+
+Generate instructions for a normal invocation using the Parrot Calling
+Conventions (PCC). This is the sequence of the following instructions:
+
+For $P0():
 
-Convert an C<invocation> structure into a series of instructions.
+ set_args_pc
+ get_results_pc
+ invokecc_p / invoke_p_p
 
-XXX Some of the conversion should be done during emit_pbc(), because only at that
-point is there a bytecode object around, in which PMCs can be emitted.
-Subs are stored as PMCs, and we need to look up the PMC constant and emit
-its index as an operand. Also, the first operands of the special PCC instructions
-must be generated once the bytecode object is around, because they use a FixedIntegerArray
-to encode flags/types of the rest of the operands.
+For "foo"() and foo():
 
-One solution would be to mark these instructions, and fix them during emitting bytecode.
-This needs more thought.
+ set_args_pc
+ get_results_pc
+ set_p_pc / find_sub_not_null_p_sc
+ invokecc_p
 
 =cut
 
 */
-void
-convert_inv_to_instr(lexer_state * const lexer, invocation * const inv) {
-    switch (inv->type) {
-        case CALL_PCC:
-            new_sub_instr(lexer, PARROT_OP_set_args_pc, "set_args_pc");
-            arguments_to_operands(lexer, inv->arguments);
+static void
+convert_pcc_call(lexer_state * const lexer, invocation * const inv) {
+    new_sub_instr(lexer, PARROT_OP_set_args_pc, "set_args_pc", inv->num_arguments);
+    arguments_to_operands(lexer, inv->arguments, inv->num_arguments);
+
+    new_sub_instr(lexer, PARROT_OP_get_results_pc, "get_results_pc", inv->num_results);
+    targets_to_operands(lexer, inv->results, inv->num_results);
+
+    /* if the target is a register, invoke that. */
+    if (TEST_FLAG(inv->sub->flags, TARGET_FLAG_IS_REG)) {
+        target *sub = new_reg(lexer, PMC_TYPE, inv->sub->info->color);
+
+        if (inv->retcc) { /* return continuation present? */
+            new_sub_instr(lexer, PARROT_OP_invoke_p_p, "invoke_p_p", 0);
+            add_operands(lexer, "%T%T", inv->sub, inv->retcc);
+        }
+        else {
+            new_sub_instr(lexer, PARROT_OP_invokecc_p, "invokecc_p", 0);
+            add_operands(lexer, "%T", sub);
+        }
+    }
+    else { /* find the global label in the current file, or find it during runtime */
+        target *sub        = generate_unique_pir_reg(lexer, PMC_TYPE);
+        global_label *glob = find_global_label(lexer, inv->sub->info->id.name);
 
-            new_sub_instr(lexer, PARROT_OP_get_results_pc, "get_results_pc");
-            targets_to_operands(lexer, inv->results);
+        if (glob) {
+            new_sub_instr(lexer, PARROT_OP_set_p_pc, "set_p_pc", 0);
+            add_operands(lexer, "%T%i", sub, glob->const_table_index);
+        }
+        else { /* find it during runtime (hopefully, otherwise exception) */
+            new_sub_instr(lexer, PARROT_OP_find_sub_not_null_p_sc, "find_sub_not_null_p_sc", 0);
 
-            /* if the target is a register, invoke that. */
-            if (TEST_FLAG(inv->sub->flags, TARGET_FLAG_IS_REG)) {
-                target *sub = new_reg(lexer, PMC_TYPE, inv->sub->info->color);
-                if (inv->retcc) { /* return continuation present? */
-                    new_sub_instr(lexer, PARROT_OP_invoke_p_p, "invoke_p_p");
-                    add_operands(lexer, "%T%T", inv->sub, inv->retcc);
-                }
-                else {
-                    new_sub_instr(lexer, PARROT_OP_invokecc_p, "invokecc_p");
-                    add_operands(lexer, "%T", sub);
-                }
-            }
-            else { /* find the global label in the current file, or find it during runtime */
-                target *sub        = generate_unique_pir_reg(lexer, PMC_TYPE);
-                global_label *glob = find_global_label(lexer, inv->sub->info->id.name);
-
-                if (glob) {
-                    /* XXX fix pmc const stuff */
-                    new_sub_instr(lexer, PARROT_OP_set_p_pc, "set_p_pc");
-                    add_operands(lexer, "%T%i", sub, glob->const_nr);
-                }
-                else { /* find it during runtime (hopefully, otherwise exception) */
-                    new_sub_instr(lexer, PARROT_OP_find_sub_not_null_p_sc,
-                                  "find_sub_not_null_p_sc");
-
-                    add_operands(lexer, "%T%s", sub, inv->sub->info->id.name);
-
-                    /* save the current instruction in a list; entries in this list will be
-                     * fixed up, if possible, after the parsing phase.
-                     *
-                     * Instead of the instruction
-                     *
-                     *   set_p_pc
-                     *
-                     * that is generated when the global label C<glob> was found (see above),
-                     * another instructions is generated. After the parse, we'll re-try
-                     * to find the global label that is referenced. For now, just generate
-                     * this instruction to do the resolving of the label during runtime:
-                     *
-                     *   find_sub_not_null_p_sc
-                     *
-                     */
-                    save_global_reference(lexer, CURRENT_INSTRUCTION(lexer),
-                                          inv->sub->info->id.name);
-                }
+            add_operands(lexer, "%T%s", sub, inv->sub->info->id.name);
 
-                new_sub_instr(lexer, PARROT_OP_invokecc_p, "invokecc_p");
-                add_operands(lexer, "%T", sub);
+            /* save the current instruction in a list; entries in this list will be
+             * fixed up, if possible, after the parsing phase.
+             *
+             * Instead of the instruction
+             *
+             *   set_p_pc
+             *
+             * that is generated when the global label C<glob> was found (see above),
+             * another instructions is generated. After the parse, we'll re-try
+             * to find the global label that is referenced. For now, just generate
+             * this instruction to do the resolving of the label during runtime:
+             *
+             *   find_sub_not_null_p_sc
+             */
+            save_global_reference(lexer, CURRENT_INSTRUCTION(lexer), inv->sub->info->id.name);
+        }
 
-            }
+        new_sub_instr(lexer, PARROT_OP_invokecc_p, "invokecc_p", 0);
+        add_operands(lexer, "%T", sub);
+
+    }
+}
+
+/*
+
+=item C<static void
+convert_pcc_return(lexer_state * const lexer, invocation * const inv)>
+
+Generate instructions for a normal return statement using the Parrot Calling
+Conventions (PCC). The sequence of instructions is:
+
+ set_returns_pc
+ returncc
+
+=cut
+
+*/
+static void
+convert_pcc_return(lexer_state * const lexer, invocation * const inv) {
+    new_sub_instr(lexer, PARROT_OP_set_returns_pc, "set_returns_pc", inv->num_arguments);
+    arguments_to_operands(lexer, inv->arguments, inv->num_arguments);
+    new_sub_instr(lexer, PARROT_OP_returncc, "returncc", 0);
+}
+
+/*
+
+=item C<static void
+convert_nci_call(lexer_state * const lexer, invocation * const inv)>
+
+Generate instructions for a function invocation using the Native Call
+Interface (NCI). The sequence of instructions is:
+
+XXX complete this.
+
+ invokecc_p
+
+=cut
+
+*/
+static void
+convert_nci_call(lexer_state * const lexer, invocation * const inv) {
+    set_instr(lexer, "invokecc_p");
+}
+
+/*
+
+=item C<static void
+convert_pcc_yield(lexer_state * const lexer, invocation * const inv)>
+
+Generate instructions for a yield statement using the Parrot Calling Conventions.
+The sequence of instructions is:
+
+ set_returns_pc
+ yield
+
+=cut
+
+*/
+static void
+convert_pcc_yield(lexer_state * const lexer, invocation * const inv) {
+    new_sub_instr(lexer, PARROT_OP_set_returns_pc, "set_returns_pc", inv->num_arguments);
+    arguments_to_operands(lexer, inv->arguments, inv->num_arguments);
+
+    new_sub_instr(lexer, PARROT_OP_yield, "yield", 0);
+}
+
+/*
+
+=item C<static void
+convert_pcc_tailcall(lexer_state * const lexer, invocation * const inv)>
+
+Generate instructions for a tailcall using the Parrot Calling Conventions (PCC).
+The sequence of instructions is:
+
+ set_args_pc
+ tailcall_pc
+
+=cut
+
+*/
+static void
+convert_pcc_tailcall(lexer_state * const lexer, invocation * const inv) {
+    new_sub_instr(lexer, PARROT_OP_set_args_pc, "set_args_pc", inv->num_arguments);
+    arguments_to_operands(lexer, inv->arguments, inv->num_arguments);
+
+    new_sub_instr(lexer, PARROT_OP_tailcall_p, "tailcall_p", 0);
+}
+
+/*
+
+=item C<static void
+convert_pcc_methodcall(lexer_state * const lexer, invocation * const inv)>
+
+Generate instructions for a method call using the Parrot Calling Conventions (PCC).
+The sequence of instructions is:
+
+ set_args_pc
+ get_results_pc
+ callmethodcc_p_sc
+
+=cut
+
+*/
+static void
+convert_pcc_methodcall(lexer_state * const lexer, invocation * const inv) {
+    new_sub_instr(lexer, PARROT_OP_set_args_pc, "set_args_pc", inv->num_arguments);
+    arguments_to_operands(lexer, inv->arguments, inv->num_arguments);
+    /* in a methodcall, the invocant object is passed as the first argument */
+    unshift_operand(lexer, expr_from_target(lexer, inv->sub));
+
+    new_sub_instr(lexer, PARROT_OP_get_results_pc, "get_results_pc", inv->num_results);
+    targets_to_operands(lexer, inv->results, inv->num_results);
+
+    new_sub_instr(lexer, PARROT_OP_callmethodcc_p_sc, "callmethodcc_p_sc", 0);
+    add_operands(lexer, "%T%E", inv->sub, inv->method);
+}
+
+/*
+
+=item C<static void
+convert_pcc_methodtailcall(lexer_state * const lexer, invocation * const inv)>
+
+Generate instructions for a method tailcall, using the Parrot Calling Conventions (PCC).
+The sequence of instructions is:
+
+ set_args_pc
+ tailcallmethod_p_p / tailcallmethod_p_sc
+
+=cut
+
+*/
+static void
+convert_pcc_methodtailcall(lexer_state * const lexer, invocation * const inv) {
+    new_sub_instr(lexer, PARROT_OP_set_args_pc, "set_args_pc", inv->num_arguments);
+    arguments_to_operands(lexer, inv->arguments, inv->num_arguments);
+
+    /* check out the type of the method expression; it may be a PMC or a STRING. */
+    if (inv->method->type == EXPR_TARGET)
+        new_sub_instr(lexer, PARROT_OP_tailcallmethod_p_p, "tailcallmethod_p_p", 0);
+    else if (inv->method->type == EXPR_CONSTANT)
+        new_sub_instr(lexer, PARROT_OP_tailcallmethod_p_sc, "tailcallmethod_p_sc", 0);
+    else
+        panic(lexer, "unknown expression type in tailcallmethod instruction");
+
+}
+
+/*
+
+=item C<void
+convert_inv_to_instr(lexer_state * const lexer, invocation * const inv)>
+
+Convert an C<invocation> structure into a series of instructions. This is the
+dispatch function, which calls the appropriate conversion function, based
+on the type of C<inv>.
+
+=cut
+
+*/
+void
+convert_inv_to_instr(lexer_state * const lexer, invocation * const inv) {
+    switch (inv->type) {
+        case CALL_PCC:
+            convert_pcc_call(lexer, inv);
             break;
         case CALL_RETURN:
-            new_sub_instr(lexer, PARROT_OP_set_returns_pc, "set_returns_pc");
-            arguments_to_operands(lexer, inv->arguments);
-
-            new_sub_instr(lexer, PARROT_OP_returncc, "returncc");
+            convert_pcc_return(lexer, inv);
             break;
         case CALL_NCI:
-            set_instr(lexer, "invokecc_p");
+            convert_nci_call(lexer, inv);
             break;
         case CALL_YIELD:
-            new_sub_instr(lexer, PARROT_OP_set_returns_pc, "set_returns_pc");
-            arguments_to_operands(lexer, inv->arguments);
-
-            new_sub_instr(lexer, PARROT_OP_yield, "yield");
+            convert_pcc_yield(lexer, inv);
             break;
         case CALL_TAILCALL:
-            new_sub_instr(lexer, PARROT_OP_set_args_pc, "set_args_pc");
-            arguments_to_operands(lexer, inv->arguments);
-
-            new_sub_instr(lexer, PARROT_OP_tailcall_p, "tailcall_pc");
+            convert_pcc_tailcall(lexer, inv);
             break;
         case CALL_METHOD:
-            new_sub_instr(lexer, PARROT_OP_set_args_pc, "set_args_pc");
-            arguments_to_operands(lexer, inv->arguments);
-            /* in a methodcall, the invocant object is passed as the first argument */
-            unshift_operand(lexer, expr_from_target(lexer, inv->sub));
-
-            new_sub_instr(lexer, PARROT_OP_get_results_pc, "get_results_pc");
-            targets_to_operands(lexer, inv->results);
-
-            new_sub_instr(lexer, PARROT_OP_callmethodcc_p_sc, "callmethodcc_p_sc");
-            add_operands(lexer, "%T%E", inv->sub, inv->method);
-
+            convert_pcc_methodcall(lexer, inv);
             break;
         case CALL_METHOD_TAILCALL:
-            new_sub_instr(lexer, PARROT_OP_set_args_pc, "set_args_pc");
-            arguments_to_operands(lexer, inv->arguments);
-
-            /* check out the type of the method expression; it may be a PMC or a STRING. */
-            if (inv->method->type == EXPR_TARGET)
-                new_sub_instr(lexer, PARROT_OP_tailcallmethod_p_p, "tailcallmethod_p_p");
-            else if (inv->method->type == EXPR_CONSTANT)
-                new_sub_instr(lexer, PARROT_OP_tailcallmethod_p_p, "tailcallmethod_p_sc");
-            else
-                panic(lexer, "unknown expression type in tailcallmethod instruction");
-
+            convert_pcc_methodtailcall(lexer, inv);
             break;
         default:
             panic(lexer, "Unknown invocation type in convert_inv_to_instr()");
@@ -2196,7 +2603,9 @@
 =item C<static label *
 new_label(lexer_state * const lexer, char const * const labelid, int offset)>
 
-Constructor for a label operand.
+Constructor for a label struct node. A new C<label> object is created,
+initialized with the label id specified in C<labelid>, and the bytecode
+offset in C<offset>. A pointer to the label node is returned.
 
 =cut
 
@@ -2235,12 +2644,10 @@
     do {
         iter = iter->next; /* init pointer to first instruction */
 
-        /* depending on what kind of branching instruction, get the right operand
-         * that contains the label.
+        /* Do a quick global check if any label bits have been set
+         * if no label at all, skip this whole block.
          */
-        if (iter->oplabelbits) { /* this is a quick global check if any label bits have been set
-                                  * if no label at all, skip this whole block.
-                                  */
+        if (iter->oplabelbits) {
 
             /* now check for each operand */
             expression *operand = iter->operands;
@@ -2263,7 +2670,10 @@
                     unsigned     offset     = find_local_label(lexer, labelid);
                     unsigned     curr_instr = iter->offset;
 
-                    /* convert the label identifier into a real label object */
+                    /* convert the label identifier into a real label object.
+                     * The label offset is calculated deducting the current
+                     * Program Counter from the PC of the label.
+                     */
                     operand->expr.l = new_label(lexer, labelid, offset - curr_instr);
                     operand->type   = EXPR_LABEL;
                 }
@@ -2302,7 +2712,7 @@
         global_label *glob = find_global_label(lexer, iter->label);
 
         /* if found, then fix it; if not, that's fine, the right instruction to find the
-         * sub during runtime is in place already.
+         * sub during runtime is in place already (i.e. "find_sub_not_null").
          */
         if (glob) {
             expression *new_second_operand;
@@ -2318,7 +2728,8 @@
              */
 
             /* create an operand that refers to a constant PMC */
-            new_second_operand = expr_from_const(lexer, new_const(lexer, INT_TYPE, glob->const_nr));
+            new_second_operand = expr_from_const(lexer, new_const(lexer, INT_TYPE,
+                                                                  glob->const_table_index));
             /* link it into the list of operands; the /current/ second operand should be removed,
              * so insert the new expression as second operand, and make sure the old second
              * operand is no longer in the list.
@@ -2334,7 +2745,7 @@
 /*
 
 =item C<static void
-emit_sub_leaving_instructions(lexer_state * const lexer)>
+emit_sub_epilogue(lexer_state * const lexer)>
 
 Emit final instructions for the current subroutine. In case
 this is a C<:main> sub, the "end" instruction is emitted,
@@ -2344,18 +2755,17 @@
 
 */
 static void
-emit_sub_leaving_instructions(lexer_state * const lexer) {
-    /* a :main-marked sub ends with the "end" instruction;
-     * otherwise it's this pair:
-     *
-     *    set_returns_pc
-     *    returncc
-     */
-    if (TEST_FLAG(lexer->subs->flags, SUB_FLAG_MAIN))
-        new_sub_instr(lexer, PARROT_OP_end, "end");
+emit_sub_epilogue(lexer_state * const lexer) {
+
+    if (TEST_FLAG(lexer->subs->flags, PIRC_SUB_FLAG_MAIN))
+        new_sub_instr(lexer, PARROT_OP_end, "end", 0);
     else {
-        new_sub_instr(lexer, PARROT_OP_set_returns_pc, "set_returns_pc");
-        new_sub_instr(lexer, PARROT_OP_returncc, "returncc");
+        /* default sub epilogue; no return values, hence 0 */
+        int array_index = generate_signature_pmc(lexer, 0);
+        new_sub_instr(lexer, PARROT_OP_set_returns_pc, "set_returns_pc", 0);
+        push_operand(lexer, expr_from_const(lexer, new_const(lexer, INT_TYPE, array_index)));
+
+        new_sub_instr(lexer, PARROT_OP_returncc, "returncc", 0);
     }
 }
 
@@ -2375,34 +2785,51 @@
 */
 void
 close_sub(lexer_state * const lexer) {
-    int need_leaving_instr = 1;
+    int need_epilogue = 1;
+    int sub_const_table_index;
+    global_label *glob;
 
-    /* don't generate leaving instructions if the last instruction was already
+    /* don't generate the sub epilogue if the last instruction was already
      * leaving the sub.
+     * XXX add all instructions that make the sub epilogue unnecessary.
+     * XXX should all branching instructions prevent generation of the epilogue?
      */
     if (CURRENT_INSTRUCTION(lexer)) {
         switch (CURRENT_INSTRUCTION(lexer)->opcode) {
             case PARROT_OP_end:
             case PARROT_OP_returncc:
-                need_leaving_instr = 0;
+                need_epilogue = 0;
                 break;
             default:
                 break;
         }
     }
 
-    if (need_leaving_instr)
-        emit_sub_leaving_instructions(lexer);
+    if (need_epilogue)
+        emit_sub_epilogue(lexer);
 
     /* fix up all local branch labels */
     fixup_local_labels(lexer);
 
     /* store end offset in bytecode of this subroutine */
-    CURRENT_SUB(lexer)->endoffset = lexer->codesize;
+    CURRENT_SUB(lexer)->info.endoffset = lexer->codesize;
 
      /* if register allocation was requested, do that now */
     if (TEST_FLAG(lexer->flags, LEXER_FLAG_REGALLOC))
         linear_scan_register_allocation(lexer->lsr);
+
+    /* store the subroutine in the bytecode constant table. */
+    sub_const_table_index = add_sub_pmc(lexer->bc, &CURRENT_SUB(lexer)->info,
+                                        TEST_FLAG(CURRENT_SUB(lexer)->flags, PIRC_SUB_FLAG_LEX));
+
+    /* store the sub PMC index in the constant table with the global label,
+     * so that invoking ops can find this index.
+     */
+    glob = find_global_label(lexer, CURRENT_SUB(lexer)->info.subname);
+
+    PARROT_ASSERT(glob != NULL); /* it was stored in new_subr(), so must be there. */
+
+    glob->const_table_index = sub_const_table_index;
 }
 
 /*
@@ -2420,7 +2847,7 @@
 update_sub_register_usage(lexer_state * const lexer, unsigned reg_usage[NUM_PARROT_TYPES]) {
     int i;
     for (i = 0; i < NUM_PARROT_TYPES; ++i)
-        CURRENT_SUB(lexer)->regs_used[i] = reg_usage[i];
+        CURRENT_SUB(lexer)->info.regs_used[i] = reg_usage[i];
 }
 
 

Modified: branches/pdd22io_part3/compilers/pirc/new/pircompunit.h
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pircompunit.h	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pircompunit.h	Mon Dec 29 23:28:53 2008
@@ -13,6 +13,9 @@
 #ifndef PARROT_PIR_PIRCOMPUNIT_H_GUARD
 #define PARROT_PIR_PIRCOMPUNIT_H_GUARD
 
+#include "pirdefines.h"
+#include "bcgen.h"
+
 /* the 4 parrot types; use explicit values that match the values in
  * PDD03_calling_conventions.pod.
  */
@@ -25,8 +28,6 @@
 
 } pir_type;
 
-/* Parrot has 4 types */
-#define NUM_PARROT_TYPES    4
 
 
 /* selector values for the expression value union */
@@ -70,21 +71,21 @@
 
 /* sub flags */
 typedef enum sub_flags {
-    SUB_FLAG_METHOD     = 1 << 0,  /* the sub is a method */
-    SUB_FLAG_INIT       = 1 << 1,  /* the sub is run before :main when starting up */
-    SUB_FLAG_LOAD       = 1 << 2,  /* the sub is run when the bytecode is loaded */
-    SUB_FLAG_OUTER      = 1 << 3,  /* the sub is lexically nested */
-    SUB_FLAG_MAIN       = 1 << 4,  /* execution of the program will start at this sub */
-    SUB_FLAG_ANON       = 1 << 5,  /* this sub is shy and will not be stored in the global
-                                      namespace */
-    SUB_FLAG_POSTCOMP   = 1 << 6,  /* this sub will be executed after compilation */
-    SUB_FLAG_IMMEDIATE  = 1 << 7,  /* similar to POSTCOMP above; check out PDD19 for difference */
-    SUB_FLAG_VTABLE     = 1 << 8,  /* this sub overrides a vtable method */
-    SUB_FLAG_LEX        = 1 << 9,  /* this sub needs a LexPad */
-    SUB_FLAG_MULTI      = 1 << 10, /* this sub is a multi method/sub */
-    SUB_FLAG_SUBID      = 1 << 11, /* this sub has a namespace-unaware identifier
-                                      XXX this flag needed? XXX */
-    SUB_FLAG_INSTANCEOF = 1 << 12  /* this sub has an :instanceof flag. XXX document this XXX */
+    PIRC_SUB_FLAG_METHOD     = 1 << 0,  /* the sub is a method */
+    PIRC_SUB_FLAG_INIT       = 1 << 1,  /* the sub is run before :main when starting up */
+    PIRC_SUB_FLAG_LOAD       = 1 << 2,  /* the sub is run when the bytecode is loaded */
+    PIRC_SUB_FLAG_HAS_OUTER  = 1 << 3,  /* the sub is lexically nested */
+    PIRC_SUB_FLAG_IS_OUTER   = 1 << 4,  /* the sub contains lexically nested subs. */
+    PIRC_SUB_FLAG_MAIN       = 1 << 5,  /* execution of the program will start at this sub */
+    PIRC_SUB_FLAG_ANON       = 1 << 6,  /* this sub is shy and will not be stored in the global
+                                           namespace */
+    PIRC_SUB_FLAG_POSTCOMP   = 1 << 7,  /* this sub will be executed after compilation */
+    PIRC_SUB_FLAG_IMMEDIATE  = 1 << 8,  /* similar to POSTCOMP above; check PDD19 for difference */
+    PIRC_SUB_FLAG_VTABLE     = 1 << 9,  /* this sub overrides a vtable method */
+    PIRC_SUB_FLAG_LEX        = 1 << 10, /* this sub needs a LexPad */
+    PIRC_SUB_FLAG_MULTI      = 1 << 11, /* this sub is a multi method/sub */
+    PIRC_SUB_FLAG_SUBID      = 1 << 12, /* this sub has a namespace-unaware identifier */
+    PIRC_SUB_FLAG_INSTANCEOF = 1 << 13  /* this sub has an :instanceof flag. XXX document this */
 
 } sub_flag;
 
@@ -111,9 +112,9 @@
 
 /* macros to set the i-th bit */
 #define BIT(i)          (1 << (i))
-#define SET_BIT(M,B)    SET_FLAG(M,B)
-#define TEST_BIT(M,B)   TEST_FLAG(M,B)
-#define CLEAR_BIT(M,B)  CLEAR_FLAG(M,B)
+#define SET_BIT(M,B)    SET_FLAG((M),(B))
+#define TEST_BIT(M,B)   TEST_FLAG((M),(B))
+#define CLEAR_BIT(M,B)  CLEAR_FLAG((M),(B))
 
 #define NOT(X)          !(X)
 
@@ -152,17 +153,17 @@
 } label;
 
 
-#define CONST_INTVAL(c) c->val.ival
-#define CONST_NUMVAL(c) c->val.nval
-#define CONST_PMCVAL(c) c->val.pval
-#define CONST_STRVAL(c) c->val.sval
+#define CONST_INTVAL(c) (c)->val.ival
+#define CONST_NUMVAL(c) (c)->val.nval
+#define CONST_PMCVAL(c) (c)->val.pval
+#define CONST_STRVAL(c) (c)->val.sval
 
 /* The expression node is used as a wrapper to represent target nodes (like .param, .local
  * and registers), constant nodes (either named or anonymous), label identifiers,
  * or key nodes, such as ["x";42].
  */
 typedef struct expression {
-    union __expression_union {
+    union expression_union {
         struct target  *t;
         constant       *c;
         char const     *id;
@@ -198,7 +199,6 @@
     struct syminfo *info;           /* pointer to symbol/pir_reg's information */
     target_flag     flags;          /* flags like :slurpy etc. */
     char const     *alias;          /* if this is a named parameter, this is the alias */
-    char const     *lex_name;       /* if this is a lexical, this field contains the name */
     struct key     *key;            /* the key of this target, i.e. $P0[$P1], $P1 is key. */
 
     struct target  *next;
@@ -239,6 +239,8 @@
     target             *retcc;         /* return continuation, if any */
     target             *results;       /* targets that will receive return values */
     argument           *arguments;     /* values passed into the sub, or return values */
+    unsigned            num_results;   /* number of result target nodes */
+    unsigned            num_arguments; /* number of argument nodes */
 
 } invocation;
 
@@ -263,7 +265,7 @@
 
 /* a hashtable bucket for storing something */
 typedef struct bucket {
-    union __bucket_union {
+    union bucket_union {
         char const          *str;
         struct symbol       *sym;
         struct local_label  *loc;
@@ -276,11 +278,11 @@
 } bucket;
 
 /* accessors for the bucket union */
-#define bucket_string(B)    B->u.str
-#define bucket_symbol(B)    B->u.sym
-#define bucket_local(B)     B->u.loc
-#define bucket_global(B)    B->u.glob
-#define bucket_constant(B)  B->u.cons
+#define bucket_string(B)    (B)->u.str
+#define bucket_symbol(B)    (B)->u.sym
+#define bucket_local(B)     (B)->u.loc
+#define bucket_global(B)    (B)->u.glob
+#define bucket_constant(B)  (B)->u.cons
 
 /* hashtable structure */
 typedef struct hashtable {
@@ -290,26 +292,22 @@
 
 } hashtable;
 
+
 /* forward declaration of structs */
 struct symbol;
 struct label;
 
+
+
 /* a sub */
 typedef struct subroutine {
     key                *name_space;    /* this sub's namespace */
-    char const         *sub_name;      /* this sub's name */
-    char const         *outer_sub;     /* this sub's outer subroutine, if any */
-    char const         *subid;         /* this sub's subid, if any */
-    int                 vtable_index;  /* index of vtable method this sub's overriding, if any */
+
     char const         *instanceof;    /* XXX document this XXX */
-    char const         *nsentry;       /* name by which the sub is stored in the namespace */
     char const         *methodname;    /* name of this sub by which it's stored as a method */
     int                 flags;         /* this sub's flags */
-    int                 startoffset;   /* start offset in bytecode where this sub starts */
-    int                 endoffset;     /* end offset in bytecode where this sub ends */
 
-    /* XXX the whole multi stuff must be implemented */
-    char              **multi_types;   /* data types of parameters if this is a multi sub */
+    struct sub_info     info;
 
     target             *parameters;    /* parameters of this sub */
     instruction        *statements;    /* statements of this sub */
@@ -317,16 +315,15 @@
     hashtable           symbols;
     hashtable           labels;        /* local labels */
 
-    struct pir_reg     *registers[4];  /* used PIR registers in this sub (1 list for each type) */
-    unsigned            regs_used[4];  /* number of PASM registers allocated for this sub */
+    struct pir_reg     *registers[NUM_PARROT_TYPES];  /* used PIR registers in this sub */
 
     struct subroutine  *next;          /* pointer to next subroutine in the list */
 
 } subroutine;
 
 /* accessors for current sub and current instruction; makes code a bit more readable */
-#define CURRENT_SUB(L)          L->subs
-#define CURRENT_INSTRUCTION(L)  L->subs->statements
+#define CURRENT_SUB(L)          (L)->subs
+#define CURRENT_INSTRUCTION(L)  (L)->subs->statements
 
 /* forward declaration */
 struct lexer_state;
@@ -342,6 +339,8 @@
 void set_sub_nsentry(struct lexer_state * const lexer, char const * const nsentry);
 void set_sub_methodname(struct lexer_state * const lexer, char const * const methodname);
 
+void set_sub_multi_types(struct lexer_state * const lexer, expression * const multitype);
+
 /* install a new subroutine node */
 void new_subr(struct lexer_state * const lexer, char const * const subname);
 
@@ -364,6 +363,7 @@
 expression *expr_from_target(struct lexer_state * const lexer, target * const t);
 expression *expr_from_ident(struct lexer_state * const lexer, char const * const name);
 expression *expr_from_key(struct lexer_state * const lexer, key * const k);
+expression *expr_from_string(struct lexer_state * const lexer, char const * const sval);
 
 /* functions for argument node creation and storing */
 argument *new_argument(struct lexer_state * const lexer, expression * const expr);
@@ -423,7 +423,7 @@
 void remove_all_operands(struct lexer_state * const lexer);
 
 
-void set_lex_flag(target * const t, char const * const lexname);
+void set_lex_flag(struct lexer_state * const lexer, target * const t, char const * const lexname);
 char const *get_inverse(char const * const instr);
 void invert_instr(struct lexer_state * const lexer);
 
@@ -448,7 +448,9 @@
 void update_sub_register_usage(struct lexer_state * const lexer,
                                unsigned reg_usage[NUM_PARROT_TYPES]);
 
-void panic(struct lexer_state * lexer, char const * const message);
+void generate_parameters_instr(struct lexer_state * const lexer, unsigned num_parameters);
+
+void panic(struct lexer_state * lexer, char const * const message, ...);
 
 #endif /* PARROT_PIR_PIRCOMPUNIT_H_GUARD */
 

Modified: branches/pdd22io_part3/compilers/pirc/new/piremit.c
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/piremit.c	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/piremit.c	Mon Dec 29 23:28:53 2008
@@ -9,9 +9,12 @@
 #include "pircompiler.h"
 #include "bcgen.h"
 
+#include "parrot/oplib/ops.h"
+#include "assert.h"
+
 /*
 
-=head1 FUNCTIONS
+=head1 DESCRIPTION
 
 This file contains emit functions. Depending on the requested output,
 the appropriate emit functions are used. Options are:
@@ -19,14 +22,35 @@
  -p     for PASM output
  -b     for bytecode output
 
+The functions in this file walk the data structure that is built during
+the parse phase. During the traversal, bytecode for instructions and
+their operands are emitted through the C<bcgen> module.
+
+
+=head1 FUNCTIONS
+
 =over 4
 
 =cut
 
 */
 
+static char const * const subflag_names[] = {
+    "method",
+    "init",
+    "load",
+    "outer",
+    "main",
+    "anon",
+    "postcomp",
+    "immediate",
+    "vtable",
+    "lex",
+    "multi",
+    "lexid"
+};
 
-#define out stdout
+#define out lexer->outfile
 
 /* the order of these letters match with the pir_type enumeration.
  * These are used for human-readable PASM output.
@@ -36,20 +60,21 @@
 static void emit_pir_statement(lexer_state * const lexer, subroutine * const sub);
 static void emit_pir_instruction(lexer_state * const lexer, instruction * const instr);
 
+static void emit_pbc_key(lexer_state * const lexer, key * const k);
 
 /* prototype declaration */
 void print_expr(lexer_state * const lexer, expression * const expr);
 void print_key(lexer_state * const lexer, key *k);
-void print_target(lexer_state *lexer, target * const t);
+void print_target(lexer_state * const lexer, target * const t);
 void print_constant(lexer_state * const lexer, constant * const c);
 void print_expressions(lexer_state * const lexer, expression * const expr);
-void print_instruction(lexer_state * const lexer, instruction *ins);
+void print_instruction(lexer_state * const lexer, instruction * const ins);
 void print_statement(lexer_state * const lexer, subroutine * const sub);
 
 /*
 
 =item C<void
-print_key(key *k)>
+print_key(lexer_state * const lexer, key *k)>
 
 Print the key C<k>. The total key is enclosed in square brackets,
 and different key elements are separated by semicolons. Example:
@@ -80,7 +105,7 @@
 /*
 
 =item C<void
-print_target(target * const t)>
+print_target(lexer_state * const lexer, target * const t)>
 
 Print the target C<t>; if C<t> has a key, that key is
 printed as well. Examples:
@@ -91,7 +116,7 @@
 
 */
 void
-print_target(lexer_state *lexer, target * const t) {
+print_target(lexer_state * const lexer, target * const t) {
     fprintf(out, "%c%d", pir_register_types[t->info->type], t->info->color);
 
     /* if the target has a key, print that too */
@@ -102,7 +127,7 @@
 /*
 
 =item C<void
-print_constant(constant *c)>
+print_constant(lexer_state * const lexer, constant * const c)>
 
 Print the value of constant C<c>.
 
@@ -189,9 +214,16 @@
     }
 }
 
+/*
+
+=item C<void
+print_instruction(lexer_state * const lexer, instruction * const ins)>
+
+=cut
 
+*/
 void
-print_instruction(lexer_state * const lexer, instruction *ins) {
+print_instruction(lexer_state * const lexer, instruction * const ins) {
     PARROT_ASSERT(ins != NULL);
 
     if (ins->label) {
@@ -221,6 +253,16 @@
     }
 }
 
+/*
+
+=item C<void
+print_statement(lexer_state * const lexer, subroutine * const sub)>
+
+XXX
+
+=cut
+
+*/
 void
 print_statement(lexer_state * const lexer, subroutine * const sub) {
     if (sub->statements != NULL) {
@@ -235,30 +277,13 @@
 
 }
 
-
-static char const * const subflag_names[] = {
-    "method",
-    "init",
-    "load",
-    "outer",
-    "main",
-    "anon",
-    "postcomp",
-    "immediate",
-    "vtable",
-    "lex",
-    "multi",
-    "lexid"
-};
-
-
-
-
 /*
 
 =item C<void
 print_subs(struct lexer_state * const lexer)>
 
+XXX
+
 =cut
 
 */
@@ -268,6 +293,8 @@
         /* set iterator to first item */
         subroutine *subiter = lexer->subs->next;
 
+        /* XXX for now this works */
+        lexer->outfile = stderr;
 
         do {
 
@@ -287,15 +314,15 @@
 
                 fprintf(out, ".pcc_sub ");
 
-                if (TEST_FLAG(subiter->flags, SUB_FLAG_MAIN))
+                if (TEST_FLAG(subiter->flags, PIRC_SUB_FLAG_MAIN))
                     fprintf(out, ":main ");
-                if (TEST_FLAG(subiter->flags, SUB_FLAG_METHOD))
+                if (TEST_FLAG(subiter->flags, PIRC_SUB_FLAG_METHOD))
                     fprintf(out, ":method ");
                     /* XXX and so on; check which ones are available in PASM mode. */
 
             }
 
-            fprintf(out, "%s:\n", subiter->sub_name);
+            fprintf(out, "%s:\n", subiter->info.subname);
             print_statement(lexer, subiter);
             subiter = subiter->next;
         }
@@ -303,21 +330,37 @@
     }
 }
 
+/*
+
+=item C<static void
+emit_pir_instruction(lexer_state * const lexer, instruction * const instr)>
+
+Print the PIR representation of C<instr>.
+
+=cut
 
+*/
 static void
 emit_pir_instruction(lexer_state * const lexer, instruction * const instr) {
 
     if (instr->label)
         fprintf(out, "  %s:\n", instr->label);
-    if (instr->opinfo) {
-        fprintf(out, "    %-10s\t", instr->opinfo->name);   /* set_p_pc became 'chopn'... XXX!!! */
 
+    if (instr->opinfo) {
+        fprintf(out, "    %-10s\t", instr->opinfo->name);
         print_expressions(lexer, instr->operands);
-
         fprintf(out, "\n");
     }
 }
 
+/*
+
+=item C<static void
+emit_pir_statement(lexer_state * const lexer, subroutine * const sub)>
+
+=cut
+
+*/
 static void
 emit_pir_statement(lexer_state * const lexer, subroutine * const sub) {
     if (sub->statements != NULL) {
@@ -331,33 +374,56 @@
     }
 }
 
+/*
+
+=item C<void
+emit_pir_subs(lexer_state * const lexer)>
+
+Print the PIR representation of all subroutines stored
+in the C<lexer>.
+
+=cut
+
+*/
 void
-emit_pir_subs(lexer_state * const lexer) {
-    if (lexer->subs != NULL) {
-        /* set iterator to first item */
-        subroutine *subiter = lexer->subs->next;
+emit_pir_subs(lexer_state * const lexer, char const * const outfile) {
+    subroutine *subiter;
 
-        do {
-            int i;
-            fprintf(out, "\n.namespace ");
-            print_key(lexer, subiter->name_space);
+    if (lexer->subs == NULL)
+        return;
 
-            fprintf(out, "\n.sub %s", subiter->sub_name);
+    /* set iterator to first item */
+    subiter = lexer->subs->next;
 
-            for (i = 0; i < BIT(i); i++) {
-                if (TEST_FLAG(subiter->flags, BIT(i))) {
-                    fprintf(out, " :%s", subflag_names[i]);
-                }
-            }
+    if (outfile) {
+        lexer->outfile = fopen(outfile, "w");
+    }
+    else {
+        lexer->outfile = stdout;
+    }
 
-            fprintf(out, "\n");
-            emit_pir_statement(lexer, subiter);
-            fprintf(out, ".end\n");
 
-            subiter = subiter->next;
+    do {
+        int i;
+        fprintf(out, "\n.namespace ");
+        print_key(lexer, subiter->name_space);
+
+        fprintf(out, "\n.sub %s", subiter->info.subname);
+
+        for (i = 0; i < BIT(i); i++) {
+            if (TEST_FLAG(subiter->flags, BIT(i))) {
+                fprintf(out, " :%s", subflag_names[i]);
+            }
         }
-        while (subiter != lexer->subs->next);
+
+        fprintf(out, "\n");
+        emit_pir_statement(lexer, subiter);
+        fprintf(out, ".end\n");
+
+        subiter = subiter->next;
     }
+    while (subiter != lexer->subs->next);
+
 }
 
 
@@ -401,6 +467,7 @@
             emit_int_arg(lexer->bc, index);
 
             */
+            fprintf(stderr, "emit_pbc_const_arg: pmc type\n");
             break;
         }
         default:
@@ -408,6 +475,8 @@
     }
 }
 
+
+
 /*
 
 =item C<static void
@@ -426,6 +495,9 @@
     emit_int_arg(lexer->bc, t->info->color);
 }
 
+
+
+
 /*
 
 =item C<static void
@@ -442,6 +514,139 @@
 }
 
 
+static void
+build_key(lexer_state * const lexer, key * const k) {
+    /* XXX TODO
+     *
+     * who can help? :-)
+     */
+}
+
+
+
+static void
+emit_pbc_expr(lexer_state * const lexer, expression * const operand) {
+    switch (operand->type) {
+        case EXPR_CONSTANT:
+            emit_pbc_const_arg(lexer, operand->expr.c);
+            break;
+        case EXPR_TARGET:
+            emit_pbc_target_arg(lexer, operand->expr.t);
+
+            if (operand->expr.t->key)
+                emit_pbc_key(lexer, operand->expr.t->key);
+
+            break;
+        case EXPR_LABEL:
+            emit_pbc_label_arg(lexer, operand->expr.l);
+            break;
+        /*
+        case EXPR_KEY:
+            fprintf(stderr, "emit pbc isntr key arg\n");
+            break;
+        */
+        default:
+            break;
+    }
+}
+
+/*
+
+=item C<static void
+emit_pbc_key(lexer_state * const lexer, key * const k)>
+
+Emit bytecode for the key C<k>.
+
+=cut
+
+*/
+static void
+emit_pbc_key(lexer_state * const lexer, key * const k) {
+    fprintf(stderr, "emit pbc key\n");
+    emit_pbc_expr(lexer, k->expr);
+    /* XXX finish this. */
+}
+
+/*
+
+=item C<static void
+optimize_instr(lexer_state * const lexer, instruction * const instr)>
+
+Optimize the instruction C<instr>. Currently, these instructions are optimized:
+
+ box_p_ic  --> set_p_pc
+ box_p_nc  --> set_p_pc
+ box_p_sc  --> set_p_pc
+
+=cut
+
+*/
+static void
+optimize_instr(lexer_state * const lexer, instruction * const instr) {
+
+    switch (instr->opcode) {
+        case PARROT_OP_box_p_ic: {
+            /* box P0, 42 --> set P0, <Integer PMC const with value 42> */
+
+            /* the last operand, which is the second in this case */
+            expression *second_operand = instr->operands;
+            PMC *intconst = pmc_new(lexer->interp,
+                                    Parrot_get_ctx_HLL_type(lexer->interp, enum_class_Integer));
+            int index     = add_pmc_const(lexer->bc, intconst);
+            VTABLE_set_integer_native(lexer->interp, intconst, second_operand->expr.c->val.ival);
+
+            instr->opcode = PARROT_OP_set_p_pc;
+
+            /* replace 2nd operand with the new one. */
+            second_operand->expr.c->val.ival = index;
+
+            break;
+        }
+        case PARROT_OP_box_p_nc: {
+            /* box P0, 3.14 --> set P0, <Integer PMC const with value 3.14> */
+
+            /* the last operand, which is the second in this case */
+            expression *second_operand = instr->operands;
+            PMC *numconst = pmc_new(lexer->interp,
+                                    Parrot_get_ctx_HLL_type(lexer->interp, enum_class_Float));
+            int index     = add_pmc_const(lexer->bc, numconst);
+            VTABLE_set_number_native(lexer->interp, numconst, second_operand->expr.c->val.nval);
+
+            instr->opcode = PARROT_OP_set_p_pc;
+
+            /* replace 2nd operand with the new one. */
+            second_operand->expr.c->val.ival = index;
+            second_operand->expr.c->type     = INT_TYPE;
+
+            break;
+        }
+        case PARROT_OP_box_p_sc: {
+            /* box P0, "hi" --> set P0, <String PMC const with value "hi"> */
+
+            /* the last operand, which is the second in this case */
+            expression *second_operand = instr->operands;
+            PMC *strconst = pmc_new(lexer->interp,
+                                    Parrot_get_ctx_HLL_type(lexer->interp, enum_class_String));
+            int index     = add_pmc_const(lexer->bc, strconst);
+
+            VTABLE_set_string_native(lexer->interp, strconst,
+                                     string_from_cstring(lexer->interp,
+                                                         second_operand->expr.c->val.sval,
+                                                         strlen(second_operand->expr.c->val.sval)));
+
+            instr->opcode = PARROT_OP_set_p_pc;
+
+            /* replace 2nd operand with the new one. */
+            second_operand->expr.c->val.ival = index;
+            second_operand->expr.c->type     = INT_TYPE;
+
+            break;
+        }
+        default:
+            break;
+    }
+}
+
 /*
 
 =item C<static void
@@ -459,41 +664,37 @@
 
     /* emit the opcode */
 
-    if (instr->opinfo) {
-        emit_opcode(lexer->bc, instr->opcode);
+    if (instr->opinfo == NULL)
+        return;
 
-        /* emit the arguments */
 
-        /* note that opinfo->op_count counts all operands plus the op itself;
-         * so substract 1 for the op itself.
+    /* optimize, if possible.
+     * XXX is this a good place to do that?
+     */
+    optimize_instr(lexer, instr);
+
+
+    emit_opcode(lexer->bc, instr->opcode);
+
+    /* emit the arguments */
+
+    /* note that opinfo->op_count counts all operands plus the op itself;
+     * so substract 1 for the op itself.
+     */
+    if (instr->opinfo->op_count > 1) {
+        /* operands are stored in a circular linked list; instr->operands points
+         * to the *last* operand, its next pointer points to the first operand.
          */
-        if (instr->opinfo->op_count > 1) {
-            /* operands are stored in a circular linked list; instr->operands points
-             * to the *last* operand, its next pointer points to the first operand.
-             */
-            operand = instr->operands->next;
-
-            for (i = 0; i < instr->opinfo->op_count - 1; ++i) {
-
-                switch (operand->type) {
-                    case EXPR_CONSTANT:
-                        emit_pbc_const_arg(lexer, operand->expr.c);
-                        break;
-                    case EXPR_TARGET:
-                        emit_pbc_target_arg(lexer, operand->expr.t);
-                        break;
-                    case EXPR_LABEL:
-                        emit_pbc_label_arg(lexer, operand->expr.l);
-                        break;
-                    default:
-                        break;
-                }
+        operand = instr->operands->next;
 
-                operand = operand->next;
-            }
+        do {
+            emit_pbc_expr(lexer, operand);
+            operand = operand->next;
         }
+        while (operand != instr->operands->next);
     }
 
+
 }
 
 
@@ -522,6 +723,11 @@
         iter = iter->next;
     }
     while (iter != sub->statements->next);
+
+    /* XXX why does this not work? */
+    if (TEST_FLAG(sub->flags, PIRC_SUB_FLAG_IMMEDIATE)) {
+        PackFile_fixup_subs(lexer->interp, PBC_IMMEDIATE, NULL);
+    }
 }
 
 /*
@@ -529,8 +735,9 @@
 =item C<void
 emit_pbc(lexer_state * const lexer)>
 
-Generate Parrot Byte Code from the abstract syntax tree. This is the top-level
-function.
+Generate Parrot Byte Code from the abstract syntax tree.
+This is the top-level function. After all instructions
+have been emitted, the PBC is written to a file.
 
 =cut
 
@@ -541,32 +748,30 @@
 
     if (lexer->subs == NULL)
         return;
+/*
+    fprintf(stderr, "emit_pbc(): starting...\n");
+*/
+    create_codesegment(lexer->bc, lexer->codesize);
 
-    lexer->bc = new_bytecode(lexer->interp, lexer->filename,
-                             lexer->codesize * 4, lexer->codesize);
-
+/*
+    fprintf(stderr, "ok 1\n");
+*/
     subiter = lexer->subs->next;
 
+    assert(subiter);
     /* iterate over all instructions and emit them */
     do {
+/*
         fprintf(stderr, "start offset of sub '%s' is: %d\tend offest: %d\n",
-                    subiter->sub_name, subiter->startoffset, subiter->endoffset);
-
-        add_sub_pmc(lexer->bc,
-                    subiter->sub_name,
-                    subiter->nsentry,
-                    subiter->subid,
-                    subiter->vtable_index,
-                    subiter->regs_used,
-                    subiter->startoffset,
-                    subiter->endoffset);
-
+                    subiter->info.subname, subiter->info.startoffset, subiter->info.endoffset);
+*/
         emit_pbc_sub(lexer, subiter);
         subiter = subiter->next;
     }
     while (subiter != lexer->subs->next);
 
     /* write the output to a file. */
+
     write_pbc_file(lexer->bc, "a.pbc");
 
     /* XXX just make sure no seg. faults  happened */

Modified: branches/pdd22io_part3/compilers/pirc/new/piremit.h
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/piremit.h	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/piremit.h	Mon Dec 29 23:28:53 2008
@@ -6,12 +6,16 @@
 #ifndef PARROT_PIR_PIREMIT_H_GUARD
 #define PARROT_PIR_PIREMIT_H_GUARD
 
-struct lexer_state; /* forward declaration */
+/* forward declaration */
+struct lexer_state;
+struct constant;
 
 void print_subs(struct lexer_state * const lexer);
-void emit_pir_subs(struct lexer_state * const lexer);
+void emit_pir_subs(struct lexer_state * const lexer, char const * const outfile);
 void emit_pbc(struct lexer_state * const lexer);
 
+int emit_pbc_const(struct lexer_state * const lexer, struct constant * const pirconst);
+
 #endif /* PARROT_PIR_PIREMIT_H_GUARD */
 
 /*

Modified: branches/pdd22io_part3/compilers/pirc/new/pirlexer.c
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pirlexer.c	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pirlexer.c	Mon Dec 29 23:28:53 2008
@@ -44,18 +44,10 @@
 
 /* A lexical scanner generated by flex */
 
-/* %not-for-header */
-
-/* %if-c-only */
-/* %if-not-reentrant */
-/* %endif */
-/* %endif */
-/* %ok-for-header */
-
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 33
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -64,7 +56,7 @@
 /* %endif */
 
 /* %if-c-only */
-    
+
 /* %endif */
 
 /* %if-c-only */
@@ -93,10 +85,10 @@
 
 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
 
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#if __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
+ * if you want the limit (max/min) macros for int types.
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -113,7 +105,7 @@
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -159,15 +151,14 @@
 /* The "const" storage-class-modifier is valid. */
 #define YY_USE_CONST
 
-#else	/* ! __cplusplus */
+#else   /* ! __cplusplus */
 
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
+#if __STDC__
 
 #define YY_USE_CONST
 
-#endif	/* defined (__STDC__) */
-#endif	/* ! __cplusplus */
+#endif  /* __STDC__ */
+#endif  /* ! __cplusplus */
 
 #ifdef YY_USE_CONST
 #define yyconst const
@@ -210,6 +201,7 @@
 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
 #define yy_flex_debug yyg->yy_flex_debug_r
 
+int yypirlex_init (yyscan_t* scanner);
 /* %endif */
 
 /* %if-not-reentrant */
@@ -264,7 +256,7 @@
 
     /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
      *       access to the local variable yy_act. Since yyless() is a macro, it would break
-     *       existing scanners that call yyless() from OUTSIDE yypirlex. 
+     *       existing scanners that call yyless() from OUTSIDE yypirlex.
      *       One obvious solution it to make yy_act a global. I tried that, and saw
      *       a 5% performance hit in a non-yylineno scanner, because yy_act is
      *       normally declared as a register variable-- so it is not worth it.
@@ -276,96 +268,101 @@
                     if ( yytext[yyl] == '\n' )\
                         --yylineno;\
             }while(0)
-    
+
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
+    do \
+        { \
+        /* Undo effects of setting up yytext. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-		*yy_cp = yyg->yy_hold_char; \
-		YY_RESTORE_YY_MORE_OFFSET \
-		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-		} \
-	while ( 0 )
+        *yy_cp = yyg->yy_hold_char; \
+        YY_RESTORE_YY_MORE_OFFSET \
+        yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+        YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+        } \
+    while ( 0 )
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+
 #ifndef YY_TYPEDEF_YY_SIZE_T
 #define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
+typedef unsigned int yy_size_t;
 #endif
 
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
-	{
+    {
 /* %if-c-only */
-	FILE *yy_input_file;
+    FILE *yy_input_file;
 /* %endif */
 
 /* %if-c++-only */
 /* %endif */
 
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
+    char *yy_ch_buf;        /* input buffer */
+    char *yy_buf_pos;       /* current position in input buffer */
+
+    /* Size of input buffer in bytes, not including room for EOB
+     * characters.
+     */
+    yy_size_t yy_buf_size;
+
+    /* Number of characters read into yy_ch_buf, not including EOB
+     * characters.
+     */
+    int yy_n_chars;
 
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	int yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
+    /* Whether we "own" the buffer - i.e., we know we created it,
+     * and can realloc() it to grow it, and should free() it to
+     * delete it.
+     */
+    int yy_is_our_buffer;
+
+    /* Whether this is an "interactive" input source; if so, and
+     * if we're using stdio for input, then we want to use getc()
+     * instead of fread(), to make sure we stop fetching input after
+     * each newline.
+     */
+    int yy_is_interactive;
+
+    /* Whether we're considered to be at the beginning of a line.
+     * If so, '^' rules will be active on the next match, otherwise
+     * not.
+     */
+    int yy_at_bol;
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
 
-	int yy_buffer_status;
+    /* Whether to try to fill the input buffer when we reach the
+     * end of it.
+     */
+    int yy_fill_buffer;
+
+    int yy_buffer_status;
 
 #define YY_BUFFER_NEW 0
 #define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via yypirrestart()), so that the user can continue scanning by
-	 * just pointing yyin at a new input file.
-	 */
+    /* When an EOF's been seen but there's still some text to process
+     * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+     * shouldn't try reading from the input source any more.  We might
+     * still have a bunch of tokens to match, though, because of
+     * possible backing-up.
+     *
+     * When we actually see the EOF, we change the status to "new"
+     * (via yypirrestart()), so that the user can continue scanning by
+     * just pointing yyin at a new input file.
+     */
 #define YY_BUFFER_EOF_PENDING 2
 
-	};
+    };
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
 /* %if-c-only Standard (non-C++) definition */
@@ -428,24 +425,24 @@
 #define yy_new_buffer yypir_create_buffer
 
 #define yy_set_interactive(is_interactive) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){ \
+    { \
+    if ( ! YY_CURRENT_BUFFER ){ \
         yypirensure_buffer_stack (yyscanner); \
-		YY_CURRENT_BUFFER_LVALUE =    \
+        YY_CURRENT_BUFFER_LVALUE =    \
             yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-	}
+    } \
+    YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+    }
 
 #define yy_set_bol(at_bol) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){\
+    { \
+    if ( ! YY_CURRENT_BUFFER ){\
         yypirensure_buffer_stack (yyscanner); \
-		YY_CURRENT_BUFFER_LVALUE =    \
+        YY_CURRENT_BUFFER_LVALUE =    \
             yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-	}
+    } \
+    YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+    }
 
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
@@ -476,13 +473,13 @@
  * corresponding action - sets up yytext.
  */
 #define YY_DO_BEFORE_ACTION \
-	yyg->yytext_ptr = yy_bp; \
+    yyg->yytext_ptr = yy_bp; \
 /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
-	yyleng = (size_t) (yy_cp - yy_bp); \
-	yyg->yy_hold_char = *yy_cp; \
-	*yy_cp = '\0'; \
+    yyleng = (size_t) (yy_cp - yy_bp); \
+    yyg->yy_hold_char = *yy_cp; \
+    *yy_cp = '\0'; \
 /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
-	yyg->yy_c_buf_p = yy_cp;
+    yyg->yy_c_buf_p = yy_cp;
 
 /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
 #define YY_NUM_RULES 204
@@ -490,10 +487,10 @@
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
-	{
-	flex_int32_t yy_verify;
-	flex_int32_t yy_nxt;
-	};
+    {
+    flex_int32_t yy_verify;
+    flex_int32_t yy_nxt;
+    };
 static yyconst flex_int16_t yy_accept[803] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -1314,16 +1311,16 @@
 /* Table of booleans, true if rule could match eol. */
 static yyconst flex_int32_t yy_rule_can_match_eol[205] =
     {   0,
-1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 1, 0, 0,     };
 
 static yyconst flex_int16_t yy_rule_linenum[204] =
@@ -1340,17 +1337,17 @@
       356,  357,  358,  359,  360,  361,  362,  363,  364,  365,
 
       366,  368,  369,  370,  371,  372,  373,  374,  377,  382,
-      383,  384,  385,  387,  392,  404,  409,  410,  411,  412,
-      413,  415,  467,  480,  502,  507,  512,  519,  520,  535,
-      540,  541,  546,  547,  548,  550,  566,  620,  648,  653,
-      658,  659,  660,  661,  666,  677,  678,  680,  682,  693,
-      707,  712,  713,  714,  715,  717,  732,  746,  775,  800,
-      802,  807,  817,  822,  840,  846,  853,  886,  888,  893,
-      929,  930,  931,  933,  934,  935,  936,  937,  938,  940,
-      941,  942,  944,  949,  954,  955,  958,  992,  997, 1000,
-     1001, 1002, 1003, 1005, 1010, 1011, 1012, 1013, 1014, 1016,
+      383,  384,  385,  387,  392,  404,  419,  420,  421,  422,
+      423,  425,  477,  490,  512,  517,  522,  529,  530,  545,
+      550,  551,  556,  557,  558,  560,  576,  630,  658,  663,
+      668,  669,  670,  671,  676,  687,  688,  690,  692,  703,
+      717,  722,  723,  724,  725,  727,  742,  756,  785,  810,
+      812,  817,  827,  832,  850,  856,  863,  896,  898,  903,
+      939,  940,  941,  943,  944,  945,  946,  947,  948,  950,
+      951,  952,  954,  959,  964,  965,  968, 1002, 1007, 1010,
+     1011, 1012, 1013, 1015, 1020, 1021, 1022, 1023, 1024, 1026,
 
-     1021, 1023, 1025
+     1031, 1033, 1035
     } ;
 
 /* The intent behind this definition is that it'll catch
@@ -1468,7 +1465,7 @@
 
 /* The PASM state is an exclusive state, recognizing ONLY PASM tokens. */
 
-#line 1472 "pirlexer.c"
+#line 1469 "pirlexer.c"
 
 #define INITIAL 0
 #define MACROHEAD 1
@@ -1549,15 +1546,9 @@
     /* This must go here because YYSTYPE and YYLTYPE are included
      * from bison output in section 1.*/
     #    define yylval yyg->yylval_r
-    
-int yypirlex_init (yyscan_t* scanner);
-
-int yypirlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
 
 /* %endif */
 
-/* %endif End reentrant structures and macros. */
-
 /* Accessor methods to globals.
    These are made visible to non-reentrant scanners for convenience. */
 
@@ -1594,6 +1585,7 @@
 void yypirset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
 
 /* %endif */
+/* %endif End reentrant structures and macros. */
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -1638,11 +1630,11 @@
 /* %if-c-only */
 
     static void yy_push_state (int new_state ,yyscan_t yyscanner);
-    
+
     static void yy_pop_state (yyscan_t yyscanner );
-    
+
     static int yy_top_state (yyscan_t yyscanner );
-    
+
 /* %endif */
 
 /* Amount of stuff to slurp up with each read. */
@@ -1656,7 +1648,7 @@
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
 /* %endif */
 /* %if-c++-only C++ definition */
 /* %endif */
@@ -1668,33 +1660,33 @@
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
 /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-		{ \
-		int c = '*'; \
-		int n; \
-		for ( n = 0; n < max_size && \
-			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
-			buf[n] = (char) c; \
-		if ( c == '\n' ) \
-			buf[n++] = (char) c; \
-		if ( c == EOF && ferror( yyin ) ) \
-			YY_FATAL_ERROR( "input in flex scanner failed" ); \
-		result = n; \
-		} \
-	else \
-		{ \
-		errno=0; \
-		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
-			{ \
-			if( errno != EINTR) \
-				{ \
-				YY_FATAL_ERROR( "input in flex scanner failed" ); \
-				break; \
-				} \
-			errno=0; \
-			clearerr(yyin); \
-			} \
-		}\
+    if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+        { \
+        int c = '*'; \
+        size_t n; \
+        for ( n = 0; n < max_size && \
+                 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+            buf[n] = (char) c; \
+        if ( c == '\n' ) \
+            buf[n++] = (char) c; \
+        if ( c == EOF && ferror( yyin ) ) \
+            YY_FATAL_ERROR( "input in flex scanner failed" ); \
+        result = n; \
+        } \
+    else \
+        { \
+        errno=0; \
+        while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+            { \
+            if( errno != EINTR) \
+                { \
+                YY_FATAL_ERROR( "input in flex scanner failed" ); \
+                break; \
+                } \
+            errno=0; \
+            clearerr(yyin); \
+            } \
+        }\
 \
 /* %if-c++-only C++ definition \ */\
 /* %endif */
@@ -1743,11 +1735,9 @@
 #define YY_DECL_IS_OURS 1
 /* %if-c-only Standard (non-C++) definition */
 
-extern int yypirlex \
-               (YYSTYPE * yylval_param ,yyscan_t yyscanner);
+extern int yypirlex (YYSTYPE * yylval_param ,yyscan_t yyscanner);
 
-#define YY_DECL int yypirlex \
-               (YYSTYPE * yylval_param , yyscan_t yyscanner)
+#define YY_DECL int yypirlex (YYSTYPE * yylval_param , yyscan_t yyscanner)
 /* %endif */
 /* %if-c++-only C++ definition */
 /* %endif */
@@ -1767,7 +1757,7 @@
 
 /* %% [6.0] YY_RULE_SETUP definition goes here */
 #define YY_RULE_SETUP \
-	YY_USER_ACTION
+    YY_USER_ACTION
 
 /* %not-for-header */
 
@@ -1775,9 +1765,9 @@
  */
 YY_DECL
 {
-	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
-	register int yy_act;
+    register yy_state_type yy_current_state;
+    register char *yy_cp, *yy_bp;
+    register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
 /* %% [7.0] user's declarations go here */
@@ -1785,129 +1775,129 @@
 
 
 
-#line 1789 "pirlexer.c"
+#line 1779 "pirlexer.c"
 
     yylval = yylval_param;
 
-	if ( !yyg->yy_init )
-		{
-		yyg->yy_init = 1;
+    if ( !yyg->yy_init )
+        {
+        yyg->yy_init = 1;
 
 #ifdef YY_USER_INIT
-		YY_USER_INIT;
+        YY_USER_INIT;
 #endif
 
-		if ( ! yyg->yy_start )
-			yyg->yy_start = 1;	/* first start state */
+        if ( ! yyg->yy_start )
+            yyg->yy_start = 1;  /* first start state */
 
-		if ( ! yyin )
+        if ( ! yyin )
 /* %if-c-only */
-			yyin = stdin;
+            yyin = stdin;
 /* %endif */
 /* %if-c++-only */
 /* %endif */
 
-		if ( ! yyout )
+        if ( ! yyout )
 /* %if-c-only */
-			yyout = stdout;
+            yyout = stdout;
 /* %endif */
 /* %if-c++-only */
 /* %endif */
 
-		if ( ! YY_CURRENT_BUFFER ) {
-			yypirensure_buffer_stack (yyscanner);
-			YY_CURRENT_BUFFER_LVALUE =
-				yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
-		}
+        if ( ! YY_CURRENT_BUFFER ) {
+            yypirensure_buffer_stack (yyscanner);
+            YY_CURRENT_BUFFER_LVALUE =
+                yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+        }
 
-		yypir_load_buffer_state(yyscanner );
-		}
+        yypir_load_buffer_state(yyscanner );
+        }
 
-	while ( 1 )		/* loops until end-of-file is reached */
-		{
+    while ( 1 )     /* loops until end-of-file is reached */
+        {
 /* %% [8.0] yymore()-related code goes here */
-		yy_cp = yyg->yy_c_buf_p;
+        yy_cp = yyg->yy_c_buf_p;
 
-		/* Support of yytext. */
-		*yy_cp = yyg->yy_hold_char;
+        /* Support of yytext. */
+        *yy_cp = yyg->yy_hold_char;
 
-		/* yy_bp points to the position in yy_ch_buf of the start of
-		 * the current run.
-		 */
-		yy_bp = yy_cp;
+        /* yy_bp points to the position in yy_ch_buf of the start of
+         * the current run.
+         */
+        yy_bp = yy_cp;
 
 /* %% [9.0] code to set up and find next match goes here */
-		yy_current_state = yyg->yy_start;
+        yy_current_state = yyg->yy_start;
 yy_match:
-		do
-			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-			if ( yy_accept[yy_current_state] )
-				{
-				yyg->yy_last_accepting_state = yy_current_state;
-				yyg->yy_last_accepting_cpos = yy_cp;
-				}
-			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-				{
-				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 803 )
-					yy_c = yy_meta[(unsigned int) yy_c];
-				}
-			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-			++yy_cp;
-			}
-		while ( yy_current_state != 802 );
-		yy_cp = yyg->yy_last_accepting_cpos;
-		yy_current_state = yyg->yy_last_accepting_state;
+        do
+            {
+            register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+            if ( yy_accept[yy_current_state] )
+                {
+                yyg->yy_last_accepting_state = yy_current_state;
+                yyg->yy_last_accepting_cpos = yy_cp;
+                }
+            while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+                {
+                yy_current_state = (int) yy_def[yy_current_state];
+                if ( yy_current_state >= 803 )
+                    yy_c = yy_meta[(unsigned int) yy_c];
+                }
+            yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+            ++yy_cp;
+            }
+        while ( yy_current_state != 802 );
+        yy_cp = yyg->yy_last_accepting_cpos;
+        yy_current_state = yyg->yy_last_accepting_state;
 
 yy_find_action:
 /* %% [10.0] code to find the action number goes here */
-		yy_act = yy_accept[yy_current_state];
+        yy_act = yy_accept[yy_current_state];
 
-		YY_DO_BEFORE_ACTION;
+        YY_DO_BEFORE_ACTION;
 
 /* %% [11.0] code for yylineno update goes here */
 
-		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
-			{
-			int yyl;
-			for ( yyl = 0; yyl < yyleng; ++yyl )
-				if ( yytext[yyl] == '\n' )
-					   
+        if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+            {
+            int yyl;
+            for ( yyl = 0; yyl < yyleng; ++yyl )
+                if ( yytext[yyl] == '\n' )
+
     do{ yylineno++;
         yycolumn=0;
     }while(0)
 ;
-			}
+            }
 
-do_action:	/* This label is used only to access EOF actions. */
+do_action:  /* This label is used only to access EOF actions. */
 
 /* %% [12.0] debug code goes here */
-		if ( yy_flex_debug )
-			{
-			if ( yy_act == 0 )
-				fprintf( stderr, "--scanner backing up\n" );
-			else if ( yy_act < 204 )
-				fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
-				         (long)yy_rule_linenum[yy_act], yytext );
-			else if ( yy_act == 204 )
-				fprintf( stderr, "--accepting default rule (\"%s\")\n",
-				         yytext );
-			else if ( yy_act == 205 )
-				fprintf( stderr, "--(end of buffer or a NUL)\n" );
-			else
-				fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
-			}
+        if ( yy_flex_debug )
+            {
+            if ( yy_act == 0 )
+                fprintf( stderr, "--scanner backing up\n" );
+            else if ( yy_act < 204 )
+                fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
+                         (long)yy_rule_linenum[yy_act], yytext );
+            else if ( yy_act == 204 )
+                fprintf( stderr, "--accepting default rule (\"%s\")\n",
+                         yytext );
+            else if ( yy_act == 205 )
+                fprintf( stderr, "--(end of buffer or a NUL)\n" );
+            else
+                fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
+            }
 
-		switch ( yy_act )
-	{ /* beginning of action switch */
+        switch ( yy_act )
+    { /* beginning of action switch */
 /* %% [13.0] actions go here */
-			case 0: /* must back up */
-			/* undo the effects of YY_DO_BEFORE_ACTION */
-			*yy_cp = yyg->yy_hold_char;
-			yy_cp = yyg->yy_last_accepting_cpos;
-			yy_current_state = yyg->yy_last_accepting_state;
-			goto yy_find_action;
+            case 0: /* must back up */
+            /* undo the effects of YY_DO_BEFORE_ACTION */
+            *yy_cp = yyg->yy_hold_char;
+            yy_cp = yyg->yy_last_accepting_cpos;
+            yy_current_state = yyg->yy_last_accepting_state;
+            goto yy_find_action;
 
 case 1:
 /* rule 1 can match eol */
@@ -1934,18 +1924,18 @@
                         }
 
                       }
-	YY_BREAK
+    YY_BREAK
 case 2:
 YY_RULE_SETUP
 #line 240 "pir.l"
 { /* ignore whitespace */ }
-	YY_BREAK
+    YY_BREAK
 case 3:
 /* rule 3 can match eol */
 YY_RULE_SETUP
 #line 242 "pir.l"
 { /* ignore line comments */ }
-	YY_BREAK
+    YY_BREAK
 case 4:
 /* rule 4 can match eol */
 YY_RULE_SETUP
@@ -1954,419 +1944,419 @@
                     yylval->sval = "\n";
                     return TK_NL;
                   }
-	YY_BREAK
+    YY_BREAK
 case 5:
 YY_RULE_SETUP
 #line 249 "pir.l"
 { return TK_ASSIGN_USHIFT; }
-	YY_BREAK
+    YY_BREAK
 case 6:
 YY_RULE_SETUP
 #line 250 "pir.l"
 { return TK_USHIFT; }
-	YY_BREAK
+    YY_BREAK
 case 7:
 YY_RULE_SETUP
 #line 251 "pir.l"
 { return TK_ASSIGN_RSHIFT; }
-	YY_BREAK
+    YY_BREAK
 case 8:
 YY_RULE_SETUP
 #line 252 "pir.l"
 { return TK_RSHIFT; }
-	YY_BREAK
+    YY_BREAK
 case 9:
 YY_RULE_SETUP
 #line 253 "pir.l"
 { return TK_LSHIFT; }
-	YY_BREAK
+    YY_BREAK
 case 10:
 YY_RULE_SETUP
 #line 254 "pir.l"
 { return TK_ARROW; }
-	YY_BREAK
+    YY_BREAK
 case 11:
 YY_RULE_SETUP
 #line 255 "pir.l"
 { return TK_EQ; }
-	YY_BREAK
+    YY_BREAK
 case 12:
 YY_RULE_SETUP
 #line 256 "pir.l"
 { return TK_NE; }
-	YY_BREAK
+    YY_BREAK
 case 13:
 YY_RULE_SETUP
 #line 257 "pir.l"
 { return TK_LE; }
-	YY_BREAK
+    YY_BREAK
 case 14:
 YY_RULE_SETUP
 #line 258 "pir.l"
 { return TK_GE; }
-	YY_BREAK
+    YY_BREAK
 case 15:
 YY_RULE_SETUP
 #line 259 "pir.l"
 { return TK_LT; }
-	YY_BREAK
+    YY_BREAK
 case 16:
 YY_RULE_SETUP
 #line 260 "pir.l"
 { return TK_GT; }
-	YY_BREAK
+    YY_BREAK
 case 17:
 YY_RULE_SETUP
 #line 262 "pir.l"
 { return TK_FDIV; }
-	YY_BREAK
+    YY_BREAK
 case 18:
 YY_RULE_SETUP
 #line 263 "pir.l"
 { return TK_AND; }
-	YY_BREAK
+    YY_BREAK
 case 19:
 YY_RULE_SETUP
 #line 264 "pir.l"
 { return TK_OR; }
-	YY_BREAK
+    YY_BREAK
 case 20:
 YY_RULE_SETUP
 #line 265 "pir.l"
 { return TK_XOR; }
-	YY_BREAK
+    YY_BREAK
 case 21:
 YY_RULE_SETUP
 #line 267 "pir.l"
 { return '+'; }
-	YY_BREAK
+    YY_BREAK
 case 22:
 YY_RULE_SETUP
 #line 268 "pir.l"
 { return '%'; }
-	YY_BREAK
+    YY_BREAK
 case 23:
 YY_RULE_SETUP
 #line 269 "pir.l"
 { return '*'; }
-	YY_BREAK
+    YY_BREAK
 case 24:
 YY_RULE_SETUP
 #line 270 "pir.l"
 { return '/'; }
-	YY_BREAK
+    YY_BREAK
 case 25:
 YY_RULE_SETUP
 #line 271 "pir.l"
 { return '!'; }
-	YY_BREAK
+    YY_BREAK
 case 26:
 YY_RULE_SETUP
 #line 272 "pir.l"
 { return '~'; }
-	YY_BREAK
+    YY_BREAK
 case 27:
 YY_RULE_SETUP
 #line 273 "pir.l"
 { return '-'; }
-	YY_BREAK
+    YY_BREAK
 case 28:
 YY_RULE_SETUP
 #line 274 "pir.l"
 { return '('; }
-	YY_BREAK
+    YY_BREAK
 case 29:
 YY_RULE_SETUP
 #line 275 "pir.l"
 { return ')'; }
-	YY_BREAK
+    YY_BREAK
 case 30:
 YY_RULE_SETUP
 #line 276 "pir.l"
 { return ','; }
-	YY_BREAK
+    YY_BREAK
 case 31:
 YY_RULE_SETUP
 #line 277 "pir.l"
 { return '['; }
-	YY_BREAK
+    YY_BREAK
 case 32:
 YY_RULE_SETUP
 #line 278 "pir.l"
 { return ']'; }
-	YY_BREAK
+    YY_BREAK
 case 33:
 YY_RULE_SETUP
 #line 280 "pir.l"
 { /* if the dot is surrounded by whitespace, it's a concatenation operator */
                     return TK_CONC;
                   }
-	YY_BREAK
+    YY_BREAK
 case 34:
 YY_RULE_SETUP
 #line 285 "pir.l"
 { return '='; }
-	YY_BREAK
+    YY_BREAK
 case 35:
 YY_RULE_SETUP
 #line 286 "pir.l"
 { return ';'; }
-	YY_BREAK
+    YY_BREAK
 case 36:
 YY_RULE_SETUP
 #line 288 "pir.l"
 { return TK_ASSIGN_INC; }
-	YY_BREAK
+    YY_BREAK
 case 37:
 YY_RULE_SETUP
 #line 289 "pir.l"
 { return TK_ASSIGN_DEC; }
-	YY_BREAK
+    YY_BREAK
 case 38:
 YY_RULE_SETUP
 #line 290 "pir.l"
 { return TK_ASSIGN_DIV; }
-	YY_BREAK
+    YY_BREAK
 case 39:
 YY_RULE_SETUP
 #line 291 "pir.l"
 { return TK_ASSIGN_MUL; }
-	YY_BREAK
+    YY_BREAK
 case 40:
 YY_RULE_SETUP
 #line 292 "pir.l"
 { return TK_ASSIGN_MOD; }
-	YY_BREAK
+    YY_BREAK
 case 41:
 YY_RULE_SETUP
 #line 293 "pir.l"
 { return TK_ASSIGN_POW; }
-	YY_BREAK
+    YY_BREAK
 case 42:
 YY_RULE_SETUP
 #line 294 "pir.l"
 { return TK_ASSIGN_BOR; }
-	YY_BREAK
+    YY_BREAK
 case 43:
 YY_RULE_SETUP
 #line 295 "pir.l"
 { return TK_ASSIGN_BAND; }
-	YY_BREAK
+    YY_BREAK
 case 44:
 YY_RULE_SETUP
 #line 296 "pir.l"
 { return TK_ASSIGN_FDIV; }
-	YY_BREAK
+    YY_BREAK
 case 45:
 YY_RULE_SETUP
 #line 297 "pir.l"
 { return TK_ASSIGN_BNOT; }
-	YY_BREAK
+    YY_BREAK
 case 46:
 YY_RULE_SETUP
 #line 298 "pir.l"
 { return TK_ASSIGN_CONC; }
-	YY_BREAK
+    YY_BREAK
 case 47:
 YY_RULE_SETUP
 #line 300 "pir.l"
 { return TK_IF; }
-	YY_BREAK
+    YY_BREAK
 case 48:
 YY_RULE_SETUP
 #line 301 "pir.l"
 { return TK_GOTO; }
-	YY_BREAK
+    YY_BREAK
 case 49:
 YY_RULE_SETUP
 #line 302 "pir.l"
 { return TK_UNLESS; }
-	YY_BREAK
+    YY_BREAK
 case 50:
 YY_RULE_SETUP
 #line 303 "pir.l"
 { return TK_NULL; }
-	YY_BREAK
+    YY_BREAK
 case 51:
 YY_RULE_SETUP
 #line 305 "pir.l"
 { return TK_INT; }
-	YY_BREAK
+    YY_BREAK
 case 52:
 YY_RULE_SETUP
 #line 306 "pir.l"
 { return TK_NUM; }
-	YY_BREAK
+    YY_BREAK
 case 53:
 YY_RULE_SETUP
 #line 307 "pir.l"
 { return TK_PMC; }
-	YY_BREAK
+    YY_BREAK
 case 54:
 YY_RULE_SETUP
 #line 308 "pir.l"
 { return TK_STRING; }
-	YY_BREAK
+    YY_BREAK
 case 55:
 YY_RULE_SETUP
 #line 310 "pir.l"
 { return TK_ANNOTATE; }
-	YY_BREAK
+    YY_BREAK
 case 56:
 YY_RULE_SETUP
 #line 311 "pir.l"
 { return TK_SET_ARG; }
-	YY_BREAK
+    YY_BREAK
 case 57:
 YY_RULE_SETUP
 #line 312 "pir.l"
 { return TK_CONST; }
-	YY_BREAK
+    YY_BREAK
 case 58:
 YY_RULE_SETUP
 #line 313 "pir.l"
 { return TK_END; }
-	YY_BREAK
+    YY_BREAK
 case 59:
 YY_RULE_SETUP
 #line 314 "pir.l"
 { return TK_FILE; }
-	YY_BREAK
+    YY_BREAK
 case 60:
 YY_RULE_SETUP
 #line 316 "pir.l"
 { return TK_GET_RESULTS; }
-	YY_BREAK
+    YY_BREAK
 case 61:
 YY_RULE_SETUP
 #line 317 "pir.l"
 { return TK_GLOBALCONST; }
-	YY_BREAK
+    YY_BREAK
 case 62:
 YY_RULE_SETUP
 #line 318 "pir.l"
 { return TK_HLL; }
-	YY_BREAK
+    YY_BREAK
 case 63:
 YY_RULE_SETUP
 #line 319 "pir.l"
 { return TK_HLL_MAP; }
-	YY_BREAK
+    YY_BREAK
 case 64:
 YY_RULE_SETUP
 #line 320 "pir.l"
 { return TK_INVOCANT; }
-	YY_BREAK
+    YY_BREAK
 case 65:
 YY_RULE_SETUP
 #line 321 "pir.l"
 { return TK_LEX; }
-	YY_BREAK
+    YY_BREAK
 case 66:
 YY_RULE_SETUP
 #line 322 "pir.l"
 { return TK_LINE; }
-	YY_BREAK
+    YY_BREAK
 case 67:
 YY_RULE_SETUP
 #line 323 "pir.l"
 { return TK_LOADLIB; }
-	YY_BREAK
+    YY_BREAK
 case 68:
 YY_RULE_SETUP
 #line 324 "pir.l"
 { return TK_LOCAL; }
-	YY_BREAK
+    YY_BREAK
 case 69:
 YY_RULE_SETUP
 #line 326 "pir.l"
 { return TK_METH_CALL; }
-	YY_BREAK
+    YY_BREAK
 case 70:
 YY_RULE_SETUP
 #line 327 "pir.l"
 { return TK_NAMESPACE; }
-	YY_BREAK
+    YY_BREAK
 case 71:
 YY_RULE_SETUP
 #line 328 "pir.l"
 { return TK_NCI_CALL; }
-	YY_BREAK
+    YY_BREAK
 case 72:
 YY_RULE_SETUP
 #line 329 "pir.l"
 { return TK_PARAM; }
-	YY_BREAK
+    YY_BREAK
 case 73:
 YY_RULE_SETUP
 #line 330 "pir.l"
 { return TK_BEGIN_CALL; }
-	YY_BREAK
+    YY_BREAK
 case 74:
 YY_RULE_SETUP
 #line 331 "pir.l"
 { return TK_BEGIN_RETURN; }
-	YY_BREAK
+    YY_BREAK
 case 75:
 YY_RULE_SETUP
 #line 332 "pir.l"
 { return TK_BEGIN_YIELD; }
-	YY_BREAK
+    YY_BREAK
 case 76:
 YY_RULE_SETUP
 #line 333 "pir.l"
 { return TK_CALL; }
-	YY_BREAK
+    YY_BREAK
 case 77:
 YY_RULE_SETUP
 #line 334 "pir.l"
 { return TK_END_CALL; }
-	YY_BREAK
+    YY_BREAK
 case 78:
 YY_RULE_SETUP
 #line 335 "pir.l"
 { return TK_END_RETURN; }
-	YY_BREAK
+    YY_BREAK
 case 79:
 YY_RULE_SETUP
 #line 336 "pir.l"
 { return TK_END_YIELD; }
-	YY_BREAK
+    YY_BREAK
 case 80:
 YY_RULE_SETUP
 #line 337 "pir.l"
 { return TK_GET_RESULT; }
-	YY_BREAK
+    YY_BREAK
 case 81:
 YY_RULE_SETUP
 #line 338 "pir.l"
 { return TK_RETURN; }
-	YY_BREAK
+    YY_BREAK
 case 82:
 YY_RULE_SETUP
 #line 339 "pir.l"
 { return TK_SUB; }
-	YY_BREAK
+    YY_BREAK
 case 83:
 YY_RULE_SETUP
 #line 340 "pir.l"
 { return TK_YIELD; }
-	YY_BREAK
+    YY_BREAK
 case 84:
 YY_RULE_SETUP
 #line 341 "pir.l"
 { return TK_SET_RETURN; }
-	YY_BREAK
+    YY_BREAK
 case 85:
 YY_RULE_SETUP
 #line 342 "pir.l"
 { return TK_SET_YIELD; }
-	YY_BREAK
+    YY_BREAK
 case 86:
 YY_RULE_SETUP
 #line 343 "pir.l"
 { return TK_TAILCALL; }
-	YY_BREAK
+    YY_BREAK
 case 87:
 YY_RULE_SETUP
 #line 346 "pir.l"
@@ -2374,112 +2364,112 @@
                     yypirerror(yyscanner, yypirget_extra(yyscanner),
                                "cannot use '%s' outside of macro definitions", yytext);
                   }
-	YY_BREAK
+    YY_BREAK
 case 88:
 YY_RULE_SETUP
 #line 353 "pir.l"
 { return TK_FLAG_ANON; }
-	YY_BREAK
+    YY_BREAK
 case 89:
 YY_RULE_SETUP
 #line 354 "pir.l"
 { return TK_FLAG_INIT; }
-	YY_BREAK
+    YY_BREAK
 case 90:
 YY_RULE_SETUP
 #line 355 "pir.l"
 { return TK_FLAG_LOAD; }
-	YY_BREAK
+    YY_BREAK
 case 91:
 YY_RULE_SETUP
 #line 356 "pir.l"
 { return TK_FLAG_POSTCOMP; }
-	YY_BREAK
+    YY_BREAK
 case 92:
 YY_RULE_SETUP
 #line 357 "pir.l"
 { return TK_FLAG_IMMEDIATE; }
-	YY_BREAK
+    YY_BREAK
 case 93:
 YY_RULE_SETUP
 #line 358 "pir.l"
 { return TK_FLAG_MAIN; }
-	YY_BREAK
+    YY_BREAK
 case 94:
 YY_RULE_SETUP
 #line 359 "pir.l"
 { return TK_FLAG_METHOD; }
-	YY_BREAK
+    YY_BREAK
 case 95:
 YY_RULE_SETUP
 #line 360 "pir.l"
 { return TK_FLAG_LEX; }
-	YY_BREAK
+    YY_BREAK
 case 96:
 YY_RULE_SETUP
 #line 361 "pir.l"
 { return TK_FLAG_OUTER; }
-	YY_BREAK
+    YY_BREAK
 case 97:
 YY_RULE_SETUP
 #line 362 "pir.l"
 { return TK_FLAG_VTABLE; }
-	YY_BREAK
+    YY_BREAK
 case 98:
 YY_RULE_SETUP
 #line 363 "pir.l"
 { return TK_FLAG_MULTI; }
-	YY_BREAK
+    YY_BREAK
 case 99:
 YY_RULE_SETUP
 #line 364 "pir.l"
 { return TK_FLAG_SUBID; }
-	YY_BREAK
+    YY_BREAK
 case 100:
 YY_RULE_SETUP
 #line 365 "pir.l"
 { return TK_FLAG_INSTANCEOF; }
-	YY_BREAK
+    YY_BREAK
 case 101:
 YY_RULE_SETUP
 #line 366 "pir.l"
 { return TK_FLAG_NSENTRY; }
-	YY_BREAK
+    YY_BREAK
 case 102:
 YY_RULE_SETUP
 #line 368 "pir.l"
 { return TK_FLAG_UNIQUE_REG; }
-	YY_BREAK
+    YY_BREAK
 case 103:
 YY_RULE_SETUP
 #line 369 "pir.l"
 { return TK_FLAG_OPTIONAL; }
-	YY_BREAK
+    YY_BREAK
 case 104:
 YY_RULE_SETUP
 #line 370 "pir.l"
 { return TK_FLAG_OPT_FLAG; }
-	YY_BREAK
+    YY_BREAK
 case 105:
 YY_RULE_SETUP
 #line 371 "pir.l"
 { return TK_FLAG_SLURPY; }
-	YY_BREAK
+    YY_BREAK
 case 106:
 YY_RULE_SETUP
 #line 372 "pir.l"
 { return TK_FLAG_NAMED; }
-	YY_BREAK
+    YY_BREAK
 case 107:
 YY_RULE_SETUP
 #line 373 "pir.l"
 { return TK_FLAG_FLAT; }
-	YY_BREAK
+    YY_BREAK
 case 108:
 YY_RULE_SETUP
 #line 374 "pir.l"
 { return TK_FLAG_INVOCANT; }
-	YY_BREAK
+    YY_BREAK
 case 109:
 YY_RULE_SETUP
 #line 377 "pir.l"
@@ -2487,27 +2477,27 @@
                     yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext + 1, yyleng - 2);
                     return TK_STRINGC;
                   }
-	YY_BREAK
+    YY_BREAK
 case 110:
 YY_RULE_SETUP
 #line 382 "pir.l"
 { yylval->ival = atoi(yytext + 2); return TK_PREG; }
-	YY_BREAK
+    YY_BREAK
 case 111:
 YY_RULE_SETUP
 #line 383 "pir.l"
 { yylval->ival = atoi(yytext + 2); return TK_SREG; }
-	YY_BREAK
+    YY_BREAK
 case 112:
 YY_RULE_SETUP
 #line 384 "pir.l"
 { yylval->ival = atoi(yytext + 2); return TK_NREG; }
-	YY_BREAK
+    YY_BREAK
 case 113:
 YY_RULE_SETUP
 #line 385 "pir.l"
 { yylval->ival = atoi(yytext + 2); return TK_IREG; }
-	YY_BREAK
+    YY_BREAK
 case 114:
 YY_RULE_SETUP
 #line 387 "pir.l"
@@ -2515,7 +2505,7 @@
                     yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
                     return TK_LABEL;
                   }
-	YY_BREAK
+    YY_BREAK
 case 115:
 YY_RULE_SETUP
 #line 392 "pir.l"
@@ -2530,49 +2520,59 @@
                     yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                     return TK_IDENT;
                   }
-	YY_BREAK
+    YY_BREAK
 case 116:
 YY_RULE_SETUP
 #line 404 "pir.l"
 { /* identifier; can be a global (sub or const), local or parrot op */
-                    yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
-                    return TK_IDENT;
+                    lexer_state * const lexer = yypirget_extra(yyscanner);
+                    constant *c = find_global_constant(lexer, yytext);
+
+                    /* XXX bleh. this is expensive; an const lookup for each identifier */
+                    if (c) {
+                        yylval->cval = c;
+                        return TK_CONST_VALUE;
+                    }
+                    else {
+                        yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
+                        return TK_IDENT;
+                    }
                   }
-	YY_BREAK
+    YY_BREAK
 case 117:
 YY_RULE_SETUP
-#line 409 "pir.l"
+#line 419 "pir.l"
 { yylval->dval = atof(yytext); return TK_NUMC; }
-	YY_BREAK
+    YY_BREAK
 case 118:
 YY_RULE_SETUP
-#line 410 "pir.l"
+#line 420 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-	YY_BREAK
+    YY_BREAK
 case 119:
 YY_RULE_SETUP
-#line 411 "pir.l"
+#line 421 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-	YY_BREAK
+    YY_BREAK
 case 120:
 YY_RULE_SETUP
-#line 412 "pir.l"
+#line 422 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-	YY_BREAK
+    YY_BREAK
 case 121:
 YY_RULE_SETUP
-#line 413 "pir.l"
+#line 423 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-	YY_BREAK
+    YY_BREAK
 case 122:
 YY_RULE_SETUP
-#line 415 "pir.l"
+#line 425 "pir.l"
 { /* XXX some work to be done to disallow $P0 . foo()
                      * spaces should not be allowed.
                      */
                      return '.';
                   }
-	YY_BREAK
+    YY_BREAK
 
 
 /* SCANSTR<<EOF>> and SCANMACRO<<EOF>> must be defined before <INTIAL><<EOF>>,
@@ -2589,15 +2589,15 @@
 
 
 case YY_STATE_EOF(SCANSTR):
-#line 438 "pir.l"
+#line 448 "pir.l"
 { /* switch back from .macro_const buffer to file. */
                      lexer_state * const lexer = yypirget_extra(yyscanner);
                      yy_pop_state(yyscanner);
                      yypir_switch_to_buffer(lexer->buffer,yyscanner);
                    }
-	YY_BREAK
+    YY_BREAK
 case YY_STATE_EOF(SCANMACRO):
-#line 444 "pir.l"
+#line 454 "pir.l"
 { /* override the default <<EOF>> action; go back to normal state and
                       * switch back to the saved file.
                       */
@@ -2620,10 +2620,10 @@
                      delete_macro_table(table);
 
                    }
-	YY_BREAK
+    YY_BREAK
 case 123:
 YY_RULE_SETUP
-#line 467 "pir.l"
+#line 477 "pir.l"
 { /* when scanning a macro body, the @ marker indicates the {IDENT} must
                           * be munged.
                           */
@@ -2632,21 +2632,21 @@
                             yylval->sval              = munge_id(id, lexer);
                             return TK_IDENT;
                        }
-	YY_BREAK
+    YY_BREAK
 case YY_STATE_EOF(INITIAL):
-#line 476 "pir.l"
+#line 486 "pir.l"
 { /* end of file, stop scanning. */
                     yyterminate();
                   }
-	YY_BREAK
+    YY_BREAK
 case 124:
 YY_RULE_SETUP
-#line 480 "pir.l"
+#line 490 "pir.l"
 { /* any character not covered in the rules above is an error. */
                     yypirerror(yyscanner, yypirget_extra(yyscanner),
                                "unexpected character: '%c'", yytext[0]);
                   }
-	YY_BREAK
+    YY_BREAK
 
 
 /*****************************************************************************
@@ -2662,50 +2662,50 @@
 
 case 125:
 YY_RULE_SETUP
-#line 502 "pir.l"
+#line 512 "pir.l"
 {
                                yy_push_state(MACROCONST, yyscanner);
                                return TK_MACRO_CONST;
                              }
-	YY_BREAK
+    YY_BREAK
 case 126:
 YY_RULE_SETUP
-#line 507 "pir.l"
+#line 517 "pir.l"
 {
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                return TK_IDENT;
                              }
-	YY_BREAK
+    YY_BREAK
 case 127:
 YY_RULE_SETUP
-#line 512 "pir.l"
+#line 522 "pir.l"
 {
                                /* only these tokens can be macro constant values */
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                yy_pop_state(yyscanner);
                                return TK_MACRO_CONST_VAL;
                              }
-	YY_BREAK
+    YY_BREAK
 case 128:
 YY_RULE_SETUP
-#line 519 "pir.l"
+#line 529 "pir.l"
 { /* ignore whitespace */ }
-	YY_BREAK
+    YY_BREAK
 case 129:
 YY_RULE_SETUP
-#line 520 "pir.l"
+#line 530 "pir.l"
 {
                                yypirerror(yyscanner, yypirget_extra(yyscanner),
                                           "unknown character: '%c'", yytext[0]);
                              }
-	YY_BREAK
+    YY_BREAK
 case YY_STATE_EOF(MACROCONST):
-#line 524 "pir.l"
+#line 534 "pir.l"
 {
                                yypirerror(yyscanner, yypirget_extra(yyscanner),
                                           "read end of file during .macro_const definition");
                              }
-	YY_BREAK
+    YY_BREAK
 
 
 /**************** macro header (.macro <ident> <parameters> ) ***************/
@@ -2713,50 +2713,50 @@
 
 case 130:
 YY_RULE_SETUP
-#line 535 "pir.l"
+#line 545 "pir.l"
 { /* start a macro definition */
                                yy_push_state(MACROHEAD, yyscanner);
                                return TK_MACRO;
                              }
-	YY_BREAK
+    YY_BREAK
 case 131:
 YY_RULE_SETUP
-#line 540 "pir.l"
+#line 550 "pir.l"
 { /* ignore whitespace */ }
-	YY_BREAK
+    YY_BREAK
 case 132:
 YY_RULE_SETUP
-#line 541 "pir.l"
+#line 551 "pir.l"
 {
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                return TK_IDENT;
                              }
-	YY_BREAK
+    YY_BREAK
 case 133:
 YY_RULE_SETUP
-#line 546 "pir.l"
+#line 556 "pir.l"
 { return '('; }
-	YY_BREAK
+    YY_BREAK
 case 134:
 YY_RULE_SETUP
-#line 547 "pir.l"
+#line 557 "pir.l"
 { return ')'; }
-	YY_BREAK
+    YY_BREAK
 case 135:
 YY_RULE_SETUP
-#line 548 "pir.l"
+#line 558 "pir.l"
 { return ','; }
-	YY_BREAK
+    YY_BREAK
 case 136:
 /* rule 136 can match eol */
 YY_RULE_SETUP
-#line 550 "pir.l"
+#line 560 "pir.l"
 { /* a set of continuous newlines yields a single newline token. */
                                yy_pop_state(yyscanner); /* remove MACROHEAD state */
                                yy_push_state(MACROBODY, yyscanner); /* enter MACROBODY state */
                                return TK_NL;
                              }
-	YY_BREAK
+    YY_BREAK
 
 
 /******************************* macro expansion ***************************/
@@ -2768,7 +2768,7 @@
 
 case 137:
 YY_RULE_SETUP
-#line 566 "pir.l"
+#line 576 "pir.l"
 { /* .foo; it can be a macro, macro_local, or just $P0.foo(),
                                 * but we need to check that.
                                 */
@@ -2822,10 +2822,10 @@
                                    }
                                }
                              }
-	YY_BREAK
+    YY_BREAK
 case 138:
 YY_RULE_SETUP
-#line 620 "pir.l"
+#line 630 "pir.l"
 { /* expand a .macro_const or parameter in argument list */
                                lexer_state * const lexer = yypirget_extra(yyscanner);
                                macro_def   * const macro = find_macro(lexer->macros, yytext + 1);
@@ -2853,85 +2853,85 @@
                                else
                                    yypirerror(yyscanner, lexer, "'%s' is not a macro", yytext + 1);
                              }
-	YY_BREAK
+    YY_BREAK
 case 139:
 YY_RULE_SETUP
-#line 648 "pir.l"
+#line 658 "pir.l"
 {
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                return TK_MACRO_ARG_IDENT;
                              }
-	YY_BREAK
+    YY_BREAK
 case 140:
 YY_RULE_SETUP
-#line 653 "pir.l"
+#line 663 "pir.l"
 {
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                return TK_MACRO_ARG_OTHER;
                              }
-	YY_BREAK
+    YY_BREAK
 case 141:
 YY_RULE_SETUP
-#line 658 "pir.l"
+#line 668 "pir.l"
 { /* ignore whitespace */ }
-	YY_BREAK
+    YY_BREAK
 case 142:
 YY_RULE_SETUP
-#line 659 "pir.l"
+#line 669 "pir.l"
 { return ','; }
-	YY_BREAK
+    YY_BREAK
 case 143:
 YY_RULE_SETUP
-#line 660 "pir.l"
+#line 670 "pir.l"
 { return '('; }
-	YY_BREAK
+    YY_BREAK
 case 144:
 YY_RULE_SETUP
-#line 661 "pir.l"
+#line 671 "pir.l"
 {
                                yy_pop_state(yyscanner); /* leave MACROEXPAND state */
                                return ')';
                              }
-	YY_BREAK
+    YY_BREAK
 case 145:
 YY_RULE_SETUP
-#line 666 "pir.l"
+#line 676 "pir.l"
 {
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                return TK_MACRO_ARG_OTHER;
                              }
-	YY_BREAK
+    YY_BREAK
 case YY_STATE_EOF(STRINGEXPAND):
-#line 671 "pir.l"
+#line 681 "pir.l"
 {
                                lexer_state * const lexer = yypirget_extra(yyscanner);
                                yy_pop_state(yyscanner);
                                yypir_switch_to_buffer(lexer->buffer,yyscanner);
                              }
-	YY_BREAK
+    YY_BREAK
 case 146:
 YY_RULE_SETUP
-#line 677 "pir.l"
+#line 687 "pir.l"
 { return '{'; }
-	YY_BREAK
+    YY_BREAK
 case 147:
 YY_RULE_SETUP
-#line 678 "pir.l"
+#line 688 "pir.l"
 { return '}'; }
-	YY_BREAK
+    YY_BREAK
 case 148:
 /* rule 148 can match eol */
 YY_RULE_SETUP
-#line 680 "pir.l"
+#line 690 "pir.l"
 { yylval->sval = "\n"; return TK_NL; }
-	YY_BREAK
+    YY_BREAK
 case 149:
 YY_RULE_SETUP
-#line 682 "pir.l"
+#line 692 "pir.l"
 { yypirerror(yyscanner, yypirget_extra(yyscanner),
                                           "unknown character in macro expansion: %c", yytext[0]);
                              }
-	YY_BREAK
+    YY_BREAK
 
 
 /******************************** .macro_local *****************************/
@@ -2939,7 +2939,7 @@
 
 case 150:
 YY_RULE_SETUP
-#line 693 "pir.l"
+#line 703 "pir.l"
 { /* give a warning if the right flag is set */
                               /*
                               lexer_state * const lexer = yypirget_extra(yyscanner);
@@ -2952,38 +2952,38 @@
                               Doesn't make sense to use it.
                               */
                             }
-	YY_BREAK
+    YY_BREAK
 case 151:
 YY_RULE_SETUP
-#line 707 "pir.l"
+#line 717 "pir.l"
 {
                               yy_push_state(MACROLOCAL, yyscanner);
                               return TK_MACRO_LOCAL;
                             }
-	YY_BREAK
+    YY_BREAK
 case 152:
 YY_RULE_SETUP
-#line 712 "pir.l"
+#line 722 "pir.l"
 { return TK_INT; }
-	YY_BREAK
+    YY_BREAK
 case 153:
 YY_RULE_SETUP
-#line 713 "pir.l"
+#line 723 "pir.l"
 { return TK_PMC; }
-	YY_BREAK
+    YY_BREAK
 case 154:
 YY_RULE_SETUP
-#line 714 "pir.l"
+#line 724 "pir.l"
 { return TK_NUM; }
-	YY_BREAK
+    YY_BREAK
 case 155:
 YY_RULE_SETUP
-#line 715 "pir.l"
+#line 725 "pir.l"
 { return TK_STRING; }
-	YY_BREAK
+    YY_BREAK
 case 156:
 YY_RULE_SETUP
-#line 717 "pir.l"
+#line 727 "pir.l"
 { /* normal .macro_local */
                               lexer_state * const lexer = yypirget_extra(yyscanner);
                               /* reserve space for {IDENT}, the @ marker and the NULL char. */
@@ -2998,10 +2998,10 @@
                               declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext));
                               return TK_MACRO_LOCAL_ID;
                             }
-	YY_BREAK
+    YY_BREAK
 case 157:
 YY_RULE_SETUP
-#line 732 "pir.l"
+#line 742 "pir.l"
 { /* declare a .macro_local based on a parameter */
                               lexer_state * const lexer = yypirget_extra(yyscanner);
 
@@ -3015,10 +3015,10 @@
                               return TK_MACRO_LOCAL_ID;
 
                             }
-	YY_BREAK
+    YY_BREAK
 case 158:
 YY_RULE_SETUP
-#line 746 "pir.l"
+#line 756 "pir.l"
 { /* .$foo */
                               lexer_state * const lexer = yypirget_extra(yyscanner);
                               macro_table * const table = peek_macro_table(lexer);
@@ -3047,10 +3047,10 @@
                               }
 
                             }
-	YY_BREAK
+    YY_BREAK
 case 159:
 YY_RULE_SETUP
-#line 775 "pir.l"
+#line 785 "pir.l"
 { /* expanding a .macro_local using a macro parameter value */
                              lexer_state * const lexer     = yypirget_extra(yyscanner);
                              char  const * const paramname = dupstrn(lexer, yytext + 1, yyleng - 2);
@@ -3075,29 +3075,29 @@
 
                              return TK_IDENT;
                            }
-	YY_BREAK
+    YY_BREAK
 case 160:
 YY_RULE_SETUP
-#line 800 "pir.l"
+#line 810 "pir.l"
 { /* ignore whitespace */ }
-	YY_BREAK
+    YY_BREAK
 case 161:
 /* rule 161 can match eol */
 YY_RULE_SETUP
-#line 802 "pir.l"
+#line 812 "pir.l"
 { /* newline after .macro_local <type> <ident> line */
                               yy_pop_state(yyscanner);
                               return TK_NL;
                             }
-	YY_BREAK
+    YY_BREAK
 case 162:
 YY_RULE_SETUP
-#line 807 "pir.l"
+#line 817 "pir.l"
 { /* this state is only used for declaring .macro_locals */
                               yypirerror(yyscanner, yypirget_extra(yyscanner),
                                  "unknown character '%c' when declaring .macro_local", yytext[0]);
                             }
-	YY_BREAK
+    YY_BREAK
 
 
 /****************************** .macro_label ********************************/
@@ -3105,15 +3105,15 @@
 
 case 163:
 YY_RULE_SETUP
-#line 817 "pir.l"
+#line 827 "pir.l"
 {
                               yy_push_state(MACROLABEL, yyscanner);
                               return TK_MACRO_LABEL;
                             }
-	YY_BREAK
+    YY_BREAK
 case 164:
 YY_RULE_SETUP
-#line 822 "pir.l"
+#line 832 "pir.l"
 { /* if the "$" is there, it's a macro label using a macro
                                * parameter's value; otherwise it's a normal macro label
                                */
@@ -3130,29 +3130,29 @@
                               declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext));
                               return TK_MACRO_LABEL_ID;
                             }
-	YY_BREAK
+    YY_BREAK
 case 165:
 /* rule 165 can match eol */
 YY_RULE_SETUP
-#line 840 "pir.l"
+#line 850 "pir.l"
 { /* the newline character after a ".macro_label $foo:" declaration */
                               yy_pop_state(yyscanner); /* leave MACROLABEL state */
                               return TK_NL;
                             }
-	YY_BREAK
+    YY_BREAK
 case 166:
 YY_RULE_SETUP
-#line 846 "pir.l"
+#line 856 "pir.l"
 { /* scan a label when expanding a buffer; declared as .macro_label */
                               lexer_state * const lexer = yypirget_extra(yyscanner);
                               char const  * const label = dupstrn(lexer, yytext, yyleng - 2);
                               yylval->sval = munge_id(label, lexer);
                               return TK_LABEL;
                             }
-	YY_BREAK
+    YY_BREAK
 case 167:
 YY_RULE_SETUP
-#line 853 "pir.l"
+#line 863 "pir.l"
 { /* scan a label when expanding macro; was a macro parameter */
                              lexer_state * const lexer     = yypirget_extra(yyscanner);
                              char const  * const paramname = dupstrn(lexer, yytext + 1, yyleng - 3);
@@ -3178,7 +3178,7 @@
                              }
                              return TK_LABEL;
                            }
-	YY_BREAK
+    YY_BREAK
 
 
 /*************************** macro body scanning (storing) ****************************/
@@ -3187,31 +3187,31 @@
 case 168:
 /* rule 168 can match eol */
 YY_RULE_SETUP
-#line 886 "pir.l"
+#line 896 "pir.l"
 { store_macro_char(CURRENT_MACRO(yypirget_extra(yyscanner)), '\n'); }
-	YY_BREAK
+    YY_BREAK
 case 169:
 YY_RULE_SETUP
-#line 888 "pir.l"
+#line 898 "pir.l"
 {
                                yy_pop_state(yyscanner); /* leave MACROBODY state */
                                return TK_ENDM;
                              }
-	YY_BREAK
+    YY_BREAK
 case 170:
 YY_RULE_SETUP
-#line 893 "pir.l"
+#line 903 "pir.l"
 { /* store everything else */
                                store_macro_char(CURRENT_MACRO(yypirget_extra(yyscanner)), yytext[0]);
                              }
-	YY_BREAK
+    YY_BREAK
 case YY_STATE_EOF(MACROBODY):
-#line 897 "pir.l"
+#line 907 "pir.l"
 { /* catch run-away macro bodys */
                                yypirerror(yyscanner, yypirget_extra(yyscanner),
                                           "read end of file while reading macro body");
                              }
-	YY_BREAK
+    YY_BREAK
  /*
 {WS}"."           {
                     yypirerror(yyscanner, yypirget_extra(yyscanner),
@@ -3238,93 +3238,93 @@
 
 case 171:
 YY_RULE_SETUP
-#line 929 "pir.l"
+#line 939 "pir.l"
 { return ','; }
-	YY_BREAK
+    YY_BREAK
 case 172:
 YY_RULE_SETUP
-#line 930 "pir.l"
+#line 940 "pir.l"
 { return '['; }
-	YY_BREAK
+    YY_BREAK
 case 173:
 YY_RULE_SETUP
-#line 931 "pir.l"
+#line 941 "pir.l"
 { return ']'; }
-	YY_BREAK
+    YY_BREAK
 case 174:
 YY_RULE_SETUP
-#line 933 "pir.l"
+#line 943 "pir.l"
 { return TK_FLAG_MAIN; }
-	YY_BREAK
+    YY_BREAK
 case 175:
 YY_RULE_SETUP
-#line 934 "pir.l"
+#line 944 "pir.l"
 { return TK_FLAG_LOAD; }
-	YY_BREAK
+    YY_BREAK
 case 176:
 YY_RULE_SETUP
-#line 935 "pir.l"
+#line 945 "pir.l"
 { return TK_FLAG_INIT; }
-	YY_BREAK
+    YY_BREAK
 case 177:
 YY_RULE_SETUP
-#line 936 "pir.l"
+#line 946 "pir.l"
 { return TK_FLAG_ANON; }
-	YY_BREAK
+    YY_BREAK
 case 178:
 YY_RULE_SETUP
-#line 937 "pir.l"
+#line 947 "pir.l"
 { return TK_FLAG_POSTCOMP; }
-	YY_BREAK
+    YY_BREAK
 case 179:
 YY_RULE_SETUP
-#line 938 "pir.l"
+#line 948 "pir.l"
 { return TK_FLAG_IMMEDIATE; }
-	YY_BREAK
+    YY_BREAK
 case 180:
 YY_RULE_SETUP
-#line 940 "pir.l"
+#line 950 "pir.l"
 { return TK_PCC_SUB; }
-	YY_BREAK
+    YY_BREAK
 case 181:
 YY_RULE_SETUP
-#line 941 "pir.l"
+#line 951 "pir.l"
 { return TK_LEX; }
-	YY_BREAK
+    YY_BREAK
 case 182:
 YY_RULE_SETUP
-#line 942 "pir.l"
+#line 952 "pir.l"
 { return TK_NAMESPACE; }
-	YY_BREAK
+    YY_BREAK
 case 183:
 YY_RULE_SETUP
-#line 944 "pir.l"
+#line 954 "pir.l"
 {
                           yy_push_state(MACROHEAD, yyscanner);
                           return TK_MACRO;
                         }
-	YY_BREAK
+    YY_BREAK
 case 184:
 YY_RULE_SETUP
-#line 949 "pir.l"
+#line 959 "pir.l"
 {
                           yy_push_state(MACROCONST, yyscanner);
                           return TK_MACRO_CONST;
                         }
-	YY_BREAK
+    YY_BREAK
 case 185:
 YY_RULE_SETUP
-#line 954 "pir.l"
+#line 964 "pir.l"
 { return TK_LINE; }
-	YY_BREAK
+    YY_BREAK
 case 186:
 YY_RULE_SETUP
-#line 955 "pir.l"
+#line 965 "pir.l"
 { return TK_FILE; }
-	YY_BREAK
+    YY_BREAK
 case 187:
 YY_RULE_SETUP
-#line 958 "pir.l"
+#line 968 "pir.l"
 { /* macro expansion in PASM mode. */
                           lexer_state * const lexer = yypirget_extra(yyscanner);
                           macro_def   * const macro = find_macro(lexer->macros, yytext + 1);
@@ -3358,247 +3358,247 @@
                               }
                           }
                         }
-	YY_BREAK
+    YY_BREAK
 case 188:
 YY_RULE_SETUP
-#line 992 "pir.l"
+#line 1002 "pir.l"
 { /* a label in PASM */
                           yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
                           return TK_LABEL;
                         }
-	YY_BREAK
+    YY_BREAK
 case 189:
 YY_RULE_SETUP
-#line 997 "pir.l"
+#line 1007 "pir.l"
 { yypirerror(yyscanner, yypirget_extra(yyscanner),
                                      "symbolic registers are not allowed in PASM mode");
                         }
-	YY_BREAK
+    YY_BREAK
 case 190:
 YY_RULE_SETUP
-#line 1000 "pir.l"
+#line 1010 "pir.l"
 { yylval->ival = atoi(yytext + 1); return TK_PREG; }
-	YY_BREAK
+    YY_BREAK
 case 191:
 YY_RULE_SETUP
-#line 1001 "pir.l"
+#line 1011 "pir.l"
 { yylval->ival = atoi(yytext + 1); return TK_NREG; }
-	YY_BREAK
+    YY_BREAK
 case 192:
 YY_RULE_SETUP
-#line 1002 "pir.l"
+#line 1012 "pir.l"
 { yylval->ival = atoi(yytext + 1); return TK_IREG; }
-	YY_BREAK
+    YY_BREAK
 case 193:
 YY_RULE_SETUP
-#line 1003 "pir.l"
+#line 1013 "pir.l"
 { yylval->ival = atoi(yytext + 1); return TK_SREG; }
-	YY_BREAK
+    YY_BREAK
 case 194:
 YY_RULE_SETUP
-#line 1005 "pir.l"
+#line 1015 "pir.l"
 { /* can be a parrot op or a label; the check is done in the parser. */
                           yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                           return TK_IDENT;
                         }
-	YY_BREAK
+    YY_BREAK
 case 195:
 YY_RULE_SETUP
-#line 1010 "pir.l"
+#line 1020 "pir.l"
 { yylval->dval = atof(yytext); return TK_NUMC; }
-	YY_BREAK
+    YY_BREAK
 case 196:
 YY_RULE_SETUP
-#line 1011 "pir.l"
+#line 1021 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-	YY_BREAK
+    YY_BREAK
 case 197:
 YY_RULE_SETUP
-#line 1012 "pir.l"
+#line 1022 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-	YY_BREAK
+    YY_BREAK
 case 198:
 YY_RULE_SETUP
-#line 1013 "pir.l"
+#line 1023 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-	YY_BREAK
+    YY_BREAK
 case 199:
 YY_RULE_SETUP
-#line 1014 "pir.l"
+#line 1024 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-	YY_BREAK
+    YY_BREAK
 case 200:
 YY_RULE_SETUP
-#line 1016 "pir.l"
+#line 1026 "pir.l"
 { /* copy the string, remove the quotes. */
                           yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext + 1, yyleng - 2);
                           return TK_STRINGC;
                         }
-	YY_BREAK
+    YY_BREAK
 case 201:
 YY_RULE_SETUP
-#line 1021 "pir.l"
+#line 1031 "pir.l"
 { /* ignore whitespace */ }
-	YY_BREAK
+    YY_BREAK
 case 202:
 /* rule 202 can match eol */
 YY_RULE_SETUP
-#line 1023 "pir.l"
+#line 1033 "pir.l"
 { return TK_NL; }
-	YY_BREAK
+    YY_BREAK
 case 203:
 YY_RULE_SETUP
-#line 1025 "pir.l"
+#line 1035 "pir.l"
 { yypirerror(yyscanner, yypirget_extra(yyscanner),
                                      "unrecognized character: %c", yytext[0]);
                         }
-	YY_BREAK
+    YY_BREAK
 case YY_STATE_EOF(PASM):
-#line 1028 "pir.l"
+#line 1038 "pir.l"
 { yyterminate(); }
-	YY_BREAK
+    YY_BREAK
 case 204:
 YY_RULE_SETUP
-#line 1030 "pir.l"
+#line 1040 "pir.l"
 ECHO;
-	YY_BREAK
+    YY_BREAK
 #line 3466 "pirlexer.c"
 case YY_STATE_EOF(MACROHEAD):
 case YY_STATE_EOF(MACROLOCAL):
 case YY_STATE_EOF(MACROLABEL):
 case YY_STATE_EOF(MACROEXPAND):
 case YY_STATE_EOF(SPECIALSTART):
-	yyterminate();
+    yyterminate();
 
-	case YY_END_OF_BUFFER:
-		{
-		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
-
-		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = yyg->yy_hold_char;
-		YY_RESTORE_YY_MORE_OFFSET
-
-		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-			{
-			/* We're scanning a new file or input source.  It's
-			 * possible that this happened because the user
-			 * just pointed yyin at a new source and called
-			 * yypirlex().  If so, then we have to assure
-			 * consistency between YY_CURRENT_BUFFER and our
-			 * globals.  Here is the right place to do so, because
-			 * this is the first action (other than possibly a
-			 * back-up) that will match for the new input source.
-			 */
-			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-			}
-
-		/* Note that here we test for yy_c_buf_p "<=" to the position
-		 * of the first EOB in the buffer, since yy_c_buf_p will
-		 * already have been incremented past the NUL character
-		 * (since all states make transitions on EOB to the
-		 * end-of-buffer state).  Contrast this with the test
-		 * in input().
-		 */
-		if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
-			{ /* This was really a NUL. */
-			yy_state_type yy_next_state;
-
-			yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state( yyscanner );
-
-			/* Okay, we're now positioned to make the NUL
-			 * transition.  We couldn't have
-			 * yy_get_previous_state() go ahead and do it
-			 * for us because it doesn't know how to deal
-			 * with the possibility of jamming (and we don't
-			 * want to build jamming into it because then it
-			 * will run more slowly).
-			 */
-
-			yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
-
-			yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
-			if ( yy_next_state )
-				{
-				/* Consume the NUL. */
-				yy_cp = ++yyg->yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-				}
+    case YY_END_OF_BUFFER:
+        {
+        /* Amount of text matched not including the EOB char. */
+        int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+        /* Undo the effects of YY_DO_BEFORE_ACTION. */
+        *yy_cp = yyg->yy_hold_char;
+        YY_RESTORE_YY_MORE_OFFSET
+
+        if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+            {
+            /* We're scanning a new file or input source.  It's
+             * possible that this happened because the user
+             * just pointed yyin at a new source and called
+             * yypirlex().  If so, then we have to assure
+             * consistency between YY_CURRENT_BUFFER and our
+             * globals.  Here is the right place to do so, because
+             * this is the first action (other than possibly a
+             * back-up) that will match for the new input source.
+             */
+            yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+            YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+            YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+            }
+
+        /* Note that here we test for yy_c_buf_p "<=" to the position
+         * of the first EOB in the buffer, since yy_c_buf_p will
+         * already have been incremented past the NUL character
+         * (since all states make transitions on EOB to the
+         * end-of-buffer state).  Contrast this with the test
+         * in input().
+         */
+        if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+            { /* This was really a NUL. */
+            yy_state_type yy_next_state;
+
+            yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
+
+            yy_current_state = yy_get_previous_state( yyscanner );
+
+            /* Okay, we're now positioned to make the NUL
+             * transition.  We couldn't have
+             * yy_get_previous_state() go ahead and do it
+             * for us because it doesn't know how to deal
+             * with the possibility of jamming (and we don't
+             * want to build jamming into it because then it
+             * will run more slowly).
+             */
+
+            yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
+
+            yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+
+            if ( yy_next_state )
+                {
+                /* Consume the NUL. */
+                yy_cp = ++yyg->yy_c_buf_p;
+                yy_current_state = yy_next_state;
+                goto yy_match;
+                }
 
-			else
-				{
+            else
+                {
 /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
-				yy_cp = yyg->yy_last_accepting_cpos;
-				yy_current_state = yyg->yy_last_accepting_state;
-				goto yy_find_action;
-				}
-			}
-
-		else switch ( yy_get_next_buffer( yyscanner ) )
-			{
-			case EOB_ACT_END_OF_FILE:
-				{
-				yyg->yy_did_buffer_switch_on_eof = 0;
-
-				if ( yypirwrap(yyscanner ) )
-					{
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF(YY_START);
-					goto do_action;
-					}
-
-				else
-					{
-					if ( ! yyg->yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-					}
-				break;
-				}
-
-			case EOB_ACT_CONTINUE_SCAN:
-				yyg->yy_c_buf_p =
-					yyg->yytext_ptr + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state( yyscanner );
-
-				yy_cp = yyg->yy_c_buf_p;
-				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-				goto yy_match;
-
-			case EOB_ACT_LAST_MATCH:
-				yyg->yy_c_buf_p =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
-
-				yy_current_state = yy_get_previous_state( yyscanner );
-
-				yy_cp = yyg->yy_c_buf_p;
-				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-				goto yy_find_action;
-			}
-		break;
-		}
-
-	default:
-		YY_FATAL_ERROR(
-			"fatal flex scanner internal error--no action found" );
-	} /* end of action switch */
-		} /* end of scanning one token */
+                yy_cp = yyg->yy_last_accepting_cpos;
+                yy_current_state = yyg->yy_last_accepting_state;
+                goto yy_find_action;
+                }
+            }
+
+        else switch ( yy_get_next_buffer( yyscanner ) )
+            {
+            case EOB_ACT_END_OF_FILE:
+                {
+                yyg->yy_did_buffer_switch_on_eof = 0;
+
+                if ( yypirwrap(yyscanner ) )
+                    {
+                    /* Note: because we've taken care in
+                     * yy_get_next_buffer() to have set up
+                     * yytext, we can now set up
+                     * yy_c_buf_p so that if some total
+                     * hoser (like flex itself) wants to
+                     * call the scanner after we return the
+                     * YY_NULL, it'll still work - another
+                     * YY_NULL will get returned.
+                     */
+                    yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
+
+                    yy_act = YY_STATE_EOF(YY_START);
+                    goto do_action;
+                    }
+
+                else
+                    {
+                    if ( ! yyg->yy_did_buffer_switch_on_eof )
+                        YY_NEW_FILE;
+                    }
+                break;
+                }
+
+            case EOB_ACT_CONTINUE_SCAN:
+                yyg->yy_c_buf_p =
+                    yyg->yytext_ptr + yy_amount_of_matched_text;
+
+                yy_current_state = yy_get_previous_state( yyscanner );
+
+                yy_cp = yyg->yy_c_buf_p;
+                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+                goto yy_match;
+
+            case EOB_ACT_LAST_MATCH:
+                yyg->yy_c_buf_p =
+                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
+
+                yy_current_state = yy_get_previous_state( yyscanner );
+
+                yy_cp = yyg->yy_c_buf_p;
+                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+                goto yy_find_action;
+            }
+        break;
+        }
+
+    default:
+        YY_FATAL_ERROR(
+            "fatal flex scanner internal error--no action found" );
+    } /* end of action switch */
+        } /* end of scanning one token */
 } /* end of yypirlex */
 /* %ok-for-header */
 
@@ -3612,9 +3612,9 @@
 /* yy_get_next_buffer - try to read in a new buffer
  *
  * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
+ *  EOB_ACT_LAST_MATCH -
+ *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *  EOB_ACT_END_OF_FILE - end of file
  */
 /* %if-c-only */
 static int yy_get_next_buffer (yyscan_t yyscanner)
@@ -3623,134 +3623,126 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-	register char *source = yyg->yytext_ptr;
-	register int number_to_move, i;
-	int ret_val;
-
-	if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
-		YY_FATAL_ERROR(
-		"fatal flex scanner internal error--end of buffer missed" );
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
-			{
-			/* We matched a single character, the EOB, so
-			 * treat this as a final EOF.
-			 */
-			return EOB_ACT_END_OF_FILE;
-			}
-
-		else
-			{
-			/* We matched some text prior to the EOB, first
-			 * process it.
-			 */
-			return EOB_ACT_LAST_MATCH;
-			}
-		}
-
-	/* Try to read more data. */
-
-	/* First move last chars to start of buffer. */
-	number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
-
-	for ( i = 0; i < number_to_move; ++i )
-		*(dest++) = *(source++);
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-		/* don't do the read, it's not guaranteed to return an EOF,
-		 * just force an EOF
-		 */
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
-
-	else
-		{
-			int num_to_read =
-			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-		while ( num_to_read <= 0 )
-			{ /* Not enough room in the buffer - grow it. */
-
-			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
-			int yy_c_buf_p_offset =
-				(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
-
-			if ( b->yy_is_our_buffer )
-				{
-				int new_size = b->yy_buf_size * 2;
-
-				if ( new_size <= 0 )
-					b->yy_buf_size += b->yy_buf_size / 8;
-				else
-					b->yy_buf_size *= 2;
-
-				b->yy_ch_buf = (char *)
-					/* Include room in for 2 EOB chars. */
-					yypirrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
-				}
-			else
-				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = 0;
-
-			if ( ! b->yy_ch_buf )
-				YY_FATAL_ERROR(
-				"fatal error - scanner input buffer overflow" );
-
-			yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-						number_to_move - 1;
-
-			}
-
-		if ( num_to_read > YY_READ_BUF_SIZE )
-			num_to_read = YY_READ_BUF_SIZE;
-
-		/* Read in more data. */
-		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			yyg->yy_n_chars, (size_t) num_to_read );
-
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-		}
-
-	if ( yyg->yy_n_chars == 0 )
-		{
-		if ( number_to_move == YY_MORE_ADJ )
-			{
-			ret_val = EOB_ACT_END_OF_FILE;
-			yypirrestart(yyin  ,yyscanner);
-			}
-
-		else
-			{
-			ret_val = EOB_ACT_LAST_MATCH;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-				YY_BUFFER_EOF_PENDING;
-			}
-		}
-
-	else
-		ret_val = EOB_ACT_CONTINUE_SCAN;
-
-	if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-		/* Extend the array by 50%, plus the number we really need. */
-		yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
-		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yypirrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
-		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-	}
-
-	yyg->yy_n_chars += number_to_move;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+    register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+    register char *source = yyg->yytext_ptr;
+    register int number_to_move, i;
+    int ret_val;
+
+    if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
+        YY_FATAL_ERROR(
+        "fatal flex scanner internal error--end of buffer missed" );
+
+    if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+        { /* Don't try to fill the buffer, so this is an EOF. */
+        if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
+            {
+            /* We matched a single character, the EOB, so
+             * treat this as a final EOF.
+             */
+            return EOB_ACT_END_OF_FILE;
+            }
+
+        else
+            {
+            /* We matched some text prior to the EOB, first
+             * process it.
+             */
+            return EOB_ACT_LAST_MATCH;
+            }
+        }
+
+    /* Try to read more data. */
+
+    /* First move last chars to start of buffer. */
+    number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+
+    for ( i = 0; i < number_to_move; ++i )
+        *(dest++) = *(source++);
+
+    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+        /* don't do the read, it's not guaranteed to return an EOF,
+         * just force an EOF
+         */
+        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
 
-	yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+    else
+        {
+            int num_to_read =
+            YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+        while ( num_to_read <= 0 )
+            { /* Not enough room in the buffer - grow it. */
+
+            /* just a shorter name for the current buffer */
+            YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+            int yy_c_buf_p_offset =
+                (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
+
+            if ( b->yy_is_our_buffer )
+                {
+                int new_size = b->yy_buf_size * 2;
+
+                if ( new_size <= 0 )
+                    b->yy_buf_size += b->yy_buf_size / 8;
+                else
+                    b->yy_buf_size *= 2;
+
+                b->yy_ch_buf = (char *)
+                    /* Include room in for 2 EOB chars. */
+                    yypirrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+                }
+            else
+                /* Can't grow it, we don't own it. */
+                b->yy_ch_buf = 0;
+
+            if ( ! b->yy_ch_buf )
+                YY_FATAL_ERROR(
+                "fatal error - scanner input buffer overflow" );
+
+            yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+            num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+                        number_to_move - 1;
+
+            }
+
+        if ( num_to_read > YY_READ_BUF_SIZE )
+            num_to_read = YY_READ_BUF_SIZE;
+
+        /* Read in more data. */
+        YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+            yyg->yy_n_chars, num_to_read );
+
+        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+        }
+
+    if ( yyg->yy_n_chars == 0 )
+        {
+        if ( number_to_move == YY_MORE_ADJ )
+            {
+            ret_val = EOB_ACT_END_OF_FILE;
+            yypirrestart(yyin  ,yyscanner);
+            }
+
+        else
+            {
+            ret_val = EOB_ACT_LAST_MATCH;
+            YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+                YY_BUFFER_EOF_PENDING;
+            }
+        }
+
+    else
+        ret_val = EOB_ACT_CONTINUE_SCAN;
+
+    yyg->yy_n_chars += number_to_move;
+    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
 
-	return ret_val;
+    yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+    return ret_val;
 }
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
@@ -3763,38 +3755,38 @@
 /* %if-c++-only */
 /* %endif */
 {
-	register yy_state_type yy_current_state;
-	register char *yy_cp;
+    register yy_state_type yy_current_state;
+    register char *yy_cp;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
 /* %% [15.0] code to get the start state into yy_current_state goes here */
-	yy_current_state = yyg->yy_start;
+    yy_current_state = yyg->yy_start;
 
-	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
-		{
+    for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
+        {
 /* %% [16.0] code to find the next state goes here */
-		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-		if ( yy_accept[yy_current_state] )
-			{
-			yyg->yy_last_accepting_state = yy_current_state;
-			yyg->yy_last_accepting_cpos = yy_cp;
-			}
-		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-			{
-			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 803 )
-				yy_c = yy_meta[(unsigned int) yy_c];
-			}
-		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		}
+        register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+        if ( yy_accept[yy_current_state] )
+            {
+            yyg->yy_last_accepting_state = yy_current_state;
+            yyg->yy_last_accepting_cpos = yy_cp;
+            }
+        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+            {
+            yy_current_state = (int) yy_def[yy_current_state];
+            if ( yy_current_state >= 803 )
+                yy_c = yy_meta[(unsigned int) yy_c];
+            }
+        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+        }
 
-	return yy_current_state;
+    return yy_current_state;
 }
 
 /* yy_try_NUL_trans - try to make a transition on the NUL character
  *
  * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
+ *  next_state = yy_try_NUL_trans( current_state );
  */
 /* %if-c-only */
     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
@@ -3802,27 +3794,27 @@
 /* %if-c++-only */
 /* %endif */
 {
-	register int yy_is_jam;
+    register int yy_is_jam;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
-	register char *yy_cp = yyg->yy_c_buf_p;
+    register char *yy_cp = yyg->yy_c_buf_p;
 
-	register YY_CHAR yy_c = 1;
-	if ( yy_accept[yy_current_state] )
-		{
-		yyg->yy_last_accepting_state = yy_current_state;
-		yyg->yy_last_accepting_cpos = yy_cp;
-		}
-	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-		{
-		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 803 )
-			yy_c = yy_meta[(unsigned int) yy_c];
-		}
-	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 802);
+    register YY_CHAR yy_c = 1;
+    if ( yy_accept[yy_current_state] )
+        {
+        yyg->yy_last_accepting_state = yy_current_state;
+        yyg->yy_last_accepting_cpos = yy_cp;
+        }
+    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+        {
+        yy_current_state = (int) yy_def[yy_current_state];
+        if ( yy_current_state >= 803 )
+            yy_c = yy_meta[(unsigned int) yy_c];
+        }
+    yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+    yy_is_jam = (yy_current_state == 802);
 
-	return yy_is_jam ? 0 : yy_current_state;
+    return yy_is_jam ? 0 : yy_current_state;
 }
 
 /* %if-c-only */
@@ -3841,81 +3833,81 @@
 /* %if-c++-only */
 /* %endif */
 {
-	int c;
+    int c;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-	*yyg->yy_c_buf_p = yyg->yy_hold_char;
+    *yyg->yy_c_buf_p = yyg->yy_hold_char;
+
+    if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+        {
+        /* yy_c_buf_p now points to the character we want to return.
+         * If this occurs *before* the EOB characters, then it's a
+         * valid NUL; if not, then we've hit the end of the buffer.
+         */
+        if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+            /* This was really a NUL. */
+            *yyg->yy_c_buf_p = '\0';
+
+        else
+            { /* need more input */
+            int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+            ++yyg->yy_c_buf_p;
+
+            switch ( yy_get_next_buffer( yyscanner ) )
+                {
+                case EOB_ACT_LAST_MATCH:
+                    /* This happens because yy_g_n_b()
+                     * sees that we've accumulated a
+                     * token and flags that we need to
+                     * try matching the token before
+                     * proceeding.  But for input(),
+                     * there's no matching to consider.
+                     * So convert the EOB_ACT_LAST_MATCH
+                     * to EOB_ACT_END_OF_FILE.
+                     */
+
+                    /* Reset buffer status. */
+                    yypirrestart(yyin ,yyscanner);
 
-	if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
-		{
-		/* yy_c_buf_p now points to the character we want to return.
-		 * If this occurs *before* the EOB characters, then it's a
-		 * valid NUL; if not, then we've hit the end of the buffer.
-		 */
-		if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
-			/* This was really a NUL. */
-			*yyg->yy_c_buf_p = '\0';
-
-		else
-			{ /* need more input */
-			int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
-			++yyg->yy_c_buf_p;
-
-			switch ( yy_get_next_buffer( yyscanner ) )
-				{
-				case EOB_ACT_LAST_MATCH:
-					/* This happens because yy_g_n_b()
-					 * sees that we've accumulated a
-					 * token and flags that we need to
-					 * try matching the token before
-					 * proceeding.  But for input(),
-					 * there's no matching to consider.
-					 * So convert the EOB_ACT_LAST_MATCH
-					 * to EOB_ACT_END_OF_FILE.
-					 */
-
-					/* Reset buffer status. */
-					yypirrestart(yyin ,yyscanner);
-
-					/*FALLTHROUGH*/
-
-				case EOB_ACT_END_OF_FILE:
-					{
-					if ( yypirwrap(yyscanner ) )
-						return EOF;
+                    /*FALLTHROUGH*/
 
-					if ( ! yyg->yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
+                case EOB_ACT_END_OF_FILE:
+                    {
+                    if ( yypirwrap(yyscanner ) )
+                        return EOF;
+
+                    if ( ! yyg->yy_did_buffer_switch_on_eof )
+                        YY_NEW_FILE;
 #ifdef __cplusplus
-					return yyinput(yyscanner);
+                    return yyinput(yyscanner);
 #else
-					return input(yyscanner);
+                    return input(yyscanner);
 #endif
-					}
+                    }
 
-				case EOB_ACT_CONTINUE_SCAN:
-					yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
-					break;
-				}
-			}
-		}
-
-	c = *(unsigned char *) yyg->yy_c_buf_p;	/* cast for 8-bit char's */
-	*yyg->yy_c_buf_p = '\0';	/* preserve yytext */
-	yyg->yy_hold_char = *++yyg->yy_c_buf_p;
+                case EOB_ACT_CONTINUE_SCAN:
+                    yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
+                    break;
+                }
+            }
+        }
+
+    c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
+    *yyg->yy_c_buf_p = '\0';    /* preserve yytext */
+    yyg->yy_hold_char = *++yyg->yy_c_buf_p;
 
 /* %% [19.0] update BOL and yylineno */
-	if ( c == '\n' )
-		   
+    if ( c == '\n' )
+
     do{ yylineno++;
         yycolumn=0;
     }while(0)
 ;
 
-	return c;
+    return c;
 }
 /* %if-c-only */
-#endif	/* ifndef YY_NO_INPUT */
+#endif  /* ifndef YY_NO_INPUT */
 /* %endif */
 
 /** Immediately switch to a different input stream.
@@ -3931,14 +3923,14 @@
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-	if ( ! YY_CURRENT_BUFFER ){
+    if ( ! YY_CURRENT_BUFFER ){
         yypirensure_buffer_stack (yyscanner);
-		YY_CURRENT_BUFFER_LVALUE =
+        YY_CURRENT_BUFFER_LVALUE =
             yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
-	}
+    }
 
-	yypir_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
-	yypir_load_buffer_state(yyscanner );
+    yypir_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
+    yypir_load_buffer_state(yyscanner );
 }
 
 /** Switch to a different input buffer.
@@ -3953,32 +3945,32 @@
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-	/* TODO. We should be able to replace this entire function body
-	 * with
-	 *		yypirpop_buffer_state();
-	 *		yypirpush_buffer_state(new_buffer);
+    /* TODO. We should be able to replace this entire function body
+     * with
+     *      yypirpop_buffer_state();
+     *      yypirpush_buffer_state(new_buffer);
+     */
+    yypirensure_buffer_stack (yyscanner);
+    if ( YY_CURRENT_BUFFER == new_buffer )
+        return;
+
+    if ( YY_CURRENT_BUFFER )
+        {
+        /* Flush out information for old buffer. */
+        *yyg->yy_c_buf_p = yyg->yy_hold_char;
+        YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+        }
+
+    YY_CURRENT_BUFFER_LVALUE = new_buffer;
+    yypir_load_buffer_state(yyscanner );
+
+    /* We don't actually know whether we did this switch during
+     * EOF (yypirwrap()) processing, but the only time this flag
+     * is looked at is after yypirwrap() is called, so it's safe
+     * to go ahead and always set it.
      */
-	yypirensure_buffer_stack (yyscanner);
-	if ( YY_CURRENT_BUFFER == new_buffer )
-		return;
-
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*yyg->yy_c_buf_p = yyg->yy_hold_char;
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-		}
-
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-	yypir_load_buffer_state(yyscanner );
-
-	/* We don't actually know whether we did this switch during
-	 * EOF (yypirwrap()) processing, but the only time this flag
-	 * is looked at is after yypirwrap() is called, so it's safe
-	 * to go ahead and always set it.
-	 */
-	yyg->yy_did_buffer_switch_on_eof = 1;
+    yyg->yy_did_buffer_switch_on_eof = 1;
 }
 
 /* %if-c-only */
@@ -3988,10 +3980,10 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-	yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-	yyg->yy_hold_char = *yyg->yy_c_buf_p;
+    yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+    yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+    yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+    yyg->yy_hold_char = *yyg->yy_c_buf_p;
 }
 
 /** Allocate and initialize an input buffer state.
@@ -4006,26 +3998,26 @@
 /* %if-c++-only */
 /* %endif */
 {
-	YY_BUFFER_STATE b;
-    
-	b = (YY_BUFFER_STATE) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yypir_create_buffer()" );
-
-	b->yy_buf_size = size;
-
-	/* yy_ch_buf has to be 2 characters longer than the size given because
-	 * we need to put in 2 end-of-buffer characters.
-	 */
-	b->yy_ch_buf = (char *) yypiralloc(b->yy_buf_size + 2 ,yyscanner );
-	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yypir_create_buffer()" );
+    YY_BUFFER_STATE b;
 
-	b->yy_is_our_buffer = 1;
+    b = (YY_BUFFER_STATE) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+    if ( ! b )
+        YY_FATAL_ERROR( "out of dynamic memory in yypir_create_buffer()" );
 
-	yypir_init_buffer(b,file ,yyscanner);
+    b->yy_buf_size = size;
+
+    /* yy_ch_buf has to be 2 characters longer than the size given because
+     * we need to put in 2 end-of-buffer characters.
+     */
+    b->yy_ch_buf = (char *) yypiralloc(b->yy_buf_size + 2 ,yyscanner );
+    if ( ! b->yy_ch_buf )
+        YY_FATAL_ERROR( "out of dynamic memory in yypir_create_buffer()" );
 
-	return b;
+    b->yy_is_our_buffer = 1;
+
+    yypir_init_buffer(b,file ,yyscanner);
+
+    return b;
 }
 
 /** Destroy the buffer.
@@ -4040,16 +4032,16 @@
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-	if ( ! b )
-		return;
+    if ( ! b )
+        return;
 
-	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+    if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+        YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
-	if ( b->yy_is_our_buffer )
-		yypirfree((void *) b->yy_ch_buf ,yyscanner );
+    if ( b->yy_is_our_buffer )
+        yypirfree((void *) b->yy_ch_buf ,yyscanner );
 
-	yypirfree((void *) b ,yyscanner );
+    yypirfree((void *) b ,yyscanner );
 }
 
 /* %if-c-only */
@@ -4070,13 +4062,13 @@
 /* %endif */
 
 {
-	int oerrno = errno;
+    int oerrno = errno;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-	yypir_flush_buffer(b ,yyscanner);
+    yypir_flush_buffer(b ,yyscanner);
 
-	b->yy_input_file = file;
-	b->yy_fill_buffer = 1;
+    b->yy_input_file = file;
+    b->yy_fill_buffer = 1;
 
     /* If b is the current buffer, then yypir_init_buffer was _probably_
      * called from yypirrestart() or through yy_get_next_buffer.
@@ -4090,11 +4082,11 @@
 /* %if-c-only */
 
         b->yy_is_interactive = 0;
-    
+
 /* %endif */
 /* %if-c++-only */
 /* %endif */
-	errno = oerrno;
+    errno = oerrno;
 }
 
 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
@@ -4108,25 +4100,25 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if ( ! b )
-		return;
+    if ( ! b )
+        return;
 
-	b->yy_n_chars = 0;
+    b->yy_n_chars = 0;
 
-	/* We always need two end-of-buffer characters.  The first causes
-	 * a transition to the end-of-buffer state.  The second causes
-	 * a jam in that state.
-	 */
-	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+    /* We always need two end-of-buffer characters.  The first causes
+     * a transition to the end-of-buffer state.  The second causes
+     * a jam in that state.
+     */
+    b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+    b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
 
-	b->yy_buf_pos = &b->yy_ch_buf[0];
+    b->yy_buf_pos = &b->yy_ch_buf[0];
 
-	b->yy_at_bol = 1;
-	b->yy_buffer_status = YY_BUFFER_NEW;
+    b->yy_at_bol = 1;
+    b->yy_buffer_status = YY_BUFFER_NEW;
 
-	if ( b == YY_CURRENT_BUFFER )
-		yypir_load_buffer_state(yyscanner );
+    if ( b == YY_CURRENT_BUFFER )
+        yypir_load_buffer_state(yyscanner );
 }
 
 /* %if-c-or-c++ */
@@ -4143,28 +4135,28 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if (new_buffer == NULL)
-		return;
+    if (new_buffer == NULL)
+        return;
 
-	yypirensure_buffer_stack(yyscanner);
+    yypirensure_buffer_stack(yyscanner);
 
-	/* This block is copied from yypir_switch_to_buffer. */
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*yyg->yy_c_buf_p = yyg->yy_hold_char;
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-		}
-
-	/* Only push if top exists. Otherwise, replace top. */
-	if (YY_CURRENT_BUFFER)
-		yyg->yy_buffer_stack_top++;
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-	/* copied from yypir_switch_to_buffer. */
-	yypir_load_buffer_state(yyscanner );
-	yyg->yy_did_buffer_switch_on_eof = 1;
+    /* This block is copied from yypir_switch_to_buffer. */
+    if ( YY_CURRENT_BUFFER )
+        {
+        /* Flush out information for old buffer. */
+        *yyg->yy_c_buf_p = yyg->yy_hold_char;
+        YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+        }
+
+    /* Only push if top exists. Otherwise, replace top. */
+    if (YY_CURRENT_BUFFER)
+        yyg->yy_buffer_stack_top++;
+    YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+    /* copied from yypir_switch_to_buffer. */
+    yypir_load_buffer_state(yyscanner );
+    yyg->yy_did_buffer_switch_on_eof = 1;
 }
 /* %endif */
 
@@ -4180,18 +4172,18 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if (!YY_CURRENT_BUFFER)
-		return;
+    if (!YY_CURRENT_BUFFER)
+        return;
 
-	yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
-	YY_CURRENT_BUFFER_LVALUE = NULL;
-	if (yyg->yy_buffer_stack_top > 0)
-		--yyg->yy_buffer_stack_top;
-
-	if (YY_CURRENT_BUFFER) {
-		yypir_load_buffer_state(yyscanner );
-		yyg->yy_did_buffer_switch_on_eof = 1;
-	}
+    yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+    YY_CURRENT_BUFFER_LVALUE = NULL;
+    if (yyg->yy_buffer_stack_top > 0)
+        --yyg->yy_buffer_stack_top;
+
+    if (YY_CURRENT_BUFFER) {
+        yypir_load_buffer_state(yyscanner );
+        yyg->yy_did_buffer_switch_on_eof = 1;
+    }
 }
 /* %endif */
 
@@ -4205,46 +4197,42 @@
 /* %if-c++-only */
 /* %endif */
 {
-	int num_to_alloc;
+    int num_to_alloc;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-	if (!yyg->yy_buffer_stack) {
+    if (!yyg->yy_buffer_stack) {
 
-		/* First allocation is just for 2 elements, since we don't know if this
-		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
-		 * immediate realloc on the next call.
+        /* First allocation is just for 2 elements, since we don't know if this
+         * scanner will even need a stack. We use 2 instead of 1 to avoid an
+         * immediate realloc on the next call.
          */
-		num_to_alloc = 1;
-		yyg->yy_buffer_stack = (struct yy_buffer_state**)yypiralloc
-								(num_to_alloc * sizeof(struct yy_buffer_state*)
-								, yyscanner);
-		if ( ! yyg->yy_buffer_stack )
-			YY_FATAL_ERROR( "out of dynamic memory in yypirensure_buffer_stack()" );
-								  
-		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-				
-		yyg->yy_buffer_stack_max = num_to_alloc;
-		yyg->yy_buffer_stack_top = 0;
-		return;
-	}
-
-	if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
-
-		/* Increase the buffer to prepare for a possible push. */
-		int grow_size = 8 /* arbitrary grow size */;
-
-		num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
-		yyg->yy_buffer_stack = (struct yy_buffer_state**)yypirrealloc
-								(yyg->yy_buffer_stack,
-								num_to_alloc * sizeof(struct yy_buffer_state*)
-								, yyscanner);
-		if ( ! yyg->yy_buffer_stack )
-			YY_FATAL_ERROR( "out of dynamic memory in yypirensure_buffer_stack()" );
-
-		/* zero only the new slots.*/
-		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
-		yyg->yy_buffer_stack_max = num_to_alloc;
-	}
+        num_to_alloc = 1;
+        yyg->yy_buffer_stack = (struct yy_buffer_state**)yypiralloc
+                                (num_to_alloc * sizeof(struct yy_buffer_state*)
+                                , yyscanner);
+
+        memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+        yyg->yy_buffer_stack_max = num_to_alloc;
+        yyg->yy_buffer_stack_top = 0;
+        return;
+    }
+
+    if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
+
+        /* Increase the buffer to prepare for a possible push. */
+        int grow_size = 8 /* arbitrary grow size */;
+
+        num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
+        yyg->yy_buffer_stack = (struct yy_buffer_state**)yypirrealloc
+                                (yyg->yy_buffer_stack,
+                                num_to_alloc * sizeof(struct yy_buffer_state*)
+                                , yyscanner);
+
+        /* zero only the new slots.*/
+        memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
+        yyg->yy_buffer_stack_max = num_to_alloc;
+    }
 }
 /* %endif */
 
@@ -4253,42 +4241,42 @@
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
  * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object. 
+ * @return the newly allocated buffer state object.
  */
 YY_BUFFER_STATE yypir_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
 {
-	YY_BUFFER_STATE b;
-    
-	if ( size < 2 ||
-	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
-	     base[size-1] != YY_END_OF_BUFFER_CHAR )
-		/* They forgot to leave room for the EOB's. */
-		return 0;
-
-	b = (YY_BUFFER_STATE) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yypir_scan_buffer()" );
-
-	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
-	b->yy_buf_pos = b->yy_ch_buf = base;
-	b->yy_is_our_buffer = 0;
-	b->yy_input_file = 0;
-	b->yy_n_chars = b->yy_buf_size;
-	b->yy_is_interactive = 0;
-	b->yy_at_bol = 1;
-	b->yy_fill_buffer = 0;
-	b->yy_buffer_status = YY_BUFFER_NEW;
+    YY_BUFFER_STATE b;
 
-	yypir_switch_to_buffer(b ,yyscanner );
+    if ( size < 2 ||
+         base[size-2] != YY_END_OF_BUFFER_CHAR ||
+         base[size-1] != YY_END_OF_BUFFER_CHAR )
+        /* They forgot to leave room for the EOB's. */
+        return 0;
+
+    b = (YY_BUFFER_STATE) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+    if ( ! b )
+        YY_FATAL_ERROR( "out of dynamic memory in yypir_scan_buffer()" );
+
+    b->yy_buf_size = size - 2;  /* "- 2" to take care of EOB's */
+    b->yy_buf_pos = b->yy_ch_buf = base;
+    b->yy_is_our_buffer = 0;
+    b->yy_input_file = 0;
+    b->yy_n_chars = b->yy_buf_size;
+    b->yy_is_interactive = 0;
+    b->yy_at_bol = 1;
+    b->yy_fill_buffer = 0;
+    b->yy_buffer_status = YY_BUFFER_NEW;
 
-	return b;
+    yypir_switch_to_buffer(b ,yyscanner );
+
+    return b;
 }
 /* %endif */
 
 /* %if-c-only */
 /** Setup the input buffer state to scan a string. The next call to yypirlex() will
  * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
+ * @param str a NUL-terminated string to scan
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  * @note If you want to scan bytes that may contain NUL values, then use
@@ -4296,8 +4284,8 @@
  */
 YY_BUFFER_STATE yypir_scan_string (yyconst char * yystr , yyscan_t yyscanner)
 {
-    
-	return yypir_scan_bytes(yystr,strlen(yystr) ,yyscanner);
+
+    return yypir_scan_bytes(yystr,strlen(yystr) ,yyscanner);
 }
 /* %endif */
 
@@ -4311,32 +4299,32 @@
  */
 YY_BUFFER_STATE yypir_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
 {
-	YY_BUFFER_STATE b;
-	char *buf;
-	yy_size_t n;
-	int i;
-    
-	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = _yybytes_len + 2;
-	buf = (char *) yypiralloc(n ,yyscanner );
-	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yypir_scan_bytes()" );
-
-	for ( i = 0; i < _yybytes_len; ++i )
-		buf[i] = yybytes[i];
-
-	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = yypir_scan_buffer(buf,n ,yyscanner);
-	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in yypir_scan_bytes()" );
-
-	/* It's okay to grow etc. this buffer, and we should throw it
-	 * away when we're done.
-	 */
-	b->yy_is_our_buffer = 1;
+    YY_BUFFER_STATE b;
+    char *buf;
+    yy_size_t n;
+    int i;
+
+    /* Get memory for full buffer, including space for trailing EOB's. */
+    n = _yybytes_len + 2;
+    buf = (char *) yypiralloc(n ,yyscanner );
+    if ( ! buf )
+        YY_FATAL_ERROR( "out of dynamic memory in yypir_scan_bytes()" );
+
+    for ( i = 0; i < _yybytes_len; ++i )
+        buf[i] = yybytes[i];
+
+    buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+    b = yypir_scan_buffer(buf,n ,yyscanner);
+    if ( ! b )
+        YY_FATAL_ERROR( "bad buffer in yypir_scan_bytes()" );
 
-	return b;
+    /* It's okay to grow etc. this buffer, and we should throw it
+     * away when we're done.
+     */
+    b->yy_is_our_buffer = 1;
+
+    return b;
 }
 /* %endif */
 
@@ -4347,26 +4335,27 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
-		{
-		yy_size_t new_size;
+    if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
+        {
+        yy_size_t new_size;
 
-		yyg->yy_start_stack_depth += YY_START_STACK_INCR;
-		new_size = yyg->yy_start_stack_depth * sizeof( int );
+        yyg->yy_start_stack_depth += YY_START_STACK_INCR;
+        new_size = yyg->yy_start_stack_depth * sizeof( int );
 
-		if ( ! yyg->yy_start_stack )
-			yyg->yy_start_stack = (int *) yypiralloc(new_size ,yyscanner );
+        if ( ! yyg->yy_start_stack )
+            yyg->yy_start_stack = (int *) yypiralloc(new_size ,yyscanner );
 
-		else
-			yyg->yy_start_stack = (int *) yypirrealloc((void *) yyg->yy_start_stack,new_size ,yyscanner );
+        else
+            yyg->yy_start_stack = (int *) yypirrealloc((void *) yyg->yy_start_stack,new_size ,yyscanner );
 
-		if ( ! yyg->yy_start_stack )
-			YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
-		}
+        if ( ! yyg->yy_start_stack )
+            YY_FATAL_ERROR(
+            "out of memory expanding start-condition stack" );
+        }
 
-	yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
+    yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
 
-	BEGIN(new_state);
+    BEGIN(new_state);
 }
 
 /* %if-c-only */
@@ -4376,10 +4365,10 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if ( --yyg->yy_start_stack_ptr < 0 )
-		YY_FATAL_ERROR( "start-condition stack underflow" );
+    if ( --yyg->yy_start_stack_ptr < 0 )
+        YY_FATAL_ERROR( "start-condition stack underflow" );
 
-	BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
+    BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
 }
 
 /* %if-c-only */
@@ -4389,7 +4378,7 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
+    return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
 }
 
 #ifndef YY_EXIT_FAILURE
@@ -4399,8 +4388,8 @@
 /* %if-c-only */
 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
 {
-    	(void) fprintf( stderr, "%s\n", msg );
-	exit( YY_EXIT_FAILURE );
+        (void) fprintf( stderr, "%s\n", msg );
+    exit( YY_EXIT_FAILURE );
 }
 /* %endif */
 /* %if-c++-only */
@@ -4410,18 +4399,18 @@
 
 #undef yyless
 #define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
+    do \
+        { \
+        /* Undo effects of setting up yytext. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-		yytext[yyleng] = yyg->yy_hold_char; \
-		yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
-		yyg->yy_hold_char = *yyg->yy_c_buf_p; \
-		*yyg->yy_c_buf_p = '\0'; \
-		yyleng = yyless_macro_arg; \
-		} \
-	while ( 0 )
+        yytext[yyleng] = yyg->yy_hold_char; \
+        yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
+        yyg->yy_hold_char = *yyg->yy_c_buf_p; \
+        *yyg->yy_c_buf_p = '\0'; \
+        yyleng = yyless_macro_arg; \
+        } \
+    while ( 0 )
 
 /* Accessor  methods (get/set functions) to struct members. */
 
@@ -4445,10 +4434,10 @@
 int yypirget_lineno  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    
+
         if (! YY_CURRENT_BUFFER)
             return 0;
-    
+
     return yylineno;
 }
 
@@ -4458,10 +4447,10 @@
 int yypirget_column  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    
+
         if (! YY_CURRENT_BUFFER)
             return 0;
-    
+
     return yycolumn;
 }
 
@@ -4526,8 +4515,8 @@
 
         /* lineno is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "yypirset_lineno called with no buffer" , yyscanner); 
-    
+           yy_fatal_error( "yypirset_lineno called with no buffer" , yyscanner);
+
     yylineno = line_number;
 }
 
@@ -4541,8 +4530,8 @@
 
         /* column is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "yypirset_column called with no buffer" , yyscanner); 
-    
+           yy_fatal_error( "yypirset_column called with no buffer" , yyscanner);
+
     yycolumn = column_no;
 }
 
@@ -4625,43 +4614,7 @@
     return yy_init_globals ( *ptr_yy_globals );
 }
 
-/* yypirlex_init_extra has the same functionality as yypirlex_init, but follows the
- * convention of taking the scanner as the last argument. Note however, that
- * this is a *pointer* to a scanner, as it will be allocated by this call (and
- * is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to yypiralloc in
- * the yyextra field.
- */
-
-int yypirlex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
-{
-    struct yyguts_t dummy_yyguts;
-
-    yypirset_extra (yy_user_defined, &dummy_yyguts);
-
-    if (ptr_yy_globals == NULL){
-        errno = EINVAL;
-        return 1;
-    }
-	
-    *ptr_yy_globals = (yyscan_t) yypiralloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-	
-    if (*ptr_yy_globals == NULL){
-        errno = ENOMEM;
-        return 1;
-    }
-    
-    /* By setting to 0xAA, we expose bugs in
-    yy_init_globals. Leave at 0x00 for releases. */
-    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-    
-    yypirset_extra (yy_user_defined, *ptr_yy_globals);
-    
-    return yy_init_globals ( *ptr_yy_globals );
-}
-
-/* %endif if-c-only */
+/* %endif */
 
 /* %if-c-only */
 static int yy_init_globals (yyscan_t yyscanner)
@@ -4705,15 +4658,15 @@
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
     /* Pop the buffer stack, destroying each element. */
-	while(YY_CURRENT_BUFFER){
-		yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
-		yypirpop_buffer_state(yyscanner);
-	}
-
-	/* Destroy the stack itself. */
-	yypirfree(yyg->yy_buffer_stack ,yyscanner);
-	yyg->yy_buffer_stack = NULL;
+    while(YY_CURRENT_BUFFER){
+        yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+        YY_CURRENT_BUFFER_LVALUE = NULL;
+        yypirpop_buffer_state(yyscanner);
+    }
+
+    /* Destroy the stack itself. */
+    yypirfree(yyg->yy_buffer_stack ,yyscanner);
+    yyg->yy_buffer_stack = NULL;
 
     /* Destroy the start condition stack. */
         yypirfree(yyg->yy_start_stack ,yyscanner );
@@ -4739,20 +4692,20 @@
 #ifndef yytext_ptr
 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
 {
-	register int i;
-	for ( i = 0; i < n; ++i )
-		s1[i] = s2[i];
+    register int i;
+    for ( i = 0; i < n; ++i )
+        s1[i] = s2[i];
 }
 #endif
 
 #ifdef YY_NEED_STRLEN
 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
 {
-	register int n;
-	for ( n = 0; s[n]; ++n )
-		;
+    register int n;
+    for ( n = 0; s[n]; ++n )
+        ;
 
-	return n;
+    return n;
 }
 #endif
 
@@ -4763,7 +4716,7 @@
 
 /* %ok-for-header */
 
-#line 1030 "pir.l"
+#line 1040 "pir.l"
 
 
 

Modified: branches/pdd22io_part3/compilers/pirc/new/pirlexer.h
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pirlexer.h	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pirlexer.h	Mon Dec 29 23:28:53 2008
@@ -48,12 +48,10 @@
 
 /* A lexical scanner generated by flex */
 
-/* %not-for-header */
-
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 33
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -62,7 +60,7 @@
 /* %endif */
 
 /* %if-c-only */
-    
+
 /* %endif */
 
 /* %if-c-only */
@@ -91,10 +89,10 @@
 
 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
 
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#if __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
+ * if you want the limit (max/min) macros for int types.
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -111,7 +109,7 @@
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -157,15 +155,14 @@
 /* The "const" storage-class-modifier is valid. */
 #define YY_USE_CONST
 
-#else	/* ! __cplusplus */
+#else   /* ! __cplusplus */
 
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
+#if __STDC__
 
 #define YY_USE_CONST
 
-#endif	/* defined (__STDC__) */
-#endif	/* ! __cplusplus */
+#endif  /* __STDC__ */
+#endif  /* ! __cplusplus */
 
 #ifdef YY_USE_CONST
 #define yyconst const
@@ -196,16 +193,12 @@
 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
 #define yy_flex_debug yyg->yy_flex_debug_r
 
+int yypirlex_init (yyscan_t* scanner);
 /* %endif */
 
 /* %if-not-reentrant */
 /* %endif */
 
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
 #define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
@@ -219,65 +212,70 @@
 /* %endif */
 /* %endif */
 
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+
 #ifndef YY_TYPEDEF_YY_SIZE_T
 #define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
+typedef unsigned int yy_size_t;
 #endif
 
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
-	{
+    {
 /* %if-c-only */
-	FILE *yy_input_file;
+    FILE *yy_input_file;
 /* %endif */
 
 /* %if-c++-only */
 /* %endif */
 
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
+    char *yy_ch_buf;        /* input buffer */
+    char *yy_buf_pos;       /* current position in input buffer */
 
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	int yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
+    /* Size of input buffer in bytes, not including room for EOB
+     * characters.
+     */
+    yy_size_t yy_buf_size;
+
+    /* Number of characters read into yy_ch_buf, not including EOB
+     * characters.
+     */
+    int yy_n_chars;
+
+    /* Whether we "own" the buffer - i.e., we know we created it,
+     * and can realloc() it to grow it, and should free() it to
+     * delete it.
+     */
+    int yy_is_our_buffer;
+
+    /* Whether this is an "interactive" input source; if so, and
+     * if we're using stdio for input, then we want to use getc()
+     * instead of fread(), to make sure we stop fetching input after
+     * each newline.
+     */
+    int yy_is_interactive;
+
+    /* Whether we're considered to be at the beginning of a line.
+     * If so, '^' rules will be active on the next match, otherwise
+     * not.
+     */
+    int yy_at_bol;
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
 
-	int yy_buffer_status;
+    /* Whether to try to fill the input buffer when we reach the
+     * end of it.
+     */
+    int yy_fill_buffer;
 
-	};
+    int yy_buffer_status;
+
+    };
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
 /* %if-c-only Standard (non-C++) definition */
@@ -365,14 +363,8 @@
 
 /* %if-reentrant */
 
-int yypirlex_init (yyscan_t* scanner);
-
-int yypirlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
-
 /* %endif */
 
-/* %endif End reentrant structures and macros. */
-
 /* Accessor methods to globals.
    These are made visible to non-reentrant scanners for convenience. */
 
@@ -409,6 +401,7 @@
 void yypirset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
 
 /* %endif */
+/* %endif End reentrant structures and macros. */
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -467,11 +460,9 @@
 #define YY_DECL_IS_OURS 1
 /* %if-c-only Standard (non-C++) definition */
 
-extern int yypirlex \
-               (YYSTYPE * yylval_param ,yyscan_t yyscanner);
+extern int yypirlex (YYSTYPE * yylval_param ,yyscan_t yyscanner);
 
-#define YY_DECL int yypirlex \
-               (YYSTYPE * yylval_param , yyscan_t yyscanner)
+#define YY_DECL int yypirlex (YYSTYPE * yylval_param , yyscan_t yyscanner)
 /* %endif */
 /* %if-c++-only C++ definition */
 /* %endif */
@@ -501,9 +492,9 @@
 #undef YY_DECL
 #endif
 
-#line 1030 "pir.l"
+#line 1040 "pir.l"
 
 
-#line 508 "pirlexer.h"
+#line 499 "pirlexer.h"
 #undef yypirIN_HEADER
 #endif /* yypirHEADER_H */

Modified: branches/pdd22io_part3/compilers/pirc/new/pirparser.c
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pirparser.c	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pirparser.c	Mon Dec 29 23:28:53 2008
@@ -124,71 +124,72 @@
      TK_NREG = 305,
      TK_SREG = 306,
      TK_IREG = 307,
-     TK_ARROW = 308,
-     TK_NE = 309,
-     TK_EQ = 310,
-     TK_LT = 311,
-     TK_LE = 312,
-     TK_GT = 313,
-     TK_GE = 314,
-     TK_USHIFT = 315,
-     TK_RSHIFT = 316,
-     TK_LSHIFT = 317,
-     TK_FDIV = 318,
-     TK_OR = 319,
-     TK_AND = 320,
-     TK_XOR = 321,
-     TK_CONC = 322,
-     TK_ASSIGN_USHIFT = 323,
-     TK_ASSIGN_RSHIFT = 324,
-     TK_ASSIGN_LSHIFT = 325,
-     TK_ASSIGN_INC = 326,
-     TK_ASSIGN_DEC = 327,
-     TK_ASSIGN_MUL = 328,
-     TK_ASSIGN_MOD = 329,
-     TK_ASSIGN_POW = 330,
-     TK_ASSIGN_DIV = 331,
-     TK_ASSIGN_BOR = 332,
-     TK_ASSIGN_BAND = 333,
-     TK_ASSIGN_FDIV = 334,
-     TK_ASSIGN_BNOT = 335,
-     TK_ASSIGN_CONC = 336,
-     TK_FLAG_INIT = 337,
-     TK_FLAG_LOAD = 338,
-     TK_FLAG_MAIN = 339,
-     TK_FLAG_ANON = 340,
-     TK_FLAG_METHOD = 341,
-     TK_FLAG_OUTER = 342,
-     TK_FLAG_VTABLE = 343,
-     TK_FLAG_LEX = 344,
-     TK_FLAG_MULTI = 345,
-     TK_FLAG_POSTCOMP = 346,
-     TK_FLAG_IMMEDIATE = 347,
-     TK_FLAG_SUBID = 348,
-     TK_FLAG_INSTANCEOF = 349,
-     TK_FLAG_NSENTRY = 350,
-     TK_FLAG_UNIQUE_REG = 351,
-     TK_FLAG_NAMED = 352,
-     TK_FLAG_SLURPY = 353,
-     TK_FLAG_FLAT = 354,
-     TK_FLAG_OPTIONAL = 355,
-     TK_FLAG_OPT_FLAG = 356,
-     TK_FLAG_INVOCANT = 357,
-     TK_MACRO = 358,
-     TK_ENDM = 359,
-     TK_MACRO_LOCAL = 360,
-     TK_MACRO_LABEL = 361,
-     TK_MACRO_CONST = 362,
-     TK_MACRO_LABEL_ID = 363,
-     TK_MACRO_LOCAL_ID = 364,
-     TK_MACRO_IDENT = 365,
-     TK_MACRO_ARG_IDENT = 366,
-     TK_MACRO_ARG_OTHER = 367,
-     TK_MACRO_CONST_VAL = 368,
-     TK_PASM_MARKER_START = 369,
-     TK_PIR_MARKER_START = 370,
-     TK_PCC_SUB = 371,
-     TK_PARROT_OP = 372
+     TK_CONST_VALUE = 308,
+     TK_ARROW = 309,
+     TK_NE = 310,
+     TK_EQ = 311,
+     TK_LT = 312,
+     TK_LE = 313,
+     TK_GT = 314,
+     TK_GE = 315,
+     TK_USHIFT = 316,
+     TK_RSHIFT = 317,
+     TK_LSHIFT = 318,
+     TK_FDIV = 319,
+     TK_OR = 320,
+     TK_AND = 321,
+     TK_XOR = 322,
+     TK_CONC = 323,
+     TK_ASSIGN_USHIFT = 324,
+     TK_ASSIGN_RSHIFT = 325,
+     TK_ASSIGN_LSHIFT = 326,
+     TK_ASSIGN_INC = 327,
+     TK_ASSIGN_DEC = 328,
+     TK_ASSIGN_MUL = 329,
+     TK_ASSIGN_MOD = 330,
+     TK_ASSIGN_POW = 331,
+     TK_ASSIGN_DIV = 332,
+     TK_ASSIGN_BOR = 333,
+     TK_ASSIGN_BAND = 334,
+     TK_ASSIGN_FDIV = 335,
+     TK_ASSIGN_BNOT = 336,
+     TK_ASSIGN_CONC = 337,
+     TK_FLAG_INIT = 338,
+     TK_FLAG_LOAD = 339,
+     TK_FLAG_MAIN = 340,
+     TK_FLAG_ANON = 341,
+     TK_FLAG_METHOD = 342,
+     TK_FLAG_OUTER = 343,
+     TK_FLAG_VTABLE = 344,
+     TK_FLAG_LEX = 345,
+     TK_FLAG_MULTI = 346,
+     TK_FLAG_POSTCOMP = 347,
+     TK_FLAG_IMMEDIATE = 348,
+     TK_FLAG_SUBID = 349,
+     TK_FLAG_INSTANCEOF = 350,
+     TK_FLAG_NSENTRY = 351,
+     TK_FLAG_UNIQUE_REG = 352,
+     TK_FLAG_NAMED = 353,
+     TK_FLAG_SLURPY = 354,
+     TK_FLAG_FLAT = 355,
+     TK_FLAG_OPTIONAL = 356,
+     TK_FLAG_OPT_FLAG = 357,
+     TK_FLAG_INVOCANT = 358,
+     TK_MACRO = 359,
+     TK_ENDM = 360,
+     TK_MACRO_LOCAL = 361,
+     TK_MACRO_LABEL = 362,
+     TK_MACRO_CONST = 363,
+     TK_MACRO_LABEL_ID = 364,
+     TK_MACRO_LOCAL_ID = 365,
+     TK_MACRO_IDENT = 366,
+     TK_MACRO_ARG_IDENT = 367,
+     TK_MACRO_ARG_OTHER = 368,
+     TK_MACRO_CONST_VAL = 369,
+     TK_PASM_MARKER_START = 370,
+     TK_PIR_MARKER_START = 371,
+     TK_PCC_SUB = 372,
+     TK_PARROT_OP = 373
    };
 #endif
 /* Tokens.  */
@@ -242,71 +243,72 @@
 #define TK_NREG 305
 #define TK_SREG 306
 #define TK_IREG 307
-#define TK_ARROW 308
-#define TK_NE 309
-#define TK_EQ 310
-#define TK_LT 311
-#define TK_LE 312
-#define TK_GT 313
-#define TK_GE 314
-#define TK_USHIFT 315
-#define TK_RSHIFT 316
-#define TK_LSHIFT 317
-#define TK_FDIV 318
-#define TK_OR 319
-#define TK_AND 320
-#define TK_XOR 321
-#define TK_CONC 322
-#define TK_ASSIGN_USHIFT 323
-#define TK_ASSIGN_RSHIFT 324
-#define TK_ASSIGN_LSHIFT 325
-#define TK_ASSIGN_INC 326
-#define TK_ASSIGN_DEC 327
-#define TK_ASSIGN_MUL 328
-#define TK_ASSIGN_MOD 329
-#define TK_ASSIGN_POW 330
-#define TK_ASSIGN_DIV 331
-#define TK_ASSIGN_BOR 332
-#define TK_ASSIGN_BAND 333
-#define TK_ASSIGN_FDIV 334
-#define TK_ASSIGN_BNOT 335
-#define TK_ASSIGN_CONC 336
-#define TK_FLAG_INIT 337
-#define TK_FLAG_LOAD 338
-#define TK_FLAG_MAIN 339
-#define TK_FLAG_ANON 340
-#define TK_FLAG_METHOD 341
-#define TK_FLAG_OUTER 342
-#define TK_FLAG_VTABLE 343
-#define TK_FLAG_LEX 344
-#define TK_FLAG_MULTI 345
-#define TK_FLAG_POSTCOMP 346
-#define TK_FLAG_IMMEDIATE 347
-#define TK_FLAG_SUBID 348
-#define TK_FLAG_INSTANCEOF 349
-#define TK_FLAG_NSENTRY 350
-#define TK_FLAG_UNIQUE_REG 351
-#define TK_FLAG_NAMED 352
-#define TK_FLAG_SLURPY 353
-#define TK_FLAG_FLAT 354
-#define TK_FLAG_OPTIONAL 355
-#define TK_FLAG_OPT_FLAG 356
-#define TK_FLAG_INVOCANT 357
-#define TK_MACRO 358
-#define TK_ENDM 359
-#define TK_MACRO_LOCAL 360
-#define TK_MACRO_LABEL 361
-#define TK_MACRO_CONST 362
-#define TK_MACRO_LABEL_ID 363
-#define TK_MACRO_LOCAL_ID 364
-#define TK_MACRO_IDENT 365
-#define TK_MACRO_ARG_IDENT 366
-#define TK_MACRO_ARG_OTHER 367
-#define TK_MACRO_CONST_VAL 368
-#define TK_PASM_MARKER_START 369
-#define TK_PIR_MARKER_START 370
-#define TK_PCC_SUB 371
-#define TK_PARROT_OP 372
+#define TK_CONST_VALUE 308
+#define TK_ARROW 309
+#define TK_NE 310
+#define TK_EQ 311
+#define TK_LT 312
+#define TK_LE 313
+#define TK_GT 314
+#define TK_GE 315
+#define TK_USHIFT 316
+#define TK_RSHIFT 317
+#define TK_LSHIFT 318
+#define TK_FDIV 319
+#define TK_OR 320
+#define TK_AND 321
+#define TK_XOR 322
+#define TK_CONC 323
+#define TK_ASSIGN_USHIFT 324
+#define TK_ASSIGN_RSHIFT 325
+#define TK_ASSIGN_LSHIFT 326
+#define TK_ASSIGN_INC 327
+#define TK_ASSIGN_DEC 328
+#define TK_ASSIGN_MUL 329
+#define TK_ASSIGN_MOD 330
+#define TK_ASSIGN_POW 331
+#define TK_ASSIGN_DIV 332
+#define TK_ASSIGN_BOR 333
+#define TK_ASSIGN_BAND 334
+#define TK_ASSIGN_FDIV 335
+#define TK_ASSIGN_BNOT 336
+#define TK_ASSIGN_CONC 337
+#define TK_FLAG_INIT 338
+#define TK_FLAG_LOAD 339
+#define TK_FLAG_MAIN 340
+#define TK_FLAG_ANON 341
+#define TK_FLAG_METHOD 342
+#define TK_FLAG_OUTER 343
+#define TK_FLAG_VTABLE 344
+#define TK_FLAG_LEX 345
+#define TK_FLAG_MULTI 346
+#define TK_FLAG_POSTCOMP 347
+#define TK_FLAG_IMMEDIATE 348
+#define TK_FLAG_SUBID 349
+#define TK_FLAG_INSTANCEOF 350
+#define TK_FLAG_NSENTRY 351
+#define TK_FLAG_UNIQUE_REG 352
+#define TK_FLAG_NAMED 353
+#define TK_FLAG_SLURPY 354
+#define TK_FLAG_FLAT 355
+#define TK_FLAG_OPTIONAL 356
+#define TK_FLAG_OPT_FLAG 357
+#define TK_FLAG_INVOCANT 358
+#define TK_MACRO 359
+#define TK_ENDM 360
+#define TK_MACRO_LOCAL 361
+#define TK_MACRO_LABEL 362
+#define TK_MACRO_CONST 363
+#define TK_MACRO_LABEL_ID 364
+#define TK_MACRO_LOCAL_ID 365
+#define TK_MACRO_IDENT 366
+#define TK_MACRO_ARG_IDENT 367
+#define TK_MACRO_ARG_OTHER 368
+#define TK_MACRO_CONST_VAL 369
+#define TK_PASM_MARKER_START 370
+#define TK_PIR_MARKER_START 371
+#define TK_PCC_SUB 372
+#define TK_PARROT_OP 373
 
 
 
@@ -565,6 +567,7 @@
 {
     double              dval;
     int                 ival;
+    unsigned            uval;
     char   const       *sval;
     struct constant    *cval;
     struct instruction *instr;
@@ -578,7 +581,7 @@
     struct macro_param *pval;
 }
 /* Line 187 of yacc.c.  */
-#line 582 "pirparser.c"
+#line 585 "pirparser.c"
 	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
@@ -591,7 +594,7 @@
 
 
 /* Line 216 of yacc.c.  */
-#line 595 "pirparser.c"
+#line 598 "pirparser.c"
 
 #ifdef short
 # undef short
@@ -806,20 +809,20 @@
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  10
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   1014
+#define YYLAST   1073
 
 /* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  138
+#define YYNTOKENS  139
 /* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  163
+#define YYNNTS  166
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  415
+#define YYNRULES  421
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  646
+#define YYNSTATES  656
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
-#define YYMAXUTOK   373
+#define YYMAXUTOK   374
 
 #define YYTRANSLATE(YYX)						\
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -830,16 +833,16 @@
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,   129,     2,     2,     2,   134,   136,     2,
-     118,   119,   133,   131,   120,   128,   127,   132,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,   124,
-       2,   121,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,   130,     2,     2,     2,   135,   137,     2,
+     119,   120,   134,   132,   121,   129,   128,   133,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,   125,
+       2,   122,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,   122,     2,   123,     2,     2,     2,     2,     2,     2,
+       2,   123,     2,   124,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,   125,   135,   126,   130,     2,     2,     2,
+       2,     2,     2,   126,   136,   127,   131,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -864,7 +867,7 @@
       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
       95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
      105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
-     115,   116,   117,   137
+     115,   116,   117,   118,   138
 };
 
 #if YYDEBUG
@@ -878,213 +881,217 @@
       73,    75,    78,    81,    83,    85,    88,    92,    95,    98,
      101,   106,   109,   114,   119,   120,   122,   124,   128,   130,
      137,   139,   142,   144,   146,   147,   150,   152,   154,   156,
-     158,   160,   162,   164,   166,   171,   174,   177,   180,   183,
-     186,   188,   190,   192,   194,   195,   198,   203,   206,   207,
-     210,   212,   214,   216,   221,   223,   224,   227,   230,   232,
-     234,   236,   238,   240,   242,   244,   246,   248,   250,   252,
-     254,   256,   258,   260,   262,   264,   268,   269,   273,   274,
-     276,   278,   282,   284,   286,   289,   291,   295,   296,   299,
-     301,   303,   305,   308,   310,   313,   316,   320,   324,   327,
-     330,   332,   334,   336,   338,   339,   341,   343,   347,   351,
-     353,   355,   357,   359,   361,   363,   366,   370,   372,   376,
-     383,   388,   395,   398,   400,   402,   406,   410,   414,   418,
-     422,   426,   431,   436,   441,   445,   449,   453,   457,   461,
-     465,   469,   474,   480,   485,   490,   494,   498,   502,   506,
-     510,   514,   518,   522,   525,   531,   537,   543,   549,   555,
-     561,   567,   573,   579,   584,   590,   595,   600,   605,   610,
-     615,   620,   625,   630,   635,   640,   645,   650,   655,   659,
-     663,   667,   671,   675,   679,   683,   687,   691,   695,   699,
-     703,   705,   707,   709,   711,   713,   715,   719,   724,   726,
-     730,   733,   734,   736,   742,   744,   746,   748,   757,   758,
-     760,   762,   765,   769,   773,   776,   782,   783,   786,   787,
-     789,   791,   794,   798,   800,   803,   807,   811,   813,   815,
-     817,   822,   825,   827,   829,   831,   833,   835,   837,   839,
-     841,   845,   846,   848,   850,   854,   857,   858,   861,   863,
-     865,   867,   870,   872,   874,   876,   878,   880,   884,   888,
-     892,   896,   897,   899,   901,   905,   907,   909,   913,   916,
-     918,   924,   930,   931,   933,   935,   938,   942,   943,   945,
-     947,   950,   954,   955,   958,   960,   963,   964,   966,   970,
-     973,   975,   977,   980,   983,   988,   993,   998,  1003,  1005,
-    1007,  1009,  1011,  1013,  1015,  1017,  1019,  1021,  1023,  1025,
-    1027,  1029,  1031,  1033,  1035,  1037,  1039,  1041,  1043,  1045,
-    1047,  1049,  1051,  1053,  1055,  1057,  1059,  1061,  1063,  1065,
-    1067,  1069,  1071,  1073,  1075,  1077,  1079,  1081,  1083,  1085,
-    1087,  1089,  1091,  1093,  1095,  1097,  1099,  1101,  1103,  1105,
-    1107,  1109,  1111,  1113,  1115,  1117,  1119,  1121,  1123,  1125,
-    1127,  1129,  1131,  1133,  1135,  1137,  1139,  1141,  1143,  1146,
-    1148,  1150,  1153,  1155,  1158,  1160,  1163,  1166,  1168,  1171,
-    1174,  1176,  1178,  1180,  1184,  1186
+     158,   160,   162,   164,   167,   172,   175,   178,   181,   184,
+     187,   191,   192,   194,   196,   200,   202,   204,   206,   208,
+     209,   212,   217,   220,   221,   224,   226,   228,   230,   235,
+     237,   238,   241,   244,   246,   248,   250,   252,   254,   256,
+     258,   260,   262,   264,   266,   268,   270,   272,   274,   276,
+     278,   282,   283,   287,   288,   290,   292,   296,   298,   300,
+     303,   305,   309,   310,   313,   315,   317,   319,   322,   324,
+     327,   330,   334,   338,   341,   344,   346,   348,   350,   352,
+     353,   355,   357,   361,   365,   367,   369,   371,   373,   375,
+     377,   380,   384,   386,   390,   397,   402,   409,   412,   414,
+     416,   420,   424,   428,   432,   436,   440,   445,   450,   455,
+     459,   463,   467,   471,   475,   479,   483,   488,   494,   499,
+     504,   508,   512,   516,   520,   524,   528,   532,   536,   539,
+     545,   551,   557,   563,   569,   575,   581,   587,   593,   598,
+     604,   609,   614,   619,   624,   629,   634,   639,   644,   649,
+     654,   659,   664,   669,   673,   677,   681,   685,   689,   693,
+     697,   701,   705,   709,   713,   717,   719,   721,   723,   725,
+     727,   729,   733,   738,   740,   744,   747,   748,   750,   756,
+     758,   760,   762,   771,   772,   774,   776,   779,   783,   787,
+     790,   796,   797,   800,   801,   803,   805,   808,   812,   814,
+     817,   821,   825,   827,   829,   831,   836,   839,   841,   843,
+     845,   847,   849,   851,   853,   855,   859,   860,   862,   864,
+     868,   871,   872,   875,   877,   879,   881,   884,   886,   888,
+     890,   892,   894,   898,   902,   906,   910,   911,   913,   915,
+     919,   921,   923,   927,   930,   932,   938,   944,   945,   947,
+     949,   952,   956,   957,   959,   961,   964,   968,   969,   972,
+     974,   977,   978,   980,   984,   987,   989,   991,   994,   997,
+    1002,  1007,  1012,  1017,  1019,  1021,  1023,  1025,  1027,  1029,
+    1031,  1033,  1035,  1037,  1039,  1041,  1043,  1045,  1047,  1049,
+    1051,  1053,  1055,  1057,  1059,  1061,  1063,  1065,  1067,  1069,
+    1071,  1073,  1075,  1077,  1079,  1081,  1083,  1085,  1087,  1089,
+    1091,  1093,  1095,  1097,  1099,  1101,  1103,  1105,  1107,  1109,
+    1111,  1113,  1115,  1117,  1119,  1121,  1123,  1125,  1127,  1129,
+    1131,  1133,  1135,  1137,  1139,  1141,  1143,  1145,  1147,  1149,
+    1151,  1153,  1155,  1157,  1159,  1162,  1164,  1166,  1169,  1171,
+    1174,  1176,  1179,  1182,  1184,  1187,  1190,  1192,  1194,  1196,
+    1200,  1202
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 static const yytype_int16 yyrhs[] =
 {
-     139,     0,    -1,   115,   140,    -1,   114,   292,    -1,   141,
-     142,   141,    -1,    -1,    35,    -1,   143,    -1,   142,    35,
-     143,    -1,   166,    -1,   277,    -1,   162,    -1,   160,    -1,
-     161,    -1,   157,    -1,   158,    -1,   159,    -1,   144,    -1,
-     145,    -1,   146,    -1,   107,    37,   113,    -1,   147,   118,
-     148,   119,    35,   151,   104,    -1,   103,   287,    -1,    -1,
-     149,    -1,   150,    -1,   149,   120,   150,    -1,   287,    -1,
-      -1,   152,    -1,   153,    -1,   152,   153,    -1,   154,    35,
-      -1,   155,    -1,   156,    -1,   106,   108,    -1,   105,   283,
-     109,    -1,     5,    46,    -1,    10,    47,    -1,    11,    46,
-      -1,    34,    46,   120,    46,    -1,     3,    46,    -1,     4,
-      46,   121,    46,    -1,    13,   122,   163,   123,    -1,    -1,
-     164,    -1,   165,    -1,   164,   124,   165,    -1,    46,    -1,
-     168,   170,    35,   173,   181,   167,    -1,     7,    -1,     6,
-     169,    -1,   287,    -1,    46,    -1,    -1,   170,   171,    -1,
-      85,    -1,    82,    -1,    83,    -1,    84,    -1,    89,    -1,
-      91,    -1,    92,    -1,    90,    -1,    87,   118,   169,   119,
-      -1,    86,   273,    -1,    88,   273,    -1,    93,   274,    -1,
-      94,   274,    -1,    95,   274,    -1,   287,    -1,    46,    -1,
-     208,    -1,   174,    -1,    -1,   174,   175,    -1,     8,   176,
-     177,    35,    -1,   283,   287,    -1,    -1,   177,   178,    -1,
-     251,    -1,   179,    -1,   180,    -1,   102,   118,   172,   119,
-      -1,    96,    -1,    -1,   181,   182,    -1,    36,   183,    -1,
-     183,    -1,   198,    -1,   215,    -1,   221,    -1,   222,    -1,
-     226,    -1,   275,    -1,   252,    -1,   227,    -1,   211,    -1,
-     197,    -1,   196,    -1,   193,    -1,   194,    -1,   184,    -1,
-     195,    -1,   185,    -1,   110,   186,    35,    -1,    -1,   118,
-     187,   119,    -1,    -1,   188,    -1,   189,    -1,   188,   120,
-     189,    -1,   111,    -1,   112,    -1,   110,   186,    -1,   190,
-      -1,   125,   191,   126,    -1,    -1,   191,   192,    -1,    35,
-      -1,   112,    -1,   111,    -1,   110,   186,    -1,    35,    -1,
-     158,    35,    -1,     1,    35,    -1,    44,   284,    35,    -1,
-      28,   246,    35,    -1,   199,    35,    -1,   200,   201,    -1,
-     210,    -1,    37,    -1,   202,    -1,   204,    -1,    -1,   203,
-      -1,   205,    -1,   203,   120,   205,    -1,   208,   121,   280,
-      -1,   206,    -1,   208,    -1,   281,    -1,   287,    -1,   286,
-      -1,   207,    -1,   245,   208,    -1,   122,   209,   123,    -1,
-     280,    -1,   209,   124,   280,    -1,   284,   121,   200,   206,
-     120,   203,    -1,   284,   121,   200,   206,    -1,   284,   121,
-     200,   208,   120,   203,    -1,   213,    35,    -1,    37,    -1,
-     288,    -1,   284,   121,    47,    -1,   284,   121,    48,    -1,
-     284,   121,    46,    -1,   284,   121,   286,    -1,   284,   121,
-     212,    -1,   284,   121,   214,    -1,   284,   121,   200,   208,
-      -1,   284,   121,   288,   208,    -1,   284,   121,    49,   208,
-      -1,   284,   291,   280,    -1,   284,    71,    47,    -1,   284,
-      71,    48,    -1,   284,    72,    47,    -1,   284,    72,    48,
-      -1,   284,    71,   284,    -1,   284,    72,   284,    -1,   284,
-     121,   289,   280,    -1,   284,   121,   284,   290,   280,    -1,
-     288,   208,   121,   280,    -1,    49,   208,   121,   280,    -1,
-      47,   290,   284,    -1,    48,   290,   284,    -1,    46,   290,
-     284,    -1,    46,   290,    46,    -1,    47,   290,    47,    -1,
-      48,   290,    48,    -1,    47,   290,    48,    -1,    48,   290,
-      47,    -1,   216,    35,    -1,   219,    44,    37,    45,   287,
-      -1,   219,    44,    38,    45,   287,    -1,   219,    44,    39,
-      45,   287,    -1,   219,    44,    40,    45,   287,    -1,   219,
-      44,    41,    45,   287,    -1,   219,    44,    42,    45,   287,
-      -1,   219,    44,    43,    45,   287,    -1,   219,    44,    45,
-      45,   287,    -1,   219,    44,    44,    45,   287,    -1,   219,
-     281,   220,   287,    -1,   219,    44,    49,   220,   287,    -1,
-     219,    37,   220,   287,    -1,   219,   286,   220,   287,    -1,
-     219,    38,   220,   287,    -1,   219,    39,   220,   287,    -1,
-     219,    40,   220,   287,    -1,   219,    41,   220,   287,    -1,
-     219,    42,   220,   287,    -1,   219,    43,   220,   287,    -1,
-     219,    45,    45,   287,    -1,   219,    45,   120,   287,    -1,
-     219,    44,    45,   287,    -1,   219,    44,   120,   287,    -1,
-     219,   217,    45,   287,    -1,   284,   282,   280,    -1,    47,
-     282,   284,    -1,    48,   282,   284,    -1,    46,   282,   284,
-      -1,    47,   282,    47,    -1,    47,   282,    48,    -1,    48,
-     282,    47,    -1,    48,   282,    48,    -1,    46,   282,    46,
-      -1,    46,   282,   218,    -1,    47,   282,    46,    -1,    48,
-     282,    46,    -1,    47,    -1,    48,    -1,    42,    -1,    43,
-      -1,    45,    -1,   120,    -1,    45,   287,    35,    -1,    12,
-     283,   223,    35,    -1,   224,    -1,   223,   120,   224,    -1,
-     287,   225,    -1,    -1,    96,    -1,     9,    46,   120,   245,
-      35,    -1,   228,    -1,   229,    -1,   238,    -1,    26,    35,
-     230,   233,    35,   235,    27,    35,    -1,    -1,   231,    -1,
-     232,    -1,   231,   232,    -1,    30,   261,    35,    -1,    29,
-     245,   234,    -1,    32,   245,    -1,    14,   245,    35,    15,
-     244,    -1,    -1,   120,   245,    -1,    -1,   236,    -1,   237,
-      -1,   236,   237,    -1,    31,   249,    35,    -1,   222,    -1,
-     239,    35,    -1,   246,   121,   240,    -1,   284,   121,   240,
-      -1,   240,    -1,   242,    -1,   241,    -1,   245,   127,   244,
-     256,    -1,   243,   256,    -1,   245,    -1,    46,    -1,   287,
-      -1,    49,    -1,    51,    -1,    46,    -1,   287,    -1,    49,
-      -1,   118,   247,   119,    -1,    -1,   248,    -1,   249,    -1,
-     248,   120,   249,    -1,   284,   250,    -1,    -1,   250,   251,
-      -1,   100,    -1,   101,    -1,    98,    -1,    97,   273,    -1,
-     253,    -1,   254,    -1,   263,    -1,   255,    -1,   264,    -1,
-      18,   256,    35,    -1,    33,   240,    35,    -1,    19,   256,
-      35,    -1,   118,   257,   119,    -1,    -1,   258,    -1,   259,
-      -1,   258,   120,   259,    -1,   261,    -1,   260,    -1,    46,
-      53,   262,    -1,   262,   271,    -1,   280,    -1,    24,    35,
-     268,    25,    35,    -1,    22,    35,   265,    23,    35,    -1,
-      -1,   266,    -1,   267,    -1,   266,   267,    -1,    20,   261,
-      35,    -1,    -1,   269,    -1,   270,    -1,   269,   270,    -1,
-      21,   261,    35,    -1,    -1,   271,   272,    -1,    99,    -1,
-      97,   273,    -1,    -1,   274,    -1,   118,    46,   119,    -1,
-     276,    35,    -1,   277,    -1,   278,    -1,    17,   279,    -1,
-      16,   279,    -1,    38,   287,   121,    47,    -1,    39,   287,
-     121,    48,    -1,    41,   287,   121,    46,    -1,    46,   287,
-     121,   281,    -1,   284,    -1,   281,    -1,    46,    -1,    47,
-      -1,    48,    -1,    54,    -1,    55,    -1,    56,    -1,    57,
-      -1,    59,    -1,    58,    -1,    38,    -1,    39,    -1,    40,
-      -1,    41,    -1,   285,    -1,   286,    -1,   287,    -1,    49,
-      -1,    50,    -1,    52,    -1,    51,    -1,    37,    -1,   288,
-      -1,    42,    -1,    43,    -1,    45,    -1,    38,    -1,    39,
-      -1,    41,    -1,    40,    -1,    44,    -1,   128,    -1,   129,
-      -1,   130,    -1,   131,    -1,   128,    -1,   132,    -1,   133,
-      -1,   134,    -1,   135,    -1,   136,    -1,   130,    -1,   137,
-      -1,    67,    -1,    60,    -1,    61,    -1,    62,    -1,    64,
-      -1,    65,    -1,    63,    -1,    66,    -1,    55,    -1,    57,
-      -1,    56,    -1,    59,    -1,    58,    -1,    54,    -1,    73,
-      -1,    74,    -1,    75,    -1,    76,    -1,    79,    -1,    77,
-      -1,    78,    -1,    80,    -1,    81,    -1,    69,    -1,    70,
-      -1,    68,    -1,   293,   294,    -1,   141,    -1,   295,    -1,
-     294,   295,    -1,   296,    -1,   162,    35,    -1,   226,    -1,
-     158,    35,    -1,   144,    35,    -1,   185,    -1,    36,   297,
-      -1,   298,   297,    -1,   300,    -1,   193,    -1,   300,    -1,
-     299,   170,    36,    -1,   116,    -1,   200,   202,    35,    -1
+     140,     0,    -1,   116,   141,    -1,   115,   296,    -1,   142,
+     143,   142,    -1,    -1,    35,    -1,   144,    -1,   143,    35,
+     144,    -1,   167,    -1,   281,    -1,   163,    -1,   161,    -1,
+     162,    -1,   158,    -1,   159,    -1,   160,    -1,   145,    -1,
+     146,    -1,   147,    -1,   108,    37,   114,    -1,   148,   119,
+     149,   120,    35,   152,   105,    -1,   104,   291,    -1,    -1,
+     150,    -1,   151,    -1,   150,   121,   151,    -1,   291,    -1,
+      -1,   153,    -1,   154,    -1,   153,   154,    -1,   155,    35,
+      -1,   156,    -1,   157,    -1,   107,   109,    -1,   106,   287,
+     110,    -1,     5,    46,    -1,    10,    47,    -1,    11,    46,
+      -1,    34,    46,   121,    46,    -1,     3,    46,    -1,     4,
+      46,   122,    46,    -1,    13,   123,   164,   124,    -1,    -1,
+     165,    -1,   166,    -1,   165,   125,   166,    -1,    46,    -1,
+     169,   171,    35,   177,   185,   168,    -1,     7,    -1,     6,
+     170,    -1,   291,    -1,    46,    -1,    -1,   171,   172,    -1,
+      86,    -1,    83,    -1,    84,    -1,    85,    -1,    90,    -1,
+      92,    -1,    93,    -1,    91,   173,    -1,    88,   119,   170,
+     120,    -1,    87,   277,    -1,    89,   277,    -1,    94,   278,
+      -1,    95,   278,    -1,    96,   278,    -1,   119,   174,   120,
+      -1,    -1,   175,    -1,   176,    -1,   175,   121,   176,    -1,
+     291,    -1,    46,    -1,   212,    -1,   178,    -1,    -1,   178,
+     179,    -1,     8,   180,   181,    35,    -1,   287,   291,    -1,
+      -1,   181,   182,    -1,   255,    -1,   183,    -1,   184,    -1,
+     103,   119,   176,   120,    -1,    97,    -1,    -1,   185,   186,
+      -1,    36,   187,    -1,   187,    -1,   202,    -1,   219,    -1,
+     225,    -1,   226,    -1,   230,    -1,   279,    -1,   256,    -1,
+     231,    -1,   215,    -1,   201,    -1,   200,    -1,   197,    -1,
+     198,    -1,   188,    -1,   199,    -1,   189,    -1,   111,   190,
+      35,    -1,    -1,   119,   191,   120,    -1,    -1,   192,    -1,
+     193,    -1,   192,   121,   193,    -1,   112,    -1,   113,    -1,
+     111,   190,    -1,   194,    -1,   126,   195,   127,    -1,    -1,
+     195,   196,    -1,    35,    -1,   113,    -1,   112,    -1,   111,
+     190,    -1,    35,    -1,   159,    35,    -1,     1,    35,    -1,
+      44,   288,    35,    -1,    28,   250,    35,    -1,   203,    35,
+      -1,   204,   205,    -1,   214,    -1,    37,    -1,   206,    -1,
+     208,    -1,    -1,   207,    -1,   209,    -1,   207,   121,   209,
+      -1,   212,   122,   284,    -1,   210,    -1,   212,    -1,   285,
+      -1,   291,    -1,   290,    -1,   211,    -1,   249,   212,    -1,
+     123,   213,   124,    -1,   284,    -1,   213,   125,   284,    -1,
+     288,   122,   204,   210,   121,   207,    -1,   288,   122,   204,
+     210,    -1,   288,   122,   204,   212,   121,   207,    -1,   217,
+      35,    -1,    37,    -1,   292,    -1,   288,   122,    47,    -1,
+     288,   122,    48,    -1,   288,   122,    46,    -1,   288,   122,
+     290,    -1,   288,   122,   216,    -1,   288,   122,   218,    -1,
+     288,   122,   204,   212,    -1,   288,   122,   292,   212,    -1,
+     288,   122,    49,   212,    -1,   288,   295,   284,    -1,   288,
+      72,    47,    -1,   288,    72,    48,    -1,   288,    73,    47,
+      -1,   288,    73,    48,    -1,   288,    72,   288,    -1,   288,
+      73,   288,    -1,   288,   122,   293,   284,    -1,   288,   122,
+     288,   294,   284,    -1,   292,   212,   122,   284,    -1,    49,
+     212,   122,   284,    -1,    47,   294,   288,    -1,    48,   294,
+     288,    -1,    46,   294,   288,    -1,    46,   294,    46,    -1,
+      47,   294,    47,    -1,    48,   294,    48,    -1,    47,   294,
+      48,    -1,    48,   294,    47,    -1,   220,    35,    -1,   223,
+      44,    37,    45,   291,    -1,   223,    44,    38,    45,   291,
+      -1,   223,    44,    39,    45,   291,    -1,   223,    44,    40,
+      45,   291,    -1,   223,    44,    41,    45,   291,    -1,   223,
+      44,    42,    45,   291,    -1,   223,    44,    43,    45,   291,
+      -1,   223,    44,    45,    45,   291,    -1,   223,    44,    44,
+      45,   291,    -1,   223,   285,   224,   291,    -1,   223,    44,
+      49,   224,   291,    -1,   223,    37,   224,   291,    -1,   223,
+     290,   224,   291,    -1,   223,    38,   224,   291,    -1,   223,
+      39,   224,   291,    -1,   223,    40,   224,   291,    -1,   223,
+      41,   224,   291,    -1,   223,    42,   224,   291,    -1,   223,
+      43,   224,   291,    -1,   223,    45,    45,   291,    -1,   223,
+      45,   121,   291,    -1,   223,    44,    45,   291,    -1,   223,
+      44,   121,   291,    -1,   223,   221,    45,   291,    -1,   288,
+     286,   284,    -1,    47,   286,   288,    -1,    48,   286,   288,
+      -1,    46,   286,   288,    -1,    47,   286,    47,    -1,    47,
+     286,    48,    -1,    48,   286,    47,    -1,    48,   286,    48,
+      -1,    46,   286,    46,    -1,    46,   286,   222,    -1,    47,
+     286,    46,    -1,    48,   286,    46,    -1,    47,    -1,    48,
+      -1,    42,    -1,    43,    -1,    45,    -1,   121,    -1,    45,
+     291,    35,    -1,    12,   287,   227,    35,    -1,   228,    -1,
+     227,   121,   228,    -1,   291,   229,    -1,    -1,    97,    -1,
+       9,    46,   121,   249,    35,    -1,   232,    -1,   233,    -1,
+     242,    -1,    26,    35,   234,   237,    35,   239,    27,    35,
+      -1,    -1,   235,    -1,   236,    -1,   235,   236,    -1,    30,
+     265,    35,    -1,    29,   247,   238,    -1,    32,   249,    -1,
+      14,   249,    35,    15,   248,    -1,    -1,   121,   249,    -1,
+      -1,   240,    -1,   241,    -1,   240,   241,    -1,    31,   253,
+      35,    -1,   226,    -1,   243,    35,    -1,   250,   122,   244,
+      -1,   288,   122,   244,    -1,   244,    -1,   246,    -1,   245,
+      -1,   249,   128,   248,   260,    -1,   247,   260,    -1,   249,
+      -1,    46,    -1,   291,    -1,    49,    -1,    51,    -1,    46,
+      -1,   291,    -1,    49,    -1,   119,   251,   120,    -1,    -1,
+     252,    -1,   253,    -1,   252,   121,   253,    -1,   288,   254,
+      -1,    -1,   254,   255,    -1,   101,    -1,   102,    -1,    99,
+      -1,    98,   277,    -1,   257,    -1,   258,    -1,   267,    -1,
+     259,    -1,   268,    -1,    18,   260,    35,    -1,    33,   244,
+      35,    -1,    19,   260,    35,    -1,   119,   261,   120,    -1,
+      -1,   262,    -1,   263,    -1,   262,   121,   263,    -1,   265,
+      -1,   264,    -1,    46,    54,   266,    -1,   266,   275,    -1,
+     284,    -1,    24,    35,   272,    25,    35,    -1,    22,    35,
+     269,    23,    35,    -1,    -1,   270,    -1,   271,    -1,   270,
+     271,    -1,    20,   265,    35,    -1,    -1,   273,    -1,   274,
+      -1,   273,   274,    -1,    21,   265,    35,    -1,    -1,   275,
+     276,    -1,   100,    -1,    98,   277,    -1,    -1,   278,    -1,
+     119,    46,   120,    -1,   280,    35,    -1,   281,    -1,   282,
+      -1,    17,   283,    -1,    16,   283,    -1,    38,   291,   122,
+      47,    -1,    39,   291,   122,    48,    -1,    41,   291,   122,
+      46,    -1,    46,   291,   122,   285,    -1,   288,    -1,   285,
+      -1,    46,    -1,    47,    -1,    48,    -1,    53,    -1,    55,
+      -1,    56,    -1,    57,    -1,    58,    -1,    60,    -1,    59,
+      -1,    38,    -1,    39,    -1,    40,    -1,    41,    -1,   289,
+      -1,   290,    -1,   291,    -1,    49,    -1,    50,    -1,    52,
+      -1,    51,    -1,    37,    -1,   292,    -1,    42,    -1,    43,
+      -1,    45,    -1,    38,    -1,    39,    -1,    41,    -1,    40,
+      -1,    44,    -1,   129,    -1,   130,    -1,   131,    -1,   132,
+      -1,   129,    -1,   133,    -1,   134,    -1,   135,    -1,   136,
+      -1,   137,    -1,   131,    -1,   138,    -1,    68,    -1,    61,
+      -1,    62,    -1,    63,    -1,    65,    -1,    66,    -1,    64,
+      -1,    67,    -1,    56,    -1,    58,    -1,    57,    -1,    60,
+      -1,    59,    -1,    55,    -1,    74,    -1,    75,    -1,    76,
+      -1,    77,    -1,    80,    -1,    78,    -1,    79,    -1,    81,
+      -1,    82,    -1,    70,    -1,    71,    -1,    69,    -1,   297,
+     298,    -1,   142,    -1,   299,    -1,   298,   299,    -1,   300,
+      -1,   163,    35,    -1,   230,    -1,   159,    35,    -1,   145,
+      35,    -1,   189,    -1,    36,   301,    -1,   302,   301,    -1,
+     304,    -1,   197,    -1,   304,    -1,   303,   171,    36,    -1,
+     117,    -1,   204,   206,    35,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   539,   539,   540,   545,   551,   552,   555,   556,   559,
-     560,   561,   562,   563,   564,   565,   566,   567,   574,   575,
-     578,   582,   588,   595,   596,   599,   600,   603,   607,   608,
-     611,   612,   615,   618,   619,   622,   626,   637,   641,   643,
-     647,   652,   656,   660,   665,   666,   670,   672,   676,   680,
-     686,   690,   694,   695,   698,   699,   702,   704,   706,   708,
-     710,   712,   714,   716,   718,   720,   722,   724,   726,   728,
-     732,   733,   734,   737,   755,   756,   760,   764,   769,   770,
-     774,   775,   776,   779,   786,   792,   793,   803,   805,   808,
-     809,   810,   811,   812,   813,   814,   815,   816,   817,   818,
-     819,   820,   821,   822,   828,   831,   836,   837,   842,   843,
-     846,   848,   856,   864,   865,   867,   870,   876,   877,   886,
-     887,   888,   889,   897,   901,   905,   914,   921,   928,   931,
-     932,   935,   944,   951,   954,   955,   958,   959,   962,   998,
-    1000,  1007,  1009,  1014,  1016,  1020,  1043,  1047,  1049,  1058,
-    1069,  1081,  1091,  1094,  1095,  1098,  1107,  1116,  1121,  1126,
-    1147,  1152,  1192,  1210,  1217,  1222,  1233,  1244,  1255,  1266,
-    1271,  1276,  1281,  1291,  1310,  1344,  1346,  1348,  1350,  1352,
-    1354,  1356,  1358,  1363,  1372,  1374,  1376,  1378,  1380,  1382,
-    1384,  1386,  1388,  1390,  1402,  1407,  1409,  1411,  1413,  1415,
-    1417,  1419,  1421,  1423,  1425,  1427,  1429,  1431,  1462,  1488,
-    1496,  1505,  1514,  1516,  1518,  1520,  1522,  1526,  1531,  1533,
-    1538,  1539,  1542,  1543,  1546,  1547,  1550,  1558,  1562,  1564,
-    1568,  1572,  1573,  1576,  1591,  1595,  1596,  1599,  1611,  1612,
-    1616,  1618,  1622,  1626,  1628,  1630,  1636,  1637,  1642,  1643,
-    1647,  1649,  1658,  1660,  1664,  1668,  1670,  1672,  1676,  1677,
-    1680,  1700,  1707,  1709,  1719,  1736,  1738,  1740,  1744,  1753,
-    1758,  1763,  1764,  1768,  1770,  1774,  1779,  1780,  1784,  1786,
-    1788,  1790,  1800,  1804,  1805,  1806,  1807,  1810,  1815,  1826,
-    1833,  1838,  1839,  1843,  1845,  1849,  1850,  1853,  1857,  1861,
-    1865,  1874,  1884,  1885,  1890,  1892,  1897,  1902,  1903,  1907,
-    1909,  1913,  1919,  1920,  1924,  1926,  1934,  1935,  1939,  1943,
-    1946,  1947,  1950,  1954,  1958,  1960,  1962,  1964,  1972,  1973,
-    1977,  1978,  1979,  1982,  1983,  1984,  1985,  1986,  1987,  1990,
-    1991,  1992,  1993,  2001,  2004,  2005,  2017,  2018,  2019,  2020,
-    2024,  2025,  2028,  2029,  2030,  2031,  2032,  2033,  2034,  2035,
-    2038,  2039,  2040,  2043,  2044,  2045,  2046,  2047,  2048,  2049,
-    2050,  2051,  2052,  2053,  2054,  2055,  2056,  2057,  2058,  2059,
-    2060,  2061,  2062,  2063,  2064,  2065,  2071,  2072,  2073,  2074,
-    2075,  2076,  2077,  2078,  2079,  2080,  2081,  2082,  2094,  2102,
-    2106,  2107,  2110,  2111,  2112,  2113,  2114,  2115,  2118,  2120,
-    2121,  2124,  2125,  2128,  2132,  2137
+       0,   545,   545,   546,   551,   557,   558,   561,   562,   565,
+     566,   567,   568,   569,   570,   571,   572,   573,   580,   581,
+     584,   588,   594,   601,   602,   605,   606,   609,   613,   614,
+     617,   618,   621,   624,   625,   628,   632,   643,   647,   649,
+     653,   658,   662,   666,   671,   672,   676,   678,   682,   686,
+     692,   696,   700,   701,   704,   705,   708,   710,   712,   714,
+     716,   718,   720,   722,   724,   726,   728,   730,   732,   734,
+     738,   743,   747,   751,   760,   771,   773,   775,   779,   788,
+     789,   793,   797,   802,   803,   807,   808,   809,   812,   819,
+     825,   826,   836,   838,   841,   842,   843,   844,   845,   846,
+     847,   848,   849,   850,   851,   852,   853,   854,   855,   861,
+     864,   869,   870,   875,   876,   879,   881,   889,   897,   898,
+     900,   903,   909,   910,   919,   920,   921,   922,   930,   934,
+     938,   947,   954,   961,   964,   965,   968,   977,   984,   987,
+     988,   991,   992,   995,  1031,  1033,  1040,  1042,  1047,  1049,
+    1053,  1076,  1080,  1082,  1091,  1102,  1114,  1124,  1127,  1128,
+    1131,  1140,  1149,  1154,  1159,  1180,  1185,  1226,  1244,  1251,
+    1256,  1267,  1278,  1289,  1300,  1305,  1310,  1315,  1325,  1344,
+    1378,  1380,  1382,  1384,  1386,  1388,  1390,  1392,  1397,  1406,
+    1408,  1410,  1412,  1414,  1416,  1418,  1420,  1422,  1424,  1436,
+    1441,  1443,  1445,  1447,  1449,  1451,  1453,  1455,  1457,  1459,
+    1461,  1463,  1465,  1496,  1522,  1530,  1539,  1548,  1550,  1552,
+    1554,  1556,  1560,  1565,  1567,  1572,  1573,  1576,  1577,  1580,
+    1581,  1584,  1592,  1596,  1598,  1602,  1606,  1607,  1610,  1625,
+    1629,  1630,  1633,  1645,  1646,  1650,  1652,  1656,  1660,  1662,
+    1664,  1670,  1671,  1676,  1677,  1681,  1683,  1692,  1694,  1698,
+    1702,  1704,  1706,  1710,  1711,  1714,  1734,  1741,  1743,  1753,
+    1770,  1772,  1774,  1778,  1787,  1792,  1797,  1798,  1802,  1804,
+    1808,  1813,  1814,  1818,  1820,  1822,  1824,  1834,  1838,  1839,
+    1840,  1841,  1844,  1849,  1860,  1867,  1872,  1873,  1877,  1879,
+    1883,  1884,  1887,  1891,  1895,  1899,  1908,  1918,  1919,  1924,
+    1926,  1931,  1936,  1937,  1941,  1943,  1947,  1953,  1954,  1958,
+    1960,  1968,  1969,  1973,  1977,  1980,  1981,  1984,  1988,  1992,
+    1994,  1996,  1998,  2006,  2007,  2011,  2012,  2013,  2014,  2017,
+    2018,  2019,  2020,  2021,  2022,  2025,  2026,  2027,  2028,  2036,
+    2039,  2040,  2051,  2052,  2053,  2054,  2058,  2059,  2062,  2063,
+    2064,  2065,  2066,  2067,  2068,  2069,  2072,  2073,  2074,  2077,
+    2078,  2079,  2080,  2081,  2082,  2083,  2084,  2085,  2086,  2087,
+    2088,  2089,  2090,  2091,  2092,  2093,  2094,  2095,  2096,  2097,
+    2098,  2099,  2105,  2106,  2107,  2108,  2109,  2110,  2111,  2112,
+    2113,  2114,  2115,  2116,  2128,  2136,  2140,  2141,  2144,  2145,
+    2146,  2147,  2148,  2149,  2152,  2154,  2155,  2158,  2159,  2162,
+    2166,  2171
 };
 #endif
 
@@ -1106,31 +1113,32 @@
   "\"string\"", "\"if\"", "\"unless\"", "\"null\"", "\"goto\"",
   "\"string constant\"", "\"integer constant\"", "\"number constant\"",
   "\"PMC register\"", "\"number register\"", "\"string register\"",
-  "\"integer register\"", "\"=>\"", "\"!=\"", "\"==\"", "\"<\"", "\"<=\"",
-  "\">\"", "\">=\"", "\">>>\"", "\">>\"", "\"<<\"", "\"//\"", "\"||\"",
-  "\"&&\"", "\"~~\"", "\".\"", "\">>>=\"", "\">>=\"", "\"<<=\"", "\"+=\"",
-  "\"-=\"", "\"*=\"", "\"%=\"", "\"**=\"", "\"/=\"", "\"|=\"", "\"&=\"",
-  "\"//=\"", "\"~=\"", "\".=\"", "\":init\"", "\":load\"", "\":main\"",
-  "\":anon\"", "\":method\"", "\":outer\"", "\":vtable\"", "\":lex\"",
-  "\":multi\"", "\":postcomp\"", "\":immediate\"", "\":subid\"",
-  "\":instanceof\"", "\":nsentry\"", "\":unique_reg\"", "\":named\"",
-  "\":slurpy\"", "\":flat\"", "\":optional\"", "\":opt_flag\"",
-  "\":invocant\"", "\".macro\"", "\".endm\"", "\".macro_local\"",
-  "\".macro_label\"", "\".macro_const\"", "\"macro-label\"",
-  "\"macro-local\"", "\"macro-identifier\"", "\"macro-id-argument\"",
-  "\"macro-argument\"", "\"macro-constant\"", "\"<pasm-input>\"",
-  "\"<pir-input>\"", "\".pcc_sub\"", "\"parrot-op\"", "'('", "')'", "','",
-  "'='", "'['", "']'", "';'", "'{'", "'}'", "'.'", "'-'", "'!'", "'~'",
-  "'+'", "'/'", "'*'", "'%'", "'|'", "'&'", "\"**\"", "$accept", "TOP",
-  "pir_contents", "opt_nl", "pir_chunks", "pir_chunk", "macro_definition",
-  "macro_const", "macro", "macro_header", "macro_parameters",
-  "macro_params", "macro_param", "macro_body", "macro_statements",
-  "macro_statement", "macro_instr", "macro_label_decl", "macro_local_decl",
-  "loadlib", "location_directive", "annotation", "hll_specifier",
-  "hll_mapping", "namespace_decl", "opt_namespace", "namespace",
-  "namespace_slice", "sub_def", "sub_end", "sub_head", "sub_id",
-  "sub_flags", "sub_flag", "multi_type", "parameter_list", "parameters",
-  "parameter", "param", "param_flags", "param_flag", "invocant_param",
+  "\"integer register\"", "\"constant-value\"", "\"=>\"", "\"!=\"",
+  "\"==\"", "\"<\"", "\"<=\"", "\">\"", "\">=\"", "\">>>\"", "\">>\"",
+  "\"<<\"", "\"//\"", "\"||\"", "\"&&\"", "\"~~\"", "\".\"", "\">>>=\"",
+  "\">>=\"", "\"<<=\"", "\"+=\"", "\"-=\"", "\"*=\"", "\"%=\"", "\"**=\"",
+  "\"/=\"", "\"|=\"", "\"&=\"", "\"//=\"", "\"~=\"", "\".=\"", "\":init\"",
+  "\":load\"", "\":main\"", "\":anon\"", "\":method\"", "\":outer\"",
+  "\":vtable\"", "\":lex\"", "\":multi\"", "\":postcomp\"",
+  "\":immediate\"", "\":subid\"", "\":instanceof\"", "\":nsentry\"",
+  "\":unique_reg\"", "\":named\"", "\":slurpy\"", "\":flat\"",
+  "\":optional\"", "\":opt_flag\"", "\":invocant\"", "\".macro\"",
+  "\".endm\"", "\".macro_local\"", "\".macro_label\"", "\".macro_const\"",
+  "\"macro-label\"", "\"macro-local\"", "\"macro-identifier\"",
+  "\"macro-id-argument\"", "\"macro-argument\"", "\"macro-constant\"",
+  "\"<pasm-input>\"", "\"<pir-input>\"", "\".pcc_sub\"", "\"parrot-op\"",
+  "'('", "')'", "','", "'='", "'['", "']'", "';'", "'{'", "'}'", "'.'",
+  "'-'", "'!'", "'~'", "'+'", "'/'", "'*'", "'%'", "'|'", "'&'", "\"**\"",
+  "$accept", "TOP", "pir_contents", "opt_nl", "pir_chunks", "pir_chunk",
+  "macro_definition", "macro_const", "macro", "macro_header",
+  "macro_parameters", "macro_params", "macro_param", "macro_body",
+  "macro_statements", "macro_statement", "macro_instr", "macro_label_decl",
+  "macro_local_decl", "loadlib", "location_directive", "annotation",
+  "hll_specifier", "hll_mapping", "namespace_decl", "opt_namespace",
+  "namespace", "namespace_slice", "sub_def", "sub_end", "sub_head",
+  "sub_id", "sub_flags", "sub_flag", "multi_type_list", "opt_multi_types",
+  "multi_types", "multi_type", "parameter_list", "parameters", "parameter",
+  "param", "param_flags", "param_flag", "invocant_param",
   "unique_reg_flag", "instructions", "instruction", "statement",
   "expansion_stat", "macro_expansion", "opt_macro_args", "macro_args",
   "macro_arg_list", "macro_arg", "braced_arg", "braced_contents",
@@ -1180,57 +1188,58 @@
      335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
      345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
      355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
-     365,   366,   367,   368,   369,   370,   371,   372,    40,    41,
-      44,    61,    91,    93,    59,   123,   125,    46,    45,    33,
-     126,    43,    47,    42,    37,   124,    38,   373
+     365,   366,   367,   368,   369,   370,   371,   372,   373,    40,
+      41,    44,    61,    91,    93,    59,   123,   125,    46,    45,
+      33,   126,    43,    47,    42,    37,   124,    38,   374
 };
 # endif
 
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_uint16 yyr1[] =
 {
-       0,   138,   139,   139,   140,   141,   141,   142,   142,   143,
-     143,   143,   143,   143,   143,   143,   143,   143,   144,   144,
-     145,   146,   147,   148,   148,   149,   149,   150,   151,   151,
-     152,   152,   153,   154,   154,   155,   156,   157,   158,   158,
-     159,   160,   161,   162,   163,   163,   164,   164,   165,   166,
-     167,   168,   169,   169,   170,   170,   171,   171,   171,   171,
-     171,   171,   171,   171,   171,   171,   171,   171,   171,   171,
-     172,   172,   172,   173,   174,   174,   175,   176,   177,   177,
-     178,   178,   178,   179,   180,   181,   181,   182,   182,   183,
-     183,   183,   183,   183,   183,   183,   183,   183,   183,   183,
-     183,   183,   183,   183,   184,   185,   186,   186,   187,   187,
-     188,   188,   189,   189,   189,   189,   190,   191,   191,   192,
-     192,   192,   192,   193,   194,   195,   196,   197,   198,   199,
-     199,   200,   201,   201,   202,   202,   203,   203,   204,   205,
-     205,   206,   206,   206,   206,   207,   208,   209,   209,   210,
-     210,   210,   211,   212,   212,   213,   213,   213,   213,   213,
-     213,   213,   213,   213,   213,   213,   213,   213,   213,   213,
-     213,   213,   213,   213,   213,   214,   214,   214,   214,   214,
-     214,   214,   214,   215,   216,   216,   216,   216,   216,   216,
-     216,   216,   216,   216,   216,   216,   216,   216,   216,   216,
-     216,   216,   216,   216,   216,   216,   216,   216,   217,   217,
+       0,   139,   140,   140,   141,   142,   142,   143,   143,   144,
+     144,   144,   144,   144,   144,   144,   144,   144,   145,   145,
+     146,   147,   148,   149,   149,   150,   150,   151,   152,   152,
+     153,   153,   154,   155,   155,   156,   157,   158,   159,   159,
+     160,   161,   162,   163,   164,   164,   165,   165,   166,   167,
+     168,   169,   170,   170,   171,   171,   172,   172,   172,   172,
+     172,   172,   172,   172,   172,   172,   172,   172,   172,   172,
+     173,   174,   174,   175,   175,   176,   176,   176,   177,   178,
+     178,   179,   180,   181,   181,   182,   182,   182,   183,   184,
+     185,   185,   186,   186,   187,   187,   187,   187,   187,   187,
+     187,   187,   187,   187,   187,   187,   187,   187,   187,   188,
+     189,   190,   190,   191,   191,   192,   192,   193,   193,   193,
+     193,   194,   195,   195,   196,   196,   196,   196,   197,   198,
+     199,   200,   201,   202,   203,   203,   204,   205,   205,   206,
+     206,   207,   207,   208,   209,   209,   210,   210,   210,   210,
+     211,   212,   213,   213,   214,   214,   214,   215,   216,   216,
      217,   217,   217,   217,   217,   217,   217,   217,   217,   217,
-     218,   218,   219,   219,   220,   220,   221,   222,   223,   223,
-     224,   225,   225,   226,   227,   228,   228,   229,   230,   230,
-     231,   231,   232,   233,   233,   233,   234,   234,   235,   235,
-     236,   236,   237,   237,   238,   239,   239,   239,   240,   240,
-     241,   242,   243,   243,   244,   244,   244,   244,   245,   245,
-     246,   247,   247,   248,   248,   249,   250,   250,   251,   251,
-     251,   251,   252,   253,   253,   253,   253,   254,   254,   255,
-     256,   257,   257,   258,   258,   259,   259,   260,   261,   262,
-     263,   264,   265,   265,   266,   266,   267,   268,   268,   269,
-     269,   270,   271,   271,   272,   272,   273,   273,   274,   275,
-     276,   276,   277,   278,   279,   279,   279,   279,   280,   280,
-     281,   281,   281,   282,   282,   282,   282,   282,   282,   283,
-     283,   283,   283,   284,   285,   285,   286,   286,   286,   286,
-     287,   287,   288,   288,   288,   288,   288,   288,   288,   288,
-     289,   289,   289,   290,   290,   290,   290,   290,   290,   290,
-     290,   290,   290,   290,   290,   290,   290,   290,   290,   290,
-     290,   290,   290,   290,   290,   290,   291,   291,   291,   291,
-     291,   291,   291,   291,   291,   291,   291,   291,   292,   293,
-     294,   294,   295,   295,   295,   295,   295,   295,   296,   296,
-     296,   297,   297,   298,   299,   300
+     217,   217,   217,   217,   217,   217,   217,   217,   217,   217,
+     218,   218,   218,   218,   218,   218,   218,   218,   219,   220,
+     220,   220,   220,   220,   220,   220,   220,   220,   220,   220,
+     220,   220,   220,   220,   220,   220,   220,   220,   220,   220,
+     220,   220,   220,   221,   221,   221,   221,   221,   221,   221,
+     221,   221,   221,   221,   221,   222,   222,   223,   223,   224,
+     224,   225,   226,   227,   227,   228,   229,   229,   230,   231,
+     232,   232,   233,   234,   234,   235,   235,   236,   237,   237,
+     237,   238,   238,   239,   239,   240,   240,   241,   241,   242,
+     243,   243,   243,   244,   244,   245,   246,   247,   247,   248,
+     248,   248,   248,   249,   249,   250,   251,   251,   252,   252,
+     253,   254,   254,   255,   255,   255,   255,   256,   257,   257,
+     257,   257,   258,   258,   259,   260,   261,   261,   262,   262,
+     263,   263,   264,   265,   266,   267,   268,   269,   269,   270,
+     270,   271,   272,   272,   273,   273,   274,   275,   275,   276,
+     276,   277,   277,   278,   279,   280,   280,   281,   282,   283,
+     283,   283,   283,   284,   284,   285,   285,   285,   285,   286,
+     286,   286,   286,   286,   286,   287,   287,   287,   287,   288,
+     289,   289,   290,   290,   290,   290,   291,   291,   292,   292,
+     292,   292,   292,   292,   292,   292,   293,   293,   293,   294,
+     294,   294,   294,   294,   294,   294,   294,   294,   294,   294,
+     294,   294,   294,   294,   294,   294,   294,   294,   294,   294,
+     294,   294,   295,   295,   295,   295,   295,   295,   295,   295,
+     295,   295,   295,   295,   296,   297,   298,   298,   299,   299,
+     299,   299,   299,   299,   300,   300,   300,   301,   301,   302,
+     303,   304
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
@@ -1242,42 +1251,43 @@
        1,     2,     2,     1,     1,     2,     3,     2,     2,     2,
        4,     2,     4,     4,     0,     1,     1,     3,     1,     6,
        1,     2,     1,     1,     0,     2,     1,     1,     1,     1,
-       1,     1,     1,     1,     4,     2,     2,     2,     2,     2,
-       1,     1,     1,     1,     0,     2,     4,     2,     0,     2,
-       1,     1,     1,     4,     1,     0,     2,     2,     1,     1,
+       1,     1,     1,     2,     4,     2,     2,     2,     2,     2,
+       3,     0,     1,     1,     3,     1,     1,     1,     1,     0,
+       2,     4,     2,     0,     2,     1,     1,     1,     4,     1,
+       0,     2,     2,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     3,     0,     3,     0,     1,
-       1,     3,     1,     1,     2,     1,     3,     0,     2,     1,
-       1,     1,     2,     1,     2,     2,     3,     3,     2,     2,
-       1,     1,     1,     1,     0,     1,     1,     3,     3,     1,
-       1,     1,     1,     1,     1,     2,     3,     1,     3,     6,
-       4,     6,     2,     1,     1,     3,     3,     3,     3,     3,
-       3,     4,     4,     4,     3,     3,     3,     3,     3,     3,
-       3,     4,     5,     4,     4,     3,     3,     3,     3,     3,
-       3,     3,     3,     2,     5,     5,     5,     5,     5,     5,
-       5,     5,     5,     4,     5,     4,     4,     4,     4,     4,
-       4,     4,     4,     4,     4,     4,     4,     4,     3,     3,
-       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
-       1,     1,     1,     1,     1,     1,     3,     4,     1,     3,
-       2,     0,     1,     5,     1,     1,     1,     8,     0,     1,
-       1,     2,     3,     3,     2,     5,     0,     2,     0,     1,
-       1,     2,     3,     1,     2,     3,     3,     1,     1,     1,
-       4,     2,     1,     1,     1,     1,     1,     1,     1,     1,
-       3,     0,     1,     1,     3,     2,     0,     2,     1,     1,
-       1,     2,     1,     1,     1,     1,     1,     3,     3,     3,
-       3,     0,     1,     1,     3,     1,     1,     3,     2,     1,
-       5,     5,     0,     1,     1,     2,     3,     0,     1,     1,
-       2,     3,     0,     2,     1,     2,     0,     1,     3,     2,
-       1,     1,     2,     2,     4,     4,     4,     4,     1,     1,
+       3,     0,     3,     0,     1,     1,     3,     1,     1,     2,
+       1,     3,     0,     2,     1,     1,     1,     2,     1,     2,
+       2,     3,     3,     2,     2,     1,     1,     1,     1,     0,
+       1,     1,     3,     3,     1,     1,     1,     1,     1,     1,
+       2,     3,     1,     3,     6,     4,     6,     2,     1,     1,
+       3,     3,     3,     3,     3,     3,     4,     4,     4,     3,
+       3,     3,     3,     3,     3,     3,     4,     5,     4,     4,
+       3,     3,     3,     3,     3,     3,     3,     3,     2,     5,
+       5,     5,     5,     5,     5,     5,     5,     5,     4,     5,
+       4,     4,     4,     4,     4,     4,     4,     4,     4,     4,
+       4,     4,     4,     3,     3,     3,     3,     3,     3,     3,
+       3,     3,     3,     3,     3,     1,     1,     1,     1,     1,
+       1,     3,     4,     1,     3,     2,     0,     1,     5,     1,
+       1,     1,     8,     0,     1,     1,     2,     3,     3,     2,
+       5,     0,     2,     0,     1,     1,     2,     3,     1,     2,
+       3,     3,     1,     1,     1,     4,     2,     1,     1,     1,
+       1,     1,     1,     1,     1,     3,     0,     1,     1,     3,
+       2,     0,     2,     1,     1,     1,     2,     1,     1,     1,
+       1,     1,     3,     3,     3,     3,     0,     1,     1,     3,
+       1,     1,     3,     2,     1,     5,     5,     0,     1,     1,
+       2,     3,     0,     1,     1,     2,     3,     0,     2,     1,
+       2,     0,     1,     3,     2,     1,     1,     2,     2,     4,
+       4,     4,     4,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     2,     1,
-       1,     2,     1,     2,     1,     2,     2,     1,     2,     2,
-       1,     1,     1,     3,     1,     3
+       1,     1,     1,     1,     2,     1,     1,     2,     1,     2,
+       1,     2,     2,     1,     2,     2,     1,     1,     1,     3,
+       1,     3
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -1285,390 +1295,402 @@
    means the default is an error.  */
 static const yytype_uint16 yydefact[] =
 {
-       0,     5,     5,     0,     6,   399,     3,     0,     2,     0,
-       1,     0,     0,     0,     0,     0,   131,     0,     0,   106,
-     414,     0,    18,    19,     0,     0,     0,   407,   134,   404,
-     398,   400,   402,     0,    54,   410,     0,     0,     0,     0,
+       0,     5,     5,     0,     6,   405,     3,     0,     2,     0,
+       1,     0,     0,     0,     0,     0,   136,     0,     0,   111,
+     420,     0,    18,    19,     0,     0,     0,   413,   139,   410,
+     404,   406,   408,     0,    54,   416,     0,     0,     0,     0,
        0,     0,     5,     7,    17,    14,    15,    16,    12,    13,
-      11,     9,    54,    10,     0,    38,    39,    44,   123,   411,
-     408,   412,   350,   355,   356,   358,   357,   352,   353,   359,
-     354,    22,   351,     0,   108,     0,   406,    23,   405,   403,
-     330,   331,   332,   346,   347,   349,   348,     0,     0,   135,
-     136,   139,   144,   140,     0,   141,   143,   142,   401,   409,
-       0,    41,     0,    37,    53,    51,    52,     0,     0,     0,
-       0,   322,     0,     6,     4,     0,     0,    48,     0,    45,
-      46,    20,   106,   112,   113,   117,     0,   109,   110,   115,
-     105,     0,    24,    25,    27,   346,     0,   147,   329,   328,
-     343,   344,   345,   415,     0,   145,   413,    57,    58,    59,
-      56,   316,     0,   316,    60,    63,    61,    62,     0,     0,
-       0,    55,     0,     0,     0,     0,     0,     0,     8,    74,
-     269,     0,   268,    43,     0,   114,     0,   107,     0,     0,
-       0,   146,     0,   137,     0,    65,   317,     0,    66,    67,
-      68,    69,    42,     0,     0,     0,     0,    40,    85,    73,
-     233,    47,   119,   106,   121,   120,   116,   118,   111,    28,
-      26,   148,     0,     0,   324,   325,   326,   327,     0,     0,
-      75,   122,     0,     0,     0,    29,    30,     0,    33,    34,
-     318,    64,     0,    50,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   131,   352,   353,   359,   354,   263,
-     346,   271,     0,    49,    86,    88,   102,   104,   100,   101,
-     103,    99,    98,    89,     0,   134,   130,    97,     0,    90,
-       0,     0,    91,    92,    93,    96,   234,   235,   236,     0,
-     257,   259,   258,     0,   262,     0,    95,   282,   283,   285,
-     284,   286,    94,     0,   320,   321,     0,   345,   351,   339,
-     340,   341,   342,    78,     0,     0,    35,    21,    31,    32,
-     125,     0,   323,   291,     0,     0,   302,   307,   238,     0,
-       0,    87,     0,     0,     0,     0,   272,   273,   276,   124,
-     128,   129,   132,   133,   140,   152,   183,   350,   355,   356,
-     358,   357,   352,   353,   359,   354,   330,   331,   332,     0,
-       0,     0,   344,   254,   261,     0,     0,   319,   397,   395,
-     396,     0,     0,   386,   387,   388,   389,   391,   392,   390,
-     393,   394,     0,     0,     0,     0,    77,    36,     0,   228,
-     231,   330,     0,   292,   293,   296,   295,   312,   299,   287,
-     289,     0,     0,   303,   304,     0,     0,   308,   309,     0,
-       0,   239,   240,   127,   288,   126,   226,     0,   270,     0,
-     275,     0,   224,   225,     0,     0,     0,     0,     0,     0,
+      11,     9,    54,    10,     0,    38,    39,    44,   128,   417,
+     414,   418,   356,   361,   362,   364,   363,   358,   359,   365,
+     360,    22,   357,     0,   113,     0,   412,    23,   411,   409,
+     335,   336,   337,   352,   353,   355,   354,   338,     0,     0,
+     140,   141,   144,   149,   145,     0,   146,   148,   147,   407,
+     415,     0,    41,     0,    37,    53,    51,    52,     0,     0,
+       0,     0,   327,     0,     6,     4,     0,     0,    48,     0,
+      45,    46,    20,   111,   117,   118,   122,     0,   114,   115,
+     120,   110,     0,    24,    25,    27,   352,     0,   152,   334,
+     333,   349,   350,   351,   421,     0,   150,   419,    57,    58,
+      59,    56,   321,     0,   321,    60,     0,    61,    62,     0,
+       0,     0,    55,     0,     0,     0,     0,     0,     0,     8,
+      79,   274,     0,   273,    43,     0,   119,     0,   112,     0,
+       0,     0,   151,     0,   142,     0,    65,   322,     0,    66,
+      71,    63,    67,    68,    69,    42,     0,     0,     0,     0,
+      40,    90,    78,   238,    47,   124,   111,   126,   125,   121,
+     123,   116,    28,    26,   153,     0,     0,    76,     0,    72,
+      73,    77,    75,   329,   330,   331,   332,     0,     0,    80,
+     127,     0,     0,     0,    29,    30,     0,    33,    34,   323,
+      64,    70,     0,     0,    50,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   136,   358,   359,   365,   360,
+     268,   352,   276,     0,    49,    91,    93,   107,   109,   105,
+     106,   108,   104,   103,    94,     0,   139,   135,   102,     0,
+      95,     0,     0,    96,    97,    98,   101,   239,   240,   241,
+       0,   262,   264,   263,     0,   267,     0,   100,   287,   288,
+     290,   289,   291,    99,     0,   325,   326,     0,   351,   357,
+     345,   346,   347,   348,    83,     0,     0,    35,    21,    31,
+      32,    74,   130,     0,   328,   296,     0,     0,   307,   312,
+     243,     0,     0,    92,     0,     0,     0,     0,   277,   278,
+     281,   129,   133,   134,   137,   138,   145,   157,   188,   356,
+     361,   362,   364,   363,   358,   359,   365,   360,   335,   336,
+     337,     0,     0,     0,   350,   259,   266,     0,     0,   324,
+     403,   401,   402,     0,     0,   392,   393,   394,   395,   397,
+     398,   396,   399,   400,     0,     0,     0,     0,    82,    36,
+       0,   233,   236,   335,     0,   297,   298,   301,   300,   317,
+     304,   292,   294,     0,     0,   308,   309,     0,     0,   313,
+     314,     0,     0,   244,   245,   132,   293,   131,   231,     0,
+     275,     0,   280,     0,   229,   230,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   333,   334,   335,   336,   338,   337,
-       0,     0,     0,     0,     0,     0,     0,   267,   265,   266,
-       0,   264,   255,   165,   166,   169,   167,   168,   170,   350,
-     157,   155,   156,   346,   360,   361,   362,     0,   159,   160,
-     256,     0,   344,   351,     0,   164,     0,    76,    84,   316,
-     280,   278,   279,     0,    79,    81,    82,    80,   227,     0,
-     232,   230,     0,   290,     0,   298,     0,     0,   305,     0,
-       0,   310,     0,     0,     0,     0,     0,   241,   174,   274,
-     277,   138,   195,   197,   198,   199,   200,   201,   202,     0,
-       0,     0,     0,     0,     0,     0,     0,   354,   205,     0,
-     206,   203,   204,   216,   220,   221,   217,   211,   218,   212,
-     213,   209,   219,   214,   215,   210,   207,   193,   208,   196,
-     260,   385,   380,   382,   381,   384,   383,   373,   374,   375,
-     378,   376,   377,   379,   372,   364,   370,   363,   365,   366,
-     367,   368,   369,   371,     0,     0,     0,   163,   150,   161,
-       0,   162,   171,   173,   281,     0,   229,   297,   294,   316,
-     314,   313,   306,   301,   311,   300,   242,     0,   246,   244,
-     248,   184,   185,   186,   187,   188,   189,   190,   192,   191,
-     194,   178,   177,   179,   181,   175,   182,   180,   176,     0,
-       0,   172,    71,     0,    72,    70,   315,     0,     0,   243,
-       0,   253,     0,   249,   250,   149,   151,    83,     0,   247,
-       0,     0,   251,   245,   252,   237
+       0,     0,     0,     0,     0,     0,   339,   340,   341,   342,
+     344,   343,     0,     0,     0,     0,     0,     0,     0,   272,
+     270,   271,     0,   269,   260,   170,   171,   174,   172,   173,
+     175,   356,   162,   160,   161,   352,   366,   367,   368,     0,
+     164,   165,   261,     0,   350,   357,     0,   169,     0,    81,
+      89,   321,   285,   283,   284,     0,    84,    86,    87,    85,
+     232,     0,   237,   235,     0,   295,     0,   303,     0,     0,
+     310,     0,     0,   315,     0,     0,     0,     0,     0,   246,
+     179,   279,   282,   143,   200,   202,   203,   204,   205,   206,
+     207,     0,     0,     0,     0,     0,     0,     0,     0,   360,
+     210,     0,   211,   208,   209,   221,   225,   226,   222,   216,
+     223,   217,   218,   214,   224,   219,   220,   215,   212,   198,
+     213,   201,   265,   391,   386,   388,   387,   390,   389,   379,
+     380,   381,   384,   382,   383,   385,   378,   370,   376,   369,
+     371,   372,   373,   374,   375,   377,     0,     0,     0,   168,
+     155,   166,     0,   167,   176,   178,   286,     0,   234,   302,
+     299,   321,   319,   318,   311,   306,   316,   305,   247,     0,
+     251,   267,   249,   253,   189,   190,   191,   192,   193,   194,
+     195,   197,   196,   199,   183,   182,   184,   186,   180,   187,
+     185,   181,     0,     0,   177,     0,   320,     0,     0,   248,
+       0,   258,     0,   254,   255,   154,   156,    88,     0,   252,
+       0,     0,   256,   250,   257,   242
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int16 yydefgoto[] =
 {
       -1,     3,     8,     5,    42,    43,    21,    22,    23,    24,
-     131,   132,   133,   224,   225,   226,   227,   228,   229,    45,
-      25,    47,    48,    49,    26,   118,   119,   120,    51,   253,
-      52,   105,   100,   161,   623,   198,   199,   220,   303,   375,
-     484,   485,   486,   218,   254,   255,   256,    27,    75,   126,
-     127,   128,   129,   176,   207,    59,   259,   260,   261,   262,
-     263,   264,    28,   331,    88,    89,   333,    90,    91,    92,
-      93,   136,   266,   267,   468,   268,   469,   269,   270,   349,
-     536,   271,   414,   272,   273,   378,   379,   491,    29,   275,
-     276,   277,   400,   401,   402,   506,   629,   632,   633,   634,
-     278,   279,   280,   281,   282,   283,   450,    94,   285,   325,
-     326,   327,   410,   487,   286,   287,   288,   289,   314,   382,
-     383,   384,   385,   386,   387,   290,   291,   392,   393,   394,
-     396,   397,   398,   495,   591,   185,   186,   292,   293,    53,
-     295,   111,   388,   138,   440,   304,   139,   140,   141,   142,
-      72,   474,   574,   373,     6,     7,    30,    31,    32,    60,
-      33,    34,    35
+     132,   133,   134,   233,   234,   235,   236,   237,   238,    45,
+      25,    47,    48,    49,    26,   119,   120,   121,    51,   264,
+      52,   106,   101,   162,   191,   218,   219,   220,   201,   202,
+     229,   314,   387,   496,   497,   498,   227,   265,   266,   267,
+      27,    75,   127,   128,   129,   130,   177,   210,    59,   270,
+     271,   272,   273,   274,   275,    28,   343,    89,    90,   345,
+      91,    92,    93,    94,   137,   277,   278,   480,   279,   481,
+     280,   281,   361,   548,   282,   426,   283,   284,   390,   391,
+     503,    29,   286,   287,   288,   412,   413,   414,   518,   639,
+     642,   643,   644,   289,   290,   291,   292,   293,   294,   462,
+      95,   296,   337,   338,   339,   422,   499,   297,   298,   299,
+     300,   326,   394,   395,   396,   397,   398,   399,   301,   302,
+     404,   405,   406,   408,   409,   410,   507,   603,   186,   187,
+     303,   304,    53,   306,   112,   400,   139,   452,   315,   140,
+     141,   142,   143,    72,   486,   586,   385,     6,     7,    30,
+      31,    32,    60,    33,    34,    35
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -572
+#define YYPACT_NINF -587
 static const yytype_int16 yypact[] =
 {
-     -31,    12,    12,    50,  -572,  -572,  -572,    15,  -572,    69,
-    -572,    17,    29,    42,   -20,     5,  -572,   172,    68,    -6,
-    -572,    85,  -572,  -572,    33,   119,   130,  -572,   532,  -572,
-      15,  -572,  -572,     5,  -572,  -572,   122,   125,   127,   606,
-     106,   128,   145,  -572,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,  -572,  -572,  -572,    80,  -572,  -572,   156,  -572,  -572,
-    -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,  -572,  -572,   109,   -44,   189,  -572,   172,  -572,  -572,
-    -572,  -572,  -572,   107,  -572,  -572,  -572,   750,   195,    87,
-    -572,  -572,  -572,  -572,   110,  -572,  -572,   111,  -572,  -572,
-     658,  -572,   116,  -572,  -572,  -572,  -572,   172,   172,   172,
-     172,  -572,   121,    69,  -572,   587,   965,  -572,   124,   115,
-    -572,  -572,    -6,  -572,  -572,  -572,   126,   139,  -572,  -572,
-    -572,   141,   142,  -572,  -572,  -572,    -9,  -572,  -572,  -572,
-    -572,  -572,  -572,  -572,   532,  -572,  -572,  -572,  -572,  -572,
-    -572,   146,   148,   146,  -572,  -572,  -572,  -572,   146,   146,
-     146,  -572,   219,   149,   161,   162,   164,   221,  -572,  -572,
-    -572,   233,  -572,  -572,   156,  -572,   -15,  -572,   -44,   254,
-     172,  -572,   750,  -572,   246,  -572,  -572,   606,  -572,  -572,
-    -572,  -572,  -572,   249,   245,   263,    23,  -572,  -572,   302,
-    -572,  -572,  -572,    -6,  -572,  -572,  -572,  -572,  -572,     4,
-    -572,  -572,   207,   209,  -572,  -572,  -572,  -572,   262,    94,
-    -572,  -572,    94,   222,   227,     4,  -572,   299,  -572,  -572,
-    -572,  -572,   300,  -572,    94,   106,   218,   218,   311,   313,
-     314,   232,   278,   510,   645,   766,   790,   440,   172,  -572,
-     -33,   440,   316,  -572,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,  -572,  -572,  -572,   317,   532,  -572,  -572,   318,  -572,
-     319,   806,  -572,  -572,  -572,  -572,  -572,  -572,  -572,   321,
-    -572,  -572,  -572,   218,   210,   236,  -572,  -572,  -572,  -572,
-    -572,  -572,  -572,   323,  -572,  -572,   705,   -74,   110,  -572,
-    -572,  -572,  -572,  -572,   172,   250,  -572,  -572,  -572,  -572,
-    -572,   172,  -572,   822,   325,   326,   342,   343,   335,   331,
-     332,  -572,   336,   339,   255,   256,   258,  -572,  -572,  -572,
-    -572,  -572,  -572,  -572,   260,  -572,  -572,   -22,   -22,   -22,
-     -22,   -22,   -22,   -22,   212,   -13,   286,   286,   286,   334,
-     -22,   286,   -22,  -572,  -572,   950,   278,  -572,  -572,  -572,
-    -572,   886,   902,  -572,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,  -572,   147,   750,   261,    81,  -572,  -572,   -14,  -572,
-     288,   333,   266,   267,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,   750,   365,   342,  -572,   750,   368,   343,  -572,   750,
-      32,   335,  -572,  -572,  -572,  -572,  -572,   750,  -572,   440,
-      61,   750,  -572,  -572,   172,   172,   172,   172,   172,   172,
-     172,   350,   351,   359,   360,   361,   362,   363,   364,   717,
-     -22,   172,   172,   172,  -572,  -572,  -572,  -572,  -572,  -572,
-     838,   854,   870,   172,   172,   750,   172,  -572,  -572,  -572,
-     218,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,   417,
-     575,   601,   601,   -33,  -572,  -572,  -572,   532,  -572,  -572,
-    -572,   601,   375,   -21,   750,  -572,   750,  -572,  -572,   146,
-    -572,  -572,  -572,   293,  -572,  -572,  -572,  -572,  -572,   172,
-    -572,  -572,   750,  -572,   822,    27,   378,   382,  -572,   383,
-     384,  -572,   385,   965,   965,   965,   386,  -572,  -572,  -572,
-    -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,   172,
-     172,   172,   172,   172,   172,   172,   172,   172,  -572,   172,
-    -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,  -572,  -572,  -572,   646,   918,   934,  -572,   303,   305,
-     750,  -572,  -572,  -572,  -572,   393,  -572,  -572,  -572,   146,
-    -572,  -572,  -572,  -572,  -572,  -572,  -572,   387,   308,  -572,
-      18,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,   532,
-     532,  -572,  -572,   322,  -572,  -572,  -572,   429,   965,  -572,
-     440,  -572,   418,    18,  -572,    87,    87,  -572,   950,  -572,
-     411,   412,  -572,  -572,  -572,  -572
+      99,    -2,    -2,    53,  -587,  -587,  -587,    15,  -587,    32,
+    -587,    17,    -6,    44,   -21,    41,  -587,  1019,    67,    -9,
+    -587,    89,  -587,  -587,    22,   115,   117,  -587,   426,  -587,
+      15,  -587,  -587,    41,  -587,  -587,   129,   173,   174,   405,
+     116,   175,   121,  -587,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,  -587,  -587,  -587,    42,  -587,  -587,   176,  -587,  -587,
+    -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,  -587,  -587,   109,     4,   193,  -587,  1019,  -587,  -587,
+    -587,  -587,  -587,   106,  -587,  -587,  -587,  -587,   770,   195,
+     111,  -587,  -587,  -587,  -587,   108,  -587,  -587,   112,  -587,
+    -587,   639,  -587,   118,  -587,  -587,  -587,  -587,  1019,  1019,
+    1019,  1019,  -587,   113,    32,  -587,   502,  1006,  -587,   114,
+     122,  -587,  -587,    -9,  -587,  -587,  -587,   119,   120,  -587,
+    -587,  -587,   123,   127,  -587,  -587,  -587,    36,  -587,  -587,
+    -587,  -587,  -587,  -587,  -587,   426,  -587,  -587,  -587,  -587,
+    -587,  -587,   133,   137,   133,  -587,   139,  -587,  -587,   133,
+     133,   133,  -587,   187,   128,   148,   151,   152,   225,  -587,
+    -587,  -587,   240,  -587,  -587,   176,  -587,    -5,  -587,     4,
+     241,  1019,  -587,   770,  -587,   231,  -587,  -587,   405,  -587,
+     245,  -587,  -587,  -587,  -587,  -587,   234,   244,   247,   131,
+    -587,  -587,   286,  -587,  -587,  -587,    -9,  -587,  -587,  -587,
+    -587,  -587,    61,  -587,  -587,   177,   179,  -587,   180,   181,
+    -587,  -587,  -587,  -587,  -587,  -587,  -587,   524,   142,  -587,
+    -587,   142,   186,   191,    61,  -587,   266,  -587,  -587,  -587,
+    -587,  -587,   245,   269,  -587,   142,   116,   215,   215,   300,
+     304,   305,   224,   672,   628,   710,   810,   827,   452,  1019,
+    -587,    30,   452,   307,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,  -587,  -587,  -587,  -587,   311,   426,  -587,  -587,   312,
+    -587,   313,   844,  -587,  -587,  -587,  -587,  -587,  -587,  -587,
+     314,  -587,  -587,  -587,   215,   226,   230,  -587,  -587,  -587,
+    -587,  -587,  -587,  -587,   318,  -587,  -587,   724,   -88,   108,
+    -587,  -587,  -587,  -587,  -587,  1019,   246,  -587,  -587,  -587,
+    -587,  -587,  -587,  1019,  -587,   861,   320,   322,   338,   340,
+     332,   328,   329,  -587,   330,   331,   248,   249,   250,  -587,
+    -587,  -587,  -587,  -587,  -587,  -587,   251,  -587,  -587,   -24,
+     -24,   -24,   -24,   -24,   -24,   -24,   223,   -16,   147,   147,
+     147,   327,   -24,   147,   -24,  -587,  -587,   287,   672,  -587,
+    -587,  -587,  -587,   926,   942,  -587,  -587,  -587,  -587,  -587,
+    -587,  -587,  -587,  -587,   149,   770,   252,    45,  -587,  -587,
+     -12,  -587,   279,   323,   261,   262,  -587,  -587,  -587,  -587,
+    -587,  -587,  -587,   770,   359,   338,  -587,   770,   360,   340,
+    -587,   770,    33,   332,  -587,  -587,  -587,  -587,  -587,   770,
+    -587,   452,   110,   770,  -587,  -587,  1019,  1019,  1019,  1019,
+    1019,  1019,  1019,   341,   342,   344,   345,   346,   347,   350,
+     351,  1028,   -24,  1019,  1019,  1019,  -587,  -587,  -587,  -587,
+    -587,  -587,   878,   894,   910,  1019,  1019,   770,  1019,  -587,
+    -587,  -587,   215,  -587,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,   270,   626,   640,   640,    30,  -587,  -587,  -587,   426,
+    -587,  -587,  -587,   640,   362,   -20,   770,  -587,   770,  -587,
+    -587,   133,  -587,  -587,  -587,   280,  -587,  -587,  -587,  -587,
+    -587,  1019,  -587,  -587,   770,  -587,   861,    13,   363,   368,
+    -587,   370,   372,  -587,   373,  1006,   672,  1006,   381,  -587,
+    -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,  1019,  1019,  1019,  1019,  1019,  1019,  1019,  1019,  1019,
+    -587,  1019,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,  -587,  -587,  -587,  -587,  -587,   990,   958,   974,  -587,
+     296,   297,   770,  -587,  -587,  -587,  -587,   245,  -587,  -587,
+    -587,   133,  -587,  -587,  -587,  -587,  -587,  -587,  -587,   384,
+     299,  -587,  -587,    52,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,  -587,   426,   426,  -587,   301,  -587,   407,  1006,  -587,
+     452,  -587,   396,    52,  -587,   111,   111,  -587,   287,  -587,
+     390,   394,  -587,  -587,  -587,  -587
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int16 yypgoto[] =
 {
-    -572,  -572,  -572,    13,  -572,   338,     8,  -572,  -572,  -572,
-    -572,  -572,   268,  -572,  -572,   224,  -572,  -572,  -572,  -572,
-       0,  -572,  -572,  -572,    10,  -572,  -572,   279,  -572,  -572,
-    -572,   283,   419,  -572,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,  -572,  -572,  -572,  -572,   230,  -572,  -200,   -95,  -572,
-    -572,   296,  -572,  -572,  -572,  -187,  -572,  -572,  -572,  -572,
-    -572,  -572,  -208,  -572,   211,  -477,  -572,   349,    30,  -572,
-     -90,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,  -572,
-    -572,  -572,  -202,  -572,  -571,  -572,     7,  -572,  -185,  -572,
-    -572,  -572,  -572,  -572,    74,  -572,  -572,  -572,  -572,  -139,
-    -572,  -572,  -226,  -572,  -572,  -572,  -138,  -114,   272,  -572,
-    -572,  -403,  -572,    89,  -572,  -572,  -572,  -572,  -229,  -572,
-    -572,    22,  -572,  -242,     9,  -572,  -572,  -572,  -572,   131,
-    -572,  -572,   120,  -572,  -572,  -146,    46,  -572,  -572,  -184,
-    -572,   290,   -82,   -27,  -128,  -186,  -206,  -572,   -25,   -17,
-    -205,  -572,  -384,  -572,  -572,  -572,  -572,   488,  -572,   490,
-    -572,  -572,    24
+    -587,  -587,  -587,    16,  -587,   316,     7,  -587,  -587,  -587,
+    -587,  -587,   253,  -587,  -587,   197,  -587,  -587,  -587,  -587,
+       0,  -587,  -587,  -587,    11,  -587,  -587,   258,  -587,  -587,
+    -587,   265,   383,  -587,  -587,  -587,  -587,  -237,  -587,  -587,
+    -587,  -587,  -587,  -587,  -587,  -587,  -587,  -587,   182,  -587,
+    -195,  -110,  -587,  -587,   277,  -587,  -587,  -587,  -193,  -587,
+    -587,  -587,  -587,  -587,  -587,  -215,  -587,   161,  -416,  -587,
+     295,   -22,  -587,   -91,  -587,  -587,  -587,  -587,  -587,  -587,
+    -587,  -587,  -587,  -587,  -587,  -283,  -587,  -586,  -587,   -43,
+    -587,  -179,  -587,  -587,  -587,  -587,  -587,    46,  -587,  -587,
+    -587,  -587,  -183,  -587,  -587,  -239,  -587,  -587,   -55,  -168,
+    -115,   229,  -587,  -587,  -414,  -587,    60,  -587,  -587,  -587,
+    -587,  -238,  -587,  -587,   -23,  -587,  -276,   -19,  -587,  -587,
+    -587,  -587,    81,  -587,  -587,    78,  -587,  -587,  -146,   -75,
+    -587,  -587,  -172,  -587,   242,   -82,   -27,  -226,  -158,  -208,
+    -587,   -25,   -17,  -210,  -587,  -385,  -587,  -587,  -587,  -587,
+     475,  -587,   474,  -587,  -587,    62
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
    number is the opposite.  If zero, do what YYDEFACT says.
    If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -351
+#define YYTABLE_NINF -357
 static const yytype_int16 yytable[] =
 {
-      71,    95,   171,    96,   145,   137,   509,   188,   315,    46,
-     265,    97,   296,   298,  -154,     9,   320,    44,   257,    50,
-     202,   488,   106,   412,    11,    12,    13,   175,    14,   631,
-     234,   258,   432,   274,   294,   265,   305,   296,   298,    61,
-      58,   322,    16,   257,  -268,   328,   503,     4,   311,   630,
-      10,    15,    16,  -268,   354,   114,   258,    61,   274,   294,
-     134,   504,   631,    54,   505,   351,   122,   123,   124,    80,
-      81,    82,    36,    37,    38,    39,    55,   575,   576,    12,
-      13,   125,    14,     1,     2,  -269,    40,   580,    56,    87,
-     163,   164,   165,   166,  -269,   203,   204,   205,   413,   172,
-     211,    87,    57,    41,   284,    73,   489,   433,   221,   222,
-     223,   206,    74,    46,   181,   182,   477,    95,    17,    96,
-      76,    44,    18,    50,   589,    19,   590,    97,   284,   284,
-     452,    20,   299,   300,   301,   302,   415,   416,   417,   418,
-     419,   420,   635,   636,   107,   108,   470,   109,   444,   496,
-     446,    77,   110,   499,    78,   455,   458,   502,   479,   480,
-     324,   481,   482,   134,   467,    79,   471,   473,   101,   217,
-     106,   102,    17,   103,   112,   334,    18,   478,   479,   480,
-     113,   481,   482,   483,   459,    63,    64,    65,    66,    67,
-      68,    69,    70,   460,   461,   462,   463,    84,    85,    86,
-     116,   297,   117,   328,   189,   190,   191,   144,   374,    62,
-      63,    64,    65,    66,    67,    68,    69,    70,   252,   441,
-     442,   550,   121,   445,   130,   172,   297,   640,   529,  -269,
-     143,   323,    87,  -268,   537,   541,   545,   162,    95,   174,
-      96,   167,   284,   252,   350,   177,   352,   173,    97,   421,
-     422,   423,   424,   425,   426,   427,   428,   429,   284,   178,
-     179,   430,   180,   232,   184,   192,   187,   197,   200,   233,
-     193,    11,    12,    13,   234,   464,   465,   466,   235,    40,
-     236,   237,   194,   195,   238,   196,   239,   376,   240,   209,
-     241,   475,   212,   215,   380,   242,   214,    58,   243,   244,
-      63,    64,    65,    66,   245,   246,   247,   248,   249,   216,
-     219,   250,    84,    85,    86,    62,    63,    64,    65,    66,
-      67,    68,    69,    70,   249,   508,   230,   170,   231,   511,
-     306,   307,   431,   584,   309,   310,   313,   355,   451,   172,
-     434,   435,   436,   437,   438,   439,   316,   472,   317,   318,
-     251,   329,   330,   335,   336,   297,   353,   356,   357,   377,
-     389,   390,   391,   548,   395,   399,   403,   404,   612,   615,
-     618,   405,    19,   577,   406,   408,   407,   579,   409,   443,
-     251,   411,   476,   581,   490,   493,   492,   494,   497,   597,
-     598,   599,   582,   500,   583,   519,   520,   512,   513,   514,
-     515,   516,   517,   518,   521,   522,   523,   524,   525,   526,
-    -158,   585,   528,   592,   530,   531,   532,   593,   594,   595,
-     596,   600,   627,   619,   328,   620,   546,   547,   628,   549,
-      62,    63,    64,    65,    66,    67,    68,    69,    70,   622,
-      95,   637,    96,   626,   638,   641,   644,   645,   210,   308,
-      97,   168,  -153,   201,  -131,  -131,  -131,  -131,  -131,  -131,
-    -131,  -131,  -131,  -131,  -131,  -131,  -131,  -131,  -131,  -131,
-     213,   115,   380,   321,   208,   507,   332,    62,    63,    64,
-      65,    66,    67,    68,    69,    70,   172,   172,   172,   135,
-      84,    85,    86,   183,   642,   624,   586,   578,   621,   510,
-     643,   587,   601,   602,   603,   604,   605,   606,   607,   608,
-     609,   232,   610,   319,   639,    87,   588,   501,    98,    11,
-      12,    13,   234,    99,   498,   312,   235,    40,   236,   237,
-       0,     0,   238,     0,   239,     0,   240,     0,   241,  -131,
-       0,     0,     0,   242,     0,    58,     0,   244,    63,    64,
-      65,    66,   245,   246,   247,   248,   249,     0,     0,   250,
-      84,    85,    86,     0,     0,     0,     0,     0,   625,    62,
-      63,    64,    65,    66,    67,    68,    69,    70,    80,    81,
-      82,    83,    84,    85,    86,     0,     0,     0,     0,     0,
-       0,     0,    95,    95,    96,    96,     0,     0,     0,     0,
-       0,     0,    97,    97,     0,     0,     0,     0,     0,     0,
-       0,   172,     0,     0,     0,     0,     0,     0,     0,     0,
-      19,   451,   169,     0,     0,     0,     0,     0,   251,   551,
-     552,   553,   554,   555,   556,   557,   558,   559,   560,   561,
-     562,   563,   564,    62,    63,    64,    65,    66,    67,    68,
-      69,    70,   104,     0,    87,   551,   552,   553,   554,   555,
-     556,   557,   558,   559,   560,   561,   562,   563,   564,   147,
-     148,   149,   150,   151,   152,   153,   154,   155,   156,   157,
-     158,   159,   160,    62,    63,    64,    65,    66,    67,    68,
-      69,    70,   611,  -263,   146,   135,    84,    85,    86,     0,
-       0,     0,     0,   565,     0,   566,   567,   568,   569,   570,
-     571,   572,   573,  -350,  -350,  -350,  -350,  -350,  -350,  -350,
-    -350,  -350,  -350,  -350,  -350,  -350,  -350,     0,     0,   565,
-       0,   566,   567,   568,   569,   570,   571,   572,   573,     0,
-     147,   148,   149,   150,   151,   152,   153,   154,   155,   156,
-     157,   158,   159,   160,    62,    63,    64,    65,    66,    67,
-      68,    69,   527,  -350,     0,     0,  -350,     0,     0,     0,
-       0,     0,  -350,   358,   359,   360,   361,   362,   363,   364,
-     365,   366,   367,   368,   369,   370,   371,    62,    63,    64,
-      65,    66,    67,    68,    69,    70,    80,    81,    82,   135,
-      84,    85,    86,  -222,  -222,  -222,  -222,  -222,  -222,  -222,
-    -222,  -222,  -222,  -222,  -222,  -222,  -222,  -222,  -222,     0,
-       0,     0,     0,     0,     0,     0,   372,  -223,  -223,  -223,
-    -223,  -223,  -223,  -223,  -223,  -223,  -223,  -223,  -223,  -223,
-    -223,  -223,  -223,   337,   338,   339,   340,   341,   342,   343,
-     344,   345,   346,   347,   348,   135,    84,    85,    86,    62,
-      63,    64,    65,    66,    67,    68,    69,    70,   381,    81,
-      82,   135,    84,    85,    86,    62,    63,    64,    65,    66,
-      67,    68,    69,    70,   533,   534,   535,   135,    84,    85,
+      71,    96,   172,    97,   146,   321,   138,   521,   189,    46,
+     327,    98,   276,   176,   332,  -159,    44,   309,     9,   307,
+      50,   424,   107,   500,    11,    12,    13,   641,    14,   444,
+     205,  -273,   268,     4,   269,    36,    37,    38,    39,   276,
+    -273,    55,    12,    13,   309,    14,   307,   515,   285,    40,
+     334,    15,    16,    10,   340,   305,   366,   641,   115,   268,
+     135,   269,   516,    54,   245,   517,    41,   427,   428,   429,
+     430,   431,   432,   316,   363,   285,    58,    61,    16,   456,
+     489,   458,   305,   640,   192,   193,   194,   323,   587,   588,
+      56,   164,   165,   166,   167,    61,   230,   425,   592,   221,
+     173,   214,    57,    88,    73,   445,   206,   207,   208,   501,
+      74,   601,   295,   602,    46,   123,   124,   125,    96,    17,
+      97,    44,   209,    18,    76,    50,    19,   508,    98,   464,
+     126,   511,    20,   453,   454,   514,    17,   457,   295,   295,
+      18,    77,   490,   491,   492,   482,   493,   494,   495,  -274,
+      78,   221,    79,    88,   108,   109,   114,   110,  -274,   541,
+     182,   183,   111,   117,   135,   467,   470,   231,   232,   479,
+     336,   107,   226,   222,   485,   102,   483,    80,    81,    82,
+     310,   311,   312,   313,    87,   346,   471,    63,    64,    65,
+      66,    67,    68,    69,    70,   472,   473,   474,   475,    84,
+      85,    86,   446,   447,   448,   449,   450,   451,   491,   492,
+     308,   493,   494,   340,     1,     2,   645,   646,   386,   103,
+     104,   113,   118,   122,   562,   222,   650,   263,   131,  -274,
+     144,    88,   145,   195,   168,  -273,   173,   308,   174,   178,
+     163,   179,   335,   180,   549,   553,   557,   175,   181,    96,
+     196,    97,   185,   295,   263,   362,   188,   364,   190,    98,
+     433,   434,   435,   436,   437,   438,   439,   440,   441,   295,
+     197,   200,   442,   198,   199,   203,   212,   215,   476,   477,
+     478,   223,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,   217,   224,   225,   228,   317,   318,   239,   388,   240,
+     241,   320,   242,   487,   322,  -158,   392,  -136,  -136,  -136,
+    -136,  -136,  -136,  -136,  -136,  -136,  -136,  -136,  -136,  -136,
+    -136,  -136,  -136,  -136,    62,    63,    64,    65,    66,    67,
+      68,    69,    70,   459,   325,   328,   460,   520,   461,   329,
+     330,   523,   341,   262,   443,   596,   342,   347,   348,   365,
+     463,   173,   368,   369,   367,   401,   389,   402,   403,   484,
+     635,   407,   411,   415,   416,   417,   418,   308,    88,   420,
+     419,   421,   455,   423,   488,   560,   502,   504,   625,   628,
+     631,   505,   509,   506,   589,   512,   531,   532,   591,   533,
+     534,   535,   536,  -136,   593,   537,   538,  -163,   604,   597,
+     609,   611,   612,   605,   594,   606,   595,   607,   608,   524,
+     525,   526,   527,   528,   529,   530,   613,   632,   633,   637,
+     638,   647,   648,   651,   540,   654,   542,   543,   544,   655,
+     169,   319,   340,   204,   213,   116,   333,   344,   558,   559,
+     184,   561,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,   105,    96,   216,    97,   636,   211,   590,   598,   519,
+     652,   610,    98,    62,    63,    64,    65,    66,    67,    68,
+      69,    70,    80,    81,    82,    83,    84,    85,    86,    87,
+     653,   331,   522,   600,   392,   599,   510,   513,   324,    62,
+      63,    64,    65,    66,    67,    68,    69,    70,   173,   173,
+     173,   136,    84,    85,    86,    99,   221,   100,     0,     0,
+     634,     0,     0,     0,   614,   615,   616,   617,   618,   619,
+     620,   621,   622,   649,   623,   243,     0,     0,     0,     0,
+       0,   244,     0,    11,    12,    13,   245,   170,     0,     0,
+     246,    40,   247,   248,     0,     0,   249,     0,   250,    88,
+     251,     0,   252,     0,     0,     0,     0,   253,     0,    58,
+     254,   255,    63,    64,    65,    66,   256,   257,   258,   259,
+     260,     0,     0,   261,    84,    85,    86,     0,     0,     0,
+     222,     0,     0,     0,     0,   148,   149,   150,   151,   152,
+     153,   154,   155,   156,   157,   158,   159,   160,   161,     0,
+       0,     0,     0,     0,     0,    96,    96,    97,    97,     0,
+       0,     0,     0,     0,     0,    98,    98,     0,     0,     0,
+       0,   173,     0,     0,     0,     0,     0,     0,     0,   243,
+       0,   463,     0,     0,     0,    19,     0,    11,    12,    13,
+     245,     0,     0,   262,   246,    40,   247,   248,     0,     0,
+     249,     0,   250,     0,   251,     0,   252,     0,     0,     0,
+       0,   253,     0,    58,     0,   255,    63,    64,    65,    66,
+     256,   257,   258,   259,   260,   147,     0,   261,    84,    85,
+      86,   563,   564,   565,   566,   567,   568,   569,   570,   571,
+     572,   573,   574,   575,   576,   563,   564,   565,   566,   567,
+     568,   569,   570,   571,   572,   573,   574,   575,   576,    62,
+      63,    64,    65,    66,    67,    68,    69,    70,   260,     0,
+       0,   171,   148,   149,   150,   151,   152,   153,   154,   155,
+     156,   157,   158,   159,   160,   161,     0,     0,     0,    19,
+       0,     0,     0,     0,     0,  -268,     0,   262,     0,     0,
+       0,     0,     0,     0,     0,   577,     0,   578,   579,   580,
+     581,   582,   583,   584,   585,     0,     0,     0,     0,   577,
+       0,   578,   579,   580,   581,   582,   583,   584,   585,  -356,
+    -356,  -356,  -356,  -356,  -356,  -356,  -356,  -356,  -356,  -356,
+    -356,  -356,  -356,   370,   371,   372,   373,   374,   375,   376,
+     377,   378,   379,   380,   381,   382,   383,    62,    63,    64,
+      65,    66,    67,    68,    69,    70,    80,    81,    82,   136,
+      84,    85,    86,    87,     0,     0,     0,     0,     0,  -356,
+       0,     0,  -356,     0,     0,     0,     0,     0,  -356,     0,
+       0,     0,     0,     0,     0,     0,   384,  -227,  -227,  -227,
+    -227,  -227,  -227,  -227,  -227,  -227,  -227,  -227,  -227,  -227,
+    -227,  -227,  -227,  -227,  -228,  -228,  -228,  -228,  -228,  -228,
+    -228,  -228,  -228,  -228,  -228,  -228,  -228,  -228,  -228,  -228,
+    -228,   349,   350,   351,   352,   353,   354,   355,   356,   357,
+     358,   359,   360,   136,    84,    85,    86,    87,    62,    63,
+      64,    65,    66,    67,    68,    69,    70,   393,    81,    82,
+     136,    84,    85,    86,    87,    62,    63,    64,    65,    66,
+      67,    68,    69,    70,   545,   546,   547,   136,    84,    85,
       86,    62,    63,    64,    65,    66,    67,    68,    69,    70,
-     538,   539,   540,   135,    84,    85,    86,    62,    63,    64,
-      65,    66,    67,    68,    69,    70,   542,   543,   544,   135,
+     550,   551,   552,   136,    84,    85,    86,    62,    63,    64,
+      65,    66,    67,    68,    69,    70,   554,   555,   556,   136,
       84,    85,    86,    62,    63,    64,    65,    66,    67,    68,
-      69,    70,     0,   453,   454,   135,    84,    85,    86,    62,
-      63,    64,    65,    66,    67,    68,    69,    70,     0,   456,
-     457,   135,    84,    85,    86,    62,    63,    64,    65,    66,
-      67,    68,    69,    70,     0,   613,   614,   135,    84,    85,
+      69,    70,     0,   465,   466,   136,    84,    85,    86,    62,
+      63,    64,    65,    66,    67,    68,    69,    70,     0,   468,
+     469,   136,    84,    85,    86,    62,    63,    64,    65,    66,
+      67,    68,    69,    70,     0,   626,   627,   136,    84,    85,
       86,    62,    63,    64,    65,    66,    67,    68,    69,    70,
-       0,   616,   617,   135,    84,    85,    86,    62,    63,    64,
-      65,    66,    67,    68,    69,    70,   447,     0,     0,   448,
-       0,   449,    62,    63,    64,    65,    66,    67,    68,    69,
-      70,     0,     0,     0,   170
+       0,   629,   630,   136,    84,    85,    86,    62,    63,    64,
+      65,    66,    67,    68,    69,    70,   624,     0,     0,   136,
+      84,    85,    86,    62,    63,    64,    65,    66,    67,    68,
+      69,    70,     0,     0,     0,   171,    62,    63,    64,    65,
+      66,    67,    68,    69,    70,    62,    63,    64,    65,    66,
+      67,    68,    69,   539
 };
 
 static const yytype_int16 yycheck[] =
 {
-      17,    28,   116,    28,    94,    87,   409,   153,   237,     9,
-     218,    28,   218,   218,    35,     2,   242,     9,   218,     9,
-      35,    35,    39,    45,     9,    10,    11,   122,    13,   600,
-      12,   218,    45,   218,   218,   243,   222,   243,   243,    15,
-      35,   247,    37,   243,   118,   251,    14,    35,   234,    31,
-       0,    36,    37,   127,   283,    42,   243,    33,   243,   243,
-      77,    29,   633,    46,    32,   271,   110,   111,   112,    46,
-      47,    48,     3,     4,     5,     6,    47,   461,   462,    10,
-      11,   125,    13,   114,   115,   118,    17,   471,    46,   122,
-     107,   108,   109,   110,   127,   110,   111,   112,   120,   116,
-     182,   122,   122,    34,   218,    37,   120,   120,   203,   105,
-     106,   126,   118,   113,   123,   124,    35,   144,   103,   144,
-      35,   113,   107,   113,    97,   110,    99,   144,   242,   243,
-     356,   116,    38,    39,    40,    41,   338,   339,   340,   341,
-     342,   343,   619,   620,    38,    39,   372,    41,   350,   391,
-     352,   118,    46,   395,    35,   361,   362,   399,    97,    98,
-     250,   100,   101,   180,   372,    35,   372,   372,    46,   196,
-     187,    46,   103,    46,    46,   265,   107,    96,    97,    98,
-      35,   100,   101,   102,    37,    38,    39,    40,    41,    42,
-      43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
-     120,   218,    46,   409,   158,   159,   160,   120,   298,    37,
-      38,    39,    40,    41,    42,    43,    44,    45,   218,   347,
-     348,   450,   113,   351,    35,   242,   243,   630,   430,   122,
-      35,   248,   122,   122,   440,   441,   442,   121,   265,   124,
-     265,   120,   356,   243,   271,   119,   271,   123,   265,    37,
-      38,    39,    40,    41,    42,    43,    44,    45,   372,   120,
-     119,    49,   120,     1,   118,    46,   118,    46,    35,     7,
-     121,     9,    10,    11,    12,   128,   129,   130,    16,    17,
-      18,    19,   121,   121,    22,   121,    24,   304,    26,    35,
-      28,   373,    46,    48,   311,    33,    47,    35,    36,    37,
-      38,    39,    40,    41,    42,    43,    44,    45,    46,    46,
-       8,    49,    50,    51,    52,    37,    38,    39,    40,    41,
-      42,    43,    44,    45,    46,   407,   119,    49,   119,   411,
-     108,   104,   120,   479,    35,    35,   118,   127,   355,   356,
-      54,    55,    56,    57,    58,    59,    35,   372,    35,    35,
-     118,    35,    35,    35,    35,   372,    35,   121,    35,   109,
-      35,    35,    20,   445,    21,    30,    35,    35,   574,   575,
-     576,    35,   110,   463,    35,   119,   121,   467,   120,    45,
-     118,   121,   121,   473,    96,   119,    53,   120,    23,   503,
-     504,   505,   474,    25,   476,    45,    45,   414,   415,   416,
-     417,   418,   419,   420,    45,    45,    45,    45,    45,    45,
-      35,   118,   429,    35,   431,   432,   433,    35,    35,    35,
-      35,    35,    35,   120,   630,   120,   443,   444,   120,   446,
-      37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
-     467,   119,   467,   589,    15,    27,    35,    35,   180,   225,
-     467,   113,    35,   174,    37,    38,    39,    40,    41,    42,
-      43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
-     187,    52,   489,   243,   178,   401,   265,    37,    38,    39,
-      40,    41,    42,    43,    44,    45,   503,   504,   505,    49,
-      50,    51,    52,   144,   633,   585,   489,   467,   580,   410,
-     638,   492,   519,   520,   521,   522,   523,   524,   525,   526,
-     527,     1,   529,   241,   628,   122,   494,   397,    30,     9,
-      10,    11,    12,    33,   393,   235,    16,    17,    18,    19,
-      -1,    -1,    22,    -1,    24,    -1,    26,    -1,    28,   122,
-      -1,    -1,    -1,    33,    -1,    35,    -1,    37,    38,    39,
-      40,    41,    42,    43,    44,    45,    46,    -1,    -1,    49,
-      50,    51,    52,    -1,    -1,    -1,    -1,    -1,   585,    37,
-      38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
-      48,    49,    50,    51,    52,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,   619,   620,   619,   620,    -1,    -1,    -1,    -1,
-      -1,    -1,   619,   620,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,   628,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-     110,   638,    35,    -1,    -1,    -1,    -1,    -1,   118,    54,
-      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
-      65,    66,    67,    37,    38,    39,    40,    41,    42,    43,
-      44,    45,    46,    -1,   122,    54,    55,    56,    57,    58,
-      59,    60,    61,    62,    63,    64,    65,    66,    67,    82,
-      83,    84,    85,    86,    87,    88,    89,    90,    91,    92,
-      93,    94,    95,    37,    38,    39,    40,    41,    42,    43,
-      44,    45,    46,   118,    36,    49,    50,    51,    52,    -1,
-      -1,    -1,    -1,   128,    -1,   130,   131,   132,   133,   134,
-     135,   136,   137,    68,    69,    70,    71,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    81,    -1,    -1,   128,
-      -1,   130,   131,   132,   133,   134,   135,   136,   137,    -1,
-      82,    83,    84,    85,    86,    87,    88,    89,    90,    91,
-      92,    93,    94,    95,    37,    38,    39,    40,    41,    42,
-      43,    44,    45,   118,    -1,    -1,   121,    -1,    -1,    -1,
-      -1,    -1,   127,    68,    69,    70,    71,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    81,    37,    38,    39,
+      17,    28,   117,    28,    95,   242,    88,   421,   154,     9,
+     248,    28,   227,   123,   253,    35,     9,   227,     2,   227,
+       9,    45,    39,    35,     9,    10,    11,   613,    13,    45,
+      35,   119,   227,    35,   227,     3,     4,     5,     6,   254,
+     128,    47,    10,    11,   254,    13,   254,    14,   227,    17,
+     258,    36,    37,     0,   262,   227,   294,   643,    42,   254,
+      77,   254,    29,    46,    12,    32,    34,   350,   351,   352,
+     353,   354,   355,   231,   282,   254,    35,    15,    37,   362,
+      35,   364,   254,    31,   159,   160,   161,   245,   473,   474,
+      46,   108,   109,   110,   111,    33,   206,   121,   483,   190,
+     117,   183,   123,   123,    37,   121,   111,   112,   113,   121,
+     119,    98,   227,   100,   114,   111,   112,   113,   145,   104,
+     145,   114,   127,   108,    35,   114,   111,   403,   145,   368,
+     126,   407,   117,   359,   360,   411,   104,   363,   253,   254,
+     108,   119,    97,    98,    99,   384,   101,   102,   103,   119,
+      35,   242,    35,   123,    38,    39,    35,    41,   128,   442,
+     124,   125,    46,   121,   181,   373,   374,   106,   107,   384,
+     261,   188,   199,   190,   384,    46,   384,    46,    47,    48,
+      38,    39,    40,    41,    53,   276,    37,    38,    39,    40,
+      41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
+      51,    52,    55,    56,    57,    58,    59,    60,    98,    99,
+     227,   101,   102,   421,   115,   116,   632,   633,   309,    46,
+      46,    46,    46,   114,   462,   242,   640,   227,    35,   123,
+      35,   123,   121,    46,   121,   123,   253,   254,   124,   120,
+     122,   121,   259,   120,   452,   453,   454,   125,   121,   276,
+     122,   276,   119,   368,   254,   282,   119,   282,   119,   276,
+      37,    38,    39,    40,    41,    42,    43,    44,    45,   384,
+     122,    46,    49,   122,   122,    35,    35,    46,   129,   130,
+     131,    47,    37,    38,    39,    40,    41,    42,    43,    44,
+      45,    46,    48,    46,     8,   109,   105,   120,   315,   120,
+     120,    35,   121,   385,    35,    35,   323,    37,    38,    39,
       40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
-      50,    51,    52,    37,    38,    39,    40,    41,    42,    43,
-      44,    45,    46,    47,    48,    49,    50,    51,    52,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,   121,    37,    38,    39,
+      50,    51,    52,    53,    37,    38,    39,    40,    41,    42,
+      43,    44,    45,    46,   119,    35,    49,   419,    51,    35,
+      35,   423,    35,   119,   121,   491,    35,    35,    35,    35,
+     367,   368,   122,    35,   128,    35,   110,    35,    20,   384,
+     597,    21,    30,    35,    35,    35,    35,   384,   123,   120,
+     122,   121,    45,   122,   122,   457,    97,    54,   586,   587,
+     588,   120,    23,   121,   475,    25,    45,    45,   479,    45,
+      45,    45,    45,   123,   485,    45,    45,    35,    35,   119,
+     515,   516,   517,    35,   486,    35,   488,    35,    35,   426,
+     427,   428,   429,   430,   431,   432,    35,   121,   121,    35,
+     121,   120,    15,    27,   441,    35,   443,   444,   445,    35,
+     114,   234,   640,   175,   181,    52,   254,   276,   455,   456,
+     145,   458,    37,    38,    39,    40,    41,    42,    43,    44,
+      45,    46,   479,   188,   479,   601,   179,   479,   501,   413,
+     643,   516,   479,    37,    38,    39,    40,    41,    42,    43,
+      44,    45,    46,    47,    48,    49,    50,    51,    52,    53,
+     648,   252,   422,   506,   501,   504,   405,   409,   246,    37,
+      38,    39,    40,    41,    42,    43,    44,    45,   515,   516,
+     517,    49,    50,    51,    52,    30,   597,    33,    -1,    -1,
+     592,    -1,    -1,    -1,   531,   532,   533,   534,   535,   536,
+     537,   538,   539,   638,   541,     1,    -1,    -1,    -1,    -1,
+      -1,     7,    -1,     9,    10,    11,    12,    35,    -1,    -1,
+      16,    17,    18,    19,    -1,    -1,    22,    -1,    24,   123,
+      26,    -1,    28,    -1,    -1,    -1,    -1,    33,    -1,    35,
+      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
+      46,    -1,    -1,    49,    50,    51,    52,    -1,    -1,    -1,
+     597,    -1,    -1,    -1,    -1,    83,    84,    85,    86,    87,
+      88,    89,    90,    91,    92,    93,    94,    95,    96,    -1,
+      -1,    -1,    -1,    -1,    -1,   632,   633,   632,   633,    -1,
+      -1,    -1,    -1,    -1,    -1,   632,   633,    -1,    -1,    -1,
+      -1,   638,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     1,
+      -1,   648,    -1,    -1,    -1,   111,    -1,     9,    10,    11,
+      12,    -1,    -1,   119,    16,    17,    18,    19,    -1,    -1,
+      22,    -1,    24,    -1,    26,    -1,    28,    -1,    -1,    -1,
+      -1,    33,    -1,    35,    -1,    37,    38,    39,    40,    41,
+      42,    43,    44,    45,    46,    36,    -1,    49,    50,    51,
+      52,    55,    56,    57,    58,    59,    60,    61,    62,    63,
+      64,    65,    66,    67,    68,    55,    56,    57,    58,    59,
+      60,    61,    62,    63,    64,    65,    66,    67,    68,    37,
+      38,    39,    40,    41,    42,    43,    44,    45,    46,    -1,
+      -1,    49,    83,    84,    85,    86,    87,    88,    89,    90,
+      91,    92,    93,    94,    95,    96,    -1,    -1,    -1,   111,
+      -1,    -1,    -1,    -1,    -1,   119,    -1,   119,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   129,    -1,   131,   132,   133,
+     134,   135,   136,   137,   138,    -1,    -1,    -1,    -1,   129,
+      -1,   131,   132,   133,   134,   135,   136,   137,   138,    69,
+      70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
+      80,    81,    82,    69,    70,    71,    72,    73,    74,    75,
+      76,    77,    78,    79,    80,    81,    82,    37,    38,    39,
       40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
-      50,    51,    52,    37,    38,    39,    40,    41,    42,    43,
-      44,    45,    46,    47,    48,    49,    50,    51,    52,    37,
-      38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
-      48,    49,    50,    51,    52,    37,    38,    39,    40,    41,
+      50,    51,    52,    53,    -1,    -1,    -1,    -1,    -1,   119,
+      -1,    -1,   122,    -1,    -1,    -1,    -1,    -1,   128,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   122,    37,    38,    39,
+      40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
+      50,    51,    52,    53,    37,    38,    39,    40,    41,    42,
+      43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
+      53,    37,    38,    39,    40,    41,    42,    43,    44,    45,
+      46,    47,    48,    49,    50,    51,    52,    53,    37,    38,
+      39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
+      49,    50,    51,    52,    53,    37,    38,    39,    40,    41,
       42,    43,    44,    45,    46,    47,    48,    49,    50,    51,
       52,    37,    38,    39,    40,    41,    42,    43,    44,    45,
       46,    47,    48,    49,    50,    51,    52,    37,    38,    39,
@@ -1681,79 +1703,82 @@
       52,    37,    38,    39,    40,    41,    42,    43,    44,    45,
       -1,    47,    48,    49,    50,    51,    52,    37,    38,    39,
       40,    41,    42,    43,    44,    45,    46,    -1,    -1,    49,
-      -1,    51,    37,    38,    39,    40,    41,    42,    43,    44,
-      45,    -1,    -1,    -1,    49
+      50,    51,    52,    37,    38,    39,    40,    41,    42,    43,
+      44,    45,    -1,    -1,    -1,    49,    37,    38,    39,    40,
+      41,    42,    43,    44,    45,    37,    38,    39,    40,    41,
+      42,    43,    44,    45
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
 static const yytype_uint16 yystos[] =
 {
-       0,   114,   115,   139,    35,   141,   292,   293,   140,   141,
-       0,     9,    10,    11,    13,    36,    37,   103,   107,   110,
-     116,   144,   145,   146,   147,   158,   162,   185,   200,   226,
-     294,   295,   296,   298,   299,   300,     3,     4,     5,     6,
-      17,    34,   142,   143,   144,   157,   158,   159,   160,   161,
-     162,   166,   168,   277,    46,    47,    46,   122,    35,   193,
-     297,   300,    37,    38,    39,    40,    41,    42,    43,    44,
-      45,   287,   288,    37,   118,   186,    35,   118,    35,    35,
-      46,    47,    48,    49,    50,    51,    52,   122,   202,   203,
-     205,   206,   207,   208,   245,   281,   286,   287,   295,   297,
-     170,    46,    46,    46,    46,   169,   287,    38,    39,    41,
-      46,   279,    46,    35,   141,   170,   120,    46,   163,   164,
-     165,   113,   110,   111,   112,   125,   187,   188,   189,   190,
-      35,   148,   149,   150,   287,    49,   209,   280,   281,   284,
-     285,   286,   287,    35,   120,   208,    36,    82,    83,    84,
+       0,   115,   116,   140,    35,   142,   296,   297,   141,   142,
+       0,     9,    10,    11,    13,    36,    37,   104,   108,   111,
+     117,   145,   146,   147,   148,   159,   163,   189,   204,   230,
+     298,   299,   300,   302,   303,   304,     3,     4,     5,     6,
+      17,    34,   143,   144,   145,   158,   159,   160,   161,   162,
+     163,   167,   169,   281,    46,    47,    46,   123,    35,   197,
+     301,   304,    37,    38,    39,    40,    41,    42,    43,    44,
+      45,   291,   292,    37,   119,   190,    35,   119,    35,    35,
+      46,    47,    48,    49,    50,    51,    52,    53,   123,   206,
+     207,   209,   210,   211,   212,   249,   285,   290,   291,   299,
+     301,   171,    46,    46,    46,    46,   170,   291,    38,    39,
+      41,    46,   283,    46,    35,   142,   171,   121,    46,   164,
+     165,   166,   114,   111,   112,   113,   126,   191,   192,   193,
+     194,    35,   149,   150,   151,   291,    49,   213,   284,   285,
+     288,   289,   290,   291,    35,   121,   212,    36,    83,    84,
       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
-      95,   171,   121,   287,   287,   287,   287,   120,   143,    35,
-      49,   245,   287,   123,   124,   186,   191,   119,   120,   119,
-     120,   123,   124,   205,   118,   273,   274,   118,   273,   274,
-     274,   274,    46,   121,   121,   121,   121,    46,   173,   174,
-      35,   165,    35,   110,   111,   112,   126,   192,   189,    35,
-     150,   280,    46,   169,    47,    48,    46,   281,   181,     8,
-     175,   186,   105,   106,   151,   152,   153,   154,   155,   156,
-     119,   119,     1,     7,    12,    16,    18,    19,    22,    24,
-      26,    28,    33,    36,    37,    42,    43,    44,    45,    46,
-      49,   118,   158,   167,   182,   183,   184,   185,   193,   194,
-     195,   196,   197,   198,   199,   200,   210,   211,   213,   215,
-     216,   219,   221,   222,   226,   227,   228,   229,   238,   239,
-     240,   241,   242,   243,   245,   246,   252,   253,   254,   255,
-     263,   264,   275,   276,   277,   278,   284,   287,   288,    38,
-      39,    40,    41,   176,   283,   283,   108,   104,   153,    35,
-      35,   283,   279,   118,   256,   256,    35,    35,    35,   246,
-     240,   183,   284,   287,   208,   247,   248,   249,   284,    35,
-      35,   201,   202,   204,   208,    35,    35,    37,    38,    39,
-      40,    41,    42,    43,    44,    45,    46,    47,    48,   217,
-     281,   284,   286,    35,   256,   127,   121,    35,    68,    69,
-      70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
-      80,    81,   121,   291,   208,   177,   287,   109,   223,   224,
-     287,    46,   257,   258,   259,   260,   261,   262,   280,    35,
-      35,    20,   265,   266,   267,    21,   268,   269,   270,    30,
-     230,   231,   232,    35,    35,    35,    35,   121,   119,   120,
-     250,   121,    45,   120,   220,   220,   220,   220,   220,   220,
-     220,    37,    38,    39,    40,    41,    42,    43,    44,    45,
-      49,   120,    45,   120,    54,    55,    56,    57,    58,    59,
-     282,   282,   282,    45,   220,   282,   220,    46,    49,    51,
-     244,   287,   240,    47,    48,   284,    47,    48,   284,    37,
-      46,    47,    48,    49,   128,   129,   130,   200,   212,   214,
-     240,   284,   286,   288,   289,   280,   121,    35,    96,    97,
-      98,   100,   101,   102,   178,   179,   180,   251,    35,   120,
-      96,   225,    53,   119,   120,   271,   261,    23,   267,   261,
-      25,   270,   261,    14,    29,    32,   233,   232,   280,   249,
-     251,   280,   287,   287,   287,   287,   287,   287,   287,    45,
-      45,    45,    45,    45,    45,    45,    45,    45,   287,   220,
-     287,   287,   287,    46,    47,    48,   218,   284,    46,    47,
-      48,   284,    46,    47,    48,   284,   287,   287,   280,   287,
-     256,    54,    55,    56,    57,    58,    59,    60,    61,    62,
-      63,    64,    65,    66,    67,   128,   130,   131,   132,   133,
-     134,   135,   136,   137,   290,   290,   290,   208,   206,   208,
-     290,   208,   280,   280,   273,   118,   224,   262,   259,    97,
-      99,   272,    35,    35,    35,    35,    35,   245,   245,   245,
-      35,   287,   287,   287,   287,   287,   287,   287,   287,   287,
-     287,    46,   284,    47,    48,   284,    47,    48,   284,   120,
-     120,   280,    46,   172,   208,   287,   273,    35,   120,   234,
-      31,   222,   235,   236,   237,   203,   203,   119,    15,   245,
-     249,    27,   237,   244,    35,    35
+      95,    96,   172,   122,   291,   291,   291,   291,   121,   144,
+      35,    49,   249,   291,   124,   125,   190,   195,   120,   121,
+     120,   121,   124,   125,   209,   119,   277,   278,   119,   277,
+     119,   173,   278,   278,   278,    46,   122,   122,   122,   122,
+      46,   177,   178,    35,   166,    35,   111,   112,   113,   127,
+     196,   193,    35,   151,   284,    46,   170,    46,   174,   175,
+     176,   212,   291,    47,    48,    46,   285,   185,     8,   179,
+     190,   106,   107,   152,   153,   154,   155,   156,   157,   120,
+     120,   120,   121,     1,     7,    12,    16,    18,    19,    22,
+      24,    26,    28,    33,    36,    37,    42,    43,    44,    45,
+      46,    49,   119,   159,   168,   186,   187,   188,   189,   197,
+     198,   199,   200,   201,   202,   203,   204,   214,   215,   217,
+     219,   220,   223,   225,   226,   230,   231,   232,   233,   242,
+     243,   244,   245,   246,   247,   249,   250,   256,   257,   258,
+     259,   267,   268,   279,   280,   281,   282,   288,   291,   292,
+      38,    39,    40,    41,   180,   287,   287,   109,   105,   154,
+      35,   176,    35,   287,   283,   119,   260,   260,    35,    35,
+      35,   250,   244,   187,   288,   291,   212,   251,   252,   253,
+     288,    35,    35,   205,   206,   208,   212,    35,    35,    37,
+      38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
+      48,   221,   285,   288,   290,    35,   260,   128,   122,    35,
+      69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
+      79,    80,    81,    82,   122,   295,   212,   181,   291,   110,
+     227,   228,   291,    46,   261,   262,   263,   264,   265,   266,
+     284,    35,    35,    20,   269,   270,   271,    21,   272,   273,
+     274,    30,   234,   235,   236,    35,    35,    35,    35,   122,
+     120,   121,   254,   122,    45,   121,   224,   224,   224,   224,
+     224,   224,   224,    37,    38,    39,    40,    41,    42,    43,
+      44,    45,    49,   121,    45,   121,    55,    56,    57,    58,
+      59,    60,   286,   286,   286,    45,   224,   286,   224,    46,
+      49,    51,   248,   291,   244,    47,    48,   288,    47,    48,
+     288,    37,    46,    47,    48,    49,   129,   130,   131,   204,
+     216,   218,   244,   288,   290,   292,   293,   284,   122,    35,
+      97,    98,    99,   101,   102,   103,   182,   183,   184,   255,
+      35,   121,    97,   229,    54,   120,   121,   275,   265,    23,
+     271,   265,    25,   274,   265,    14,    29,    32,   237,   236,
+     284,   253,   255,   284,   291,   291,   291,   291,   291,   291,
+     291,    45,    45,    45,    45,    45,    45,    45,    45,    45,
+     291,   224,   291,   291,   291,    46,    47,    48,   222,   288,
+      46,    47,    48,   288,    46,    47,    48,   288,   291,   291,
+     284,   291,   260,    55,    56,    57,    58,    59,    60,    61,
+      62,    63,    64,    65,    66,    67,    68,   129,   131,   132,
+     133,   134,   135,   136,   137,   138,   294,   294,   294,   212,
+     210,   212,   294,   212,   284,   284,   277,   119,   228,   266,
+     263,    98,   100,   276,    35,    35,    35,    35,    35,   249,
+     247,   249,   249,    35,   291,   291,   291,   291,   291,   291,
+     291,   291,   291,   291,    46,   288,    47,    48,   288,    47,
+      48,   288,   121,   121,   284,   176,   277,    35,   121,   238,
+      31,   226,   239,   240,   241,   207,   207,   120,    15,   249,
+     253,    27,   241,   248,    35,    35
 };
 
 #define yyerrok		(yyerrstatus = 0)
@@ -2581,22 +2606,22 @@
   switch (yyn)
     {
         case 4:
-#line 548 "pir.y"
+#line 554 "pir.y"
     { fixup_global_labels(lexer); ;}
     break;
 
   case 20:
-#line 579 "pir.y"
+#line 585 "pir.y"
     { new_macro_const(lexer->macros, (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval), yypirget_lineno(yyscanner)); ;}
     break;
 
   case 21:
-#line 585 "pir.y"
+#line 591 "pir.y"
     { /* fprintf(stderr, "macro body: [%s]\n", CURRENT_MACRO(lexer)->body);*/ ;}
     break;
 
   case 22:
-#line 589 "pir.y"
+#line 595 "pir.y"
     {
                           new_macro(lexer->macros, (yyvsp[(2) - (2)].sval), yypirget_lineno(yyscanner), TRUE,
                                     lexer->macro_size);
@@ -2604,17 +2629,17 @@
     break;
 
   case 27:
-#line 604 "pir.y"
+#line 610 "pir.y"
     { add_macro_param(CURRENT_MACRO(lexer), (yyvsp[(1) - (1)].sval)); ;}
     break;
 
   case 35:
-#line 623 "pir.y"
+#line 629 "pir.y"
     { store_macro_string(CURRENT_MACRO(lexer), "%s\n", (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 36:
-#line 627 "pir.y"
+#line 633 "pir.y"
     {
                           store_macro_string(CURRENT_MACRO(lexer), ".local %s %s\n",
                                              pir_type_names[(yyvsp[(2) - (3)].ival)], (yyvsp[(3) - (3)].sval));
@@ -2622,203 +2647,251 @@
     break;
 
   case 37:
-#line 638 "pir.y"
+#line 644 "pir.y"
     { load_library(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 38:
-#line 642 "pir.y"
+#line 648 "pir.y"
     { yypirset_lineno ((yyvsp[(2) - (2)].ival), yyscanner); ;}
     break;
 
   case 39:
-#line 644 "pir.y"
+#line 650 "pir.y"
     { lexer->filename = (yyvsp[(2) - (2)].sval); ;}
     break;
 
   case 41:
-#line 653 "pir.y"
+#line 659 "pir.y"
     { set_hll(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 42:
-#line 657 "pir.y"
+#line 663 "pir.y"
     { set_hll_map(lexer, (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 43:
-#line 661 "pir.y"
+#line 667 "pir.y"
     { set_namespace(lexer, (yyvsp[(3) - (4)].key)); ;}
     break;
 
   case 44:
-#line 665 "pir.y"
+#line 671 "pir.y"
     { (yyval.key) = NULL; ;}
     break;
 
   case 45:
-#line 667 "pir.y"
+#line 673 "pir.y"
     { (yyval.key) = (yyvsp[(1) - (1)].key); ;}
     break;
 
   case 46:
-#line 671 "pir.y"
+#line 677 "pir.y"
     { (yyval.key) = new_key(lexer, (yyvsp[(1) - (1)].expr)); ;}
     break;
 
   case 47:
-#line 673 "pir.y"
+#line 679 "pir.y"
     { (yyval.key) = add_key(lexer, (yyvsp[(1) - (3)].key), (yyvsp[(3) - (3)].expr)); ;}
     break;
 
   case 48:
-#line 677 "pir.y"
+#line 683 "pir.y"
     { (yyval.expr) = expr_from_const(lexer, new_const(lexer, STRING_TYPE, (yyvsp[(1) - (1)].sval))); ;}
     break;
 
   case 50:
-#line 687 "pir.y"
+#line 693 "pir.y"
     { close_sub(lexer); ;}
     break;
 
   case 51:
-#line 691 "pir.y"
+#line 697 "pir.y"
     { new_subr(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 56:
-#line 703 "pir.y"
-    { set_sub_flag(lexer, SUB_FLAG_ANON);;}
+#line 709 "pir.y"
+    { set_sub_flag(lexer, PIRC_SUB_FLAG_ANON);;}
     break;
 
   case 57:
-#line 705 "pir.y"
-    { set_sub_flag(lexer, SUB_FLAG_INIT); ;}
+#line 711 "pir.y"
+    { set_sub_flag(lexer, PIRC_SUB_FLAG_INIT); ;}
     break;
 
   case 58:
-#line 707 "pir.y"
-    { set_sub_flag(lexer, SUB_FLAG_LOAD); ;}
+#line 713 "pir.y"
+    { set_sub_flag(lexer, PIRC_SUB_FLAG_LOAD); ;}
     break;
 
   case 59:
-#line 709 "pir.y"
-    { set_sub_flag(lexer, SUB_FLAG_MAIN); ;}
+#line 715 "pir.y"
+    { set_sub_flag(lexer, PIRC_SUB_FLAG_MAIN); ;}
     break;
 
   case 60:
-#line 711 "pir.y"
-    { set_sub_flag(lexer, SUB_FLAG_LEX); ;}
+#line 717 "pir.y"
+    { set_sub_flag(lexer, PIRC_SUB_FLAG_LEX); ;}
     break;
 
   case 61:
-#line 713 "pir.y"
-    { set_sub_flag(lexer, SUB_FLAG_POSTCOMP); ;}
+#line 719 "pir.y"
+    { set_sub_flag(lexer, PIRC_SUB_FLAG_POSTCOMP); ;}
     break;
 
   case 62:
-#line 715 "pir.y"
-    { set_sub_flag(lexer, SUB_FLAG_IMMEDIATE); ;}
+#line 721 "pir.y"
+    { set_sub_flag(lexer, PIRC_SUB_FLAG_IMMEDIATE); ;}
     break;
 
   case 63:
-#line 717 "pir.y"
-    { set_sub_flag(lexer, SUB_FLAG_MULTI); ;}
+#line 723 "pir.y"
+    { set_sub_flag(lexer, PIRC_SUB_FLAG_MULTI); ;}
     break;
 
   case 64:
-#line 719 "pir.y"
+#line 725 "pir.y"
     { set_sub_outer(lexer, (yyvsp[(3) - (4)].sval)); ;}
     break;
 
   case 65:
-#line 721 "pir.y"
+#line 727 "pir.y"
     { set_sub_methodname(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 66:
-#line 723 "pir.y"
+#line 729 "pir.y"
     { set_sub_vtable(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 67:
-#line 725 "pir.y"
+#line 731 "pir.y"
     { set_sub_subid(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 68:
-#line 727 "pir.y"
+#line 733 "pir.y"
     { set_sub_instanceof(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 69:
-#line 729 "pir.y"
+#line 735 "pir.y"
     { set_sub_nsentry(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
-  case 73:
-#line 738 "pir.y"
+  case 70:
+#line 739 "pir.y"
+    { set_sub_multi_types(lexer, (yyvsp[(2) - (3)].expr)); ;}
+    break;
+
+  case 71:
+#line 743 "pir.y"
     {
-                           /* if there are parameters, then emit a get_params instruction. */
-                           if ((yyvsp[(1) - (1)].ival) > 0) {
+                          CURRENT_SUB(lexer)->info.num_multi_types = 1;
+                          /* n=1 means :multi() -- without any types. */
+                        ;}
+    break;
 
-                               set_instr(lexer, "get_params");
-                               /* don't infer the signatured opname from arguments,
-                                * it's always same: get_params_pc
-                                * (this is one of the special 4 instructions for sub invocation).
-                                */
+  case 72:
+#line 748 "pir.y"
+    { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
+    break;
 
-                               update_op(lexer, CURRENT_INSTRUCTION(lexer),
-                                         PARROT_OP_get_params_pc);
-                           }
-                         ;}
+  case 73:
+#line 752 "pir.y"
+    {
+                          CURRENT_SUB(lexer)->info.num_multi_types = 2;
+                          /* start counting multi types; always 1 higher than actual number
+                           * so that n=0 means no :multi, n=1 means :multi(), n=2 means
+                           * :multi(Type1), n=3 means :multi(Type1,Type2), etc.
+                           */
+                           (yyval.expr) = (yyvsp[(1) - (1)].expr);
+                        ;}
     break;
 
   case 74:
-#line 755 "pir.y"
-    { (yyval.ival) = 0; ;}
+#line 761 "pir.y"
+    {
+                          ++CURRENT_SUB(lexer)->info.num_multi_types;
+                          /* link the multi types in reverse other. That's fine,
+                           * as long as you remember that it's reversed.
+                           */
+                          (yyvsp[(3) - (3)].expr)->next = (yyvsp[(1) - (3)].expr);
+                          (yyval.expr) = (yyvsp[(3) - (3)].expr);
+                        ;}
     break;
 
   case 75:
-#line 757 "pir.y"
-    { ++(yyval.ival); /* count number of parameters */ ;}
+#line 772 "pir.y"
+    { (yyval.expr) = expr_from_ident(lexer, (yyvsp[(1) - (1)].sval)); ;}
     break;
 
   case 76:
-#line 761 "pir.y"
-    { set_param_flag(lexer, (yyvsp[(2) - (4)].targ), (yyvsp[(3) - (4)].ival)); ;}
+#line 774 "pir.y"
+    { (yyval.expr) = expr_from_string(lexer, (yyvsp[(1) - (1)].sval)); ;}
     break;
 
   case 77:
-#line 765 "pir.y"
-    { (yyval.targ) = add_param(lexer, (yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].sval)); ;}
+#line 776 "pir.y"
+    { (yyval.expr) = expr_from_key(lexer, (yyvsp[(1) - (1)].key)); ;}
     break;
 
   case 78:
-#line 769 "pir.y"
-    { (yyval.ival) = 0; ;}
+#line 780 "pir.y"
+    {
+                           /* if there are parameters, then emit a get_params instruction. */
+                           if ((yyvsp[(1) - (1)].uval) > 0)
+                               generate_parameters_instr(lexer, (yyvsp[(1) - (1)].uval));
+                         ;}
     break;
 
   case 79:
-#line 771 "pir.y"
-    { SET_FLAG((yyval.ival), (yyvsp[(2) - (2)].ival)); ;}
+#line 788 "pir.y"
+    { (yyval.uval) = 0; ;}
+    break;
+
+  case 80:
+#line 790 "pir.y"
+    { ++(yyval.uval); /* count number of parameters */ ;}
+    break;
+
+  case 81:
+#line 794 "pir.y"
+    { set_param_flag(lexer, (yyvsp[(2) - (4)].targ), (yyvsp[(3) - (4)].ival)); ;}
+    break;
+
+  case 82:
+#line 798 "pir.y"
+    { (yyval.targ) = add_param(lexer, (yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 83:
-#line 780 "pir.y"
+#line 802 "pir.y"
+    { (yyval.ival) = 0; ;}
+    break;
+
+  case 84:
+#line 804 "pir.y"
+    { SET_FLAG((yyval.ival), (yyvsp[(2) - (2)].ival)); ;}
+    break;
+
+  case 88:
+#line 813 "pir.y"
     { (yyval.ival) = TARGET_FLAG_INVOCANT;
                            /* XXX handle multi_type */
 
                          ;}
     break;
 
-  case 84:
-#line 787 "pir.y"
+  case 89:
+#line 820 "pir.y"
     { (yyval.ival) = TARGET_FLAG_UNIQUE_REG; ;}
     break;
 
-  case 86:
-#line 794 "pir.y"
+  case 91:
+#line 827 "pir.y"
     {
                          ++lexer->stmt_counter;
                          /* increment the logical statement counter; a statement can be
@@ -2828,38 +2901,38 @@
                         ;}
     break;
 
-  case 87:
-#line 804 "pir.y"
+  case 92:
+#line 837 "pir.y"
     { set_label(lexer, (yyvsp[(1) - (2)].sval)); ;}
     break;
 
-  case 105:
-#line 832 "pir.y"
+  case 110:
+#line 865 "pir.y"
     { (yyval.sval) = expand_macro(yyscanner, (yyvsp[(1) - (3)].mval), (yyvsp[(2) - (3)].pval)); ;}
     break;
 
-  case 106:
-#line 836 "pir.y"
+  case 111:
+#line 869 "pir.y"
     { (yyval.pval) = NULL; ;}
     break;
 
-  case 107:
-#line 838 "pir.y"
+  case 112:
+#line 871 "pir.y"
     { (yyval.pval) = (yyvsp[(2) - (3)].pval); ;}
     break;
 
-  case 108:
-#line 842 "pir.y"
+  case 113:
+#line 875 "pir.y"
     { (yyval.pval) = NULL; ;}
     break;
 
-  case 110:
-#line 847 "pir.y"
+  case 115:
+#line 880 "pir.y"
     { (yyval.pval) = new_macro_param((yyvsp[(1) - (1)].sval)); ;}
     break;
 
-  case 111:
-#line 849 "pir.y"
+  case 116:
+#line 882 "pir.y"
     {
                           macro_param *param = new_macro_param((yyvsp[(3) - (3)].sval));
                           param->next = (yyvsp[(1) - (3)].pval);
@@ -2867,8 +2940,8 @@
                         ;}
     break;
 
-  case 112:
-#line 857 "pir.y"
+  case 117:
+#line 890 "pir.y"
     {
                           symbol *sym = find_symbol(lexer, (yyvsp[(1) - (1)].sval));
                           if (sym == NULL) {
@@ -2878,23 +2951,23 @@
                         ;}
     break;
 
-  case 114:
-#line 866 "pir.y"
+  case 119:
+#line 899 "pir.y"
     { (yyval.sval) = expand_macro(yyscanner, (yyvsp[(1) - (2)].mval), (yyvsp[(2) - (2)].pval)); ;}
     break;
 
-  case 116:
-#line 871 "pir.y"
+  case 121:
+#line 904 "pir.y"
     { (yyval.sval) = (yyvsp[(2) - (3)].sval); ;}
     break;
 
-  case 117:
-#line 876 "pir.y"
+  case 122:
+#line 909 "pir.y"
     { (yyval.sval) = ""; ;}
     break;
 
-  case 118:
-#line 878 "pir.y"
+  case 123:
+#line 911 "pir.y"
     { /* XXX cleanup memory stuff */
                           char *newbuff = (char *)mem_sys_allocate((strlen((yyvsp[(1) - (2)].sval)) + strlen((yyvsp[(2) - (2)].sval)) + 2)
                                                                    * sizeof (char));
@@ -2903,18 +2976,18 @@
                         ;}
     break;
 
-  case 122:
-#line 890 "pir.y"
+  case 127:
+#line 923 "pir.y"
     { (yyval.sval) = expand_macro(yyscanner, (yyvsp[(1) - (2)].mval), (yyvsp[(2) - (2)].pval)); ;}
     break;
 
-  case 123:
-#line 898 "pir.y"
+  case 128:
+#line 931 "pir.y"
     { set_instr(lexer, NULL); ;}
     break;
 
-  case 125:
-#line 906 "pir.y"
+  case 130:
+#line 939 "pir.y"
     {
                            if (lexer->parse_errors > MAX_NUM_ERRORS)
                                panic(lexer, "Too many errors. Compilation aborted.\n");
@@ -2923,24 +2996,24 @@
                          ;}
     break;
 
-  case 126:
-#line 915 "pir.y"
+  case 131:
+#line 948 "pir.y"
     {
                            set_instrf(lexer, "null", "%T", (yyvsp[(2) - (3)].targ));
                            get_opinfo(yyscanner);
                          ;}
     break;
 
-  case 127:
-#line 922 "pir.y"
+  case 132:
+#line 955 "pir.y"
     {
                            set_instrf(lexer, "get_results", "%T", (yyvsp[(2) - (3)].targ));
                            get_opinfo(yyscanner);
                          ;}
     break;
 
-  case 131:
-#line 936 "pir.y"
+  case 136:
+#line 969 "pir.y"
     { /* at this point, TK_IDENT may in fact be a symbol identifier,
                             * not an op, so don't do any checks like is_parrot_op() just yet.
                             */
@@ -2949,8 +3022,8 @@
                          ;}
     break;
 
-  case 132:
-#line 945 "pir.y"
+  case 137:
+#line 978 "pir.y"
     { /* when this rule is activated, the initial identifier must
                            * be a parrot op.
                            */
@@ -2959,8 +3032,8 @@
                         ;}
     break;
 
-  case 138:
-#line 963 "pir.y"
+  case 143:
+#line 996 "pir.y"
     {
                          /* the "instruction" that was set now appears to be
                           * an identifier; get the name, and check its type.
@@ -2996,41 +3069,41 @@
                        ;}
     break;
 
-  case 139:
-#line 999 "pir.y"
+  case 144:
+#line 1032 "pir.y"
     { push_operand(lexer, (yyvsp[(1) - (1)].expr)); ;}
     break;
 
-  case 140:
-#line 1004 "pir.y"
+  case 145:
+#line 1037 "pir.y"
     { push_operand(lexer, expr_from_key(lexer, (yyvsp[(1) - (1)].key))); ;}
     break;
 
-  case 141:
-#line 1008 "pir.y"
+  case 146:
+#line 1041 "pir.y"
     { (yyval.expr) = expr_from_const(lexer, (yyvsp[(1) - (1)].cval)); ;}
     break;
 
-  case 142:
-#line 1010 "pir.y"
+  case 147:
+#line 1043 "pir.y"
     { /* this is either a LABEL or a symbol; in the latter case, the type
                             * will be filled in later. */
                            (yyval.expr) = expr_from_ident(lexer, (yyvsp[(1) - (1)].sval));
                          ;}
     break;
 
-  case 143:
-#line 1015 "pir.y"
+  case 148:
+#line 1048 "pir.y"
     { (yyval.expr) = expr_from_target(lexer, (yyvsp[(1) - (1)].targ)); ;}
     break;
 
-  case 144:
-#line 1017 "pir.y"
+  case 149:
+#line 1050 "pir.y"
     { (yyval.expr) = expr_from_target(lexer, (yyvsp[(1) - (1)].targ)); ;}
     break;
 
-  case 145:
-#line 1021 "pir.y"
+  case 150:
+#line 1054 "pir.y"
     {
                            /* if $1 is a register, just return that */
                            if (TEST_FLAG((yyvsp[(1) - (2)].targ)->flags, TARGET_FLAG_IS_REG))
@@ -3053,23 +3126,23 @@
                          ;}
     break;
 
-  case 146:
-#line 1044 "pir.y"
+  case 151:
+#line 1077 "pir.y"
     { (yyval.key) = (yyvsp[(2) - (3)].key); ;}
     break;
 
-  case 147:
-#line 1048 "pir.y"
+  case 152:
+#line 1081 "pir.y"
     { (yyval.key) = new_key(lexer, (yyvsp[(1) - (1)].expr)); ;}
     break;
 
-  case 148:
-#line 1050 "pir.y"
+  case 153:
+#line 1083 "pir.y"
     { (yyval.key) = add_key(lexer, (yyvsp[(1) - (3)].key), (yyvsp[(3) - (3)].expr)); ;}
     break;
 
-  case 149:
-#line 1059 "pir.y"
+  case 154:
+#line 1092 "pir.y"
     {
                           /* the instruction is already set in parrot_op rule */
                           unshift_operand(lexer, (yyvsp[(4) - (6)].expr));
@@ -3082,8 +3155,8 @@
                         ;}
     break;
 
-  case 150:
-#line 1070 "pir.y"
+  case 155:
+#line 1103 "pir.y"
     {
                           /* the instruction is already set in parrot_op rule */
                           unshift_operand(lexer, (yyvsp[(4) - (4)].expr));
@@ -3097,8 +3170,8 @@
                         ;}
     break;
 
-  case 151:
-#line 1082 "pir.y"
+  case 156:
+#line 1115 "pir.y"
     { /* XXX create a PMC const for $4 */
                           unshift_operand(lexer, expr_from_key(lexer, (yyvsp[(4) - (6)].key)));
                           unshift_operand(lexer, expr_from_target(lexer, (yyvsp[(1) - (6)].targ)));
@@ -3108,8 +3181,8 @@
                         ;}
     break;
 
-  case 155:
-#line 1099 "pir.y"
+  case 160:
+#line 1132 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].ival) == 0)
                               set_instrf(lexer, "null", "%T", (yyvsp[(1) - (3)].targ));
@@ -3120,8 +3193,8 @@
                         ;}
     break;
 
-  case 156:
-#line 1108 "pir.y"
+  case 161:
+#line 1141 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].dval) == 0.0)
                               set_instrf(lexer, "null", "%T", (yyvsp[(1) - (3)].targ));
@@ -3132,24 +3205,24 @@
                         ;}
     break;
 
-  case 157:
-#line 1117 "pir.y"
+  case 162:
+#line 1150 "pir.y"
     {
                           set_instrf(lexer, "set", "%T%s", (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].sval));
                           get_opinfo(yyscanner);
                         ;}
     break;
 
-  case 158:
-#line 1122 "pir.y"
+  case 163:
+#line 1155 "pir.y"
     {
                           set_instrf(lexer, "set", "%T%T", (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].targ));
                           get_opinfo(yyscanner);
                         ;}
     break;
 
-  case 159:
-#line 1127 "pir.y"
+  case 164:
+#line 1160 "pir.y"
     {
                           symbol *sym = find_symbol(lexer, (yyvsp[(3) - (3)].sval));
                           if (sym) {
@@ -3172,16 +3245,16 @@
                         ;}
     break;
 
-  case 160:
-#line 1148 "pir.y"
+  case 165:
+#line 1181 "pir.y"
     {
                           unshift_operand(lexer, expr_from_target(lexer, (yyvsp[(1) - (3)].targ)));
                           get_opinfo(yyscanner);
                         ;}
     break;
 
-  case 161:
-#line 1153 "pir.y"
+  case 166:
+#line 1186 "pir.y"
     {
                           /*   $P0 = foo ["bar"]
                            *
@@ -3202,7 +3275,8 @@
                                   get_opinfo(yyscanner);
                               }
                               else
-                                  yypirerror(yyscanner, lexer, "indexed object '%s' not declared", (yyvsp[(3) - (4)].sval));
+                                  yypirerror(yyscanner, lexer,
+                                             "indexed object '%s' not declared", (yyvsp[(3) - (4)].sval));
 
                               /* create a symbol node anyway, so we can continue with instr. gen. */
                               sym = new_symbol(lexer, (yyvsp[(3) - (4)].sval), PMC_TYPE);
@@ -3223,8 +3297,8 @@
                         ;}
     break;
 
-  case 162:
-#line 1193 "pir.y"
+  case 167:
+#line 1227 "pir.y"
     {
                           symbol *sym = find_symbol(lexer, (yyvsp[(3) - (4)].sval));
                           target *t;
@@ -3244,8 +3318,8 @@
                         ;}
     break;
 
-  case 163:
-#line 1211 "pir.y"
+  case 168:
+#line 1245 "pir.y"
     {
                           target *preg = new_reg(lexer, PMC_TYPE, (yyvsp[(3) - (4)].ival));
                           set_target_key(preg, (yyvsp[(4) - (4)].key));
@@ -3254,16 +3328,16 @@
                         ;}
     break;
 
-  case 164:
-#line 1218 "pir.y"
+  case 169:
+#line 1252 "pir.y"
     {
                           set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival)], "%T%E", (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].expr));
                           get_opinfo(yyscanner);
                         ;}
     break;
 
-  case 165:
-#line 1223 "pir.y"
+  case 170:
+#line 1257 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].ival) == 1)
                               set_instrf(lexer, "inc", "%T", (yyvsp[(1) - (3)].targ));
@@ -3276,8 +3350,8 @@
                         ;}
     break;
 
-  case 166:
-#line 1234 "pir.y"
+  case 171:
+#line 1268 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].dval) == 1.0)
                               set_instrf(lexer, "inc", "%T", (yyvsp[(1) - (3)].targ));
@@ -3290,8 +3364,8 @@
                         ;}
     break;
 
-  case 167:
-#line 1245 "pir.y"
+  case 172:
+#line 1279 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].ival) == 1)
                               set_instrf(lexer, "dec", "%T", (yyvsp[(1) - (3)].targ));
@@ -3304,8 +3378,8 @@
                         ;}
     break;
 
-  case 168:
-#line 1256 "pir.y"
+  case 173:
+#line 1290 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].dval) == 1.0)
                               set_instrf(lexer, "dec", "%T", (yyvsp[(1) - (3)].targ));
@@ -3318,32 +3392,32 @@
                         ;}
     break;
 
-  case 169:
-#line 1267 "pir.y"
+  case 174:
+#line 1301 "pir.y"
     {
                           set_instrf(lexer, "add", "%T%T", (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].targ));
                           get_opinfo(yyscanner);
                         ;}
     break;
 
-  case 170:
-#line 1272 "pir.y"
+  case 175:
+#line 1306 "pir.y"
     {
                           set_instrf(lexer, "sub", "%T%T", (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].targ));
                           get_opinfo(yyscanner);
                         ;}
     break;
 
-  case 171:
-#line 1277 "pir.y"
+  case 176:
+#line 1311 "pir.y"
     {
                           set_instrf(lexer, (yyvsp[(3) - (4)].sval), "%T%E", (yyvsp[(1) - (4)].targ), (yyvsp[(4) - (4)].expr));
                           get_opinfo(yyscanner);
                         ;}
     break;
 
-  case 172:
-#line 1282 "pir.y"
+  case 177:
+#line 1316 "pir.y"
     {
                           if (targets_equal((yyvsp[(1) - (5)].targ), (yyvsp[(3) - (5)].targ))) /* $P0 = $P0 + $P1 ==> $P0 += $P1 */
                               set_instrf(lexer, opnames[(yyvsp[(4) - (5)].ival)], "%T%E", (yyvsp[(1) - (5)].targ), (yyvsp[(5) - (5)].expr));
@@ -3355,8 +3429,8 @@
                         ;}
     break;
 
-  case 173:
-#line 1292 "pir.y"
+  case 178:
+#line 1326 "pir.y"
     {
                           symbol *sym = find_symbol(lexer, (yyvsp[(1) - (4)].sval));
                           target *t;
@@ -3377,8 +3451,8 @@
                       ;}
     break;
 
-  case 174:
-#line 1311 "pir.y"
+  case 179:
+#line 1345 "pir.y"
     {
                           target *preg = new_reg(lexer, PMC_TYPE, (yyvsp[(1) - (4)].ival));
                           set_target_key(preg, (yyvsp[(2) - (4)].key));
@@ -3387,98 +3461,98 @@
                         ;}
     break;
 
-  case 175:
-#line 1345 "pir.y"
+  case 180:
+#line 1379 "pir.y"
     { set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival)], "%i%T", (yyvsp[(1) - (3)].ival), (yyvsp[(3) - (3)].targ)); ;}
     break;
 
-  case 176:
-#line 1347 "pir.y"
+  case 181:
+#line 1381 "pir.y"
     { set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival)], "%n%T", (yyvsp[(1) - (3)].dval), (yyvsp[(3) - (3)].targ)); ;}
     break;
 
-  case 177:
-#line 1349 "pir.y"
+  case 182:
+#line 1383 "pir.y"
     { set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival)], "%s%T", (yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].targ)); ;}
     break;
 
-  case 178:
-#line 1351 "pir.y"
+  case 183:
+#line 1385 "pir.y"
     { set_instrf(lexer, "set", "%C", fold_s_s(yyscanner, (yyvsp[(1) - (3)].sval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].sval))); ;}
     break;
 
-  case 179:
-#line 1353 "pir.y"
+  case 184:
+#line 1387 "pir.y"
     { set_instrf(lexer, "set", "%C", fold_i_i(yyscanner, (yyvsp[(1) - (3)].ival), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival))); ;}
     break;
 
-  case 180:
-#line 1355 "pir.y"
+  case 185:
+#line 1389 "pir.y"
     { set_instrf(lexer, "set", "%C", fold_n_n(yyscanner, (yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval))); ;}
     break;
 
-  case 181:
-#line 1357 "pir.y"
+  case 186:
+#line 1391 "pir.y"
     { set_instrf(lexer, "set", "%C", fold_i_n(yyscanner, (yyvsp[(1) - (3)].ival), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval))); ;}
     break;
 
-  case 182:
-#line 1359 "pir.y"
+  case 187:
+#line 1393 "pir.y"
     { set_instrf(lexer, "set", "%C", fold_n_i(yyscanner, (yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival))); ;}
     break;
 
-  case 183:
-#line 1364 "pir.y"
+  case 188:
+#line 1398 "pir.y"
     { get_opinfo(yyscanner); ;}
     break;
 
-  case 184:
-#line 1373 "pir.y"
+  case 189:
+#line 1407 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (5)].ival), 1, (yyvsp[(3) - (5)].sval), (yyvsp[(5) - (5)].sval)); ;}
     break;
 
-  case 185:
-#line 1375 "pir.y"
+  case 190:
+#line 1409 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (5)].ival), 1, "int", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
-  case 186:
-#line 1377 "pir.y"
+  case 191:
+#line 1411 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (5)].ival), 1, "num", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
-  case 187:
-#line 1379 "pir.y"
+  case 192:
+#line 1413 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (5)].ival), 1, "pmc", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
-  case 188:
-#line 1381 "pir.y"
+  case 193:
+#line 1415 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (5)].ival), 1, "string", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
-  case 189:
-#line 1383 "pir.y"
+  case 194:
+#line 1417 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (5)].ival), 1, "if", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
-  case 190:
-#line 1385 "pir.y"
+  case 195:
+#line 1419 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (5)].ival), 1, "unless", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
-  case 191:
-#line 1387 "pir.y"
+  case 196:
+#line 1421 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (5)].ival), 1, "goto", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
-  case 192:
-#line 1389 "pir.y"
+  case 197:
+#line 1423 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (5)].ival), 1, "null", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
-  case 193:
-#line 1391 "pir.y"
+  case 198:
+#line 1425 "pir.y"
     {
                           int istrue = evaluate_c(lexer, (yyvsp[(2) - (4)].cval));
                           /* if "unless", invert the true-ness */
@@ -3492,76 +3566,76 @@
                         ;}
     break;
 
-  case 194:
-#line 1403 "pir.y"
+  case 199:
+#line 1437 "pir.y"
     {
                           set_instrf(lexer, (yyvsp[(1) - (5)].ival) ? "unless_null" : "if_null", "%T%I",
                                      new_reg(lexer, PMC_TYPE, (yyvsp[(3) - (5)].ival)), (yyvsp[(5) - (5)].sval));
                         ;}
     break;
 
-  case 195:
-#line 1408 "pir.y"
+  case 200:
+#line 1442 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (4)].ival), 0, (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 196:
-#line 1410 "pir.y"
+  case 201:
+#line 1444 "pir.y"
     { set_instrf(lexer, (yyvsp[(1) - (4)].ival) ? "unless" : "if", "%T%I", (yyvsp[(2) - (4)].targ), (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 197:
-#line 1412 "pir.y"
+  case 202:
+#line 1446 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (4)].ival), 0, "int", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 198:
-#line 1414 "pir.y"
+  case 203:
+#line 1448 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (4)].ival), 0, "num", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 199:
-#line 1416 "pir.y"
+  case 204:
+#line 1450 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (4)].ival), 0, "pmc", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 200:
-#line 1418 "pir.y"
+  case 205:
+#line 1452 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (4)].ival), 0, "string", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 201:
-#line 1420 "pir.y"
+  case 206:
+#line 1454 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (4)].ival), 0, "if", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 202:
-#line 1422 "pir.y"
+  case 207:
+#line 1456 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (4)].ival), 0, "unless", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 203:
-#line 1424 "pir.y"
+  case 208:
+#line 1458 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (4)].ival), 0, "goto", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 204:
-#line 1426 "pir.y"
+  case 209:
+#line 1460 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (4)].ival), 0, "goto", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 205:
-#line 1428 "pir.y"
+  case 210:
+#line 1462 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (4)].ival), 0, "null", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 206:
-#line 1430 "pir.y"
+  case 211:
+#line 1464 "pir.y"
     { create_if_instr(yyscanner, lexer, (yyvsp[(1) - (4)].ival), 0, "null", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 207:
-#line 1432 "pir.y"
+  case 212:
+#line 1466 "pir.y"
     {
                           if ((yyvsp[(2) - (4)].ival) == COMPUTE_DURING_RUNTIME) {
                              if ((yyvsp[(1) - (4)].ival) == NEED_INVERT_OPNAME) /* "unless" */
@@ -3588,8 +3662,8 @@
                         ;}
     break;
 
-  case 208:
-#line 1463 "pir.y"
+  case 213:
+#line 1497 "pir.y"
     {
                           /* the instructions "gt" and "ge" are converted to "lt" and "le".
                            * if so, then the arguments must be reversed as well. "lt" and
@@ -3617,8 +3691,8 @@
                         ;}
     break;
 
-  case 209:
-#line 1489 "pir.y"
+  case 214:
+#line 1523 "pir.y"
     {
                           if (((yyvsp[(0) - (3)].ival) != NEED_INVERT_OPNAME) && ((yyvsp[(2) - (3)].ival) == OP_GE || (yyvsp[(2) - (3)].ival) == OP_GT))
                               set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival) + 1], "%T%i", (yyvsp[(3) - (3)].targ), (yyvsp[(1) - (3)].ival));
@@ -3628,8 +3702,8 @@
                         ;}
     break;
 
-  case 210:
-#line 1497 "pir.y"
+  case 215:
+#line 1531 "pir.y"
     {
                           if (((yyvsp[(0) - (3)].ival) != NEED_INVERT_OPNAME) && ((yyvsp[(2) - (3)].ival) == OP_GE || (yyvsp[(2) - (3)].ival) == OP_GT))
                               set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival) + 1], "%T%n", (yyvsp[(3) - (3)].targ), (yyvsp[(1) - (3)].dval));
@@ -3640,8 +3714,8 @@
                         ;}
     break;
 
-  case 211:
-#line 1506 "pir.y"
+  case 216:
+#line 1540 "pir.y"
     {
                           if (((yyvsp[(0) - (3)].ival) != NEED_INVERT_OPNAME) && ((yyvsp[(2) - (3)].ival) == OP_GE || (yyvsp[(2) - (3)].ival) == OP_GT))
                               set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival)], "%T%s", (yyvsp[(3) - (3)].targ), (yyvsp[(1) - (3)].sval));
@@ -3652,71 +3726,71 @@
                         ;}
     break;
 
-  case 212:
-#line 1515 "pir.y"
+  case 217:
+#line 1549 "pir.y"
     { (yyval.ival) = evaluate_i_i((yyvsp[(1) - (3)].ival), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival)); ;}
     break;
 
-  case 213:
-#line 1517 "pir.y"
+  case 218:
+#line 1551 "pir.y"
     { (yyval.ival) = evaluate_i_n((yyvsp[(1) - (3)].ival), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval)); ;}
     break;
 
-  case 214:
-#line 1519 "pir.y"
+  case 219:
+#line 1553 "pir.y"
     { (yyval.ival) = evaluate_n_i((yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival)); ;}
     break;
 
-  case 215:
-#line 1521 "pir.y"
+  case 220:
+#line 1555 "pir.y"
     { (yyval.ival) = evaluate_n_n((yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval)); ;}
     break;
 
-  case 216:
-#line 1523 "pir.y"
+  case 221:
+#line 1557 "pir.y"
     { (yyval.ival) = evaluate_s_s((yyvsp[(1) - (3)].sval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].sval)); ;}
     break;
 
-  case 217:
-#line 1527 "pir.y"
+  case 222:
+#line 1561 "pir.y"
     {
                           yypirerror(yyscanner, lexer, "cannot compare string to %s",
                                      (yyvsp[(3) - (3)].ival) == INT_TYPE ? "integer" : "number");
                         ;}
     break;
 
-  case 218:
-#line 1532 "pir.y"
+  case 223:
+#line 1566 "pir.y"
     { yypirerror(yyscanner, lexer, "cannot compare integer to string"); ;}
     break;
 
-  case 219:
-#line 1534 "pir.y"
+  case 224:
+#line 1568 "pir.y"
     { yypirerror(yyscanner, lexer, "cannot compare number to string"); ;}
     break;
 
-  case 220:
-#line 1538 "pir.y"
+  case 225:
+#line 1572 "pir.y"
     { (yyval.ival) = INT_TYPE; ;}
     break;
 
-  case 221:
-#line 1539 "pir.y"
+  case 226:
+#line 1573 "pir.y"
     { (yyval.ival) = NUM_TYPE; ;}
     break;
 
-  case 222:
-#line 1542 "pir.y"
+  case 227:
+#line 1576 "pir.y"
     { (yyval.ival) = DONT_INVERT_OPNAME; /* no need to invert */ ;}
     break;
 
-  case 223:
-#line 1543 "pir.y"
+  case 228:
+#line 1577 "pir.y"
     { (yyval.ival) = NEED_INVERT_OPNAME; /* yes, invert opname */ ;}
     break;
 
-  case 226:
-#line 1551 "pir.y"
+  case 231:
+#line 1585 "pir.y"
     {
                           set_instrf(lexer, "branch", "%I", (yyvsp[(2) - (3)].sval));
                           set_op_labelflag(lexer, BIT(0)); /* bit 0 means: "1 << 0" */
@@ -3724,38 +3798,38 @@
                         ;}
     break;
 
-  case 227:
-#line 1559 "pir.y"
+  case 232:
+#line 1593 "pir.y"
     { declare_local(lexer, (yyvsp[(2) - (4)].ival), (yyvsp[(3) - (4)].symb)); ;}
     break;
 
-  case 228:
-#line 1563 "pir.y"
+  case 233:
+#line 1597 "pir.y"
     { (yyval.symb) = (yyvsp[(1) - (1)].symb); ;}
     break;
 
-  case 229:
-#line 1565 "pir.y"
+  case 234:
+#line 1599 "pir.y"
     { (yyval.symb) = add_local((yyvsp[(1) - (3)].symb), (yyvsp[(3) - (3)].symb)); ;}
     break;
 
-  case 230:
-#line 1569 "pir.y"
+  case 235:
+#line 1603 "pir.y"
     { (yyval.symb) = new_local(lexer, (yyvsp[(1) - (2)].sval), (yyvsp[(2) - (2)].ival)); ;}
     break;
 
-  case 231:
-#line 1572 "pir.y"
+  case 236:
+#line 1606 "pir.y"
     { (yyval.ival) = 0; ;}
     break;
 
-  case 232:
-#line 1573 "pir.y"
+  case 237:
+#line 1607 "pir.y"
     { (yyval.ival) = 1; ;}
     break;
 
-  case 233:
-#line 1577 "pir.y"
+  case 238:
+#line 1611 "pir.y"
     { /* if $4 is not a register, it must be a declared symbol */
                           if (!TEST_FLAG((yyvsp[(4) - (5)].targ)->flags, TARGET_FLAG_IS_REG)) {
 
@@ -3763,90 +3837,90 @@
                                   yypirerror(yyscanner, lexer, "lexical '%s' must be of type 'pmc'",
                                              (yyvsp[(4) - (5)].targ)->info->id.name);
                           }
-                          set_lex_flag((yyvsp[(4) - (5)].targ), (yyvsp[(2) - (5)].sval));
+                          set_lex_flag(lexer, (yyvsp[(4) - (5)].targ), (yyvsp[(2) - (5)].sval));
                         ;}
     break;
 
-  case 234:
-#line 1592 "pir.y"
+  case 239:
+#line 1626 "pir.y"
     { convert_inv_to_instr(lexer, (yyvsp[(1) - (1)].invo)); ;}
     break;
 
-  case 237:
-#line 1604 "pir.y"
+  case 242:
+#line 1638 "pir.y"
     { /* $4 contains an invocation object */
                               set_invocation_args((yyvsp[(4) - (8)].invo), (yyvsp[(3) - (8)].argm));
                               (yyval.invo) = set_invocation_results((yyvsp[(4) - (8)].invo), (yyvsp[(6) - (8)].targ));
                             ;}
     break;
 
-  case 238:
-#line 1611 "pir.y"
+  case 243:
+#line 1645 "pir.y"
     { (yyval.argm) = NULL; ;}
     break;
 
-  case 239:
-#line 1613 "pir.y"
+  case 244:
+#line 1647 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
-  case 240:
-#line 1617 "pir.y"
+  case 245:
+#line 1651 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
-  case 241:
-#line 1619 "pir.y"
+  case 246:
+#line 1653 "pir.y"
     { (yyval.argm) = add_arg((yyvsp[(1) - (2)].argm), (yyvsp[(2) - (2)].argm)); ;}
     break;
 
-  case 242:
-#line 1623 "pir.y"
+  case 247:
+#line 1657 "pir.y"
     { (yyval.argm) = (yyvsp[(2) - (3)].argm); ;}
     break;
 
-  case 243:
-#line 1627 "pir.y"
+  case 248:
+#line 1661 "pir.y"
     { (yyval.invo) = invoke(lexer, CALL_PCC, (yyvsp[(2) - (3)].targ), (yyvsp[(3) - (3)].targ)); ;}
     break;
 
-  case 244:
-#line 1629 "pir.y"
+  case 249:
+#line 1663 "pir.y"
     { (yyval.invo) = invoke(lexer, CALL_NCI, (yyvsp[(2) - (2)].targ)); ;}
     break;
 
-  case 245:
-#line 1632 "pir.y"
+  case 250:
+#line 1666 "pir.y"
     { (yyval.invo) = invoke(lexer, CALL_METHOD, (yyvsp[(2) - (5)].targ), (yyvsp[(5) - (5)].expr)); ;}
     break;
 
-  case 246:
-#line 1636 "pir.y"
+  case 251:
+#line 1670 "pir.y"
     { (yyval.targ) = NULL; ;}
     break;
 
-  case 247:
-#line 1638 "pir.y"
+  case 252:
+#line 1672 "pir.y"
     { (yyval.targ) = (yyvsp[(2) - (2)].targ); ;}
     break;
 
-  case 248:
-#line 1642 "pir.y"
+  case 253:
+#line 1676 "pir.y"
     { (yyval.targ) = NULL; ;}
     break;
 
-  case 249:
-#line 1644 "pir.y"
+  case 254:
+#line 1678 "pir.y"
     { (yyval.targ) = (yyvsp[(1) - (1)].targ); ;}
     break;
 
-  case 250:
-#line 1648 "pir.y"
+  case 255:
+#line 1682 "pir.y"
     { (yyval.targ) = (yyvsp[(1) - (1)].targ); ;}
     break;
 
-  case 251:
-#line 1650 "pir.y"
+  case 256:
+#line 1684 "pir.y"
     {
                              if ((yyvsp[(2) - (2)].targ))
                                  (yyval.targ) = add_target(lexer, (yyvsp[(1) - (2)].targ), (yyvsp[(2) - (2)].targ));
@@ -3855,33 +3929,33 @@
                            ;}
     break;
 
-  case 252:
-#line 1659 "pir.y"
+  case 257:
+#line 1693 "pir.y"
     { (yyval.targ) = (yyvsp[(2) - (3)].targ); ;}
     break;
 
-  case 253:
-#line 1661 "pir.y"
+  case 258:
+#line 1695 "pir.y"
     { (yyval.targ) = NULL; ;}
     break;
 
-  case 255:
-#line 1669 "pir.y"
+  case 260:
+#line 1703 "pir.y"
     { (yyval.invo) = set_invocation_results((yyvsp[(3) - (3)].invo), (yyvsp[(1) - (3)].targ)); ;}
     break;
 
-  case 256:
-#line 1671 "pir.y"
+  case 261:
+#line 1705 "pir.y"
     { (yyval.invo) = set_invocation_results((yyvsp[(3) - (3)].invo), (yyvsp[(1) - (3)].targ)); ;}
     break;
 
-  case 257:
-#line 1673 "pir.y"
+  case 262:
+#line 1707 "pir.y"
     {  (yyval.invo) = set_invocation_results((yyvsp[(1) - (1)].invo), NULL); ;}
     break;
 
-  case 260:
-#line 1681 "pir.y"
+  case 265:
+#line 1715 "pir.y"
     {
                              /* if $1 is not a register, check whether the symbol was declared */
                              if (!TEST_FLAG((yyvsp[(1) - (4)].targ)->flags, TARGET_FLAG_IS_REG)) {
@@ -3901,21 +3975,21 @@
                            ;}
     break;
 
-  case 261:
-#line 1701 "pir.y"
+  case 266:
+#line 1735 "pir.y"
     {
                              (yyval.invo) = invoke(lexer, CALL_PCC, (yyvsp[(1) - (2)].targ), NULL);
                              set_invocation_args((yyval.invo), (yyvsp[(2) - (2)].argm));
                            ;}
     break;
 
-  case 262:
-#line 1708 "pir.y"
+  case 267:
+#line 1742 "pir.y"
     { (yyval.targ) = (yyvsp[(1) - (1)].targ); ;}
     break;
 
-  case 263:
-#line 1710 "pir.y"
+  case 268:
+#line 1744 "pir.y"
     {
                              symbol *sym = find_symbol(lexer, (yyvsp[(1) - (1)].sval));
                              if (sym == NULL)
@@ -3925,8 +3999,8 @@
                            ;}
     break;
 
-  case 264:
-#line 1720 "pir.y"
+  case 269:
+#line 1754 "pir.y"
     { /* check that this identifier was declared */
                              symbol *sym = find_symbol(lexer, (yyvsp[(1) - (1)].sval));
 
@@ -3945,23 +4019,23 @@
                            ;}
     break;
 
-  case 265:
-#line 1737 "pir.y"
+  case 270:
+#line 1771 "pir.y"
     { (yyval.expr) = expr_from_target(lexer, new_reg(lexer, PMC_TYPE, (yyvsp[(1) - (1)].ival))); ;}
     break;
 
-  case 266:
-#line 1739 "pir.y"
+  case 271:
+#line 1773 "pir.y"
     { (yyval.expr) = expr_from_target(lexer, new_reg(lexer, STRING_TYPE, (yyvsp[(1) - (1)].ival))); ;}
     break;
 
-  case 267:
-#line 1741 "pir.y"
+  case 272:
+#line 1775 "pir.y"
     { (yyval.expr) = expr_from_const(lexer, new_const(lexer, STRING_TYPE, (yyvsp[(1) - (1)].sval))); ;}
     break;
 
-  case 268:
-#line 1745 "pir.y"
+  case 273:
+#line 1779 "pir.y"
     {
                              symbol *sym = find_symbol(lexer, (yyvsp[(1) - (1)].sval));
                              if (sym == NULL)
@@ -3972,89 +4046,89 @@
                            ;}
     break;
 
-  case 269:
-#line 1754 "pir.y"
+  case 274:
+#line 1788 "pir.y"
     { (yyval.targ) = new_reg(lexer, PMC_TYPE, (yyvsp[(1) - (1)].ival)); ;}
     break;
 
-  case 270:
-#line 1759 "pir.y"
+  case 275:
+#line 1793 "pir.y"
     { (yyval.targ) = (yyvsp[(2) - (3)].targ); ;}
     break;
 
-  case 271:
-#line 1763 "pir.y"
+  case 276:
+#line 1797 "pir.y"
     { (yyval.targ) = NULL; ;}
     break;
 
-  case 272:
-#line 1765 "pir.y"
+  case 277:
+#line 1799 "pir.y"
     { (yyval.targ) = (yyvsp[(1) - (1)].targ); ;}
     break;
 
-  case 273:
-#line 1769 "pir.y"
+  case 278:
+#line 1803 "pir.y"
     { (yyval.targ) = (yyvsp[(1) - (1)].targ); ;}
     break;
 
-  case 274:
-#line 1771 "pir.y"
+  case 279:
+#line 1805 "pir.y"
     { (yyval.targ) = add_target(lexer, (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].targ)); ;}
     break;
 
-  case 275:
-#line 1775 "pir.y"
+  case 280:
+#line 1809 "pir.y"
     { (yyval.targ) = set_param_flag(lexer, (yyvsp[(1) - (2)].targ), (yyvsp[(2) - (2)].ival)); ;}
     break;
 
-  case 276:
-#line 1779 "pir.y"
+  case 281:
+#line 1813 "pir.y"
     { (yyval.ival) = 0; ;}
     break;
 
-  case 277:
-#line 1781 "pir.y"
+  case 282:
+#line 1815 "pir.y"
     { SET_FLAG((yyval.ival), (yyvsp[(2) - (2)].ival)); ;}
     break;
 
-  case 278:
-#line 1785 "pir.y"
+  case 283:
+#line 1819 "pir.y"
     { (yyval.ival) = TARGET_FLAG_OPTIONAL; ;}
     break;
 
-  case 279:
-#line 1787 "pir.y"
+  case 284:
+#line 1821 "pir.y"
     { (yyval.ival) = TARGET_FLAG_OPT_FLAG; ;}
     break;
 
-  case 280:
-#line 1789 "pir.y"
+  case 285:
+#line 1823 "pir.y"
     { (yyval.ival) = TARGET_FLAG_SLURPY; ;}
     break;
 
-  case 281:
-#line 1791 "pir.y"
+  case 286:
+#line 1825 "pir.y"
     {
                              (yyval.ival) = TARGET_FLAG_NAMED;
                              set_param_alias(lexer, (yyvsp[(2) - (2)].sval));
                            ;}
     break;
 
-  case 282:
-#line 1801 "pir.y"
+  case 287:
+#line 1835 "pir.y"
     { convert_inv_to_instr(lexer, (yyvsp[(1) - (1)].invo)); ;}
     break;
 
-  case 287:
-#line 1811 "pir.y"
+  case 292:
+#line 1845 "pir.y"
     {
                               (yyval.invo) = invoke(lexer, CALL_RETURN);
                               set_invocation_args((yyval.invo), (yyvsp[(2) - (3)].argm));
                             ;}
     break;
 
-  case 288:
-#line 1816 "pir.y"
+  case 293:
+#line 1850 "pir.y"
     { /* was the invocation a method call? then it becomes a method tail
                                * call, otherwise it's just a normal (sub) tail call.
                                */
@@ -4065,275 +4139,279 @@
                             ;}
     break;
 
-  case 289:
-#line 1827 "pir.y"
+  case 294:
+#line 1861 "pir.y"
     {
                               (yyval.invo) = invoke(lexer, CALL_YIELD);
                               set_invocation_args((yyval.invo), (yyvsp[(2) - (3)].argm));
                             ;}
     break;
 
-  case 290:
-#line 1834 "pir.y"
+  case 295:
+#line 1868 "pir.y"
     { (yyval.argm) = (yyvsp[(2) - (3)].argm); ;}
     break;
 
-  case 291:
-#line 1838 "pir.y"
+  case 296:
+#line 1872 "pir.y"
     { (yyval.argm) = NULL; ;}
     break;
 
-  case 292:
-#line 1840 "pir.y"
+  case 297:
+#line 1874 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
-  case 293:
-#line 1844 "pir.y"
+  case 298:
+#line 1878 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
-  case 294:
-#line 1846 "pir.y"
+  case 299:
+#line 1880 "pir.y"
     { (yyval.argm) = add_arg((yyvsp[(1) - (3)].argm), (yyvsp[(3) - (3)].argm)); ;}
     break;
 
-  case 297:
-#line 1854 "pir.y"
+  case 302:
+#line 1888 "pir.y"
     { (yyval.argm) = set_arg_alias(lexer, (yyvsp[(1) - (3)].sval)); ;}
     break;
 
-  case 298:
-#line 1858 "pir.y"
+  case 303:
+#line 1892 "pir.y"
     { (yyval.argm) = set_arg_flag((yyval.argm), (yyvsp[(2) - (2)].ival)); ;}
     break;
 
-  case 299:
-#line 1862 "pir.y"
+  case 304:
+#line 1896 "pir.y"
     { (yyval.argm) = set_curarg(lexer, new_argument(lexer, (yyvsp[(1) - (1)].expr)));  ;}
     break;
 
-  case 300:
-#line 1868 "pir.y"
+  case 305:
+#line 1902 "pir.y"
     {
                               (yyval.invo) = invoke(lexer, CALL_RETURN);
                               set_invocation_args((yyval.invo), (yyvsp[(3) - (5)].argm));
                             ;}
     break;
 
-  case 301:
-#line 1877 "pir.y"
+  case 306:
+#line 1911 "pir.y"
     {
                               (yyval.invo) = invoke(lexer, CALL_YIELD);
                               set_invocation_args((yyval.invo), (yyvsp[(3) - (5)].argm));
                             ;}
     break;
 
-  case 302:
-#line 1884 "pir.y"
+  case 307:
+#line 1918 "pir.y"
     { (yyval.argm) = NULL; ;}
     break;
 
-  case 303:
-#line 1886 "pir.y"
+  case 308:
+#line 1920 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
-  case 304:
-#line 1891 "pir.y"
+  case 309:
+#line 1925 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
-  case 305:
-#line 1893 "pir.y"
+  case 310:
+#line 1927 "pir.y"
     { (yyval.argm) = add_arg((yyvsp[(1) - (2)].argm), (yyvsp[(2) - (2)].argm)); ;}
     break;
 
-  case 306:
-#line 1898 "pir.y"
+  case 311:
+#line 1932 "pir.y"
     { (yyval.argm) = (yyvsp[(2) - (3)].argm); ;}
     break;
 
-  case 307:
-#line 1902 "pir.y"
+  case 312:
+#line 1936 "pir.y"
     { (yyval.argm) = NULL; ;}
     break;
 
-  case 308:
-#line 1904 "pir.y"
+  case 313:
+#line 1938 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
-  case 309:
-#line 1908 "pir.y"
+  case 314:
+#line 1942 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
-  case 310:
-#line 1910 "pir.y"
+  case 315:
+#line 1944 "pir.y"
     { (yyval.argm) = add_arg((yyvsp[(1) - (2)].argm), (yyvsp[(2) - (2)].argm)); ;}
     break;
 
-  case 311:
-#line 1914 "pir.y"
+  case 316:
+#line 1948 "pir.y"
     { (yyval.argm) = (yyvsp[(2) - (3)].argm); ;}
     break;
 
-  case 312:
-#line 1919 "pir.y"
+  case 317:
+#line 1953 "pir.y"
     { (yyval.ival) = 0; ;}
     break;
 
-  case 313:
-#line 1921 "pir.y"
+  case 318:
+#line 1955 "pir.y"
     { SET_FLAG((yyval.ival), (yyvsp[(2) - (2)].ival)); ;}
     break;
 
-  case 314:
-#line 1925 "pir.y"
+  case 319:
+#line 1959 "pir.y"
     { (yyval.ival) = ARG_FLAG_FLAT; ;}
     break;
 
-  case 315:
-#line 1927 "pir.y"
+  case 320:
+#line 1961 "pir.y"
     {
                                (yyval.ival) = ARG_FLAG_NAMED;
                                set_arg_alias(lexer, (yyvsp[(2) - (2)].sval));
                              ;}
     break;
 
-  case 316:
-#line 1934 "pir.y"
+  case 321:
+#line 1968 "pir.y"
     { (yyval.sval) = NULL; ;}
     break;
 
-  case 317:
-#line 1936 "pir.y"
+  case 322:
+#line 1970 "pir.y"
     { (yyval.sval) = (yyvsp[(1) - (1)].sval); ;}
     break;
 
-  case 318:
-#line 1940 "pir.y"
+  case 323:
+#line 1974 "pir.y"
     { (yyval.sval) = (yyvsp[(2) - (3)].sval); ;}
     break;
 
-  case 322:
-#line 1951 "pir.y"
+  case 327:
+#line 1985 "pir.y"
     { store_global_constant(lexer, (yyvsp[(2) - (2)].cval)); ;}
     break;
 
-  case 323:
-#line 1955 "pir.y"
+  case 328:
+#line 1989 "pir.y"
     { /* XXX is .globalconst to be kept? */ ;}
     break;
 
-  case 324:
-#line 1959 "pir.y"
+  case 329:
+#line 1993 "pir.y"
     { (yyval.cval) = new_named_const(lexer, INT_TYPE, (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].ival)); ;}
     break;
 
-  case 325:
-#line 1961 "pir.y"
+  case 330:
+#line 1995 "pir.y"
     { (yyval.cval) = new_named_const(lexer, NUM_TYPE, (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].dval)); ;}
     break;
 
-  case 326:
-#line 1963 "pir.y"
+  case 331:
+#line 1997 "pir.y"
     { (yyval.cval) = new_named_const(lexer, STRING_TYPE, (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].sval)); ;}
     break;
 
-  case 327:
-#line 1965 "pir.y"
+  case 332:
+#line 1999 "pir.y"
     { (yyval.cval) = new_pmc_const((yyvsp[(1) - (4)].sval), (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].cval)); ;}
     break;
 
-  case 328:
-#line 1972 "pir.y"
+  case 333:
+#line 2006 "pir.y"
     { (yyval.expr) = expr_from_target(lexer, (yyvsp[(1) - (1)].targ)); ;}
     break;
 
-  case 329:
-#line 1973 "pir.y"
+  case 334:
+#line 2007 "pir.y"
     { (yyval.expr) = expr_from_const(lexer, (yyvsp[(1) - (1)].cval)); ;}
     break;
 
-  case 330:
-#line 1977 "pir.y"
+  case 335:
+#line 2011 "pir.y"
     { (yyval.cval) = new_const(lexer, STRING_TYPE, (yyvsp[(1) - (1)].sval)); ;}
     break;
 
-  case 331:
-#line 1978 "pir.y"
+  case 336:
+#line 2012 "pir.y"
     { (yyval.cval) = new_const(lexer, INT_TYPE, (yyvsp[(1) - (1)].ival)); ;}
     break;
 
-  case 332:
-#line 1979 "pir.y"
+  case 337:
+#line 2013 "pir.y"
     { (yyval.cval) = new_const(lexer, NUM_TYPE, (yyvsp[(1) - (1)].dval)); ;}
     break;
 
-  case 333:
-#line 1982 "pir.y"
+  case 338:
+#line 2014 "pir.y"
+    { (yyval.cval) = (yyvsp[(1) - (1)].cval); ;}
+    break;
+
+  case 339:
+#line 2017 "pir.y"
     { (yyval.ival) = OP_NE; ;}
     break;
 
-  case 334:
-#line 1983 "pir.y"
+  case 340:
+#line 2018 "pir.y"
     { (yyval.ival) = OP_EQ; ;}
     break;
 
-  case 335:
-#line 1984 "pir.y"
+  case 341:
+#line 2019 "pir.y"
     { (yyval.ival) = OP_LT; ;}
     break;
 
-  case 336:
-#line 1985 "pir.y"
+  case 342:
+#line 2020 "pir.y"
     { (yyval.ival) = OP_LE; ;}
     break;
 
-  case 337:
-#line 1986 "pir.y"
+  case 343:
+#line 2021 "pir.y"
     { (yyval.ival) = OP_GE; ;}
     break;
 
-  case 338:
-#line 1987 "pir.y"
+  case 344:
+#line 2022 "pir.y"
     { (yyval.ival) = OP_GT; ;}
     break;
 
-  case 339:
-#line 1990 "pir.y"
+  case 345:
+#line 2025 "pir.y"
     { (yyval.ival) = INT_TYPE; ;}
     break;
 
-  case 340:
-#line 1991 "pir.y"
+  case 346:
+#line 2026 "pir.y"
     { (yyval.ival) = NUM_TYPE; ;}
     break;
 
-  case 341:
-#line 1992 "pir.y"
+  case 347:
+#line 2027 "pir.y"
     { (yyval.ival) = PMC_TYPE; ;}
     break;
 
-  case 342:
-#line 1993 "pir.y"
+  case 348:
+#line 2028 "pir.y"
     { (yyval.ival) = STRING_TYPE; ;}
     break;
 
-  case 343:
-#line 2001 "pir.y"
+  case 349:
+#line 2036 "pir.y"
     { set_curtarget(lexer, (yyvsp[(1) - (1)].targ));  ;}
     break;
 
-  case 345:
-#line 2005 "pir.y"
+  case 351:
+#line 2040 "pir.y"
     { /* a symbol must have been declared; check that at this point. */
-                           symbol *sym = find_symbol(lexer, (yyvsp[(1) - (1)].sval));
+                           symbol * sym = find_symbol(lexer, (yyvsp[(1) - (1)].sval));
                            if (sym == NULL) {
                                undeclared_symbol(yyscanner, lexer, (yyvsp[(1) - (1)].sval));
-
                                /* make sure sym is not NULL */
                                sym = new_symbol(lexer, (yyvsp[(1) - (1)].sval), UNKNOWN_TYPE);
                            }
@@ -4341,278 +4419,278 @@
                          ;}
     break;
 
-  case 346:
-#line 2017 "pir.y"
+  case 352:
+#line 2051 "pir.y"
     { (yyval.targ) = new_reg(lexer, PMC_TYPE, (yyvsp[(1) - (1)].ival));    ;}
     break;
 
-  case 347:
-#line 2018 "pir.y"
+  case 353:
+#line 2052 "pir.y"
     { (yyval.targ) = new_reg(lexer, NUM_TYPE, (yyvsp[(1) - (1)].ival));    ;}
     break;
 
-  case 348:
-#line 2019 "pir.y"
+  case 354:
+#line 2053 "pir.y"
     { (yyval.targ) = new_reg(lexer, INT_TYPE, (yyvsp[(1) - (1)].ival));    ;}
     break;
 
-  case 349:
-#line 2020 "pir.y"
+  case 355:
+#line 2054 "pir.y"
     { (yyval.targ) = new_reg(lexer, STRING_TYPE, (yyvsp[(1) - (1)].ival)); ;}
     break;
 
-  case 352:
-#line 2028 "pir.y"
+  case 358:
+#line 2062 "pir.y"
     { (yyval.sval) = "if"; ;}
     break;
 
-  case 353:
-#line 2029 "pir.y"
+  case 359:
+#line 2063 "pir.y"
     { (yyval.sval) = "unless"; ;}
     break;
 
-  case 354:
-#line 2030 "pir.y"
+  case 360:
+#line 2064 "pir.y"
     { (yyval.sval) = "goto"; ;}
     break;
 
-  case 355:
-#line 2031 "pir.y"
+  case 361:
+#line 2065 "pir.y"
     { (yyval.sval) = "int"; ;}
     break;
 
-  case 356:
-#line 2032 "pir.y"
+  case 362:
+#line 2066 "pir.y"
     { (yyval.sval) = "num"; ;}
     break;
 
-  case 357:
-#line 2033 "pir.y"
+  case 363:
+#line 2067 "pir.y"
     { (yyval.sval) = "string"; ;}
     break;
 
-  case 358:
-#line 2034 "pir.y"
+  case 364:
+#line 2068 "pir.y"
     { (yyval.sval) = "pmc"; ;}
     break;
 
-  case 359:
-#line 2035 "pir.y"
+  case 365:
+#line 2069 "pir.y"
     { (yyval.sval) = "null"; ;}
     break;
 
-  case 360:
-#line 2038 "pir.y"
+  case 366:
+#line 2072 "pir.y"
     { (yyval.sval) = "neg"; ;}
     break;
 
-  case 361:
-#line 2039 "pir.y"
+  case 367:
+#line 2073 "pir.y"
     { (yyval.sval) = "not"; ;}
     break;
 
-  case 362:
-#line 2040 "pir.y"
+  case 368:
+#line 2074 "pir.y"
     { (yyval.sval) = "bnot"; ;}
     break;
 
-  case 363:
-#line 2043 "pir.y"
+  case 369:
+#line 2077 "pir.y"
     { (yyval.ival) = OP_ADD; ;}
     break;
 
-  case 364:
-#line 2044 "pir.y"
+  case 370:
+#line 2078 "pir.y"
     { (yyval.ival) = OP_SUB; ;}
     break;
 
-  case 365:
-#line 2045 "pir.y"
+  case 371:
+#line 2079 "pir.y"
     { (yyval.ival) = OP_DIV; ;}
     break;
 
-  case 366:
-#line 2046 "pir.y"
+  case 372:
+#line 2080 "pir.y"
     { (yyval.ival) = OP_MUL; ;}
     break;
 
-  case 367:
-#line 2047 "pir.y"
+  case 373:
+#line 2081 "pir.y"
     { (yyval.ival) = OP_MOD; ;}
     break;
 
-  case 368:
-#line 2048 "pir.y"
+  case 374:
+#line 2082 "pir.y"
     { (yyval.ival) = OP_BOR; ;}
     break;
 
-  case 369:
-#line 2049 "pir.y"
+  case 375:
+#line 2083 "pir.y"
     { (yyval.ival) = OP_BAND; ;}
     break;
 
-  case 370:
-#line 2050 "pir.y"
+  case 376:
+#line 2084 "pir.y"
     { (yyval.ival) = OP_BXOR; ;}
     break;
 
-  case 371:
-#line 2051 "pir.y"
+  case 377:
+#line 2085 "pir.y"
     { (yyval.ival) = OP_POW; ;}
     break;
 
-  case 372:
-#line 2052 "pir.y"
+  case 378:
+#line 2086 "pir.y"
     { (yyval.ival) = OP_CONCAT; ;}
     break;
 
-  case 373:
-#line 2053 "pir.y"
+  case 379:
+#line 2087 "pir.y"
     { (yyval.ival) = OP_LSR; ;}
     break;
 
-  case 374:
-#line 2054 "pir.y"
+  case 380:
+#line 2088 "pir.y"
     { (yyval.ival) = OP_SHR; ;}
     break;
 
-  case 375:
-#line 2055 "pir.y"
+  case 381:
+#line 2089 "pir.y"
     { (yyval.ival) = OP_SHL; ;}
     break;
 
-  case 376:
-#line 2056 "pir.y"
+  case 382:
+#line 2090 "pir.y"
     { (yyval.ival) = OP_OR; ;}
     break;
 
-  case 377:
-#line 2057 "pir.y"
+  case 383:
+#line 2091 "pir.y"
     { (yyval.ival) = OP_AND; ;}
     break;
 
-  case 378:
-#line 2058 "pir.y"
+  case 384:
+#line 2092 "pir.y"
     { (yyval.ival) = OP_FDIV; ;}
     break;
 
-  case 379:
-#line 2059 "pir.y"
+  case 385:
+#line 2093 "pir.y"
     { (yyval.ival) = OP_XOR; ;}
     break;
 
-  case 380:
-#line 2060 "pir.y"
+  case 386:
+#line 2094 "pir.y"
     { (yyval.ival) = OP_ISEQ; ;}
     break;
 
-  case 381:
-#line 2061 "pir.y"
+  case 387:
+#line 2095 "pir.y"
     { (yyval.ival) = OP_ISLE; ;}
     break;
 
-  case 382:
-#line 2062 "pir.y"
+  case 388:
+#line 2096 "pir.y"
     { (yyval.ival) = OP_ISLT; ;}
     break;
 
-  case 383:
-#line 2063 "pir.y"
+  case 389:
+#line 2097 "pir.y"
     { (yyval.ival) = OP_ISGE; ;}
     break;
 
-  case 384:
-#line 2064 "pir.y"
+  case 390:
+#line 2098 "pir.y"
     { (yyval.ival) = OP_ISGT; ;}
     break;
 
-  case 385:
-#line 2065 "pir.y"
+  case 391:
+#line 2099 "pir.y"
     { (yyval.ival) = OP_ISNE; ;}
     break;
 
-  case 386:
-#line 2071 "pir.y"
+  case 392:
+#line 2105 "pir.y"
     { (yyval.ival) = OP_MUL; ;}
     break;
 
-  case 387:
-#line 2072 "pir.y"
+  case 393:
+#line 2106 "pir.y"
     { (yyval.ival) = OP_MOD; ;}
     break;
 
-  case 388:
-#line 2073 "pir.y"
+  case 394:
+#line 2107 "pir.y"
     { (yyval.ival) = OP_POW; ;}
     break;
 
-  case 389:
-#line 2074 "pir.y"
+  case 395:
+#line 2108 "pir.y"
     { (yyval.ival) = OP_DIV; ;}
     break;
 
-  case 390:
-#line 2075 "pir.y"
+  case 396:
+#line 2109 "pir.y"
     { (yyval.ival) = OP_FDIV; ;}
     break;
 
-  case 391:
-#line 2076 "pir.y"
+  case 397:
+#line 2110 "pir.y"
     { (yyval.ival) = OP_BOR; ;}
     break;
 
-  case 392:
-#line 2077 "pir.y"
+  case 398:
+#line 2111 "pir.y"
     { (yyval.ival) = OP_BAND; ;}
     break;
 
-  case 393:
-#line 2078 "pir.y"
+  case 399:
+#line 2112 "pir.y"
     { (yyval.ival) = OP_BXOR; ;}
     break;
 
-  case 394:
-#line 2079 "pir.y"
+  case 400:
+#line 2113 "pir.y"
     { (yyval.ival) = OP_CONCAT; ;}
     break;
 
-  case 395:
-#line 2080 "pir.y"
+  case 401:
+#line 2114 "pir.y"
     { (yyval.ival) = OP_SHR; ;}
     break;
 
-  case 396:
-#line 2081 "pir.y"
+  case 402:
+#line 2115 "pir.y"
     { (yyval.ival) = OP_SHL; ;}
     break;
 
-  case 397:
-#line 2082 "pir.y"
+  case 403:
+#line 2116 "pir.y"
     { (yyval.ival) = OP_LSR; ;}
     break;
 
-  case 399:
-#line 2103 "pir.y"
+  case 405:
+#line 2137 "pir.y"
     { new_subr(lexer, "@start"); ;}
     break;
 
-  case 408:
-#line 2119 "pir.y"
+  case 414:
+#line 2153 "pir.y"
     { set_label(lexer, (yyvsp[(1) - (2)].sval)); ;}
     break;
 
-  case 413:
-#line 2129 "pir.y"
+  case 419:
+#line 2163 "pir.y"
     { set_sub_name(lexer, (yyvsp[(3) - (3)].sval)); ;}
     break;
 
-  case 414:
-#line 2133 "pir.y"
+  case 420:
+#line 2167 "pir.y"
     { new_subr(lexer, NULL); ;}
     break;
 
-  case 415:
-#line 2138 "pir.y"
+  case 421:
+#line 2172 "pir.y"
     {
                                   if (is_parrot_op(lexer, (yyvsp[(1) - (3)].sval)))
                                       get_opinfo(yyscanner);
@@ -4624,7 +4702,7 @@
 
 
 /* Line 1267 of yacc.c.  */
-#line 4628 "pirparser.c"
+#line 4706 "pirparser.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -4838,7 +4916,7 @@
 }
 
 
-#line 2149 "pir.y"
+#line 2183 "pir.y"
 
 
 
@@ -5987,11 +6065,37 @@
                 *instr_writer++ = '_';
                 *instr_writer++ = 'k';
 
+                /* XXX this switch replaces the messy code below. double-check before delete. */
+                switch (iter->expr.t->key->expr->type) {
+                    case EXPR_TARGET:
+                        switch (iter->expr.t->key->expr->expr.t->info->type) {
+                            case PMC_TYPE:
+                                /* the key is a target, and its type is a PMC. In that
+                                 * case, do not print the signature; 'kp' is not valid.
+                                 */
+                                break;
+                            case INT_TYPE:
+                                *instr_writer++ = 'i';
+                                break;
+                            default:
+                                break;
+                        }
+                        break;
+                    case EXPR_CONSTANT:
+                        *instr_writer++ = 'c';
+                        break;
+                    default:
+                        /* XXX does this ever happen? */
+                        fprintf(stderr, "write_signature: non-constant key\n");
+                        instr_writer = write_signature(iter->expr.t->key->expr, instr_writer);
+                        break;
+                }
+
+
+                /*
                 if ((iter->expr.t->key->expr->type == EXPR_TARGET)
                 &&  (iter->expr.t->key->expr->expr.t->info->type == PMC_TYPE)) {
-                    /* the key is a target, and its type is a PMC. In that case, do not
-                     * print the signature; 'kp' is not valid.
-                     */
+
                 }
                 else {
                     if ((iter->expr.t->key->expr->type == EXPR_TARGET)
@@ -6000,9 +6104,7 @@
                        *instr_writer++ = 'i';
                     }
                     else
-                    /*
-                    instr_writer = write_signature(iter->expr.t->key->expr, instr_writer);
-                    */
+
                     switch (iter->expr.t->key->expr->type) {
                         case EXPR_CONSTANT:
                             *instr_writer++ = 'c';
@@ -6012,7 +6114,8 @@
                             instr_writer = write_signature(iter->expr.t->key->expr, instr_writer);
                             break;
                     }
-                }
+                }*/
+
             }
             break;
         case EXPR_CONSTANT:
@@ -6228,7 +6331,6 @@
         expression *iter = CURRENT_INSTRUCTION(lexer)->operands;
         opinfo           = CURRENT_INSTRUCTION(lexer)->opinfo;
 
-
         PARROT_ASSERT(opinfo);
 
         opcount = opinfo->op_count - 1; /* according to op.h, opcount also counts the op itself. */
@@ -6262,13 +6364,10 @@
                  * which one to fix.
                  */
 
-                /*
-                fprintf(stderr, "setting %dth label flag on instruction %s\n", BIT(i),
-                        CURRENT_INSTRUCTION(lexer)->opname);
-                 */
+                /* fprintf(stderr, "setting %dth label flag on instruction %s\n", BIT(i),
+                        CURRENT_INSTRUCTION(lexer)->opname); */
 
                 SET_FLAG(CURRENT_INSTRUCTION(lexer)->oplabelbits, BIT(i));
-
             }
 
             ++i;

Modified: branches/pdd22io_part3/compilers/pirc/new/pirparser.h
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pirparser.h	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pirparser.h	Mon Dec 29 23:28:53 2008
@@ -89,71 +89,72 @@
      TK_NREG = 305,
      TK_SREG = 306,
      TK_IREG = 307,
-     TK_ARROW = 308,
-     TK_NE = 309,
-     TK_EQ = 310,
-     TK_LT = 311,
-     TK_LE = 312,
-     TK_GT = 313,
-     TK_GE = 314,
-     TK_USHIFT = 315,
-     TK_RSHIFT = 316,
-     TK_LSHIFT = 317,
-     TK_FDIV = 318,
-     TK_OR = 319,
-     TK_AND = 320,
-     TK_XOR = 321,
-     TK_CONC = 322,
-     TK_ASSIGN_USHIFT = 323,
-     TK_ASSIGN_RSHIFT = 324,
-     TK_ASSIGN_LSHIFT = 325,
-     TK_ASSIGN_INC = 326,
-     TK_ASSIGN_DEC = 327,
-     TK_ASSIGN_MUL = 328,
-     TK_ASSIGN_MOD = 329,
-     TK_ASSIGN_POW = 330,
-     TK_ASSIGN_DIV = 331,
-     TK_ASSIGN_BOR = 332,
-     TK_ASSIGN_BAND = 333,
-     TK_ASSIGN_FDIV = 334,
-     TK_ASSIGN_BNOT = 335,
-     TK_ASSIGN_CONC = 336,
-     TK_FLAG_INIT = 337,
-     TK_FLAG_LOAD = 338,
-     TK_FLAG_MAIN = 339,
-     TK_FLAG_ANON = 340,
-     TK_FLAG_METHOD = 341,
-     TK_FLAG_OUTER = 342,
-     TK_FLAG_VTABLE = 343,
-     TK_FLAG_LEX = 344,
-     TK_FLAG_MULTI = 345,
-     TK_FLAG_POSTCOMP = 346,
-     TK_FLAG_IMMEDIATE = 347,
-     TK_FLAG_SUBID = 348,
-     TK_FLAG_INSTANCEOF = 349,
-     TK_FLAG_NSENTRY = 350,
-     TK_FLAG_UNIQUE_REG = 351,
-     TK_FLAG_NAMED = 352,
-     TK_FLAG_SLURPY = 353,
-     TK_FLAG_FLAT = 354,
-     TK_FLAG_OPTIONAL = 355,
-     TK_FLAG_OPT_FLAG = 356,
-     TK_FLAG_INVOCANT = 357,
-     TK_MACRO = 358,
-     TK_ENDM = 359,
-     TK_MACRO_LOCAL = 360,
-     TK_MACRO_LABEL = 361,
-     TK_MACRO_CONST = 362,
-     TK_MACRO_LABEL_ID = 363,
-     TK_MACRO_LOCAL_ID = 364,
-     TK_MACRO_IDENT = 365,
-     TK_MACRO_ARG_IDENT = 366,
-     TK_MACRO_ARG_OTHER = 367,
-     TK_MACRO_CONST_VAL = 368,
-     TK_PASM_MARKER_START = 369,
-     TK_PIR_MARKER_START = 370,
-     TK_PCC_SUB = 371,
-     TK_PARROT_OP = 372
+     TK_CONST_VALUE = 308,
+     TK_ARROW = 309,
+     TK_NE = 310,
+     TK_EQ = 311,
+     TK_LT = 312,
+     TK_LE = 313,
+     TK_GT = 314,
+     TK_GE = 315,
+     TK_USHIFT = 316,
+     TK_RSHIFT = 317,
+     TK_LSHIFT = 318,
+     TK_FDIV = 319,
+     TK_OR = 320,
+     TK_AND = 321,
+     TK_XOR = 322,
+     TK_CONC = 323,
+     TK_ASSIGN_USHIFT = 324,
+     TK_ASSIGN_RSHIFT = 325,
+     TK_ASSIGN_LSHIFT = 326,
+     TK_ASSIGN_INC = 327,
+     TK_ASSIGN_DEC = 328,
+     TK_ASSIGN_MUL = 329,
+     TK_ASSIGN_MOD = 330,
+     TK_ASSIGN_POW = 331,
+     TK_ASSIGN_DIV = 332,
+     TK_ASSIGN_BOR = 333,
+     TK_ASSIGN_BAND = 334,
+     TK_ASSIGN_FDIV = 335,
+     TK_ASSIGN_BNOT = 336,
+     TK_ASSIGN_CONC = 337,
+     TK_FLAG_INIT = 338,
+     TK_FLAG_LOAD = 339,
+     TK_FLAG_MAIN = 340,
+     TK_FLAG_ANON = 341,
+     TK_FLAG_METHOD = 342,
+     TK_FLAG_OUTER = 343,
+     TK_FLAG_VTABLE = 344,
+     TK_FLAG_LEX = 345,
+     TK_FLAG_MULTI = 346,
+     TK_FLAG_POSTCOMP = 347,
+     TK_FLAG_IMMEDIATE = 348,
+     TK_FLAG_SUBID = 349,
+     TK_FLAG_INSTANCEOF = 350,
+     TK_FLAG_NSENTRY = 351,
+     TK_FLAG_UNIQUE_REG = 352,
+     TK_FLAG_NAMED = 353,
+     TK_FLAG_SLURPY = 354,
+     TK_FLAG_FLAT = 355,
+     TK_FLAG_OPTIONAL = 356,
+     TK_FLAG_OPT_FLAG = 357,
+     TK_FLAG_INVOCANT = 358,
+     TK_MACRO = 359,
+     TK_ENDM = 360,
+     TK_MACRO_LOCAL = 361,
+     TK_MACRO_LABEL = 362,
+     TK_MACRO_CONST = 363,
+     TK_MACRO_LABEL_ID = 364,
+     TK_MACRO_LOCAL_ID = 365,
+     TK_MACRO_IDENT = 366,
+     TK_MACRO_ARG_IDENT = 367,
+     TK_MACRO_ARG_OTHER = 368,
+     TK_MACRO_CONST_VAL = 369,
+     TK_PASM_MARKER_START = 370,
+     TK_PIR_MARKER_START = 371,
+     TK_PCC_SUB = 372,
+     TK_PARROT_OP = 373
    };
 #endif
 /* Tokens.  */
@@ -207,71 +208,72 @@
 #define TK_NREG 305
 #define TK_SREG 306
 #define TK_IREG 307
-#define TK_ARROW 308
-#define TK_NE 309
-#define TK_EQ 310
-#define TK_LT 311
-#define TK_LE 312
-#define TK_GT 313
-#define TK_GE 314
-#define TK_USHIFT 315
-#define TK_RSHIFT 316
-#define TK_LSHIFT 317
-#define TK_FDIV 318
-#define TK_OR 319
-#define TK_AND 320
-#define TK_XOR 321
-#define TK_CONC 322
-#define TK_ASSIGN_USHIFT 323
-#define TK_ASSIGN_RSHIFT 324
-#define TK_ASSIGN_LSHIFT 325
-#define TK_ASSIGN_INC 326
-#define TK_ASSIGN_DEC 327
-#define TK_ASSIGN_MUL 328
-#define TK_ASSIGN_MOD 329
-#define TK_ASSIGN_POW 330
-#define TK_ASSIGN_DIV 331
-#define TK_ASSIGN_BOR 332
-#define TK_ASSIGN_BAND 333
-#define TK_ASSIGN_FDIV 334
-#define TK_ASSIGN_BNOT 335
-#define TK_ASSIGN_CONC 336
-#define TK_FLAG_INIT 337
-#define TK_FLAG_LOAD 338
-#define TK_FLAG_MAIN 339
-#define TK_FLAG_ANON 340
-#define TK_FLAG_METHOD 341
-#define TK_FLAG_OUTER 342
-#define TK_FLAG_VTABLE 343
-#define TK_FLAG_LEX 344
-#define TK_FLAG_MULTI 345
-#define TK_FLAG_POSTCOMP 346
-#define TK_FLAG_IMMEDIATE 347
-#define TK_FLAG_SUBID 348
-#define TK_FLAG_INSTANCEOF 349
-#define TK_FLAG_NSENTRY 350
-#define TK_FLAG_UNIQUE_REG 351
-#define TK_FLAG_NAMED 352
-#define TK_FLAG_SLURPY 353
-#define TK_FLAG_FLAT 354
-#define TK_FLAG_OPTIONAL 355
-#define TK_FLAG_OPT_FLAG 356
-#define TK_FLAG_INVOCANT 357
-#define TK_MACRO 358
-#define TK_ENDM 359
-#define TK_MACRO_LOCAL 360
-#define TK_MACRO_LABEL 361
-#define TK_MACRO_CONST 362
-#define TK_MACRO_LABEL_ID 363
-#define TK_MACRO_LOCAL_ID 364
-#define TK_MACRO_IDENT 365
-#define TK_MACRO_ARG_IDENT 366
-#define TK_MACRO_ARG_OTHER 367
-#define TK_MACRO_CONST_VAL 368
-#define TK_PASM_MARKER_START 369
-#define TK_PIR_MARKER_START 370
-#define TK_PCC_SUB 371
-#define TK_PARROT_OP 372
+#define TK_CONST_VALUE 308
+#define TK_ARROW 309
+#define TK_NE 310
+#define TK_EQ 311
+#define TK_LT 312
+#define TK_LE 313
+#define TK_GT 314
+#define TK_GE 315
+#define TK_USHIFT 316
+#define TK_RSHIFT 317
+#define TK_LSHIFT 318
+#define TK_FDIV 319
+#define TK_OR 320
+#define TK_AND 321
+#define TK_XOR 322
+#define TK_CONC 323
+#define TK_ASSIGN_USHIFT 324
+#define TK_ASSIGN_RSHIFT 325
+#define TK_ASSIGN_LSHIFT 326
+#define TK_ASSIGN_INC 327
+#define TK_ASSIGN_DEC 328
+#define TK_ASSIGN_MUL 329
+#define TK_ASSIGN_MOD 330
+#define TK_ASSIGN_POW 331
+#define TK_ASSIGN_DIV 332
+#define TK_ASSIGN_BOR 333
+#define TK_ASSIGN_BAND 334
+#define TK_ASSIGN_FDIV 335
+#define TK_ASSIGN_BNOT 336
+#define TK_ASSIGN_CONC 337
+#define TK_FLAG_INIT 338
+#define TK_FLAG_LOAD 339
+#define TK_FLAG_MAIN 340
+#define TK_FLAG_ANON 341
+#define TK_FLAG_METHOD 342
+#define TK_FLAG_OUTER 343
+#define TK_FLAG_VTABLE 344
+#define TK_FLAG_LEX 345
+#define TK_FLAG_MULTI 346
+#define TK_FLAG_POSTCOMP 347
+#define TK_FLAG_IMMEDIATE 348
+#define TK_FLAG_SUBID 349
+#define TK_FLAG_INSTANCEOF 350
+#define TK_FLAG_NSENTRY 351
+#define TK_FLAG_UNIQUE_REG 352
+#define TK_FLAG_NAMED 353
+#define TK_FLAG_SLURPY 354
+#define TK_FLAG_FLAT 355
+#define TK_FLAG_OPTIONAL 356
+#define TK_FLAG_OPT_FLAG 357
+#define TK_FLAG_INVOCANT 358
+#define TK_MACRO 359
+#define TK_ENDM 360
+#define TK_MACRO_LOCAL 361
+#define TK_MACRO_LABEL 362
+#define TK_MACRO_CONST 363
+#define TK_MACRO_LABEL_ID 364
+#define TK_MACRO_LOCAL_ID 365
+#define TK_MACRO_IDENT 366
+#define TK_MACRO_ARG_IDENT 367
+#define TK_MACRO_ARG_OTHER 368
+#define TK_MACRO_CONST_VAL 369
+#define TK_PASM_MARKER_START 370
+#define TK_PIR_MARKER_START 371
+#define TK_PCC_SUB 372
+#define TK_PARROT_OP 373
 
 
 
@@ -282,6 +284,7 @@
 {
     double              dval;
     int                 ival;
+    unsigned            uval;
     char   const       *sval;
     struct constant    *cval;
     struct instruction *instr;
@@ -295,7 +298,7 @@
     struct macro_param *pval;
 }
 /* Line 1489 of yacc.c.  */
-#line 299 "pirparser.h"
+#line 302 "pirparser.h"
 	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1

Modified: branches/pdd22io_part3/compilers/pirc/new/pirsymbol.c
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pirsymbol.c	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pirsymbol.c	Mon Dec 29 23:28:53 2008
@@ -63,7 +63,7 @@
 */
 static int
 next_register(NOTNULL(lexer_state * const lexer), pir_type type) {
-    CURRENT_SUB(lexer)->regs_used[type]++; /* count number of registers used */
+    CURRENT_SUB(lexer)->info.regs_used[type]++; /* count number of registers used */
     return lexer->curregister[type]++;
 }
 
@@ -229,7 +229,6 @@
             iter->info.type  = type;
         }
 
-
         iter = iter->next;
     }
 
@@ -261,7 +260,7 @@
             while (b) {
                 if (bucket_symbol(b)->info.color == NO_REG_ALLOCATED)
                     fprintf(stderr, "Warning: in sub '%s': symbol '%s' declared but not used\n",
-                                    subiter->sub_name, bucket_symbol(b)->info.id.name);
+                                    subiter->info.subname, bucket_symbol(b)->info.id.name);
 
                 b = b->next;
             }
@@ -511,7 +510,7 @@
 new_global_label(NOTNULL(lexer_state * const lexer), NOTNULL(char const * const name)) {
     global_label *glob = pir_mem_allocate_zeroed_typed(lexer, global_label);
     glob->name         = name;
-    glob->const_nr     = 0;
+    glob->const_table_index = 0;
     return glob;
 }
 
@@ -575,11 +574,16 @@
 */
 void
 store_global_constant(NOTNULL(lexer_state * const lexer), NOTNULL(constant * const c)) {
-    hashtable    *table = &lexer->constants;
-    unsigned long hash  = get_hashcode(c->name, table->size);
-    bucket *b           = new_bucket(lexer);
-    bucket_constant(b)  = c;
+    hashtable    *table  = &lexer->constants;
+    unsigned long hash   = get_hashcode(c->name, table->size);
+    bucket *b            = new_bucket(lexer);
+    bucket_constant(b)   = c;
     store_bucket(table, b, hash);
+
+    /* add it as a constant in the PBC constant table */
+    /* XXX is this necessary? Seems not. 12/27/2008. --kjs
+    c->const_table_index = emit_pbc_const(lexer, c);
+    */
 }
 
 /*
@@ -688,7 +692,7 @@
 
     /* no label found, emit an error message. */
     yypirerror(lexer->yyscanner, lexer, "in sub '%s': cannot find offset for label '%s'",
-               CURRENT_SUB(lexer)->sub_name, labelname);
+               CURRENT_SUB(lexer)->info.subname, labelname);
 
     return 0;
 }

Modified: branches/pdd22io_part3/compilers/pirc/new/pirsymbol.h
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/new/pirsymbol.h	(original)
+++ branches/pdd22io_part3/compilers/pirc/new/pirsymbol.h	Mon Dec 29 23:28:53 2008
@@ -9,8 +9,6 @@
  * a pir_reg object represents a PIR symbolic register ($I0, $S1, etc.).
  * For each symbol/pir-reg in a sub, there is only one corresponding
  * symbol/pir_reg object.
- * References to these symbols are stored as target nodes (during the
- * parse), which will point to these symbol or pir_reg objects.
  */
 
 #ifndef PARROT_PIR_PIRSYMBOL_H_GUARD
@@ -59,15 +57,15 @@
 
 /* structure to represent a global label */
 typedef struct global_label {
-    char const          *name;
-    int                  const_nr;
+    char const * name;              /* name of the global label a.k.a. sub */
+    int          const_table_index; /* index in PBC const table where this sub PMC is stored */
 
 } global_label;
 
 /* structure to represent a local label */
 typedef struct local_label {
-    char const         *name;
-    unsigned            offset;
+    char const * name;      /* name of the local label */
+    unsigned     offset;    /* offset in bytecode where this label points to. */
 
 } local_label;
 

Modified: branches/pdd22io_part3/compilers/pirc/t/basic.t
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/t/basic.t	(original)
+++ branches/pdd22io_part3/compilers/pirc/t/basic.t	Mon Dec 29 23:28:53 2008
@@ -47,7 +47,7 @@
 CODE
 .namespace []
 main:
-    set_returns
+    set_returns 1
     returncc
 OUTPUT
 
@@ -58,7 +58,7 @@
 CODE
 .namespace []
 .pcc_sub main:
-    set_returns
+    set_returns 1
     returncc
 OUTPUT
 
@@ -71,11 +71,11 @@
 CODE
 .namespace []
 .pcc_sub main:
-    set_returns
+    set_returns 1
     returncc
 .namespace []
 .pcc_sub get_integer:
-    set_returns
+    set_returns 5
     returncc
 OUTPUT
 
@@ -88,11 +88,11 @@
 CODE
 .namespace []
 .pcc_sub :method main:
-    set_returns
+    set_returns 1
     returncc
 .namespace []
 .pcc_sub :method bye:
-    set_returns
+    set_returns 5
     returncc
 OUTPUT
 
@@ -103,7 +103,7 @@
 CODE
 .namespace []
 .pcc_sub main:
-    set_returns
+    set_returns 1
     returncc
 OUTPUT
 

Modified: branches/pdd22io_part3/compilers/pirc/t/heredoc.t
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/t/heredoc.t	(original)
+++ branches/pdd22io_part3/compilers/pirc/t/heredoc.t	Mon Dec 29 23:28:53 2008
@@ -29,11 +29,11 @@
 CODE
 .namespace []
 main:
-    set_args "\nthis is a simple single-line heredoc.\n", "\nthis is a simple\nmulti\nline\nheredoc\n.\n", "\nand yet another\nmulti\nline\nheredoc\nstring.\n"
-    get_results ""
+    set_args 1
+    get_results 2
     find_sub_not_null P0, "foo"
     invokecc P0
-    set_returns
+    set_returns 3
     returncc
 OUTPUT
 
@@ -54,9 +54,9 @@
 .namespace []
 foo:
     get_params
-    set_returns "\n This is some text returned through .yield!\n\n"
+    set_returns 1
     yield
-    set_returns "\n Some text returned through return\n"
+    set_returns 2
     returncc
 OUTPUT
 
@@ -75,7 +75,7 @@
 main:
     set S0, "\nthis is a simple assigned heredoc string to $S0.\n"
     set S1, "\nthis is a simple assigned heredoc string to string s.\n"
-    set_returns
+    set_returns 1
     returncc
 OUTPUT
 

Modified: branches/pdd22io_part3/compilers/pirc/t/macro.t
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/t/macro.t	(original)
+++ branches/pdd22io_part3/compilers/pirc/t/macro.t	Mon Dec 29 23:28:53 2008
@@ -17,7 +17,7 @@
 .namespace []
 main:
     print "hello"
-    set_returns
+    set_returns 1
     returncc
 OUTPUT
 
@@ -38,7 +38,7 @@
 main:
     say 42
     say "hi"
-    set_returns
+    set_returns 1
     returncc
 OUTPUT
 

Modified: branches/pdd22io_part3/compilers/pirc/t/stmts.t
==============================================================================
--- branches/pdd22io_part3/compilers/pirc/t/stmts.t	(original)
+++ branches/pdd22io_part3/compilers/pirc/t/stmts.t	Mon Dec 29 23:28:53 2008
@@ -23,7 +23,7 @@
     set S0, "hi"
     set I0, 42
     set N0, 3.140000
-    set_returns
+    set_returns 1
     returncc
 OUTPUT
 
@@ -45,7 +45,7 @@
 X:
 Y:
 Z:
-    set_returns
+    set_returns 1
     returncc
 OUTPUT
 
@@ -67,7 +67,7 @@
     lt I1, I0, 4
 goto:
 L:
-    set_returns
+    set_returns 1
     returncc
 OUTPUT
 
@@ -80,11 +80,11 @@
 CODE
 .namespace []
 main:
-    set_args ""
-    get_results ""
+    set_args 1
+    get_results 2
     find_sub_not_null P0, "foo"
     invokecc P0
-    set_returns
+    set_returns 3
     returncc
 OUTPUT
 
@@ -99,15 +99,15 @@
 CODE
 .namespace []
 main:
-    set_args ""
-    get_results ""
-    set P0, 0
+    set_args 1
+    get_results 2
+    set P0, 10
     invokecc P0
-    set_returns
+    set_returns 3
     returncc
 .namespace []
 foo:
-    set_returns
+    set_returns 7
     returncc
 OUTPUT
 

Modified: branches/pdd22io_part3/compilers/tge/tgc.pir
==============================================================================
--- branches/pdd22io_part3/compilers/tge/tgc.pir	(original)
+++ branches/pdd22io_part3/compilers/tge/tgc.pir	Mon Dec 29 23:28:53 2008
@@ -66,14 +66,14 @@
 
   OUTPUT_FILE:
     outfile = opts['output']
-    outfh = open outfile, '>'
+    outfh = open outfile, 'w'
     unless outfh goto ERR_NO_OUTFILE
 
   OUTPUT_DONE:
 
     # Read grammar file and compile here
     .local pmc infh
-    infh = open infile, "<"
+    infh = open infile, 'r'
     unless infh goto ERR_NO_INFILE
 
     .local string source

Modified: branches/pdd22io_part3/config/auto/warnings.pm
==============================================================================
--- branches/pdd22io_part3/config/auto/warnings.pm	(original)
+++ branches/pdd22io_part3/config/auto/warnings.pm	Mon Dec 29 23:28:53 2008
@@ -103,23 +103,18 @@
 
     my @cage_warnings = qw(
         -std=c89
-        -Wconversion
         -Werror-implicit-function-declaration
         -Wformat=2
         -Wlarger-than-4096
         -Wlong-long
         -Wmissing-format-attribute
-        -Wmissing-noreturn
-        -Wno-deprecated-declarations
-        -Wno-div-by-zero
+        -Wdeprecated-declarations
+        -Wdiv-by-zero
         -Wno-format-extra-args
         -Wno-import
         -Wno-multichar
         -Wno-pointer-sign
         -Wold-style-definition
-        -Wredundant-decls
-        -Wswitch-enum
-        -Wsystem-headers
         -Wunreachable-code
         -Wunused-function
         -Wunused-label
@@ -130,11 +125,16 @@
 
     my @may_not_even_be_interesting = qw(
         -Wpadded
+        -Wredundant-decls
+        -Wswitch-enum
+        -Wsystem-headers
     );
 
     my @nice_to_have_but_too_noisy_for_now = qw(
         -pedantic
+        -Wconversion
         -Wint-to-pointer-cast
+        -Wmissing-noreturn
         -Wshadow
         -Wunused-macros
     );

Modified: branches/pdd22io_part3/config/gen/makefiles/pirc.in
==============================================================================
--- branches/pdd22io_part3/config/gen/makefiles/pirc.in	(original)
+++ branches/pdd22io_part3/config/gen/makefiles/pirc.in	Mon Dec 29 23:28:53 2008
@@ -76,8 +76,7 @@
 new/bcgen$(O): new/bcgen.c new/bcgen.h
 
 test: all
-	podchecker $(SOURCES) \	
-	README.pod
+	podchecker $(SOURCES) README.pod
 	perl t/harness
 
 # regenerate the Makefile

Modified: branches/pdd22io_part3/config/gen/makefiles/root.in
==============================================================================
--- branches/pdd22io_part3/config/gen/makefiles/root.in	(original)
+++ branches/pdd22io_part3/config/gen/makefiles/root.in	Mon Dec 29 23:28:53 2008
@@ -1128,25 +1128,17 @@
 
 $(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.str
+$(IO_DIR)/api$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h $(IO_DIR)/api.str
 
-$(IO_DIR)/io_buf$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
+$(IO_DIR)/buffer$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
 
-$(IO_DIR)/io_layers$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
+$(IO_DIR)/portable$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
 
-$(IO_DIR)/io_unix$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
+$(IO_DIR)/unix$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
 
-$(IO_DIR)/io_utf8$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
+$(IO_DIR)/utf8$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
 
-$(IO_DIR)/io_mmap$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
-
-$(IO_DIR)/io_win32$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
-
-$(IO_DIR)/io_stdio$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
-
-$(IO_DIR)/io_string$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
-
-$(IO_DIR)/io_passdown$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
+$(IO_DIR)/win32$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
 
 $(SRC_DIR)/gc/memory$(O) : $(GENERAL_H_FILES)
 

Modified: branches/pdd22io_part3/docs/book/ch03_pir_basics.pod
==============================================================================
--- branches/pdd22io_part3/docs/book/ch03_pir_basics.pod	(original)
+++ branches/pdd22io_part3/docs/book/ch03_pir_basics.pod	Mon Dec 29 23:28:53 2008
@@ -27,7 +27,7 @@
 instructional code examples. The documentation for the PIR compiler IMCC
 in F<docs/imcc/> or the project documentation in F<docs/> are good
 sources for information about the current syntax, semantics, and
-implementation. The other PIR compiler, PIRC, has it's own documentation
+implementation. The other PIR compiler, PIRC, has its own documentation
 that is slowly maturing. This is a useful source of information too. The
 test suite in F<t/compilers/imcc/> shows examples of proper working code. In fact,
 the test suite is the definitive PIR resource, because it shows how PIR
@@ -268,7 +268,7 @@
 The statement C<sum = $I42 + 5> translates to something like
 C<add I16, I17, 5> in PASM. The exact translation isn't too important
 N<Unless you're hacking on IMCC or PIRC!>, so we don't have to worry
-about it for now. We will talk more about PASM and it's instruction
+about it for now. We will talk more about PASM and its instruction
 set in X<CHP-5> Chapter 5.
 
 PIR also provides automatic assignment operators such as C<+=>, C<-=>,

Modified: branches/pdd22io_part3/docs/book/ch04_pir_subroutines.pod
==============================================================================
--- branches/pdd22io_part3/docs/book/ch04_pir_subroutines.pod	(original)
+++ branches/pdd22io_part3/docs/book/ch04_pir_subroutines.pod	Mon Dec 29 23:28:53 2008
@@ -284,7 +284,7 @@
 
 In this example, the subroutine C<add_two> makes two calls to
 c<add_one>. The second call to C<add_one> is used as the return
-value. C<add_one> is called and it's result is immediately returned
+value. C<add_one> is called and its result is immediately returned
 to the caller of C<add_two>, it is never stored anywhere. We can
 optimize this situation is we realize that the second call to
 C<add_one> is returning to the same place that C<add_two> is. The
@@ -308,7 +308,7 @@
 What this means is that we can define a subroutine by name inside a
 larger subroutine, and our "inner" subroutine is only visible and callable
 from the "outer" subroutine. Plus, the "inner" subroutine inherits all the
-lexical variables from the outer subroutine, but is able to define it's
+lexical variables from the outer subroutine, but is able to define its
 own lexical variables that cannot be seen or modified by the outer subroutine.
 
 =head3 Scope and HLLs

Modified: branches/pdd22io_part3/docs/book/ch05_pasm.pod
==============================================================================
--- branches/pdd22io_part3/docs/book/ch05_pasm.pod	(original)
+++ branches/pdd22io_part3/docs/book/ch05_pasm.pod	Mon Dec 29 23:28:53 2008
@@ -66,7 +66,7 @@
 capital letters to make them stand out from the rest of the source code
 more clearly. A label definition is simply the name of the label
 followed by a colon. It can be on its own line N<In fact, we recommend
-that it be on it's own line, for readability.>:
+that it be on its own line, for readability.>:
 
   LABEL:
       print "Norwegian Blue\n"
@@ -1024,11 +1024,11 @@
 success and a C<Undef>X<Undef PMC> X<I/O;failure> object on
 failure. The C<ParrotIO> object hides OS-specific details.
 
-  open P0, "people.txt", "<"
+  open P0, "people.txt", "r"
 
 The modestring specifies whether the file is opened in read-only
-(C<E<lt>>), write-only (C<E<gt>>), read-write (C<+E<lt>>), or append
-mode (C<E<gt>E<gt>>).
+(C<r>), write-only (C<w>), read-write (C<rw>), or append
+mode (C<wa>).
 
 The C<close>X<close opcode (PASM)> opcode closes a C<ParrotIO> object:
 
@@ -2790,149 +2790,6 @@
 Z<CHP-5-SECT-12.5>
 
 The C<isa> and C<can> opcodes are also useful when working with
-objects. C<isa>X<isa opcode (PASM)> checks whether an object belongs
-to or inherits from a particular class. C<can>X<can opcode (PASM)>
-checks whether an object has a particular method. Both return a true
-or false value.
-
-    isa I0, P3, "Foo"		# 1
-    isa I0, P3, "Bar"		# 1
-    can I0, P3, "__add"		# 1
-
-=head2 Complete Example
-
-Z<CHP-5-SECT-12.6>
-
-    newclass P1, "Foo"
-    addattribute P1, "$.i"                # Foo.i
-
-    find_type I1, "Foo"
-    new P3, I1          # call __init if it exists
-    set P3, 30          # call __set_integer_native method
-
-    new P4, I1          # same with P4
-    set P4, 12
-    new P5, I1          # create a new LHS for add
-
-    add P5, P3, P4      # __add method
-    set I10, P5         # __get_integer
-    print I10
-    print "\n"
-    print P5            # calls __get_string prints 'fortytwo'
-    print "\n"
-
-    inc P3              # __increment
-    add P5, P3, P4
-    print P5            # calls __get_string prints '43'
-    print "\n"
-
-    subclass P3, P1, "Bar"
-
-    find_type I1, "Bar"
-    new P3, I1
-
-    set P3, 100
-    new P4, I1
-    set P4, 200
-    new P5, I1
-
-    add P5, P3, P4
-    print P5                    # prints 300
-    print "\n"
-
-    set P5, 42
-    print P5                    # prints 'fortytwo'
-    print "\n"
-
-    inc P5
-    print P5                    # prints 41 as Bar's
-    print P5                    # prints 41 as _bar_inc decrements
-    print "\n"
-
-    set S0, "_half"             # set method name
-    set P2, P5                  # the object
-    savetop                     # preserve registers
-    callmethodcc                # create return continuation, call
-    restoretop
-    print I5
-    print "\n"
-
-=head2 Additional Object Opcodes
-
-Z<CHP-5-SECT-12.5>
-
-The C<isa> and C<can> opcodes are also useful when working with
-objects. C<isa>X<isa opcode (PASM)> checks whether an object belongs to or
-inherits from a particular class. C<can>X<can opcode (PASM)> checks whether
-an object has a particular method. Both return a true or false value.
-
-    isa I0, P3, "Foo"		# 1
-    isa I0, P3, "Bar"		# 1
-    can I0, P3, "__add"		# 1
-
-=head2 Complete Example
-
-Z<CHP-5-SECT-12.6>
-
-    newclass P1, "Foo"
-    addattribute P1, "$.i"                # Foo.i
-
-    find_type I1, "Foo"
-    new P3, I1          # call __init if it exists
-    set P3, 30          # call __set_integer_native method
-
-    new P4, I1          # same with P4
-    set P4, 12
-    new P5, I1          # create a new LHS for add
-
-    add P5, P3, P4      # __add method
-    set I10, P5         # __get_integer
-    print I10
-    print "\n"
-    print P5            # calls __get_string prints 'fortytwo'
-    print "\n"
-
-    inc P3              # __increment
-    add P5, P3, P4
-    print P5            # calls __get_string prints '43'
-    print "\n"
-
-    subclass P3, P1, "Bar"
-
-    find_type I1, "Bar"
-    new P3, I1
-
-    set P3, 100
-    new P4, I1
-    set P4, 200
-    new P5, I1
-
-    add P5, P3, P4
-    print P5                    # prints 300
-    print "\n"
-
-    set P5, 42
-    print P5                    # prints 'fortytwo'
-    print "\n"
-
-    inc P5
-    print P5                    # prints 41 as Bar's
-    print P5                    # prints 41 as _bar_inc decrements
-    print "\n"
-
-    set S0, "_half"             # set method name
-    set P2, P5                  # the object
-    savetop                     # preserve registers
-    callmethodcc                # create return continuation, call
-    restoretop
-    print I5
-    print "\n"
-
-=head2 Additional Object Opcodes
-
-Z<CHP-5-SECT-12.5>
-
-The C<isa> and C<can> opcodes are also useful when working with
 objects. C<isa>X<isa opcode (PASM)> checks whether an object belongs to or
 inherits from a particular class. C<can>X<can opcode (PASM)> checks whether
 an object has a particular method. Both return a true or false value.

Modified: branches/pdd22io_part3/docs/book/ch06_library.pod
==============================================================================
--- branches/pdd22io_part3/docs/book/ch06_library.pod	(original)
+++ branches/pdd22io_part3/docs/book/ch06_library.pod	Mon Dec 29 23:28:53 2008
@@ -7,7 +7,7 @@
 PIR and PASM are both very low-level languages by any programming
 standards, even though they support some important features of
 high-level dynamic languages,and PIR has some symbolic syntax features.
-Important reoccuring programming tasks in these lanuages have been
+Important re-occurring programming tasks in these lanuages have been
 extracted out into a series of runtime libraries to help make these
 tasks easier. Libraries written in PIR or PASM can be easily included
 and used from any of the high-level language compilers that target

Modified: branches/pdd22io_part3/docs/book/ch08_architecture.pod
==============================================================================
--- branches/pdd22io_part3/docs/book/ch08_architecture.pod	(original)
+++ branches/pdd22io_part3/docs/book/ch08_architecture.pod	Mon Dec 29 23:28:53 2008
@@ -183,7 +183,7 @@
 tree is flattened, and is passed into a series of substitutions and
 transformations. The compiler is the least interesting part or Parrot,
 little more than a simple rule-based filter module. It is simple, but
-it's a necessart part of Parrot.
+it's a necessary part of Parrot.
 
 For many languages the parser and compiler are essentially a single
 unit. Like the parser, the compiler is modular, so you can load

Modified: branches/pdd22io_part3/docs/book/ch09_pct.pod
==============================================================================
--- branches/pdd22io_part3/docs/book/ch09_pct.pod	(original)
+++ branches/pdd22io_part3/docs/book/ch09_pct.pod	Mon Dec 29 23:28:53 2008
@@ -5,7 +5,7 @@
 Z<CHP-8>
 
 So far we've talked a lot about low-level Parrot programming with
-PIR and PASM. However, the true power of Parrot is it's ability to
+PIR and PASM. However, the true power of Parrot is its ability to
 host programs written in high level languages such as Perl 6,
 Python, Ruby, Tcl, and PHP. In order to write code in these languages
 developers need there to be compilers that convert from the language
@@ -185,7 +185,7 @@
 
 A recursive descent parser, like the one used in PGE, is a top-down
 parser. This means it attempts to start at the highest-level rule and
-work it's way down to the individual input tokens in order to match
+work its way down to the individual input tokens in order to match
 the given input. Once the parser has matched the entire input N<a
 source code file, or a line of input at the terminal in interactive
 mode> the parse is considered successful and the generated AST is
@@ -342,7 +342,7 @@
     'Skywalker'
  }
 
-This is the same rule, except now it passes two arguments to it's
+This is the same rule, except now it passes two arguments to its
 action method: the match object and the name of the person who
 got matched.
 
@@ -371,7 +371,7 @@
 Notice that an C<if_statement> can contain a list of C<statement>s, and
 that each statement may itself be an C<if_statement>? This is called
 I<recursion> X<Recursion>, and is part of where the "Recursive Descent"
-algorithm gets it's name from.
+algorithm gets its name from.
 
 Now, let's look at a more direct example of a comma-separated list of
 integer digits to form an array. We can define this recursively as
@@ -450,7 +450,7 @@
 equation are split into two subtypes: I<terms> and I<operators>. Operators
 themselves are split into a number of types including postfix (C<-a>),
 suffix (C<i++>), infix (C<x + y>), circumfix (C<[z]>), postcircumix
-(C<a[b]>), and list (C<1, 2, 3>). Each operator gets it's own precidence
+(C<a[b]>), and list (C<1, 2, 3>). Each operator gets its own precidence
 number that specifies how closely it binds to the terms. In the example above,
 the expression is parsed
 
@@ -478,8 +478,8 @@
 of saying that the rule is overridable dynamically, and that it might be defined
 somewhere else. In this case, PCT takes information from the proto declaration
 and fills in the details for us. On another note, this also means that the HLL
-itself can modify it's own grammar at run time, by overriding the proto
-definitions for it's operator table. Some languages call this process "operator
+itself can modify its own grammar at run time, by overriding the proto
+definitions for its operator table. Some languages call this process "operator
 overloading".
 
 A proto is defined like this, taking some of our grammar rules above:
@@ -802,4 +802,4 @@
 # Local variables:
 #   c-file-style: "parrot"
 # End:
-# vim: expandtab shiftwidth=4:
\ No newline at end of file
+# vim: expandtab shiftwidth=4:

Modified: branches/pdd22io_part3/docs/book/ch10_hlls.pod
==============================================================================
--- branches/pdd22io_part3/docs/book/ch10_hlls.pod	(original)
+++ branches/pdd22io_part3/docs/book/ch10_hlls.pod	Mon Dec 29 23:28:53 2008
@@ -14,11 +14,11 @@
 interoperating with each other then compiled languages have because
 compiled languages operate at the same machine-code level and typically
 can make use of the same application binary interface (ABI). With the
-right compiler settings, programs written in Visual Basic and interoperate
+right compiler settings, programs written in Visual Basic can interoperate
 with programs written in C N<On some systems anyway>, which can call
-functions written in C++, in Ada, Fortran, and Pascal. To try to mix
+functions written in C++, in Ada, Fortran, Pascal and so on. To try to mix
 two common dynamic languages, like Perl and Python, or Ruby and PHP, you
-would need to custom write some kind of "glue" function to try to include
+would need to write some kind of custom "glue" function to try to include
 an interpreter object from one language as a library for another language,
 and then write code to try and get the parser for one to interact nicely
 with the parser for the other. It's a nightmare, frankly, and you don't
@@ -33,7 +33,7 @@
 a binding for a popular library such as opengl or xlib once, and include
 that library into any language that needs it. Compare this to the current
 situation where a library like Gtk2 needs to have bindings for every
-language that wants to use it.In short, Parrot should make interoperation
+language that wants to use it. In short, Parrot should make interoperation
 easier for everybody.
 
 This chapter is going to talk about HLLs, the way they operate, and the
@@ -122,7 +122,7 @@
 the compiler fakecutables. The fakecutables contain a link to C<libparrot>,
 which contains all the necessary guts of Parrot. When the fakecutable is
 executed, a small driver program loads the PBC data into libparrot through
-it's API functions. The Parrot executable is just one small example of how
+its API functions. The Parrot executable is just one small example of how
 Parrot's functionality can be implemented, and we will talk about a few other
 ways here too.
 
@@ -135,7 +135,7 @@
 =head3 Creating and Interoperating Interpreters
 
 Parrot's executable, which is the interface which most users are going
-to be familiar with uses a single interpreter structure to perform a
+to be familiar with, uses a single interpreter structure to perform a
 single execution task. However, this isn't the only supported structural
 model that Parrot supports. In fact, the interpreter structure is not a
 singleton, and multiple interpreters can be created by a single program.
@@ -160,7 +160,7 @@
 specific environments (such as within a single program) are called
 I<Domain-Specific Languages> (DSL). DSLs are a very popular topic because
 a DSL allows developers to create a custom language that makes dealing
-with a given problem space or data set very easy. Parrot and it's suite
+with a given problem space or data set very easy. Parrot and its suite
 of compiler tools in turn make creating the DSLs very easy. It's all
 about ease of use.
 
@@ -251,4 +251,4 @@
 # Local variables:
 #   c-file-style: "parrot"
 # End:
-# vim: expandtab shiftwidth=4:
\ No newline at end of file
+# vim: expandtab shiftwidth=4:

Modified: branches/pdd22io_part3/docs/book/ch12_opcodes.pod
==============================================================================
--- branches/pdd22io_part3/docs/book/ch12_opcodes.pod	(original)
+++ branches/pdd22io_part3/docs/book/ch12_opcodes.pod	Mon Dec 29 23:28:53 2008
@@ -76,7 +76,7 @@
 The fast core is a bare-bones core that doesn't do any of the
 bounds-checking or context updating that the slow core does. The fast
 core is the way Parrot should run, and is used to find and debug places
-where execution strays outside of it's normal bounds. In pseudocode, the
+where execution strays outside of its normal bounds. In pseudocode, the
 fast core is very much like the slow core except it doesn't do the bounds
 checking between each instruction, and doesn't update the interpreter's
 current context for each dispatch.
@@ -88,7 +88,7 @@
 
 =item* Switch Core
 
-As it's name implies, the switch core uses a gigantic C C<switch / case>
+As its name implies, the switch core uses a gigantic C C<switch / case>
 structure to execute opcodes. Here's a brief example of how this
 architecture works:
 
@@ -112,13 +112,17 @@
 =item* Computed Goto Core
 
 I<Computed Goto> is a feature of some C compilers where a label is
-treated as a piece of data that can be stored in an array. Each opcode
-is simply a label in a very large function, and the labels are stored
-in an array. Calling an opcode is as easy as taking that opcode's number
-as the index of the label array, and calling the associated label.
-Sound complicated? It is a little, especially to C programmers who are
-not used to these kinds of features, and who have been taught that the
-C<goto> keyword is to be avoided.
+treated as a piece of data that can be stored as a C<void *> pointer. Each
+opcode becomes simply a label in a very large function, and pointers to the
+labels are stored in a large array. Calling an opcode is as easy as taking
+that opcode's number as the index of the label array, and calling the
+associated label. Sound complicated? It is a little, especially to C
+programmers who are not used to using labels, much less treating them as
+first class data items.
+
+Notice that computed goto is a feature only available in some compilers
+such as GCC, and will not be available in every distribution of Parrot,
+depending what compilers were used to build it.
 
 As was mentioned earlier, not all compilers support computed goto, which
 means that this core will not be built on platforms that don't support it.
@@ -165,9 +169,11 @@
 
 =item* Precomputed Goto Core
 
-The precomputed goto core is an amazingly optimized fast core that uses
+The precomputed goto core is an amazingly fast optimized core that uses
 the same computed goto feature, but performs the array dereferencing
-before the core even starts. In the computed goto core, you have this
+before the core even starts. The compiled bytecode is fed into a
+preprocessor that converts the bytecode instruction numbers into lable
+pointer values. In the computed goto core, you have this
 operation to move to the next opcode:
 
   goto *my_labels[*(current_opcode += 1)];
@@ -176,26 +182,31 @@
 operations must be performed to complete this step: The value of
 C<current_opcode> must be incremented to the next value, that value must
 be dereferenced to find the opcode value. In C, arrays are pointers, so
-C<my_labels> gets dereferenced and an offset is taken according to find
+C<my_labels> gets dereferenced and an offset is taken from it to find
 the stored label reference. That label reference is then dereferenced, and
 the jump is performed.
 
 That's a lot of steps to execute before we can jump to the next opcode.
-Now, what, if each opcode value was replaced with the value of the jump
-label beforehand? If C<current_opcode> points to a label referenced
-already, we don't need the array at all. We can replace that entire mess
-above with this line:
+What if each opcode value was replaced with the value of the jump
+label beforehand? If C<current_opcode> points to a label pointer directly,
+we don't need to perform an additional dereference on the array at all. We
+can replace that entire mess above with this line:
 
   goto **(current_opcode += 1);
 
 That's far fewer machine instructions to execute before we can move to the
 next opcode, which means faster throughput. Remember that whatever dispatch
-mechanism is used will be called after every singly opcode, and some large
+mechanism is used will be called after every single opcode, and some large
 programs may have millions of opcodes! Every single machine instruction
 that can be cut out of the dispatch mechanism could increase the execution
-speed of Parrot in a significant and noticable way. The precomputed goto
-core, while not available on all compilers, takes the idea of optimization
-to the extreme.
+speed of Parrot in a significant and noticable way. N<The dispatch mechanism
+used by the various runcores is hardly the largest performance bottleneck in
+Parrot anyway, but we like to use faster cores to shave every little bit of
+speed out of the system>.
+
+The caveat of course is that the predereferenced computed goto core is only
+available with compilers that support computed goto, such as GCC. Parrot
+will not have access to this core if it is built with a different compiler.
 
 =item* Tracing Core
 
@@ -295,7 +306,7 @@
 
 When Parrot parses through the file and sees the C<Foo> operation, it
 converts it to the real name C<Foo_i_n>. The real name of an opcode
-is it's name followed by an underscore-separated ordered list of
+is its name followed by an underscore-separated ordered list of
 the parameters to that opcode. This is how Parrot appears to use
 polymorphism: It translates the overloaded opcode common names into
 longer unique names depending on the parameter list of that opcode. Here
@@ -311,7 +322,7 @@
 This isn't a complete list, but you should get the picture. Each different
 combination of parameters translates to a different unique operation, and
 each operation is remarkably simple to implement. In some cases, Parrot
-can even use it's multi-method dispatch system to call opcodes which are
+can even use its multi-method dispatch system to call opcodes which are
 heavily overloaded, or for which there is no exact fit but the parameters
 could be coerced into different types to complete the operation. For
 instance, attempting to add a STRING to a PMC might coerce the string into

Modified: branches/pdd22io_part3/docs/book/ch13_reference.pod
==============================================================================
--- branches/pdd22io_part3/docs/book/ch13_reference.pod	(original)
+++ branches/pdd22io_part3/docs/book/ch13_reference.pod	Mon Dec 29 23:28:53 2008
@@ -1771,7 +1771,7 @@
   open R<DEST>, R<FILENAME>
   open R<DEST>, R<FILENAME>, R<MODE>
 
-Open a file in the specified mode ("E<lt>", "E<gt>", etc.) and return
+Open a file in the specified mode ("r", "w", etc.) and return
 a filehandle. Without the mode it defaults to read/write.
 
 I<Arguments: P, S, S or P, S>

Modified: branches/pdd22io_part3/docs/glossary.pod
==============================================================================
--- branches/pdd22io_part3/docs/glossary.pod	(original)
+++ branches/pdd22io_part3/docs/glossary.pod	Mon Dec 29 23:28:53 2008
@@ -164,7 +164,7 @@
 International Components for Unicode
 
 ICU is a C and C++ library that provides support for Unicode on a variety of
-platforms.  It was distributed with parrot at one time, but current releases
+platforms. It was distributed with parrot at one time, but current releases
 require you to get your own copy.
 
 L<http://oss.software.ibm.com/icu/index.html>
@@ -233,13 +233,10 @@
 
 =item PIRC
 
-Acronym for PIR Compiler, a PIR compiler currently still in experimental
-phase. The purpose is to reimplement the PIR language, which is currently
-implemented by IMCC. There are two versions of PIRC: a handwritten, recursive-
-descent top-down compiler, written in C, and a version using a Bison and
-Flex grammar specification.
-
-Some day, either PIRC should be completed, or IMCC should be cleaned up.
+Acronym for PIR Compiler, a PIR compiler currently under development.
+The purpose is to reimplement the PIR language, which is currently
+implemented by IMCC. PIRC is written using a Bison and Flex grammar
+specification.
 
 =item PDD
 

Modified: branches/pdd22io_part3/docs/pdds/draft/pdd14_numbers.pod
==============================================================================
--- branches/pdd22io_part3/docs/pdds/draft/pdd14_numbers.pod	(original)
+++ branches/pdd22io_part3/docs/pdds/draft/pdd14_numbers.pod	Mon Dec 29 23:28:53 2008
@@ -28,7 +28,7 @@
 
 Integer data types have a dedicated register set. In PIR, the C<I> register
 variables (C<$I0>, etc.) and C<.param>s or C<.local>s declared with the C<int>
-type are native integers. Native unsigned integers are not accessibly directly
+type are native integers. Native unsigned integers are not accessible directly
 in PIR. Many opcodes or vtable functions are defined with variants that take
 native integer arguments. When passed to a subroutine or method call, a native
 integer may be autoboxed as an C<Integer> PMC, or as an HLL type mapped to

Modified: branches/pdd22io_part3/editor/indent_pir.vim
==============================================================================
--- branches/pdd22io_part3/editor/indent_pir.vim	(original)
+++ branches/pdd22io_part3/editor/indent_pir.vim	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,4 @@
-" Description:  imcc indenter
+" Description:  PIR indenter
 " Author:   Andrew Rodland <arodland@entermail.net>
 " Maintainer: Jimmy Zhuo <zhuomingliang@yahoo.com.cn>
 " Last Change: 2008 Dec 3

Modified: branches/pdd22io_part3/examples/io/httpd.pir
==============================================================================
--- branches/pdd22io_part3/examples/io/httpd.pir	(original)
+++ branches/pdd22io_part3/examples/io/httpd.pir	Mon Dec 29 23:28:53 2008
@@ -207,7 +207,7 @@
 SERVE_file:
     # try to open the file in url
     concat url, doc_root, url
-    fp = open url, "<"
+    fp = open url, 'r'
     unless fp goto SERVE_404
     len = stat url, .STAT_FILESIZE
     read file_content, fp, len

Modified: branches/pdd22io_part3/examples/library/ncurses_life.pir
==============================================================================
--- branches/pdd22io_part3/examples/library/ncurses_life.pir	(original)
+++ branches/pdd22io_part3/examples/library/ncurses_life.pir	Mon Dec 29 23:28:53 2008
@@ -579,7 +579,7 @@
     err  = "File not found " . file
 
     .local pmc io
-    open io, file, "<"
+    open io, file, 'r'
     $I0 = defined io
     unless $I0 goto nok
     null err

Modified: branches/pdd22io_part3/examples/pasm/xml_parser.pasm
==============================================================================
--- branches/pdd22io_part3/examples/pasm/xml_parser.pasm	(original)
+++ branches/pdd22io_part3/examples/pasm/xml_parser.pasm	Mon Dec 29 23:28:53 2008
@@ -371,7 +371,7 @@
 	# SMALL FILES ONLY.  SMALL.  SMALL.  SMALL.  Parrots I/O
 	# GC does not play nice with read().
 	set S10, ""
-	open P0, "examples/pasm/small.xml", "<"
+	open P0, "examples/pasm/small.xml", 'r'
 	if P0, READ
 	print "Couldn't open small.xml\n"
 	exit 1

Modified: branches/pdd22io_part3/examples/pir/io.pir
==============================================================================
--- branches/pdd22io_part3/examples/pir/io.pir	(original)
+++ branches/pdd22io_part3/examples/pir/io.pir	Mon Dec 29 23:28:53 2008
@@ -20,7 +20,7 @@
 .sub 'example' :main
     .local string test_fn
     test_fn = "tmp_example_io.tmp"
-    $P0 = open test_fn, ">"
+    $P0 = open test_fn, 'w'
     seek $P0, 300, 0
     # 64bit version of seek with high 32bits = 0
     #seek $IO, $P0, 0, 400, 0
@@ -32,7 +32,7 @@
     print $P0, "test5\n"
     close $P0
 
-    $P0 = open test_fn, "<"
+    $P0 = open test_fn, 'r'
     $S0 = read $P0, 1024
     print $S0
 

Modified: branches/pdd22io_part3/examples/pir/pirric.pir
==============================================================================
--- branches/pdd22io_part3/examples/pir/pirric.pir	(original)
+++ branches/pdd22io_part3/examples/pir/pirric.pir	Mon Dec 29 23:28:53 2008
@@ -2339,7 +2339,7 @@
 
     #say filename
 
-    open file, filename, '<'
+    open file, filename, 'r'
 
     linecount = 0
 nextline:
@@ -2377,7 +2377,7 @@
     .local pmc file
     .local pmc program
 
-    open file, filename, '>'
+    open file, filename, 'w'
 
     self.'list'(0, 0, file)
 

Modified: branches/pdd22io_part3/examples/pir/quine_ord.pir
==============================================================================
--- branches/pdd22io_part3/examples/pir/quine_ord.pir	(original)
+++ branches/pdd22io_part3/examples/pir/quine_ord.pir	Mon Dec 29 23:28:53 2008
@@ -1433,9 +1433,9 @@
 push code_as_data, 101
 push code_as_data, 44
 push code_as_data, 32
-push code_as_data, 34
-push code_as_data, 60
-push code_as_data, 34
+push code_as_data, 39
+push code_as_data, 114
+push code_as_data, 39
 push code_as_data, 10
 push code_as_data, 32
 push code_as_data, 32
@@ -3532,7 +3532,7 @@
     .local pmc code_fh
     .local int size
     size = stat program_name, .STAT_FILESIZE
-    code_fh = open program_name, "<"
+    code_fh = open program_name, 'r'
     .local string code
     code = read code_fh, size
 

Modified: branches/pdd22io_part3/examples/pir/sudoku.pir
==============================================================================
--- branches/pdd22io_part3/examples/pir/sudoku.pir	(original)
+++ branches/pdd22io_part3/examples/pir/sudoku.pir	Mon Dec 29 23:28:53 2008
@@ -237,7 +237,7 @@
     .local string line, result, c
     .local int i, len
     result = ""
-    io = open file_name, "<"
+    io = open file_name, 'r'
     $I0 = defined io
     unless $I0 goto err
 loop:

Modified: branches/pdd22io_part3/examples/pir/uniq.pir
==============================================================================
--- branches/pdd22io_part3/examples/pir/uniq.pir	(original)
+++ branches/pdd22io_part3/examples/pir/uniq.pir	Mon Dec 29 23:28:53 2008
@@ -84,7 +84,7 @@
 
   $I1 = 1 # count
   .local pmc in_fh
-  in_fh = open file_name, "<"
+  in_fh = open file_name, 'r'
   unless in_fh, ERR
   .local string prev_line, curr_line
   prev_line = readline in_fh

Modified: branches/pdd22io_part3/examples/streams/FileLines.pir
==============================================================================
--- branches/pdd22io_part3/examples/streams/FileLines.pir	(original)
+++ branches/pdd22io_part3/examples/streams/FileLines.pir	Mon Dec 29 23:28:53 2008
@@ -40,7 +40,7 @@
 
     # create a file stream
     file = new "Stream::ParrotIO"
-    file."open"( name, "<" )
+    file."open"( name, 'r' )
 
     # process it one line per read
     lines = new "Stream::Lines"

Modified: branches/pdd22io_part3/examples/streams/ParrotIO.pir
==============================================================================
--- branches/pdd22io_part3/examples/streams/ParrotIO.pir	(original)
+++ branches/pdd22io_part3/examples/streams/ParrotIO.pir	Mon Dec 29 23:28:53 2008
@@ -25,7 +25,7 @@
     stream = new "Stream::ParrotIO"
 
     # open this file
-    stream."open"( "examples/streams/ParrotIO.pir", "<" )
+    stream."open"( "examples/streams/ParrotIO.pir", 'r' )
 
     # you can specifiy a custom block size with
     # stream."blockSize"( 10 )

Modified: branches/pdd22io_part3/examples/tge/branch/transform.pir
==============================================================================
--- branches/pdd22io_part3/examples/tge/branch/transform.pir	(original)
+++ branches/pdd22io_part3/examples/tge/branch/transform.pir	Mon Dec 29 23:28:53 2008
@@ -108,7 +108,7 @@
   fromfile:
     # Read in the source file
     filename = argv[1]
-    filehandle = open filename, "<"
+    filehandle = open filename, 'r'
 
   grabline:
     $S1 = read filehandle, 65535

Modified: branches/pdd22io_part3/examples/tutorial/40_file_ops.pir
==============================================================================
--- branches/pdd22io_part3/examples/tutorial/40_file_ops.pir	(original)
+++ branches/pdd22io_part3/examples/tutorial/40_file_ops.pir	Mon Dec 29 23:28:53 2008
@@ -7,11 +7,11 @@
 .sub main :main
     .local pmc fileout, filein
 
-    fileout = open "40_file_ops_data.txt", ">"
+    fileout = open "40_file_ops_data.txt", 'w'
     print fileout, "The quick brown fox jumps over the lazy dog.\n"
     close fileout
 
-    filein = open "40_file_ops_data.txt", "<"
+    filein = open "40_file_ops_data.txt", 'r'
     $S0 = readline filein
     say $S0
     close filein

Modified: branches/pdd22io_part3/ext/SQLite3/gen_sqlite3.pl
==============================================================================
--- branches/pdd22io_part3/ext/SQLite3/gen_sqlite3.pl	(original)
+++ branches/pdd22io_part3/ext/SQLite3/gen_sqlite3.pl	Mon Dec 29 23:28:53 2008
@@ -15,7 +15,7 @@
 
 print preamble();
 
-for (parse_ast($fn).kv) -> $k,$v {
+for (parse_ast($fn).hash().kv) -> $k,$v {
     #dump_node($v);
     if ($v.WHAT eq "FuncDecl") {
         my @result = pir($v);

Modified: branches/pdd22io_part3/include/parrot/debugger.h
==============================================================================
--- branches/pdd22io_part3/include/parrot/debugger.h	(original)
+++ branches/pdd22io_part3/include/parrot/debugger.h	Mon Dec 29 23:28:53 2008
@@ -298,9 +298,7 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-void PDB_free_file(PARROT_INTERP, ARGIN_NULLOK(PDB_file_t *file))
-        __attribute__nonnull__(1);
-
+void PDB_free_file(SHIM_INTERP, ARGIN_NULLOK(PDB_file_t *file));
 void PDB_get_command(PARROT_INTERP)
         __attribute__nonnull__(1);
 

Modified: branches/pdd22io_part3/include/parrot/encoding.h
==============================================================================
--- branches/pdd22io_part3/include/parrot/encoding.h	(original)
+++ branches/pdd22io_part3/include/parrot/encoding.h	Mon Dec 29 23:28:53 2008
@@ -126,6 +126,7 @@
 
 PARROT_EXPORT
 PARROT_DOES_NOT_RETURN
+PARROT_CANNOT_RETURN_NULL
 const ENCODING * Parrot_load_encoding(PARROT_INTERP,
     ARGIN(const char *encodingname))
         __attribute__nonnull__(1)

Modified: branches/pdd22io_part3/include/parrot/exceptions.h
==============================================================================
--- branches/pdd22io_part3/include/parrot/exceptions.h	(original)
+++ branches/pdd22io_part3/include/parrot/exceptions.h	Mon Dec 29 23:28:53 2008
@@ -183,7 +183,7 @@
 PARROT_EXPORT
 PARROT_DOES_NOT_RETURN
 void Parrot_ex_throw_from_c_args(PARROT_INTERP,
-    ARGIN_NULLOK(void *ret_addr),
+    SHIM(void *ret_addr),
     int exitcode,
     ARGIN(const char *format),
     ...)
@@ -209,6 +209,11 @@
         __attribute__nonnull__(4);
 
 PARROT_DOES_NOT_RETURN
+void die_from_exception(PARROT_INTERP, ARGIN(PMC *exception))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_DOES_NOT_RETURN
 void do_panic(
     NULLOK_INTERP,
     ARGIN_NULLOK(const char *message),

Modified: branches/pdd22io_part3/include/parrot/hash.h
==============================================================================
--- branches/pdd22io_part3/include/parrot/hash.h	(original)
+++ branches/pdd22io_part3/include/parrot/hash.h	Mon Dec 29 23:28:53 2008
@@ -179,12 +179,14 @@
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
-void parrot_new_cstring_hash(SHIM_INTERP, ARGOUT(Hash **hptr))
+void parrot_new_cstring_hash(PARROT_INTERP, ARGOUT(Hash **hptr))
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*hptr);
 
 PARROT_EXPORT
-void parrot_new_hash(SHIM_INTERP, ARGOUT(Hash **hptr))
+void parrot_new_hash(PARROT_INTERP, ARGOUT(Hash **hptr))
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*hptr);
 
@@ -195,12 +197,14 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
-void parrot_new_pmc_hash(SHIM_INTERP, ARGOUT(PMC *container))
+void parrot_new_pmc_hash(PARROT_INTERP, ARGOUT(PMC *container))
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*container);
 
 PARROT_EXPORT
-void parrot_new_pointer_hash(SHIM_INTERP, ARGOUT(Hash **hptr))
+void parrot_new_pointer_hash(PARROT_INTERP, ARGOUT(Hash **hptr))
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*hptr);
 
@@ -228,8 +232,7 @@
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*hash);
 
-void parrot_new_hash_x(
-    PARROT_INTERP,
+void parrot_new_hash_x(PARROT_INTERP,
     ARGOUT(Hash **hptr),
     PARROT_DATA_TYPE val_type,
     Hash_key_type hkey_type,
@@ -241,8 +244,7 @@
         __attribute__nonnull__(6)
         FUNC_MODIFIES(*hptr);
 
-void parrot_new_pmc_hash_x(
-    PARROT_INTERP,
+void parrot_new_pmc_hash_x(PARROT_INTERP,
     ARGMOD(PMC *container),
     PARROT_DATA_TYPE val_type,
     Hash_key_type hkey_type,

Modified: branches/pdd22io_part3/include/parrot/multidispatch.h
==============================================================================
--- branches/pdd22io_part3/include/parrot/multidispatch.h	(original)
+++ branches/pdd22io_part3/include/parrot/multidispatch.h	Mon Dec 29 23:28:53 2008
@@ -59,18 +59,6 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-funcptr_t get_mmd_dispatch_type(PARROT_INTERP,
-    INTVAL func_nr,
-    INTVAL left_type,
-    INTVAL right_type,
-    ARGOUT(int *is_pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(5)
-        FUNC_MODIFIES(*is_pmc);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
 PMC* Parrot_build_sig_object_from_varargs(PARROT_INTERP,
     ARGIN(const char *sig),
     va_list args)
@@ -223,7 +211,7 @@
 PARROT_WARN_UNUSED_RESULT
 PMC * Parrot_mmd_sort_manhattan_by_sig_pmc(PARROT_INTERP,
     ARGIN(PMC *candidates),
-    ARGIN(PMC* invoke_sig))
+    ARGIN(PMC *invoke_sig))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);

Modified: branches/pdd22io_part3/include/parrot/register.h
==============================================================================
--- branches/pdd22io_part3/include/parrot/register.h	(original)
+++ branches/pdd22io_part3/include/parrot/register.h	Mon Dec 29 23:28:53 2008
@@ -110,10 +110,9 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 Parrot_Context * Parrot_push_context(PARROT_INTERP,
-    ARGMOD(INTVAL *n_regs_used))
+    ARGIN(const INTVAL *n_regs_used))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*n_regs_used);
+        __attribute__nonnull__(2);
 
 PARROT_EXPORT
 void Parrot_set_context_threshold(SHIM_INTERP, SHIM(Parrot_Context *ctx));
@@ -127,19 +126,17 @@
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 Parrot_Context * Parrot_alloc_context(PARROT_INTERP,
-    ARGMOD(INTVAL *number_regs_used),
+    ARGIN(const INTVAL *number_regs_used),
     ARGIN_NULLOK(Parrot_Context *old))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*number_regs_used);
+        __attribute__nonnull__(2);
 
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 Parrot_Context * Parrot_set_new_context(PARROT_INTERP,
-    ARGMOD(INTVAL *number_regs_used))
+    ARGIN(const INTVAL *number_regs_used))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*number_regs_used);
+        __attribute__nonnull__(2);
 
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/gc/register.c */

Modified: branches/pdd22io_part3/include/parrot/stacks.h
==============================================================================
--- branches/pdd22io_part3/include/parrot/stacks.h	(original)
+++ branches/pdd22io_part3/include/parrot/stacks.h	Mon Dec 29 23:28:53 2008
@@ -99,10 +99,9 @@
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
-Stack_Entry_t * stack_entry(PARROT_INTERP,
+Stack_Entry_t * stack_entry(SHIM_INTERP,
     ARGIN(Stack_Chunk_t *stack),
     INTVAL depth)
-        __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_EXPORT

Modified: branches/pdd22io_part3/include/parrot/string_funcs.h
==============================================================================
--- branches/pdd22io_part3/include/parrot/string_funcs.h	(original)
+++ branches/pdd22io_part3/include/parrot/string_funcs.h	Mon Dec 29 23:28:53 2008
@@ -474,9 +474,8 @@
 PARROT_EXPORT
 PARROT_MALLOC
 PARROT_CAN_RETURN_NULL
-char * string_to_cstring_nullable(PARROT_INTERP,
-    ARGIN_NULLOK(const STRING *s))
-        __attribute__nonnull__(1);
+char * string_to_cstring_nullable(SHIM_INTERP,
+    ARGIN_NULLOK(const STRING *s));
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
@@ -523,7 +522,6 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*tc);
 
-PARROT_INLINE
 void string_free(PARROT_INTERP, ARGIN(STRING *s))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);

Modified: branches/pdd22io_part3/languages/Zcode/z3main.pir
==============================================================================
--- branches/pdd22io_part3/languages/Zcode/z3main.pir	(original)
+++ branches/pdd22io_part3/languages/Zcode/z3main.pir	Mon Dec 29 23:28:53 2008
@@ -97,7 +97,7 @@
   setattribute self, "Zmachine\0file", pfile
   .include "stat.pasm"
   $I0 = stat file, .STAT_FILESIZE
-  io = open file, "<"
+  io = open file, 'r'
   $S0 = read io, $I0
   close io
   im = new 'String'

Modified: branches/pdd22io_part3/languages/befunge/load.pasm
==============================================================================
--- branches/pdd22io_part3/languages/befunge/load.pasm	(original)
+++ branches/pdd22io_part3/languages/befunge/load.pasm	Mon Dec 29 23:28:53 2008
@@ -8,7 +8,7 @@
 # ordinal values of the content of the file, 80x25.
 LOAD:
         restore S0              # Fetch the filename
-        open P0, S0, "<"
+        open P0, S0, 'r'
         set S1, ""              # S1 = accumulator
 
 # Read the file.

Modified: branches/pdd22io_part3/languages/bf/bf.pasm
==============================================================================
--- branches/pdd22io_part3/languages/bf/bf.pasm	(original)
+++ branches/pdd22io_part3/languages/bf/bf.pasm	Mon Dec 29 23:28:53 2008
@@ -23,7 +23,7 @@
   set I3, 1     # optimize switch
   set S0, P5[2]
 no_o:
-  open P1, S0, "<"
+  open P1, S0, 'r'
   defined I0, P1
   unless I0, usage
 SOURCE_LOOP:

Modified: branches/pdd22io_part3/languages/bf/bfc.pir
==============================================================================
--- branches/pdd22io_part3/languages/bf/bfc.pir	(original)
+++ branches/pdd22io_part3/languages/bf/bfc.pir	Mon Dec 29 23:28:53 2008
@@ -32,7 +32,7 @@
 
   # Read the file into S1
 SOURCE:
-  open $P1, filename, "<"
+  open $P1, filename, 'r'
   defined $I0, $P1
   if $I0, SOURCE_LOOP
   print filename

Modified: branches/pdd22io_part3/languages/bf/bfco.pir
==============================================================================
--- branches/pdd22io_part3/languages/bf/bfco.pir	(original)
+++ branches/pdd22io_part3/languages/bf/bfco.pir	Mon Dec 29 23:28:53 2008
@@ -36,7 +36,7 @@
 
   # Read the file into S1
 SOURCE:
-  open $P1, filename, "<"
+  open $P1, filename, 'r'
   defined $I0, $P1
   if $I0, SOURCE_LOOP
   print filename

Modified: branches/pdd22io_part3/languages/ecmascript/config/makefiles/root.in
==============================================================================
--- branches/pdd22io_part3/languages/ecmascript/config/makefiles/root.in	(original)
+++ branches/pdd22io_part3/languages/ecmascript/config/makefiles/root.in	Mon Dec 29 23:28:53 2008
@@ -133,7 +133,7 @@
 	@echo ""
 
 test: all
-	$(PERL) t/harness t
+	$(PERL) t/harness
 
 testclean:
 	$(RM_F) "t/*.js" "t/*.out"

Modified: branches/pdd22io_part3/languages/ecmascript/src/builtin/builtins.pir
==============================================================================
--- branches/pdd22io_part3/languages/ecmascript/src/builtin/builtins.pir	(original)
+++ branches/pdd22io_part3/languages/ecmascript/src/builtin/builtins.pir	Mon Dec 29 23:28:53 2008
@@ -120,6 +120,16 @@
 ## built-in operators
 ##
 
+.sub 'prefix:?' :multi(_)
+    .param pmc a
+    if a goto a_true
+    $P0 = get_hll_global ['JSBoolean'], 'false'
+    .return ($P0)
+  a_true:
+    $P0 = get_hll_global ['JSBoolean'], 'true'
+    .return ($P0)
+.end
+
 .sub 'infix:='
     .param pmc lhs
     .param pmc rhs
@@ -235,7 +245,7 @@
     .param pmc left
     .param pmc right
     iseq $I0, left, right
-    .return ($I0)
+    .tailcall 'prefix:?'($I0)
 .end
 
 

Modified: branches/pdd22io_part3/languages/ecmascript/src/classes/Boolean.pir
==============================================================================
--- branches/pdd22io_part3/languages/ecmascript/src/classes/Boolean.pir	(original)
+++ branches/pdd22io_part3/languages/ecmascript/src/classes/Boolean.pir	Mon Dec 29 23:28:53 2008
@@ -43,6 +43,13 @@
   .return ("false")
 .end
 
+.sub 'get_integer1' #:vtable
+  .param pmc self
+   $I0 = self
+  .return ($I0)
+.end
+
+
 .sub 'ACCEPTS' :method
     .param pmc topic
     .return (self)

Modified: branches/pdd22io_part3/languages/ecmascript/src/parser/actions.pm
==============================================================================
--- branches/pdd22io_part3/languages/ecmascript/src/parser/actions.pm	(original)
+++ branches/pdd22io_part3/languages/ecmascript/src/parser/actions.pm	Mon Dec 29 23:28:53 2008
@@ -650,21 +650,18 @@
 
 method true($/) {
     # XXX change this into type a ECMAScript type, 'Boolean' or whatever
-#    make PAST::Val.new( :returns('Integer'), :value('1'), :node($/) );
     make PAST::Var.new( :name(~$/), :namespace('JSBoolean'), :scope('package'), :node($/) );
-
 }
 
 method false($/) {
     # XXX change this into type 'Boolean' or whatever
-#    make PAST::Val.new( :returns('Integer'), :value('0'), :node($/) );
     make PAST::Var.new( :name(~$/), :namespace('JSBoolean'), :scope('package'), :node($/) );
 }
 
 method null($/) {
     # XXX would this work?
-    make PAST::Var.new( :name('null'), :scope('package'), :node($/) );
-#    make PAST::Var.new( :name(~$/), :namespace('Null'), :node($/) );
+    #make PAST::Var.new( :name('null'), :scope('package'), :node($/) );
+    make PAST::Var.new( :name('null'), :namespace('JSNull'), :scope('package'), :node($/) );
 }
 
 method object_literal($/) {

Modified: branches/pdd22io_part3/languages/ecmascript/t/harness
==============================================================================
--- branches/pdd22io_part3/languages/ecmascript/t/harness	(original)
+++ branches/pdd22io_part3/languages/ecmascript/t/harness	Mon Dec 29 23:28:53 2008
@@ -1,10 +1,168 @@
 #! perl
-
 # $Id$
 
-use FindBin;
-use lib qw( . lib ../lib ../../lib ../../lib );
-use Parrot::Test::Harness language => 'JS', compiler => 'js.pbc';
+=head1 NAME
+
+languages/ecmascript/t/harness - A harness for JS
+
+=head1 SYNOPSIS
+
+  cd languages && perl ecmascript/t/harness --files --master
+
+  cd languages/ecmascript && perl t/harness 
+
+  cd languages/ecmascript && perl t/harness --verbose t/hello.t 
+
+=head1 DESCRIPTION
+
+If I'm called with a single
+argument of "--files", I just return a list of files to process.
+This list is one per line, and is relative to the languages dir.
+
+If I'm called with no args, I run the complete suite.
+
+Otherwise I run the tests that were passed on the command line.
+
+=cut
+
+# pragmata
+use strict;
+use warnings;
+use FindBin ();
+use lib "$FindBin::Bin/../../../lib", "$FindBin::Bin/../lib";
+
+use Cwd                     ();
+use File::Spec              ();
+use TAP::Harness            3.12;     # support closures for the 'exec' option
+use TAP::Harness::Archive   0.12; 
+use Parrot::Config          qw( %PConfig );
+use Getopt::Long;
+use Parrot::Harness::Smoke;
+use Parrot::Test;
+
+my ( $files_flag, $master_flag, $send_to_smolder_flag, $archive_flag, $verbose_flag );
+my ( $js_flag, $pjs_flag);
+GetOptions(
+    'files'           => \$files_flag,
+    'master'          => \$master_flag,          # unused, but passed by languages/t/harness
+    'send-to-smolder' => \$send_to_smolder_flag,
+    'archive'         => \$archive_flag,
+    'verbose'         => \$verbose_flag,
+    'with-pjs'        => \$pjs_flag,
+    'with-js'         => \$js_flag,
+);
+
+my $hll = 'ecmascript';
+my $verbosity = $verbose_flag ? 1 : $ENV{HARNESS_VERBOSE};
+$verbosity ||= 0;
+
+if ( $files_flag ) {
+    # Only the Makefile in 'parrot/languages' uses --files for unified testing
+    my $dir = File::Spec->catfile( $hll, 't' );
+    # unified testing can't handle test scripts written in JS
+    my @files = grep { ! m!in_php|pmc|embed! } glob( File::Spec->catfile( $dir, '*/*.t' ) );
+    print join( "\n", @files );
+    print "\n" if scalar(@files);
+}
+else { 
+    my $path_to_parrot = Parrot::Test::path_to_parrot();
+    my @cmd = ( "$path_to_parrot/parrot$PConfig{exe}", "$path_to_parrot/languages/ecmascript/js.pbc" );
+    $ENV{PARROT_PIPP_TEST_MODULE} = 'Parrot::Test::JS::PJS';
+
+    if ( $js_flag ) { 
+         $ENV{PARROT_PIPP_TEST_MODULE} = 'Parrot::Test::JS::SpiderMonkey';
+         @cmd = qw{ js } ;
+    }
+    elsif ( $pjs_flag ) {
+        $ENV{PARROT_PIPP_TEST_MODULE} = 'Parrot::Test::JS::PJS';
+    }
+
+    my @files;
+    if ( scalar(@ARGV) ) {
+        # Someone specified tests for me to run.
+        @files = grep { -f $_ } @ARGV
+    }
+    else {
+        ( undef, undef, my $current_dir ) = File::Spec->splitpath( Cwd::getcwd() );
+        if ( $current_dir eq 'languages' ) {
+            @files = glob( File::Spec->catfile( $hll, 't', '*/*.t' ) );
+        }
+        elsif ( $current_dir eq $hll ) {
+            @files = glob( File::Spec->catfile( 't', '*/*.t' ) );
+            print glob( File::Spec->catfile( 't', '*.t' ) );
+            push @files, glob( File::Spec->catfile( 't', '*.t' ) );
+        }
+        else {
+            die "Where am I?";
+        }
+    }
+
+    my $exec_sub
+        = sub {
+              my ( $harness, $test_file ) = @_;
+
+              # the directory t/embed contains only PIR test files
+              return [ "$path_to_parrot/parrot$PConfig{exe}", $test_file ] if $test_file =~ m{t/embed/.*[.]t$};
+
+              # the directory t/pmc contains only PIR test files
+              return [ "$path_to_parrot/parrot$PConfig{exe}", $test_file ] if $test_file =~ m{t/pmc/.*[.]t$};
+
+              # the directory t/in_php contains only test scripts written in JS
+              return [ @cmd, $test_file ] if $test_file =~ m{t/sanity_js/.*[.]t$};
+              if ($test_file =~ m{^t/(?:[^/])*\.t$!}) {
+                print "$test_file\n";
+                return [ @cmd, $test_file ];
+              }
+
+
+              # all other directories contain test scripts written in Perl
+              return [ $PConfig{perl}, $test_file ];
+          };  
+    if ( $archive_flag ) { 
+        my %env_data = Parrot::Harness::Smoke::collect_test_environment_data();
+       
+        my $report_file = ['js_test_run.tar.gz'];
+        my $harness = TAP::Harness::Archive->new(
+            {
+                exec             => $exec_sub,
+                verbosity        => $verbosity,
+                archive          => $report_file->[0],
+                merge            => 1,
+                extra_properties => \%env_data,
+            }
+        );
+        $harness->runtests(@files);
+
+        if ( $send_to_smolder_flag ) {
+            $env_data{report_file} = $report_file;
+            $env_data{project_id}  = 10;
+            Parrot::Harness::Smoke::send_archive_to_smolder(%env_data);
+        }
+    } else {
+       my $harness = TAP::Harness->new(
+           {
+               exec       => $exec_sub,
+               verbosity  => $verbosity,
+           }
+       );
+        $harness->runtests(@files);
+    }
+}
+
+=head1 SEE ALSO
+
+  F<languages/perl6/t/harness>
+
+=head1 AUTHOR
+
+Bernhard Schmalhofer - <Bernhard.Schmalhofer@gmx.de>
+Kevin Tew - <tewk at tewk dot com>
+
+=cut
 
-# Set up PERL6LIB environment path so the "use" tests can find libraries
-# $ENV{PERL6LIB} = "$Bin/01-sanity";
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/pdd22io_part3/languages/lazy-k/lazy.pir
==============================================================================
--- branches/pdd22io_part3/languages/lazy-k/lazy.pir	(original)
+++ branches/pdd22io_part3/languages/lazy-k/lazy.pir	Mon Dec 29 23:28:53 2008
@@ -50,7 +50,7 @@
     goto run
 open_file:
     $S0 = argv[1]
-    in = open $S0, "<"
+    in = open $S0, 'r'
     $I0 = defined in
     if $I0 goto run
     printerr "can't open '"

Modified: branches/pdd22io_part3/languages/lua/lua.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/lua.pir	(original)
+++ branches/pdd22io_part3/languages/lua/lua.pir	Mon Dec 29 23:28:53 2008
@@ -523,10 +523,6 @@
 
 F<languages/lua/doc/status.pod>
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/luac.pl
==============================================================================
--- branches/pdd22io_part3/languages/lua/luac.pl	(original)
+++ branches/pdd22io_part3/languages/lua/luac.pl	Mon Dec 29 23:28:53 2008
@@ -82,9 +82,5 @@
 
 =head1 DESCRIPTION
 
-=head1 AUTHOR
-
-Francois Perrad
-
 =cut
 

Modified: branches/pdd22io_part3/languages/lua/luac2pir.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/luac2pir.pir	(original)
+++ branches/pdd22io_part3/languages/lua/luac2pir.pir	Mon Dec 29 23:28:53 2008
@@ -17,10 +17,6 @@
 
 luad
 
-=head1 AUTHOR
-
-Francois Perrad.
-
 =cut
 
 .loadlib 'lua_group'

Modified: branches/pdd22io_part3/languages/lua/luad.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/luad.pir	(original)
+++ branches/pdd22io_part3/languages/lua/luad.pir	Mon Dec 29 23:28:53 2008
@@ -17,10 +17,6 @@
 
 L<http://luaforge.net/projects/chunkspy/>
 
-=head1 AUTHOR
-
-Francois Perrad.
-
 =cut
 
 .loadlib 'lua_group'

Modified: branches/pdd22io_part3/languages/lua/luap.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/luap.pir	(original)
+++ branches/pdd22io_part3/languages/lua/luap.pir	Mon Dec 29 23:28:53 2008
@@ -29,13 +29,6 @@
 .end
 
 
-=head1 AUTHORS
-
-Francois Perrad
-
-=cut
-
-
 # Local Variables:
 #   mode: pir
 #   fill-column: 100

Modified: branches/pdd22io_part3/languages/lua/src/PASTGrammar.tg
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/PASTGrammar.tg	(original)
+++ branches/pdd22io_part3/languages/lua/src/PASTGrammar.tg	Mon Dec 29 23:28:53 2008
@@ -804,11 +804,3 @@
     .tailcall $P0.'new'('node'=>node, 'name'=>'LuaString', 'value'=>$S0)
 }
 
-=head1 AUTHORS
-
-Klaas-Jan Stol <parrotcode@gmail.com>
-
-Francois Perrad
-
-=cut
-

Modified: branches/pdd22io_part3/languages/lua/src/POSTGrammar.tg
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/POSTGrammar.tg	(original)
+++ branches/pdd22io_part3/languages/lua/src/POSTGrammar.tg	Mon Dec 29 23:28:53 2008
@@ -87,7 +87,7 @@
   L4:
     .local pmc start
     $P0 = get_hll_global ['Lua'; 'POST'], 'Sub'
-    start = $P0.'new'('name'=>'&start', 'pirflags'=>':anon :main')
+    start = $P0.'new'('name'=>'&start', 'pirflags'=>':anon :main', 'hll'=>'lua')
     $S0 = post.'subid'()
     start.'push_pirop'('inline', $S0, 'inline'=><<'PIRCODE')
     .param pmc args :optional
@@ -111,7 +111,6 @@
     $P0 = get_hll_global ['Lua'; 'POST'], 'Chunk'
     .tailcall $P0.'new'(start, 'node'=>node, 'prologue'=><<'PIRCODE')
 .include "interpinfo.pasm"
-.HLL "lua"
 .loadlib "lua_group"
 PIRCODE
 }
@@ -977,6 +976,9 @@
     ops.'push_pirop'('.local pmc', pname)
     ops.'push_pirop'('.lex', lname, pname, 'result'=>pname)
     storage_lex[name] = pname
+    ops.'push_pirop'('set', pname, 'node'=>node)
+    ops.'result'(pname)
+    .return (ops)
   L3:
     ops.'push_pirop'('store_lex', lname, 'node'=>node)
     ops.'result'(lname)
@@ -1061,10 +1063,3 @@
     .tailcall tree.'get'('package', node)
 }
 
-
-=head1 AUTHORS
-
-Francois Perrad
-
-=cut
-

Modified: branches/pdd22io_part3/languages/lua/src/dumplex.tg
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/dumplex.tg	(original)
+++ branches/pdd22io_part3/languages/lua/src/dumplex.tg	Mon Dec 29 23:28:53 2008
@@ -134,9 +134,5 @@
 
 =back
 
-=head1 AUTHOR
-
-Francois Perrad
-
 =cut
 

Modified: branches/pdd22io_part3/languages/lua/src/grammar51.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/grammar51.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/grammar51.pir	Mon Dec 29 23:28:53 2008
@@ -616,10 +616,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/_helpers.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/_helpers.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/_helpers.pir	Mon Dec 29 23:28:53 2008
@@ -54,10 +54,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/alarm.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/alarm.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/alarm.pir	Mon Dec 29 23:28:53 2008
@@ -85,10 +85,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/base64.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/base64.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/base64.pir	Mon Dec 29 23:28:53 2008
@@ -108,10 +108,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/bc.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/bc.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/bc.pir	Mon Dec 29 23:28:53 2008
@@ -426,10 +426,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/bit.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/bit.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/bit.pir	Mon Dec 29 23:28:53 2008
@@ -211,7 +211,6 @@
     $I1 = lua_checknumber(1, x)
     $I2 = lua_checknumber(2, n)
     band $I2, 31
-    neg $I2
     rot $I0, $I1, $I2, 32
     .BRET($I0)
 .end
@@ -223,6 +222,7 @@
     $I1 = lua_checknumber(1, x)
     $I2 = lua_checknumber(2, n)
     band $I2, 31
+    neg $I2
     rot $I0, $I1, $I2, 32
     .BRET($I0)
 .end
@@ -239,8 +239,8 @@
     .param pmc x :optional
     .param pmc extra :slurpy
     $I1 = lua_checknumber(1, x)
-    $I0 = $I1 >> 24
-    $I2 = $I1 >> 8
+    $I0 = $I1 >>> 24
+    $I2 = $I1 >>> 8
     $I2 &= 0x0000ff00
     $I0 |= $I2
     $I3 = $I1 & 0x0000ff00
@@ -254,10 +254,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/bitlib.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/bitlib.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/bitlib.pir	Mon Dec 29 23:28:53 2008
@@ -261,10 +261,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/complex.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/complex.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/complex.pir	Mon Dec 29 23:28:53 2008
@@ -147,7 +147,8 @@
     $P1 = get(1, z)
     $P2 = get(2, w)
     $P0 = add $P1, $P2
-    .tailcall newcomplex($P0)
+    $P0 = newcomplex($P0)
+    .return ($P0)
 .end
 
 
@@ -162,7 +163,8 @@
     $P1 = get(1, z)
     $P2 = get(2, w)
     $P0 = div $P1, $P2
-    .tailcall newcomplex($P0)
+    $P0 = newcomplex($P0)
+    .return ($P0)
 .end
 
 
@@ -194,7 +196,8 @@
     $P1 = get(1, z)
     $P2 = get(2, w)
     $P0 = mul $P1, $P2
-    .tailcall newcomplex($P0)
+    $P0 = newcomplex($P0)
+    .return ($P0)
 .end
 
 
@@ -209,7 +212,8 @@
     $P1 = get(1, z)
     $P2 = get(2, w)
     $P0 = sub $P1, $P2
-    .tailcall newcomplex($P0)
+    $P0 = newcomplex($P0)
+    .return ($P0)
 .end
 
 
@@ -562,10 +566,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/gl_binding.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/gl_binding.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/gl_binding.pir	Mon Dec 29 23:28:53 2008
@@ -809,10 +809,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/glut.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/glut.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/glut.pir	Mon Dec 29 23:28:53 2008
@@ -367,10 +367,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/lfs.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/lfs.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/lfs.pir	Mon Dec 29 23:28:53 2008
@@ -686,10 +686,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/lpeg.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/lpeg.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/lpeg.pir	Mon Dec 29 23:28:53 2008
@@ -1193,10 +1193,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/luaaux.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luaaux.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luaaux.pir	Mon Dec 29 23:28:53 2008
@@ -1071,10 +1071,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/luabasic.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luabasic.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luabasic.pir	Mon Dec 29 23:28:53 2008
@@ -933,10 +933,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad.
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/luabytecode.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luabytecode.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luabytecode.pir	Mon Dec 29 23:28:53 2008
@@ -507,12 +507,6 @@
 
 .include 'languages/lua/src/lib/luabytecode_gen.pir'
 
-=head1 AUTHOR
-
-Francois Perrad.
-
-=cut
-
 # Local Variables:
 #   mode: pir
 #   fill-column: 100

Modified: branches/pdd22io_part3/languages/lua/src/lib/luacoroutine.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luacoroutine.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luacoroutine.pir	Mon Dec 29 23:28:53 2008
@@ -261,12 +261,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad.
-
-Bob Rogers.
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/luadebug.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luadebug.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luadebug.pir	Mon Dec 29 23:28:53 2008
@@ -388,10 +388,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/luafile.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luafile.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luafile.pir	Mon Dec 29 23:28:53 2008
@@ -380,10 +380,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad.
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/luaio.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luaio.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luaio.pir	Mon Dec 29 23:28:53 2008
@@ -717,10 +717,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad.
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/luamath.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luamath.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luamath.pir	Mon Dec 29 23:28:53 2008
@@ -474,13 +474,6 @@
 .end
 
 
-=head1 AUTHORS
-
-Francois Perrad.
-
-=cut
-
-
 # Local Variables:
 #   mode: pir
 #   fill-column: 100

Modified: branches/pdd22io_part3/languages/lua/src/lib/luaos.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luaos.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luaos.pir	Mon Dec 29 23:28:53 2008
@@ -489,10 +489,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad.
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/luapackage.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luapackage.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luapackage.pir	Mon Dec 29 23:28:53 2008
@@ -562,10 +562,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/luaperl.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luaperl.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luaperl.pir	Mon Dec 29 23:28:53 2008
@@ -156,10 +156,6 @@
 
 =back
 
-=head1 AUTHOR
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/luaregex.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luaregex.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luaregex.pir	Mon Dec 29 23:28:53 2008
@@ -178,10 +178,6 @@
 
 Mostly taken from F<compilers/pge/PGE/P5Regex.pir>.
 
-=head1 AUTHOR
-
-Francois Perrad
-
 =cut
 
 .sub '__onload' :anon :load :init

Modified: branches/pdd22io_part3/languages/lua/src/lib/luastring.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luastring.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luastring.pir	Mon Dec 29 23:28:53 2008
@@ -998,10 +998,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/luatable.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/luatable.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/luatable.pir	Mon Dec 29 23:28:53 2008
@@ -506,10 +506,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/markdown.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/markdown.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/markdown.pir	Mon Dec 29 23:28:53 2008
@@ -70,10 +70,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/mathx.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/mathx.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/mathx.pir	Mon Dec 29 23:28:53 2008
@@ -611,10 +611,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/md5.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/md5.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/md5.pir	Mon Dec 29 23:28:53 2008
@@ -214,10 +214,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/random.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/random.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/random.pir	Mon Dec 29 23:28:53 2008
@@ -220,10 +220,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/struct.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/struct.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/struct.pir	Mon Dec 29 23:28:53 2008
@@ -508,10 +508,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lib/uuid.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lib/uuid.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lib/uuid.pir	Mon Dec 29 23:28:53 2008
@@ -146,10 +146,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lua51.pg
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lua51.pg	(original)
+++ branches/pdd22io_part3/languages/lua/src/lua51.pg	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2007, The Perl Foundation.
+# Copyright (C) 2006-2008, The Perl Foundation.
 # $Id$
 
 =head1 NAME
@@ -331,12 +331,3 @@
 
 proto 'infix:or'    is looser('infix:and')  is past('or')       { ... }
 
-
-=head1 AUTHORS
-
-Klaas-Jan Stol <parrotcode@gmail.com>
-
-Francois Perrad
-
-=cut
-

Modified: branches/pdd22io_part3/languages/lua/src/lua51.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lua51.pir	(original)
+++ branches/pdd22io_part3/languages/lua/src/lua51.pir	Mon Dec 29 23:28:53 2008
@@ -277,12 +277,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Klaas-Jan Stol <parrotcode@gmail.com>
-
-Francois Perrad
-
 =cut
 
 

Modified: branches/pdd22io_part3/languages/lua/src/lua51_testlex.pg
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/lua51_testlex.pg	(original)
+++ branches/pdd22io_part3/languages/lua/src/lua51_testlex.pg	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2007, The Perl Foundation.
+# Copyright (C) 2006-2008, The Perl Foundation.
 # $Id$
 
 =head1 NAME
@@ -92,9 +92,3 @@
     | \]
 }
 
-=head1 AUTHOR
-
-Francois Perrad
-
-=cut
-

Modified: branches/pdd22io_part3/languages/lua/src/pmc/lua.pmc
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/pmc/lua.pmc	(original)
+++ branches/pdd22io_part3/languages/lua/src/pmc/lua.pmc	Mon Dec 29 23:28:53 2008
@@ -377,10 +377,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 */

Modified: branches/pdd22io_part3/languages/lua/src/pmc/luaany.pmc
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/pmc/luaany.pmc	(original)
+++ branches/pdd22io_part3/languages/lua/src/pmc/luaany.pmc	Mon Dec 29 23:28:53 2008
@@ -655,10 +655,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad.
-
 =cut
 
 */

Modified: branches/pdd22io_part3/languages/lua/src/pmc/luaboolean.pmc
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/pmc/luaboolean.pmc	(original)
+++ branches/pdd22io_part3/languages/lua/src/pmc/luaboolean.pmc	Mon Dec 29 23:28:53 2008
@@ -251,12 +251,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad.
-
-Klaas-Jan Stol.
-
 =cut
 
 */

Modified: branches/pdd22io_part3/languages/lua/src/pmc/luabytecode.pmc
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/pmc/luabytecode.pmc	(original)
+++ branches/pdd22io_part3/languages/lua/src/pmc/luabytecode.pmc	Mon Dec 29 23:28:53 2008
@@ -395,10 +395,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 */

Modified: branches/pdd22io_part3/languages/lua/src/pmc/luafunction.pmc
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/pmc/luafunction.pmc	(original)
+++ branches/pdd22io_part3/languages/lua/src/pmc/luafunction.pmc	Mon Dec 29 23:28:53 2008
@@ -199,10 +199,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 */

Modified: branches/pdd22io_part3/languages/lua/src/pmc/luanil.pmc
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/pmc/luanil.pmc	(original)
+++ branches/pdd22io_part3/languages/lua/src/pmc/luanil.pmc	Mon Dec 29 23:28:53 2008
@@ -176,10 +176,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Original code by Klaas-Jan Stol.
-
 =cut
 
 */

Modified: branches/pdd22io_part3/languages/lua/src/pmc/luanumber.pmc
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/pmc/luanumber.pmc	(original)
+++ branches/pdd22io_part3/languages/lua/src/pmc/luanumber.pmc	Mon Dec 29 23:28:53 2008
@@ -1467,12 +1467,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad.
-
-Klaas-Jan Stol.
-
 =cut
 
 */

Modified: branches/pdd22io_part3/languages/lua/src/pmc/luastring.pmc
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/pmc/luastring.pmc	(original)
+++ branches/pdd22io_part3/languages/lua/src/pmc/luastring.pmc	Mon Dec 29 23:28:53 2008
@@ -1088,12 +1088,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad.
-
-Klaas-Jan Stol.
-
 =cut
 
 */

Modified: branches/pdd22io_part3/languages/lua/src/pmc/luatable.pmc
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/pmc/luatable.pmc	(original)
+++ branches/pdd22io_part3/languages/lua/src/pmc/luatable.pmc	Mon Dec 29 23:28:53 2008
@@ -832,12 +832,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
-Klaas-Jan Stol
-
 =cut
 
 */

Modified: branches/pdd22io_part3/languages/lua/src/pmc/luathread.pmc
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/pmc/luathread.pmc	(original)
+++ branches/pdd22io_part3/languages/lua/src/pmc/luathread.pmc	Mon Dec 29 23:28:53 2008
@@ -237,10 +237,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad
-
 =cut
 
 */

Modified: branches/pdd22io_part3/languages/lua/src/pmc/luauserdata.pmc
==============================================================================
--- branches/pdd22io_part3/languages/lua/src/pmc/luauserdata.pmc	(original)
+++ branches/pdd22io_part3/languages/lua/src/pmc/luauserdata.pmc	Mon Dec 29 23:28:53 2008
@@ -378,10 +378,6 @@
 
 =back
 
-=head1 AUTHORS
-
-Francois Perrad.
-
 =cut
 
 */

Modified: branches/pdd22io_part3/languages/lua/t/Parrot/Test/Lua.pm
==============================================================================
--- branches/pdd22io_part3/languages/lua/t/Parrot/Test/Lua.pm	(original)
+++ branches/pdd22io_part3/languages/lua/t/Parrot/Test/Lua.pm	Mon Dec 29 23:28:53 2008
@@ -140,10 +140,6 @@
 
 F<languages/tcl/lib/Parrot/Test/Tcl.pm>, F<languages/m4/lib/Parrot/Test/M4.pm>
 
-=head1 AUTHOR
-
-Francois Perrad
-
 =cut
 
 1;

Modified: branches/pdd22io_part3/languages/lua/t/Parrot/Test/Lua_lex.pm
==============================================================================
--- branches/pdd22io_part3/languages/lua/t/Parrot/Test/Lua_lex.pm	(original)
+++ branches/pdd22io_part3/languages/lua/t/Parrot/Test/Lua_lex.pm	Mon Dec 29 23:28:53 2008
@@ -90,10 +90,6 @@
 
 F<languages/lua/t/Parrot/Test/Lua.pm>
 
-=head1 AUTHOR
-
-Francois Perrad
-
 =cut
 
 1;

Modified: branches/pdd22io_part3/languages/lua/t/Parrot/Test/Luad.pm
==============================================================================
--- branches/pdd22io_part3/languages/lua/t/Parrot/Test/Luad.pm	(original)
+++ branches/pdd22io_part3/languages/lua/t/Parrot/Test/Luad.pm	Mon Dec 29 23:28:53 2008
@@ -92,10 +92,6 @@
 
 F<languages/lua/t/Parrot/Test/Lua.pm>
 
-=head1 AUTHOR
-
-Francois Perrad
-
 =cut
 
 1;

Modified: branches/pdd22io_part3/languages/lua/t/bit.t
==============================================================================
--- branches/pdd22io_part3/languages/lua/t/bit.t	(original)
+++ branches/pdd22io_part3/languages/lua/t/bit.t	Mon Dec 29 23:28:53 2008
@@ -32,7 +32,7 @@
     plan skip_all => "parrot only";
 }
 else {
-    plan tests => 6;
+    plan tests => 8;
 }
 
 language_output_is( 'lua', << 'CODE', << "OUTPUT", 'require' );
@@ -69,9 +69,24 @@
 language_output_is( 'lua', << 'CODE', << "OUTPUT", 'bit.bswap' );
 m = require "bit"
 assert(bit.bswap(0x12345678) == 0x78563412)
+assert(bit.bswap(0x9ABCDEF0) == 0xF0DEBC9A)
 CODE
 OUTPUT
 
+my $code;
+
+$code = Parrot::Test::slurp_file( "$FindBin::Bin/bit/bittest.lua" );
+$code .= "\nprint 'ok'\n";
+language_output_is( 'lua', $code, << "OUTPUT", 'bittest' );
+ok
+OUTPUT
+
+$code = Parrot::Test::slurp_file( "$FindBin::Bin/bit/nsievebits.lua" );
+$code .= "\nprint 'ok'\n";
+language_output_is( 'lua', $code, << "OUTPUT", 'nsievebits' );
+ok
+OUTPUT
+
 
 # Local Variables:
 #   mode: cperl

Modified: branches/pdd22io_part3/languages/lua/t/harness
==============================================================================
--- branches/pdd22io_part3/languages/lua/t/harness	(original)
+++ branches/pdd22io_part3/languages/lua/t/harness	Mon Dec 29 23:28:53 2008
@@ -177,10 +177,6 @@
 
 F<languages/scheme/t/harness>, F<languages/m4/t/harness>, F<languages/python/t/harness>
 
-=head1 AUTHOR
-
-Francois Perrad
-
 =cut
 
 # Local Variables:

Modified: branches/pdd22io_part3/languages/lua/t/io.t
==============================================================================
--- branches/pdd22io_part3/languages/lua/t/io.t	(original)
+++ branches/pdd22io_part3/languages/lua/t/io.t	Mon Dec 29 23:28:53 2008
@@ -184,7 +184,7 @@
 DATA
 close $Y;
 
-language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'io:read *number', params => '< number.txt', todo => 'can\'t peek stdin, see RT #61290');
+language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'io:read *number', params => '< number.txt' );
 while true do
     local n1, n2, n3 = io.read("*number", "*number", "*number")
     if not n1 then break end

Modified: branches/pdd22io_part3/languages/lua/t/shootout.t
==============================================================================
--- branches/pdd22io_part3/languages/lua/t/shootout.t	(original)
+++ branches/pdd22io_part3/languages/lua/t/shootout.t	Mon Dec 29 23:28:53 2008
@@ -59,14 +59,9 @@
 #       Generate and write random DNA sequences
 #
 
-TODO:
-{
-    local $TODO = 'broken';
-
 $code = Parrot::Test::slurp_file( "$FindBin::Bin/shootout/fasta_lua-2.lua" );
 $out = Parrot::Test::slurp_file( "$FindBin::Bin/shootout/fasta-output.txt" );
 language_output_is( 'lua', $code, $out, 'fasta', params => '1000' );
-}
 
 #
 #   pidigits
@@ -111,14 +106,9 @@
 #       Indexed-access to bit-values
 #
 
-TODO:
-{
-    local $TODO = 'broken';
-
 $code = Parrot::Test::slurp_file( "$FindBin::Bin/shootout/nsievebits.lua" );
 $out = Parrot::Test::slurp_file( "$FindBin::Bin/shootout/nsievebits-output.txt" );
 language_output_is( 'lua', $code, $out, 'nsieve-bits' );
-}
 
 #
 #   recursive
@@ -171,9 +161,9 @@
 #       Eigenvalue using the power method
 #
 
-TODO:
+SKIP:
 {
-    local $TODO = 'broken';
+    skip('low memory', 1) unless ($test_prog eq 'lua');
 
 $code = Parrot::Test::slurp_file( "$FindBin::Bin/shootout/spectralnorm_lua-3.lua" );
 $out = Parrot::Test::slurp_file( "$FindBin::Bin/shootout/spectralnorm-output.txt" );
@@ -185,14 +175,9 @@
 #       Symmetrical thread rendez-vous requests
 #
 
-TODO:
-{
-    local $TODO = 'broken';
-
 $code = Parrot::Test::slurp_file( "$FindBin::Bin/shootout/chameneos.lua" );
 $out = Parrot::Test::slurp_file( "$FindBin::Bin/shootout/chameneos-output.txt" );
 language_output_is( 'lua', $code, $out, 'chameneos', params => '100' );
-}
 
 #
 #   reverse-complement

Modified: branches/pdd22io_part3/languages/lua/test_lex.pir
==============================================================================
--- branches/pdd22io_part3/languages/lua/test_lex.pir	(original)
+++ branches/pdd22io_part3/languages/lua/test_lex.pir	Mon Dec 29 23:28:53 2008
@@ -92,12 +92,6 @@
     .return ()
 .end
 
-=head1 AUTHOR
-
-Francois Perrad
-
-=cut
-
 
 # Local Variables:
 #   mode: pir

Modified: branches/pdd22io_part3/languages/m4/src/freeze.pir
==============================================================================
--- branches/pdd22io_part3/languages/m4/src/freeze.pir	(original)
+++ branches/pdd22io_part3/languages/m4/src/freeze.pir	Mon Dec 29 23:28:53 2008
@@ -40,7 +40,7 @@
   .local string    text
 
   .local pmc frozen_fh
-  frozen_fh = open frozen_file, ">"
+  frozen_fh = open frozen_file, 'w'
   .local pmc iterator
   iterator = new 'Iterator', symtab
   iterator = .ITERATE_FROM_START
@@ -86,7 +86,7 @@
   .local string content
   # TODO: M4PATH
   .local pmc frozen_fh
-  frozen_fh = open frozen_file, "<"
+  frozen_fh = open frozen_file, 'r'
   if frozen_fh goto READ_CONTENT
     printerr "'"
     printerr frozen_file

Modified: branches/pdd22io_part3/languages/perl6/build/gen_junction_pir.pl
==============================================================================
--- branches/pdd22io_part3/languages/perl6/build/gen_junction_pir.pl	(original)
+++ branches/pdd22io_part3/languages/perl6/build/gen_junction_pir.pl	Mon Dec 29 23:28:53 2008
@@ -11,6 +11,7 @@
   infix:+ infix:-
   infix:== infix:!= infix:<  infix:>  infix:<= infix:>=
   infix:eq infix:ne infix:lt infix:gt infix:le infix:ge
+  infix:<=> infix:leg infix:cmp infix:eqv infix:=:=
 );
 
 my @unary = qw(

Modified: branches/pdd22io_part3/languages/perl6/docs/spectest-progress.csv
==============================================================================
--- branches/pdd22io_part3/languages/perl6/docs/spectest-progress.csv	(original)
+++ branches/pdd22io_part3/languages/perl6/docs/spectest-progress.csv	Mon Dec 29 23:28:53 2008
@@ -216,3 +216,8 @@
 "2008-12-22 00:00",34232,5790,0,304,1393,7487,9578,261
 "2008-12-23 00:00",34267,5833,0,319,1435,7587,9742,264
 "2008-12-24 00:00",34313,5837,0,316,1434,7587,9742,264
+"2008-12-25 00:00",34346,5840,1,316,1431,7588,9744,264
+"2008-12-26 00:00",34364,5880,1,326,1404,7611,9851,264
+"2008-12-27 00:00",34407,5905,0,327,1379,7611,9851,264
+"2008-12-28 00:00",34465,5913,0,324,1375,7612,9863,264
+"2008-12-29 00:00",34549,5802,141,324,1345,7612,9863,264

Modified: branches/pdd22io_part3/languages/perl6/src/builtins/assign.pir
==============================================================================
--- branches/pdd22io_part3/languages/perl6/src/builtins/assign.pir	(original)
+++ branches/pdd22io_part3/languages/perl6/src/builtins/assign.pir	Mon Dec 29 23:28:53 2008
@@ -2,7 +2,7 @@
 
 =head1 NAME
 
-src/builtins/inplace.pir - Inplace assignments
+src/builtins/assign.pir - assignments
 
 =head1 Functions
 

Modified: branches/pdd22io_part3/languages/perl6/src/builtins/cmp.pir
==============================================================================
--- branches/pdd22io_part3/languages/perl6/src/builtins/cmp.pir	(original)
+++ branches/pdd22io_part3/languages/perl6/src/builtins/cmp.pir	Mon Dec 29 23:28:53 2008
@@ -150,7 +150,7 @@
 .end
 
 
-.sub 'infix:leg'
+.sub 'infix:leg' :multi(_,_)
     .param string a
     .param string b
     $I0 = cmp a, b

Modified: branches/pdd22io_part3/languages/perl6/src/builtins/io.pir
==============================================================================
--- branches/pdd22io_part3/languages/perl6/src/builtins/io.pir	(original)
+++ branches/pdd22io_part3/languages/perl6/src/builtins/io.pir	Mon Dec 29 23:28:53 2008
@@ -64,13 +64,13 @@
     if w goto is_write
     if a goto is_append
 is_read:
-    mode = "<"
+    mode = "r"
     goto done_mode
 is_write:
-    mode = ">"
+    mode = "w"
     goto done_mode
 is_append:
-    mode = ">>"
+    mode = "wa"
     goto done_mode
 done_mode:
 

Modified: branches/pdd22io_part3/languages/perl6/src/builtins/match.pir
==============================================================================
--- branches/pdd22io_part3/languages/perl6/src/builtins/match.pir	(original)
+++ branches/pdd22io_part3/languages/perl6/src/builtins/match.pir	Mon Dec 29 23:28:53 2008
@@ -12,7 +12,7 @@
 
 .namespace []
 
-.sub 'infix:~~'
+.sub 'infix:~~' :multi()
     .param pmc topic
     .param pmc x
     .tailcall x.'ACCEPTS'(topic)

Modified: branches/pdd22io_part3/languages/perl6/src/classes/Junction.pir
==============================================================================
--- branches/pdd22io_part3/languages/perl6/src/classes/Junction.pir	(original)
+++ branches/pdd22io_part3/languages/perl6/src/classes/Junction.pir	Mon Dec 29 23:28:53 2008
@@ -349,6 +349,16 @@
     .tailcall '!MAKE_JUNCTION'(JUNCTION_TYPE_NONE, args)
 .end
 
+=item infix:<~~>
+
+=cut
+
+.sub 'infix:~~' :multi('Junction', _)
+    .param pmc topic
+    .param pmc x
+    .tailcall '!DISPATCH_JUNCTION'('infix:~~', topic, x)
+.end
+
 
 =back
 

Modified: branches/pdd22io_part3/languages/perl6/src/classes/Range.pir
==============================================================================
--- branches/pdd22io_part3/languages/perl6/src/classes/Range.pir	(original)
+++ branches/pdd22io_part3/languages/perl6/src/classes/Range.pir	Mon Dec 29 23:28:53 2008
@@ -202,6 +202,21 @@
 .end
 
 
+=item reverse()
+
+Generate the range in reverse sequence.  (This is wrong for now--
+really what should happen is that we invert .from and .to and
+switch the :by argument.)
+
+=cut
+
+.namespace ['Range']
+.sub 'reverse' :method
+    $P0 = self.'list'()
+    .tailcall $P0.'reverse'()
+.end
+
+
 =item shift()   (vtable_method)
 
 Generate the next element at the front of the Range.

Modified: branches/pdd22io_part3/languages/perl6/src/parser/grammar.pg
==============================================================================
--- branches/pdd22io_part3/languages/perl6/src/parser/grammar.pg	(original)
+++ branches/pdd22io_part3/languages/perl6/src/parser/grammar.pg	Mon Dec 29 23:28:53 2008
@@ -155,9 +155,7 @@
 ##  closing brace is the last non-ws thing on the line.
 
 token block {
-    '{'
-    <statement_block>
-    [ '}' || <panic: Missing '}'> ]
+    '{' ~ '}' <statement_block>
     <.BLOCK_STATEMENT_END>?
     {*}
 }
@@ -425,13 +423,12 @@
         $P0 = 1
         set_global [ 'Perl6' ; 'Grammar' ; 'Actions' ], '$?SIG_BLOCK_NOT_NEEDED', $P0
     }}
-    <signature>
+    ~ ')' <signature>
     {{
         $P0 = new 'Integer'
         $P0 = 0
         set_global [ 'Perl6' ; 'Grammar' ; 'Actions' ], '$?SIG_BLOCK_NOT_NEEDED', $P0
     }}
-    [ ')' || <.panic: "Missing right parenthesis in signature"> ]
     {*}
 }
 
@@ -659,13 +656,12 @@
           $P0 = 1
           set_global [ 'Perl6' ; 'Grammar' ; 'Actions' ], '$?SIG_BLOCK_NOT_NEEDED', $P0
       }}
-      <signature>
+      ~ ')' <signature>
       {{
           $P0 = new 'Integer'
           $P0 = 0
           set_global [ 'Perl6' ; 'Grammar' ; 'Actions' ], '$?SIG_BLOCK_NOT_NEEDED', $P0
       }}
-      [ ')' || <.panic: "Missing right parenthsesis after signature"> ]
     ]
     {*}
 }
@@ -902,3 +898,10 @@
 proto 'term:' is precedence('z=')
     is parsed(&expect_term)
     { ... }
+
+proto 'term:->' is equiv(term:)
+    is parsed(&expect_term)
+    is skipkey(0)
+    { ... }
+
+proto 'close:<->' is equiv(term:) { ... }

Modified: branches/pdd22io_part3/languages/pipp/CREDITS
==============================================================================
--- branches/pdd22io_part3/languages/pipp/CREDITS	(original)
+++ branches/pdd22io_part3/languages/pipp/CREDITS	Mon Dec 29 23:28:53 2008
@@ -1,7 +1,8 @@
 # $Id$
 
-List of people who have contributes to Pipp.
+List of people who have contributed to Pipp.
 ----------
+
 N: Paul Cochrane
 E: paultcochrane@gmail.com
 D: Coding standards
@@ -17,6 +18,7 @@
 
 N: Bernhard Schmalhofer
 E: Bernhard.Schmalhofer@gmx.de
+U: bernhard
 D: Maintainer
 
 N: Jimmy Zhuo
@@ -29,3 +31,16 @@
 E: keane.dp@gmail.com
 D: Implementation of 'elsif'
 D: Implementation of 'do-while'
+D: Implementation of 'array()'
+
+N: François Perrad
+E: francois.perrad@gadz.org
+W: http://fperrad.googlepages.com/home
+U: fperrad
+D: stub generator for extensions
+D: implementation of many functions
+
+N: Christoph Otto
+E: christoph@mksig.org
+U: cotto
+D: Implementation of PhpArray

Modified: branches/pdd22io_part3/languages/pipp/src/common/builtins.pir
==============================================================================
--- branches/pdd22io_part3/languages/pipp/src/common/builtins.pir	(original)
+++ branches/pdd22io_part3/languages/pipp/src/common/builtins.pir	Mon Dec 29 23:28:53 2008
@@ -71,7 +71,7 @@
 
 ## symbolic unary
 .sub 'prefix:-' :multi(_)
-    .param num a
+    .param pmc a
 
     neg a
 
@@ -310,6 +310,14 @@
     .RETURN_BOOL($I0)
 .end
 
+.sub 'infix:=>'
+    .param pmc key
+    .param pmc value
+    $P0 = new 'ResizablePMCArray'
+    $P0[0] = key
+    $P0[1] = value
+    .return($P0)
+.end
 
 .include 'languages/pipp/src/common/php_standard.pir'
 

Modified: branches/pdd22io_part3/languages/pipp/src/common/php_array.pir
==============================================================================
--- branches/pdd22io_part3/languages/pipp/src/common/php_array.pir	(original)
+++ branches/pdd22io_part3/languages/pipp/src/common/php_array.pir	Mon Dec 29 23:28:53 2008
@@ -61,6 +61,38 @@
     .REGISTER_LONG_CONSTANT(cst, 'COUNT_RECURSIVE', COUNT_RECURSIVE)
 .end
 
+=item C<array array([mixed $...])>
+
+Creates an array
+
+=cut
+
+.sub 'array'
+    .param pmc args :slurpy
+    .local pmc array, iter
+    array = new 'PhpArray'
+    iter = new 'Iterator', args
+    $I1 = 0
+    args_loop:
+        unless iter goto args_end
+        $P0 = shift iter
+        $I0 = isa $P0, 'ResizablePMCArray'
+        unless $I0 goto add_var
+        $P1 = $P0[0]
+        $P2 = $P0[1]
+        array[$P1] = $P2
+        goto args_loop
+    add_var:
+        array[$I1] = $P0
+        inc $I1
+        goto end
+    end:
+        goto args_loop
+    args_end:
+    .return(array)
+.end
+
+
 =item C<array array_change_key_case(array input [, int case=CASE_LOWER])>
 
 Retuns an array with all string keys lowercased [or uppercased]
@@ -173,12 +205,34 @@
 
 Create an array containing num elements starting with index start_key each initialized to val
 
-NOT IMPLEMENTED.
-
 =cut
 
 .sub 'array_fill'
-    not_implemented()
+    .param pmc args :slurpy
+    .local pmc array, index, value
+    .local int count
+    array = new 'PhpArray'
+    ($I0, index, count, value) = parse_parameters('llz', args :flat)
+    unless $I0 goto L4
+    unless count >= 0 goto L3
+    #set start index then continue from 0
+    unless index < 0 goto L1
+    array[index] = value
+    index = 0
+    $I0 = 1
+    goto L2
+  L1:
+    $I0 = 0
+  L2:
+    inc $I0
+    unless $I0 <= count goto L4
+    array[index] = value
+    inc index
+    goto L2
+  L3:
+    error(E_WARNING, "Warning: array_fill(): Number of elements must be positive")
+  L4:
+    .return(array)
 .end
 
 =item C<array array_fill_keys(array keys, mixed val)>

Modified: branches/pdd22io_part3/languages/pipp/src/common/php_file.pir
==============================================================================
--- branches/pdd22io_part3/languages/pipp/src/common/php_file.pir	(original)
+++ branches/pdd22io_part3/languages/pipp/src/common/php_file.pir	Mon Dec 29 23:28:53 2008
@@ -315,6 +315,7 @@
 
 .sub 'fopen'
     .param pmc args :slurpy
+
     .local string filename
     .local string mode
     .local int use_include_path
@@ -342,33 +343,10 @@
 .sub '_getmode' :anon
     .param string mode
     .local string res
-    unless mode == 'r' goto L1
-    res = '<'
-    goto L9
-  L1:
-    unless mode == 'w' goto L2
-    res = '>'
-    goto L9
-  L2:
-    unless mode == 'a' goto L3
-    res = '>>'
-    goto L9
-  L3:
-    unless mode == 'r+' goto L4
-    res = '+<'
-    goto L9
-  L4:
-    unless mode == 'w+' goto L5
-    res = '+>'
-    goto L9
-  L5:
-    unless mode == 'a+' goto L6
-    res = '+>>'
-    goto L9
-  L6:
-    res = ''
-  L9:
-    .return (res)
+
+    # TODO: check which Parrot modes differ from the PHP modes
+  NO_CHANGE:
+    .return (mode)
 .end
 
 =item C<int fpassthru(resource fp)>
@@ -574,7 +552,7 @@
     unless use_include_path goto L2
     $I0 |= USE_PATH
   L2:
-    stream = stream_open(filename, '<', $I0, context)
+    stream = stream_open(filename, 'r', $I0, context)
     unless stream goto L3
     $I0 = stream_passthru(stream)
     close stream

Modified: branches/pdd22io_part3/languages/pipp/src/pct/actions.pm
==============================================================================
--- branches/pdd22io_part3/languages/pipp/src/pct/actions.pm	(original)
+++ branches/pdd22io_part3/languages/pipp/src/pct/actions.pm	Mon Dec 29 23:28:53 2008
@@ -21,38 +21,37 @@
 
 method TOP($/, $key) {
     our @?BLOCK; # A stack of PAST::Block
-    our $?BLOCK; # The current block. Used for managing the symbol table. 
    
     if $key eq 'open' {
-        $?BLOCK := PAST::Block.new(
-                       :node($/),
-                       :hll('pipp')
-                   );
+        my $block := PAST::Block.new(
+                         :node($/),
+                         :hll('pipp')
+                     );
         
         # set up scope 'package' for the superglobals
         # TODO: use a loop
-        $?BLOCK.symbol_defaults( :scope('lexical') );
-        $?BLOCK.symbol( :scope('package'), '$_GET' );
-        $?BLOCK.symbol( :scope('package'), '$_POST' );
-        $?BLOCK.symbol( :scope('package'), '$_SERVER' );
-        $?BLOCK.symbol( :scope('package'), '$_GLOBALS' );
-        $?BLOCK.symbol( :scope('package'), '$_FILES' );
-        $?BLOCK.symbol( :scope('package'), '$_COOKIE' );
-        $?BLOCK.symbol( :scope('package'), '$_SESSION' );
-        $?BLOCK.symbol( :scope('package'), '$_REQUEST' );
-        $?BLOCK.symbol( :scope('package'), '$_ENV' );
-        @?BLOCK.unshift($?BLOCK);
+        $block.symbol_defaults( :scope('lexical') );
+        $block.symbol( :scope('package'), '$_GET' );
+        $block.symbol( :scope('package'), '$_POST' );
+        $block.symbol( :scope('package'), '$_SERVER' );
+        $block.symbol( :scope('package'), '$_GLOBALS' );
+        $block.symbol( :scope('package'), '$_FILES' );
+        $block.symbol( :scope('package'), '$_COOKIE' );
+        $block.symbol( :scope('package'), '$_SESSION' );
+        $block.symbol( :scope('package'), '$_REQUEST' );
+        $block.symbol( :scope('package'), '$_ENV' );
+        @?BLOCK.unshift($block);
     }
     else {
         # retrieve the block created in the "if" section in this method.
-        my $past := @?BLOCK.shift();
+        my $block := @?BLOCK.shift();
 
         # a PHP script consists of a list of statements
         for $<sea_or_code> {
-            $past.push( $($_) );
+            $block.push( $($_) );
         }
 
-        make $past;
+        make $block;
     }
 }
 
@@ -63,58 +62,45 @@
 # The sea, text, surrounding the island, code, is printed out
 method SEA($/) {
     make PAST::Op.new(
+             :name('echo'),
+             :node($/),
              PAST::Val.new(
                  :value(~$/),
                  :returns('PhpString')
-             ),
-             :name('echo'),
-             :node($/)
+             )
          );
 }
 
 method code_short_tag($/) {
-    my $past := PAST::Stmts.new( :node($/) );
-    for $<statement> {
-        $past.push( $($_) );
-    }
-
-    make $past;
+    make $( $<statement_list> );
 }
 
 method code_echo_tag($/) {
-    my $past := PAST::Stmts.new( :node($/) );
+    my $stmts := $( $<statement_list> );
 
-    my $echo := $( $<arguments> );
+    my $echo := $( $<argument_list> );
     $echo.name( 'echo' );
-    $past.push( $echo );
 
-    for $<statement> {
-        $past.push( $($_) );
-    }
+    $stmts.unshift( $echo );
 
-    make $past;
+    make $stmts;
 }
 
 method code_script_tag($/) {
-    my $past := PAST::Stmts.new( :node($/) );
-    for $<statement> {
-        $past.push( $($_) );
-    }
+    make $( $<statement_list> );
+}
 
-    make $past;
+method statement($/, $key) {
+    make $( $/{$key} );
 }
 
-method block($/) {
-    my $past := PAST::Stmts.new( :node($/) );
+method statement_list($/) {
+    my $stmts := PAST::Stmts.new( :node($/) );
     for $<statement> {
-        $past.push( $($_) );
+        $stmts.push( $($_) );
     }
 
-    make $past;
-}
-
-method statement($/, $key) {
-    make $( $/{$key} );
+    make $stmts;
 }
 
 method inline_sea_short_tag($/) {
@@ -165,7 +151,7 @@
 }
 
 method echo_statement($/) {
-    my $past := $( $<arguments> );
+    my $past := $( $<argument_list> );
     $past.name( 'echo' );
 
     make $past;
@@ -175,37 +161,71 @@
     make $( $<expression> );
 }
 
+method closure_call($/) {
+    my $past := $( $<argument_list> );
+    $past.unshift( $( $<var> ) );
+
+    make $past;
+}
+
 method function_call($/) {
-    my $past := $( $<arguments> );
+    my $past := $( $<argument_list> );
     $past.name( ~$<FUNCTION_NAME> );
 
     make $past;
 }
 
-method method_call($/) {
+method instantiate_array($/) {
     my $past := PAST::Op.new(
-                    :name( ~$<METHOD_NAME> ),
-                    :pasttype( 'callmethod' ),
-                    :name( ~$<METHOD_NAME> ),
-                    $( $<var> )
+                    :pasttype( 'call' ),
+                    :name( 'array' ),
+                    :node( $/ )
                 );
+  
+    for $<array_argument> {
+        $past.push( $($_) );
+    }   
 
     make $past;
 }
 
-method constructor_call($/) {
-    my $past := PAST::Op.new(
-                    :name( 'new' ),
-                    :pasttype( 'callmethod' ),
-                    PAST::Var.new(
-                        :name( ~$<CLASS_NAME> ),
-                        :scope( 'package' ),
-                    )
-                );
+method array_argument($/, $key) {
+    make $( $/{$key} );
+}
+
+method key_value_pair($/) { 
+   make 
+       PAST::Op.new(
+           :node( $/ ),
+           :pasttype( 'call' ),
+           :name( 'infix:=>' ),
+           :returns( 'Array' ),
+           $( $<key> ),
+           $( $<value> )
+       );
+}
+
+method method_call($/) {
+    my $past := $( $<argument_list> );
+    $past.name( ~$<METHOD_NAME> );
+    $past.pasttype( 'callmethod' );
+    $past.unshift( $( $<var> ) );
 
     make $past;
 }
 
+method constructor_call($/) {
+    make
+        PAST::Op.new(
+            :name( 'new' ),
+            :pasttype( 'callmethod' ),
+            PAST::Var.new(
+                :name( ~$<CLASS_NAME> ),
+                :scope( 'package' ),
+            )
+        );
+}
+
 method constant($/) {
     make PAST::Op.new(
              :name('constant'),
@@ -247,7 +267,7 @@
     make $past;
 }
 
-method arguments($/) {
+method argument_list($/) {
     my $past := PAST::Op.new(
                     :pasttype('call'),
                     :node($/)
@@ -260,22 +280,22 @@
 }
 
 method conditional_expression($/) {
-    my $past := PAST::Op.new(
-                    $( $<expression> ),
-                    $( $<block> ),
-                    :node($/)
-                );
-    make $past;
+    make
+        PAST::Op.new(
+            :node($/),
+            $( $<expression> ),
+            $( $<statement_list> )
+        );
 }
 
 method do_while_statement($/) {
-    my $past := PAST::Op.new(
-                    $( $<expression> ),
-                    $( $<block> ),
-                    :pasttype('repeat_while'),
-                    :node($/)
-                );
-    make $past;
+    make
+        PAST::Op.new(
+            :pasttype('repeat_while'),
+            :node($/),
+            $( $<expression> ),
+            $( $<statement_list> )
+        );
 }
 
 method if_statement($/) {
@@ -284,7 +304,7 @@
         
     my $else := undef;
     if +$<else_clause> {
-        $else := $( $<else_clause>[0] );
+        $else := $( $<else_clause>[0]<statement_list> );
     }
     my $first_eif := undef;
     if +$<elseif_clause> {
@@ -314,10 +334,6 @@
      make $past;
 }
 
-method else_clause($/) {
-    make $( $<block> );
-}
-
 method elseif_clause($/) {
     my $past := $( $<conditional_expression> );
     $past.pasttype('if');
@@ -334,9 +350,24 @@
 }
 
 method array_elem($/) {
-    my $past_var_name := $( $<VAR_NAME> );
-    $past_var_name.scope('package');
-    $past_var_name.viviself('PhpArray');
+    our @?BLOCK;
+    unless @?BLOCK[0].symbol( ~$<VAR_NAME> ) {
+        @?BLOCK[0].symbol( ~$<VAR_NAME>, :scope('lexical') );
+        @?BLOCK[0].push(
+            PAST::Var.new(
+                :name(~$<VAR_NAME>),
+                :viviself('PhpArray'),
+                :isdecl(1)
+            )
+        );
+    }
+
+    my $past_var_name := 
+        PAST::Var.new(
+            :name(~$<VAR_NAME>),
+            :viviself('PhpArray'),
+            :lvalue(1),
+        );
 
     make PAST::Var.new(
              $past_var_name,
@@ -347,35 +378,30 @@
          );
 }
 
-method var($/, $key) {
-    make $( $/{$key} );
-}
-
-method VAR_NAME($/) {
-    our $?PIPP_CURRENT_SCOPE;
-    our $?BLOCK;
-
-    my $isdecl;
-    if $?BLOCK.symbol( ~$/ ) {
-        # symbol is already present
-        $isdecl := 0;
-    }
-    else {
-        $isdecl := 1;
-        $?BLOCK.symbol(
-            ~$/,
-            :scope( $?PIPP_CURRENT_SCOPE ?? $?PIPP_CURRENT_SCOPE !! 'package' )
+method simple_var($/) {
+    our @?BLOCK;
+    unless @?BLOCK[0].symbol( ~$<VAR_NAME> ) {
+        @?BLOCK[0].symbol( ~$<VAR_NAME>, :scope('lexical') );
+        @?BLOCK[0].push(
+            PAST::Var.new(
+                :name(~$<VAR_NAME>),
+                :viviself('PhpNull'),
+                :isdecl(1)
+            )
         );
     }
 
     make PAST::Var.new(
-             :scope( $?PIPP_CURRENT_SCOPE ?? $?PIPP_CURRENT_SCOPE !! 'package' ),
-             :name(~$/),
+             :name(~$<VAR_NAME>),
              :viviself('PhpNull'),
              :lvalue(1),
          );
 }
 
+method var($/, $key) {
+    make $( $/{$key} );
+}
+
 method this($/) {
     make PAST::Op.new(
              :inline( "%r = self" )
@@ -383,12 +409,17 @@
 }
 
 method member($/) {
-    make PAST::Op.new(
-             :inline( "%r = self" )
-         );
+    make
+        PAST::Op.new(
+            :pasttype('callmethod'),
+            :name('member'),
+            PAST::Var.new(
+                :name('$this'),
+                :scope('lexical')
+            )
+        );
 }
 
-
 method while_statement($/) {
     my $past := $( $<conditional_expression> );
     $past.pasttype('while');
@@ -397,9 +428,9 @@
 
 method for_statement($/) {
     my $init  := $( $<var_assign> );
+
     my $cond  := $( $<expression>[0] );
-    my $work  := PAST::Stmts.new( $( $<block> ), $( $<expression>[1] ) );
-    
+    my $work  := PAST::Stmts.new( $( $<statement_list> ), $( $<expression>[1] ) );
     my $while := PAST::Op.new(
                        $cond,
                        $work,
@@ -478,120 +509,180 @@
          );
 }
 
-method function_definition($/) {
-
-    # PHP has two scopes: local to functions and global
-    our $?PIPP_CURRENT_SCOPE := 'lexical';
+method closure($/, $key) {
+    our @?BLOCK; # A stack of PAST::Block
 
-    # note that $<param_list> creates a new PAST::Block.
-    my $past := $( $<param_list> );
-    # TODO: set $?BLOCK
+    if $key eq 'open' {
+        # note that $<param_list> creates a new PAST::Block.
+        my $block := $( $<param_list> );
 
-    $past.name( ~$<FUNCTION_NAME> );
-    $past.control('return_pir');
-    $past.push( $( $<block> ) );
+        # declare the bound vars a lexical
+        if +$<bind_list> == 1 {
+            for $<bind_list>[0]<VAR_NAME> {
+                $block.symbol( ~$_, :scope('lexical') ); 
+            }
+        }
+        @?BLOCK.unshift( $block );
+    }
+    else {
+        my $block := @?BLOCK.shift();
 
-    $?PIPP_CURRENT_SCOPE := '';
+        $block.control('return_pir');
+        $block.push( $( $<statement_list> ) );
 
-    make $past;
+        make $block;
+    }
 }
 
-# nested functions are not supported yet
-method ENTER_FUNCTION_DEF($/) {
-    our $?PIPP_CURRENT_SCOPE;
-    $?PIPP_CURRENT_SCOPE := 'lexical';
-}
-method EXIT_FUNCTION_DEF($/) {
-    our $?PIPP_CURRENT_SCOPE;
-    $?PIPP_CURRENT_SCOPE := 'package';
+method function_definition($/, $key) {
+    our @?BLOCK; # A stack of PAST::Block
+
+    if $key eq 'open' {
+        # note that $<param_list> creates a new PAST::Block.
+        @?BLOCK.unshift( $( $<param_list> ) );
+    }
+    else {
+        my $block := @?BLOCK.shift();
+
+        $block.name( ~$<FUNCTION_NAME> );
+        $block.control('return_pir');
+        $block.push( $( $<statement_list> ) );
+
+        make $block;
+    }
 }
 
-method class_method_definition($/) {
+method class_method_definition($/, $key) {
+    our @?BLOCK; # A stack of PAST::Block
 
-    # note that $<param_list> creates a new PAST::Block.
-    my $past := $( $<param_list> );
-    # TODO: set $?BLOCK
+    if $key eq 'open' {
+        # note that $<param_list> creates a new PAST::Block.
+        my $block := $( $<param_list> );
+        $block.unshift(
+            PAST::Op.new(
+                :pasttype('bind'),                                            
+                PAST::Var.new(
+                    :name('$this'),
+                    :scope('lexical'),                                        
+                    :isdecl(1)                                               
+                ),                                                               
+                PAST::Var.new(
+                    :name('self'),                                            
+                    :scope('register')                                       
+                )                                                               
+            )
+        );                  
 
-    $past.name( ~$<METHOD_NAME> );
-    $past.blocktype( 'method' );
-    $past.control('return_pir');
-    $past.push( $( $<block> ) );
+        @?BLOCK.unshift( $block );
+    }
+    else {
+        my $block := @?BLOCK.shift();
 
-    make $past;
+        $block.name( ~$<METHOD_NAME> );
+        $block.blocktype( 'method' );
+        $block.control('return_pir');
+        $block.push( $( $<statement_list> ) );
+
+        make $block;
+    }
 }
 
 method param_list($/) {
 
-    my $past := PAST::Block.new(
-                    :blocktype('declaration'),
-                    :node($/)
-                );
-    # TODO: set $?BLOCK
+    my $block :=
+        PAST::Block.new(
+            :blocktype('declaration'),
+            :node($/)
+        );
     my $arity := 0;
     for $<VAR_NAME> {
-        my $param := $( $_ );
-        $param.scope('parameter');
-        $past.push($param);
-
-        # enter the parameter as a lexical into the block's symbol table
-        # TODO: lexical by default
-        $past.symbol(
-             :scope('lexical'),
-             $param.name()
-        );
+        my $param :=
+            PAST::Var.new(
+                :name(~$_),
+                :scope('parameter'),
+                :viviself('PhpNull'),
+                :lvalue(1),
+            );
+        $block.push($param);
         $arity++;
+        $block.symbol( ~$_, :scope('lexical') ); 
     }
-    $past.arity( $arity );
+    $block.arity( $arity );
 
-    make $past;
+    make $block;
 }
 
 method class_definition($/, $key) {
     our @?BLOCK; # A stack of PAST::Block
-    our $?BLOCK; # The current block. Used for managing the symbol table. 
 
     if $key eq 'open' {
-        # TODO: set $?BLOCK
+        @?BLOCK.unshift(
+            PAST::Block.new(
+                :node($/),
+                :blocktype('declaration'),
+                :pirflags( ':init :load' )
+            )
+        );
     }
     else {
-        # TODO: put this into the 'if' branch
-        $?BLOCK := PAST::Block.new(
-                       :node($/),
-                       :blocktype('declaration'),
-                       :pirflags( ':init :load' )
-                   );
-        @?BLOCK.unshift($?BLOCK);
-        my $past := @?BLOCK.shift();
-        $past.namespace( $<CLASS_NAME><ident> );
-        $past.push( PAST::Stmts.new(
-                        PAST::Op.new(
-                            :inline(   "$P0 = get_root_global ['parrot'], 'P6metaclass'\n"
-                                     ~ "$P2 = $P0.'new_class'('" ~ $<CLASS_NAME> ~ "')\n" ),
-                            :pasttype( 'inline' )
-                        )
-                    )
+        my $block := @?BLOCK.shift();
+        $block.namespace( $<CLASS_NAME><ident> );
+        $block.push(
+            PAST::Stmts.new(
+                PAST::Op.new(
+                    :inline(   "$P0 = get_root_global ['parrot'], 'P6metaclass'\n"
+                             ~ "$P2 = $P0.'new_class'('" ~ $<CLASS_NAME> ~ "')\n" ),
+                    :pasttype( 'inline' )
+                )
+            )
         );
 
         # nothing to do for $<const_definition,
         # setup of class constants is done in the 'loadinit' node
         for $<class_constant_definition> {
-           $past.push( $($_) );
+           $block.push( $($_) );
         }
 
-        # TODO: set $?BLOCK
         my $methods_block := PAST::Block.new( :blocktype('immediate') );
+
+        # declare the attributes
         for $<class_member_definition> {
-            $methods_block.symbol(
-                ~$_<VAR_NAME><ident>,
-                :scope('attribute')
+            $methods_block.symbol( ~$_<VAR_NAME><ident>, :scope('attribute') );
+            $methods_block.push(
+                PAST::Var.new(
+                    :name(~$_<VAR_NAME><ident>),
+                    :scope('attribute'),
+                    :isdecl(1)
+                )
             );
         }
+
+        # add the methods
         for $<class_method_definition> {
             $methods_block.push( $($_) );
         }
-        $past.push( $methods_block );
 
-        make $past;
+        # add accessors for the attributes
+        for $<class_member_definition> {
+            $methods_block.push(
+                PAST::Block.new(
+                    :blocktype('declaration'),
+                    :name(~$_<VAR_NAME><ident>),
+                    :pirflags(':method'),
+                    :node( $/ ),
+                    PAST::Stmts.new(
+                        PAST::Var.new(
+                            :name(~$_<VAR_NAME><ident>),
+                            :scope('attribute')
+                        )
+                    )
+                )
+            );
+        }
+
+        $block.push( $methods_block );
+
+        make $block;
     }
 }
 
@@ -604,7 +695,6 @@
     my $past;
     if $key eq 'quote_regex' {
         our $?NS;
-        # TODO: set $?BLOCK
         $past := PAST::Block.new(
             $<quote_regex>,
             :compiler('PGE::Perl6Regex'),

Modified: branches/pdd22io_part3/languages/pipp/src/pct/grammar.pg
==============================================================================
--- branches/pdd22io_part3/languages/pipp/src/pct/grammar.pg	(original)
+++ branches/pdd22io_part3/languages/pipp/src/pct/grammar.pg	Mon Dec 29 23:28:53 2008
@@ -2,15 +2,14 @@
 # $Id$
 
 # PHP grammar for Pipp PCT
-
 grammar Pipp::Grammar is PCT::Grammar;
 
 # the starting rule
 token TOP {
-     {*}                                     #= open
-     <sea_or_code>*
-     [ $ || <.panic: 'Syntax error'> ]
-     {*}                                     #= close
+    {*}                                     #= open
+    <sea_or_code>*
+    [ $ || <.panic: 'Syntax error'> ]
+    {*}                                     #= close
 }
 
 # Whitespace and comments
@@ -49,22 +48,22 @@
 }
 
 rule code_echo_tag {
-    <.CODE_START_ECHO_TAG> <arguments> <.statement_delimiter>
-        <statement>*
+    <.CODE_START_ECHO_TAG> <argument_list> <.statement_delimiter>
+        <statement_list>
     <.close_short_tag>?
     {*}
 }
 
 rule code_script_tag {
     <.open_script_tag>
-        <statement>*
+        <statement_list>
     <.close_script_tag>?
     {*}
 }
 
 rule code_short_tag {
     <.open_short_tag>
-        <statement>*
+        <statement_list>
     <.close_short_tag>?
     {*}
 }
@@ -73,7 +72,7 @@
     '<script' <ws_char>+: 'language' <ws_char>*: '=' <ws_char>*: <quoted_lang_name> <ws_char>*: '>'
     {{ $P0 = new 'String'
        $P0 = "script"
-        set_global "tag_type", $P0
+       set_global "tag_type", $P0
     }}
 }
 
@@ -94,7 +93,7 @@
     '<?=' 
     {{ $P0 = new 'String'
        $P0 = "short"
-        set_global "tag_type", $P0
+       set_global "tag_type", $P0
     }}
 }
 
@@ -102,7 +101,7 @@
     '<?' 'php'?  
     {{ $P0 = new 'String'
        $P0 = "short"
-        set_global "tag_type", $P0
+       set_global "tag_type", $P0
     }}
 }
 
@@ -117,14 +116,10 @@
     }} <.fail>
 }
 
-# block and statements
-rule block {
-    '{' <statement>* '}'
-    {*}
-}
+# statements
 
 rule statement {
-      <namespace_statement>     {*}  #= namespace_statement
+    | <namespace_statement>     {*}  #= namespace_statement
     | <return_statement>        {*}  #= return_statement
     | <require_once_statement>  {*}  #= require_once_statement
     | <echo_statement>          {*}  #= echo_statement
@@ -135,13 +130,17 @@
     | <for_statement>           {*}  #= for_statement
     | <inline_sea_short_tag>    {*}  #= inline_sea_short_tag
     | <inline_sea_script_tag>   {*}  #= inline_sea_script_tag
-    | <var_assign>              {*}  #= var_assign
+    | [ <var_assign> ';' ]      {*}  #= var_assign
     | <function_definition>     {*}  #= function_definition
     | <class_definition>        {*}  #= class_definition
 }
 
+rule statement_list {
+    <statement>* {*}            
+}
+
 rule statement_delimiter {
-      ';'
+    | ';'
     | <before '?'>
     | $
 }
@@ -163,7 +162,7 @@
 }
 
 token echo_statement {
-    'echo' <.ws_char> <arguments> <ws> <.statement_delimiter>
+    'echo' <.ws_char> <argument_list> <ws> <.statement_delimiter>
     {*}
 }
 
@@ -172,26 +171,25 @@
     {*}
 }
 
-rule arguments {
+rule argument_list {
     [ <expression> [',' <expression>]* ]?
     {*}
 }
 
 rule conditional_expression {
-    '(' <expression> ')' <block>
+    '(' <expression> ')' '{' <statement_list> '}'
     {*}
 }
 
 rule if_statement {
     'if' <conditional_expression>
-    [<elseif_clause>]*
-    [<else_clause>]?
+    <elseif_clause>*
+    <else_clause>?
     {*}
 }
 
 rule else_clause {
-    'else' <block>
-    {*}
+    'else' '{' <statement_list> '}'
 }
 
 rule elseif_clause {
@@ -205,12 +203,12 @@
 }
 
 rule do_while_statement {
-    'do' <block> 'while' '(' <expression> ')' <.statement_delimiter>
+    'do' '{' <statement_list> '}' 'while' '(' <expression> ')' <.statement_delimiter>
     {*}
 }
 
 rule for_statement {
-    'for' '(' <var_assign> <expression> ';' <expression> ')' <block>
+    'for' '(' <var_assign> ';' <expression> ';' <expression> ')' '{' <statement_list> '}'
     {*}
 }
 
@@ -233,7 +231,7 @@
 }
 
 rule var_assign {
-    <var> '=' <expression> <.statement_delimiter>
+    <var> '=' <expression>
     {*}
 }
 
@@ -258,23 +256,41 @@
 
 # namespace support
 
-token NAMESPACE_SEPARATOR { '\\' }
+token NAMESPACE_SEPARATOR      { '\\' }
 
-token NAMESPACE_NAME { <ident>? [ <.NAMESPACE_SEPARATOR> <ident> ]* }
+token NAMESPACE_NAME           { <ident>? [ <.NAMESPACE_SEPARATOR> <ident> ]* }
 
-token VAR_NAME {
-    '$' <ident>
-    {*}
-}
+token VAR_NAME                 { '$' <ident> }
 
 # terms
 rule method_call {
-    <var> '->' <METHOD_NAME> '(' <arguments> ')'
+    <var> '->' <METHOD_NAME> '(' <argument_list> ')'
+    {*}
+}
+
+rule closure_call {
+    <var> '(' <argument_list> ')'
     {*}
 }
 
 rule function_call {
-    <FUNCTION_NAME> '(' <arguments> ')'
+    <FUNCTION_NAME> '(' <argument_list> ')'
+    {*}
+}
+
+# a trailing ',' is allowed
+rule instantiate_array {
+    'array' '(' [ <array_argument> [ ',' <array_argument> ]* ]? ','? ')'
+    {*}
+}
+
+rule array_argument {
+    | <key_value_pair>  {*}    #= key_value_pair
+    | <expression>      {*}    #= expression
+}
+
+rule key_value_pair {
+    <key=expression> '=>' <value=expression>
     {*}
 }
 
@@ -340,14 +356,19 @@
     {*}
 }
 
+token simple_var {
+    <VAR_NAME>
+    {*}
+}
+
 token var {
-      <this>        {*}   #= this
+    | <this>        {*}   #= this
     | <array_elem>  {*}   #= array_elem
-    | <VAR_NAME>    {*}   #= VAR_NAME
+    | <simple_var>  {*}   #= simple_var
 }
 
 rule literal {
-      <TRUE>    {*}    #= TRUE
+    | <TRUE>    {*}    #= TRUE
     | <FALSE>   {*}    #= FALSE
     | <NULL>    {*}    #= NULL
     | <NUMBER>  {*}    #= NUMBER
@@ -356,10 +377,14 @@
 }
 
 rule term {
-      <method_call>            {*}   #= method_call
+    | <method_call>            {*}   #= method_call
+    | <closure>                {*}   #= closure
+    | <closure_call>           {*}   #= closure_call
     | <function_call>          {*}   #= function_call
+    | <instantiate_array>      {*}   #= instantiate_array
     | <constructor_call>       {*}   #= constructor_call
-    | '(' <expression> {*} ')'       #= expression
+    | '(' <var_assign> ')'     {*}   #= var_assign
+    | '(' <expression> ')'     {*}   #= expression
     | <literal>                {*}   #= literal
     | <class_constant>         {*}   #= class_constant
     | <constant>               {*}   #= constant
@@ -369,19 +394,22 @@
 
 
 # declarations
-rule function_definition {
-    'function' <FUNCTION_NAME> <.ENTER_FUNCTION_DEF> <param_list> <block> <.EXIT_FUNCTION_DEF>
-    {*}
+rule closure {
+    'function' <bind_list>? <param_list> 
+    {*}                                     #= open
+    '{' <statement_list> '}'
+    {*}                                     #= close
 }
 
-# special subrule for marking variable scope
-token ENTER_FUNCTION_DEF {
-    {*}
+rule bind_list {
+    'use' '(' [ '&'? <VAR_NAME> [',' '&'? <VAR_NAME>]* ]? ')'
 }
 
-# ditto
-token EXIT_FUNCTION_DEF {
-    {*}
+rule function_definition {
+    'function' <FUNCTION_NAME> <param_list>
+    {*}                                     #= open
+    '{' <statement_list> '}'
+    {*}                                     #= close
 }
 
 rule param_list {
@@ -404,8 +432,8 @@
 }
 
 rule class_definition {
-    {*}                                     #= open
     'class' <CLASS_NAME> [ 'implements' <INTERFACE_NAME> ]? '{'
+    {*}                                     #= open
         <class_constant_definition>*
         <class_member_definition>*
         <class_method_definition>*
@@ -423,12 +451,12 @@
 }
 
 rule class_method_definition {
-    'function' <METHOD_NAME> <param_list> <block>
-    {*}
+    'function' <METHOD_NAME> <param_list>
+    {*}                                     #= open
+    '{' <statement_list> '}'
+    {*}                                     #= close
 }
 
-
-
 token curly_interpolation {
     '{' <var> '}'
     {*}

Modified: branches/pdd22io_part3/languages/pipp/t/php/closures.t
==============================================================================
--- branches/pdd22io_part3/languages/pipp/t/php/closures.t	(original)
+++ branches/pdd22io_part3/languages/pipp/t/php/closures.t	Mon Dec 29 23:28:53 2008
@@ -20,18 +20,175 @@
 use FindBin;
 use lib "$FindBin::Bin/../../../../lib", "$FindBin::Bin/../../lib";
 
-use Parrot::Test tests => 1;
+use Parrot::Test tests => 7;
 
-language_output_is( 'Pipp', <<'CODE', <<'OUT', 'function with no args', todo => 'not implemented yet' );
+=for perl6
+
+my $anon_no_args = sub ()  {
+  print "The function anon_no_args() has been called.\n";
+};
+
+$anon_no_args();
+
+=cut
+
+language_output_is( 'Pipp', <<'CODE', <<'OUT', 'anonymous function with no args' );
+<?php
+
+$anon_no_args = function ()  {
+  echo "The function anon_no_args() has been called.\n";
+};
+
+$anon_no_args();
+
+?>
+CODE
+The function anon_no_args() has been called.
+OUT
+
+
+=for perl6
+
+my $anon_one_arg = sub ($arg_1)  {
+  print "'$arg_1' was passed to anon_one_arg().\n";
+};
+
+$anon_one_arg('one');
+
+=cut
+
+language_output_is( 'Pipp', <<'CODE', <<'OUT', 'anonymous function with one arg' );
 <?php
 
-$dummy_no_args = function ()  {
-  echo "The function dummy_no_args() has been called.\n";
+$anon_one_arg = function ($arg_1)  {
+  echo "'$arg_1' was passed to anon_one_arg().\n";
 };
 
-$dummy_no_args();
+$anon_one_arg('one');
+
+?>
+CODE
+'one' was passed to anon_one_arg().
+OUT
+
+
+language_output_is( 'Pipp', <<'CODE', <<'OUT', 'anonymous function with three args' );
+<?php
+
+$anon_three_args = function ($arg_1, $arg_2, $arg_3)  {
+  echo "'$arg_1', '$arg_2', '$arg_3' was passed to anon_three_args().\n";
+};
+
+$anon_three_args('one', 'two', 'three');
+
+?>
+CODE
+'one', 'two', 'three' was passed to anon_three_args().
+OUT
+
+language_output_is( 'Pipp', <<'CODE', <<'OUT', 'create an anonymous sub' );
+<?php
+
+function generator () {
+
+    $anon_no_arg = function ()  {
+        echo "anon_no_arg() was called.\n";
+    };
+}
+
+$sub = generator();
+
+$sub();
+
+?>
+CODE
+anon_no_arg() was called.
+OUT
+
+
+language_output_is( 'Pipp', <<'CODE', <<'OUT', 'create an anonymous sub with two args' );
+<?php
+
+function generator () {
+
+    $anon_two_args = function ($arg_1, $arg_2)  {
+        echo "'$arg_1', '$arg_2' was passed to anon_two_args().\n";
+    };
+
+    return $anon_two_args;
+}
+
+$sub = generator();
+
+$sub('one', 'two');
+
+?>
+CODE
+'one', 'two' was passed to anon_two_args().
+OUT
+
+
+language_output_is( 'Pipp', <<'CODE', <<'OUT', 'closure with one bound var' );
+<?php
+
+function gen_indentor ( ) {
+    $indention = ' ';
+    $indentor = function use ($indention) ($line)  {
+        echo $indention . $line . "\n";
+    };
+
+    return $indentor;
+}
+
+$sub_1 = gen_indentor(' ');
+
+$sub_1('1a');
+$sub_1('1b');
+$sub_1('1c');
+
+?>
+CODE
+ 1a
+ 1b
+ 1c
+OUT
+
+
+language_output_is( 'Pipp', <<'CODE', <<'OUT', 'closure with a passed bound var', todo => 'broken' );
+<?php
+
+function gen_indentor ( $indention ) {
+
+    $indentor = function use ($indention) ($line)  {
+        echo $indention . $line . "\n";
+    };
+
+    return $indentor;
+}
+
+$sub_1 = gen_indentor(' ');
+$sub_2 = gen_indentor('  ');
+$sub_3 = gen_indentor('   ');
+
+$sub_1('1a');
+$sub_1('1b');
+$sub_1('1c');
+$sub_2('2a');
+$sub_2('2b');
+$sub_2('2c');
+$sub_3('3a');
+$sub_3('3b');
+$sub_3('3c');
 
 ?>
 CODE
-The function dummy_no_args() has been called.
+ 1a
+ 1b
+ 1c
+  2a
+  2b
+  2c
+   3a
+   3b
+   3c
 OUT

Modified: branches/pdd22io_part3/languages/pipp/t/php/functions.t
==============================================================================
--- branches/pdd22io_part3/languages/pipp/t/php/functions.t	(original)
+++ branches/pdd22io_part3/languages/pipp/t/php/functions.t	Mon Dec 29 23:28:53 2008
@@ -158,11 +158,11 @@
 language_output_is( 'Pipp', <<'CODE', <<'OUT', 'function with three args' );
 <?php
 
-function echo_two_args( $arg_1, $arg_2, $arg_3 )  {
+function echo_three_args( $arg_1, $arg_2, $arg_3 )  {
   echo "$arg_1 $arg_2 $arg_3\n";
 }
 
-echo_two_args( 12, 'asdf', -1 );
+echo_three_args( 12, 'asdf', -1 );
 
 ?>
 CODE

Modified: branches/pdd22io_part3/languages/pipp/t/php/oo.t
==============================================================================
--- branches/pdd22io_part3/languages/pipp/t/php/oo.t	(original)
+++ branches/pdd22io_part3/languages/pipp/t/php/oo.t	Mon Dec 29 23:28:53 2008
@@ -20,7 +20,7 @@
 use FindBin;
 use lib "$FindBin::Bin/../../../../lib", "$FindBin::Bin/../../lib";
 
-use Parrot::Test tests => 6;
+use Parrot::Test tests => 8;
 
 language_output_is( 'Pipp', <<'CODE', <<'OUT', 'definition of a class' );
 <?php
@@ -152,10 +152,70 @@
 }
 
 $foo = new Foo;
-$foo->echo_menber();
+$foo->echo_member();
 
 ?>
 CODE
 a member of Foo
 OUT
 
+
+=for perl6
+
+class Foo {
+    method one_arg($arg_1) {
+        print $arg_1;
+        print "\n";
+    }
+}
+
+my $foo = Foo.new();
+$foo.one_arg('the first argument');
+
+=cut
+
+language_output_is( 'Pipp', <<'CODE', <<'OUT', 'method with one parameter' );
+<?php
+
+class Foo {
+    function one_arg($arg_1) {
+        echo $arg_1;
+        echo "\n";
+    }
+}
+
+$foo = new Foo;
+$foo->one_arg('the first argument');
+
+?>
+CODE
+the first argument
+OUT
+
+language_output_is( 'Pipp', <<'CODE', <<'OUT', 'method with one parameter' );
+<?php
+
+class Foo {
+    function four_args($arg_1, $arg_2, $arg_3, $arg_4) {
+        echo $arg_1;
+        echo "\n";
+        echo $arg_2;
+        echo "\n";
+        echo $arg_3;
+        echo "\n";
+        echo $arg_4;
+        echo "\n";
+    }
+}
+
+$foo = new Foo;
+$foo->four_args( 'one', 'two', 'three', 'four' );
+
+?>
+CODE
+one
+two
+three
+four
+OUT
+

Modified: branches/pdd22io_part3/languages/regex/regex-compiler.pir
==============================================================================
--- branches/pdd22io_part3/languages/regex/regex-compiler.pir	(original)
+++ branches/pdd22io_part3/languages/regex/regex-compiler.pir	Mon Dec 29 23:28:53 2008
@@ -48,7 +48,7 @@
         .local string result
         .local string buffer
         result = ""
-        file = open filename, "<"
+        file = open filename, 'r'
 loop:   buffer = read file, 65536
         $I0 = length buffer
         le $I0, 0, done

Modified: branches/pdd22io_part3/languages/unlambda/unl.pir
==============================================================================
--- branches/pdd22io_part3/languages/unlambda/unl.pir	(original)
+++ branches/pdd22io_part3/languages/unlambda/unl.pir	Mon Dec 29 23:28:53 2008
@@ -28,7 +28,7 @@
     goto run
 open_file:
     $S0 = argv[1]
-    in = open $S0, "<"
+    in = open $S0, 'r'
     $I0 = defined in
     if $I0 goto run
     printerr "can't open '"

Modified: branches/pdd22io_part3/lib/Parrot/Ops2c/Utils.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Ops2c/Utils.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Ops2c/Utils.pm	Mon Dec 29 23:28:53 2008
@@ -6,7 +6,7 @@
 use lib ("lib/");
 use Parrot::OpLib::core;
 use Parrot::OpsFile;
-use File::Spec;
+use File::Spec ();
 use IO::File ();
 
 =head1 NAME
@@ -945,7 +945,7 @@
 }
 static void hop_init(void) {
     size_t i;
-    op_info_t * info = $self->{bs}op_lib.op_info_table;
+    op_info_t * const info = $self->{bs}op_lib.op_info_table;
     /* store full names */
     for (i = 0; i < $self->{bs}op_lib.op_count; i++)
         store_op(info + i, 1);

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/Method.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/Method.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/Method.pm	Mon Dec 29 23:28:53 2008
@@ -7,7 +7,7 @@
 use constant VTABLE       => 'VTABLE';
 use constant NON_VTABLE   => 'NON_VTABLE';
 use constant MULTI        => 'MULTI';
-use Parrot::Pmc2c::UtilFunctions qw(count_newlines args_from_parameter_list passable_args_from_parameter_list);
+use Parrot::Pmc2c::UtilFunctions qw( args_from_parameter_list passable_args_from_parameter_list );
 
 sub new {
     my ( $class, $self_hash ) = @_;

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/MethodEmitter.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/MethodEmitter.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/MethodEmitter.pm	Mon Dec 29 23:28:53 2008
@@ -24,8 +24,6 @@
 use strict;
 use warnings;
 use Parrot::Pmc2c::Emitter ();
-use Parrot::Pmc2c::UtilFunctions
-    qw( gen_ret dont_edit count_newlines dynext_load_code c_code_coda );
 use Parrot::Pmc2c::PCCMETHOD ();
 
 =item C<generate_body($pmc)>
@@ -49,7 +47,7 @@
         $self->rewrite_nci_method($pmc);
     }
 
-    $emit->( ( $pmc->is_dynamic ? 'PARROT_DYNEXT_EXPORT ' : 'PARROT_EXPORT ') . $self->decl( $pmc, 'CFILE' ) );
+    $emit->( $pmc->export . ' ' . $self->decl( $pmc, 'CFILE' ) );
     $emit->("{\n");
     $emit->($body);
     $emit->("}\n");
@@ -91,7 +89,6 @@
     my $ret     = $self->return_type;
     my $meth    = $self->name;
     my $args    = $self->parameters;
-    my $ro      = $pmc->flag('is_ro') ? '' : '';
     my $decs    = $self->decorators;
 
     # convert 'type*' to 'type *' per PDD07
@@ -104,11 +101,12 @@
     my ( $decorators, $export, $extern, $newl, $semi, $interp, $pmcvar );
     $decorators = join($/, @$decs, '');
     if ( $for_header eq 'HEADER' ) {
-        $export = $pmc->is_dynamic ? 'PARROT_DYNEXT_EXPORT ' : 'PARROT_EXPORT ';
+        $export = $pmc->export;
         $extern = '';
         $newl   = ' ';
         $semi   = ';';
-        $interp = $pmcvar = '';
+        $interp = '';
+        $pmcvar = '';
     }
     else {
         $export = '';
@@ -120,7 +118,7 @@
     }
 
     return <<"EOC";
-$decorators$export$extern$ret${newl}Parrot_${pmcname}${ro}_$meth(PARROT_INTERP, PMC *$pmcvar$args)$semi
+$decorators$export $extern$ret${newl}Parrot_${pmcname}_$meth(PARROT_INTERP, PMC *$pmcvar$args)$semi
 EOC
 }
 

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/PCCMETHOD.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/PCCMETHOD.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/PCCMETHOD.pm	Mon Dec 29 23:28:53 2008
@@ -393,15 +393,15 @@
     my $set_params  = make_arg_pmc($params_flags, '_param_sig');
 
     $e->emit( <<"END", __FILE__, __LINE__ + 1 );
-    INTVAL   _n_regs_used[]       = { $n_regs_used };
+    const INTVAL _n_regs_used[]   = { $n_regs_used };
     opcode_t _param_indexes[]     = { $params_indexes };
     opcode_t *_return_indexes;
     opcode_t *_current_args;
-    PMC      *_param_sig          = pmc_new(interp, enum_class_FixedIntegerArray);
+    PMC      * const _param_sig   = pmc_new(interp, enum_class_FixedIntegerArray);
     PMC      *_return_sig         = PMCNULL;
 
     Parrot_Context *_caller_ctx   = CONTEXT(interp);
-    PMC *_ret_cont                = new_ret_continuation_pmc(interp, NULL);
+    PMC * const _ret_cont         = new_ret_continuation_pmc(interp, NULL);
     Parrot_Context *_ctx          = Parrot_push_context(interp, _n_regs_used);
     PMC *_ccont                   = PMCNULL;
 

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC.pm	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2006, The Perl Foundation.
+# Copyright (C) 2004-2008, The Perl Foundation.
 # $Id$
 #
 
@@ -27,7 +27,6 @@
 our @EXPORT_OK = qw();
 use Storable ();
 use Parrot::PMC;
-use Parrot::Pmc2c::UtilFunctions qw(spew);
 use Parrot::Pmc2c::Method;
 
 sub create {
@@ -172,6 +171,12 @@
     return 1;
 }
 
+sub export {
+    my ( $self ) = @_;
+
+    return $self->is_dynamic ? 'PARROT_DYNEXT_EXPORT' : 'PARROT_EXPORT';
+}
+
 sub implements_vtable {
     my ( $self, $vt_meth ) = @_;
     return 0 unless $self->has_method($vt_meth);

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/Null.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/Null.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/Null.pm	Mon Dec 29 23:28:53 2008
@@ -11,7 +11,6 @@
 use base 'Parrot::Pmc2c::PMC';
 use strict;
 use warnings;
-use Parrot::Pmc2c::UtilFunctions qw( gen_ret );
 
 =item C<pre_method_gen($method, $line, $out_name)>
 

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/RO.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/RO.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/RO.pm	Mon Dec 29 23:28:53 2008
@@ -25,14 +25,11 @@
 use warnings;
 use base qw( Parrot::Pmc2c::PMC );
 
-use Parrot::Pmc2c::Emitter;
-use Parrot::Pmc2c::PMCEmitter;
-use Parrot::Pmc2c::Method;
-use Parrot::Pmc2c::MethodEmitter;
-use Parrot::Pmc2c::UtilFunctions
-    qw( gen_ret dont_edit count_newlines dynext_load_code c_code_coda );
+use Parrot::Pmc2c::Emitter ();
+use Parrot::Pmc2c::PMCEmitter ();
+use Parrot::Pmc2c::Method ();
+use Parrot::Pmc2c::UtilFunctions qw( return_statement );
 use Text::Balanced 'extract_bracketed';
-use Parrot::Pmc2c::PCCMETHOD;
 
 =item C<make_RO($type)>
 
@@ -99,17 +96,22 @@
             $self->add_method($ro_method);
         }
         elsif ( $parent->vtable_method_does_write($vt_method_name) ) {
+            # All parameters passed in are shims, because we're
+            # creating an exception-thrower.
+            my @parameters = split( /\s*,\s*/, $vt_method->parameters );
+            @parameters = map { "SHIM($_)" } @parameters;
+
             my $ro_method = Parrot::Pmc2c::Method->new(
                 {
                     name        => $vt_method_name,
                     parent_name => $parent->name,
                     return_type => $vt_method->return_type,
-                    parameters  => $vt_method->parameters,
+                    parameters  => join( ', ', @parameters ),
                     type        => Parrot::Pmc2c::Method::VTABLE,
                 }
             );
             my $pmcname = $parent->name;
-            my $ret     = gen_ret($ro_method);
+            my $ret     = return_statement($ro_method);
             my $body    = <<EOC;
     Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_WRITE_TO_CONSTCLASS,
             "$vt_method_name() in read-only instance of $pmcname");

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/Ref.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/Ref.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/Ref.pm	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, The Perl Foundation.
+# Copyright (C) 2007-2008, The Perl Foundation.
 # $Id$
 
 =head1 Parrot::Pmc2c::Ref Instance Methods
@@ -11,7 +11,7 @@
 use base 'Parrot::Pmc2c::PMC';
 use strict;
 use warnings;
-use Parrot::Pmc2c::UtilFunctions qw( gen_ret passable_args_from_parameter_list );
+use Parrot::Pmc2c::UtilFunctions qw( return_statement passable_args_from_parameter_list );
 
 =item C<prederef($method)>
 
@@ -81,7 +81,7 @@
         if ( $method->return_type ne 'void' ) {
             $ret_def    = $method->return_type . ' ret_val;';
             $ret_assign = 'ret_val = ';
-            $ret        = gen_ret( $method, 'ret_val' );
+            $ret        = return_statement( $method, 'ret_val' );
         }
         my $body = <<EOC;
     $ret_def

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/default.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/default.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/default.pm	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, The Perl Foundation.
+# Copyright (C) 2007-2008, The Perl Foundation.
 # $Id$
 
 =head1 Parrot::Pmc2c::PMC::default Instance Methods
@@ -10,7 +10,7 @@
 package Parrot::Pmc2c::PMC::default;
 use strict;
 use warnings;
-use Parrot::Pmc2c::UtilFunctions qw( gen_ret );
+use Parrot::Pmc2c::UtilFunctions qw( return_statement );
 use base qw( Parrot::Pmc2c::PMC );
 
 =item C<pre_method_gen()>
@@ -33,7 +33,7 @@
             }
         );
 
-        my $ret = gen_ret($method);
+        my $ret = return_statement($method);
         $new_default_method->body( Parrot::Pmc2c::Emitter->text(<<"EOC") );
     cant_do_method(interp, pmc, "$vt_method_name");
     $ret

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/deleg_pmc.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/deleg_pmc.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/PMC/deleg_pmc.pm	Mon Dec 29 23:28:53 2008
@@ -1,12 +1,12 @@
 package Parrot::Pmc2c::PMC::deleg_pmc;
 
-# Copyright (C) 2007, The Perl Foundation.
+# Copyright (C) 2007-2008, The Perl Foundation.
 # $Id$
 
 use base 'Parrot::Pmc2c::PMC';
 use strict;
 use warnings;
-use Parrot::Pmc2c::UtilFunctions qw( gen_ret passable_args_from_parameter_list );
+use Parrot::Pmc2c::UtilFunctions qw( return_statement passable_args_from_parameter_list );
 
 =over 4
 
@@ -36,7 +36,7 @@
         );
 
         my $arg  = passable_args_from_parameter_list( $method->parameters );
-        my $ret  = gen_ret( $method, "VTABLE_$vt_method_name(interp, attr$arg)" );
+        my $ret  = return_statement( $method, "VTABLE_$vt_method_name(interp, attr$arg)" );
         $new_method->body( Parrot::Pmc2c::Emitter->text(<<"EOC") );
     PMC * const attr = get_attrib_num(PMC_data_typed(pmc, SLOTTYPE *), 0);
     $ret

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/PMCEmitter.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/PMCEmitter.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/PMCEmitter.pm	Mon Dec 29 23:28:53 2008
@@ -25,8 +25,7 @@
 use Parrot::Pmc2c::Emitter;
 use Parrot::Pmc2c::Method;
 use Parrot::Pmc2c::MethodEmitter;
-use Parrot::Pmc2c::UtilFunctions
-    qw( gen_ret dont_edit count_newlines dynext_load_code c_code_coda );
+use Parrot::Pmc2c::UtilFunctions qw( dont_edit dynext_load_code c_code_coda );
 use Text::Balanced 'extract_bracketed';
 use Parrot::Pmc2c::PCCMETHOD;
 use Parrot::Pmc2c::MULTI;

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/Pmc2cMain.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/Pmc2cMain.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/Pmc2cMain.pm	Mon Dec 29 23:28:53 2008
@@ -9,7 +9,7 @@
 use Parrot::Pmc2c::VTable ();
 use Parrot::Pmc2c::Dumper;
 use Parrot::Pmc2c::Library ();
-use Parrot::Pmc2c::UtilFunctions qw( slurp spew filename );
+use Parrot::Pmc2c::UtilFunctions qw( filename );
 use Parrot::Pmc2c::PCCMETHOD ();
 use Parrot::Pmc2c::PMC::default ();
 use Parrot::Pmc2c::PMC::delegate ();

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/UtilFunctions.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/UtilFunctions.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/UtilFunctions.pm	Mon Dec 29 23:28:53 2008
@@ -5,7 +5,7 @@
 use strict;
 use warnings;
 use base qw( Exporter );
-our @EXPORT_OK = qw( count_newlines gen_ret dont_edit dynext_load_code
+our @EXPORT_OK = qw( count_newlines return_statement dont_edit dynext_load_code
     c_code_coda slurp spew splat open_file filename escape_filename
     args_from_parameter_list
     passable_args_from_parameter_list
@@ -84,7 +84,7 @@
 EOC
 }
 
-=item C<gen_ret($method, $body)>
+=item C<return_statement($method, $body)>
 
 Generate the C code for a C<return> statement, if the body is empty then
 make a cast if needed.
@@ -93,7 +93,7 @@
 
 =cut
 
-sub gen_ret {
+sub return_statement {
     my ( $method, $body ) = @_;
 
     my $return_type = $method->return_type;

Modified: branches/pdd22io_part3/lib/Parrot/Pmc2c/VTable.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Pmc2c/VTable.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Pmc2c/VTable.pm	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2006, The Perl Foundation.
+# Copyright (C) 2004-2008, The Perl Foundation.
 # $Id$
 package Parrot::Pmc2c::VTable;
 use strict;
@@ -6,8 +6,7 @@
 
 use Storable ();
 use Parrot::Vtable;
-use Parrot::Pmc2c::Method;
-use Parrot::Pmc2c::UtilFunctions qw(spew);
+use Parrot::Pmc2c::Method ();
 use File::Basename;
 use Cwd qw(cwd);
 

Modified: branches/pdd22io_part3/lib/Parrot/Test.pm
==============================================================================
--- branches/pdd22io_part3/lib/Parrot/Test.pm	(original)
+++ branches/pdd22io_part3/lib/Parrot/Test.pm	Mon Dec 29 23:28:53 2008
@@ -571,7 +571,6 @@
         my $exec_f = per_test( '_pbcexe', $test_no );    # Make cleanup and svn:ignore more simple
         $exe_f =~ s@[\\/:]@$PConfig{slash}@g;
 
-        # RT#43751 put this into sub generate_pbc()
         run_command(
             qq{$parrot $args -o $pbc_f "$code_f"},
             CD     => $path_to_parrot,

Modified: branches/pdd22io_part3/runtime/parrot/include/DWIM.pir
==============================================================================
--- branches/pdd22io_part3/runtime/parrot/include/DWIM.pir	(original)
+++ branches/pdd22io_part3/runtime/parrot/include/DWIM.pir	Mon Dec 29 23:28:53 2008
@@ -51,7 +51,7 @@
     .param pmc ar
     #concat me, "x"         # test output is in source.pirx
     .local pmc file
-    open file, me, ">"
+    open file, me, 'w'
     unless file, err_write
     .local pmc iter
     iter = new 'Iterator', ar
@@ -204,7 +204,7 @@
 .sub _read          # read in source code of script
     .param string me
     .local pmc file
-    open file, me, "<"
+    open file, me, 'r'
     unless file, err_open
     .local pmc ar
     .local string line

Modified: branches/pdd22io_part3/runtime/parrot/library/Config/JSON.pir
==============================================================================
--- branches/pdd22io_part3/runtime/parrot/library/Config/JSON.pir	(original)
+++ branches/pdd22io_part3/runtime/parrot/library/Config/JSON.pir	Mon Dec 29 23:28:53 2008
@@ -22,7 +22,7 @@
     .local string text
     .local pmc fh
 
-    fh = open filename, '<'
+    fh = open filename, 'r'
     if fh goto slurp_file
     $P0 = new 'Exception'
     $S0 = concat "can't open file: ", filename
@@ -72,7 +72,7 @@
     output = _json( config, expanded )
 
     # write out the file..
-    $P1 = open filename, '>'
+    $P1 = open filename, 'w'
     print $P1, output
     close $P1
 

Modified: branches/pdd22io_part3/runtime/parrot/library/Crow.pir
==============================================================================
--- branches/pdd22io_part3/runtime/parrot/library/Crow.pir	(original)
+++ branches/pdd22io_part3/runtime/parrot/library/Crow.pir	Mon Dec 29 23:28:53 2008
@@ -62,7 +62,7 @@
     .local pmc newsfile
     .local string buf, news, start
 
-    newsfile = open 'NEWS', '<'
+    newsfile = open 'NEWS', 'r'
 
     ## find the start of the news item for this version
     start    = concat 'New in ', version

Modified: branches/pdd22io_part3/runtime/parrot/library/HTTP/Daemon.pir
==============================================================================
--- branches/pdd22io_part3/runtime/parrot/library/HTTP/Daemon.pir	(original)
+++ branches/pdd22io_part3/runtime/parrot/library/HTTP/Daemon.pir	Mon Dec 29 23:28:53 2008
@@ -714,7 +714,7 @@
 
 SERVE_file:
     # try to open the file in url
-    fp = open url, "<"
+    fp = open url, 'r'
     unless fp goto SERVE_404
     len = stat url, .STAT_FILESIZE
     read file_content, fp, len

Modified: branches/pdd22io_part3/runtime/parrot/library/config.pir
==============================================================================
--- branches/pdd22io_part3/runtime/parrot/library/config.pir	(original)
+++ branches/pdd22io_part3/runtime/parrot/library/config.pir	Mon Dec 29 23:28:53 2008
@@ -51,7 +51,7 @@
     conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
     conf_file .= "/runtime/parrot/include/config.fpmc"
 
-    open CONF, conf_file, "<"
+    open CONF, conf_file, 'r'
     $I0 = defined CONF
     if $I0 goto ok1
     printerr "Can't read '"

Modified: branches/pdd22io_part3/src/debug.c
==============================================================================
--- branches/pdd22io_part3/src/debug.c	(original)
+++ branches/pdd22io_part3/src/debug.c	Mon Dec 29 23:28:53 2008
@@ -2748,7 +2748,7 @@
 */
 
 void
-PDB_free_file(PARROT_INTERP, ARGIN_NULLOK(PDB_file_t *file))
+PDB_free_file(SHIM_INTERP, ARGIN_NULLOK(PDB_file_t *file))
 {
     while (file) {
         /* Free all of the allocated line structures */

Modified: branches/pdd22io_part3/src/encoding.c
==============================================================================
--- branches/pdd22io_part3/src/encoding.c	(original)
+++ branches/pdd22io_part3/src/encoding.c	Mon Dec 29 23:28:53 2008
@@ -164,6 +164,7 @@
 
 PARROT_EXPORT
 PARROT_DOES_NOT_RETURN
+PARROT_CANNOT_RETURN_NULL
 const ENCODING *
 Parrot_load_encoding(PARROT_INTERP, ARGIN(const char *encodingname))
 {

Modified: branches/pdd22io_part3/src/exceptions.c
==============================================================================
--- branches/pdd22io_part3/src/exceptions.c	(original)
+++ branches/pdd22io_part3/src/exceptions.c	Mon Dec 29 23:28:53 2008
@@ -40,12 +40,6 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static PMC * die_from_exception(PARROT_INTERP, ARGIN(PMC *exception))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
 PARROT_CAN_RETURN_NULL
 static opcode_t * pass_exception_args(PARROT_INTERP,
     ARGIN(const char *sig),
@@ -89,7 +83,7 @@
 
 /*
 
-=item C<static PMC * die_from_exception>
+=item C<void die_from_exception>
 
 Print a stack trace for C<exception>, a message if there is one, and then exit.
 
@@ -97,9 +91,8 @@
 
 */
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static PMC *
+PARROT_DOES_NOT_RETURN
+void
 die_from_exception(PARROT_INTERP, ARGIN(PMC *exception))
 {
     STRING * const message     = VTABLE_get_string(interp, exception);
@@ -194,9 +187,8 @@
     if (PMC_IS_NULL(handler)) {
         STRING * const message     = VTABLE_get_string(interp, exception);
         const INTVAL   severity    = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "severity"));
-        PMC *dead;
         if (severity < EXCEPT_error) {
-            PMC *resume = VTABLE_get_attr_str(interp, exception, CONST_STRING(interp, "resume"));
+            PMC * const resume = VTABLE_get_attr_str(interp, exception, CONST_STRING(interp, "resume"));
             if (string_equal(interp, message, CONST_STRING(interp, "")) == 1) {
                 Parrot_io_eprintf(interp, "%S\n", message);
             }
@@ -212,7 +204,7 @@
                 return VTABLE_invoke(interp, resume, NULL);
             }
         }
-        dead = die_from_exception(interp, exception);
+        die_from_exception(interp, exception);
     }
 
     address    = VTABLE_invoke(interp, handler, dest);
@@ -253,9 +245,10 @@
         ARGIN(const char *format), va_list arglist)
 {
     /* Make and set exception message. */
-    STRING *msg = strchr(format, '%') ?
-        Parrot_vsprintf_c(interp, format, arglist) :
-        string_make(interp, format, strlen(format), NULL, 0);
+    STRING * const msg =
+        strchr(format, '%')
+            ? Parrot_vsprintf_c(interp, format, arglist)
+            : string_make(interp, format, strlen(format), NULL, 0);
 
     return Parrot_ex_build_exception(interp, EXCEPT_error, ex_type, msg);
 }
@@ -292,7 +285,7 @@
     RunProfile * const profile      = interp->profile;
     Parrot_runloop    *return_point = interp->current_runloop;
     if (PMC_IS_NULL(handler)) {
-        PMC *dead = die_from_exception(interp, exception);
+        die_from_exception(interp, exception);
     }
 
     /* If profiling, remember end time of lastop and generate entry for

Modified: branches/pdd22io_part3/src/gc/register.c
==============================================================================
--- branches/pdd22io_part3/src/gc/register.c	(original)
+++ branches/pdd22io_part3/src/gc/register.c	Mon Dec 29 23:28:53 2008
@@ -342,7 +342,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 Parrot_Context *
-Parrot_push_context(PARROT_INTERP, ARGMOD(INTVAL *n_regs_used))
+Parrot_push_context(PARROT_INTERP, ARGIN(const INTVAL *n_regs_used))
 {
     Parrot_Context * const old = CONTEXT(interp);
     Parrot_Context * const ctx = Parrot_set_new_context(interp, n_regs_used);
@@ -408,7 +408,7 @@
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 Parrot_Context *
-Parrot_alloc_context(PARROT_INTERP, ARGMOD(INTVAL *number_regs_used),
+Parrot_alloc_context(PARROT_INTERP, ARGIN(const INTVAL *number_regs_used),
     ARGIN_NULLOK(Parrot_Context *old))
 {
     Parrot_Context *ctx;
@@ -505,7 +505,7 @@
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 Parrot_Context *
-Parrot_set_new_context(PARROT_INTERP, ARGMOD(INTVAL *number_regs_used))
+Parrot_set_new_context(PARROT_INTERP, ARGIN(const INTVAL *number_regs_used))
 {
     Parrot_Context *old = CONTEXT(interp);
     Parrot_Context *ctx = Parrot_alloc_context(interp, number_regs_used, old);

Modified: branches/pdd22io_part3/src/gc/resources.c
==============================================================================
--- branches/pdd22io_part3/src/gc/resources.c	(original)
+++ branches/pdd22io_part3/src/gc/resources.c	Mon Dec 29 23:28:53 2008
@@ -776,9 +776,8 @@
         PObj_constant_TEST(str)
             ? interp->arena_base->constant_string_pool
             : interp->arena_base->memory_pool;
-    /*
-     * if the requested size is smaller then buflen, we are done
-     */
+
+    /* if the requested size is smaller then buflen, we are done */
     if (newsize <= PObj_buflen(str))
         return;
 
@@ -789,26 +788,28 @@
      */
     new_size = aligned_string_size(newsize);
     old_size = aligned_string_size(PObj_buflen(str));
-    needed = new_size - old_size;
-    if (pool->top_block->free >= needed &&
-            pool->top_block->top == (char*)PObj_bufstart(str) +
-            old_size) {
+    needed   = new_size - old_size;
+
+    if (pool->top_block->free >= needed
+    &&  pool->top_block->top  == (char *)PObj_bufstart(str) + old_size) {
         pool->top_block->free -= needed;
         pool->top_block->top  += needed;
         PObj_buflen(str) = new_size - sizeof (void*);
         return;
     }
+
     PARROT_ASSERT(str->bufused <= newsize);
+
     /* only copy used memory, not total string buffer */
     copysize = str->bufused;
 
-    if (!PObj_COW_TEST(str)) {
+    if (!PObj_COW_TEST(str))
         pool->guaranteed_reclaimable += PObj_buflen(str);
-    }
+
     pool->possibly_reclaimable += PObj_buflen(str);
 
     mem = (char *)mem_allocate(interp, new_size, pool);
-    mem += sizeof (void*);
+    mem += sizeof (void *);
 
     /* copy mem from strstart, *not* bufstart */
     oldmem             = str->strstart;
@@ -818,9 +819,8 @@
 
     /* We shouldn't ever have a 0 from size, but we do. If we can track down
      * those bugs, this can be removed which would make things cheaper */
-    if (copysize) {
+    if (copysize)
         memcpy(mem, oldmem, copysize);
-    }
 }
 
 /*

Modified: branches/pdd22io_part3/src/global.c
==============================================================================
--- branches/pdd22io_part3/src/global.c	(original)
+++ branches/pdd22io_part3/src/global.c	Mon Dec 29 23:28:53 2008
@@ -101,10 +101,8 @@
 static PMC *
 internal_ns_keyed(PARROT_INTERP, ARGIN(PMC *base_ns), ARGIN(PMC *pmc_key), int flags)
 {
-    PMC *sub_ns;
     PMC *ns = base_ns;
     INTVAL i, n;
-    static const INTVAL max_intval = (INTVAL)((~(UINTVAL)0) >> 1); /*2s comp*/
 
     if (pmc_key->vtable->base_type == enum_class_String) {
         STRING *str_key = VTABLE_get_string(interp, pmc_key);
@@ -118,6 +116,8 @@
 
     for (i = 0; i < n; ++i) {
         STRING *part;
+        PMC *sub_ns;
+
         if (!pmc_key)
             Parrot_ex_throw_from_c_args(interp, NULL, 1,
                 "Passed a NULL pmc_key into VTABLE_get_string_keyed_int");

Modified: branches/pdd22io_part3/src/hash.c
==============================================================================
--- branches/pdd22io_part3/src/hash.c	(original)
+++ branches/pdd22io_part3/src/hash.c	Mon Dec 29 23:28:53 2008
@@ -39,8 +39,7 @@
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 PARROT_MALLOC
-static Hash * create_hash(
-    PARROT_INTERP,
+static Hash * create_hash(PARROT_INTERP,
     PARROT_DATA_TYPE val_type,
     Hash_key_type hkey_type,
     ARGIN(hash_comp_fn compare),

Modified: branches/pdd22io_part3/src/hll.c
==============================================================================
--- branches/pdd22io_part3/src/hll.c	(original)
+++ branches/pdd22io_part3/src/hll.c	Mon Dec 29 23:28:53 2008
@@ -344,8 +344,7 @@
 Parrot_register_HLL_type(PARROT_INTERP, INTVAL hll_id,
         INTVAL core_type, INTVAL hll_type)
 {
-    PMC  *entry, *type_hash, *instantiated;
-    Hash *hash;
+    PMC  *entry, *type_hash;
     PMC  *hll_info = interp->HLL_info;
     const INTVAL n = VTABLE_elements(interp, hll_info);
 

Modified: branches/pdd22io_part3/src/inter_call.c
==============================================================================
--- branches/pdd22io_part3/src/inter_call.c	(original)
+++ branches/pdd22io_part3/src/inter_call.c	Mon Dec 29 23:28:53 2008
@@ -333,7 +333,7 @@
 PARROT_EXPORT
 int
 Parrot_init_arg_indexes_and_sig_pmc(SHIM_INTERP, ARGIN(Parrot_Context *ctx),
-        ARGIN_NULLOK(opcode_t *indexes), ARGIN_NULLOK(PMC* sig_pmc),
+        ARGIN_NULLOK(opcode_t *indexes), ARGIN_NULLOK(PMC *sig_pmc),
         ARGMOD(call_state_item *sti))
 {
     if (!sig_pmc && indexes) {
@@ -1415,7 +1415,7 @@
 
             /*
              * Workaround for several argument passing problems
-             * RT#54860 y otros
+             * RT #54860 y otros
              * Save current value while setting the optional
              */
             UnionVal old_value;
@@ -1623,7 +1623,7 @@
 void
 parrot_pass_args(PARROT_INTERP,
         ARGMOD(Parrot_Context *src_ctx), ARGMOD(Parrot_Context *dest_ctx),
-        ARGMOD(opcode_t *src_indexes),     ARGMOD(opcode_t *dest_indexes),
+        ARGMOD(opcode_t *src_indexes),   ARGMOD(opcode_t *dest_indexes),
         arg_pass_t param_or_result)
 {
     call_state st;
@@ -2625,7 +2625,6 @@
     /* args_sig, results_sig */
     PMC *sigs[2];
 
-    const char *x;
     const char *ret_x  = NULL;
 
     indexes[0] = arg_indexes;

Modified: branches/pdd22io_part3/src/io/buffer.c
==============================================================================
--- branches/pdd22io_part3/src/io/buffer.c	(original)
+++ branches/pdd22io_part3/src/io/buffer.c	Mon Dec 29 23:28:53 2008
@@ -254,6 +254,7 @@
     return got;
 }
 
+
 /*
 
 =item C<size_t Parrot_io_read_buffer>
@@ -268,12 +269,11 @@
 Parrot_io_read_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle),
               ARGIN(STRING **buf))
 {
-    unsigned char *out_buf;
-    STRING *s;
-    size_t len;
-    size_t current = 0;
-    INTVAL buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
-    unsigned char *buffer_start, *buffer_next, *buffer_end;
+    unsigned char *out_buf, *buffer_start, *buffer_next, *buffer_end;
+    STRING        *s;
+    size_t         len;
+    size_t         current      = 0;
+    INTVAL         buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
 
     /* write buffer flush */
     if (buffer_flags & PIO_BF_WRITEBUF) {
@@ -286,25 +286,27 @@
     buffer_end   = Parrot_io_get_buffer_end(interp, filehandle);
 
     /* line buffered read */
-    if (Parrot_io_get_flags(interp, filehandle) & PIO_F_LINEBUF) {
+    if (Parrot_io_get_flags(interp, filehandle) & PIO_F_LINEBUF)
         return Parrot_io_readline_buffer(interp, filehandle, buf);
-    }
 
     if (*buf == NULL) {
         *buf = new_string_header(interp, 0);
         (*buf)->bufused = len = 2048;
     }
-    s = *buf;
+
+    s   = *buf;
     len = s->bufused;
-    if (!s->strstart) {
+
+    if (!s->strstart)
         Parrot_allocate_string(interp, s, len);
-    }
+
     out_buf = (unsigned char *)s->strstart;
+
     /* read Data from buffer */
     if (buffer_flags & PIO_BF_READBUF) {
         const size_t avail = buffer_end - buffer_next;
+        current            = avail < len ? avail : len;
 
-        current = avail < len ? avail : len;
         memcpy(out_buf, buffer_next, current);
         buffer_next += current;
         Parrot_io_set_buffer_next(interp, filehandle, buffer_next);
@@ -315,6 +317,7 @@
         if (current == avail) {
             buffer_flags &= ~PIO_BF_READBUF;
             Parrot_io_set_buffer_flags(interp, filehandle, buffer_flags);
+
             /* Reset next and end */
             Parrot_io_set_buffer_end(interp, filehandle, NULL);
             Parrot_io_set_buffer_next(interp, filehandle, buffer_start);
@@ -337,8 +340,8 @@
         size_t got;
 
         if (len >= Parrot_io_get_buffer_size(interp, filehandle)) {
-            STRING  fake;
-            STRING *sf = &fake;
+            STRING     fake;
+            STRING    *sf = &fake;
 
             fake.strstart = (char *)out_buf;
             fake.bufused  = len;
@@ -395,13 +398,10 @@
 Parrot_io_peek_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle),
         ARGOUT(STRING **buf))
 {
-    UINTVAL len   = 1;
-    size_t  avail = 0;
-
+    unsigned char *buffer_next;
+    STRING * const s            = Parrot_io_make_string(interp, buf, 1);
+    UINTVAL        len          = 1;
     INTVAL         buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
-    unsigned char *buffer_next, *buffer_end;
-
-    STRING * const s = Parrot_io_make_string(interp, buf, 1);
 
     /* write buffer flush */
     if (buffer_flags & PIO_BF_WRITEBUF) {
@@ -410,28 +410,16 @@
     }
 
     buffer_next  = Parrot_io_get_buffer_next(interp, filehandle);
-    buffer_end   = Parrot_io_get_buffer_end(interp, filehandle);
-
-    /* read Data from buffer */
-    if (buffer_flags & PIO_BF_READBUF) {
-        avail = buffer_end - buffer_next;
-
-        /* if we have data available, copy out the next byte */
-        if (avail) {
-ret_string:
-            memcpy(s->strstart, buffer_next, len);
-            s->bufused = s->strlen = len;
-            return len;
-        }
-    }
 
     /* (re)fill the buffer */
     if (! (buffer_flags & PIO_BF_READBUF)) {
         size_t got;
-        /* exception if we're unbuffered */
-        if (Parrot_io_get_buffer_size(interp, filehandle) == 0)
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
-                "Can't peek at unbuffered I/O");
+
+        /* promote to buffered if unbuffered */
+        if (Parrot_io_get_buffer_size(interp, filehandle) == 0) {
+            Parrot_io_setbuf(interp, filehandle, 1);
+            return Parrot_io_peek_buffer(interp, filehandle, buf);
+        }
 
         /* Parrot_io_fill_readbuf() can return -1, but len should be positive */
         got = Parrot_io_fill_readbuf(interp, filehandle);
@@ -446,9 +434,13 @@
     }
 
     /* if we got any data, then copy out the next byte */
-    goto ret_string;
+    memmove(s->strstart, buffer_next, len);
+    s->bufused = s->strlen = len;
+
+    return len;
 }
 
+
 /*
 
 =item C<size_t Parrot_io_readline_buffer>
@@ -566,13 +558,13 @@
 {
     size_t avail;
     void * const buffer = s->strstart;
-    size_t len = s->bufused;
+    const size_t len = s->bufused;
     int need_flush;
 
-    INTVAL         buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
-    unsigned char *buffer_start = Parrot_io_get_buffer_start(interp, filehandle);
-    unsigned char *buffer_next  = Parrot_io_get_buffer_next(interp, filehandle);
-    size_t         buffer_size  = Parrot_io_get_buffer_size(interp, filehandle);
+    INTVAL                buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
+    unsigned char * const buffer_start = Parrot_io_get_buffer_start(interp, filehandle);
+    unsigned char *       buffer_next  = Parrot_io_get_buffer_next(interp, filehandle);
+    const size_t          buffer_size  = Parrot_io_get_buffer_size(interp, filehandle);
 
     if (len <= 0)
         return 0;

Modified: branches/pdd22io_part3/src/io/filehandle.c
==============================================================================
--- branches/pdd22io_part3/src/io/filehandle.c	(original)
+++ branches/pdd22io_part3/src/io/filehandle.c	Mon Dec 29 23:28:53 2008
@@ -73,51 +73,6 @@
         }
     }
 
-    /* These comparisons are put in place for backward compatibility, and will
-     * be removed after a deprecation cycle. */
-    if (flags == 0) {
-        INTVAL first = string_index(interp, mode_str, 0);
-        INTVAL second = string_index(interp, mode_str, 1);
-        switch (first) {
-            case '+':
-                flags |= (PIO_F_WRITE | PIO_F_READ);
-                switch (second) {
-                    case '<':
-                        break;
-                    case '>':
-                        flags |= PIO_F_TRUNC;
-                        break;
-                    default:
-                        return 0;
-                }
-                break;
-            case '<':
-                flags |= PIO_F_READ;
-                break;
-            case '>':
-                flags |= PIO_F_WRITE;
-                if (second == '>') {
-                    flags |= PIO_F_APPEND;
-                }
-                else {
-                    flags |= PIO_F_TRUNC;
-                }
-                break;
-            case '-':       /* -| read from pipe */
-                if (second == '|') {
-                    flags |= PIO_F_PIPE | PIO_F_READ;
-                }
-                break;
-            case '|':       /* |- write to pipe */
-                if (second == '-') {
-                    flags |= PIO_F_PIPE | PIO_F_WRITE;
-                }
-                break;
-            default:
-                return 0;
-        }
-    }
-
     return flags;
 }
 
@@ -168,7 +123,7 @@
     else {
         STRING *s = *buf;
         if (s->bufused < len)
-            Parrot_allocate_string(interp, s, len);
+            Parrot_reallocate_string(interp, s, len);
         return s;
     }
 }
@@ -178,7 +133,7 @@
 
 =item C<void Parrot_io_set_os_handle>
 
-Set the C<os_handle> attribute of the FileHandle object, which stores the
+Sets the C<os_handle> attribute of the FileHandle object, which stores the
 low-level filehandle for the OS.
 
 Currently, this pokes directly into the C struct of the FileHandle PMC. This

Modified: branches/pdd22io_part3/src/io/portable.c
==============================================================================
--- branches/pdd22io_part3/src/io/portable.c	(original)
+++ branches/pdd22io_part3/src/io/portable.c	Mon Dec 29 23:28:53 2008
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2007, The Perl Foundation.
+Copyright (C) 2001-2008, The Perl Foundation.
 $Id$
 
 =head1 NAME
@@ -80,11 +80,12 @@
     }
 }
 
+
 /*
 
 =item C<INTVAL Parrot_io_init_portable>
 
-Setup standard streams, etc.
+Sets up standard streams, etc.
 
 =cut
 
@@ -109,11 +110,12 @@
     return 0;
 }
 
+
 /*
 
 =item C<PMC * Parrot_io_open_portable>
 
-Open a new FileHandle PMC from a given path.
+Opens a new FileHandle PMC from a given STRING path with the provided modes.
 
 =cut
 
@@ -126,7 +128,7 @@
               ARGIN(STRING *path), INTVAL flags)
 {
     const char *oflags;
-    FILE *fptr;
+    FILE       *fptr;
 
     if ((flags & (PIO_F_WRITE | PIO_F_READ)) == 0)
         return NULL;
@@ -138,17 +140,18 @@
 
     { /* scope for temporary C string */
         const char *spath = string_to_cstring(interp, path);
-        /* Try opening the file- note that this can't really handle O_EXCL, etc. */
+        /* Try opening the file
+         * note that this can't really handle O_EXCL, etc. */
         fptr = fopen(spath, oflags);
 
-        if (fptr == NULL && errno == ENOENT && (flags & PIO_F_WRITE)) {
+        if (fptr == NULL && errno == ENOENT && (flags & PIO_F_WRITE))
             fptr = fopen(spath, "w+b");
-        }
+
         string_cstring_free(spath);
     }
 
     /* File open */
-    if (fptr != NULL) {
+    if (fptr) {
         PMC *io;
         if (io_is_tty_portable((PIOHANDLE)fptr))
             flags |= PIO_F_CONSOLE;
@@ -170,7 +173,7 @@
 
 =item C<PMC * Parrot_io_fdopen_portable>
 
-RT#48260: Not yet documented!!!
+Associates an IO PMC with a file descriptor.
 
 =cut
 
@@ -196,6 +199,7 @@
         io = filehandle;
 
     Parrot_io_set_os_handle(interp, filehandle, (PIOHANDLE)fptr);
+
     return io;
 }
 
@@ -204,7 +208,7 @@
 
 =item C<INTVAL Parrot_io_close_portable>
 
-RT#48260: Not yet documented!!!
+Closes the underlying filehandle of a given IO PMC.
 
 =cut
 
@@ -213,19 +217,22 @@
 INTVAL
 Parrot_io_close_portable(PARROT_INTERP, ARGMOD(PMC *filehandle))
 {
-    FILE * const fptr = (FILE*) Parrot_io_get_os_handle(interp, filehandle);
+    FILE * const fptr = (FILE *)Parrot_io_get_os_handle(interp, filehandle);
 
-    if (fptr != NULL)
+    if (fptr)
         fclose(fptr);
+
     Parrot_io_set_os_handle(interp, filehandle, (PIOHANDLE)NULL);
+
     return 0;
 }
 
+
 /*
 
 =item C<INTVAL Parrot_io_is_closed_portable>
 
-Test whether the filehandle has been closed.
+Tests whether the filehandle has been closed.
 
 =cut
 
@@ -245,7 +252,7 @@
 
 =item C<static INTVAL io_is_tty_portable>
 
-RT#48260: Not yet documented!!!
+Tests whether the given file descriptor is attached to a tty.
 
 =cut
 
@@ -260,11 +267,12 @@
     return 0;
 }
 
+
 /*
 
 =item C<size_t Parrot_io_peek_portable>
 
-Retrieve the next character in the stream without modifying the stream.
+Retrieves the next character in the stream without modifying the stream.
 
 =cut
 
@@ -275,16 +283,16 @@
         ARGIN(PMC *filehandle),
         ARGIN(STRING **buf))
 {
-    FILE * const fptr = (FILE *) Parrot_io_get_os_handle(interp, filehandle);
-    STRING * const s = Parrot_io_make_string(interp, buf, 1);
+    FILE   * const fptr  = (FILE *)Parrot_io_get_os_handle(interp, filehandle);
+    STRING * const s     = Parrot_io_make_string(interp, buf, 1);
 
     /* read the next byte into the buffer */
-    const size_t bytes = fread(s->strstart, 1, 1, fptr);
+    const size_t   bytes = fread(s->strstart, 1, 1, fptr);
 
     /* if we got anything from the stream, push it back on */
     if (bytes) {
         s->bufused = s->strlen = 1;
-        ungetc(*(char*)s->strstart, fptr);
+        ungetc(*(char *)s->strstart, fptr);
     }
     else
         s->bufused = s->strlen = 1;
@@ -297,7 +305,7 @@
 
 =item C<INTVAL Parrot_io_getblksize_portable>
 
-RT#48260: Not yet documented!!!
+Returns the block size of the given file descriptor.
 
 =cut
 
@@ -317,7 +325,7 @@
 
 =item C<INTVAL Parrot_io_flush_portable>
 
-RT#48260: Not yet documented!!!
+Flushes the underlying file descriptor of the given IO PMC.
 
 =cut
 
@@ -326,7 +334,7 @@
 INTVAL
 Parrot_io_flush_portable(SHIM_INTERP, SHIM(PMC *filehandle))
 {
-    return fflush((FILE*)Parrot_io_get_os_handle(interp, filehandle));
+    return fflush((FILE *)Parrot_io_get_os_handle(interp, filehandle));
 }
 
 
@@ -334,7 +342,8 @@
 
 =item C<size_t Parrot_io_read_portable>
 
-RT#48260: Not yet documented!!!
+Reads from the given filehandle into the provided STRING, returning the number
+of bytes read.
 
 =cut
 
@@ -344,20 +353,18 @@
 Parrot_io_read_portable(PARROT_INTERP, SHIM(PMC *filehandle),
               ARGIN(STRING **buf))
 {
-    FILE * const fptr = (FILE *)Parrot_io_get_os_handle(interp, filehandle);
-    STRING * const s = Parrot_io_make_string(interp, buf, 2048);
-    const size_t len = s->bufused;
-    void * const buffer = s->strstart;
-
-    const size_t bytes = fread(buffer, 1, len, fptr);
+    FILE   * const fptr   = (FILE *)Parrot_io_get_os_handle(interp, filehandle);
+    STRING * const s      = Parrot_io_make_string(interp, buf, 2048);
+    void   * const buffer = s->strstart;
+    const   size_t len    = s->bufused;
+    const   size_t bytes  = fread(buffer, 1, len, fptr);
 
     s->bufused = s->strlen = bytes;
 
     if (bytes != len) {
-        if (feof(fptr)) {
+        if (feof(fptr))
             Parrot_io_set_flags(interp, filehandle,
-                                (Parrot_io_get_flags(interp, filehandle) | PIO_F_EOF));
-        }
+                (Parrot_io_get_flags(interp, filehandle) | PIO_F_EOF));
     }
 
     return bytes;
@@ -368,7 +375,7 @@
 
 =item C<size_t Parrot_io_write_portable>
 
-RT#48260: Not yet documented!!!
+Writes the given STRING to the provided IO PMC.
 
 =cut
 
@@ -379,14 +386,15 @@
 {
     void * const buffer = s->strstart;
     return fwrite(buffer, 1, s->bufused,
-                  (FILE*)Parrot_io_get_os_handle(interp, filehandle));
+                  (FILE *)Parrot_io_get_os_handle(interp, filehandle));
 }
 
+
 /*
 
 =item C<PIOOFF_T Parrot_io_seek_portable>
 
-RT#48260: Not yet documented!!!
+Seeks to the given offset and position within the provided IO PMC.
 
 =cut
 
@@ -399,21 +407,23 @@
     PIOOFF_T pos;
     errno = 0;
 
-    if ((pos = fseek((FILE*)Parrot_io_get_os_handle(interp, filehandle),
+    if ((pos = fseek((FILE *)Parrot_io_get_os_handle(interp, filehandle),
                     (long)offset, whence)) >= 0)
         Parrot_io_set_file_position(interp, filehandle, pos);
 
     /* Seek clears EOF */
     Parrot_io_set_flags(interp, filehandle,
             (Parrot_io_get_flags(interp, filehandle) & ~PIO_F_EOF));
+
     return pos;
 }
 
+
 /*
 
 =item C<PIOOFF_T Parrot_io_tell_portable>
 
-RT#48260: Not yet documented!!!
+Returns the current position of the given IO PMC.
 
 =cut
 
@@ -422,14 +432,15 @@
 PIOOFF_T
 Parrot_io_tell_portable(PARROT_INTERP, ARGIN(PMC *filehandle))
 {
-    return (ftell((FILE*)Parrot_io_get_os_handle(interp, filehandle)));
+    return (ftell((FILE *)Parrot_io_get_os_handle(interp, filehandle)));
 }
 
+
 /*
 
 =item C<PMC * Parrot_io_open_pipe_portable>
 
-Open a pipe. Not implemented for this platform.
+Opens a pipe. Not implemented for this platform.
 
 =cut
 

Modified: branches/pdd22io_part3/src/jit.c
==============================================================================
--- branches/pdd22io_part3/src/jit.c	(original)
+++ branches/pdd22io_part3/src/jit.c	Mon Dec 29 23:28:53 2008
@@ -366,10 +366,8 @@
                     else if (flags & KEY_string_FLAG)
                         typ = 2;
 
-                    if (n < NUM_REGISTERS) {
-                        if (!ru[typ].reg_count[n]++)
-                            ru[typ].reg_dir[n] |= PARROT_ARGDIR_IN;
-                    }
+                    if (n < NUM_REGISTERS && !ru[typ].reg_count[n]++)
+                        ru[typ].reg_dir[n] |= PARROT_ARGDIR_IN;
                 }
                 key = key_next(interp, key);
             }
@@ -393,7 +391,7 @@
 static void
 init_regusage(PARROT_INTERP, Parrot_jit_optimizer_section_ptr cur_section)
 {
-    int typ, j;
+    int typ;
 
     cur_section->ru[0].registers_used =
         CONTEXT(interp)->n_regs_used[REGNO_INT];
@@ -401,9 +399,11 @@
         CONTEXT(interp)->n_regs_used[REGNO_NUM];
     cur_section->ru[1].registers_used =
         cur_section->ru[2].registers_used = 0;
-    for (typ = 0; typ < 4; typ++)
+    for (typ = 0; typ < 4; typ++) {
+        int j;
         for (j = 0; j < cur_section->ru[typ].registers_used; j++)
             cur_section->ru[typ].reg_usage[j] = j;
+    }
 }
 
 /*

Modified: branches/pdd22io_part3/src/jit/alpha/jit_defs.c
==============================================================================
--- branches/pdd22io_part3/src/jit/alpha/jit_defs.c	(original)
+++ branches/pdd22io_part3/src/jit/alpha/jit_defs.c	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,9 @@
 /* Stub file for RT#38929 fixes */
+/*
+Copyright (C) 2008, The Perl Foundation.
+$Id$
+*/
+/* HEADERIZER HFILE: none */
 
 /*
  * Local variables:

Modified: branches/pdd22io_part3/src/jit/amd64/jit_defs.c
==============================================================================
--- branches/pdd22io_part3/src/jit/amd64/jit_defs.c	(original)
+++ branches/pdd22io_part3/src/jit/amd64/jit_defs.c	Mon Dec 29 23:28:53 2008
@@ -1,7 +1,13 @@
+/*
+Copyright (C) 2008, The Perl Foundation.
+$Id$
+*/
 
 #include "parrot/parrot.h"
 #include "jit_emit.h"
 
+/* HEADERIZER HFILE: none */
+
 /*
  * enumerate these mapped registers
  * please note that you have to preserve registers in

Modified: branches/pdd22io_part3/src/jit/arm/jit_defs.c
==============================================================================
--- branches/pdd22io_part3/src/jit/arm/jit_defs.c	(original)
+++ branches/pdd22io_part3/src/jit/arm/jit_defs.c	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,9 @@
 /* Stub file for RT#38929 fixes */
+/*
+Copyright (C) 2008, The Perl Foundation.
+$Id$
+*/
+/* HEADERIZER HFILE: none */
 
 /*
  * Local variables:

Modified: branches/pdd22io_part3/src/jit/hppa/jit_defs.c
==============================================================================
--- branches/pdd22io_part3/src/jit/hppa/jit_defs.c	(original)
+++ branches/pdd22io_part3/src/jit/hppa/jit_defs.c	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,9 @@
 /* Stub file for RT#38929 fixes */
+/*
+Copyright (C) 2008, The Perl Foundation.
+$Id$
+*/
+/* HEADERIZER HFILE: none */
 
 /*
  * Local variables:

Modified: branches/pdd22io_part3/src/jit/i386/jit_defs.c
==============================================================================
--- branches/pdd22io_part3/src/jit/i386/jit_defs.c	(original)
+++ branches/pdd22io_part3/src/jit/i386/jit_defs.c	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,9 @@
 /* Stub file for RT#38929 fixes */
+/*
+Copyright (C) 2008, The Perl Foundation.
+$Id$
+*/
+/* HEADERIZER HFILE: none */
 
 /*
  * Local variables:

Modified: branches/pdd22io_part3/src/jit/ia64/jit_defs.c
==============================================================================
--- branches/pdd22io_part3/src/jit/ia64/jit_defs.c	(original)
+++ branches/pdd22io_part3/src/jit/ia64/jit_defs.c	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,9 @@
 /* Stub file for RT#38929 fixes */
+/*
+Copyright (C) 2008, The Perl Foundation.
+$Id$
+*/
+/* HEADERIZER HFILE: none */
 
 /*
  * Local variables:

Modified: branches/pdd22io_part3/src/jit/mips/jit_defs.c
==============================================================================
--- branches/pdd22io_part3/src/jit/mips/jit_defs.c	(original)
+++ branches/pdd22io_part3/src/jit/mips/jit_defs.c	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,9 @@
 /* Stub file for RT#38929 fixes */
+/*
+Copyright (C) 2008, The Perl Foundation.
+$Id$
+*/
+/* HEADERIZER HFILE: none */
 
 /*
  * Local variables:

Modified: branches/pdd22io_part3/src/jit/ppc/jit_defs.c
==============================================================================
--- branches/pdd22io_part3/src/jit/ppc/jit_defs.c	(original)
+++ branches/pdd22io_part3/src/jit/ppc/jit_defs.c	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,9 @@
 /* Stub file for RT#38929 fixes */
+/*
+Copyright (C) 2008, The Perl Foundation.
+$Id$
+*/
+/* HEADERIZER HFILE: none */
 
 /*
  * Local variables:

Modified: branches/pdd22io_part3/src/jit/skeleton/jit_defs.c
==============================================================================
--- branches/pdd22io_part3/src/jit/skeleton/jit_defs.c	(original)
+++ branches/pdd22io_part3/src/jit/skeleton/jit_defs.c	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,9 @@
 /* Stub file for RT#38929 fixes */
+/*
+Copyright (C) 2008, The Perl Foundation.
+$Id$
+*/
+/* HEADERIZER HFILE: none */
 
 /*
  * Local variables:

Modified: branches/pdd22io_part3/src/jit/sun4/jit_defs.c
==============================================================================
--- branches/pdd22io_part3/src/jit/sun4/jit_defs.c	(original)
+++ branches/pdd22io_part3/src/jit/sun4/jit_defs.c	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,9 @@
 /* Stub file for RT#38929 fixes */
+/*
+Copyright (C) 2008, The Perl Foundation.
+$Id$
+*/
+/* HEADERIZER HFILE: none */
 
 /*
  * Local variables:

Modified: branches/pdd22io_part3/src/list.c
==============================================================================
--- branches/pdd22io_part3/src/list.c	(original)
+++ branches/pdd22io_part3/src/list.c	Mon Dec 29 23:28:53 2008
@@ -652,30 +652,33 @@
     int do_sparse = (INTVAL)idx - (INTVAL)list->cap >= 10 * MAX_ITEMS;
 
     if (list->item_type == enum_type_sized) {
-        items = list->items_per_chunk;
-        size = items * list->item_size;
+        do_sparse = 0;
+        items     = list->items_per_chunk;
+        size      = items * list->item_size;
+
         list->grow_policy = items == MAX_ITEMS ?
             enum_grow_fixed : enum_grow_mixed;
-        do_sparse = 0;
     }
     else if (do_sparse) {
         PARROT_ASSERT(where);
         /* don't add sparse chunk at start of list */
         if (!list->n_chunks) {
-            list->grow_policy = enum_grow_fixed;
-            /* if wee need more, the next allocation will allocate the rest */
-            items = MAX_ITEMS;
-            size = items * list->item_size;
             do_sparse = 0;
+            items     = MAX_ITEMS;
+
+            /* if we need more, the next allocation will allocate the rest */
+            size = items * list->item_size;
+            list->grow_policy = enum_grow_fixed;
         }
         else {
+            /* allocate a dummy chunk holding many items virtually */
+            size  = list->item_size;
             items = idx - list->cap - 1;
+
             /* round down this function will then be called again, to add the
              * final real chunk, with the rest of the needed size */
             items &= ~(MAX_ITEMS - 1);
             list->grow_policy = enum_grow_mixed;
-            /* allocate a dummy chunk holding many items virtually */
-            size = list->item_size;
         }
     }
     /* initial size for empty lists grow_policy is not yet known or was
@@ -752,9 +755,10 @@
     if (where) {                /* at end */
         if (chunk)
             chunk->next = new_chunk;
-        list->last = new_chunk;
         if (!list->first)
             list->first = new_chunk;
+
+        list->last = new_chunk;
     }
     else {
         new_chunk->next = chunk;

Modified: branches/pdd22io_part3/src/ops/core.ops
==============================================================================
--- branches/pdd22io_part3/src/ops/core.ops	(original)
+++ branches/pdd22io_part3/src/ops/core.ops	Mon Dec 29 23:28:53 2008
@@ -133,7 +133,7 @@
 }
 
 inline op prederef__() :internal :flow {
-    opcode_t *_this = CUR_OPCODE;
+    const opcode_t * const _this = CUR_OPCODE;
     if (interp->run_core & PARROT_CGOTO_CORE) {
         /* must be CGP then - check for events in not yet prederefed code */
         Parrot_cx_runloop_wake(interp, interp->scheduler);
@@ -1332,7 +1332,7 @@
 
 op dlfunc(out PMC, invar PMC, in STR, in STR) {
     char * const name = string_to_cstring(interp, ($3));
-    void *ptr         = Parrot_dlsym(
+    void * const ptr  = Parrot_dlsym(
                             PMC_IS_NULL($2) ? NULL :
                             VTABLE_defined(interp, $2) ? PMC_data($2) :
                             NULL,

Modified: branches/pdd22io_part3/src/ops/experimental.ops
==============================================================================
--- branches/pdd22io_part3/src/ops/experimental.ops	(original)
+++ branches/pdd22io_part3/src/ops/experimental.ops	Mon Dec 29 23:28:53 2008
@@ -146,31 +146,12 @@
 }
 
 
-=item B<slice>(out PMC, invar PMC, in KEY)
-
-Return a new Iterator PMC $1 for aggregate $2 and Slice PMC $3.
-
-=item B<slice>(out PMC, invar PMC, in KEY, inconst INT)
-
-Return a new list PMC $1 for aggregate $2 and Slice PMC $3.
-
-This is a Python opcode. Range is i <= k < j. $4 must be 1.
-May change and move to python.ops.
-
 =item B<iter>(out PMC, invar PMC)
 
 Return a new Iterator PMC $1 for aggregate $2.
 
 =cut
 
-inline op slice(out PMC, invar PMC, in KEY) :base_core {
-    $1 = VTABLE_slice(interp, $2, $3, 0);
-}
-
-inline op slice(out PMC, invar PMC, in KEY, inconst INT) :python {
-    $1 = VTABLE_slice(interp, $2, $3, $4);
-}
-
 inline op iter(out PMC, invar PMC) :base_core {
     $1 = VTABLE_get_iter(interp, $2);
 }

Modified: branches/pdd22io_part3/src/ops/io.ops
==============================================================================
--- branches/pdd22io_part3/src/ops/io.ops	(original)
+++ branches/pdd22io_part3/src/ops/io.ops	Mon Dec 29 23:28:53 2008
@@ -93,12 +93,19 @@
 =item B<open>(out PMC, in STR, in STR)
 
 Open URL (file, address, database, in core image) named $2 with
-Perl style mode string in $3 and create an IO object in $1.
+a mode string in $3 and create an IO object in $1.
+
+The mode consists of a string of characters specified in any order:
+
+ r : read
+ w : write
+ a : append (Note: you must specify "wa", not just "a")
+ p : pipe
 
 =item B<open>(out PMC, in STR)
 
 Open URL (file, address, database, in core image) named $2 with
-read/write mode and create an IO object in $1.
+read mode and create an IO object in $1.
 
 =cut
 

Modified: branches/pdd22io_part3/src/pmc/env.pmc
==============================================================================
--- branches/pdd22io_part3/src/pmc/env.pmc	(original)
+++ branches/pdd22io_part3/src/pmc/env.pmc	Mon Dec 29 23:28:53 2008
@@ -159,15 +159,14 @@
         else {
             char * const keyname = string_to_cstring(interp,
                 VTABLE_get_string(interp, key));
-            char *val            = NULL;
 
             if (keyname) {
                 int free_it = 0;
-                val         = Parrot_getenv(keyname, &free_it);
+                char * const val = Parrot_getenv(keyname, &free_it);
                 string_cstring_free(keyname);
 
                 if (val) {
-                    STRING *retval = string_from_cstring(interp, val, 0);
+                    STRING * const retval = string_from_cstring(interp, val, 0);
 
                     if (free_it)
                         mem_sys_free(val);

Modified: branches/pdd22io_part3/src/pmc/namespace.pmc
==============================================================================
--- branches/pdd22io_part3/src/pmc/namespace.pmc	(original)
+++ branches/pdd22io_part3/src/pmc/namespace.pmc	Mon Dec 29 23:28:53 2008
@@ -535,6 +535,25 @@
 
 /*
 
+=item C<METHOD make_namespace(PMC* key)>
+
+Create and retrieve the namespace given by C<key>.  If the namespace
+already exists, only retrieve it.
+
+=cut
+
+*/
+
+    METHOD make_namespace(PMC *key) {
+        PMC *ns = Parrot_get_namespace_keyed(INTERP, SELF, key);
+        if (PMC_IS_NULL(ns)) {
+            ns = Parrot_make_namespace_keyed(INTERP, SELF, key);
+        }
+        RETURN(PMC *ns);
+    }
+
+/*
+
 =item C<METHOD add_namespace(STRING *name, PMC *namespace)>
 
 Stores the given namespace under this namespace, with the given name.  Throws

Modified: branches/pdd22io_part3/src/pmc/role.pmc
==============================================================================
--- branches/pdd22io_part3/src/pmc/role.pmc	(original)
+++ branches/pdd22io_part3/src/pmc/role.pmc	Mon Dec 29 23:28:53 2008
@@ -296,8 +296,8 @@
 */
 
     VTABLE void add_attribute(STRING *name, PMC *type) {
-        Parrot_Role_attributes * const role          = PARROT_ROLE(SELF);
-        PMC         * const new_attribute = pmc_new(interp, enum_class_Hash);
+        Parrot_Role_attributes * const role  = PARROT_ROLE(SELF);
+        PMC           * const new_attribute  = pmc_new(interp, enum_class_Hash);
 
         /* Set name and type. */
         VTABLE_set_string_keyed_str(interp, new_attribute, CONST_STRING(interp, "name"), name);
@@ -486,7 +486,7 @@
 
     VTABLE STRING *get_string() {
         Parrot_Role_attributes * const role  = PARROT_ROLE(SELF);
-        PMC         * const _namespace = role->_namespace;
+        PMC               * const _namespace = role->_namespace;
 
         if (!PMC_IS_NULL(_namespace)) {
             /* Call the 'get_name' method on the role's associated namespace
@@ -586,7 +586,7 @@
 
     METHOD name(STRING *name :optional, int got_name :opt_flag) {
         Parrot_Role_attributes *role     = PARROT_ROLE(SELF);
-        STRING      *ret_name = NULL;
+        STRING                 *ret_name = NULL;
 
         if (got_name) {
             /* We'll build a hash just containing the name, then give this to
@@ -613,8 +613,8 @@
 */
 
     METHOD get_namespace() {
-        Parrot_Role_attributes *role          = PARROT_ROLE(SELF);
-        PMC         *ret_namespace = role->_namespace;
+        Parrot_Role_attributes *role = PARROT_ROLE(SELF);
+        PMC           *ret_namespace = role->_namespace;
         RETURN(PMC *ret_namespace);
     }
 

Modified: branches/pdd22io_part3/src/pmc/slice.pmc
==============================================================================
--- branches/pdd22io_part3/src/pmc/slice.pmc	(original)
+++ branches/pdd22io_part3/src/pmc/slice.pmc	Mon Dec 29 23:28:53 2008
@@ -174,7 +174,7 @@
  * next range PMC in Key chain
  */
 static void
-set_slice_next(PARROT_INTERP, PMC *self, PMC *agg)
+set_slice_next(PARROT_INTERP, ARGMOD(PMC *self))
 {
     parrot_range_t * const r = (parrot_range_t *)PMC_struct_val(self);
 
@@ -396,7 +396,7 @@
 
                 /* we are passed now the new PMC we created above */
             case ITERATE_GET_NEXT:
-                set_slice_next(INTERP, SELF, agg);
+                set_slice_next(INTERP, SELF);
                 break;
             default:
                 Parrot_ex_throw_from_c_args(INTERP, NULL,

Modified: branches/pdd22io_part3/src/runops_cores.c
==============================================================================
--- branches/pdd22io_part3/src/runops_cores.c	(original)
+++ branches/pdd22io_part3/src/runops_cores.c	Mon Dec 29 23:28:53 2008
@@ -126,7 +126,6 @@
     static size_t dod, gc;
     Arenas * const arena_base = interp->arena_base;
     Interp *debugger;
-    PMC* pio;
 
     dod = arena_base->dod_runs;
     gc = arena_base->collect_runs;

Modified: branches/pdd22io_part3/src/stacks.c
==============================================================================
--- branches/pdd22io_part3/src/stacks.c	(original)
+++ branches/pdd22io_part3/src/stacks.c	Mon Dec 29 23:28:53 2008
@@ -198,7 +198,7 @@
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 Stack_Entry_t *
-stack_entry(PARROT_INTERP, ARGIN(Stack_Chunk_t *stack), INTVAL depth)
+stack_entry(SHIM_INTERP, ARGIN(Stack_Chunk_t *stack), INTVAL depth)
 {
     Stack_Chunk_t *chunk;
     size_t         offset = (size_t)depth;

Modified: branches/pdd22io_part3/src/stm/waitlist.c
==============================================================================
--- branches/pdd22io_part3/src/stm/waitlist.c	(original)
+++ branches/pdd22io_part3/src/stm/waitlist.c	Mon Dec 29 23:28:53 2008
@@ -15,7 +15,7 @@
 
 =head1 DESCRIPTION
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =head2 Functions
 
@@ -91,7 +91,7 @@
 
 =item C<static struct waitlist_thread_data * get_thread>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -120,7 +120,7 @@
 
 =item C<static struct waitlist_thread_data * get_thread_noalloc>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -139,7 +139,7 @@
 
 =item C<static struct waitlist_entry * alloc_entry>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -182,7 +182,7 @@
 
 =item C<static void add_entry>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -211,7 +211,7 @@
 
 =item C<static int remove_first>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -236,7 +236,7 @@
 
 =item C<static void waitlist_remove>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -294,7 +294,7 @@
 
 =item C<static void waitlist_remove_check>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -322,7 +322,7 @@
 
 =item C<static void waitlist_signal_one>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -350,7 +350,7 @@
 
 =item C<static void waitlist_signal_all>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -396,7 +396,7 @@
 
 =item C<void Parrot_STM_waitlist_add_self>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -419,7 +419,7 @@
 
 =item C<void Parrot_STM_waitlist_signal>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -438,7 +438,7 @@
 
 =item C<void Parrot_STM_waitlist_remove_all>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -476,7 +476,7 @@
 
 =item C<void Parrot_STM_waitlist_wait>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -507,7 +507,7 @@
 
 =item C<void Parrot_STM_waitlist_init>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -525,7 +525,7 @@
 
 =item C<void Parrot_STM_waitlist_destroy_thread>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -556,7 +556,7 @@
 
 =item C<static STM_tx_log * Parrot_STM_tx_log_alloc>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 
@@ -600,7 +600,7 @@
 
 =item C<STM_tx_log * Parrot_STM_tx_log_get>
 
-RT#48260: Not yet documented!!!
+RT #48260: Not yet documented!!!
 
 =cut
 

Modified: branches/pdd22io_part3/src/sub.c
==============================================================================
--- branches/pdd22io_part3/src/sub.c	(original)
+++ branches/pdd22io_part3/src/sub.c	Mon Dec 29 23:28:53 2008
@@ -488,7 +488,6 @@
 
     Parrot_block_GC_mark(interp);
     if (Parrot_Context_get_info(interp, ctx, &info)) {
-        static const char unknown_file[] = "(unknown file)";
         DECL_CONST_CAST;
 
         res = Parrot_sprintf_c(interp,
@@ -668,14 +667,14 @@
 */
 
 void
-Parrot_continuation_rewind_environment(PARROT_INTERP, ARGIN(PMC *pmc),
+Parrot_continuation_rewind_environment(PARROT_INTERP, SHIM(PMC *pmc),
         ARGIN(Parrot_cont *cc))
 {
-    Parrot_Context *to_ctx = cc->to_ctx;
+    Parrot_Context * const to_ctx = cc->to_ctx;
 
     /* debug print before context is switched */
     if (Interp_trace_TEST(interp, PARROT_TRACE_SUB_CALL_FLAG)) {
-        PMC *sub = to_ctx->current_sub;
+        PMC * const sub = to_ctx->current_sub;
 
         Parrot_io_eprintf(interp, "# Back in sub '%Ss', env %p\n",
                     Parrot_full_sub_name(interp, sub),

Modified: branches/pdd22io_part3/t/compilers/pge/03-optable.t
==============================================================================
--- branches/pdd22io_part3/t/compilers/pge/03-optable.t	(original)
+++ branches/pdd22io_part3/t/compilers/pge/03-optable.t	Mon Dec 29 23:28:53 2008
@@ -7,7 +7,7 @@
 use warnings;
 use lib qw( t . lib ../lib ../../lib ../../../lib );
 use Test::More;
-use Parrot::Test tests => 35;
+use Parrot::Test tests => 37;
 
 optable_output_is( 'a',     'term:a',                                   'Simple term' );
 optable_output_is( 'a+b',   'infix:+(term:a, term:b)',                  'Simple infix' );
@@ -42,6 +42,9 @@
 optable_output_is( '++a', 'prefix:++(term:a)',  'prefix' );
 optable_output_is( '--a', 'prefix:--(term:a)',  'prefix' );
 
+optable_output_is( '-a',  'prefix:-(term:a)',   'prefix ltm');
+optable_output_is( '->a', 'term:->a',           'prefix ltm');
+
 optable_output_is(
     'a*(b+c)',
     'infix:*(term:a, circumfix:( )(infix:+(term:b, term:c)))',
@@ -109,6 +112,7 @@
     optable.'newtok'('prefix:--', 'equiv'=>'prefix:++')
     optable.'newtok'('postfix:++', 'equiv'=>'prefix:++')
     optable.'newtok'('postfix:--', 'equiv'=>'prefix:++')
+    optable.'newtok'('prefix:-', 'equiv'=>'prefix:++')
 
     .local pmc ident
     ident = get_global ['PGE';'Match'], 'ident'
@@ -118,6 +122,11 @@
     optable.'newtok'('postcircumfix:( )', 'looser'=>'term:', 'nows'=>1, 'nullterm'=>1)
     optable.'newtok'('postcircumfix:[ ]', 'equiv'=>'postcircumfix:( )', 'nows'=>1)
 
+    .local pmc arrow
+    $P0 = compreg 'PGE::Perl6Regex'
+    arrow = $P0("'->' <ident>")
+    optable.'newtok'('term:->', 'equiv'=>'term:', 'parsed'=>arrow, 'skipkey'=>0)
+
     .local string test
     test = "<<test>>"
 
@@ -148,6 +157,7 @@
     type = match['type']
     print type
     if type == 'term:' goto print_term
+    if type == 'term:->' goto print_term_arrow
     print '('
     .local pmc iter
     $P0 = match.'list'()
@@ -171,6 +181,10 @@
     goto end
   print_term:
     print match
+    goto end
+  print_term_arrow:
+    $S0 = match['ident']
+    print $S0
   end:
     .return ()
 .end

Modified: branches/pdd22io_part3/t/compilers/pge/p5regex/p5rx.t
==============================================================================
--- branches/pdd22io_part3/t/compilers/pge/p5regex/p5rx.t	(original)
+++ branches/pdd22io_part3/t/compilers/pge/p5regex/p5rx.t	Mon Dec 29 23:28:53 2008
@@ -122,7 +122,7 @@
     test_file = test_dir . test_name
 
     # Open the test file
-    file_handle = open test_file, '<'
+    file_handle = open test_file, 'r'
     $S0 = typeof file_handle
     if $S0 == 'Undef' goto bad_file
 

Modified: branches/pdd22io_part3/t/compilers/pge/perl6regex/01-regex.t
==============================================================================
--- branches/pdd22io_part3/t/compilers/pge/perl6regex/01-regex.t	(original)
+++ branches/pdd22io_part3/t/compilers/pge/perl6regex/01-regex.t	Mon Dec 29 23:28:53 2008
@@ -81,6 +81,7 @@
     push test_files, 'rx_captures'
     push test_files, 'rx_modifiers'
     push test_files, 'rx_syntax'
+    push test_files, 'rx_goal'
 
     .local pmc interp     # a handle to our interpreter object.
                interp = getinterp
@@ -136,7 +137,7 @@
     test_file = test_dir . test_name
 
     # Open the test file
-    file_handle = open test_file, '<'
+    file_handle = open test_file, 'r'
     $S0 = typeof file_handle
     if $S0 == 'Undef' goto bad_file
 

Modified: branches/pdd22io_part3/t/examples/streams.t
==============================================================================
--- branches/pdd22io_part3/t/examples/streams.t	(original)
+++ branches/pdd22io_part3/t/examples/streams.t	Mon Dec 29 23:28:53 2008
@@ -162,7 +162,7 @@
 read:[   40 ]
 read:[   41     # create a file stream]
 read:[   42     file = new "Stream::ParrotIO"]
-read:[   43     file."open"( name, "<" )]
+read:[   43     file."open"( name, 'r' )]
 read:[   44 ]
 read:[   45     # process it one line per read]
 read:[   46     lines = new "Stream::Lines"]
@@ -245,7 +245,7 @@
 read:[de "library/Stream/ParrotIO.pir"\n\n    # create the]
 read:[ ParrotIO stream\n    stream = new "Stream::ParrotI]
 read:[O"\n\n    # open this file\n    stream."open"( "examp]
-read:[les/streams/ParrotIO.pir", "<" )\n\n    # you can sp]
+read:[les/streams/ParrotIO.pir", 'r' )\n\n    # you can sp]
 read:[ecifiy a custom block size with\n    # stream."bloc]
 read:[kSize"( 10 )\n\n    # dump the stream\n    stream."du]
 read:[mp"()\n\n    end\n.end\n\n=head1 AUTHOR\n\nJens Rieks E<l]

Modified: branches/pdd22io_part3/t/library/streams.t
==============================================================================
--- branches/pdd22io_part3/t/library/streams.t	(original)
+++ branches/pdd22io_part3/t/library/streams.t	Mon Dec 29 23:28:53 2008
@@ -350,7 +350,7 @@
 
     # create a file stream
     file = new "Stream::ParrotIO"
-    file."open"( name, "<" )
+    file."open"( name, 'r' )
 
     # process it one line per read
     lines = new "Stream::Lines"
@@ -948,7 +948,7 @@
     stream = new "Stream::ParrotIO"
 
     # open this file
-    stream."open"( "t/library/perlhist.txt", "<" )
+    stream."open"( "t/library/perlhist.txt", 'r' )
 
     # you can specifiy a custom block size with
     # stream."blockSize"( 10 )

Modified: branches/pdd22io_part3/t/oo/methods.t
==============================================================================
--- branches/pdd22io_part3/t/oo/methods.t	(original)
+++ branches/pdd22io_part3/t/oo/methods.t	Mon Dec 29 23:28:53 2008
@@ -36,7 +36,7 @@
     .local string filename
 
     filename = "method_library.pir"
-    file = open filename, ">"
+    file = open filename, 'w'
 
     $S0 = <<'END'
     .namespace['Foo']

Modified: branches/pdd22io_part3/t/op/sprintf.t
==============================================================================
--- branches/pdd22io_part3/t/op/sprintf.t	(original)
+++ branches/pdd22io_part3/t/op/sprintf.t	Mon Dec 29 23:28:53 2008
@@ -125,7 +125,7 @@
 
     # Open the test file
     .local pmc file_handle   # currently open file
-               file_handle = open test_file, '<'
+               file_handle = open test_file, 'r'
 
     unless file_handle goto bad_file
 

Modified: branches/pdd22io_part3/t/pmc/eval.t
==============================================================================
--- branches/pdd22io_part3/t/pmc/eval.t	(original)
+++ branches/pdd22io_part3/t/pmc/eval.t	Mon Dec 29 23:28:53 2008
@@ -251,12 +251,12 @@
   .local pmc io
   f1 = compi("foo_1", "hello from foo_1")
   \$S0 = f1
-  io = open "$temp_pbc", ">"
+  io = open "$temp_pbc", 'w'
   print io, \$S0
   close io
   load_bytecode "$temp_pbc"
   f2 = compi("foo_2", "hello from foo_2")
-  io = open "$temp2_pbc", ">"
+  io = open "$temp2_pbc", 'w'
   print io, f2
   close io
   load_bytecode "$temp2_pbc"
@@ -325,14 +325,14 @@
   .local pmc io, os
   f1 = compi("foo_1", "hello from foo_1")
   \$S0 = f1
-  io = open "$temp_pbc", ">"
+  io = open "$temp_pbc", 'w'
   print io, \$S0
   close io
   load_bytecode "$temp_pbc"
   os = new 'OS'
   os.'rm'("$temp_pbc")
   f2 = compi("foo_2", "hello from foo_2")
-  io = open "$temp_pbc", ">"
+  io = open "$temp_pbc", 'w'
   print io, f2
   close io
   load_bytecode "$temp_pbc"
@@ -368,7 +368,7 @@
   .local pmc io
   f = compi("foo_1", "hello from foo_1")
   \$S0 = freeze f
-  io = open "$temp_file", ">"
+  io = open "$temp_file", 'w'
   print io, \$S0
   close io
   say "written"
@@ -403,7 +403,7 @@
     file = "$temp_file"
     .include "stat.pasm"
     size = stat file, .STAT_FILESIZE
-    io = open file, "<"
+    io = open file, 'r'
     \$S0 = read io, size
     close io
     e = thaw \$S0
@@ -422,7 +422,7 @@
   .local pmc io
   f = compi("foo_1", "hello from foo_1")
   \$S0 = freeze f
-  io = open "$temp_file", ">"
+  io = open "$temp_file", 'w'
   print io, \$S0
   close io
   say "written"
@@ -460,7 +460,7 @@
     file = "$temp_file"
     .include "stat.pasm"
     size = stat file, .STAT_FILESIZE
-    io = open file, "<"
+    io = open file, 'r'
     \$S0 = read io, size
     close io
     e = thaw \$S0

Modified: branches/pdd22io_part3/t/pmc/freeze.t
==============================================================================
--- branches/pdd22io_part3/t/pmc/freeze.t	(original)
+++ branches/pdd22io_part3/t/pmc/freeze.t	Mon Dec 29 23:28:53 2008
@@ -349,7 +349,7 @@
     print "\n"
     freeze S11, P10
     print "ok 1\n"
-    open P3, "temp.fpmc", ">"
+    open P3, "temp.fpmc", 'w'
     print P3, S11
     close P3
     print "ok 2\n"
@@ -368,7 +368,7 @@
     print "stat failed\n"
     exit 1
 ok1:
-    open P3, S3, "<"
+    open P3, S3, 'r'
     read S3, P3, I0
     close P3
     print "ok 1\n"
@@ -411,7 +411,7 @@
     print "\n"
     freeze S11, P10
     print "ok 1\n"
-    open P3, "temp.fpmc", ">"
+    open P3, "temp.fpmc", 'w'
     print P3, S11
     close P3
     print "ok 2\n"
@@ -430,7 +430,7 @@
     print "stat failed\n"
     exit 1
 ok1:
-    open P3, S3, "<"
+    open P3, S3, 'r'
     read S3, P3, I0
     close P3
     # print S3
@@ -468,7 +468,7 @@
     print S10
     print "\n"
     freeze S3, P10
-    open P3, "temp.fpmc", ">"
+    open P3, "temp.fpmc", 'w'
     print P3, S3
     close P3
 
@@ -515,7 +515,7 @@
     new P10, "Foo"
     print S10
     freeze S3, P10
-    open P3, "temp.fpmc", ">"
+    open P3, "temp.fpmc", 'w'
     print P3, S3
     close P3
     print "ok 1\n"
@@ -557,7 +557,7 @@
     print "stat failed\n"
     exit 1
 ok1:
-    open P3, S3, "<"
+    open P3, S3, 'r'
     read S3, P3, I0
     close P3
 
@@ -792,7 +792,7 @@
 
 .namespace [ "OPTable" ]
 
-.sub "__init" :method
+.sub "init" :method :vtable
     .local pmc keytable, klentable
     keytable = new 'Hash'
     klentable = new 'Hash'

Modified: branches/pdd22io_part3/t/pmc/io.t
==============================================================================
--- branches/pdd22io_part3/t/pmc/io.t	(original)
+++ branches/pdd22io_part3/t/pmc/io.t	Mon Dec 29 23:28:53 2008
@@ -94,10 +94,10 @@
 my (undef, $temp_file) = create_tempfile( UNLINK => 1 );
 
 pasm_output_is( <<"CODE", <<'OUTPUT', "open/close" );
-    open P0, "$temp_file", ">"
+    open P0, "$temp_file", 'w'
     print P0, "a line\\n"
     close P0
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     read S0, P0, 20
     print S0
     end
@@ -107,12 +107,12 @@
 
 pasm_output_is( <<"CODE", <<'OUTPUT', "timely destruction" );
     interpinfo I0, 2    # DOD runs
-    open P0, "$temp_file", ">"
+    open P0, "$temp_file", 'w'
         needs_destroy P0
     print P0, "a line\\n"
     null P0            # kill it
     sweep 0            # a lazy DOD has to close the PIO
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     read S0, P0, 20
     print S0
     end
@@ -125,7 +125,7 @@
 .sub main :main
     getstdout $P0
     $I0 = $P0.'get_fd'()
-    fdopen $P1, $I0, ">"
+    fdopen $P1, $I0, 'w'
     defined $I0, $P1
     unless $I0, nok
     print $P1, "ok\n"
@@ -143,7 +143,7 @@
 .sub main :main
     getstdout $P0
     $I0 = $P0.'get_fd'()
-    fdopen $P1, $I0, ">"
+    fdopen $P1, $I0, 'w'
     defined $I0, $P1
     unless $I0, nok
     print $P1, "ok\n"
@@ -159,18 +159,18 @@
 
 pasm_output_is( <<"CODE", <<'OUTPUT', "get_bool" );
     push_eh read_non_existent_file
-    open P0, "$no_such_file", "<"
+    open P0, "$no_such_file", 'r'
 
     print "Huh: '$no_such_file' exists? - not "
 ok1:
     say "ok 1"
 
-    open P0, "$temp_file", ">"
+    open P0, "$temp_file", 'w'
     print P0, "a line\\n"
     print P0, "a line\\n"
     close P0
 
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     if P0, ok2
     print "not "
 ok2:    say "ok 2"
@@ -241,7 +241,7 @@
 SKIP: {
     skip( "clone not finished yet", 1 );
     pasm_output_is( <<"CODE", <<'OUTPUT', "clone" );
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     clone P1, P0
     read S0, P1, 1024
     print S0
@@ -320,13 +320,13 @@
 
 # write to file opened for reading
 pasm_output_is( <<"CODE", <<'OUTPUT', "3-arg open" );
-   open P1, "$temp_file", ">"
+   open P1, "$temp_file", 'w'
    print P1, "Foobar\\n"
    close P1
 
    push_eh _print_to_read_only
 
-   open P2, "$temp_file", "<"
+   open P2, "$temp_file", 'r'
    print P2, "baz\\n"
    say "skipped"
 
@@ -336,7 +336,7 @@
 
    close P2
 
-   open P3, "$temp_file", "<"
+   open P3, "$temp_file", 'r'
    readline S1, P3
    close P3
    print S1
@@ -363,7 +363,7 @@
 OUTPUT
 
 pasm_output_is( <<"CODE", '', 'append' );
-   open P1, "$temp_file", ">>"
+   open P1, "$temp_file", 'wa'
    print P1, "Parrot flies\\n"
    close P1
    end
@@ -375,7 +375,7 @@
 OUTPUT
 
 pasm_output_is( <<"CODE", '', 'write to file' );
-   open P1, "$temp_file", ">"
+   open P1, "$temp_file", 'w'
    print P1, "Parrot overwrites\\n"
    close P1
    end
@@ -389,7 +389,7 @@
    set I0, 0
    set I1, 10000
 
-   open P0, "$temp_file", ">"
+   open P0, "$temp_file", 'w'
 
 PRINT:
    ge I0, I1, END
@@ -408,7 +408,7 @@
 
 pir_output_is( <<"CODE", <<'OUTPUT', "turn off buffering" );
 .sub main :main
-   open \$P0, "$temp_file", ">"
+   open \$P0, "$temp_file", 'w'
 
 #  set buffer type
    \$P0.'buffer_type'('unbuffered')
@@ -435,7 +435,7 @@
 .sub main
     .local string filename
     filename = "$temp_file"
-    \$P1 = open filename, ">"
+    \$P1 = open filename, 'w'
     .local int count, max, nltest
     count = 0
     max = 10000
@@ -582,7 +582,7 @@
 OUTPUT
 
 pasm_output_is( <<"CODE", <<'OUTPUT', 'seek/tell' );
-   open P0, "$temp_file", ">"
+   open P0, "$temp_file", 'w'
    print P0, "Hello "
    tell I0, P0
    print P0, "World!"
@@ -590,7 +590,7 @@
    print P0, "Parrot!\\n"
    close P0
    say "ok 1"
-   open P0, "$temp_file", "<"
+   open P0, "$temp_file", 'r'
    read S0, P0, 65635
    print S0
    end
@@ -600,7 +600,7 @@
 OUTPUT
 
 pasm_error_output_like( <<"CODE", <<'OUTPUT', '32bit seek: exception' );
-   open P0, "$temp_file", ">"
+   open P0, "$temp_file", 'w'
    seek P0, -1, 0
    say "error!"
    end
@@ -609,7 +609,7 @@
 OUTPUT
 
 pasm_error_output_like( <<"CODE", <<'OUTPUT', '64bit seek: exception' );
-   open P0, "$temp_file", ">"
+   open P0, "$temp_file", 'w'
    seek P0, -1, -1, 0
    say "error!"
    end
@@ -618,10 +618,10 @@
 OUTPUT
 
 pasm_output_is( <<"CODE", <<'OUTPUT', "peek" );
-    open P0, "$temp_file", ">"
+    open P0, "$temp_file", 'w'
     print P0, "a line\\n"
     close P0
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     peek S0, P0
     print S0
     peek S1, P0
@@ -638,9 +638,9 @@
 OUTPUT
 
 pasm_output_is( <<"CODE", <<'OUTPUT', "peek on an empty file" );
-    open P0, "$temp_file", ">"
+    open P0, "$temp_file", 'w'
     close P0
-    open P0, "$temp_file", "<"
+    open P0, "$temp_file", 'r'
     peek S0, P0
     eq S0, "", OK1
     print "not "
@@ -655,13 +655,13 @@
 .sub _main
     # Write something into a file
     .local pmc out
-    out = open "$temp_file", ">"
+    out = open "$temp_file", 'w'
     print out, "0123456789\\n"
     close out
 
     # read file contents back in
     .local pmc in
-    in = open "$temp_file", "<"
+    in = open "$temp_file", 'r'
     .local string from_file
     from_file = read in, 20
 
@@ -681,13 +681,13 @@
 .sub _main
     # Write something into a file
     .local pmc out
-    out = open "$temp_file", ">"
+    out = open "$temp_file", 'w'
     print out, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\\n"
     close out
 
     .local pmc in
     .local string line
-    in = open '$temp_file', '<'
+    in = open '$temp_file', 'r'
     line = read in, 50000
     close in
 
@@ -741,7 +741,7 @@
     .local string f
     f = '$temp_file'
     len = stat f, .STAT_FILESIZE
-    pio = open f, "<"
+    pio = open f, 'r'
     pio.'encoding'("utf8")
     \$S0 = read pio, len
     close pio
@@ -768,7 +768,7 @@
     .local pmc pio
     .local string f
     f = '$temp_file'
-    pio = open f, "<"
+    pio = open f, 'r'
     pio.'encoding'("utf8")
     \$S0 = readline pio
     close pio
@@ -798,7 +798,7 @@
     .local string f
     f = '$temp_file'
     len = stat f, .STAT_FILESIZE
-    pio = open f, "<"
+    pio = open f, 'r'
     pio.'encoding'("utf8")
     \$S0 = read pio, 2
     len -= 2
@@ -852,7 +852,7 @@
 line 3
 EOS
     .local pmc pio, cl
-    pio = open    "$temp_file", ">"
+    pio = open    "$temp_file", 'w'
     print pio, \$S0
     close pio
     cl = new 'FileHandle'
@@ -874,10 +874,10 @@
 line 3
 EOS
     .local pmc pio, pio2
-    pio = open    "$temp_file", ">"
+    pio = open    "$temp_file", 'w'
     print pio, \$S0
     close pio
-    pio2 = open    "$temp_file", "<"
+    pio2 = open    "$temp_file", 'r'
     \$S1 = pio2.'readall'()
     if \$S0 == \$S1 goto ok
     print "not "

Modified: branches/pdd22io_part3/t/pmc/namespace.t
==============================================================================
--- branches/pdd22io_part3/t/pmc/namespace.t	(original)
+++ branches/pdd22io_part3/t/pmc/namespace.t	Mon Dec 29 23:28:53 2008
@@ -6,7 +6,7 @@
 use warnings;
 use lib qw( . lib ../lib ../../lib );
 use Test::More;
-use Parrot::Test tests => 65;
+use Parrot::Test tests => 66;
 use Parrot::Config;
 
 =head1 NAME
@@ -1769,6 +1769,24 @@
 OK
 OUT
 
+pir_output_is( <<'CODE', <<'OUT', "make_namespace method");
+.sub 'main' :main
+    $P0 = split ';', 'perl6;Foo;Bar'
+    $P1 = get_root_namespace
+    $P2 = $P1.'make_namespace'($P0)
+    $I0 = isa $P2, 'NameSpace'
+    say $I0
+    $P3 = get_root_namespace ['perl6';'Foo';'Bar']
+    $I0 = isnull $P3
+    say $I0
+    $I0 = issame $P2, $P3
+    say $I0
+.end
+CODE
+1
+0
+1
+OUT
 
 # Local Variables:
 #   mode: cperl

Modified: branches/pdd22io_part3/t/pmc/packfile.t
==============================================================================
--- branches/pdd22io_part3/t/pmc/packfile.t	(original)
+++ branches/pdd22io_part3/t/pmc/packfile.t	Mon Dec 29 23:28:53 2008
@@ -79,7 +79,7 @@
     $S0  = interpinfo .INTERPINFO_RUNTIME_PREFIX
     $S0 .= "/runtime/parrot/library/uuid.pbc"
     $I0  = stat $S0, .STAT_FILESIZE
-    pio  = open $S0, "<"
+    pio  = open $S0, 'r'
     $S0  = read pio, $I0
     close pio
     pf   = $S0

Modified: branches/pdd22io_part3/t/pmc/sys.t
==============================================================================
--- branches/pdd22io_part3/t/pmc/sys.t	(original)
+++ branches/pdd22io_part3/t/pmc/sys.t	Mon Dec 29 23:28:53 2008
@@ -31,7 +31,7 @@
 
 .sub _test :main
      .local pmc O
-     open O, "$temp_pir", ">"
+     open O, "$temp_pir", 'w'
      print O, ".sub _main :main\\n"
      print O, "\tsay \\"Hello, World!\\"\\n"
      print O, ".end\\n"

Modified: branches/pdd22io_part3/t/tools/dump_pbc.t
==============================================================================
--- branches/pdd22io_part3/t/tools/dump_pbc.t	(original)
+++ branches/pdd22io_part3/t/tools/dump_pbc.t	Mon Dec 29 23:28:53 2008
@@ -35,7 +35,7 @@
     my $PARROT   = ".$PConfig{slash}$PConfig{test_prog}";
     system( "$PARROT --output $pbc_fn $pir_fn" );
     my $cmd = File::Spec->catfile( qw{. tools util dump_pbc.pl} );
-    my $out = `perl $cmd $pbc_fn`;
+    my $out = `$PConfig{perl} $cmd $pbc_fn`;
 
     like( $out, $snippet, $desc );
 

Modified: branches/pdd22io_part3/tools/build/ops2c.pl
==============================================================================
--- branches/pdd22io_part3/tools/build/ops2c.pl	(original)
+++ branches/pdd22io_part3/tools/build/ops2c.pl	Mon Dec 29 23:28:53 2008
@@ -1,11 +1,12 @@
 #! perl
-# Copyright (C) 2001-2006, The Perl Foundation.
+# Copyright (C) 2001-2008, The Perl Foundation.
 # $Id$
+
 use warnings;
 use strict;
 use lib 'lib';
 use Parrot::Ops2c::Auxiliary qw( Usage getoptions );
-use Parrot::Ops2c::Utils;
+use Parrot::Ops2c::Utils ();
 
 my $flagref = getoptions();
 if ( ( not defined $flagref )

Modified: branches/pdd22io_part3/tools/dev/bench_op.pir
==============================================================================
--- branches/pdd22io_part3/tools/dev/bench_op.pir	(original)
+++ branches/pdd22io_part3/tools/dev/bench_op.pir	Mon Dec 29 23:28:53 2008
@@ -156,7 +156,7 @@
 no_v1:
     # op may be a file or an opcode - try to open it
     .local pmc F
-    open F, op, "<"
+    open F, op, 'r'
     .local int def
     def = defined F
     unless def goto op_is_op

Modified: branches/pdd22io_part3/tools/dev/pbc_to_exe_gen.pl
==============================================================================
--- branches/pdd22io_part3/tools/dev/pbc_to_exe_gen.pl	(original)
+++ branches/pdd22io_part3/tools/dev/pbc_to_exe_gen.pl	Mon Dec 29 23:28:53 2008
@@ -11,6 +11,9 @@
 __END__
 #! parrot
 
+# DO NOT EDIT; your changes will be lost.
+# This file was generated automatically by tools/dev/pbc_to_exe_gen.pl
+
 =head1 TITLE
 
 pbc_to_exe
@@ -44,7 +47,7 @@
 
   open_outfile:
     .local pmc outfh
-    outfh = open cfile, '>'
+    outfh = open cfile, 'w'
     if outfh goto args_handled
     die "infile not specified"
 
@@ -139,7 +142,7 @@
     .param string infile
 
     .local pmc infh
-               infh = open infile, '<'
+               infh = open infile, 'r'
 
     if infh goto file_open
     die "cannot open infile"

Modified: branches/pdd22io_part3/tools/dev/vms-patch
==============================================================================
--- branches/pdd22io_part3/tools/dev/vms-patch	(original)
+++ branches/pdd22io_part3/tools/dev/vms-patch	Mon Dec 29 23:28:53 2008
@@ -1,4 +1,6 @@
 #!/usr/bin/perl
+# Copyright (C) 2004-2008, The Perl Foundation.
+# $Id$
 
 # usage:
 # tools/dev/vms-patch < the_patch | patch -p0



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About