[svn:parrot] r40541 - in branches/pluggable_runcore: . compilers/imcc compilers/json/JSON compilers/ncigen compilers/ncigen/src compilers/ncigen/src/builtins compilers/ncigen/src/parser compilers/nqp/src compilers/nqp/src/Grammar compilers/pct/src/PAST compilers/pct/src/PCT compilers/pct/src/POST compilers/pge compilers/pge/PGE compilers/pirc/src compilers/tge/TGE config/auto config/auto/sizes config/gen config/gen/call_list config/gen/config_pm config/gen/makefiles config/gen/platform/generic config/gen/platform/win32 config/init config/init/hints docs docs/book/draft docs/book/module docs/book/pct docs/book/pir docs/dev docs/pdds docs/pdds/draft docs/project docs/resources examples/benchmarks examples/c examples/config examples/config/file examples/embed examples/japh examples/json examples/languages/abc examples/languages/squaak examples/languages/squaak/src/builtins examples/opengl examples/pasm examples/past examples/pge examples/pir examples/sdl/minesweeper exa mples/shootout examples/subs examples/tutorial ext/SQLite3 include/parrot lib/Parrot lib/Parrot/Configure/Options lib/Parrot/Configure/Options/Conf lib/Parrot/Configure/Step lib/Parrot/Docs/Section lib/Parrot/Harness lib/Parrot/OpTrans lib/Parrot/Pmc2c lib/Parrot/Pmc2c/PMC lib/Parrot/Test ports/cpan ports/cygwin ports/debian ports/fedora ports/macports ports/mandriva ports/suse ports/ubuntu runtime/parrot/include runtime/parrot/languages runtime/parrot/library runtime/parrot/library/Data runtime/parrot/library/Data/Dumper runtime/parrot/library/Math runtime/parrot/library/NCI runtime/parrot/library/PGE runtime/parrot/library/SDL runtime/parrot/library/Stream runtime/parrot/library/Test runtime/parrot/library/YAML/Dumper src src/call src/dynoplibs src/dynpmc src/gc src/interp src/io src/jit/i386 src/ops src/pmc src/runcore src/string t/codingstd t/compilers/imcc/imcpasm t/compilers/imcc/syn t/compilers/pct t/compilers/pge t/compilers/pge/p5regex t/compilers/pge/perl6regex t/c ompilers/tge t/configure t/dynoplibs t/dynpmc t/examples t/include t/library t/native_pbc t/oo t/op t/pharness t/pir t/pmc t/pmc/testlib t/src t/steps/auto t/steps/init/hints t/tools t/tools/dev/searchops t/tools/ops2pm tools/build tools/dev tools/util xconf
cotto at svn.parrot.org
cotto at svn.parrot.org
Fri Aug 14 01:24:52 UTC 2009
Author: cotto
Date: Fri Aug 14 01:24:23 2009
New Revision: 40541
URL: https://trac.parrot.org/parrot/changeset/40541
Log:
bring branch up-to-date with trunk
Added:
branches/pluggable_runcore/docs/book/module/
- copied from r40540, trunk/docs/book/module/
branches/pluggable_runcore/docs/book/pct/
- copied from r40540, trunk/docs/book/pct/
branches/pluggable_runcore/examples/c/pbc_info.c
- copied unchanged from r40540, trunk/examples/c/pbc_info.c
branches/pluggable_runcore/examples/config/
- copied from r40540, trunk/examples/config/
branches/pluggable_runcore/examples/embed/cotorra.c
- copied unchanged from r40540, trunk/examples/embed/cotorra.c
branches/pluggable_runcore/examples/opengl/static-triangle-hll.pir
- copied unchanged from r40540, trunk/examples/opengl/static-triangle-hll.pir
branches/pluggable_runcore/ports/fedora/parrot-1.x.0.patch
- copied unchanged from r40540, trunk/ports/fedora/parrot-1.x.0.patch
branches/pluggable_runcore/src/dynoplibs/math.ops
- copied unchanged from r40540, trunk/src/dynoplibs/math.ops
branches/pluggable_runcore/src/dynpmc/foo2.pmc
- copied unchanged from r40540, trunk/src/dynpmc/foo2.pmc
branches/pluggable_runcore/src/pmc/arrayiterator.pmc
- copied unchanged from r40540, trunk/src/pmc/arrayiterator.pmc
branches/pluggable_runcore/src/pmc/hashiterator.pmc
- copied unchanged from r40540, trunk/src/pmc/hashiterator.pmc
branches/pluggable_runcore/src/pmc/hashiteratorkey.pmc
- copied unchanged from r40540, trunk/src/pmc/hashiteratorkey.pmc
branches/pluggable_runcore/src/pmc/orderedhashiterator.pmc
- copied unchanged from r40540, trunk/src/pmc/orderedhashiterator.pmc
branches/pluggable_runcore/src/pmc/stringiterator.pmc
- copied unchanged from r40540, trunk/src/pmc/stringiterator.pmc
branches/pluggable_runcore/t/compilers/pge/regression.t
- copied unchanged from r40540, trunk/t/compilers/pge/regression.t
branches/pluggable_runcore/t/dynoplibs/math.t
- copied unchanged from r40540, trunk/t/dynoplibs/math.t
branches/pluggable_runcore/t/dynoplibs/obscure.t
- copied unchanged from r40540, trunk/t/dynoplibs/obscure.t
branches/pluggable_runcore/t/dynpmc/foo2.t
- copied unchanged from r40540, trunk/t/dynpmc/foo2.t
branches/pluggable_runcore/t/include/
- copied from r40540, trunk/t/include/
branches/pluggable_runcore/t/pir/
- copied from r40540, trunk/t/pir/
branches/pluggable_runcore/t/pmc/arrayiterator.t
- copied unchanged from r40540, trunk/t/pmc/arrayiterator.t
branches/pluggable_runcore/t/pmc/hashiterator.t
- copied unchanged from r40540, trunk/t/pmc/hashiterator.t
branches/pluggable_runcore/t/pmc/hashiteratorkey.t
- copied unchanged from r40540, trunk/t/pmc/hashiteratorkey.t
branches/pluggable_runcore/t/pmc/orderedhashiterator.t
- copied unchanged from r40540, trunk/t/pmc/orderedhashiterator.t
branches/pluggable_runcore/t/pmc/stringiterator.t
- copied unchanged from r40540, trunk/t/pmc/stringiterator.t
branches/pluggable_runcore/t/tools/pgegrep.t
- copied unchanged from r40540, trunk/t/tools/pgegrep.t
branches/pluggable_runcore/t/tools/testdata
- copied unchanged from r40540, trunk/t/tools/testdata
Replaced:
branches/pluggable_runcore/docs/book/pct/ch01_introduction.pod
- copied unchanged from r40540, trunk/docs/book/pct/ch01_introduction.pod
branches/pluggable_runcore/docs/book/pct/ch02_getting_started.pod
- copied unchanged from r40540, trunk/docs/book/pct/ch02_getting_started.pod
branches/pluggable_runcore/docs/book/pct/ch03_compiler_tools.pod
- copied unchanged from r40540, trunk/docs/book/pct/ch03_compiler_tools.pod
branches/pluggable_runcore/docs/book/pct/ch04_pge.pod
- copied unchanged from r40540, trunk/docs/book/pct/ch04_pge.pod
branches/pluggable_runcore/docs/book/pct/ch05_nqp.pod
- copied unchanged from r40540, trunk/docs/book/pct/ch05_nqp.pod
branches/pluggable_runcore/examples/config/file/
- copied from r40540, trunk/examples/config/file/
branches/pluggable_runcore/examples/config/file/configcompiler
- copied unchanged from r40540, trunk/examples/config/file/configcompiler
branches/pluggable_runcore/examples/config/file/configwithfatalstep
- copied unchanged from r40540, trunk/examples/config/file/configwithfatalstep
branches/pluggable_runcore/t/include/fp_equality.t
- copied unchanged from r40540, trunk/t/include/fp_equality.t
branches/pluggable_runcore/t/pir/macro.t
- copied unchanged from r40540, trunk/t/pir/macro.t
Deleted:
branches/pluggable_runcore/config/auto/fink.pm
branches/pluggable_runcore/config/auto/macports.pm
branches/pluggable_runcore/docs/book/draft/ch04_compiler_tools.pod
branches/pluggable_runcore/docs/book/draft/ch05_pge.pod
branches/pluggable_runcore/docs/book/draft/ch06_nqp.pod
branches/pluggable_runcore/docs/dev/fhs.pod
branches/pluggable_runcore/examples/embed/lorito.c
branches/pluggable_runcore/examples/subs/jsr_ret.pasm
branches/pluggable_runcore/include/parrot/stacks.h
branches/pluggable_runcore/ports/ubuntu/lpia_no_aligned_funcptr.patch
branches/pluggable_runcore/runtime/parrot/library/Data/Replace.pir
branches/pluggable_runcore/runtime/parrot/library/NCI/call_toolkit_init.pir
branches/pluggable_runcore/src/dynpmc/pair.pmc
branches/pluggable_runcore/src/pbc_info.c
branches/pluggable_runcore/src/stacks.c
branches/pluggable_runcore/t/compilers/imcc/imcpasm/sub.t
branches/pluggable_runcore/t/compilers/imcc/syn/bsr.t
branches/pluggable_runcore/t/dynpmc/pair.t
branches/pluggable_runcore/t/steps/auto/fink-01.t
branches/pluggable_runcore/t/steps/auto/macports-01.t
branches/pluggable_runcore/t/steps/auto/macports-02.t
branches/pluggable_runcore/tools/dev/parrot_8.supp
branches/pluggable_runcore/xconf/
Modified:
branches/pluggable_runcore/ (props changed)
branches/pluggable_runcore/CREDITS
branches/pluggable_runcore/ChangeLog
branches/pluggable_runcore/Configure.pl
branches/pluggable_runcore/DEPRECATED.pod
branches/pluggable_runcore/MANIFEST
branches/pluggable_runcore/MANIFEST.SKIP
branches/pluggable_runcore/MANIFEST.generated
branches/pluggable_runcore/META.yml
branches/pluggable_runcore/NEWS
branches/pluggable_runcore/PBC_COMPAT
branches/pluggable_runcore/PLATFORMS
branches/pluggable_runcore/README
branches/pluggable_runcore/RESPONSIBLE_PARTIES
branches/pluggable_runcore/VERSION
branches/pluggable_runcore/compilers/imcc/cfg.c
branches/pluggable_runcore/compilers/imcc/cfg.h
branches/pluggable_runcore/compilers/imcc/imc.h
branches/pluggable_runcore/compilers/imcc/imcc.l
branches/pluggable_runcore/compilers/imcc/imcc.y
branches/pluggable_runcore/compilers/imcc/imclexer.c
branches/pluggable_runcore/compilers/imcc/imcparser.c
branches/pluggable_runcore/compilers/imcc/imcparser.h
branches/pluggable_runcore/compilers/imcc/instructions.h
branches/pluggable_runcore/compilers/imcc/optimizer.c
branches/pluggable_runcore/compilers/imcc/parser.h
branches/pluggable_runcore/compilers/imcc/parser_util.c
branches/pluggable_runcore/compilers/imcc/pbc.c
branches/pluggable_runcore/compilers/imcc/pcc.c
branches/pluggable_runcore/compilers/imcc/symreg.c
branches/pluggable_runcore/compilers/imcc/symreg.h
branches/pluggable_runcore/compilers/imcc/unit.h
branches/pluggable_runcore/compilers/json/JSON/pge2pir.tg
branches/pluggable_runcore/compilers/ncigen/NCIGENP6.pm
branches/pluggable_runcore/compilers/ncigen/src/NCIPIR.pir
branches/pluggable_runcore/compilers/ncigen/src/builtins/say.pir
branches/pluggable_runcore/compilers/ncigen/src/parser/actions.pm
branches/pluggable_runcore/compilers/nqp/src/Grammar/Actions.pir
branches/pluggable_runcore/compilers/nqp/src/builtins.pir
branches/pluggable_runcore/compilers/pct/src/PAST/Compiler.pir
branches/pluggable_runcore/compilers/pct/src/PAST/Node.pir
branches/pluggable_runcore/compilers/pct/src/PCT/HLLCompiler.pir
branches/pluggable_runcore/compilers/pct/src/PCT/Node.pir
branches/pluggable_runcore/compilers/pct/src/POST/Compiler.pir
branches/pluggable_runcore/compilers/pge/PGE/Exp.pir
branches/pluggable_runcore/compilers/pge/PGE/Match.pir
branches/pluggable_runcore/compilers/pge/PGE/OPTable.pir
branches/pluggable_runcore/compilers/pge/PGE/Perl6Regex.pir
branches/pluggable_runcore/compilers/pge/README.pod
branches/pluggable_runcore/compilers/pge/STATUS
branches/pluggable_runcore/compilers/pirc/src/pir.l
branches/pluggable_runcore/compilers/pirc/src/pircompiler.h
branches/pluggable_runcore/compilers/pirc/src/pircompunit.c
branches/pluggable_runcore/compilers/pirc/src/pirlexer.c
branches/pluggable_runcore/compilers/tge/TGE/Compiler.pir
branches/pluggable_runcore/compilers/tge/TGE/Grammar.pir
branches/pluggable_runcore/config/auto/gc.pm
branches/pluggable_runcore/config/auto/gdbm.pm
branches/pluggable_runcore/config/auto/gettext.pm
branches/pluggable_runcore/config/auto/gmp.pm
branches/pluggable_runcore/config/auto/opengl.pm
branches/pluggable_runcore/config/auto/pcre.pm
branches/pluggable_runcore/config/auto/readline.pm
branches/pluggable_runcore/config/auto/sizes/intval_maxmin_c.in (props changed)
branches/pluggable_runcore/config/gen/call_list/misc.in
branches/pluggable_runcore/config/gen/config_pm/config_pir.in
branches/pluggable_runcore/config/gen/makefiles/dynoplibs.in
branches/pluggable_runcore/config/gen/makefiles/dynpmc.in
branches/pluggable_runcore/config/gen/makefiles/root.in
branches/pluggable_runcore/config/gen/opengl.pm
branches/pluggable_runcore/config/gen/parrot_include.pm
branches/pluggable_runcore/config/gen/platform/generic/exec.c
branches/pluggable_runcore/config/gen/platform/generic/platform_limits.h
branches/pluggable_runcore/config/gen/platform/win32/time.c
branches/pluggable_runcore/config/init/defaults.pm
branches/pluggable_runcore/config/init/hints.pm
branches/pluggable_runcore/config/init/hints/darwin.pm
branches/pluggable_runcore/config/init/hints/mswin32.pm
branches/pluggable_runcore/docs/book/draft/README (props changed)
branches/pluggable_runcore/docs/book/draft/appa_glossary.pod (props changed)
branches/pluggable_runcore/docs/book/draft/appb_patch_submission.pod (props changed)
branches/pluggable_runcore/docs/book/draft/appc_command_line_options.pod (props changed)
branches/pluggable_runcore/docs/book/draft/appd_build_options.pod (props changed)
branches/pluggable_runcore/docs/book/draft/appe_source_code.pod (props changed)
branches/pluggable_runcore/docs/book/draft/ch01_introduction.pod (props changed)
branches/pluggable_runcore/docs/book/draft/ch02_getting_started.pod (props changed)
branches/pluggable_runcore/docs/book/draft/ch07_dynpmcs.pod (props changed)
branches/pluggable_runcore/docs/book/draft/ch08_dynops.pod (contents, props changed)
branches/pluggable_runcore/docs/book/draft/ch10_opcode_reference.pod (contents, props changed)
branches/pluggable_runcore/docs/book/draft/ch11_directive_reference.pod (props changed)
branches/pluggable_runcore/docs/book/draft/ch12_operator_reference.pod (props changed)
branches/pluggable_runcore/docs/book/draft/chXX_hlls.pod (props changed)
branches/pluggable_runcore/docs/book/draft/chXX_library.pod (props changed)
branches/pluggable_runcore/docs/book/draft/chXX_testing_and_debugging.pod (props changed)
branches/pluggable_runcore/docs/book/pir/ch01_introduction.pod
branches/pluggable_runcore/docs/book/pir/ch04_variables.pod
branches/pluggable_runcore/docs/book/pir/ch06_subroutines.pod
branches/pluggable_runcore/docs/debugger.pod
branches/pluggable_runcore/docs/dev/c_functions.pod (props changed)
branches/pluggable_runcore/docs/dev/jit_i386.pod
branches/pluggable_runcore/docs/embed.pod
branches/pluggable_runcore/docs/parrothist.pod
branches/pluggable_runcore/docs/pdds/draft/pdd06_pasm.pod
branches/pluggable_runcore/docs/pdds/draft/pdd16_native_call.pod
branches/pluggable_runcore/docs/pdds/pdd17_pmc.pod
branches/pluggable_runcore/docs/pdds/pdd22_io.pod
branches/pluggable_runcore/docs/pdds/pdd28_strings.pod
branches/pluggable_runcore/docs/pdds/pdd30_install.pod (contents, props changed)
branches/pluggable_runcore/docs/pmc2c.pod
branches/pluggable_runcore/docs/project/debian_packaging_guide.pod
branches/pluggable_runcore/docs/project/release_manager_guide.pod
branches/pluggable_runcore/docs/project/ubuntu_packaging_guide.pod
branches/pluggable_runcore/docs/resources/parrot.css
branches/pluggable_runcore/examples/benchmarks/addit.pasm
branches/pluggable_runcore/examples/benchmarks/overload.pir
branches/pluggable_runcore/examples/benchmarks/stress.pasm
branches/pluggable_runcore/examples/benchmarks/stress1.pasm
branches/pluggable_runcore/examples/benchmarks/stress2.pasm
branches/pluggable_runcore/examples/benchmarks/stress3.pasm
branches/pluggable_runcore/examples/embed/Makefile
branches/pluggable_runcore/examples/embed/Makefile.msvc
branches/pluggable_runcore/examples/japh/japh3.pasm
branches/pluggable_runcore/examples/json/postalcodes.pir
branches/pluggable_runcore/examples/languages/abc/ (props changed)
branches/pluggable_runcore/examples/languages/squaak/ (props changed)
branches/pluggable_runcore/examples/languages/squaak/src/builtins/say.pir
branches/pluggable_runcore/examples/pasm/fact.pasm
branches/pluggable_runcore/examples/past/01-sub.pir
branches/pluggable_runcore/examples/past/four_plus_one.pir
branches/pluggable_runcore/examples/pge/demo.pir (props changed)
branches/pluggable_runcore/examples/pir/life.pir
branches/pluggable_runcore/examples/pir/pirric.pir
branches/pluggable_runcore/examples/pir/quine_ord.pir
branches/pluggable_runcore/examples/pir/sudoku.pir
branches/pluggable_runcore/examples/sdl/minesweeper/field.pir
branches/pluggable_runcore/examples/shootout/knucleotide.pir
branches/pluggable_runcore/examples/shootout/random.pasm
branches/pluggable_runcore/examples/shootout/regexdna.pir
branches/pluggable_runcore/examples/subs/bsr_ret.pasm
branches/pluggable_runcore/examples/tutorial/01_temp_var.pir
branches/pluggable_runcore/examples/tutorial/02_local_var.pir
branches/pluggable_runcore/examples/tutorial/03_temp_var_basic_pmcs.pir
branches/pluggable_runcore/examples/tutorial/04_pod_comments.pir
branches/pluggable_runcore/examples/tutorial/10_math_ops.pir
branches/pluggable_runcore/examples/tutorial/13_logical_ops.pir
branches/pluggable_runcore/examples/tutorial/20_string_ops.pir
branches/pluggable_runcore/examples/tutorial/22_string_ops_length.pir
branches/pluggable_runcore/examples/tutorial/23_string_ops_substr.pir
branches/pluggable_runcore/examples/tutorial/30_arrays_basic.pir
branches/pluggable_runcore/examples/tutorial/33_hashes.pir
branches/pluggable_runcore/examples/tutorial/34_multikey.pir
branches/pluggable_runcore/examples/tutorial/40_file_ops.pir
branches/pluggable_runcore/examples/tutorial/55_iterator.pir
branches/pluggable_runcore/ext/SQLite3/gen_sqlite3.pl
branches/pluggable_runcore/include/parrot/call.h (props changed)
branches/pluggable_runcore/include/parrot/compiler.h
branches/pluggable_runcore/include/parrot/debugger.h
branches/pluggable_runcore/include/parrot/gc_api.h (contents, props changed)
branches/pluggable_runcore/include/parrot/global.h
branches/pluggable_runcore/include/parrot/hash.h
branches/pluggable_runcore/include/parrot/interpreter.h
branches/pluggable_runcore/include/parrot/key.h
branches/pluggable_runcore/include/parrot/library.h
branches/pluggable_runcore/include/parrot/oo.h
branches/pluggable_runcore/include/parrot/packfile.h
branches/pluggable_runcore/include/parrot/parrot.h
branches/pluggable_runcore/include/parrot/pmc.h
branches/pluggable_runcore/include/parrot/register.h
branches/pluggable_runcore/include/parrot/runcore_api.h (props changed)
branches/pluggable_runcore/include/parrot/runcore_trace.h (props changed)
branches/pluggable_runcore/include/parrot/string_funcs.h
branches/pluggable_runcore/include/parrot/string_primitives.h
branches/pluggable_runcore/include/parrot/sub.h
branches/pluggable_runcore/lib/Parrot/Configure/Options/Conf.pm
branches/pluggable_runcore/lib/Parrot/Configure/Options/Conf/Shared.pm
branches/pluggable_runcore/lib/Parrot/Configure/Step/List.pm
branches/pluggable_runcore/lib/Parrot/Configure/Step/Methods.pm
branches/pluggable_runcore/lib/Parrot/Docs/Section/Parrot.pm
branches/pluggable_runcore/lib/Parrot/Harness/DefaultTests.pm
branches/pluggable_runcore/lib/Parrot/Harness/Smoke.pm
branches/pluggable_runcore/lib/Parrot/Op.pm
branches/pluggable_runcore/lib/Parrot/OpTrans.pm
branches/pluggable_runcore/lib/Parrot/OpTrans/C.pm
branches/pluggable_runcore/lib/Parrot/OpTrans/CGP.pm
branches/pluggable_runcore/lib/Parrot/OpTrans/CGoto.pm
branches/pluggable_runcore/lib/Parrot/OpTrans/CSwitch.pm
branches/pluggable_runcore/lib/Parrot/OpsFile.pm
branches/pluggable_runcore/lib/Parrot/Pmc2c/Method.pm
branches/pluggable_runcore/lib/Parrot/Pmc2c/MethodEmitter.pm
branches/pluggable_runcore/lib/Parrot/Pmc2c/PCCMETHOD.pm
branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/Null.pm
branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/ParrotClass.pm
branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/RO.pm
branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/default.pm
branches/pluggable_runcore/lib/Parrot/Pmc2c/PMCEmitter.pm
branches/pluggable_runcore/lib/Parrot/Revision.pm
branches/pluggable_runcore/lib/Parrot/Test/Pod.pm
branches/pluggable_runcore/lib/Parrot/Vtable.pm
branches/pluggable_runcore/ports/cpan/pause_guide.pod (props changed)
branches/pluggable_runcore/ports/cygwin/README
branches/pluggable_runcore/ports/cygwin/parrot-1.0.0-1.cygport (props changed)
branches/pluggable_runcore/ports/debian/changelog
branches/pluggable_runcore/ports/debian/libparrot-dev.install.in (props changed)
branches/pluggable_runcore/ports/debian/libparrot.install.in (props changed)
branches/pluggable_runcore/ports/debian/parrot-devel.install.in
branches/pluggable_runcore/ports/debian/parrot-doc.install.in (props changed)
branches/pluggable_runcore/ports/debian/parrot.install.in (props changed)
branches/pluggable_runcore/ports/debian/rules
branches/pluggable_runcore/ports/fedora/parrot.spec.fedora (contents, props changed)
branches/pluggable_runcore/ports/macports/Portfile
branches/pluggable_runcore/ports/mandriva/parrot.spec.mandriva (contents, props changed)
branches/pluggable_runcore/ports/suse/parrot.spec.suse (contents, props changed)
branches/pluggable_runcore/ports/ubuntu/changelog
branches/pluggable_runcore/ports/ubuntu/control.in
branches/pluggable_runcore/runtime/parrot/include/fp_equality.pasm
branches/pluggable_runcore/runtime/parrot/languages/ (props changed)
branches/pluggable_runcore/runtime/parrot/library/Crow.pir
branches/pluggable_runcore/runtime/parrot/library/Curses.pir
branches/pluggable_runcore/runtime/parrot/library/Data/Dumper/Default.pir
branches/pluggable_runcore/runtime/parrot/library/JSON.pir
branches/pluggable_runcore/runtime/parrot/library/Math/Rand.pir (props changed)
branches/pluggable_runcore/runtime/parrot/library/OpenGL.pir
branches/pluggable_runcore/runtime/parrot/library/P6object.pir
branches/pluggable_runcore/runtime/parrot/library/PGE/Dumper.pir
branches/pluggable_runcore/runtime/parrot/library/PGE/Hs.pir
branches/pluggable_runcore/runtime/parrot/library/PGE/Perl6Grammar.pir
branches/pluggable_runcore/runtime/parrot/library/PGE/Util.pir
branches/pluggable_runcore/runtime/parrot/library/Protoobject.pir
branches/pluggable_runcore/runtime/parrot/library/SDL.pir
branches/pluggable_runcore/runtime/parrot/library/SDL/Font.pir
branches/pluggable_runcore/runtime/parrot/library/SDL/StopWatch.pir
branches/pluggable_runcore/runtime/parrot/library/Stream/Combiner.pir
branches/pluggable_runcore/runtime/parrot/library/Test/Class.pir
branches/pluggable_runcore/runtime/parrot/library/Test/More.pir
branches/pluggable_runcore/runtime/parrot/library/YAML/Dumper/Default.pir
branches/pluggable_runcore/runtime/parrot/library/parrotlib.pir
branches/pluggable_runcore/runtime/parrot/library/pcre.pir
branches/pluggable_runcore/src/call/ops.c (contents, props changed)
branches/pluggable_runcore/src/call/pcc.c (props changed)
branches/pluggable_runcore/src/debug.c
branches/pluggable_runcore/src/dynoplibs/obscure.ops
branches/pluggable_runcore/src/dynpmc/dynlexpad.pmc
branches/pluggable_runcore/src/dynpmc/foo.pmc
branches/pluggable_runcore/src/dynpmc/gdbmhash.pmc
branches/pluggable_runcore/src/dynpmc/rational.pmc
branches/pluggable_runcore/src/embed.c
branches/pluggable_runcore/src/exceptions.c
branches/pluggable_runcore/src/gc/alloc_memory.c (contents, props changed)
branches/pluggable_runcore/src/gc/alloc_register.c (contents, props changed)
branches/pluggable_runcore/src/gc/alloc_resources.c (props changed)
branches/pluggable_runcore/src/gc/api.c (contents, props changed)
branches/pluggable_runcore/src/gc/gc_private.h
branches/pluggable_runcore/src/gc/generational_ms.c (props changed)
branches/pluggable_runcore/src/gc/incremental_ms.c (props changed)
branches/pluggable_runcore/src/gc/malloc.c (props changed)
branches/pluggable_runcore/src/gc/malloc_trace.c (props changed)
branches/pluggable_runcore/src/gc/mark_sweep.c (contents, props changed)
branches/pluggable_runcore/src/gc/system.c (props changed)
branches/pluggable_runcore/src/global.c
branches/pluggable_runcore/src/hash.c
branches/pluggable_runcore/src/hll.c
branches/pluggable_runcore/src/interp/inter_cb.c (props changed)
branches/pluggable_runcore/src/interp/inter_create.c (contents, props changed)
branches/pluggable_runcore/src/interp/inter_misc.c (props changed)
branches/pluggable_runcore/src/io/api.c
branches/pluggable_runcore/src/io/buffer.c
branches/pluggable_runcore/src/io/filehandle.c
branches/pluggable_runcore/src/io/unix.c
branches/pluggable_runcore/src/jit/i386/jit_defs.c
branches/pluggable_runcore/src/key.c
branches/pluggable_runcore/src/library.c
branches/pluggable_runcore/src/oo.c
branches/pluggable_runcore/src/ops/bit.ops
branches/pluggable_runcore/src/ops/cmp.ops
branches/pluggable_runcore/src/ops/core.ops
branches/pluggable_runcore/src/ops/debug.ops
branches/pluggable_runcore/src/ops/experimental.ops
branches/pluggable_runcore/src/ops/io.ops
branches/pluggable_runcore/src/ops/math.ops
branches/pluggable_runcore/src/ops/object.ops
branches/pluggable_runcore/src/ops/ops.num
branches/pluggable_runcore/src/ops/pic.ops
branches/pluggable_runcore/src/ops/pmc.ops
branches/pluggable_runcore/src/ops/set.ops
branches/pluggable_runcore/src/ops/string.ops
branches/pluggable_runcore/src/ops/sys.ops
branches/pluggable_runcore/src/ops/var.ops
branches/pluggable_runcore/src/packdump.c
branches/pluggable_runcore/src/packfile.c
branches/pluggable_runcore/src/packout.c
branches/pluggable_runcore/src/parrot_debugger.c
branches/pluggable_runcore/src/pmc.c
branches/pluggable_runcore/src/pmc/addrregistry.pmc
branches/pluggable_runcore/src/pmc/array.pmc
branches/pluggable_runcore/src/pmc/bigint.pmc
branches/pluggable_runcore/src/pmc/bignum.pmc
branches/pluggable_runcore/src/pmc/class.pmc
branches/pluggable_runcore/src/pmc/continuation.pmc
branches/pluggable_runcore/src/pmc/coroutine.pmc
branches/pluggable_runcore/src/pmc/default.pmc
branches/pluggable_runcore/src/pmc/env.pmc
branches/pluggable_runcore/src/pmc/exception.pmc
branches/pluggable_runcore/src/pmc/exporter.pmc
branches/pluggable_runcore/src/pmc/filehandle.pmc
branches/pluggable_runcore/src/pmc/fixedbooleanarray.pmc
branches/pluggable_runcore/src/pmc/fixedfloatarray.pmc
branches/pluggable_runcore/src/pmc/fixedintegerarray.pmc
branches/pluggable_runcore/src/pmc/fixedpmcarray.pmc
branches/pluggable_runcore/src/pmc/fixedstringarray.pmc
branches/pluggable_runcore/src/pmc/float.pmc
branches/pluggable_runcore/src/pmc/hash.pmc
branches/pluggable_runcore/src/pmc/iterator.pmc
branches/pluggable_runcore/src/pmc/key.pmc
branches/pluggable_runcore/src/pmc/lexpad.pmc
branches/pluggable_runcore/src/pmc/managedstruct.pmc
branches/pluggable_runcore/src/pmc/namespace.pmc
branches/pluggable_runcore/src/pmc/null.pmc
branches/pluggable_runcore/src/pmc/object.pmc
branches/pluggable_runcore/src/pmc/orderedhash.pmc
branches/pluggable_runcore/src/pmc/os.pmc
branches/pluggable_runcore/src/pmc/parrotinterpreter.pmc
branches/pluggable_runcore/src/pmc/parrotlibrary.pmc
branches/pluggable_runcore/src/pmc/parrotrunningthread.pmc
branches/pluggable_runcore/src/pmc/pmcproxy.pmc
branches/pluggable_runcore/src/pmc/pointer.pmc
branches/pluggable_runcore/src/pmc/retcontinuation.pmc
branches/pluggable_runcore/src/pmc/role.pmc
branches/pluggable_runcore/src/pmc/scheduler.pmc
branches/pluggable_runcore/src/pmc/schedulermessage.pmc
branches/pluggable_runcore/src/pmc/socket.pmc
branches/pluggable_runcore/src/pmc/string.pmc
branches/pluggable_runcore/src/pmc/task.pmc
branches/pluggable_runcore/src/pmc/timer.pmc
branches/pluggable_runcore/src/pmc/unmanagedstruct.pmc
branches/pluggable_runcore/src/pmc_freeze.c
branches/pluggable_runcore/src/runcore/cores.c (props changed)
branches/pluggable_runcore/src/runcore/main.c (props changed)
branches/pluggable_runcore/src/runcore/trace.c (contents, props changed)
branches/pluggable_runcore/src/string/api.c
branches/pluggable_runcore/src/string/primitives.c
branches/pluggable_runcore/src/sub.c
branches/pluggable_runcore/src/vtable.tbl
branches/pluggable_runcore/t/codingstd/c_function_docs.t
branches/pluggable_runcore/t/codingstd/svn_id.t
branches/pluggable_runcore/t/codingstd/test_file_coverage.t
branches/pluggable_runcore/t/compilers/imcc/imcpasm/cfg.t
branches/pluggable_runcore/t/compilers/imcc/syn/errors.t
branches/pluggable_runcore/t/compilers/imcc/syn/file.t
branches/pluggable_runcore/t/compilers/imcc/syn/labels.t
branches/pluggable_runcore/t/compilers/pct/past.t
branches/pluggable_runcore/t/compilers/pct/post.t
branches/pluggable_runcore/t/compilers/pge/03-optable.t
branches/pluggable_runcore/t/compilers/pge/p5regex/p5rx.t
branches/pluggable_runcore/t/compilers/pge/perl6regex/01-regex.t
branches/pluggable_runcore/t/compilers/pge/pge_text.t
branches/pluggable_runcore/t/compilers/tge/NoneGrammar.tg (props changed)
branches/pluggable_runcore/t/configure/008-file_based_configuration.t
branches/pluggable_runcore/t/dynpmc/dynlexpad.t
branches/pluggable_runcore/t/dynpmc/foo.t
branches/pluggable_runcore/t/examples/namespace.t
branches/pluggable_runcore/t/examples/pir.t
branches/pluggable_runcore/t/examples/pod.t
branches/pluggable_runcore/t/examples/subs.t
branches/pluggable_runcore/t/library/mime_base64.t
branches/pluggable_runcore/t/library/pcre.t
branches/pluggable_runcore/t/library/protoobject.t
branches/pluggable_runcore/t/native_pbc/annotations.pbc
branches/pluggable_runcore/t/native_pbc/integer_1.pbc
branches/pluggable_runcore/t/native_pbc/number_1.pbc
branches/pluggable_runcore/t/native_pbc/number_2.pbc
branches/pluggable_runcore/t/native_pbc/string_1.pbc
branches/pluggable_runcore/t/oo/metamodel.t
branches/pluggable_runcore/t/oo/root_new.t (props changed)
branches/pluggable_runcore/t/op/basic.t
branches/pluggable_runcore/t/op/cmp-nonbranch.t
branches/pluggable_runcore/t/op/gc.t
branches/pluggable_runcore/t/op/io.t
branches/pluggable_runcore/t/op/jit.t
branches/pluggable_runcore/t/op/lexicals.t
branches/pluggable_runcore/t/op/sprintf.t
branches/pluggable_runcore/t/op/string.t
branches/pluggable_runcore/t/pharness/01-default_tests.t
branches/pluggable_runcore/t/pmc/array.t
branches/pluggable_runcore/t/pmc/capture.t
branches/pluggable_runcore/t/pmc/complex.t
branches/pluggable_runcore/t/pmc/hash.t
branches/pluggable_runcore/t/pmc/integer.t
branches/pluggable_runcore/t/pmc/io_iterator.t
branches/pluggable_runcore/t/pmc/iterator.t
branches/pluggable_runcore/t/pmc/key.t
branches/pluggable_runcore/t/pmc/namespace.t
branches/pluggable_runcore/t/pmc/nci.t
branches/pluggable_runcore/t/pmc/object-meths.t
branches/pluggable_runcore/t/pmc/object-mro.t
branches/pluggable_runcore/t/pmc/orderedhash.t
branches/pluggable_runcore/t/pmc/packfile.t
branches/pluggable_runcore/t/pmc/packfileannotation.t
branches/pluggable_runcore/t/pmc/packfileannotations.t
branches/pluggable_runcore/t/pmc/packfileconstanttable.t
branches/pluggable_runcore/t/pmc/packfilefixupentry.t
branches/pluggable_runcore/t/pmc/packfilefixuptable.t
branches/pluggable_runcore/t/pmc/packfilerawsegment.t
branches/pluggable_runcore/t/pmc/packfilesegment.t
branches/pluggable_runcore/t/pmc/pmc.t
branches/pluggable_runcore/t/pmc/resizablebooleanarray.t
branches/pluggable_runcore/t/pmc/resizablepmcarray.t
branches/pluggable_runcore/t/pmc/resizablestringarray.t
branches/pluggable_runcore/t/pmc/string.t
branches/pluggable_runcore/t/pmc/sub.t
branches/pluggable_runcore/t/pmc/testlib/packfile_common.pir
branches/pluggable_runcore/t/src/embed.t (props changed)
branches/pluggable_runcore/t/src/extend.t
branches/pluggable_runcore/t/steps/auto/gc-01.t
branches/pluggable_runcore/t/steps/auto/gdbm-01.t
branches/pluggable_runcore/t/steps/auto/gmp-01.t
branches/pluggable_runcore/t/steps/auto/readline-01.t
branches/pluggable_runcore/t/steps/init/hints/darwin-01.t
branches/pluggable_runcore/t/tools/dev/searchops/samples.pm
branches/pluggable_runcore/t/tools/dump_pbc.t
branches/pluggable_runcore/t/tools/ops2pm/08-sort_ops.t
branches/pluggable_runcore/t/tools/parrot_debugger.t
branches/pluggable_runcore/t/tools/pmc2c.t
branches/pluggable_runcore/tools/build/nativecall.pl
branches/pluggable_runcore/tools/dev/create_language.pl
branches/pluggable_runcore/tools/dev/fetch_languages.pl (props changed)
branches/pluggable_runcore/tools/dev/mk_gitignore.pl (props changed)
branches/pluggable_runcore/tools/dev/mk_language_shell.pl
branches/pluggable_runcore/tools/dev/mk_manifest_and_skip.pl
branches/pluggable_runcore/tools/dev/parrot-fuzzer
branches/pluggable_runcore/tools/dev/parrot.supp
branches/pluggable_runcore/tools/dev/pbc_header.pl
branches/pluggable_runcore/tools/dev/pbc_to_exe.pir
branches/pluggable_runcore/tools/dev/vtablize.pl
branches/pluggable_runcore/tools/util/perlcritic-cage.conf (props changed)
branches/pluggable_runcore/tools/util/pgegrep
branches/pluggable_runcore/tools/util/release.json
Modified: branches/pluggable_runcore/CREDITS
==============================================================================
--- branches/pluggable_runcore/CREDITS Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/CREDITS Fri Aug 14 01:24:23 2009 (r40541)
@@ -237,6 +237,7 @@
D: Patch for key flags in pdd08
D: Range check in Env PMC
A: christoph_googleacct at mksig.org
+A: christop... at mksig.org
D: Pipp
E: christoph at mksig.org
@@ -496,6 +497,12 @@
N: John Paul Wallington
D: pir-mode.el: fix for xemacs plus bugfixes and cleanups
+N: Jonathan Leto
+E: jonathan at leto.net
+W: http://leto.net
+U: dukeleto
+S: Portland, OR
+
N: Jonathan Scott Duff
U: duff
E: duff at pobox.com
@@ -667,6 +674,11 @@
E: Michael.Cartmell at thomson.com
D: README.win32 spelling patch
+N: Michael H. Hind
+U: mikehh
+D: codingstd patches
+E: mike.hind at gmail.com
+
N: Michael G. Schwern
N: Michael Scott
@@ -677,9 +689,6 @@
U: mikescott
W: http://xrl.us/sml
-U: mikehh
-D: codingstd patches
-
N: Michael Stevens
D: Remove an unused variable in C-land
@@ -788,6 +797,11 @@
E: rurban at cpan.org
D: cygwin, 64-bit pbc compat, float converters, bignum.pmc
+N: Richard Hainsworth
+U: finanalyst
+E: richard at rusrating.ru
+D: bugfix SDL Font
+
N: Richard Tibbetts
D: Divide by zero exceptions in some PMCs
@@ -840,6 +854,11 @@
N: Sam Vilain
D: Prototype object model and tests
+N: Samuel Harrington
+E: samuel.harrington at mines.sdsmt.edu
+U: samlh
+D: css patch
+
N: Sean O'Rourke
E: educated_foo at yahoo.com
U: educated_foo
@@ -917,6 +936,11 @@
U: thgibbs
E: thgibbs at deltafarms.com
+N: Ted Reed
+U: treed
+E: ted.reed at gmail.com
+D: cardinal
+
N: Thilo Planz
D: partcl tests and inspiration
Modified: branches/pluggable_runcore/ChangeLog
==============================================================================
--- branches/pluggable_runcore/ChangeLog Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ChangeLog Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,12 +1,16 @@
#1 $Id$
+2009.7.21 cotto
+ * Released 1.4.0
+ See NEWS for more.
+
2009.06.16 Whiteknight
- * Released 1.3.0
- Ses NEWS for more.
+ * Released 1.3.0
+ Ses NEWS for more.
2009.05.19 Infinoid
- * Released 1.2.0
- See NEWS for more.
+ * Released 1.2.0
+ See NEWS for more.
2009.04.21 fperrad
* Released 1.1.0
Modified: branches/pluggable_runcore/Configure.pl
==============================================================================
--- branches/pluggable_runcore/Configure.pl Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/Configure.pl Fri Aug 14 01:24:23 2009 (r40541)
@@ -196,6 +196,25 @@
=back
+=item C<--configure_trace>
+
+Store the results of each configuration step in a Storable F<.sto> file on
+disk, for later analysis by F<Parrot::Configure::Trace> methods.
+
+=item Operating system-specific configuration options
+
+=over 4
+
+=item C<--darwin_no_fink>
+
+On Darwin, do not probe for Fink libraries.
+
+=item C<--darwin_no_macports>
+
+On Darwin, do not probe for Macports libraries.
+
+=back
+
=back
=head2 Compile Options
@@ -336,11 +355,6 @@
Use JIT to emit a native executable.
-=item C<--gc=(type)>
-
-Determine the type of garbage collection. The value for C<type> should be one
-of: C<gc>, C<libc>, C<malloc> or C<malloc-trace>. The default is C<gc>.
-
=back
=head2 International Components For Unicode (ICU) Options
@@ -638,11 +652,11 @@
You may see how this works in practice by calling:
- perl Configure.pl --file=xconf/samples/yourfoobar
+ perl Configure.pl --file=examples/config/file/configcompiler
or
- perl Configure.pl --file=xconf/samples/testfoobar
+ perl Configure.pl --file=examples/config/file/configwithfatalstep
=head1 SEE ALSO
Modified: branches/pluggable_runcore/DEPRECATED.pod
==============================================================================
--- branches/pluggable_runcore/DEPRECATED.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/DEPRECATED.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -33,27 +33,10 @@
.include 'warnings.pasm'
warningson .PARROT_WARNINGS_DEPRECATED_FLAG
-=head1 Configuration
-
-=over 4
-
-=item Alternate GC configurations [eligible in 1.5]
-
-C<malloc>, C<malloc-trace> and C<libc> will be removed as potential
-options for the C<--gc> config option.
-
-L<https://trac.parrot.org/parrot/ticket/490>
-
-=back
-
=head1 PMCS
=over 4
-=item pair (dynamic PMC) [eligible in 1.5]
-
-L<https://trac.parrot.org/parrot/ticket/187>
-
=item random [eligible in 1.1]
L<https://trac.parrot.org/parrot/ticket/189>
@@ -79,6 +62,12 @@
L<https://trac.parrot.org/parrot/ticket/264>
+=item VTABLE nomenclature. [eligible in 1.5]
+
+Current list of VTABLE functions will be reviewed and cleaned.
+
+L<https://trac.parrot.org/parrot/ticket/866>
+
=back
=head1 Opcodes
@@ -92,10 +81,6 @@
L<https://trac.parrot.org/parrot/ticket/449>
-=item experimental ops [eligible in 1.1]
-
-F<src/ops/experimental.ops> - only the C<trap> opcode remains
-
=item get_addr and set_addr [eligible in 1.5]
L<https://trac.parrot.org/parrot/ticket/218>
@@ -105,14 +90,6 @@
for Sub, Exception, and related PMC types will instead be handled by
get_label and set_label.
-=item C<bsr>, C<jsr>, and C<ret> [eligible in 1.5]
-
-L<https://trac.parrot.org/parrot/ticket/702>
-
-=item C<branch_cs> [eligible in 1.5]
-
-L<https://trac.parrot.org/parrot/ticket/470>
-
=back
=head1 Bytecode
@@ -135,9 +112,11 @@
=head1 Class Features
-=over 4
+[Nothing at this time.]
-=back
+=head1 Debugger
+
+Assigning to registers [experimental]
=head1 PIR syntax
@@ -145,21 +124,7 @@
=item Assignment syntax with opcodes [eligible in 1.1]
-When the first argument of an opcode is C<OUT>, then
-the assignment syntax will be allowed, as it is today.
-
-In any other case (i.e. C<INOUT>, C<IN>), this will become
-a syntax error. For example:
-
- $S0 = print
- $P0 = substr 1, 2, "x"
-
-Will have to be:
-
- print $S0
- substr $P0, 1, 2, "x"
-
-L<http://rt.perl.org/rt3/Ticket/Display.html?id=36283>
+L<https://trac.parrot.org/parrot/ticket/906>
=item named class/pmc lookup in pir syntax such as new, isa, subclass,
get_class, etc [eligible in 1.1]
@@ -217,55 +182,55 @@
L<https://trac.parrot.org/parrot/ticket/443>
-=item parrot_new_pmc_hash [eligible in 1.5]
+=item PMC Attributes Allocation Functions [experimental]
-This function will be removed. parrot_new_hash should be used in its place.
+ Parrot_gc_allocate_pmc_attributes
+ Parrot_gc_free_pmc_attributes
-L<https://trac.parrot.org/parrot/ticket/494>
+These items and related helper functions are added as experimental support
+for TT #895
-=item Parrot_get_namespace_autobase [eligible in 1.5]
+=item PDB_compile and PDB_eval [eligible in 2.1]
-L<https://trac.parrot.org/parrot/ticket/155>
+The function PDB_compile doesn't work since some time, and his implementation
+was a hack. His functionality may be reimplemented in another way. Until the
+end of deprecation cycle it just throws an excpetion.
-=item Parrot_find_global_k [eligible in 1.5]
+The PDB_eval function, that used in the debugger to support the eval
+command, was using PDB_compile. His functionality must be reimplemented
+in another way and with a name that follows current conventions, in the
+meantime and until the end of the deprecation cycle it just shows a
+diagnostic message.
-L<https://trac.parrot.org/parrot/ticket/156>
+L<https://trac.parrot.org/parrot/ticket/872>
-=item Parrot_MMD_method_name [eligible in 1.5]
+=back
-L<https://trac.parrot.org/parrot/ticket/625>
+=head1 Compiler tools
-=item pobject_lives [eligible in 1.5]
+=head2 PASM1 compiler
-L<https://trac.parrot.org/parrot/ticket/664>
+=over 4
-=item functions in src/stack.c [eligible in 1.5]
+=item C<PASM1 compiler> [eligible in 2.1]
-L<https://trac.parrot.org/parrot/ticket/702>
-Here is a list of functions in this file which are currently being exported:
+See PDB_compile.
- stack_system_init
- cst_new_stack_chunk
- new_stack
- mark_stack
- stack_height
- stack_entry
- stack_prepare_push
- stack_push
- stack_prepare_pop
- stack_pop
- pop_dest
- stack_peep
- Parrot_dump_dynamic_environment
- Parrot_push_action*
- Parrot_push_mark*
- Parrot_pop_mark*
+=back
-* = item may be kept but reimplemented.
+=head2 Parrot Grammar Engine (PGE)
-=back
+=over 4
-=head1 Compiler tools
+=item Action methods in rules
+
+Per Synopsis 5, all regexes will have an implied {*} token at the
+end which cause invocation of an action method if a C<:action>
+object is supplied.
+
+L<https://trac.parrot.org/parrot/ticket/843>
+
+=back
=head2 Parrot Compiler Toolkit
@@ -291,6 +256,14 @@
L<https://trac.parrot.org/parrot/ticket/463>
+=item PAST::Val node generation [eligible in 1.5]
+
+The PAST::Compiler may generate the code for PAST::Val nodes
+(i.e., constants) at the beginning of the block (Parrot sub) instead
+of the location where they occur in the PAST tree.
+
+L<https://trac.parrot.org/parrot/ticket/868>
+
=back
=head2 Not Quite Perl (NQP)
@@ -305,9 +278,25 @@
L<https://trac.parrot.org/parrot/ticket/459>
-=back
+=item Quoted items [eligible in 1.5]
-=cut
+Double-quoted strings will interpret unescaped $-names
+as interpolated variables in the string. Bare slashes
+will introduce regular expressions. The C<< <foo bar> >>
+syntax will produce an array of strings instead of a single
+string.
+
+L<https://trac.parrot.org/parrot/ticket/837>
+
+=item C<< PIR q:to:<xyz> >> inline PIR [eligible in 1.5]
+
+The C<< PIR q:to:<xyz> >> form of inline PIR in NQP scripts is
+deprecated. Use C< Q:PIR { ... } > or C< Q:PIR {{ ... }} >
+instead.
+
+L<https://trac.parrot.org/parrot/ticket/842>
+
+=back
=head1 build tools
@@ -340,22 +329,18 @@
=over 4
-=item Data::Replace [eligible in 1.5]
-
-L<https://trac.parrot.org/parrot/ticket/108>
-
=item JSON, JSON, and Config;JSON [eligible in 1.5]
L<https://trac.parrot.org/parrot/ticket/508>
-=item NCI::call_toolkit_init [eligible in 1.5]
-
-L<https://trac.parrot.org/parrot/ticket/753>
-
=item Cross-HLL library loading [experimental]
L<https://trac.parrot.org/parrot/ticket/754>
+=item OpenGL bindings and libraries [experimental]
+
+L<https://trac.parrot.org/parrot/ticket/852>
+
=back
=head1 Footnotes
Modified: branches/pluggable_runcore/MANIFEST
==============================================================================
--- branches/pluggable_runcore/MANIFEST Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/MANIFEST Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Sun Jul 12 15:39:35 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu Aug 13 02:35:20 2009 UT
#
# See below for documentation on the format of this file.
#
@@ -228,7 +228,6 @@
config/auto/env.pm []
config/auto/env/test_setenv_c.in []
config/auto/env/test_unsetenv_c.in []
-config/auto/fink.pm []
config/auto/format.pm []
config/auto/funcptr.pm []
config/auto/funcptr/test_c.in []
@@ -257,7 +256,6 @@
config/auto/jit/test_exec_cygwin_c.in []
config/auto/jit/test_exec_linux_c.in []
config/auto/jit/test_exec_openbsd_c.in []
-config/auto/macports.pm []
config/auto/memalign.pm []
config/auto/memalign/test2_c.in []
config/auto/memalign/test_c.in []
@@ -420,9 +418,6 @@
docs/book/draft/appe_source_code.pod []
docs/book/draft/ch01_introduction.pod []
docs/book/draft/ch02_getting_started.pod []
-docs/book/draft/ch04_compiler_tools.pod []
-docs/book/draft/ch05_pge.pod []
-docs/book/draft/ch06_nqp.pod []
docs/book/draft/ch07_dynpmcs.pod []
docs/book/draft/ch08_dynops.pod []
docs/book/draft/ch10_opcode_reference.pod []
@@ -431,6 +426,11 @@
docs/book/draft/chXX_hlls.pod []
docs/book/draft/chXX_library.pod []
docs/book/draft/chXX_testing_and_debugging.pod []
+docs/book/pct/ch01_introduction.pod []
+docs/book/pct/ch02_getting_started.pod []
+docs/book/pct/ch03_compiler_tools.pod []
+docs/book/pct/ch04_pge.pod []
+docs/book/pct/ch05_nqp.pod []
docs/book/pir/ch01_introduction.pod []
docs/book/pir/ch02_getting_started.pod []
docs/book/pir/ch03_basic_syntax.pod []
@@ -448,7 +448,6 @@
docs/dev/c_functions.pod []
docs/dev/debugging_with_msvc.pod []
docs/dev/events.pod []
-docs/dev/fhs.pod []
docs/dev/headerizer.pod []
docs/dev/infant.pod []
docs/dev/jit_i386.pod []
@@ -641,12 +640,15 @@
examples/benchmarks/vpm.py [examples]
examples/benchmarks/vpm.rb [examples]
examples/c/nanoparrot.c [examples]
+examples/c/pbc_info.c [examples]
examples/c/test_main.c [examples]
examples/compilers/Makefile [examples]
examples/compilers/japhc.c [examples]
+examples/config/file/configcompiler [examples]
+examples/config/file/configwithfatalstep [examples]
examples/embed/Makefile [examples]
examples/embed/Makefile.msvc [examples]
-examples/embed/lorito.c [examples]
+examples/embed/cotorra.c [examples]
examples/io/http.pir [examples]
examples/io/httpd.pir [examples]
examples/japh/README []doc
@@ -728,6 +730,7 @@
examples/opengl/math.pir [examples]
examples/opengl/shapes.p6 [examples]
examples/opengl/shapes.pir [examples]
+examples/opengl/static-triangle-hll.pir [examples]
examples/opengl/static-triangle.p6 [examples]
examples/opengl/static-triangle.pir [examples]
examples/opengl/triangle.p6 [examples]
@@ -865,7 +868,6 @@
examples/streams/Writer.pir [examples]
examples/subs/bsr_ret.pasm [examples]
examples/subs/coroutine.pasm [examples]
-examples/subs/jsr_ret.pasm [examples]
examples/subs/multi_retvals.pir [examples]
examples/subs/no_retval.pir [examples]
examples/subs/pasm_sub1.pasm [examples]
@@ -996,7 +998,6 @@
include/parrot/scheduler_private.h [main]include
include/parrot/settings.h [main]include
include/parrot/slice.h [main]include
-include/parrot/stacks.h [main]include
include/parrot/stat.h [main]include
include/parrot/string.h [main]include
include/parrot/string_funcs.h [main]include
@@ -1161,7 +1162,6 @@
runtime/parrot/library/Data/Dumper.pir [library]
runtime/parrot/library/Data/Dumper/Base.pir [library]
runtime/parrot/library/Data/Dumper/Default.pir [library]
-runtime/parrot/library/Data/Replace.pir [library]
runtime/parrot/library/Digest/MD5.pir [library]
runtime/parrot/library/Getopt/Obj.pir [library]
runtime/parrot/library/HTTP/Daemon.pir [library]
@@ -1171,7 +1171,6 @@
runtime/parrot/library/Math/Rand.pir [library]
runtime/parrot/library/Math/Random/mt19937ar.pir [library]
runtime/parrot/library/NCI/Utils.pir [library]
-runtime/parrot/library/NCI/call_toolkit_init.pir [library]
runtime/parrot/library/OpenGL.pir [library]
runtime/parrot/library/OpenGL/Math.pir [library]
runtime/parrot/library/P6object.pir [library]
@@ -1249,13 +1248,14 @@
src/dynext.c []
src/dynoplibs/README []doc
src/dynoplibs/obscure.ops []
+src/dynoplibs/math.ops []
src/dynpmc/README.pod []doc
src/dynpmc/dynlexpad.pmc [devel]src
src/dynpmc/ext.pir []
src/dynpmc/foo.pmc [devel]src
+src/dynpmc/foo2.pmc [devel]src
src/dynpmc/gdbmhash.pmc [devel]src
src/dynpmc/main.pasm []
-src/dynpmc/pair.pmc [devel]src
src/dynpmc/rational.pmc [devel]src
src/dynpmc/rotest.pmc [devel]src
src/dynpmc/subproxy.pmc [devel]src
@@ -1376,13 +1376,13 @@
src/parrot_debugger.c []
src/pbc_disassemble.c []
src/pbc_dump.c []
-src/pbc_info.c []
src/pbc_merge.c []
src/pic.c []
src/pic_jit.c []
src/pmc.c []
src/pmc/addrregistry.pmc [devel]src
src/pmc/array.pmc [devel]src
+src/pmc/arrayiterator.pmc [devel]src
src/pmc/bigint.pmc [devel]src
src/pmc/bignum.pmc [devel]src
src/pmc/boolean.pmc [devel]src
@@ -1411,6 +1411,8 @@
src/pmc/float.pmc [devel]src
src/pmc/handle.pmc [devel]src
src/pmc/hash.pmc [devel]src
+src/pmc/hashiterator.pmc [devel]src
+src/pmc/hashiteratorkey.pmc [devel]src
src/pmc/integer.pmc [devel]src
src/pmc/iterator.pmc [devel]src
src/pmc/key.pmc [devel]src
@@ -1423,6 +1425,7 @@
src/pmc/null.pmc [devel]src
src/pmc/object.pmc [devel]src
src/pmc/orderedhash.pmc [devel]src
+src/pmc/orderedhashiterator.pmc [devel]src
src/pmc/os.pmc [devel]src
src/pmc/packfile.pmc [devel]src
src/pmc/packfileannotation.pmc [devel]src
@@ -1456,6 +1459,7 @@
src/pmc/socket.pmc [devel]src
src/pmc/string.pmc [devel]src
src/pmc/stringhandle.pmc [devel]src
+src/pmc/stringiterator.pmc [devel]src
src/pmc/sub.pmc [devel]src
src/pmc/task.pmc [devel]src
src/pmc/timer.pmc [devel]src
@@ -1468,7 +1472,6 @@
src/scheduler.c []
src/spf_render.c []
src/spf_vtable.c []
-src/stacks.c []
src/string/api.c []
src/string/charset.c []
src/string/charset/ascii.c []
@@ -1541,10 +1544,8 @@
t/compilers/imcc/imcpasm/opt2.t [test]
t/compilers/imcc/imcpasm/optc.t [test]
t/compilers/imcc/imcpasm/pcc.t [test]
-t/compilers/imcc/imcpasm/sub.t [test]
t/compilers/imcc/reg/alloc.t [test]
t/compilers/imcc/reg/spill.t [test]
-t/compilers/imcc/syn/bsr.t [test]
t/compilers/imcc/syn/clash.t [test]
t/compilers/imcc/syn/const.t [test]
t/compilers/imcc/syn/errors.t [test]
@@ -1597,6 +1598,7 @@
t/compilers/pge/pge_globs.t [test]
t/compilers/pge/pge_text.t [test]
t/compilers/pge/pge_util.t [test]
+t/compilers/pge/regression.t [test]
t/compilers/tge/NoneGrammar.tg [test]
t/compilers/tge/basic.t [test]
t/compilers/tge/grammar.t [test]
@@ -1672,10 +1674,12 @@
t/distro/file_metadata.t [test]
t/distro/manifest.t [test]
t/distro/meta_yml.t [test]
+t/dynoplibs/obscure.t [test]
+t/dynoplibs/math.t [test]
t/dynpmc/dynlexpad.t [test]
t/dynpmc/foo.t [test]
+t/dynpmc/foo2.t [test]
t/dynpmc/gdbmhash.t [test]
-t/dynpmc/pair.t [test]
t/dynpmc/rational.t [test]
t/dynpmc/rotest.t [test]
t/dynpmc/subclass_with_pir_method.t [test]
@@ -1693,6 +1697,7 @@
t/examples/subs.t [test]
t/examples/tutorial.t [test]
t/harness [test]
+t/include/fp_equality.t [test]
t/library/cgi_query_hash.t [test]
t/library/coroutine.t [test]
t/library/dumper.t [test]
@@ -1825,8 +1830,10 @@
t/pharness/02-get_test_prog_args.t [test]
t/pharness/03-handle_long_options.t [test]
t/pharness/04-Usage.t [test]
+t/pir/macro.t [test]
t/pmc/addrregistry.t [test]
t/pmc/array.t [test]
+t/pmc/arrayiterator.t [test]
t/pmc/bigint.t [test]
t/pmc/bignum.t [test]
t/pmc/boolean.t [test]
@@ -1858,6 +1865,8 @@
t/pmc/globals.t [test]
t/pmc/handle.t [test]
t/pmc/hash.t [test]
+t/pmc/hashiterator.t [test]
+t/pmc/hashiteratorkey.t [test]
t/pmc/integer.t [test]
t/pmc/io.t [test]
t/pmc/io_iterator.t [test]
@@ -1877,6 +1886,7 @@
t/pmc/object.t [test]
t/pmc/objects.t [test]
t/pmc/orderedhash.t [test]
+t/pmc/orderedhashiterator.t [test]
t/pmc/os.t [test]
t/pmc/packfile.t [test]
t/pmc/packfileannotation.t [test]
@@ -1916,6 +1926,7 @@
t/pmc/socket.t [test]
t/pmc/string.t [test]
t/pmc/stringhandle.t [test]
+t/pmc/stringiterator.t [test]
t/pmc/sub.t [test]
t/pmc/sys.t [test]
t/pmc/task.t [test]
@@ -1949,7 +1960,6 @@
t/steps/auto/crypto-01.t [test]
t/steps/auto/ctags-01.t [test]
t/steps/auto/env-01.t [test]
-t/steps/auto/fink-01.t [test]
t/steps/auto/format-01.t [test]
t/steps/auto/funcptr-01.t [test]
t/steps/auto/gc-01.t [test]
@@ -1963,8 +1973,6 @@
t/steps/auto/inline-01.t [test]
t/steps/auto/isreg-01.t [test]
t/steps/auto/jit-01.t [test]
-t/steps/auto/macports-01.t [test]
-t/steps/auto/macports-02.t [test]
t/steps/auto/memalign-01.t [test]
t/steps/auto/msvc-01.t [test]
t/steps/auto/neg_0-01.t [test]
@@ -2081,6 +2089,7 @@
t/tools/ops2pm/samples/pic_ops.original [test]
t/tools/parrot_debugger.t [test]
t/tools/pbc_merge.t [test]
+t/tools/pgegrep.t [test]
t/tools/pmc2c.t [test]
t/tools/pmc2cutils/00-qualify.t [test]
t/tools/pmc2cutils/01-pmc2cutils.t [test]
@@ -2090,6 +2099,7 @@
t/tools/pmc2cutils/05-gen_c.t [test]
t/tools/pmc2cutils/08-pmc-pm.t [test]
t/tools/pmc2cutils/README []doc
+t/tools/testdata [test]
tools/build/addopstags.pl []
tools/build/c2str.pl []
tools/build/fixup_gen_file.pl []
@@ -2134,7 +2144,6 @@
tools/dev/opsrenumber.pl []
tools/dev/parrot-fuzzer []
tools/dev/parrot.supp []
-tools/dev/parrot_8.supp []
tools/dev/parrot_api.pl []
tools/dev/parrot_coverage.pl []
tools/dev/parrotbench.pl []
@@ -2166,8 +2175,6 @@
tools/util/release.json []
tools/util/templates.json []
tools/util/update_copyright.pl []
-xconf/samples/testfoobar []
-xconf/samples/yourfoobar []
# Local variables:
# mode: text
# buffer-read-only: t
Modified: branches/pluggable_runcore/MANIFEST.SKIP
==============================================================================
--- branches/pluggable_runcore/MANIFEST.SKIP Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/MANIFEST.SKIP Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,6 +1,6 @@
# ex: set ro:
# $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Thu Jun 25 20:34:12 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Tue Jul 21 23:09:08 2009 UT
#
# This file should contain a transcript of the svn:ignore properties
# of the directories in the Parrot subversion repository. (Needed for
Modified: branches/pluggable_runcore/MANIFEST.generated
==============================================================================
--- branches/pluggable_runcore/MANIFEST.generated Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/MANIFEST.generated Fri Aug 14 01:24:23 2009 (r40541)
@@ -2,10 +2,10 @@
# See tools/dev/install_files.pl for documentation on the
# format of this file.
# Please re-sort this file after *EVERY* modification
-blib/lib/libparrot.1.3.0.dylib [main]lib
+blib/lib/libparrot.1.4.0.dylib [main]lib
blib/lib/libparrot.a [main]lib
blib/lib/libparrot.dylib [main]lib
-blib/lib/libparrot.so.1.3.0 [main]lib
+blib/lib/libparrot.so.1.4.0 [main]lib
blib/lib/libparrot.so [main]lib
compilers/json/JSON/grammar.pbc [json]
compilers/json/JSON.pbc [json]
@@ -48,6 +48,7 @@
include/parrot/vtable.h [main]include
install_config.fpmc [main]lib
src/install_config.o [main]lib
+src/install_config.obj [main]lib
installable_parrot_config.exe [main]bin
installable_parrot_config [main]bin
installable_parrot_debugger.exe [main]bin
@@ -58,14 +59,13 @@
installable_pbc_disassemble [main]bin
installable_pbc_dump.exe [main]bin
installable_pbc_dump [main]bin
-installable_pbc_info.exe [main]bin
-installable_pbc_info [main]bin
installable_pbc_merge.exe [main]bin
installable_pbc_merge [main]bin
installable_pbc_to_exe.exe [main]bin
installable_pbc_to_exe [main]bin
lib/Parrot/Config/Generated.pm [devel]lib
libparrot.dll [main]bin
+libparrot.lib [main]bin
lib/Parrot/OpLib/core.pm [devel]lib
lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm [devel]lib
lib/Parrot/PMC.pm [devel]lib
@@ -118,7 +118,6 @@
runtime/parrot/include/iotypes.pasm [main]
runtime/parrot/include/iterator.pasm [main]
runtime/parrot/include/longopt.pasm [main]
-runtime/parrot/include/mmd.pasm [main]
runtime/parrot/include/opengl_defines.pasm [main]
runtime/parrot/include/parrotlib.pbc [main]
runtime/parrot/include/pmctypes.pasm [main]
Modified: branches/pluggable_runcore/META.yml
==============================================================================
--- branches/pluggable_runcore/META.yml Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/META.yml Fri Aug 14 01:24:23 2009 (r40541)
@@ -4,7 +4,7 @@
# See http://module-build.sourceforge.net/META-spec-current.html for details.
---
name: parrot
-version: 1.3.0
+version: 1.4.0
author: parrot-dev at lists.parrot.org
abstract: a virtual machine designed for dynamic languages
license: artistic2
Modified: branches/pluggable_runcore/NEWS
==============================================================================
--- branches/pluggable_runcore/NEWS Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/NEWS Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,5 +1,35 @@
# $Id$
+New in 1.4.0
+- Core
+ + Key and Iterator refactor
+ + Major pbc_to_exe generated code speed improvement
+ + New "Infinite Memory" GC core for demonstration purposes
+ + gc_debug runcore and GC-related heisenbug fixes
+ + Elimination of variable expansion in parrot_config
+ + CLI arguments are processed as Unicode by default
+ + Substantial optimizations in NCI
+ + Parrot builds on Win64
+ + Hashes can use native types as keys and values
+ + Fixed installed pbc_to_exe
+ + Simplification of PMC generation code
+ + Improved GC encapsulation and API documentation
+- Documentation
+ + List of candidates for embedding API (docs/embed.pod)
+ + PIR book sent to publisher
+- Testing
+ + Several conversions of Perl test to pure PIR.
+ + C indentation coding standards test improvement
+ + Improved test coverage of example code
+- Deprecations
+ + Removal of PGE rules: <null> <fail> <sp> <lt> <gt> <dot>
+ + Removal of PGE methods: .text .item .result_object
+ + Deprecation of most dynops
++ Miscellaneous
+ + Beginnings of OpenGL::Math library; OpenGL bindings and library marked experimental
+ + Localizing and consting fixes
+ + Many memory and thread-related leaks plugged
+
New in 1.3.0
- Core
+ Optimized parts of the IO system
Modified: branches/pluggable_runcore/PBC_COMPAT
==============================================================================
--- branches/pluggable_runcore/PBC_COMPAT Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/PBC_COMPAT Fri Aug 14 01:24:23 2009 (r40541)
@@ -27,14 +27,8 @@
# please insert tab separated entries at the top of the list
-4.8 2009.05.30 Infinoid Added Handle PMC
-4.7 2009.05.29 cotto add cmp_pmc opcode (also, addition of setstdin and root_new in previous commits)
-4.6 2009.05.18 bacek removed PackfileAnnotationKeys PMC
-4.5 2009.04.10 cotto removed Ref and SharedRef PMCs
-4.4 2009.04.07 pmichaud find_caller_lex added
-4.3 2009.03.25 jonathan socket opcodes added
-4.2 2009.03.21 cotto removed Bound_NCI PMC
-4.1 2009.03.17 cotto removed Slice PMC
+5.1 2009.08.06 cotto remove branch_cs opcode
+5.0 2009.07.21 cotto released 1.4.0
4.0 2009.03.17 allison released 1.0.0
3.0 2007.07.23 jonathan implementing new PBC header format
2.0 2005.11.22 leo changed PBC format (HLL_info)
Modified: branches/pluggable_runcore/PLATFORMS
==============================================================================
--- branches/pluggable_runcore/PLATFORMS Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/PLATFORMS Fri Aug 14 01:24:23 2009 (r40541)
@@ -14,15 +14,15 @@
CGoto JIT EXEC Thr Sig
--------------------------------------------------------------------------------
cygwin1.5.25-x86-gcc3.4.4 4 Y Y - - - Y Y Y 20090315
-darwin8.11.1-x86-gcc4.0.1 ?? ? N ? ? ? Y Y*3 Y 20090420
+darwin8.11.1-x86-gcc4.0.1 ?? ? N ? ? ? Y Y Y 20090720
linux-x86-gcc4.1.2 Y Y ? Y Y Y Y ? 20090419
linux-x86-gcc4.1.3 Y Y ? Y Y Y Y ? 20080414
linux-x86-gcc4.2.3 Y Y ? Y Y Y Y ? 20080715
linux-x86-gcc4.2.4 Y Y ? Y Y Y Y ? 20081023
linux-x86-gcc4.3.2 Y Y ? Y Y Y Y ? 20081030
linux-x86-llvm-gcc-4.2 Y Y ? ? ? Y Y ? 20090514
-sol10-sparc-cc_5.9 B4 Y - - Y Y Y Y ? 20090419
-sol10-sparc-cc_5.9 B8 Y - - Y Y Y Y ? 20090419
+sol10-sparc-cc_5.9 B4 Y - - Y Y Y Y ? 20090720
+sol10-sparc-cc_5.9 B8 Y - - Y Y Y Y ? 20090720
sol10-sparc-gcc_4.0.2 B4 Y - - Y Y Y Y/1 ? 20080510
sol10-sparc-gcc_4.0.2 B8 Y - - Y Y Y Y/2 ? 20080518
win32-x86-mingw_gcc3.4.5 Y Y - - - Y Y Y 20090421
@@ -38,7 +38,7 @@
cygwin1.7.0-x86-gcc4.3.2 4 Y Y - - - Y Y Y 20090315
dragonfly2.2.0-i386-gcc-4.1.2 4 Y Y - Y Y Y Y ? 20090427
freebsd-x86-gcc-4.2.1 4 Y Y Y ? ? Y Y Y 20090415
-freebsd-amd64-gcc-4.2.1 8 Y - - ? ? Y Y Y 20090419
+freebsd-amd64-gcc-4.2.1 8 Y - - ? ? Y Y Y 20090720
linux-amd64-clang-r73854 8 ? ? = Y Y Y/4 Y/1 ? 20090622
linux-amd64-clang-r75433 8 Y N ? ? ? Y Y ? 20090712
linux-ppc-gcc3.4.5 Y Y Y ? ? Y Y ? 20080519
@@ -64,6 +64,7 @@
win32-x86-msvc_6.0 4 - Y - - - Y Y/8 ? 20090315
win32-x64-msvc_9.0 8 - - - - - Y Y/51 ? 20081203
win32-x64-mingw_gcc3.4.5 8 Y Y ? ? ? Y Y ? 20090210
+win64-amd64-msvc_9.0 8 N N N ? ? Y*3 N ? 20090720
Legend:
? ... unknown or untested
@@ -94,9 +95,8 @@
*1 gcc and cc defaults to 32bits on solaris, for 64bit use
--ccflags='-m64' --ldflags='-m64' --linkflags='-m64'
*2 http://rt.perl.org/rt3/Ticket/Display.html?id=60926
-*3 failures in 'make examples_tests' (part of 'make fulltest')
-*4 compiles with --ccflags=-U__APPLE_CC__ --without-gmp
- See http://lists.parrot.org/pipermail/parrot-dev/2009-June/002407.html
+*3 64-bit MSVC uses 32-bit int and long values. For 64-bit use
+ --ccflags="-GS- -MD" --intval="long long" --opcode="long long"
The following configurations are also working on x86/linux (and possibly
other platforms):
Modified: branches/pluggable_runcore/README
==============================================================================
--- branches/pluggable_runcore/README Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/README Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,4 +1,4 @@
-This is Parrot, version 1.3.0
+This is Parrot, version 1.4.0
------------------------------
Parrot is Copyright (C) 2001-2009, Parrot Foundation.
Modified: branches/pluggable_runcore/RESPONSIBLE_PARTIES
==============================================================================
--- branches/pluggable_runcore/RESPONSIBLE_PARTIES Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/RESPONSIBLE_PARTIES Fri Aug 14 01:24:23 2009 (r40541)
@@ -7,8 +7,7 @@
for.
See docs/project/roles_responsibilities.pod for role definitions, and
-https://trac.parrot.org/parrot/wiki/Languages for more language
-authors/maintainers.
+https://trac.parrot.org/parrot/wiki/Languages for language authors/maintainers.
Project Team
@@ -26,6 +25,7 @@
Klaas-Jan Stol
Francois Perrad
Mark Glines
+ Christoph Otto
Metacommitter Allison Randal
Jerry Gay
@@ -54,16 +54,7 @@
Allison Randal (TGE)
Klaas-Jan Stol (PIRC)
-High Level Language Developer Patrick Michaud (Perl 6, NQP)
- Will Coleda (Tcl)
- Stephen Weeks (Cardinal (Ruby), Lolcode)
- Francois Perrad (Lua, Pipp (PHP))
- Bernhard Schmalhofer (Pipp (PHP), Eclectus (Scheme))
- Kevin Tew (Cardinal (Ruby))
- Christoph Otto (Pipp (PHP))
-
Platform Porter Allison Randal (Debian, Ubuntu)
- Aldo Calpini (PocketPC)
Francois Perrad (MinGW32)
Reini Urban (cygwin)
Will Coleda (MacPorts)
Modified: branches/pluggable_runcore/VERSION
==============================================================================
--- branches/pluggable_runcore/VERSION Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/VERSION Fri Aug 14 01:24:23 2009 (r40541)
@@ -1 +1 @@
-1.3.0
+1.4.0
Modified: branches/pluggable_runcore/compilers/imcc/cfg.c
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/cfg.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/cfg.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -417,7 +417,6 @@
for (i = 0; i < unit->n_basic_blocks; i++) {
Basic_block * const bb = unit->bb_list[i];
- Edge *pred;
SymReg *addr;
/* if the block can fall-through */
@@ -439,74 +438,6 @@
bb_add_edge(unit, bb, unit->bb_list[0]);
}
- if (STREQ(bb->end->opname, "ret")) {
- Instruction *sub;
- IMCC_debug(interp, DEBUG_CFG, "found ret in bb %d\n", i);
-
- /* now go back, find labels and connect these with bsrs */
-
- /* this doesn't work, if this is a local backward sub call
- * the bsr isn't chained yet so the pred_list is empty
- *
- * s. #25948
- */
- if (!bb->pred_list) {
- unsigned int j;
-
- for (j = i; j < unit->n_basic_blocks; j++) {
- Basic_block * const b_bsr = unit->bb_list[j];
-
- if (STREQ(b_bsr->end->opname, "bsr")) {
- SymReg *addr = get_branch_reg(b_bsr->end);
-
- if (addr)
- bb_findadd_edge(interp, unit, b_bsr, addr);
- }
- }
- }
- /* end #25948 */
-
- for (pred = bb->pred_list; pred; pred = pred->next) {
- int found = 0;
-
- if (STREQ(pred->from->end->opname, "bsr")) {
- int j;
- {
- SymReg * const r = pred->from->end->symregs[0];
- sub = pred->to->start;
-
- if ((sub->type & ITLABEL)
- && STREQ(sub->symregs[0]->name, r->name))
- found = 1;
- }
-invok:
- j = pred->from->index;
-
- if (found) {
- IMCC_debug(interp, DEBUG_CFG,
- "\tcalled from bb %d '%I'\n",
- j, pred->from->end);
-
- for (; sub && sub != bb->end; sub = sub->next) {
- unit->bb_list[sub->bbindex]->flag |= BB_IS_SUB;
- }
-
- bb_add_edge(unit, bb, unit->bb_list[j + 1]);
-
- IMCC_debug(interp, DEBUG_CFG, "\tand does saveall no\n");
- }
- }
- else if (STREQ(pred->from->end->opname, "invoke")) {
- found = 1;
- sub = pred->to->start;
- goto invok;
- }
-
- if (!found)
- IMCC_debug(interp, DEBUG_CFG, "\tcalled from unknown!\n");
- }
- }
-
last = bb;
}
Modified: branches/pluggable_runcore/compilers/imcc/cfg.h
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/cfg.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/cfg.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -45,7 +45,6 @@
/* Functions: */
-struct _IMC_Unit;
/* HEADERIZER BEGIN: compilers/imcc/cfg.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
Modified: branches/pluggable_runcore/compilers/imcc/imc.h
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/imc.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/imc.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -41,7 +41,7 @@
* that won't collide with high level compiler generated names. */
#define IMCC_INTERNAL_CHAR '@'
-typedef struct _IMC_Unit IMC_Unit;
+typedef struct IMC_Unit IMC_Unit;
#include "symreg.h"
#include "instructions.h"
@@ -595,6 +595,7 @@
STRING *error_message; /* The Error message */
/* some values that were global... */
+ Namespace *namespace_stack;
SymReg *cur_call;
SymReg *cur_obj;
SymReg *adv_named_id;
@@ -603,6 +604,7 @@
char *heredoc_end;
char *heredoc_content;
char *cur_macro_name;
+ int is_def;
struct macro_frame_t *frames;
imcc_globals *globals;
@@ -633,7 +635,6 @@
int has_compile;
int imcc_warn;
int in_pod;
- int in_slice;
int ins_line;
int keyvec;
int line; /* current line number */
Modified: branches/pluggable_runcore/compilers/imcc/imcc.l
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/imcc.l Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/imcc.l Fri Aug 14 01:24:23 2009 (r40541)
@@ -60,9 +60,6 @@
YY_BUFFER_STATE buffer;
} macro_frame_t;
-/* short ranged globals for lexer state */
-int pesky_global__is_def = 0;
-
/* static function declarations */
static void pop_parser_state(PARROT_INTERP, ARGMOD(void *yyscanner));
@@ -640,7 +637,7 @@
}
<emit,INITIAL>{ID} {
- if (!pesky_global__is_def) {
+ if (!IMCC_INFO(interp)->is_def) {
SymReg *r = find_sym(interp, yytext);
if (r && (r->type & (VTIDENTIFIER|VT_CONSTP))) {
@@ -664,7 +661,7 @@
}
valp->s = mem_sys_strdup(yytext);
- return (!pesky_global__is_def && is_op(interp, valp->s) ? PARROT_OP : IDENTIFIER);
+ return (!IMCC_INFO(interp)->is_def && is_op(interp, valp->s) ? PARROT_OP : IDENTIFIER);
}
Modified: branches/pluggable_runcore/compilers/imcc/imcc.y
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/imcc.y Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/imcc.y Fri Aug 14 01:24:23 2009 (r40541)
@@ -458,7 +458,7 @@
if (!ascii)
rhs->type |= VT_ENCODED;
- rhs->usage = U_FIXUP | U_SUBID_LOOKUP;;
+ rhs->usage |= U_FIXUP | U_SUBID_LOOKUP;
break;
default:
rhs = mk_const(interp, name, 'P');
@@ -524,7 +524,7 @@
if (!ascii)
rhs->type |= VT_ENCODED;
- rhs->usage = U_FIXUP | U_SUBID_LOOKUP;
+ rhs->usage |= U_FIXUP | U_SUBID_LOOKUP;
}
else {
rhs = mk_const(interp, const_name, 'P');
@@ -880,8 +880,9 @@
"register %s already declared as lexical %s", r->name, name->name);
/* chain all names in r->reg */
- name->reg = r->reg;
- r->reg = name;
+ name->reg = r->reg;
+ r->reg = name;
+ name->usage |= U_LEXICAL;
r->use_count++;
}
@@ -1219,28 +1220,28 @@
;
constdef:
- CONST { pesky_global__is_def = 1; } type IDENTIFIER '=' const
+ CONST { IMCC_INFO(interp)->is_def = 1; } type IDENTIFIER '=' const
{
mk_const_ident(interp, $4, $3, $6, 1);
mem_sys_free($4);
- pesky_global__is_def = 0;
+ IMCC_INFO(interp)->is_def = 0;
}
;
pmc_const:
- CONST { pesky_global__is_def=1; } INTC var_or_i '=' any_string
+ CONST { IMCC_INFO(interp)->is_def = 1; } INTC var_or_i '=' any_string
{
$$ = mk_pmc_const(interp, IMCC_INFO(interp)->cur_unit, $3, $4, $6);
mem_sys_free($6);
- pesky_global__is_def = 0;
+ IMCC_INFO(interp)->is_def = 0;
}
- | CONST { pesky_global__is_def=1; } STRINGC var_or_i '=' any_string
+ | CONST { IMCC_INFO(interp)->is_def = 1; } STRINGC var_or_i '=' any_string
{
$$ = mk_pmc_const_named(interp, IMCC_INFO(interp)->cur_unit, $3, $4, $6);
mem_sys_free($3);
mem_sys_free($6);
- pesky_global__is_def = 0;
+ IMCC_INFO(interp)->is_def = 0;
}
;
any_string:
@@ -1290,10 +1291,14 @@
}
| LEXICAL STRINGC COMMA REG
{
- SymReg *r = mk_pasm_reg(interp, $4);
- SymReg *n = mk_const(interp, $2, 'S');
+ char *name = mem_sys_strdup($2 + 1);
+ SymReg *r = mk_pasm_reg(interp, $4);
+ SymReg *n;
+ name[strlen(name) - 1] = 0;
+ n = mk_const(interp, name, 'S');
set_lexical(interp, r, n);
$$ = 0;
+ mem_sys_free(name);
mem_sys_free($2);
mem_sys_free($4);
}
@@ -1340,10 +1345,6 @@
maybe_ns:
'[' keylist ']'
{
- if (IMCC_INFO(interp)->in_slice)
- IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
- "Slice not allowed in namespace.");
-
$$ = $2;
}
| '[' ']' { $$ = NULL; }
@@ -1386,7 +1387,7 @@
;
sub_param:
- PARAM { pesky_global__is_def=1; } sub_param_type_def { $$ = $3; pesky_global__is_def=0; }
+ PARAM { IMCC_INFO(interp)->is_def = 1; } sub_param_type_def { $$ = $3; IMCC_INFO(interp)->is_def = 0; }
;
sub_param_type_def:
@@ -1669,7 +1670,7 @@
pcc_result:
RESULT target paramtype_list { $$ = $2; $$->type |= $3; }
- | LOCAL { pesky_global__is_def=1; } type id_list_id
+ | LOCAL { IMCC_INFO(interp)->is_def = 1; } type id_list_id
{
IdList * const l = $4;
SymReg *ignored;
@@ -1678,8 +1679,8 @@
else
ignored = mk_ident(interp, l->id, $3);
UNUSED(ignored);
- pesky_global__is_def=0;
- $$=0;
+ IMCC_INFO(interp)->is_def = 0;
+ $$ = 0;
}
;
@@ -1900,7 +1901,7 @@
labeled_inst:
assignment
| conditional_statement
- | LOCAL { pesky_global__is_def=1; } type id_list
+ | LOCAL { IMCC_INFO(interp)->is_def = 1; } type id_list
{
IdList *l = $4;
while (l) {
@@ -1914,32 +1915,36 @@
mem_sys_free(l1->id);
mem_sys_free(l1);
}
- pesky_global__is_def=0; $$=0;
+ IMCC_INFO(interp)->is_def = 0; $$ = 0;
}
| LEXICAL STRINGC COMMA target
{
- SymReg * const n = mk_const(interp, $2, 'S');
+ SymReg *n;
+ char *name = mem_sys_strdup($2 + 1);
+ name[strlen(name) - 1] = 0;
+ n = mk_const(interp, name, 'S');
set_lexical(interp, $4, n); $$ = 0;
mem_sys_free($2);
+ mem_sys_free(name);
}
| LEXICAL USTRINGC COMMA target
{
- SymReg * const n = mk_const(interp, $2, 'U');
+ SymReg *n = mk_const(interp, $2, 'U');
set_lexical(interp, $4, n); $$ = 0;
mem_sys_free($2);
}
- | CONST { pesky_global__is_def=1; } type IDENTIFIER '=' const
+ | CONST { IMCC_INFO(interp)->is_def = 1; } type IDENTIFIER '=' const
{
mk_const_ident(interp, $4, $3, $6, 0);
- pesky_global__is_def=0;
+ IMCC_INFO(interp)->is_def = 0;
mem_sys_free($4);
}
| pmc_const
- | GLOBAL_CONST { pesky_global__is_def=1; } type IDENTIFIER '=' const
+ | GLOBAL_CONST { IMCC_INFO(interp)->is_def = 1; } type IDENTIFIER '=' const
{
mk_const_ident(interp, $4, $3, $6, 1);
- pesky_global__is_def=0;
+ IMCC_INFO(interp)->is_def = 0;
mem_sys_free($4);
}
| TAILCALL sub_call
@@ -2371,7 +2376,6 @@
keylist:
{
IMCC_INFO(interp)->nkeys = 0;
- IMCC_INFO(interp)->in_slice = 0;
}
_keylist
{
@@ -2384,7 +2388,6 @@
keylist_force:
{
IMCC_INFO(interp)->nkeys = 0;
- IMCC_INFO(interp)->in_slice = 0;
}
_keylist
{
@@ -2406,8 +2409,6 @@
key:
var
{
- if (IMCC_INFO(interp)->in_slice)
- $1->type |= VT_START_SLICE | VT_END_SLICE;
$$ = $1;
}
;
Modified: branches/pluggable_runcore/compilers/imcc/imclexer.c
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/imclexer.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/imclexer.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -2428,9 +2428,6 @@
YY_BUFFER_STATE buffer;
} macro_frame_t;
-/* short ranged globals for lexer state */
-int pesky_global__is_def = 0;
-
/* static function declarations */
static void pop_parser_state(PARROT_INTERP, ARGMOD(void *yyscanner));
@@ -2487,7 +2484,7 @@
-#line 2491 "compilers/imcc/imclexer.c"
+#line 2488 "compilers/imcc/imclexer.c"
#define INITIAL 0
#define emit 1
@@ -2732,7 +2729,7 @@
register int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-#line 155 "compilers/imcc/imcc.l"
+#line 152 "compilers/imcc/imcc.l"
/* for emacs "*/
if (IMCC_INFO(interp)->expect_pasm == 1 && !IMCC_INFO(interp)->in_pod) {
@@ -2751,7 +2748,7 @@
return 0;
}
-#line 2755 "compilers/imcc/imclexer.c"
+#line 2752 "compilers/imcc/imclexer.c"
if ( !yyg->yy_init )
{
@@ -2834,7 +2831,7 @@
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
-#line 173 "compilers/imcc/imcc.l"
+#line 170 "compilers/imcc/imcc.l"
{
IMCC_INFO(interp)->frames->heredoc_rest = mem_sys_strdup(yytext);
BEGIN(heredoc2);
@@ -2843,7 +2840,7 @@
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
-#line 178 "compilers/imcc/imcc.l"
+#line 175 "compilers/imcc/imcc.l"
{
/* heredocs have highest priority
* arrange them before all wildcard state matches
@@ -2861,7 +2858,7 @@
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 193 "compilers/imcc/imcc.l"
+#line 190 "compilers/imcc/imcc.l"
{
/* Are we at the end of the heredoc? */
if (STREQ(IMCC_INFO(interp)->heredoc_end, yytext)) {
@@ -2902,7 +2899,7 @@
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
-#line 230 "compilers/imcc/imcc.l"
+#line 227 "compilers/imcc/imcc.l"
{
yy_pop_state(yyscanner);
yy_push_state(cmt3, yyscanner);
@@ -2915,7 +2912,7 @@
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 240 "compilers/imcc/imcc.l"
+#line 237 "compilers/imcc/imcc.l"
{
yy_pop_state(yyscanner);
yy_push_state(cmt4, yyscanner);
@@ -2923,17 +2920,17 @@
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 245 "compilers/imcc/imcc.l"
+#line 242 "compilers/imcc/imcc.l"
{ yy_push_state(cmt2, yyscanner); }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 247 "compilers/imcc/imcc.l"
+#line 244 "compilers/imcc/imcc.l"
{ yy_push_state(cmt1, yyscanner); }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 249 "compilers/imcc/imcc.l"
+#line 246 "compilers/imcc/imcc.l"
{
IMCC_INFO(interp)->line = atoi(yytext);
yy_pop_state(yyscanner);
@@ -2944,7 +2941,7 @@
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
-#line 256 "compilers/imcc/imcc.l"
+#line 253 "compilers/imcc/imcc.l"
{
yy_pop_state(yyscanner);
IMCC_INFO(interp)->line++;
@@ -2953,7 +2950,7 @@
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
-#line 261 "compilers/imcc/imcc.l"
+#line 258 "compilers/imcc/imcc.l"
{
if (IMCC_INFO(interp)->expect_pasm == 2)
BEGIN(INITIAL);
@@ -2966,7 +2963,7 @@
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 271 "compilers/imcc/imcc.l"
+#line 268 "compilers/imcc/imcc.l"
{
yy_push_state(cmt5, yyscanner);
}
@@ -2974,7 +2971,7 @@
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
-#line 275 "compilers/imcc/imcc.l"
+#line 272 "compilers/imcc/imcc.l"
{
if (IMCC_INFO(interp)->expect_pasm == 2)
BEGIN(INITIAL);
@@ -2990,7 +2987,7 @@
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
-#line 288 "compilers/imcc/imcc.l"
+#line 285 "compilers/imcc/imcc.l"
{
/* this is a stand-alone =cut, but we're
* not in POD mode, so just ignore.
@@ -2999,7 +2996,7 @@
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 294 "compilers/imcc/imcc.l"
+#line 291 "compilers/imcc/imcc.l"
{
IMCC_INFO(interp)->in_pod = 1;
yy_push_state(pod, yyscanner);
@@ -3008,7 +3005,7 @@
case 15:
/* rule 15 can match eol */
YY_RULE_SETUP
-#line 299 "compilers/imcc/imcc.l"
+#line 296 "compilers/imcc/imcc.l"
{
IMCC_INFO(interp)->in_pod = 0;
yy_pop_state(yyscanner);
@@ -3017,473 +3014,473 @@
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 305 "compilers/imcc/imcc.l"
+#line 302 "compilers/imcc/imcc.l"
{ /*ignore*/ }
YY_BREAK
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
-#line 307 "compilers/imcc/imcc.l"
+#line 304 "compilers/imcc/imcc.l"
{ IMCC_INFO(interp)->line++; }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 309 "compilers/imcc/imcc.l"
+#line 306 "compilers/imcc/imcc.l"
return TK_LINE;
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 310 "compilers/imcc/imcc.l"
+#line 307 "compilers/imcc/imcc.l"
return TK_FILE;
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 311 "compilers/imcc/imcc.l"
+#line 308 "compilers/imcc/imcc.l"
return ANNOTATE;
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 312 "compilers/imcc/imcc.l"
+#line 309 "compilers/imcc/imcc.l"
return LEXICAL;
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 313 "compilers/imcc/imcc.l"
+#line 310 "compilers/imcc/imcc.l"
return ARG;
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 314 "compilers/imcc/imcc.l"
+#line 311 "compilers/imcc/imcc.l"
return SUB;
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 315 "compilers/imcc/imcc.l"
+#line 312 "compilers/imcc/imcc.l"
return ESUB;
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 316 "compilers/imcc/imcc.l"
+#line 313 "compilers/imcc/imcc.l"
return PCC_BEGIN;
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 317 "compilers/imcc/imcc.l"
+#line 314 "compilers/imcc/imcc.l"
return PCC_END;
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 318 "compilers/imcc/imcc.l"
+#line 315 "compilers/imcc/imcc.l"
return PCC_CALL;
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 319 "compilers/imcc/imcc.l"
+#line 316 "compilers/imcc/imcc.l"
return NCI_CALL;
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 320 "compilers/imcc/imcc.l"
+#line 317 "compilers/imcc/imcc.l"
return METH_CALL;
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 321 "compilers/imcc/imcc.l"
+#line 318 "compilers/imcc/imcc.l"
return INVOCANT;
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 322 "compilers/imcc/imcc.l"
+#line 319 "compilers/imcc/imcc.l"
return PCC_SUB;
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 323 "compilers/imcc/imcc.l"
+#line 320 "compilers/imcc/imcc.l"
return PCC_BEGIN_RETURN;
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 324 "compilers/imcc/imcc.l"
+#line 321 "compilers/imcc/imcc.l"
return PCC_END_RETURN;
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 325 "compilers/imcc/imcc.l"
+#line 322 "compilers/imcc/imcc.l"
return PCC_BEGIN_YIELD;
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 326 "compilers/imcc/imcc.l"
+#line 323 "compilers/imcc/imcc.l"
return PCC_END_YIELD;
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 328 "compilers/imcc/imcc.l"
+#line 325 "compilers/imcc/imcc.l"
return METHOD;
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 329 "compilers/imcc/imcc.l"
+#line 326 "compilers/imcc/imcc.l"
return MULTI;
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 330 "compilers/imcc/imcc.l"
+#line 327 "compilers/imcc/imcc.l"
return MAIN;
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 331 "compilers/imcc/imcc.l"
+#line 328 "compilers/imcc/imcc.l"
return LOAD;
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 332 "compilers/imcc/imcc.l"
+#line 329 "compilers/imcc/imcc.l"
return INIT;
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 333 "compilers/imcc/imcc.l"
+#line 330 "compilers/imcc/imcc.l"
return IMMEDIATE;
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 334 "compilers/imcc/imcc.l"
+#line 331 "compilers/imcc/imcc.l"
return POSTCOMP;
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 335 "compilers/imcc/imcc.l"
+#line 332 "compilers/imcc/imcc.l"
return ANON;
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 336 "compilers/imcc/imcc.l"
+#line 333 "compilers/imcc/imcc.l"
return OUTER;
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 337 "compilers/imcc/imcc.l"
+#line 334 "compilers/imcc/imcc.l"
return NEED_LEX;
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 338 "compilers/imcc/imcc.l"
+#line 335 "compilers/imcc/imcc.l"
return VTABLE_METHOD;
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 339 "compilers/imcc/imcc.l"
+#line 336 "compilers/imcc/imcc.l"
return NS_ENTRY;
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 340 "compilers/imcc/imcc.l"
+#line 337 "compilers/imcc/imcc.l"
return UNIQUE_REG;
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 341 "compilers/imcc/imcc.l"
+#line 338 "compilers/imcc/imcc.l"
return SUB_INSTANCE_OF;
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 342 "compilers/imcc/imcc.l"
+#line 339 "compilers/imcc/imcc.l"
return SUBID;
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 344 "compilers/imcc/imcc.l"
+#line 341 "compilers/imcc/imcc.l"
return RESULT;
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 345 "compilers/imcc/imcc.l"
+#line 342 "compilers/imcc/imcc.l"
return GET_RESULTS;
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 346 "compilers/imcc/imcc.l"
+#line 343 "compilers/imcc/imcc.l"
return YIELDT;
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 347 "compilers/imcc/imcc.l"
+#line 344 "compilers/imcc/imcc.l"
return SET_YIELD;
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 348 "compilers/imcc/imcc.l"
+#line 345 "compilers/imcc/imcc.l"
return RETURN;
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 349 "compilers/imcc/imcc.l"
+#line 346 "compilers/imcc/imcc.l"
return SET_RETURN;
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 350 "compilers/imcc/imcc.l"
+#line 347 "compilers/imcc/imcc.l"
return TAILCALL;
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 351 "compilers/imcc/imcc.l"
+#line 348 "compilers/imcc/imcc.l"
return LOADLIB;
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 353 "compilers/imcc/imcc.l"
+#line 350 "compilers/imcc/imcc.l"
return ADV_FLAT;
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 354 "compilers/imcc/imcc.l"
+#line 351 "compilers/imcc/imcc.l"
return ADV_SLURPY;
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 355 "compilers/imcc/imcc.l"
+#line 352 "compilers/imcc/imcc.l"
return ADV_OPTIONAL;
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 356 "compilers/imcc/imcc.l"
+#line 353 "compilers/imcc/imcc.l"
return ADV_OPT_FLAG;
YY_BREAK
case 63:
YY_RULE_SETUP
-#line 357 "compilers/imcc/imcc.l"
+#line 354 "compilers/imcc/imcc.l"
return ADV_NAMED;
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 358 "compilers/imcc/imcc.l"
+#line 355 "compilers/imcc/imcc.l"
return ADV_ARROW;
YY_BREAK
case 65:
YY_RULE_SETUP
-#line 359 "compilers/imcc/imcc.l"
+#line 356 "compilers/imcc/imcc.l"
return ADV_INVOCANT;
YY_BREAK
case 66:
YY_RULE_SETUP
-#line 361 "compilers/imcc/imcc.l"
+#line 358 "compilers/imcc/imcc.l"
return NAMESPACE;
YY_BREAK
case 67:
YY_RULE_SETUP
-#line 362 "compilers/imcc/imcc.l"
+#line 359 "compilers/imcc/imcc.l"
return HLL;
YY_BREAK
case 68:
YY_RULE_SETUP
-#line 364 "compilers/imcc/imcc.l"
+#line 361 "compilers/imcc/imcc.l"
return LOCAL;
YY_BREAK
case 69:
YY_RULE_SETUP
-#line 365 "compilers/imcc/imcc.l"
+#line 362 "compilers/imcc/imcc.l"
return CONST;
YY_BREAK
case 70:
YY_RULE_SETUP
-#line 366 "compilers/imcc/imcc.l"
+#line 363 "compilers/imcc/imcc.l"
return GLOBAL_CONST;
YY_BREAK
case 71:
YY_RULE_SETUP
-#line 367 "compilers/imcc/imcc.l"
+#line 364 "compilers/imcc/imcc.l"
return PARAM;
YY_BREAK
case 72:
YY_RULE_SETUP
-#line 368 "compilers/imcc/imcc.l"
+#line 365 "compilers/imcc/imcc.l"
return GOTO;
YY_BREAK
case 73:
YY_RULE_SETUP
-#line 369 "compilers/imcc/imcc.l"
+#line 366 "compilers/imcc/imcc.l"
return IF;
YY_BREAK
case 74:
YY_RULE_SETUP
-#line 370 "compilers/imcc/imcc.l"
+#line 367 "compilers/imcc/imcc.l"
return UNLESS;
YY_BREAK
case 75:
YY_RULE_SETUP
-#line 371 "compilers/imcc/imcc.l"
+#line 368 "compilers/imcc/imcc.l"
return PNULL;
YY_BREAK
case 76:
YY_RULE_SETUP
-#line 372 "compilers/imcc/imcc.l"
+#line 369 "compilers/imcc/imcc.l"
return INTV;
YY_BREAK
case 77:
YY_RULE_SETUP
-#line 373 "compilers/imcc/imcc.l"
+#line 370 "compilers/imcc/imcc.l"
return FLOATV;
YY_BREAK
case 78:
YY_RULE_SETUP
-#line 375 "compilers/imcc/imcc.l"
+#line 372 "compilers/imcc/imcc.l"
return PMCV;
YY_BREAK
case 79:
YY_RULE_SETUP
-#line 376 "compilers/imcc/imcc.l"
+#line 373 "compilers/imcc/imcc.l"
return STRINGV;
YY_BREAK
case 80:
YY_RULE_SETUP
-#line 377 "compilers/imcc/imcc.l"
+#line 374 "compilers/imcc/imcc.l"
return SHIFT_LEFT;
YY_BREAK
case 81:
YY_RULE_SETUP
-#line 378 "compilers/imcc/imcc.l"
+#line 375 "compilers/imcc/imcc.l"
return SHIFT_RIGHT;
YY_BREAK
case 82:
YY_RULE_SETUP
-#line 379 "compilers/imcc/imcc.l"
+#line 376 "compilers/imcc/imcc.l"
return SHIFT_RIGHT_U;
YY_BREAK
case 83:
YY_RULE_SETUP
-#line 380 "compilers/imcc/imcc.l"
+#line 377 "compilers/imcc/imcc.l"
return LOG_AND;
YY_BREAK
case 84:
YY_RULE_SETUP
-#line 381 "compilers/imcc/imcc.l"
+#line 378 "compilers/imcc/imcc.l"
return LOG_OR;
YY_BREAK
case 85:
YY_RULE_SETUP
-#line 382 "compilers/imcc/imcc.l"
+#line 379 "compilers/imcc/imcc.l"
return LOG_XOR;
YY_BREAK
case 86:
YY_RULE_SETUP
-#line 383 "compilers/imcc/imcc.l"
+#line 380 "compilers/imcc/imcc.l"
return RELOP_LT;
YY_BREAK
case 87:
YY_RULE_SETUP
-#line 384 "compilers/imcc/imcc.l"
+#line 381 "compilers/imcc/imcc.l"
return RELOP_LTE;
YY_BREAK
case 88:
YY_RULE_SETUP
-#line 385 "compilers/imcc/imcc.l"
+#line 382 "compilers/imcc/imcc.l"
return RELOP_GT;
YY_BREAK
case 89:
YY_RULE_SETUP
-#line 386 "compilers/imcc/imcc.l"
+#line 383 "compilers/imcc/imcc.l"
return RELOP_GTE;
YY_BREAK
case 90:
YY_RULE_SETUP
-#line 387 "compilers/imcc/imcc.l"
+#line 384 "compilers/imcc/imcc.l"
return RELOP_EQ;
YY_BREAK
case 91:
YY_RULE_SETUP
-#line 388 "compilers/imcc/imcc.l"
+#line 385 "compilers/imcc/imcc.l"
return RELOP_NE;
YY_BREAK
case 92:
YY_RULE_SETUP
-#line 389 "compilers/imcc/imcc.l"
+#line 386 "compilers/imcc/imcc.l"
return POW;
YY_BREAK
case 93:
YY_RULE_SETUP
-#line 391 "compilers/imcc/imcc.l"
+#line 388 "compilers/imcc/imcc.l"
return CONCAT;
YY_BREAK
case 94:
YY_RULE_SETUP
-#line 392 "compilers/imcc/imcc.l"
+#line 389 "compilers/imcc/imcc.l"
return DOT;
YY_BREAK
case 95:
YY_RULE_SETUP
-#line 394 "compilers/imcc/imcc.l"
+#line 391 "compilers/imcc/imcc.l"
return PLUS_ASSIGN;
YY_BREAK
case 96:
YY_RULE_SETUP
-#line 395 "compilers/imcc/imcc.l"
+#line 392 "compilers/imcc/imcc.l"
return MINUS_ASSIGN;
YY_BREAK
case 97:
YY_RULE_SETUP
-#line 396 "compilers/imcc/imcc.l"
+#line 393 "compilers/imcc/imcc.l"
return MUL_ASSIGN;
YY_BREAK
case 98:
YY_RULE_SETUP
-#line 397 "compilers/imcc/imcc.l"
+#line 394 "compilers/imcc/imcc.l"
return DIV_ASSIGN;
YY_BREAK
case 99:
YY_RULE_SETUP
-#line 398 "compilers/imcc/imcc.l"
+#line 395 "compilers/imcc/imcc.l"
return MOD_ASSIGN;
YY_BREAK
case 100:
YY_RULE_SETUP
-#line 399 "compilers/imcc/imcc.l"
+#line 396 "compilers/imcc/imcc.l"
return FDIV;
YY_BREAK
case 101:
YY_RULE_SETUP
-#line 400 "compilers/imcc/imcc.l"
+#line 397 "compilers/imcc/imcc.l"
return FDIV_ASSIGN;
YY_BREAK
case 102:
YY_RULE_SETUP
-#line 401 "compilers/imcc/imcc.l"
+#line 398 "compilers/imcc/imcc.l"
return BAND_ASSIGN;
YY_BREAK
case 103:
YY_RULE_SETUP
-#line 402 "compilers/imcc/imcc.l"
+#line 399 "compilers/imcc/imcc.l"
return BOR_ASSIGN;
YY_BREAK
case 104:
YY_RULE_SETUP
-#line 403 "compilers/imcc/imcc.l"
+#line 400 "compilers/imcc/imcc.l"
return BXOR_ASSIGN;
YY_BREAK
case 105:
YY_RULE_SETUP
-#line 404 "compilers/imcc/imcc.l"
+#line 401 "compilers/imcc/imcc.l"
return SHR_ASSIGN;
YY_BREAK
case 106:
YY_RULE_SETUP
-#line 405 "compilers/imcc/imcc.l"
+#line 402 "compilers/imcc/imcc.l"
return SHL_ASSIGN;
YY_BREAK
case 107:
YY_RULE_SETUP
-#line 406 "compilers/imcc/imcc.l"
+#line 403 "compilers/imcc/imcc.l"
return SHR_U_ASSIGN;
YY_BREAK
case 108:
YY_RULE_SETUP
-#line 407 "compilers/imcc/imcc.l"
+#line 404 "compilers/imcc/imcc.l"
return CONCAT_ASSIGN;
YY_BREAK
case 109:
YY_RULE_SETUP
-#line 409 "compilers/imcc/imcc.l"
+#line 406 "compilers/imcc/imcc.l"
{
char *macro_name = NULL;
int start_cond = YY_START;
@@ -3529,14 +3526,14 @@
YY_BREAK
case 110:
YY_RULE_SETUP
-#line 452 "compilers/imcc/imcc.l"
+#line 449 "compilers/imcc/imcc.l"
{
return read_macro(valp, interp, yyscanner);
}
YY_BREAK
case 111:
YY_RULE_SETUP
-#line 456 "compilers/imcc/imcc.l"
+#line 453 "compilers/imcc/imcc.l"
{
const int c = yylex(valp,yyscanner,interp);
@@ -3551,7 +3548,7 @@
YY_BREAK
case 112:
YY_RULE_SETUP
-#line 468 "compilers/imcc/imcc.l"
+#line 465 "compilers/imcc/imcc.l"
{
if (valp) {
char *label;
@@ -3576,7 +3573,7 @@
YY_BREAK
case 113:
YY_RULE_SETUP
-#line 490 "compilers/imcc/imcc.l"
+#line 487 "compilers/imcc/imcc.l"
{
if (valp) {
@@ -3601,12 +3598,12 @@
YY_BREAK
case 114:
YY_RULE_SETUP
-#line 512 "compilers/imcc/imcc.l"
+#line 509 "compilers/imcc/imcc.l"
return COMMA;
YY_BREAK
case 115:
YY_RULE_SETUP
-#line 514 "compilers/imcc/imcc.l"
+#line 511 "compilers/imcc/imcc.l"
{
/* trim last ':' */
YYCHOP();
@@ -3619,7 +3616,7 @@
YY_BREAK
case 116:
YY_RULE_SETUP
-#line 524 "compilers/imcc/imcc.l"
+#line 521 "compilers/imcc/imcc.l"
{
char * const macro_name = yytext + 1;
@@ -3631,32 +3628,32 @@
YY_BREAK
case 117:
YY_RULE_SETUP
-#line 535 "compilers/imcc/imcc.l"
+#line 532 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, FLOATC);
YY_BREAK
case 118:
YY_RULE_SETUP
-#line 536 "compilers/imcc/imcc.l"
+#line 533 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, INTC);
YY_BREAK
case 119:
YY_RULE_SETUP
-#line 537 "compilers/imcc/imcc.l"
+#line 534 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, INTC);
YY_BREAK
case 120:
YY_RULE_SETUP
-#line 538 "compilers/imcc/imcc.l"
+#line 535 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, INTC);
YY_BREAK
case 121:
YY_RULE_SETUP
-#line 539 "compilers/imcc/imcc.l"
+#line 536 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, INTC);
YY_BREAK
case 122:
YY_RULE_SETUP
-#line 541 "compilers/imcc/imcc.l"
+#line 538 "compilers/imcc/imcc.l"
{
valp->s = mem_sys_strdup(yytext);
@@ -3669,7 +3666,7 @@
YY_BREAK
case 123:
YY_RULE_SETUP
-#line 551 "compilers/imcc/imcc.l"
+#line 548 "compilers/imcc/imcc.l"
{
valp->s = mem_sys_strdup(yytext);
@@ -3679,7 +3676,7 @@
YY_BREAK
case 124:
YY_RULE_SETUP
-#line 558 "compilers/imcc/imcc.l"
+#line 555 "compilers/imcc/imcc.l"
{
macro_frame_t *frame;
@@ -3710,7 +3707,7 @@
YY_BREAK
case 125:
YY_RULE_SETUP
-#line 586 "compilers/imcc/imcc.l"
+#line 583 "compilers/imcc/imcc.l"
{
/* charset:"..." */
valp->s = mem_sys_strdup(yytext);
@@ -3721,7 +3718,7 @@
YY_BREAK
case 126:
YY_RULE_SETUP
-#line 594 "compilers/imcc/imcc.l"
+#line 591 "compilers/imcc/imcc.l"
{
if (valp) (valp)->s = yytext;
if (IMCC_INFO(interp)->state->pasm_file)
@@ -3732,7 +3729,7 @@
YY_BREAK
case 127:
YY_RULE_SETUP
-#line 602 "compilers/imcc/imcc.l"
+#line 599 "compilers/imcc/imcc.l"
{
if (valp) (valp)->s = yytext;
if (IMCC_INFO(interp)->state->pasm_file)
@@ -3743,7 +3740,7 @@
YY_BREAK
case 128:
YY_RULE_SETUP
-#line 610 "compilers/imcc/imcc.l"
+#line 607 "compilers/imcc/imcc.l"
{
if (valp) (valp)->s = yytext;
if (IMCC_INFO(interp)->state->pasm_file)
@@ -3754,7 +3751,7 @@
YY_BREAK
case 129:
YY_RULE_SETUP
-#line 618 "compilers/imcc/imcc.l"
+#line 615 "compilers/imcc/imcc.l"
{
if (valp) (valp)->s = yytext;
if (IMCC_INFO(interp)->state->pasm_file)
@@ -3765,7 +3762,7 @@
YY_BREAK
case 130:
YY_RULE_SETUP
-#line 626 "compilers/imcc/imcc.l"
+#line 623 "compilers/imcc/imcc.l"
{
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"'%s' is not a valid register name", yytext);
@@ -3773,7 +3770,7 @@
YY_BREAK
case 131:
YY_RULE_SETUP
-#line 631 "compilers/imcc/imcc.l"
+#line 628 "compilers/imcc/imcc.l"
{
if (IMCC_INFO(interp)->state->pasm_file == 0)
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
@@ -3787,9 +3784,9 @@
YY_BREAK
case 132:
YY_RULE_SETUP
-#line 642 "compilers/imcc/imcc.l"
+#line 639 "compilers/imcc/imcc.l"
{
- if (!pesky_global__is_def) {
+ if (!IMCC_INFO(interp)->is_def) {
SymReg *r = find_sym(interp, yytext);
if (r && (r->type & (VTIDENTIFIER|VT_CONSTP))) {
@@ -3813,24 +3810,24 @@
}
valp->s = mem_sys_strdup(yytext);
- return (!pesky_global__is_def && is_op(interp, valp->s) ? PARROT_OP : IDENTIFIER);
+ return (!IMCC_INFO(interp)->is_def && is_op(interp, valp->s) ? PARROT_OP : IDENTIFIER);
}
YY_BREAK
case 133:
YY_RULE_SETUP
-#line 671 "compilers/imcc/imcc.l"
+#line 668 "compilers/imcc/imcc.l"
/* skip */;
YY_BREAK
case 134:
YY_RULE_SETUP
-#line 673 "compilers/imcc/imcc.l"
+#line 670 "compilers/imcc/imcc.l"
{
/* catch all except for state macro */
return yytext[0];
}
YY_BREAK
case YY_STATE_EOF(emit):
-#line 678 "compilers/imcc/imcc.l"
+#line 675 "compilers/imcc/imcc.l"
{
BEGIN(INITIAL);
@@ -3843,18 +3840,18 @@
}
YY_BREAK
case YY_STATE_EOF(INITIAL):
-#line 689 "compilers/imcc/imcc.l"
+#line 686 "compilers/imcc/imcc.l"
yyterminate();
YY_BREAK
case 135:
YY_RULE_SETUP
-#line 691 "compilers/imcc/imcc.l"
+#line 688 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, ENDM);
YY_BREAK
case 136:
/* rule 136 can match eol */
YY_RULE_SETUP
-#line 693 "compilers/imcc/imcc.l"
+#line 690 "compilers/imcc/imcc.l"
{
IMCC_INFO(interp)->line++;
DUP_AND_RET(valp, '\n');
@@ -3862,12 +3859,12 @@
YY_BREAK
case 137:
YY_RULE_SETUP
-#line 698 "compilers/imcc/imcc.l"
+#line 695 "compilers/imcc/imcc.l"
return LABEL;
YY_BREAK
case 138:
YY_RULE_SETUP
-#line 700 "compilers/imcc/imcc.l"
+#line 697 "compilers/imcc/imcc.l"
{
if (yylex(valp,yyscanner,interp) != LABEL)
@@ -3894,7 +3891,7 @@
YY_BREAK
case 139:
YY_RULE_SETUP
-#line 724 "compilers/imcc/imcc.l"
+#line 721 "compilers/imcc/imcc.l"
{
if (valp) {
const size_t len = strlen(IMCC_INFO(interp)->cur_macro_name) + yyleng + 12;
@@ -3913,49 +3910,49 @@
YY_BREAK
case 140:
YY_RULE_SETUP
-#line 740 "compilers/imcc/imcc.l"
+#line 737 "compilers/imcc/imcc.l"
/* skip leading ws */;
YY_BREAK
case 141:
YY_RULE_SETUP
-#line 741 "compilers/imcc/imcc.l"
+#line 738 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, ' ');
YY_BREAK
case 142:
YY_RULE_SETUP
-#line 742 "compilers/imcc/imcc.l"
+#line 739 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, REG);
YY_BREAK
case 143:
YY_RULE_SETUP
-#line 743 "compilers/imcc/imcc.l"
+#line 740 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, REG);
YY_BREAK
case 144:
YY_RULE_SETUP
-#line 744 "compilers/imcc/imcc.l"
+#line 741 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, IDENTIFIER);
YY_BREAK
case 145:
YY_RULE_SETUP
-#line 745 "compilers/imcc/imcc.l"
+#line 742 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, MACRO);
YY_BREAK
case 146:
YY_RULE_SETUP
-#line 746 "compilers/imcc/imcc.l"
+#line 743 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, yytext[0]);
YY_BREAK
case YY_STATE_EOF(macro):
-#line 747 "compilers/imcc/imcc.l"
+#line 744 "compilers/imcc/imcc.l"
yyterminate();
YY_BREAK
case 147:
YY_RULE_SETUP
-#line 749 "compilers/imcc/imcc.l"
+#line 746 "compilers/imcc/imcc.l"
ECHO;
YY_BREAK
-#line 3959 "compilers/imcc/imclexer.c"
+#line 3956 "compilers/imcc/imclexer.c"
case YY_STATE_EOF(pod):
case YY_STATE_EOF(cmt1):
case YY_STATE_EOF(cmt2):
@@ -5157,7 +5154,7 @@
#define YYTABLES_NAME "yytables"
-#line 749 "compilers/imcc/imcc.l"
+#line 746 "compilers/imcc/imcc.l"
Modified: branches/pluggable_runcore/compilers/imcc/imcparser.c
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/imcparser.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/imcparser.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -782,7 +782,7 @@
if (!ascii)
rhs->type |= VT_ENCODED;
- rhs->usage = U_FIXUP | U_SUBID_LOOKUP;;
+ rhs->usage |= U_FIXUP | U_SUBID_LOOKUP;
break;
default:
rhs = mk_const(interp, name, 'P');
@@ -848,7 +848,7 @@
if (!ascii)
rhs->type |= VT_ENCODED;
- rhs->usage = U_FIXUP | U_SUBID_LOOKUP;
+ rhs->usage |= U_FIXUP | U_SUBID_LOOKUP;
}
else {
rhs = mk_const(interp, const_name, 'P');
@@ -1204,8 +1204,9 @@
"register %s already declared as lexical %s", r->name, name->name);
/* chain all names in r->reg */
- name->reg = r->reg;
- r->reg = name;
+ name->reg = r->reg;
+ r->reg = name;
+ name->usage |= U_LEXICAL;
r->use_count++;
}
@@ -1389,7 +1390,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 1048 "compilers/imcc/imcc.y"
+#line 1049 "compilers/imcc/imcc.y"
{
IdList * idlist;
int t;
@@ -1397,8 +1398,8 @@
SymReg * sr;
Instruction *i;
}
-/* Line 193 of yacc.c. */
-#line 1391 "compilers/imcc/imcparser.c"
+/* Line 187 of yacc.c. */
+#line 1392 "compilers/imcc/imcparser.c"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
@@ -1411,7 +1412,7 @@
/* Line 216 of yacc.c. */
-#line 1404 "compilers/imcc/imcparser.c"
+#line 1405 "compilers/imcc/imcparser.c"
#ifdef short
# undef short
@@ -1832,40 +1833,40 @@
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 1143, 1143, 1147, 1148, 1152, 1153, 1154, 1160, 1166,
- 1167, 1168, 1169, 1173, 1174, 1183, 1189, 1197, 1209, 1222,
- 1222, 1231, 1231, 1238, 1238, 1247, 1248, 1252, 1253, 1257,
- 1258, 1259, 1260, 1261, 1262, 1263, 1266, 1266, 1275, 1274,
- 1287, 1291, 1300, 1304, 1308, 1308, 1320, 1322, 1326, 1341,
- 1349, 1354, 1358, 1362, 1353, 1374, 1375, 1376, 1389, 1389,
- 1393, 1407, 1411, 1417, 1426, 1432, 1441, 1447, 1456, 1462,
- 1471, 1479, 1484, 1495, 1498, 1503, 1511, 1512, 1513, 1514,
- 1515, 1526, 1537, 1540, 1542, 1547, 1546, 1579, 1580, 1584,
- 1585, 1589, 1590, 1594, 1595, 1599, 1600, 1601, 1602, 1603,
- 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1616,
- 1621, 1625, 1630, 1634, 1638, 1643, 1652, 1653, 1657, 1662,
- 1663, 1671, 1672, 1672, 1687, 1688, 1692, 1693, 1694, 1695,
- 1696, 1697, 1698, 1703, 1703, 1706, 1714, 1714, 1720, 1721,
- 1726, 1734, 1735, 1740, 1748, 1752, 1757, 1756, 1769, 1770,
- 1774, 1775, 1785, 1790, 1800, 1809, 1810, 1822, 1826, 1828,
- 1829, 1830, 1831, 1832, 1836, 1837, 1841, 1842, 1846, 1857,
- 1858, 1869, 1876, 1885, 1895, 1896, 1901, 1902, 1903, 1903,
- 1919, 1925, 1931, 1931, 1938, 1939, 1939, 1945, 1951, 1955,
- 1967, 1968, 1969, 1970, 1971, 1972, 1976, 1977, 1978, 1979,
- 1983, 1996, 1998, 2000, 2002, 2004, 2009, 2012, 2019, 2018,
- 2027, 2028, 2029, 2030, 2038, 2039, 2040, 2044, 2045, 2046,
- 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056,
- 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066,
- 2072, 2071, 2083, 2090, 2091, 2092, 2093, 2094, 2095, 2096,
- 2097, 2098, 2099, 2100, 2101, 2102, 2107, 2118, 2119, 2120,
- 2121, 2127, 2141, 2147, 2153, 2159, 2158, 2167, 2168, 2178,
- 2188, 2195, 2200, 2210, 2214, 2215, 2219, 2220, 2223, 2224,
- 2228, 2232, 2242, 2248, 2258, 2263, 2267, 2268, 2272, 2276,
- 2280, 2287, 2291, 2295, 2302, 2303, 2307, 2308, 2309, 2310,
- 2311, 2312, 2316, 2317, 2321, 2322, 2326, 2327, 2331, 2332,
- 2339, 2346, 2347, 2348, 2352, 2353, 2357, 2358, 2362, 2363,
- 2367, 2368, 2372, 2372, 2385, 2385, 2398, 2399, 2407, 2416,
- 2417, 2418, 2419, 2420, 2424, 2425, 2426, 2427
+ 0, 1144, 1144, 1148, 1149, 1153, 1154, 1155, 1161, 1167,
+ 1168, 1169, 1170, 1174, 1175, 1184, 1190, 1198, 1210, 1223,
+ 1223, 1232, 1232, 1239, 1239, 1248, 1249, 1253, 1254, 1258,
+ 1259, 1260, 1261, 1262, 1263, 1264, 1267, 1267, 1276, 1275,
+ 1288, 1292, 1305, 1309, 1313, 1313, 1325, 1327, 1331, 1346,
+ 1350, 1355, 1359, 1363, 1354, 1375, 1376, 1377, 1390, 1390,
+ 1394, 1408, 1412, 1418, 1427, 1433, 1442, 1448, 1457, 1463,
+ 1472, 1480, 1485, 1496, 1499, 1504, 1512, 1513, 1514, 1515,
+ 1516, 1527, 1538, 1541, 1543, 1548, 1547, 1580, 1581, 1585,
+ 1586, 1590, 1591, 1595, 1596, 1600, 1601, 1602, 1603, 1604,
+ 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1617,
+ 1622, 1626, 1631, 1635, 1639, 1644, 1653, 1654, 1658, 1663,
+ 1664, 1672, 1673, 1673, 1688, 1689, 1693, 1694, 1695, 1696,
+ 1697, 1698, 1699, 1704, 1704, 1707, 1715, 1715, 1721, 1722,
+ 1727, 1735, 1736, 1741, 1749, 1753, 1758, 1757, 1770, 1771,
+ 1775, 1776, 1786, 1791, 1801, 1810, 1811, 1823, 1827, 1829,
+ 1830, 1831, 1832, 1833, 1837, 1838, 1842, 1843, 1847, 1858,
+ 1859, 1870, 1877, 1886, 1896, 1897, 1902, 1903, 1904, 1904,
+ 1920, 1930, 1936, 1936, 1943, 1944, 1944, 1950, 1956, 1960,
+ 1972, 1973, 1974, 1975, 1976, 1977, 1981, 1982, 1983, 1984,
+ 1988, 2001, 2003, 2005, 2007, 2009, 2014, 2017, 2024, 2023,
+ 2032, 2033, 2034, 2035, 2043, 2044, 2045, 2049, 2050, 2051,
+ 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061,
+ 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071,
+ 2077, 2076, 2088, 2095, 2096, 2097, 2098, 2099, 2100, 2101,
+ 2102, 2103, 2104, 2105, 2106, 2107, 2112, 2123, 2124, 2125,
+ 2126, 2132, 2146, 2152, 2158, 2164, 2163, 2172, 2173, 2183,
+ 2193, 2200, 2205, 2215, 2219, 2220, 2224, 2225, 2228, 2229,
+ 2233, 2237, 2247, 2253, 2263, 2268, 2272, 2273, 2277, 2281,
+ 2285, 2292, 2296, 2300, 2307, 2308, 2312, 2313, 2314, 2315,
+ 2316, 2317, 2321, 2322, 2326, 2327, 2331, 2332, 2336, 2337,
+ 2344, 2351, 2352, 2353, 2357, 2358, 2362, 2363, 2367, 2368,
+ 2372, 2373, 2377, 2377, 2389, 2389, 2401, 2402, 2410, 2417,
+ 2418, 2419, 2420, 2421, 2425, 2426, 2427, 2428
};
#endif
@@ -3219,22 +3220,22 @@
switch (yyn)
{
case 2:
-#line 1143 "compilers/imcc/imcc.y"
+#line 1144 "compilers/imcc/imcc.y"
{ if (yynerrs) YYABORT; (yyval.i) = 0; ;}
break;
case 5:
-#line 1152 "compilers/imcc/imcc.y"
+#line 1153 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); ;}
break;
case 6:
-#line 1153 "compilers/imcc/imcc.y"
+#line 1154 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); ;}
break;
case 7:
-#line 1155 "compilers/imcc/imcc.y"
+#line 1156 "compilers/imcc/imcc.y"
{
(yyval.i) = (yyvsp[(1) - (1)].i);
imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
@@ -3243,7 +3244,7 @@
break;
case 8:
-#line 1161 "compilers/imcc/imcc.y"
+#line 1162 "compilers/imcc/imcc.y"
{
(yyval.i) = (yyvsp[(1) - (1)].i);
imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
@@ -3252,32 +3253,32 @@
break;
case 9:
-#line 1166 "compilers/imcc/imcc.y"
+#line 1167 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 10:
-#line 1167 "compilers/imcc/imcc.y"
+#line 1168 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 11:
-#line 1168 "compilers/imcc/imcc.y"
+#line 1169 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 12:
-#line 1169 "compilers/imcc/imcc.y"
+#line 1170 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 13:
-#line 1173 "compilers/imcc/imcc.y"
+#line 1174 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 14:
-#line 1175 "compilers/imcc/imcc.y"
+#line 1176 "compilers/imcc/imcc.y"
{
(yyval.i) = 0;
do_loadlib(interp, (yyvsp[(2) - (3)].s));
@@ -3286,7 +3287,7 @@
break;
case 15:
-#line 1184 "compilers/imcc/imcc.y"
+#line 1185 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->line = atoi((yyvsp[(2) - (5)].s));
/* set_filename() frees the STRINGC */
@@ -3295,7 +3296,7 @@
break;
case 16:
-#line 1190 "compilers/imcc/imcc.y"
+#line 1191 "compilers/imcc/imcc.y"
{
/* set_filename() frees the STRINGC */
set_filename(interp, (yyvsp[(2) - (3)].s));
@@ -3303,7 +3304,7 @@
break;
case 17:
-#line 1198 "compilers/imcc/imcc.y"
+#line 1199 "compilers/imcc/imcc.y"
{
/* We'll want to store an entry while emitting instructions, so just
* store annotation like it's an instruction. */
@@ -3314,7 +3315,7 @@
break;
case 18:
-#line 1210 "compilers/imcc/imcc.y"
+#line 1211 "compilers/imcc/imcc.y"
{
STRING * const hll_name = Parrot_str_unescape(interp, (yyvsp[(2) - (2)].s) + 1, '"', NULL);
CONTEXT(interp)->current_HLL =
@@ -3327,80 +3328,80 @@
break;
case 19:
-#line 1222 "compilers/imcc/imcc.y"
- { pesky_global__is_def = 1; ;}
+#line 1223 "compilers/imcc/imcc.y"
+ { IMCC_INFO(interp)->is_def = 1; ;}
break;
case 20:
-#line 1223 "compilers/imcc/imcc.y"
+#line 1224 "compilers/imcc/imcc.y"
{
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1);
mem_sys_free((yyvsp[(4) - (6)].s));
- pesky_global__is_def = 0;
+ IMCC_INFO(interp)->is_def = 0;
;}
break;
case 21:
-#line 1231 "compilers/imcc/imcc.y"
- { pesky_global__is_def=1; ;}
+#line 1232 "compilers/imcc/imcc.y"
+ { IMCC_INFO(interp)->is_def = 1; ;}
break;
case 22:
-#line 1232 "compilers/imcc/imcc.y"
+#line 1233 "compilers/imcc/imcc.y"
{
(yyval.i) = mk_pmc_const(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s));
mem_sys_free((yyvsp[(6) - (6)].s));
- pesky_global__is_def = 0;
+ IMCC_INFO(interp)->is_def = 0;
;}
break;
case 23:
-#line 1238 "compilers/imcc/imcc.y"
- { pesky_global__is_def=1; ;}
+#line 1239 "compilers/imcc/imcc.y"
+ { IMCC_INFO(interp)->is_def = 1; ;}
break;
case 24:
-#line 1239 "compilers/imcc/imcc.y"
+#line 1240 "compilers/imcc/imcc.y"
{
(yyval.i) = mk_pmc_const_named(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s));
mem_sys_free((yyvsp[(3) - (6)].s));
mem_sys_free((yyvsp[(6) - (6)].s));
- pesky_global__is_def = 0;
+ IMCC_INFO(interp)->is_def = 0;
;}
break;
case 29:
-#line 1257 "compilers/imcc/imcc.y"
+#line 1258 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 30:
-#line 1258 "compilers/imcc/imcc.y"
+#line 1259 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 31:
-#line 1259 "compilers/imcc/imcc.y"
+#line 1260 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 32:
-#line 1260 "compilers/imcc/imcc.y"
+#line 1261 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 33:
-#line 1261 "compilers/imcc/imcc.y"
+#line 1262 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); ;}
break;
case 36:
-#line 1266 "compilers/imcc/imcc.y"
+#line 1267 "compilers/imcc/imcc.y"
{ clear_state(interp); ;}
break;
case 37:
-#line 1268 "compilers/imcc/imcc.y"
+#line 1269 "compilers/imcc/imcc.y"
{
(yyval.i) = INS(interp, IMCC_INFO(interp)->cur_unit,
(yyvsp[(2) - (3)].s), 0, IMCC_INFO(interp)->regs,
@@ -3410,7 +3411,7 @@
break;
case 38:
-#line 1275 "compilers/imcc/imcc.y"
+#line 1276 "compilers/imcc/imcc.y"
{
imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM);
@@ -3418,7 +3419,7 @@
break;
case 39:
-#line 1280 "compilers/imcc/imcc.y"
+#line 1281 "compilers/imcc/imcc.y"
{
(yyval.i) = iSUBROUTINE(interp,
IMCC_INFO(interp)->cur_unit,
@@ -3429,36 +3430,40 @@
break;
case 40:
-#line 1288 "compilers/imcc/imcc.y"
+#line 1289 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr));
;}
break;
case 41:
-#line 1292 "compilers/imcc/imcc.y"
+#line 1293 "compilers/imcc/imcc.y"
{
- SymReg *r = mk_pasm_reg(interp, (yyvsp[(4) - (4)].s));
- SymReg *n = mk_const(interp, (yyvsp[(2) - (4)].s), 'S');
+ char *name = mem_sys_strdup((yyvsp[(2) - (4)].s) + 1);
+ SymReg *r = mk_pasm_reg(interp, (yyvsp[(4) - (4)].s));
+ SymReg *n;
+ name[strlen(name) - 1] = 0;
+ n = mk_const(interp, name, 'S');
set_lexical(interp, r, n);
(yyval.i) = 0;
+ mem_sys_free(name);
mem_sys_free((yyvsp[(2) - (4)].s));
mem_sys_free((yyvsp[(4) - (4)].s));
;}
break;
case 42:
-#line 1300 "compilers/imcc/imcc.y"
+#line 1305 "compilers/imcc/imcc.y"
{ (yyval.i) = 0;;}
break;
case 44:
-#line 1308 "compilers/imcc/imcc.y"
+#line 1313 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); ;}
break;
case 45:
-#line 1311 "compilers/imcc/imcc.y"
+#line 1316 "compilers/imcc/imcc.y"
{
/* if (optimizer_level & OPT_PASM)
imc_compile_unit(interp, IMCC_INFO(interp)->cur_unit);
@@ -3469,7 +3474,7 @@
break;
case 48:
-#line 1327 "compilers/imcc/imcc.y"
+#line 1332 "compilers/imcc/imcc.y"
{
int re_open = 0;
(yyval.i) = 0;
@@ -3484,37 +3489,33 @@
break;
case 49:
-#line 1342 "compilers/imcc/imcc.y"
+#line 1347 "compilers/imcc/imcc.y"
{
- if (IMCC_INFO(interp)->in_slice)
- IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
- "Slice not allowed in namespace.");
-
(yyval.sr) = (yyvsp[(2) - (3)].sr);
;}
break;
case 50:
-#line 1349 "compilers/imcc/imcc.y"
+#line 1350 "compilers/imcc/imcc.y"
{ (yyval.sr) = NULL; ;}
break;
case 51:
-#line 1354 "compilers/imcc/imcc.y"
+#line 1355 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PCCSUB);
;}
break;
case 52:
-#line 1358 "compilers/imcc/imcc.y"
+#line 1359 "compilers/imcc/imcc.y"
{
iSUBROUTINE(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (3)].sr));
;}
break;
case 53:
-#line 1362 "compilers/imcc/imcc.y"
+#line 1363 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_call->pcc_sub->pragma = (yyvsp[(5) - (6)].t);
if (!IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid) {
@@ -3525,22 +3526,22 @@
break;
case 54:
-#line 1370 "compilers/imcc/imcc.y"
+#line 1371 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;}
break;
case 55:
-#line 1374 "compilers/imcc/imcc.y"
+#line 1375 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; ;}
break;
case 56:
-#line 1375 "compilers/imcc/imcc.y"
+#line 1376 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; ;}
break;
case 57:
-#line 1377 "compilers/imcc/imcc.y"
+#line 1378 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
add_pcc_named_param(IMCC_INFO(interp)->cur_call,
@@ -3553,17 +3554,17 @@
break;
case 58:
-#line 1389 "compilers/imcc/imcc.y"
- { pesky_global__is_def=1; ;}
+#line 1390 "compilers/imcc/imcc.y"
+ { IMCC_INFO(interp)->is_def = 1; ;}
break;
case 59:
-#line 1389 "compilers/imcc/imcc.y"
- { (yyval.sr) = (yyvsp[(3) - (3)].sr); pesky_global__is_def=0; ;}
+#line 1390 "compilers/imcc/imcc.y"
+ { (yyval.sr) = (yyvsp[(3) - (3)].sr); IMCC_INFO(interp)->is_def = 0; ;}
break;
case 60:
-#line 1394 "compilers/imcc/imcc.y"
+#line 1395 "compilers/imcc/imcc.y"
{
if ((yyvsp[(3) - (3)].t) & VT_UNIQUE_REG)
(yyval.sr) = mk_ident_ur(interp, (yyvsp[(2) - (3)].s), (yyvsp[(1) - (3)].t));
@@ -3575,12 +3576,12 @@
break;
case 61:
-#line 1407 "compilers/imcc/imcc.y"
+#line 1408 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; ;}
break;
case 62:
-#line 1412 "compilers/imcc/imcc.y"
+#line 1413 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->outer = mk_sub_address_fromc(interp, (yyvsp[(3) - (4)].s));
@@ -3589,7 +3590,7 @@
break;
case 63:
-#line 1418 "compilers/imcc/imcc.y"
+#line 1419 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->outer = mk_const(interp, (yyvsp[(3) - (4)].s), 'S');
@@ -3598,7 +3599,7 @@
break;
case 64:
-#line 1427 "compilers/imcc/imcc.y"
+#line 1428 "compilers/imcc/imcc.y"
{
(yyval.t) = P_VTABLE;
IMCC_INFO(interp)->cur_unit->vtable_name = NULL;
@@ -3607,7 +3608,7 @@
break;
case 65:
-#line 1433 "compilers/imcc/imcc.y"
+#line 1434 "compilers/imcc/imcc.y"
{
(yyval.t) = P_VTABLE;
IMCC_INFO(interp)->cur_unit->vtable_name = (yyvsp[(3) - (4)].s);
@@ -3616,7 +3617,7 @@
break;
case 66:
-#line 1442 "compilers/imcc/imcc.y"
+#line 1443 "compilers/imcc/imcc.y"
{
(yyval.t) = P_METHOD;
IMCC_INFO(interp)->cur_unit->method_name = NULL;
@@ -3625,7 +3626,7 @@
break;
case 67:
-#line 1448 "compilers/imcc/imcc.y"
+#line 1449 "compilers/imcc/imcc.y"
{
(yyval.t) = P_METHOD;
IMCC_INFO(interp)->cur_unit->method_name = (yyvsp[(3) - (4)].s);
@@ -3634,7 +3635,7 @@
break;
case 68:
-#line 1457 "compilers/imcc/imcc.y"
+#line 1458 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->ns_entry_name = NULL;
@@ -3643,7 +3644,7 @@
break;
case 69:
-#line 1463 "compilers/imcc/imcc.y"
+#line 1464 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->ns_entry_name = (yyvsp[(3) - (4)].s);
@@ -3652,7 +3653,7 @@
break;
case 70:
-#line 1472 "compilers/imcc/imcc.y"
+#line 1473 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->instance_of = (yyvsp[(3) - (4)].s);
@@ -3660,7 +3661,7 @@
break;
case 71:
-#line 1480 "compilers/imcc/imcc.y"
+#line 1481 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->subid = NULL;
@@ -3668,7 +3669,7 @@
break;
case 72:
-#line 1485 "compilers/imcc/imcc.y"
+#line 1486 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->subid = mk_const(interp, (yyvsp[(3) - (4)].s), 'S');
@@ -3678,14 +3679,14 @@
break;
case 73:
-#line 1495 "compilers/imcc/imcc.y"
+#line 1496 "compilers/imcc/imcc.y"
{
add_pcc_multi(IMCC_INFO(interp)->cur_call, NULL);
;}
break;
case 74:
-#line 1499 "compilers/imcc/imcc.y"
+#line 1500 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr));
@@ -3693,7 +3694,7 @@
break;
case 75:
-#line 1504 "compilers/imcc/imcc.y"
+#line 1505 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr));
@@ -3701,27 +3702,27 @@
break;
case 76:
-#line 1511 "compilers/imcc/imcc.y"
+#line 1512 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "INTVAL", 'S'); ;}
break;
case 77:
-#line 1512 "compilers/imcc/imcc.y"
+#line 1513 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "FLOATVAL", 'S'); ;}
break;
case 78:
-#line 1513 "compilers/imcc/imcc.y"
+#line 1514 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "PMC", 'S'); ;}
break;
case 79:
-#line 1514 "compilers/imcc/imcc.y"
+#line 1515 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "STRING", 'S'); ;}
break;
case 80:
-#line 1516 "compilers/imcc/imcc.y"
+#line 1517 "compilers/imcc/imcc.y"
{
SymReg *r;
if (strcmp((yyvsp[(1) - (1)].s), "_") != 0)
@@ -3735,7 +3736,7 @@
break;
case 81:
-#line 1527 "compilers/imcc/imcc.y"
+#line 1528 "compilers/imcc/imcc.y"
{
SymReg *r;
if (strcmp((yyvsp[(1) - (1)].s), "_") != 0)
@@ -3749,12 +3750,12 @@
break;
case 82:
-#line 1537 "compilers/imcc/imcc.y"
+#line 1538 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); ;}
break;
case 85:
-#line 1547 "compilers/imcc/imcc.y"
+#line 1548 "compilers/imcc/imcc.y"
{
char name[128];
SymReg *r, *r1;
@@ -3781,82 +3782,82 @@
break;
case 86:
-#line 1575 "compilers/imcc/imcc.y"
+#line 1576 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;}
break;
case 87:
-#line 1579 "compilers/imcc/imcc.y"
+#line 1580 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 0; ;}
break;
case 88:
-#line 1580 "compilers/imcc/imcc.y"
+#line 1581 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 1; ;}
break;
case 89:
-#line 1584 "compilers/imcc/imcc.y"
+#line 1585 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; ;}
break;
case 90:
-#line 1585 "compilers/imcc/imcc.y"
+#line 1586 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->object = (yyvsp[(2) - (3)].sr); ;}
break;
case 91:
-#line 1589 "compilers/imcc/imcc.y"
+#line 1590 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; ;}
break;
case 93:
-#line 1594 "compilers/imcc/imcc.y"
+#line 1595 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (1)].t); ;}
break;
case 94:
-#line 1595 "compilers/imcc/imcc.y"
+#line 1596 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;}
break;
case 95:
-#line 1599 "compilers/imcc/imcc.y"
+#line 1600 "compilers/imcc/imcc.y"
{ (yyval.t) = P_LOAD; ;}
break;
case 96:
-#line 1600 "compilers/imcc/imcc.y"
+#line 1601 "compilers/imcc/imcc.y"
{ (yyval.t) = P_INIT; ;}
break;
case 97:
-#line 1601 "compilers/imcc/imcc.y"
+#line 1602 "compilers/imcc/imcc.y"
{ (yyval.t) = P_MAIN; ;}
break;
case 98:
-#line 1602 "compilers/imcc/imcc.y"
+#line 1603 "compilers/imcc/imcc.y"
{ (yyval.t) = P_IMMEDIATE; ;}
break;
case 99:
-#line 1603 "compilers/imcc/imcc.y"
+#line 1604 "compilers/imcc/imcc.y"
{ (yyval.t) = P_POSTCOMP; ;}
break;
case 100:
-#line 1604 "compilers/imcc/imcc.y"
+#line 1605 "compilers/imcc/imcc.y"
{ (yyval.t) = P_ANON; ;}
break;
case 101:
-#line 1605 "compilers/imcc/imcc.y"
+#line 1606 "compilers/imcc/imcc.y"
{ (yyval.t) = P_NEED_LEX; ;}
break;
case 109:
-#line 1617 "compilers/imcc/imcc.y"
+#line 1618 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
@@ -3864,14 +3865,14 @@
break;
case 110:
-#line 1622 "compilers/imcc/imcc.y"
+#line 1623 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
;}
break;
case 111:
-#line 1626 "compilers/imcc/imcc.y"
+#line 1627 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isNCI;
@@ -3879,21 +3880,21 @@
break;
case 112:
-#line 1631 "compilers/imcc/imcc.y"
+#line 1632 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
;}
break;
case 113:
-#line 1635 "compilers/imcc/imcc.y"
+#line 1636 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (3)].s), 'S'));
;}
break;
case 114:
-#line 1639 "compilers/imcc/imcc.y"
+#line 1640 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
@@ -3901,7 +3902,7 @@
break;
case 115:
-#line 1644 "compilers/imcc/imcc.y"
+#line 1645 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (5)].s), 'S'));
add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
@@ -3909,27 +3910,27 @@
break;
case 116:
-#line 1652 "compilers/imcc/imcc.y"
+#line 1653 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; ;}
break;
case 117:
-#line 1653 "compilers/imcc/imcc.y"
+#line 1654 "compilers/imcc/imcc.y"
{ add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); ;}
break;
case 118:
-#line 1657 "compilers/imcc/imcc.y"
+#line 1658 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (2)].sr); ;}
break;
case 119:
-#line 1662 "compilers/imcc/imcc.y"
+#line 1663 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; ;}
break;
case 120:
-#line 1664 "compilers/imcc/imcc.y"
+#line 1665 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
@@ -3937,17 +3938,17 @@
break;
case 121:
-#line 1671 "compilers/imcc/imcc.y"
+#line 1672 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;}
break;
case 122:
-#line 1672 "compilers/imcc/imcc.y"
- { pesky_global__is_def=1; ;}
+#line 1673 "compilers/imcc/imcc.y"
+ { IMCC_INFO(interp)->is_def = 1; ;}
break;
case 123:
-#line 1673 "compilers/imcc/imcc.y"
+#line 1674 "compilers/imcc/imcc.y"
{
IdList * const l = (yyvsp[(4) - (4)].idlist);
SymReg *ignored;
@@ -3956,68 +3957,68 @@
else
ignored = mk_ident(interp, l->id, (yyvsp[(3) - (4)].t));
UNUSED(ignored);
- pesky_global__is_def=0;
- (yyval.sr)=0;
+ IMCC_INFO(interp)->is_def = 0;
+ (yyval.sr) = 0;
;}
break;
case 124:
-#line 1687 "compilers/imcc/imcc.y"
+#line 1688 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; ;}
break;
case 125:
-#line 1688 "compilers/imcc/imcc.y"
+#line 1689 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;}
break;
case 126:
-#line 1692 "compilers/imcc/imcc.y"
+#line 1693 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_FLAT; ;}
break;
case 127:
-#line 1693 "compilers/imcc/imcc.y"
+#line 1694 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_OPTIONAL; ;}
break;
case 128:
-#line 1694 "compilers/imcc/imcc.y"
+#line 1695 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_OPT_FLAG; ;}
break;
case 129:
-#line 1695 "compilers/imcc/imcc.y"
+#line 1696 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_NAMED; ;}
break;
case 130:
-#line 1696 "compilers/imcc/imcc.y"
+#line 1697 "compilers/imcc/imcc.y"
{ adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); ;}
break;
case 131:
-#line 1697 "compilers/imcc/imcc.y"
+#line 1698 "compilers/imcc/imcc.y"
{ adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); ;}
break;
case 132:
-#line 1698 "compilers/imcc/imcc.y"
+#line 1699 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_UNIQUE_REG; ;}
break;
case 133:
-#line 1703 "compilers/imcc/imcc.y"
+#line 1704 "compilers/imcc/imcc.y"
{ begin_return_or_yield(interp, 0); ;}
break;
case 134:
-#line 1705 "compilers/imcc/imcc.y"
+#line 1706 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; ;}
break;
case 135:
-#line 1707 "compilers/imcc/imcc.y"
+#line 1708 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->asm_state = AsmDefault;
(yyval.i) = 0;
@@ -4025,22 +4026,22 @@
break;
case 136:
-#line 1714 "compilers/imcc/imcc.y"
+#line 1715 "compilers/imcc/imcc.y"
{ begin_return_or_yield(interp, 1); ;}
break;
case 137:
-#line 1716 "compilers/imcc/imcc.y"
+#line 1717 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; ;}
break;
case 138:
-#line 1720 "compilers/imcc/imcc.y"
+#line 1721 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; ;}
break;
case 139:
-#line 1722 "compilers/imcc/imcc.y"
+#line 1723 "compilers/imcc/imcc.y"
{
if ((yyvsp[(1) - (2)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr));
@@ -4048,7 +4049,7 @@
break;
case 140:
-#line 1727 "compilers/imcc/imcc.y"
+#line 1728 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr));
@@ -4056,12 +4057,12 @@
break;
case 141:
-#line 1734 "compilers/imcc/imcc.y"
+#line 1735 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; ;}
break;
case 142:
-#line 1736 "compilers/imcc/imcc.y"
+#line 1737 "compilers/imcc/imcc.y"
{
if ((yyvsp[(1) - (2)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr));
@@ -4069,7 +4070,7 @@
break;
case 143:
-#line 1741 "compilers/imcc/imcc.y"
+#line 1742 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr));
@@ -4077,17 +4078,17 @@
break;
case 144:
-#line 1748 "compilers/imcc/imcc.y"
+#line 1749 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;}
break;
case 145:
-#line 1752 "compilers/imcc/imcc.y"
+#line 1753 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;}
break;
case 146:
-#line 1757 "compilers/imcc/imcc.y"
+#line 1758 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->asm_state == AsmDefault)
begin_return_or_yield(interp, (yyvsp[(1) - (2)].t));
@@ -4095,7 +4096,7 @@
break;
case 147:
-#line 1762 "compilers/imcc/imcc.y"
+#line 1763 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->asm_state = AsmDefault;
(yyval.t) = 0;
@@ -4103,22 +4104,22 @@
break;
case 148:
-#line 1769 "compilers/imcc/imcc.y"
+#line 1770 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; ;}
break;
case 149:
-#line 1770 "compilers/imcc/imcc.y"
+#line 1771 "compilers/imcc/imcc.y"
{ (yyval.t) = 1; ;}
break;
case 150:
-#line 1774 "compilers/imcc/imcc.y"
+#line 1775 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 151:
-#line 1776 "compilers/imcc/imcc.y"
+#line 1777 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
add_pcc_named_return(IMCC_INFO(interp)->sr_return,
@@ -4131,7 +4132,7 @@
break;
case 152:
-#line 1786 "compilers/imcc/imcc.y"
+#line 1787 "compilers/imcc/imcc.y"
{
SymReg * const name = mk_const(interp, (yyvsp[(1) - (3)].s), 'S');
add_pcc_named_return(IMCC_INFO(interp)->sr_return, name, (yyvsp[(3) - (3)].sr));
@@ -4139,7 +4140,7 @@
break;
case 153:
-#line 1791 "compilers/imcc/imcc.y"
+#line 1792 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
add_pcc_named_return(IMCC_INFO(interp)->sr_return,
@@ -4152,7 +4153,7 @@
break;
case 154:
-#line 1801 "compilers/imcc/imcc.y"
+#line 1802 "compilers/imcc/imcc.y"
{
SymReg * const name = mk_const(interp, (yyvsp[(3) - (5)].s), 'S');
add_pcc_named_return(IMCC_INFO(interp)->sr_return, name, (yyvsp[(5) - (5)].sr));
@@ -4160,47 +4161,47 @@
break;
case 157:
-#line 1822 "compilers/imcc/imcc.y"
+#line 1823 "compilers/imcc/imcc.y"
{ clear_state(interp); ;}
break;
case 158:
-#line 1827 "compilers/imcc/imcc.y"
+#line 1828 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (2)].i); ;}
break;
case 159:
-#line 1828 "compilers/imcc/imcc.y"
+#line 1829 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 160:
-#line 1829 "compilers/imcc/imcc.y"
+#line 1830 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 161:
-#line 1830 "compilers/imcc/imcc.y"
+#line 1831 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 162:
-#line 1831 "compilers/imcc/imcc.y"
+#line 1832 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 163:
-#line 1832 "compilers/imcc/imcc.y"
+#line 1833 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); ;}
break;
case 164:
-#line 1836 "compilers/imcc/imcc.y"
+#line 1837 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; ;}
break;
case 168:
-#line 1847 "compilers/imcc/imcc.y"
+#line 1848 "compilers/imcc/imcc.y"
{
Instruction * const i = iLABEL(interp, IMCC_INFO(interp)->cur_unit, mk_local_label(interp, (yyvsp[(1) - (1)].s)));
mem_sys_free((yyvsp[(1) - (1)].s));
@@ -4209,12 +4210,12 @@
break;
case 169:
-#line 1857 "compilers/imcc/imcc.y"
+#line 1858 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (3)].i); ;}
break;
case 170:
-#line 1859 "compilers/imcc/imcc.y"
+#line 1860 "compilers/imcc/imcc.y"
{
if (yynerrs >= PARROT_MAX_RECOVER_ERRORS) {
IMCC_warning(interp, "Too many errors. Correct some first.\n");
@@ -4225,7 +4226,7 @@
break;
case 171:
-#line 1870 "compilers/imcc/imcc.y"
+#line 1871 "compilers/imcc/imcc.y"
{
IdList* const l = (yyvsp[(1) - (1)].idlist);
l->next = NULL;
@@ -4234,7 +4235,7 @@
break;
case 172:
-#line 1877 "compilers/imcc/imcc.y"
+#line 1878 "compilers/imcc/imcc.y"
{
IdList* const l = (yyvsp[(3) - (3)].idlist);
l->next = (yyvsp[(1) - (3)].idlist);
@@ -4243,7 +4244,7 @@
break;
case 173:
-#line 1886 "compilers/imcc/imcc.y"
+#line 1887 "compilers/imcc/imcc.y"
{
IdList* const l = mem_allocate_n_zeroed_typed(1, IdList);
l->id = (yyvsp[(1) - (2)].s);
@@ -4253,22 +4254,22 @@
break;
case 174:
-#line 1895 "compilers/imcc/imcc.y"
+#line 1896 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; ;}
break;
case 175:
-#line 1896 "compilers/imcc/imcc.y"
+#line 1897 "compilers/imcc/imcc.y"
{ (yyval.t) = 1; ;}
break;
case 178:
-#line 1903 "compilers/imcc/imcc.y"
- { pesky_global__is_def=1; ;}
+#line 1904 "compilers/imcc/imcc.y"
+ { IMCC_INFO(interp)->is_def = 1; ;}
break;
case 179:
-#line 1904 "compilers/imcc/imcc.y"
+#line 1905 "compilers/imcc/imcc.y"
{
IdList *l = (yyvsp[(4) - (4)].idlist);
while (l) {
@@ -4282,58 +4283,62 @@
mem_sys_free(l1->id);
mem_sys_free(l1);
}
- pesky_global__is_def=0; (yyval.i)=0;
+ IMCC_INFO(interp)->is_def = 0; (yyval.i) = 0;
;}
break;
case 180:
-#line 1920 "compilers/imcc/imcc.y"
+#line 1921 "compilers/imcc/imcc.y"
{
- SymReg * const n = mk_const(interp, (yyvsp[(2) - (4)].s), 'S');
+ SymReg *n;
+ char *name = mem_sys_strdup((yyvsp[(2) - (4)].s) + 1);
+ name[strlen(name) - 1] = 0;
+ n = mk_const(interp, name, 'S');
set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0;
mem_sys_free((yyvsp[(2) - (4)].s));
+ mem_sys_free(name);
;}
break;
case 181:
-#line 1926 "compilers/imcc/imcc.y"
+#line 1931 "compilers/imcc/imcc.y"
{
- SymReg * const n = mk_const(interp, (yyvsp[(2) - (4)].s), 'U');
+ SymReg *n = mk_const(interp, (yyvsp[(2) - (4)].s), 'U');
set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0;
mem_sys_free((yyvsp[(2) - (4)].s));
;}
break;
case 182:
-#line 1931 "compilers/imcc/imcc.y"
- { pesky_global__is_def=1; ;}
+#line 1936 "compilers/imcc/imcc.y"
+ { IMCC_INFO(interp)->is_def = 1; ;}
break;
case 183:
-#line 1932 "compilers/imcc/imcc.y"
+#line 1937 "compilers/imcc/imcc.y"
{
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 0);
- pesky_global__is_def=0;
+ IMCC_INFO(interp)->is_def = 0;
mem_sys_free((yyvsp[(4) - (6)].s));
;}
break;
case 185:
-#line 1939 "compilers/imcc/imcc.y"
- { pesky_global__is_def=1; ;}
+#line 1944 "compilers/imcc/imcc.y"
+ { IMCC_INFO(interp)->is_def = 1; ;}
break;
case 186:
-#line 1940 "compilers/imcc/imcc.y"
+#line 1945 "compilers/imcc/imcc.y"
{
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1);
- pesky_global__is_def=0;
+ IMCC_INFO(interp)->is_def = 0;
mem_sys_free((yyvsp[(4) - (6)].s));
;}
break;
case 187:
-#line 1946 "compilers/imcc/imcc.y"
+#line 1951 "compilers/imcc/imcc.y"
{
(yyval.i) = NULL;
IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isTAIL_CALL;
@@ -4342,14 +4347,14 @@
break;
case 188:
-#line 1952 "compilers/imcc/imcc.y"
+#line 1957 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "branch", 1, (yyvsp[(2) - (2)].sr));
;}
break;
case 189:
-#line 1956 "compilers/imcc/imcc.y"
+#line 1961 "compilers/imcc/imcc.y"
{
(yyval.i) = INS(interp,
IMCC_INFO(interp)->cur_unit,
@@ -4364,47 +4369,47 @@
break;
case 190:
-#line 1967 "compilers/imcc/imcc.y"
+#line 1972 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); ;}
break;
case 191:
-#line 1968 "compilers/imcc/imcc.y"
+#line 1973 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;}
break;
case 192:
-#line 1969 "compilers/imcc/imcc.y"
+#line 1974 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 195:
-#line 1972 "compilers/imcc/imcc.y"
+#line 1977 "compilers/imcc/imcc.y"
{ (yyval.i) = 0;;}
break;
case 196:
-#line 1976 "compilers/imcc/imcc.y"
+#line 1981 "compilers/imcc/imcc.y"
{ (yyval.t) = 'I'; ;}
break;
case 197:
-#line 1977 "compilers/imcc/imcc.y"
+#line 1982 "compilers/imcc/imcc.y"
{ (yyval.t) = 'N'; ;}
break;
case 198:
-#line 1978 "compilers/imcc/imcc.y"
+#line 1983 "compilers/imcc/imcc.y"
{ (yyval.t) = 'S'; ;}
break;
case 199:
-#line 1979 "compilers/imcc/imcc.y"
+#line 1984 "compilers/imcc/imcc.y"
{ (yyval.t) = 'P'; ;}
break;
case 200:
-#line 1984 "compilers/imcc/imcc.y"
+#line 1989 "compilers/imcc/imcc.y"
{
/* there'd normally be a mem_sys_strdup() here, but the lexer already
* copied the string, so it's safe to use directly */
@@ -4417,37 +4422,37 @@
break;
case 201:
-#line 1997 "compilers/imcc/imcc.y"
+#line 2002 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "set", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); ;}
break;
case 202:
-#line 1999 "compilers/imcc/imcc.y"
+#line 2004 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (4)].s), 2, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].sr)); ;}
break;
case 203:
-#line 2001 "compilers/imcc/imcc.y"
+#line 2006 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(4) - (5)].s), 3, (yyvsp[(1) - (5)].sr), (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); ;}
break;
case 204:
-#line 2003 "compilers/imcc/imcc.y"
+#line 2008 "compilers/imcc/imcc.y"
{ (yyval.i) = iINDEXFETCH(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(5) - (6)].sr)); ;}
break;
case 205:
-#line 2005 "compilers/imcc/imcc.y"
+#line 2010 "compilers/imcc/imcc.y"
{ (yyval.i) = iINDEXSET(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(6) - (6)].sr)); ;}
break;
case 206:
-#line 2010 "compilers/imcc/imcc.y"
+#line 2015 "compilers/imcc/imcc.y"
{ (yyval.i) = iNEW(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (7)].sr), (yyvsp[(4) - (7)].s), (yyvsp[(6) - (7)].sr), 1); ;}
break;
case 207:
-#line 2013 "compilers/imcc/imcc.y"
+#line 2018 "compilers/imcc/imcc.y"
{
add_pcc_result((yyvsp[(3) - (3)].i)->symregs[0], (yyvsp[(1) - (3)].sr));
IMCC_INFO(interp)->cur_call = NULL;
@@ -4456,14 +4461,14 @@
break;
case 208:
-#line 2019 "compilers/imcc/imcc.y"
+#line 2024 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
;}
break;
case 209:
-#line 2023 "compilers/imcc/imcc.y"
+#line 2028 "compilers/imcc/imcc.y"
{
IMCC_itcall_sub(interp, (yyvsp[(6) - (9)].sr));
IMCC_INFO(interp)->cur_call = NULL;
@@ -4471,144 +4476,144 @@
break;
case 213:
-#line 2031 "compilers/imcc/imcc.y"
+#line 2036 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(1) - (3)].sr));
;}
break;
case 214:
-#line 2038 "compilers/imcc/imcc.y"
+#line 2043 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"not"; ;}
break;
case 215:
-#line 2039 "compilers/imcc/imcc.y"
+#line 2044 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bnot"; ;}
break;
case 216:
-#line 2040 "compilers/imcc/imcc.y"
+#line 2045 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"neg"; ;}
break;
case 217:
-#line 2044 "compilers/imcc/imcc.y"
+#line 2049 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"sub"; ;}
break;
case 218:
-#line 2045 "compilers/imcc/imcc.y"
+#line 2050 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"add"; ;}
break;
case 219:
-#line 2046 "compilers/imcc/imcc.y"
+#line 2051 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mul"; ;}
break;
case 220:
-#line 2047 "compilers/imcc/imcc.y"
+#line 2052 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"div"; ;}
break;
case 221:
-#line 2048 "compilers/imcc/imcc.y"
+#line 2053 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mod"; ;}
break;
case 222:
-#line 2049 "compilers/imcc/imcc.y"
+#line 2054 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"fdiv"; ;}
break;
case 223:
-#line 2050 "compilers/imcc/imcc.y"
+#line 2055 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"pow"; ;}
break;
case 224:
-#line 2051 "compilers/imcc/imcc.y"
+#line 2056 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"concat"; ;}
break;
case 225:
-#line 2052 "compilers/imcc/imcc.y"
+#line 2057 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"iseq"; ;}
break;
case 226:
-#line 2053 "compilers/imcc/imcc.y"
+#line 2058 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isne"; ;}
break;
case 227:
-#line 2054 "compilers/imcc/imcc.y"
+#line 2059 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isgt"; ;}
break;
case 228:
-#line 2055 "compilers/imcc/imcc.y"
+#line 2060 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isge"; ;}
break;
case 229:
-#line 2056 "compilers/imcc/imcc.y"
+#line 2061 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"islt"; ;}
break;
case 230:
-#line 2057 "compilers/imcc/imcc.y"
+#line 2062 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isle"; ;}
break;
case 231:
-#line 2058 "compilers/imcc/imcc.y"
+#line 2063 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shl"; ;}
break;
case 232:
-#line 2059 "compilers/imcc/imcc.y"
+#line 2064 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shr"; ;}
break;
case 233:
-#line 2060 "compilers/imcc/imcc.y"
+#line 2065 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lsr"; ;}
break;
case 234:
-#line 2061 "compilers/imcc/imcc.y"
+#line 2066 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"and"; ;}
break;
case 235:
-#line 2062 "compilers/imcc/imcc.y"
+#line 2067 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"or"; ;}
break;
case 236:
-#line 2063 "compilers/imcc/imcc.y"
+#line 2068 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"xor"; ;}
break;
case 237:
-#line 2064 "compilers/imcc/imcc.y"
+#line 2069 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"band"; ;}
break;
case 238:
-#line 2065 "compilers/imcc/imcc.y"
+#line 2070 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bor"; ;}
break;
case 239:
-#line 2066 "compilers/imcc/imcc.y"
+#line 2071 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bxor"; ;}
break;
case 240:
-#line 2072 "compilers/imcc/imcc.y"
+#line 2077 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
(yyval.i)->type &= ~ITCALL;
@@ -4617,84 +4622,84 @@
break;
case 241:
-#line 2077 "compilers/imcc/imcc.y"
+#line 2082 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; ;}
break;
case 242:
-#line 2084 "compilers/imcc/imcc.y"
+#line 2089 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(2) - (3)].s), 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr));
;}
break;
case 243:
-#line 2090 "compilers/imcc/imcc.y"
+#line 2095 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"add"; ;}
break;
case 244:
-#line 2091 "compilers/imcc/imcc.y"
+#line 2096 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"sub"; ;}
break;
case 245:
-#line 2092 "compilers/imcc/imcc.y"
+#line 2097 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mul"; ;}
break;
case 246:
-#line 2093 "compilers/imcc/imcc.y"
+#line 2098 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"div"; ;}
break;
case 247:
-#line 2094 "compilers/imcc/imcc.y"
+#line 2099 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mod"; ;}
break;
case 248:
-#line 2095 "compilers/imcc/imcc.y"
+#line 2100 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"fdiv"; ;}
break;
case 249:
-#line 2096 "compilers/imcc/imcc.y"
+#line 2101 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"concat"; ;}
break;
case 250:
-#line 2097 "compilers/imcc/imcc.y"
+#line 2102 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"band"; ;}
break;
case 251:
-#line 2098 "compilers/imcc/imcc.y"
+#line 2103 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bor"; ;}
break;
case 252:
-#line 2099 "compilers/imcc/imcc.y"
+#line 2104 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bxor"; ;}
break;
case 253:
-#line 2100 "compilers/imcc/imcc.y"
+#line 2105 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shr"; ;}
break;
case 254:
-#line 2101 "compilers/imcc/imcc.y"
+#line 2106 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shl"; ;}
break;
case 255:
-#line 2102 "compilers/imcc/imcc.y"
+#line 2107 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lsr"; ;}
break;
case 256:
-#line 2108 "compilers/imcc/imcc.y"
+#line 2113 "compilers/imcc/imcc.y"
{
(yyval.i) = func_ins(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (4)].sr), (yyvsp[(3) - (4)].s),
IMCC_INFO(interp) -> regs,
@@ -4705,22 +4710,22 @@
break;
case 257:
-#line 2118 "compilers/imcc/imcc.y"
+#line 2123 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 258:
-#line 2119 "compilers/imcc/imcc.y"
+#line 2124 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 259:
-#line 2120 "compilers/imcc/imcc.y"
+#line 2125 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 260:
-#line 2122 "compilers/imcc/imcc.y"
+#line 2127 "compilers/imcc/imcc.y"
{
(yyval.sr) = (yyvsp[(1) - (1)].sr);
if ((yyvsp[(1) - (1)].sr)->set != 'P')
@@ -4729,7 +4734,7 @@
break;
case 261:
-#line 2128 "compilers/imcc/imcc.y"
+#line 2133 "compilers/imcc/imcc.y"
{
/* disallow bareword method names; SREG name constants are fine */
const char * const name = (yyvsp[(3) - (3)].sr)->name;
@@ -4746,7 +4751,7 @@
break;
case 262:
-#line 2142 "compilers/imcc/imcc.y"
+#line 2147 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
(yyval.sr) = mk_const(interp, (yyvsp[(3) - (3)].s), 'U');
@@ -4755,7 +4760,7 @@
break;
case 263:
-#line 2148 "compilers/imcc/imcc.y"
+#line 2153 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
(yyval.sr) = mk_const(interp, (yyvsp[(3) - (3)].s), 'S');
@@ -4764,12 +4769,12 @@
break;
case 264:
-#line 2153 "compilers/imcc/imcc.y"
+#line 2158 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); ;}
break;
case 265:
-#line 2159 "compilers/imcc/imcc.y"
+#line 2164 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
IMCC_itcall_sub(interp, (yyvsp[(1) - (1)].sr));
@@ -4777,17 +4782,17 @@
break;
case 266:
-#line 2163 "compilers/imcc/imcc.y"
+#line 2168 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (5)].i); ;}
break;
case 267:
-#line 2167 "compilers/imcc/imcc.y"
+#line 2172 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; ;}
break;
case 268:
-#line 2169 "compilers/imcc/imcc.y"
+#line 2174 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4800,7 +4805,7 @@
break;
case 269:
-#line 2179 "compilers/imcc/imcc.y"
+#line 2184 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4813,7 +4818,7 @@
break;
case 270:
-#line 2189 "compilers/imcc/imcc.y"
+#line 2194 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
add_pcc_named_arg(IMCC_INFO(interp)->cur_call,
@@ -4823,7 +4828,7 @@
break;
case 271:
-#line 2196 "compilers/imcc/imcc.y"
+#line 2201 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
add_pcc_named_arg_var(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr));
@@ -4831,7 +4836,7 @@
break;
case 272:
-#line 2201 "compilers/imcc/imcc.y"
+#line 2206 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
add_pcc_named_arg(IMCC_INFO(interp)->cur_call,
@@ -4841,47 +4846,47 @@
break;
case 273:
-#line 2210 "compilers/imcc/imcc.y"
+#line 2215 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); ;}
break;
case 274:
-#line 2214 "compilers/imcc/imcc.y"
+#line 2219 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; ;}
break;
case 275:
-#line 2215 "compilers/imcc/imcc.y"
+#line 2220 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;}
break;
case 276:
-#line 2219 "compilers/imcc/imcc.y"
+#line 2224 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_FLAT; ;}
break;
case 277:
-#line 2220 "compilers/imcc/imcc.y"
+#line 2225 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_NAMED; ;}
break;
case 278:
-#line 2223 "compilers/imcc/imcc.y"
+#line 2228 "compilers/imcc/imcc.y"
{ adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; ;}
break;
case 279:
-#line 2224 "compilers/imcc/imcc.y"
+#line 2229 "compilers/imcc/imcc.y"
{ adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; ;}
break;
case 280:
-#line 2228 "compilers/imcc/imcc.y"
+#line 2233 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); ;}
break;
case 281:
-#line 2233 "compilers/imcc/imcc.y"
+#line 2238 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4894,7 +4899,7 @@
break;
case 282:
-#line 2243 "compilers/imcc/imcc.y"
+#line 2248 "compilers/imcc/imcc.y"
{
add_pcc_named_result(IMCC_INFO(interp)->cur_call,
mk_const(interp, (yyvsp[(3) - (5)].s), 'S'), (yyvsp[(5) - (5)].sr));
@@ -4903,7 +4908,7 @@
break;
case 283:
-#line 2249 "compilers/imcc/imcc.y"
+#line 2254 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4916,7 +4921,7 @@
break;
case 284:
-#line 2259 "compilers/imcc/imcc.y"
+#line 2264 "compilers/imcc/imcc.y"
{
add_pcc_named_result(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(1) - (3)].s), 'S'), (yyvsp[(3) - (3)].sr));
mem_sys_free((yyvsp[(1) - (3)].s));
@@ -4924,124 +4929,124 @@
break;
case 285:
-#line 2263 "compilers/imcc/imcc.y"
+#line 2268 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; ;}
break;
case 286:
-#line 2267 "compilers/imcc/imcc.y"
+#line 2272 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); ;}
break;
case 287:
-#line 2268 "compilers/imcc/imcc.y"
+#line 2273 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); ;}
break;
case 288:
-#line 2273 "compilers/imcc/imcc.y"
+#line 2278 "compilers/imcc/imcc.y"
{
(yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, inv_op((yyvsp[(3) - (6)].s)), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr));
;}
break;
case 289:
-#line 2277 "compilers/imcc/imcc.y"
+#line 2282 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr));
;}
break;
case 290:
-#line 2281 "compilers/imcc/imcc.y"
+#line 2286 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
;}
break;
case 291:
-#line 2288 "compilers/imcc/imcc.y"
+#line 2293 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
;}
break;
case 292:
-#line 2292 "compilers/imcc/imcc.y"
+#line 2297 "compilers/imcc/imcc.y"
{
(yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr));
;}
break;
case 293:
-#line 2296 "compilers/imcc/imcc.y"
+#line 2301 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr));
;}
break;
case 294:
-#line 2302 "compilers/imcc/imcc.y"
+#line 2307 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; ;}
break;
case 295:
-#line 2303 "compilers/imcc/imcc.y"
+#line 2308 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; ;}
break;
case 296:
-#line 2307 "compilers/imcc/imcc.y"
+#line 2312 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"eq"; ;}
break;
case 297:
-#line 2308 "compilers/imcc/imcc.y"
+#line 2313 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"ne"; ;}
break;
case 298:
-#line 2309 "compilers/imcc/imcc.y"
+#line 2314 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"gt"; ;}
break;
case 299:
-#line 2310 "compilers/imcc/imcc.y"
+#line 2315 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"ge"; ;}
break;
case 300:
-#line 2311 "compilers/imcc/imcc.y"
+#line 2316 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lt"; ;}
break;
case 301:
-#line 2312 "compilers/imcc/imcc.y"
+#line 2317 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"le"; ;}
break;
case 304:
-#line 2321 "compilers/imcc/imcc.y"
+#line 2326 "compilers/imcc/imcc.y"
{ (yyval.sr) = NULL; ;}
break;
case 305:
-#line 2322 "compilers/imcc/imcc.y"
+#line 2327 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (1)].sr); ;}
break;
case 306:
-#line 2326 "compilers/imcc/imcc.y"
+#line 2331 "compilers/imcc/imcc.y"
{ (yyval.sr) = IMCC_INFO(interp)->regs[0]; ;}
break;
case 308:
-#line 2331 "compilers/imcc/imcc.y"
+#line 2336 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (1)].sr); ;}
break;
case 309:
-#line 2333 "compilers/imcc/imcc.y"
+#line 2338 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (4)].sr);
IMCC_INFO(interp) -> keyvec |= KEY_BIT(IMCC_INFO(interp)->nargs);
@@ -5051,7 +5056,7 @@
break;
case 310:
-#line 2340 "compilers/imcc/imcc.y"
+#line 2345 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(2) - (3)].sr);
(yyval.sr) = (yyvsp[(2) - (3)].sr);
@@ -5059,45 +5064,44 @@
break;
case 312:
-#line 2347 "compilers/imcc/imcc.y"
+#line 2352 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 313:
-#line 2348 "compilers/imcc/imcc.y"
+#line 2353 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 314:
-#line 2352 "compilers/imcc/imcc.y"
+#line 2357 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 315:
-#line 2353 "compilers/imcc/imcc.y"
+#line 2358 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 316:
-#line 2357 "compilers/imcc/imcc.y"
+#line 2362 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 317:
-#line 2358 "compilers/imcc/imcc.y"
+#line 2363 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 322:
-#line 2372 "compilers/imcc/imcc.y"
+#line 2377 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
- IMCC_INFO(interp)->in_slice = 0;
;}
break;
case 323:
-#line 2377 "compilers/imcc/imcc.y"
+#line 2381 "compilers/imcc/imcc.y"
{
(yyval.sr) = link_keys(interp,
IMCC_INFO(interp)->nkeys,
@@ -5106,15 +5110,14 @@
break;
case 324:
-#line 2385 "compilers/imcc/imcc.y"
+#line 2389 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
- IMCC_INFO(interp)->in_slice = 0;
;}
break;
case 325:
-#line 2390 "compilers/imcc/imcc.y"
+#line 2393 "compilers/imcc/imcc.y"
{
(yyval.sr) = link_keys(interp,
IMCC_INFO(interp)->nkeys,
@@ -5123,12 +5126,12 @@
break;
case 326:
-#line 2398 "compilers/imcc/imcc.y"
+#line 2401 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); ;}
break;
case 327:
-#line 2400 "compilers/imcc/imcc.y"
+#line 2403 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(3) - (3)].sr);
(yyval.sr) = IMCC_INFO(interp)->keys[0];
@@ -5136,62 +5139,60 @@
break;
case 328:
-#line 2408 "compilers/imcc/imcc.y"
+#line 2411 "compilers/imcc/imcc.y"
{
- if (IMCC_INFO(interp)->in_slice)
- (yyvsp[(1) - (1)].sr)->type |= VT_START_SLICE | VT_END_SLICE;
(yyval.sr) = (yyvsp[(1) - (1)].sr);
;}
break;
case 329:
-#line 2416 "compilers/imcc/imcc.y"
+#line 2417 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'I'); ;}
break;
case 330:
-#line 2417 "compilers/imcc/imcc.y"
+#line 2418 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'N'); ;}
break;
case 331:
-#line 2418 "compilers/imcc/imcc.y"
+#line 2419 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'S'); ;}
break;
case 332:
-#line 2419 "compilers/imcc/imcc.y"
+#line 2420 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'P'); ;}
break;
case 333:
-#line 2420 "compilers/imcc/imcc.y"
+#line 2421 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_pasm_reg(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 334:
-#line 2424 "compilers/imcc/imcc.y"
+#line 2425 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'I'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 335:
-#line 2425 "compilers/imcc/imcc.y"
+#line 2426 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'N'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 336:
-#line 2426 "compilers/imcc/imcc.y"
+#line 2427 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'S'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
case 337:
-#line 2427 "compilers/imcc/imcc.y"
+#line 2428 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'U'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
break;
/* Line 1267 of yacc.c. */
-#line 5184 "compilers/imcc/imcparser.c"
+#line 5185 "compilers/imcc/imcparser.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -5405,7 +5406,7 @@
}
-#line 2433 "compilers/imcc/imcc.y"
+#line 2434 "compilers/imcc/imcc.y"
/* I need this prototype somewhere... */
Modified: branches/pluggable_runcore/compilers/imcc/imcparser.h
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/imcparser.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/imcparser.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -295,7 +295,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 1048 "compilers/imcc/imcc.y"
+#line 1049 "compilers/imcc/imcc.y"
{
IdList * idlist;
int t;
@@ -303,7 +303,7 @@
SymReg * sr;
Instruction *i;
}
-/* Line 1529 of yacc.c. */
+/* Line 1489 of yacc.c. */
#line 297 "compilers/imcc/imcparser.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
Modified: branches/pluggable_runcore/compilers/imcc/instructions.h
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/instructions.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/instructions.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -75,19 +75,14 @@
} Instruction_Flags;
#undef INSTRUCTION_BIT
-
-/* Forward decl */
-struct _IMC_Unit;
-
-
/* Functions */
/* Globals */
typedef struct _emittert {
int (*open)(PARROT_INTERP, void *param);
- int (*emit)(PARROT_INTERP, void *param, const struct _IMC_Unit *, const Instruction *ins);
- int (*new_sub)(PARROT_INTERP, void *param, struct _IMC_Unit *);
- int (*end_sub)(PARROT_INTERP, void *param, struct _IMC_Unit *);
+ int (*emit)(PARROT_INTERP, void *param, const IMC_Unit *, const Instruction *ins);
+ int (*new_sub)(PARROT_INTERP, void *param, IMC_Unit *);
+ int (*end_sub)(PARROT_INTERP, void *param, IMC_Unit *);
int (*close)(PARROT_INTERP, void *param);
} Emitter;
Modified: branches/pluggable_runcore/compilers/imcc/optimizer.c
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/optimizer.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/optimizer.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -1501,14 +1501,12 @@
}
}
- /* Unreachable instructions */
+ /* Unreachable instructions */
for (last = unit->instructions, ins = last->next;
last && ins;
ins = ins->next) {
- if (!last && !ins)
- break;
if ((last->type & IF_goto) && !(ins->type & ITLABEL) &&
STREQ(last->opname, "branch")) {
Modified: branches/pluggable_runcore/compilers/imcc/parser.h
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/parser.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/parser.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -14,9 +14,6 @@
#include "imcparser.h"
-/* short ranged globals for lexer state */
-extern int pesky_global__is_def;
-
#define KEY_BIT(argnum) (1 << (argnum))
/* An opaque pointer. */
Modified: branches/pluggable_runcore/compilers/imcc/parser_util.c
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/parser_util.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/parser_util.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -555,9 +555,7 @@
|| STREQ(name, "returncc"))
ins->type |= IF_goto;
else if (STREQ(fullname, "jump_i")
- || STREQ(fullname, "jsr_i")
- || STREQ(fullname, "branch_i")
- || STREQ(fullname, "bsr_i"))
+ || STREQ(fullname, "branch_i"))
IMCC_INFO(interp)->dont_optimize = 1;
}
else if (STREQ(name, "set") && n == 2) {
Modified: branches/pluggable_runcore/compilers/imcc/pbc.c
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/pbc.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/pbc.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -183,11 +183,6 @@
static int old_blocks(PARROT_INTERP)
__attribute__nonnull__(1);
-PARROT_CONST_FUNCTION
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static const char * slice_deb(int bits);
-
static void store_fixup(PARROT_INTERP,
ARGIN(const SymReg *r),
int pc,
@@ -277,7 +272,6 @@
|| PARROT_ASSERT_ARG(r)
#define ASSERT_ARGS_old_blocks __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_slice_deb __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
#define ASSERT_ARGS_store_fixup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(r)
@@ -673,7 +667,10 @@
fixup->type |= VT_ENCODED;
if (r->usage & U_SUBID_LOOKUP)
- fixup->usage = U_SUBID_LOOKUP;
+ fixup->usage = U_SUBID_LOOKUP;
+
+ if (r->usage & U_LEXICAL)
+ fixup->usage |= U_LEXICAL;
/* set_p_pc = 2 */
fixup->color = pc;
@@ -867,7 +864,9 @@
subs_t *s1;
/* check in matching namespace */
- if (fixup->usage & U_SUBID_LOOKUP) {
+ if (fixup->usage & U_LEXICAL)
+ s1 = NULL;
+ else if (fixup->usage & U_SUBID_LOOKUP) {
subid_lookup = 1;
/* s1 = find_sub_by_subid(interp, fixup->name, &pc); */
s1 = find_sub_by_subid(interp, fixup->name, s, &pc);
@@ -1583,42 +1582,6 @@
/*
-=item C<static const char * slice_deb(int bits)>
-
-Returns debugging information for the indicated slice type.
-
-=cut
-
-*/
-
-PARROT_CONST_FUNCTION
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static const char *
-slice_deb(int bits)
-{
- ASSERT_ARGS(slice_deb)
- if ((bits & VT_SLICE_BITS) == (VT_START_SLICE|VT_END_SLICE))
- return "start+end";
-
- if ((bits & VT_SLICE_BITS) == (VT_START_ZERO|VT_END_SLICE))
- return "..end";
-
- if ((bits & VT_SLICE_BITS) == (VT_START_SLICE|VT_END_INF))
- return "start..";
-
- if (bits & VT_START_SLICE)
- return "start";
-
- if (bits & VT_END_SLICE)
- return "end";
-
- return "";
-}
-
-
-/*
-
=item C<static opcode_t build_key(PARROT_INTERP, SymReg *key_reg)>
Builds a Key PMC from the given SymReg.
@@ -1655,7 +1618,7 @@
for (key_length = 0; reg ; reg = reg->nextkey, key_length++) {
SymReg *r = reg;
- int var_type, slice_bits, type;
+ int type;
if ((pc - key - 2) >= KEYLEN)
IMCC_fatal(interp, 1, "build_key:"
@@ -1667,17 +1630,14 @@
if (r->reg)
r = r->reg;
- var_type = type & ~VT_SLICE_BITS;
- slice_bits = type & VT_SLICE_BITS;
-
- switch (var_type) {
+ switch (type) {
case VTIDENTIFIER: /* P[S0] */
case VTPASM: /* P[S0] */
case VTREG: /* P[S0] */
if (r->set == 'I')
- *pc++ = PARROT_ARG_I | slice_bits; /* register type */
+ *pc++ = PARROT_ARG_I; /* register type */
else if (r->set == 'S')
- *pc++ = PARROT_ARG_S | slice_bits;
+ *pc++ = PARROT_ARG_S;
else
IMCC_fatal(interp, 1, "build_key: wrong register set\n");
@@ -1690,9 +1650,8 @@
sprintf(s+strlen(s), "%c%d", r->set, (int)r->color);
IMCC_debug(interp, DEBUG_PBC_CONST,
- " keypart reg %s %c%d slice %s\n",
- r->name, r->set, (int)r->color,
- slice_deb(slice_bits));
+ " keypart reg %s %c%d\n",
+ r->name, r->set, (int)r->color);
break;
case VT_CONSTP:
case VTCONST:
@@ -1700,27 +1659,25 @@
switch (r->set) {
case 'S': /* P["key"] */
/* str constant */
- *pc++ = PARROT_ARG_SC | slice_bits;
+ *pc++ = PARROT_ARG_SC;
/* constant idx */
*pc++ = r->color;
IMCC_debug(interp, DEBUG_PBC_CONST,
- " keypart SC %s #%d slice %s\n",
- r->name, r->color,
- slice_deb(slice_bits));
+ " keypart SC %s #%d\n",
+ r->name, r->color);
break;
case 'I': /* P[;42;..] */
/* int constant */
- *pc++ = PARROT_ARG_IC | slice_bits;
+ *pc++ = PARROT_ARG_IC;
/* value */
*pc++ = r->color = atol(r->name);
IMCC_debug(interp, DEBUG_PBC_CONST,
- " keypart IC %s #%d slice %s\n",
- r->name, r->color,
- slice_deb(slice_bits));
+ " keypart IC %s #%d\n",
+ r->name, r->color);
break;
default:
IMCC_fatal(interp, 1, "build_key: unknown set\n");
@@ -1729,7 +1686,7 @@
break;
default:
IMCC_fatal(interp, 1, "build_key: "
- "unknown type 0x%x on %s\n", var_type, r->name);
+ "unknown type 0x%x on %s\n", type, r->name);
}
}
@@ -2226,7 +2183,7 @@
/* Create segment. "_ANN" is added to the name */
const size_t len = strlen(interp->code->base.name) + 5;
char * const name = (char *) mem_sys_allocate(len);
- int add = interp->code && interp->code->base.dir;
+ int add = interp->code->base.dir ? 1 : 0;
PackFile_Directory * const dir = add ? interp->code->base.dir :
&interp->initial_pf->directory;
strcpy(name, interp->code->base.name);
Modified: branches/pluggable_runcore/compilers/imcc/pcc.c
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/pcc.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/pcc.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -783,7 +783,7 @@
/* insert set_p_pc with the sub as constant */
the_sub->set = 'p';
- the_sub->usage = U_FIXUP;
+ the_sub->usage |= U_FIXUP;
the_sub->type &= ~VTADDRESS;
the_sub->type |= VTCONST; /* preserve VT_ENCODED */
regs[0] = reg;
Modified: branches/pluggable_runcore/compilers/imcc/symreg.c
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/symreg.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/symreg.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -29,10 +29,6 @@
#include "imc.h"
-/* Globals: */
-
-static Namespace * pesky_global__namespace;
-
/* Code: */
/* HEADERIZER HFILE: compilers/imcc/symreg.h */
@@ -140,14 +136,14 @@
*/
void
-push_namespace(SHIM_INTERP, ARGIN(const char *name))
+push_namespace(PARROT_INTERP, ARGIN(const char *name))
{
ASSERT_ARGS(push_namespace)
Namespace * const ns = mem_allocate_zeroed_typed(Namespace);
- ns->parent = pesky_global__namespace;
+ ns->parent = IMCC_INFO(interp)->namespace_stack;
ns->name = mem_sys_strdup(name);
- pesky_global__namespace = ns;
+ IMCC_INFO(interp)->namespace_stack = ns;
}
@@ -166,7 +162,7 @@
pop_namespace(PARROT_INTERP, ARGIN(const char *name))
{
ASSERT_ARGS(pop_namespace)
- Namespace * const ns = pesky_global__namespace;
+ Namespace * const ns = IMCC_INFO(interp)->namespace_stack;
if (!ns)
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "pop() on empty namespace stack\n");
@@ -181,7 +177,7 @@
mem_sys_free(ident);
}
- pesky_global__namespace = ns->parent;
+ IMCC_INFO(interp)->namespace_stack = ns->parent;
mem_sys_free(ns);
}
@@ -640,23 +636,22 @@
mk_ident(PARROT_INTERP, ARGIN(const char *name), int t)
{
ASSERT_ARGS(mk_ident)
- char * const fullname = _mk_fullname(pesky_global__namespace, name);
+ char * const fullname = _mk_fullname(IMCC_INFO(interp)->namespace_stack, name);
SymReg *r = get_sym_by_name(&(IMCC_INFO(interp)->last_unit->hash), name);
- if (r && r->set != t) {
- IMCC_print_inc(interp);
- IMCC_warning(interp, "Duplicated IDENTIFIER '%s'\n", fullname);
- }
+ if (r && r->set != t)
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+ "syntax error, duplicated IDENTIFIER '%s'\n", fullname);
r = mk_symreg(interp, fullname, t);
r->type = VTIDENTIFIER;
- if (pesky_global__namespace) {
+ if (IMCC_INFO(interp)->namespace_stack) {
Identifier * const ident = mem_allocate_zeroed_typed(Identifier);
ident->name = fullname;
- ident->next = pesky_global__namespace->idents;
- pesky_global__namespace->idents = ident;
+ ident->next = IMCC_INFO(interp)->namespace_stack->idents;
+ IMCC_INFO(interp)->namespace_stack->idents = ident;
}
else
mem_sys_free(fullname);
@@ -736,8 +731,8 @@
switch (rhs->pmc_type) {
case enum_class_Sub:
case enum_class_Coroutine:
- r[1] = rhs;
- rhs->usage = U_FIXUP;
+ r[1] = rhs;
+ rhs->usage |= U_FIXUP;
INS(interp, unit, "set_p_pc", "", r, 2, 0, 1);
return NULL;
default:
@@ -977,10 +972,19 @@
SymReg *r;
if (uniq == U_add_all) {
+ int is_lexical = 0;
+ r = get_sym_by_name(&IMCC_INFO(interp)->ghash, name);
+
+ if (r && r->usage & U_LEXICAL)
+ is_lexical = 1;
+
r = mem_allocate_zeroed_typed(SymReg);
r->type = VTADDRESS;
r->name = mem_sys_strdup(name);
_store_symreg(hsh, r);
+
+ if (is_lexical)
+ r->usage |= U_LEXICAL;
}
else {
/* Aux var to avoid the need of const casts */
@@ -1191,7 +1195,6 @@
SymReg *key;
SymReg *keychain;
int i;
- int any_slice = 0;
size_t len = 0;
/* namespace keys are global consts - no cur_unit */
@@ -1203,7 +1206,7 @@
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "link_keys: huh? no keys\n");
/* short-circuit simple key unless we've been told not to */
- if (nargs == 1 && !force && !(keys[0]->type & VT_SLICE_BITS))
+ if (nargs == 1 && !force)
return keys[0];
/* calc len of key_str
@@ -1211,13 +1214,8 @@
* have the slice flag set */
for (i = 0; i < nargs; i++) {
len += 1 + strlen(keys[i]->name);
- if (keys[i]->type & VT_SLICE_BITS)
- any_slice = 1;
}
- if (any_slice && !(keys[0]->type & VT_SLICE_BITS))
- keys[0]->type |= (VT_START_SLICE|VT_END_SLICE);
-
key_str = (char *)mem_sys_allocate(len);
*key_str = '\0';
@@ -1229,7 +1227,7 @@
strcat(key_str, ";");
}
- if (!any_slice && ((keychain = _get_sym(h, key_str)) != NULL)) {
+ if ((keychain = _get_sym(h, key_str)) != NULL) {
mem_sys_free(key_str);
return keychain;
}
@@ -1552,7 +1550,7 @@
{
ASSERT_ARGS(find_sym)
if (IMCC_INFO(interp)->cur_unit)
- return _find_sym(interp, pesky_global__namespace,
+ return _find_sym(interp, IMCC_INFO(interp)->namespace_stack,
&IMCC_INFO(interp)->cur_unit->hash, name);
return NULL;
Modified: branches/pluggable_runcore/compilers/imcc/symreg.h
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/symreg.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/symreg.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -21,11 +21,6 @@
VT_FLAT = VARTYPE_BIT(8), /* var :flat */
VT_OPTIONAL = VARTYPE_BIT(9), /* var :optional */
/* include/parrot/packfile.h */
- VT_START_SLICE = PF_VT_START_SLICE, /* x .. y slice range */
- VT_END_SLICE = PF_VT_END_SLICE,
- VT_START_ZERO = PF_VT_START_ZERO, /* .. y 0..start */
- VT_END_INF = PF_VT_END_INF, /* x.. start..inf */
- VT_SLICE_BITS = PF_VT_SLICE_BITS,
VT_ENCODED = VARTYPE_BIT(16), /* unicode string constant */
VT_OPT_FLAG = VARTYPE_BIT(17), /* var :opt_flag */
VT_NAMED = VARTYPE_BIT(18), /* var :named(name) */
@@ -108,8 +103,6 @@
Identifier *idents;
};
-struct _IMC_Unit;
-
/* functions */
/* HEADERIZER BEGIN: compilers/imcc/symreg.c */
@@ -317,7 +310,8 @@
__attribute__nonnull__(1)
__attribute__nonnull__(2);
-void push_namespace(SHIM_INTERP, ARGIN(const char *name))
+void push_namespace(PARROT_INTERP, ARGIN(const char *name))
+ __attribute__nonnull__(1)
__attribute__nonnull__(2);
void store_symreg(PARROT_INTERP, ARGMOD(SymReg *r))
@@ -429,7 +423,8 @@
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(name)
#define ASSERT_ARGS_push_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(name)
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(name)
#define ASSERT_ARGS_store_symreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(r)
Modified: branches/pluggable_runcore/compilers/imcc/unit.h
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/unit.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/imcc/unit.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -32,7 +32,7 @@
int used_once;
} ;
-struct _IMC_Unit {
+struct IMC_Unit {
INTVAL type;
Instruction *instructions;
Instruction *last_ins;
@@ -52,8 +52,8 @@
SymReg **reglist;
unsigned int n_symbols;
int max_color;
- struct _IMC_Unit *prev;
- struct _IMC_Unit *next;
+ IMC_Unit *prev;
+ IMC_Unit *next;
SymReg *_namespace;
int owns_namespace; /* should this unit free *_namespace */
Modified: branches/pluggable_runcore/compilers/json/JSON/pge2pir.tg
==============================================================================
--- branches/pluggable_runcore/compilers/json/JSON/pge2pir.tg Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/json/JSON/pge2pir.tg Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,7 +3,7 @@
transform result (ROOT) {
.local pmc pir
.local string result
-
+
$S0 = tree.'get'('pir', node, 'value')
pir = new 'CodeString'
@@ -14,7 +14,7 @@
pir.'emit'('.end')
.return(pir)
-}
+}
transform pir (value) {
@@ -25,7 +25,7 @@
type = 'string'
sub_node = node[type]
unless null sub_node goto got_type
-
+
type = 'number'
sub_node = node[type]
unless null sub_node goto got_type
@@ -84,7 +84,7 @@
.local string result, child_result, key_result
result = pir.'unique'('$P')
pir.'emit'(" %0 = new 'Hash'", result)
-
+
.local pmc items
items = node['members']
@@ -96,23 +96,23 @@
keys = items['string']
items = items['value']
- .local pmc iter, key_iter, child, key
- key_iter = new 'Iterator', keys
- iter = new 'Iterator', items
+ .local pmc it, key_iter, child, key
+ key_iter = iter keys
+ it = iter items
# the two iters should be in lockstep as a result of the PGE grammar
loop:
- unless iter goto end
- child = shift iter
+ unless it goto end
+ child = shift it
$P0 = tree.'get'('pir', child, 'value')
$S0 = $P0
- pir .= $S0
+ pir .= $S0
child_result = child['ret']
key = shift key_iter
$P0 = tree.'get'('pir', key, 'string')
$S0 = $P0
- pir .= $S0
+ pir .= $S0
key_result = key['ret']
pir.'emit'(' %0[%1] = %2', result, key_result, child_result)
@@ -122,7 +122,7 @@
end:
node['ret'] = result
- .return (pir)
+ .return (pir)
}
transform pir (array) {
@@ -131,7 +131,7 @@
.local string result, child_result
result = pir.'unique'('$P')
pir.'emit'(" %0 = new 'ResizablePMCArray'", result)
-
+
.local pmc items
@@ -140,14 +140,14 @@
items = items['value']
- .local pmc iter, child
- iter = new 'Iterator', items
+ .local pmc it, child
+ it = iter items
loop:
- unless iter goto end
- child = shift iter
+ unless it goto end
+ child = shift it
$P0 = tree.'get'('pir', child, 'value')
$S0 = $P0
- pir .= $S0
+ pir .= $S0
child_result = child['ret']
pir.'emit'(' push %0, %1', result, child_result)
@@ -155,20 +155,20 @@
end:
node['ret'] = result
- .return (pir)
+ .return (pir)
}
transform pir (string) {
- .local pmc pir, result, children, iter, child
+ .local pmc pir, result, children, it, child
.local string tmp
tmp = ''
pir = new 'CodeString'
children = node['char']
if null children goto loop_end
- iter = new 'Iterator', children
+ it = iter children
loop:
push_eh loop_end
- child = shift iter
+ child = shift it
pop_eh
unless child goto loop_end
$S0 = child
@@ -180,7 +180,7 @@
$S1 = substr $S0, 2, 4
$P1 = $S1
$I0 = $P1.'to_int'(16)
- $S0 = chr $I0
+ $S0 = chr $I0
goto char
escape:
$P0 = get_root_global [ 'JSON' ], '$escapes'
Modified: branches/pluggable_runcore/compilers/ncigen/NCIGENP6.pm
==============================================================================
--- branches/pluggable_runcore/compilers/ncigen/NCIGENP6.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/ncigen/NCIGENP6.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -4,6 +4,8 @@
# Copyright (C) 2008, Parrot Foundation.
use v6;
+class NCIGENAST::FuncDecl {
+}
evalfile('./ncigen.pbc', lang => 'Parrot');
@@ -12,9 +14,9 @@
run("gcc -x c -E $fn > $pp_fn");
my $compiler = compreg('NCIGEN');
- my $ast = $compiler.parse(slurp($pp_fn));
+ my $match = $compiler.parse(slurp($pp_fn));
unlink $pp_fn;
- $ast.item();
+ $match.ast;
}
sub compreg {
Modified: branches/pluggable_runcore/compilers/ncigen/src/NCIPIR.pir
==============================================================================
--- branches/pluggable_runcore/compilers/ncigen/src/NCIPIR.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/ncigen/src/NCIPIR.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -134,14 +134,14 @@
.sub 'pir_children' :method
.param pmc node
- .local pmc code, iter
+ .local pmc code, it
code = new 'CodeString'
- iter = new 'Iterator', node
+ it = iter node
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local string key
.local pmc cast
- key = shift iter
+ key = shift it
cast = node[key]
$P0 = self.'pir'(cast)
code .= $P0
Modified: branches/pluggable_runcore/compilers/ncigen/src/builtins/say.pir
==============================================================================
--- branches/pluggable_runcore/compilers/ncigen/src/builtins/say.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/ncigen/src/builtins/say.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -11,11 +11,11 @@
.sub 'say'
.param pmc args :slurpy
- .local pmc iter
- iter = new 'Iterator', args
+ .local pmc it
+ it = iter args
iter_loop:
- unless iter goto iter_end
- $P0 = shift iter
+ unless it goto iter_end
+ $P0 = shift it
print $P0
goto iter_loop
iter_end:
@@ -26,10 +26,12 @@
.sub 'printf'
.param pmc format
.param pmc args :slurpy
- .local pmc iter
- iter = new 'Iterator', args
+ .local pmc it
+ it = iter args
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
+ $P0 = shift it
+ print $P0
goto iter_loop
iter_end:
.end
Modified: branches/pluggable_runcore/compilers/ncigen/src/parser/actions.pm
==============================================================================
--- branches/pluggable_runcore/compilers/ncigen/src/parser/actions.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/ncigen/src/parser/actions.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -44,20 +44,20 @@
}
method declaration($/) {
- my $ast := NCIGENAST::VarDecl.new( :node($/) );
+ my $ast := NCIGENAST::VarDecl.new() ;
my $type := "";
- #say("=================================================================================================");
- #_dumper($/);
+# say("=================================================================================================");
+# _dumper($/);
# make $decls;
# return 1;
my $decl_specs := $<declaration_specifiers><repeatable_declaration_specifiers>;
if typedef($decl_specs) {
- $ast := NCIGENAST::TypeDef.new( :node($/) );
+ $ast := NCIGENAST::TypeDef.new( );
$type := "TypeDef";
}
elsif $/<init_declarator><init_declarator><declarator><direct_declarator><declarator_suffix><declarator_suffix><parameter_type_list> {
- $ast := NCIGENAST::FuncDecl.new( :node($/) );
+ $ast := NCIGENAST::FuncDecl.new( );
$type := "FuncDecl";
}
# elsif $<declaration_specifiers><type_specifier><type> {
@@ -65,7 +65,7 @@
# $type := "Struct";
# }
else {
- $ast := NCIGENAST::VarDecl.new( :node($/) );
+ $ast := NCIGENAST::VarDecl.new( );
$type := "VarDecl";
}
parse_decl_specs( $<declaration_specifiers><repeatable_declaration_specifiers>, $ast );
@@ -81,7 +81,7 @@
#assert(+$<init_declarator><declarator><direct_declarator><declarator_suffix> == 1);
my $params := $<init_declarator><declarator><declarator><direct_declarator><declarator_suffix><parameter_type_list><parameter_type_list><parameter_list><parameter_declaration>;
for $params {
- my $param := NCIGENAST::Param.new( :node( $_ ) );
+ my $param := NCIGENAST::Param.new( );
settype($_<declaration_specifiers><type_specifier>, $param);
my $param_ident := $_<declarator>;
@@ -183,12 +183,12 @@
if $struct_or_union {
my $ident := $<struct_or_union_specifier><identifier><identifier>;
if $ident {
- $ident := strip_spaces($ident.text());
+ $ident := strip_spaces(~$ident);
}
else {
$ident := $<struct_or_union_specifier><identifier>;
if $ident {
- $ident := strip_spaces($ident.text());
+ $ident := strip_spaces(~$ident);
}
else {
$ident := "anonymous_" ~~ $struct_or_union~~ "1";
@@ -199,10 +199,10 @@
if $s_or_u {
my $su;
if ($struct_or_union eq "struct" ) {
- $su := NCIGENAST::Struct.new( :node($/) );
+ $su := NCIGENAST::Struct.new( );
}
else {
- $su := NCIGENAST::Union.new( :node($/) );
+ $su := NCIGENAST::Union.new( );
}
$su.name($ident);
build_struct_or_union($s_or_u, $su);
@@ -227,12 +227,12 @@
sub build_struct_or_union($/, $ast) {
for $/ {
- my $smt := NCIGENAST::VarDecl.new( :node($_) );
+ my $smt := NCIGENAST::VarDecl.new( );
settype( $_<specifier_qualifier_list><type_specifier>, $smt );
for $_<struct_declarator_list> {
my $sm := $smt.clone();
my $declarator := $_<struct_declarator><declarator>;
- $sm.name(strip_spaces($declarator.text()));
+ $sm.name(strip_spaces(~$declarator));
ispointer($declarator, $sm);
$ast.push($sm);
}
Modified: branches/pluggable_runcore/compilers/nqp/src/Grammar/Actions.pir
==============================================================================
--- branches/pluggable_runcore/compilers/nqp/src/Grammar/Actions.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/nqp/src/Grammar/Actions.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -103,11 +103,11 @@
past = $P0.'new'('node'=>match)
$P1 = match['statement']
if null $P1 goto iter_end
- .local pmc iter
- iter = new 'Iterator', $P1
+ .local pmc it
+ it = iter $P1
iter_loop:
- unless iter goto iter_end
- $P2 = shift iter
+ unless it goto iter_end
+ $P2 = shift it
$P2 = $P2.'ast'()
past.'push'($P2)
goto iter_loop
@@ -152,10 +152,12 @@
.param pmc match
.local pmc expr, block, past
.local int cond
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
cond = match['EXPR']
cond -= 1
- bsr get_expr
- bsr get_block
+ local_branch jmpstack, get_expr
+ local_branch jmpstack, get_block
$P2 = get_hll_global ['PAST'], 'Op'
past = $P2.'new'(expr, block, 'pasttype'=>'if', 'node'=>match)
@@ -169,8 +171,8 @@
while:
unless cond != 0 goto end_while
cond -= 1
- bsr get_expr
- bsr get_block
+ local_branch jmpstack, get_expr
+ local_branch jmpstack, get_block
past = $P2.'new'(expr, block, past, 'pasttype'=>'if', 'node'=>match)
goto while
@@ -181,12 +183,12 @@
expr = match['EXPR']
expr = expr[cond]
expr = expr.'ast'()
- ret
+ local_return jmpstack
get_block:
block = match['block']
block = block[cond]
block = block.'ast'()
- ret
+ local_return jmpstack
end:
match.'!make'(past)
.end
@@ -411,11 +413,11 @@
$P0 = $P0[0]
if null $P0 goto param_end
unless $P0 goto param_end
- .local pmc iter
- iter = new 'Iterator', $P0
+ .local pmc it
+ it = iter $P0
param_loop:
- unless iter goto param_end
- $P1 = shift iter
+ unless it goto param_end
+ $P1 = shift it
.local pmc parameter
$P2 = $P1['parameter']
parameter = $P2.'ast'()
@@ -517,11 +519,11 @@
past = $P0.'ast'()
$P1 = match['postfix']
if null $P1 goto end
- .local pmc iter, term
- iter = new 'Iterator', $P1
+ .local pmc it, term
+ it = iter $P1
iter_loop:
- unless iter goto end
- $P2 = shift iter
+ unless it goto end
+ $P2 = shift it
term = past
past = $P2.'ast'()
past.'unshift'(term)
@@ -1038,11 +1040,11 @@
past = $P0.'new'('node'=>match, 'name'=>name, 'opattr'=>opattr)
$P1 = match.'list'()
if null $P1 goto iter_end
- .local pmc iter
- iter = new 'Iterator', $P1
+ .local pmc it
+ it = iter $P1
iter_loop:
- unless iter goto iter_end
- $P2 = shift iter
+ unless it goto iter_end
+ $P2 = shift it
$I0 = $P2.'from'()
$I1 = $P2.'to'()
if $I0 == $I1 goto iter_loop
Modified: branches/pluggable_runcore/compilers/nqp/src/builtins.pir
==============================================================================
--- branches/pluggable_runcore/compilers/nqp/src/builtins.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/nqp/src/builtins.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -13,12 +13,12 @@
.sub 'print'
.param pmc list :slurpy
- .local pmc iter
+ .local pmc it
- iter = new 'Iterator', list
+ it = iter list
iter_loop:
- unless iter goto iter_end
- $P0 = shift iter
+ unless it goto iter_end
+ $P0 = shift it
print $P0
goto iter_loop
iter_end:
Modified: branches/pluggable_runcore/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- branches/pluggable_runcore/compilers/pct/src/PAST/Compiler.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pct/src/PAST/Compiler.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -664,7 +664,7 @@
.local string rtype
rtype = options['rtype']
- .local pmc iter, node, ops, pops, tail, skip
+ .local pmc it, node, ops, pops, tail, skip
$P0 = get_hll_global ['POST'], 'Ops'
ops = $P0.'new'('node'=>node)
$P0 = get_hll_global ['POST'], 'Ops'
@@ -675,10 +675,10 @@
$S0 = self.'unique'('skip_handler_')
skip = $P0.'new'('result'=>$S0)
- iter = new 'Iterator', ehs
+ it = iter ehs
handler_loop:
- unless iter, handler_loop_done
- node = shift iter
+ unless it, handler_loop_done
+ node = shift it
.local pmc ehpir, types, label
.local string ehreg, type
@@ -826,14 +826,14 @@
## merge the Block's symtable with outersym
symtable = clone symtable
symtable_merge:
- .local pmc iter
- iter = new 'Iterator', outersym
+ .local pmc it
+ it = iter outersym
symtable_merge_loop:
- unless iter goto have_symtable
- $S0 = shift iter
+ unless it goto have_symtable
+ $S0 = shift it
$I0 = exists symtable[$S0]
if $I0 goto symtable_merge_loop
- $P0 = iter[$S0]
+ $P0 = it[$S0]
symtable[$S0] = $P0
goto symtable_merge_loop
have_symtable:
@@ -1187,11 +1187,13 @@
exprpost = self.'as_post'(exprpast, 'rtype'=>exprrtype)
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
childpast = thenpast
- bsr make_childpost
+ local_branch jmpstack, make_childpost
thenpost = childpost
childpast = elsepast
- bsr make_childpost
+ local_branch jmpstack, make_childpost
elsepost = childpost
if null elsepost goto no_elsepost
@@ -1241,7 +1243,7 @@
unless result goto ret_childpost
childpost = self.'coerce'(childpost, result)
ret_childpost:
- ret
+ local_return jmpstack
.end
.sub 'unless' :method :multi(_, ['PAST';'Op'])
@@ -1499,14 +1501,14 @@
returns = box 'ResizablePMCArray'
have_returns:
- .local pmc listpost, iter
+ .local pmc listpost, it
listpost = self.'as_vivipost'(returns, 'rtype'=>'P')
ops.'result'(listpost)
ops.'push'(listpost)
- iter = new 'Iterator', posargs
+ it = iter posargs
iter_loop:
- unless iter goto iter_end
- $S0 = shift iter
+ unless it goto iter_end
+ $S0 = shift it
ops.'push_pirop'('push', listpost, $S0)
goto iter_loop
iter_end:
Modified: branches/pluggable_runcore/compilers/pct/src/PAST/Node.pir
==============================================================================
--- branches/pluggable_runcore/compilers/pct/src/PAST/Node.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pct/src/PAST/Node.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -430,7 +430,7 @@
.param pmc hash
$P0 = split ' ', "pasttype pirop inline lvalue"
- $P1 = new 'Iterator', $P0
+ $P1 = iter $P0
iter_loop:
unless $P1 goto iter_end
$S0 = shift $P1
Modified: branches/pluggable_runcore/compilers/pct/src/PCT/HLLCompiler.pir
==============================================================================
--- branches/pluggable_runcore/compilers/pct/src/PCT/HLLCompiler.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pct/src/PCT/HLLCompiler.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -41,11 +41,11 @@
Options:
USAGE
- .local pmc iter
- iter = new 'Iterator', $P0
+ .local pmc it
+ it = iter $P0
options_loop:
- unless iter goto options_end
- $P3 = shift iter
+ unless it goto options_end
+ $P3 = shift it
$P1 .= " "
$P1 .= $P3
$P1 .= "\n"
@@ -193,15 +193,15 @@
.sub 'removestage' :method
.param string stagename
- .local pmc stages, iter, newstages
+ .local pmc stages, it, newstages
stages = getattribute self, '@stages'
newstages = new 'ResizableStringArray'
- iter = new 'Iterator', stages
+ it = iter stages
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local pmc current
- current = shift iter
+ current = shift it
if current == stagename goto iter_loop
push newstages, current
goto iter_loop
@@ -245,14 +245,14 @@
target = adverbs['after']
positional_insert:
- .local pmc iter, newstages
+ .local pmc it, newstages
newstages = new 'ResizableStringArray'
- iter = new 'Iterator', stages
+ it = iter stages
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local pmc current
- current = shift iter
+ current = shift it
unless current == target goto no_insert_before
unless position == 'before' goto no_insert_before
push newstages, stagename
@@ -293,14 +293,14 @@
target = adverbs['target']
target = downcase target
- .local pmc stages, result, iter
+ .local pmc stages, result, it
result = source
stages = getattribute self, '@stages'
- iter = new 'Iterator', stages
+ it = iter stages
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local string stagename
- stagename = shift iter
+ stagename = shift it
result = self.stagename(result, adverbs :flat :named)
if target == stagename goto have_result
goto iter_loop
@@ -690,13 +690,13 @@
have_files_array:
.local string code
code = ''
- .local pmc iter
- iter = new 'Iterator', files
+ .local pmc it
+ it = iter files
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local string iname
.local pmc ifh
- iname = shift iter
+ iname = shift it
ifh = new 'FileHandle'
unless encoding == 'utf8' goto iter_loop_1
ifh.'encoding'(encoding)
@@ -738,11 +738,11 @@
getopts = new 'Getopt::Obj'
getopts.'notOptStop'(1)
$P0 = getattribute self, '@cmdoptions'
- .local pmc iter
- iter = new 'Iterator', $P0
+ .local pmc it
+ it = iter $P0
getopts_loop:
- unless iter goto getopts_end
- $S0 = shift iter
+ unless it goto getopts_end
+ $S0 = shift it
push getopts, $S0
goto getopts_loop
getopts_end:
@@ -783,11 +783,11 @@
opts = self.'process_args'(args)
## merge command-line args with defaults passed in from caller
- .local pmc iter
- iter = new 'Iterator', opts
+ .local pmc it
+ it = iter opts
mergeopts_loop:
- unless iter goto mergeopts_end
- $S0 = shift iter
+ unless it goto mergeopts_end
+ $S0 = shift it
$P0 = opts[$S0]
adverbs[$S0] = $P0
goto mergeopts_loop
Modified: branches/pluggable_runcore/compilers/pct/src/PCT/Node.pir
==============================================================================
--- branches/pluggable_runcore/compilers/pct/src/PCT/Node.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pct/src/PCT/Node.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -57,20 +57,20 @@
.param pmc children :slurpy
.param pmc adverbs :slurpy :named
- .local pmc iter
- iter = new 'Iterator', children
+ .local pmc it
+ it = iter children
children_loop:
- unless iter goto children_end
- $P0 = shift iter
+ unless it goto children_end
+ $P0 = shift it
push self, $P0
goto children_loop
children_end:
- iter = new 'Iterator', adverbs
+ it = iter adverbs
adverbs_loop:
- unless iter goto adverbs_end
- $S0 = shift iter
- $P0 = iter[$S0]
+ unless it goto adverbs_end
+ $S0 = shift it
+ $P0 = it[$S0]
$P1 = find_method self, $S0
self.$P1($P0)
goto adverbs_loop
@@ -180,11 +180,10 @@
=cut
.sub 'iterator' :method
- .local pmc iter
+ .local pmc it
$P0 = self.'list'()
- iter = new 'Iterator', $P0
- iter = 0
- .return (iter)
+ it = iter $P0
+ .return (it)
.end
Modified: branches/pluggable_runcore/compilers/pct/src/POST/Compiler.pir
==============================================================================
--- branches/pluggable_runcore/compilers/pct/src/POST/Compiler.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pct/src/POST/Compiler.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -293,11 +293,11 @@
.local pmc paramlist
paramlist = node['paramlist']
if null paramlist goto paramlist_done
- .local pmc iter
- iter = new 'Iterator', paramlist
+ .local pmc it
+ it = iter paramlist
param_loop:
- unless iter goto paramlist_done
- $P0 = shift iter
+ unless it goto paramlist_done
+ $P0 = shift it
if null $P0 goto param_loop
subpir .= $P0
goto param_loop
Modified: branches/pluggable_runcore/compilers/pge/PGE/Exp.pir
==============================================================================
--- branches/pluggable_runcore/compilers/pge/PGE/Exp.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pge/PGE/Exp.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -443,15 +443,15 @@
.param string label
.param string next
- .local pmc iter, exp
+ .local pmc it, exp
code.'emit'(' %0: # concat', label)
$P0 = self.'list'()
- iter = new 'Iterator', $P0
- exp = shift iter
+ it = iter $P0
+ exp = shift it
$S0 = code.'unique'('R')
iter_loop:
- unless iter goto iter_end
- $P1 = shift iter
+ unless it goto iter_end
+ $P1 = shift it
$S1 = code.'unique'('R')
exp.'pir'(code, $S0, $S1)
exp = $P1
@@ -862,7 +862,7 @@
%L_1:
$P0 = find_name '%0'
unless null $P0 goto %L_2
- say "Unable to find regex '%0'"
+ die "Unable to find regex '%0'"
%L_2:
CODE
Modified: branches/pluggable_runcore/compilers/pge/PGE/Match.pir
==============================================================================
--- branches/pluggable_runcore/compilers/pge/PGE/Match.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pge/PGE/Match.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -278,36 +278,6 @@
.end
-=item C<find_key([ key1, key2, ... ])>
-
-Find the first of C<key1>, C<key2>, etc. in the current
-Match object, and return it. Returns '' if none of
-the specified keys are found. If no keys are specified,
-then simply return the first key found.
-
-=cut
-
-.sub 'find_key' :method
- .param pmc keys :slurpy
- if null keys goto first_key
- unless keys goto first_key
- loop:
- unless keys goto not_found
- $S0 = shift keys
- $I0 = exists self[$S0]
- unless $I0 goto loop
- .return ($S0)
- first_key:
- $P0 = self.'hash'()
- $P1 = new 'Iterator', $P0
- unless $P1 goto not_found
- $S0 = shift $P1
- .return ($S0)
- not_found:
- .return ('')
-.end
-
-
=item C<_failcut(int cutvalue)>
Immediately "fail" this Match object, removing any
Modified: branches/pluggable_runcore/compilers/pge/PGE/OPTable.pir
==============================================================================
--- branches/pluggable_runcore/compilers/pge/PGE/OPTable.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pge/PGE/OPTable.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -52,7 +52,7 @@
.return ()
.end
-=item C<syncat(string name, adverbs :slurpy :named)>
+=item C<sctable(string name, adverbs :slurpy :named)>
Adds (or replaces) a syntactic category's defaults.
@@ -110,7 +110,7 @@
if $I0 goto end
tokentable[name] = token
- $P0 = new 'Iterator', args
+ $P0 = iter args
args_loop:
unless $P0 goto args_end
$S1 = shift $P0
@@ -239,7 +239,7 @@
.local pmc ws
.local string key
.local pmc token, top, oper
- .local pmc iter
+ .local pmc it
.local int tokencat, topcat
.local int circumnest
.local pmc cstack
@@ -367,10 +367,10 @@
if oper goto oper_found
goto key_next
key_array:
- iter = new 'Iterator', token
+ it = iter token
key_array_1:
- unless iter goto key_next
- token = shift iter
+ unless it goto key_next
+ token = shift it
local_branch cstack, token_match
if_null oper, key_array_1
if oper goto oper_found
Modified: branches/pluggable_runcore/compilers/pge/PGE/Perl6Regex.pir
==============================================================================
--- branches/pluggable_runcore/compilers/pge/PGE/Perl6Regex.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pge/PGE/Perl6Regex.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -1667,14 +1667,14 @@
.tailcall exp1.'perl6exp'(pad)
with_lhs:
- .local pmc lexscope, savescope, iter
+ .local pmc lexscope, savescope, it
lexscope = pad['lexscope']
savescope = new 'Hash'
- iter = new 'Iterator', lexscope
+ it = iter lexscope
iter_loop:
- unless iter goto iter_end
- $P1 = shift iter
- $P2 = iter[$P1]
+ unless it goto iter_end
+ $P1 = shift it
+ $P2 = it[$P1]
savescope[$P1] = $P2
goto iter_loop
iter_end:
Modified: branches/pluggable_runcore/compilers/pge/README.pod
==============================================================================
--- branches/pluggable_runcore/compilers/pge/README.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pge/README.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -118,8 +118,7 @@
and reduction phases before being sent to code generation to
produce a PIR subroutine.
-The generated PIR code uses bsr/ret for its internal backtracking
-(optimized for tailcalls) and uses Parrot calling conventions for
+The generated PIR code uses Parrot calling conventions for
all interfaces with external callers/callees such as subrules.
PGE also uses Parrot coroutines for the matching
Modified: branches/pluggable_runcore/compilers/pge/STATUS
==============================================================================
--- branches/pluggable_runcore/compilers/pge/STATUS Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pge/STATUS Fri Aug 14 01:24:23 2009 (r40541)
@@ -13,9 +13,11 @@
* capturing and non-capturing groups
* modifiers :i, :ignorecase, :s, :sigspace (with synonyms :w and :words)
* enumerated character lists (<[abcdef]>, <-[a..f]>)
+* composed character classes (<+alpha-[aeiou]>)
* character classes (., \d, \w, \s, \n, \e, \f, \r, \t, \x[hhh], \o[nnn])
* anchors (^, $, ^^, $$, \b, \b)
* negated character classes
+* \c[...] and \C[...]
* capturing subrules (<expr>)
* non-capturing subrules (<.expr>)
* negated subrules (<!expr>)
@@ -34,7 +36,6 @@
Perl 6 rule features to-do
--------------------------
-* rule composition (<+alpha-[aeiou]>)
* lookbehind according to S05 definition
* <cut> assertion
* versions of <commit> and cuts that release backtracking state
@@ -42,7 +43,6 @@
* literal assertions (<'literal'>)
* interpolated assertions (<"literal">)
* array and hash aliasing (@<foo>:=(...), %<foo>:=(...))
-* \c[...] and \C[...]
* don't generate unneeded internal data structures (e.g., gpad)
Modified: branches/pluggable_runcore/compilers/pirc/src/pir.l
==============================================================================
--- branches/pluggable_runcore/compilers/pirc/src/pir.l Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pirc/src/pir.l Fri Aug 14 01:24:23 2009 (r40541)
@@ -416,6 +416,11 @@
char *str = Parrot_str_to_cstring(lexer->interp, pstr);
yylval->sval = str;
+
+ /* store the STRING in lexer's sval buffer; once PIRC is doing
+ only STRINGs, it can be stored in yylval.sval. */
+ lexer->sval = pstr;
+
return TK_STRINGC;
}
Modified: branches/pluggable_runcore/compilers/pirc/src/pircompiler.h
==============================================================================
--- branches/pluggable_runcore/compilers/pirc/src/pircompiler.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pirc/src/pircompiler.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -146,6 +146,12 @@
annotation *annotations;
unsigned num_annotations;
+
+ /* XXX Temporary STRING pointer, for the conversion of all lexer code to use
+ STRINGs instead of c strings (char pointers). Cannot change yylval union yet,
+ as it's better to have duplicated functionality, then removing the old c strings
+ stuff*/
+ STRING *sval;
} lexer_state;
Modified: branches/pluggable_runcore/compilers/pirc/src/pircompunit.c
==============================================================================
--- branches/pluggable_runcore/compilers/pirc/src/pircompunit.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pirc/src/pircompunit.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -2476,7 +2476,6 @@
case PARROT_OP_end:
case PARROT_OP_returncc:
case PARROT_OP_yield:
- case PARROT_OP_ret:
case PARROT_OP_branch_ic:
case PARROT_OP_exit_ic:
need_epilogue = 0;
Modified: branches/pluggable_runcore/compilers/pirc/src/pirlexer.c
==============================================================================
--- branches/pluggable_runcore/compilers/pirc/src/pirlexer.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/pirc/src/pirlexer.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -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 */
-
- /* 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;
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
- /* 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;
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
-
- int yy_buffer_status;
+ 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 209
@@ -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[825] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1388,16 +1385,16 @@
/* Table of booleans, true if rule could match eol. */
static yyconst flex_int32_t yy_rule_can_match_eol[210] =
{ 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, 1, 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,
+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, 1, 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[209] =
@@ -1414,17 +1411,17 @@
381, 382, 383, 384, 385, 386, 387, 388, 389, 390,
392, 393, 394, 395, 396, 397, 398, 399, 401, 405,
- 422, 427, 456, 504, 505, 506, 507, 509, 514, 526,
- 554, 555, 556, 557, 558, 560, 568, 619, 632, 654,
- 659, 664, 671, 672, 687, 692, 693, 698, 699, 700,
- 702, 718, 772, 800, 805, 810, 811, 812, 813, 818,
- 829, 830, 832, 834, 845, 859, 864, 865, 866, 867,
- 869, 884, 898, 927, 952, 954, 959, 969, 974, 992,
- 998, 1005, 1038, 1040, 1045, 1081, 1082, 1083, 1085, 1086,
- 1087, 1088, 1089, 1090, 1092, 1093, 1094, 1096, 1101, 1106,
- 1107, 1110, 1144, 1149, 1152, 1153, 1154, 1155, 1157, 1162,
+ 427, 432, 461, 509, 510, 511, 512, 514, 519, 531,
+ 559, 560, 561, 562, 563, 565, 573, 624, 637, 659,
+ 664, 669, 676, 677, 692, 697, 698, 703, 704, 705,
+ 707, 723, 777, 805, 810, 815, 816, 817, 818, 823,
+ 834, 835, 837, 839, 850, 864, 869, 870, 871, 872,
+ 874, 889, 903, 932, 957, 959, 964, 974, 979, 997,
+ 1003, 1010, 1043, 1045, 1050, 1086, 1087, 1088, 1090, 1091,
+ 1092, 1093, 1094, 1095, 1097, 1098, 1099, 1101, 1106, 1111,
+ 1112, 1115, 1149, 1154, 1157, 1158, 1159, 1160, 1162, 1167,
- 1163, 1164, 1165, 1166, 1168, 1173, 1175, 1177
+ 1168, 1169, 1170, 1171, 1173, 1178, 1180, 1182
} ;
/* The intent behind this definition is that it'll catch
@@ -1544,7 +1541,7 @@
/* The PASM state is an exclusive state, recognizing ONLY PASM tokens. */
-#line 1548 "pirlexer.c"
+#line 1545 "pirlexer.c"
#define INITIAL 0
#define MACROHEAD 1
@@ -1625,15 +1622,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. */
@@ -1670,6 +1661,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.
@@ -1714,11 +1706,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. */
@@ -1732,7 +1724,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 */
@@ -1744,33 +1736,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 */
@@ -1819,11 +1811,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 */
@@ -1843,7 +1833,7 @@
/* %% [6.0] YY_RULE_SETUP definition goes here */
#define YY_RULE_SETUP \
- YY_USER_ACTION
+ YY_USER_ACTION
/* %not-for-header */
@@ -1851,9 +1841,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 */
@@ -1861,129 +1851,129 @@
-#line 1865 "pirlexer.c"
+#line 1855 "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 >= 825 )
- 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 != 824 );
- 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 >= 825 )
+ 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 != 824 );
+ 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 < 209 )
- fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
- (long)yy_rule_linenum[yy_act], yytext );
- else if ( yy_act == 209 )
- fprintf( stderr, "--accepting default rule (\"%s\")\n",
- yytext );
- else if ( yy_act == 210 )
- 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 < 209 )
+ fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
+ (long)yy_rule_linenum[yy_act], yytext );
+ else if ( yy_act == 209 )
+ fprintf( stderr, "--accepting default rule (\"%s\")\n",
+ yytext );
+ else if ( yy_act == 210 )
+ 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 */
@@ -2010,18 +2000,18 @@
}
}
- YY_BREAK
+ YY_BREAK
case 2:
YY_RULE_SETUP
#line 248 "pir.l"
{ /* ignore whitespace */ }
- YY_BREAK
+ YY_BREAK
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
#line 250 "pir.l"
{ /* ignore line comments */ }
- YY_BREAK
+ YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
@@ -2047,414 +2037,414 @@
yylval->ival = num_newlines;
return TK_NL;
}
- YY_BREAK
+ YY_BREAK
case 5:
YY_RULE_SETUP
#line 274 "pir.l"
{ return TK_ASSIGN_USHIFT; }
- YY_BREAK
+ YY_BREAK
case 6:
YY_RULE_SETUP
#line 275 "pir.l"
{ return TK_USHIFT; }
- YY_BREAK
+ YY_BREAK
case 7:
YY_RULE_SETUP
#line 276 "pir.l"
{ return TK_ASSIGN_RSHIFT; }
- YY_BREAK
+ YY_BREAK
case 8:
YY_RULE_SETUP
#line 277 "pir.l"
{ return TK_RSHIFT; }
- YY_BREAK
+ YY_BREAK
case 9:
YY_RULE_SETUP
#line 278 "pir.l"
{ return TK_LSHIFT; }
- YY_BREAK
+ YY_BREAK
case 10:
YY_RULE_SETUP
#line 279 "pir.l"
{ return TK_ARROW; }
- YY_BREAK
+ YY_BREAK
case 11:
YY_RULE_SETUP
#line 280 "pir.l"
{ return TK_EQ; }
- YY_BREAK
+ YY_BREAK
case 12:
YY_RULE_SETUP
#line 281 "pir.l"
{ return TK_NE; }
- YY_BREAK
+ YY_BREAK
case 13:
YY_RULE_SETUP
#line 282 "pir.l"
{ return TK_LE; }
- YY_BREAK
+ YY_BREAK
case 14:
YY_RULE_SETUP
#line 283 "pir.l"
{ return TK_GE; }
- YY_BREAK
+ YY_BREAK
case 15:
YY_RULE_SETUP
#line 284 "pir.l"
{ return TK_LT; }
- YY_BREAK
+ YY_BREAK
case 16:
YY_RULE_SETUP
#line 285 "pir.l"
{ return TK_GT; }
- YY_BREAK
+ YY_BREAK
case 17:
YY_RULE_SETUP
#line 287 "pir.l"
{ return TK_FDIV; }
- YY_BREAK
+ YY_BREAK
case 18:
YY_RULE_SETUP
#line 288 "pir.l"
{ return TK_AND; }
- YY_BREAK
+ YY_BREAK
case 19:
YY_RULE_SETUP
#line 289 "pir.l"
{ return TK_OR; }
- YY_BREAK
+ YY_BREAK
case 20:
YY_RULE_SETUP
#line 290 "pir.l"
{ return TK_XOR; }
- YY_BREAK
+ YY_BREAK
case 21:
YY_RULE_SETUP
#line 292 "pir.l"
{ return '+'; }
- YY_BREAK
+ YY_BREAK
case 22:
YY_RULE_SETUP
#line 293 "pir.l"
{ return '%'; }
- YY_BREAK
+ YY_BREAK
case 23:
YY_RULE_SETUP
#line 294 "pir.l"
{ return '*'; }
- YY_BREAK
+ YY_BREAK
case 24:
YY_RULE_SETUP
#line 295 "pir.l"
{ return '/'; }
- YY_BREAK
+ YY_BREAK
case 25:
YY_RULE_SETUP
#line 296 "pir.l"
{ return '!'; }
- YY_BREAK
+ YY_BREAK
case 26:
YY_RULE_SETUP
#line 297 "pir.l"
{ return '~'; }
- YY_BREAK
+ YY_BREAK
case 27:
YY_RULE_SETUP
#line 298 "pir.l"
{ return '-'; }
- YY_BREAK
+ YY_BREAK
case 28:
YY_RULE_SETUP
#line 299 "pir.l"
{ return '('; }
- YY_BREAK
+ YY_BREAK
case 29:
YY_RULE_SETUP
#line 300 "pir.l"
{ return ')'; }
- YY_BREAK
+ YY_BREAK
case 30:
YY_RULE_SETUP
#line 301 "pir.l"
{ return ','; }
- YY_BREAK
+ YY_BREAK
case 31:
YY_RULE_SETUP
#line 302 "pir.l"
{ return '['; }
- YY_BREAK
+ YY_BREAK
case 32:
YY_RULE_SETUP
#line 303 "pir.l"
{ return ']'; }
- YY_BREAK
+ YY_BREAK
case 33:
YY_RULE_SETUP
#line 305 "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 310 "pir.l"
{ return '='; }
- YY_BREAK
+ YY_BREAK
case 35:
YY_RULE_SETUP
#line 311 "pir.l"
{ return ';'; }
- YY_BREAK
+ YY_BREAK
case 36:
YY_RULE_SETUP
#line 313 "pir.l"
{ return TK_ASSIGN_INC; }
- YY_BREAK
+ YY_BREAK
case 37:
YY_RULE_SETUP
#line 314 "pir.l"
{ return TK_ASSIGN_DEC; }
- YY_BREAK
+ YY_BREAK
case 38:
YY_RULE_SETUP
#line 315 "pir.l"
{ return TK_ASSIGN_DIV; }
- YY_BREAK
+ YY_BREAK
case 39:
YY_RULE_SETUP
#line 316 "pir.l"
{ return TK_ASSIGN_MUL; }
- YY_BREAK
+ YY_BREAK
case 40:
YY_RULE_SETUP
#line 317 "pir.l"
{ return TK_ASSIGN_MOD; }
- YY_BREAK
+ YY_BREAK
case 41:
YY_RULE_SETUP
#line 318 "pir.l"
{ return TK_ASSIGN_POW; }
- YY_BREAK
+ YY_BREAK
case 42:
YY_RULE_SETUP
#line 319 "pir.l"
{ return TK_ASSIGN_BOR; }
- YY_BREAK
+ YY_BREAK
case 43:
YY_RULE_SETUP
#line 320 "pir.l"
{ return TK_ASSIGN_BAND; }
- YY_BREAK
+ YY_BREAK
case 44:
YY_RULE_SETUP
#line 321 "pir.l"
{ return TK_ASSIGN_FDIV; }
- YY_BREAK
+ YY_BREAK
case 45:
YY_RULE_SETUP
#line 322 "pir.l"
{ return TK_ASSIGN_BNOT; }
- YY_BREAK
+ YY_BREAK
case 46:
YY_RULE_SETUP
#line 323 "pir.l"
{ return TK_ASSIGN_CONC; }
- YY_BREAK
+ YY_BREAK
case 47:
YY_RULE_SETUP
#line 325 "pir.l"
{ return TK_IF; }
- YY_BREAK
+ YY_BREAK
case 48:
YY_RULE_SETUP
#line 326 "pir.l"
{ return TK_GOTO; }
- YY_BREAK
+ YY_BREAK
case 49:
YY_RULE_SETUP
#line 327 "pir.l"
{ return TK_UNLESS; }
- YY_BREAK
+ YY_BREAK
case 50:
YY_RULE_SETUP
#line 328 "pir.l"
{ return TK_NULL; }
- YY_BREAK
+ YY_BREAK
case 51:
YY_RULE_SETUP
#line 330 "pir.l"
{ return TK_INT; }
- YY_BREAK
+ YY_BREAK
case 52:
YY_RULE_SETUP
#line 331 "pir.l"
{ return TK_NUM; }
- YY_BREAK
+ YY_BREAK
case 53:
YY_RULE_SETUP
#line 332 "pir.l"
{ return TK_PMC; }
- YY_BREAK
+ YY_BREAK
case 54:
YY_RULE_SETUP
#line 333 "pir.l"
{ return TK_STRING; }
- YY_BREAK
+ YY_BREAK
case 55:
YY_RULE_SETUP
#line 335 "pir.l"
{ return TK_ANNOTATE; }
- YY_BREAK
+ YY_BREAK
case 56:
YY_RULE_SETUP
#line 336 "pir.l"
{ return TK_SET_ARG; }
- YY_BREAK
+ YY_BREAK
case 57:
YY_RULE_SETUP
#line 337 "pir.l"
{ return TK_CONST; }
- YY_BREAK
+ YY_BREAK
case 58:
YY_RULE_SETUP
#line 338 "pir.l"
{ return TK_END; }
- YY_BREAK
+ YY_BREAK
case 59:
YY_RULE_SETUP
#line 339 "pir.l"
{ return TK_FILE; }
- YY_BREAK
+ YY_BREAK
case 60:
YY_RULE_SETUP
#line 341 "pir.l"
{ return TK_GET_RESULTS; }
- YY_BREAK
+ YY_BREAK
case 61:
YY_RULE_SETUP
#line 342 "pir.l"
{ return TK_GLOBALCONST; }
- YY_BREAK
+ YY_BREAK
case 62:
YY_RULE_SETUP
#line 343 "pir.l"
{ return TK_HLL; }
- YY_BREAK
+ YY_BREAK
case 63:
YY_RULE_SETUP
#line 344 "pir.l"
{ return TK_INVOCANT; }
- YY_BREAK
+ YY_BREAK
case 64:
YY_RULE_SETUP
#line 345 "pir.l"
{ return TK_LEX; }
- YY_BREAK
+ YY_BREAK
case 65:
YY_RULE_SETUP
#line 346 "pir.l"
{ return TK_LINE; }
- YY_BREAK
+ YY_BREAK
case 66:
YY_RULE_SETUP
#line 347 "pir.l"
{ return TK_LOADLIB; }
- YY_BREAK
+ YY_BREAK
case 67:
YY_RULE_SETUP
#line 348 "pir.l"
{ return TK_LOCAL; }
- YY_BREAK
+ YY_BREAK
case 68:
YY_RULE_SETUP
#line 350 "pir.l"
{ return TK_METH_CALL; }
- YY_BREAK
+ YY_BREAK
case 69:
YY_RULE_SETUP
#line 351 "pir.l"
{ return TK_NAMESPACE; }
- YY_BREAK
+ YY_BREAK
case 70:
YY_RULE_SETUP
#line 352 "pir.l"
{ return TK_NCI_CALL; }
- YY_BREAK
+ YY_BREAK
case 71:
YY_RULE_SETUP
#line 353 "pir.l"
{ return TK_PARAM; }
- YY_BREAK
+ YY_BREAK
case 72:
YY_RULE_SETUP
#line 354 "pir.l"
{ return TK_BEGIN_CALL; }
- YY_BREAK
+ YY_BREAK
case 73:
YY_RULE_SETUP
#line 355 "pir.l"
{ return TK_BEGIN_RETURN; }
- YY_BREAK
+ YY_BREAK
case 74:
YY_RULE_SETUP
#line 356 "pir.l"
{ return TK_BEGIN_YIELD; }
- YY_BREAK
+ YY_BREAK
case 75:
YY_RULE_SETUP
#line 357 "pir.l"
{ return TK_CALL; }
- YY_BREAK
+ YY_BREAK
case 76:
YY_RULE_SETUP
#line 358 "pir.l"
{ return TK_END_CALL; }
- YY_BREAK
+ YY_BREAK
case 77:
YY_RULE_SETUP
#line 359 "pir.l"
{ return TK_END_RETURN; }
- YY_BREAK
+ YY_BREAK
case 78:
YY_RULE_SETUP
#line 360 "pir.l"
{ return TK_END_YIELD; }
- YY_BREAK
+ YY_BREAK
case 79:
YY_RULE_SETUP
#line 361 "pir.l"
{ return TK_GET_RESULT; }
- YY_BREAK
+ YY_BREAK
case 80:
YY_RULE_SETUP
#line 362 "pir.l"
{ return TK_RETURN; }
- YY_BREAK
+ YY_BREAK
case 81:
YY_RULE_SETUP
#line 363 "pir.l"
{ return TK_SUB; }
- YY_BREAK
+ YY_BREAK
case 82:
YY_RULE_SETUP
#line 364 "pir.l"
{ return TK_YIELD; }
- YY_BREAK
+ YY_BREAK
case 83:
YY_RULE_SETUP
#line 365 "pir.l"
{ return TK_SET_RETURN; }
- YY_BREAK
+ YY_BREAK
case 84:
YY_RULE_SETUP
#line 366 "pir.l"
{ return TK_SET_YIELD; }
- YY_BREAK
+ YY_BREAK
case 85:
YY_RULE_SETUP
#line 367 "pir.l"
{ return TK_TAILCALL; }
- YY_BREAK
+ YY_BREAK
case 86:
YY_RULE_SETUP
#line 370 "pir.l"
@@ -2462,124 +2452,124 @@
yypirerror(yyscanner, yypirget_extra(yyscanner),
"cannot use '%s' outside of macro definitions", yytext);
}
- YY_BREAK
+ YY_BREAK
case 87:
YY_RULE_SETUP
#line 377 "pir.l"
{ return TK_FLAG_ANON; }
- YY_BREAK
+ YY_BREAK
case 88:
YY_RULE_SETUP
#line 378 "pir.l"
{ return TK_FLAG_INIT; }
- YY_BREAK
+ YY_BREAK
case 89:
YY_RULE_SETUP
#line 379 "pir.l"
{ return TK_FLAG_LOAD; }
- YY_BREAK
+ YY_BREAK
case 90:
YY_RULE_SETUP
#line 380 "pir.l"
{ return TK_FLAG_POSTCOMP; }
- YY_BREAK
+ YY_BREAK
case 91:
YY_RULE_SETUP
#line 381 "pir.l"
{ return TK_FLAG_IMMEDIATE; }
- YY_BREAK
+ YY_BREAK
case 92:
YY_RULE_SETUP
#line 382 "pir.l"
{ return TK_FLAG_MAIN; }
- YY_BREAK
+ YY_BREAK
case 93:
YY_RULE_SETUP
#line 383 "pir.l"
{ return TK_FLAG_METHOD; }
- YY_BREAK
+ YY_BREAK
case 94:
YY_RULE_SETUP
#line 384 "pir.l"
{ return TK_FLAG_LEX; }
- YY_BREAK
+ YY_BREAK
case 95:
YY_RULE_SETUP
#line 385 "pir.l"
{ return TK_FLAG_OUTER; }
- YY_BREAK
+ YY_BREAK
case 96:
YY_RULE_SETUP
#line 386 "pir.l"
{ return TK_FLAG_VTABLE; }
- YY_BREAK
+ YY_BREAK
case 97:
YY_RULE_SETUP
#line 387 "pir.l"
{ return TK_FLAG_MULTI; }
- YY_BREAK
+ YY_BREAK
case 98:
YY_RULE_SETUP
#line 388 "pir.l"
{ return TK_FLAG_SUBID; }
- YY_BREAK
+ YY_BREAK
case 99:
YY_RULE_SETUP
#line 389 "pir.l"
{ return TK_FLAG_INSTANCEOF; }
- YY_BREAK
+ YY_BREAK
case 100:
YY_RULE_SETUP
#line 390 "pir.l"
{ return TK_FLAG_NSENTRY; }
- YY_BREAK
+ YY_BREAK
case 101:
YY_RULE_SETUP
#line 392 "pir.l"
{ return TK_FLAG_UNIQUE_REG; }
- YY_BREAK
+ YY_BREAK
case 102:
YY_RULE_SETUP
#line 393 "pir.l"
{ return TK_FLAG_OPTIONAL; }
- YY_BREAK
+ YY_BREAK
case 103:
YY_RULE_SETUP
#line 394 "pir.l"
{ return TK_FLAG_OPT_FLAG; }
- YY_BREAK
+ YY_BREAK
case 104:
YY_RULE_SETUP
#line 395 "pir.l"
{ return TK_FLAG_SLURPY; }
- YY_BREAK
+ YY_BREAK
case 105:
YY_RULE_SETUP
#line 396 "pir.l"
{ return TK_FLAG_NAMED; }
- YY_BREAK
+ YY_BREAK
case 106:
YY_RULE_SETUP
#line 397 "pir.l"
{ return TK_FLAG_FLAT; }
- YY_BREAK
+ YY_BREAK
case 107:
YY_RULE_SETUP
#line 398 "pir.l"
{ return TK_FLAG_INVOCANT; }
- YY_BREAK
+ YY_BREAK
case 108:
YY_RULE_SETUP
#line 399 "pir.l"
{ return TK_FLAG_LOOKAHEAD; }
- YY_BREAK
+ YY_BREAK
case 109:
YY_RULE_SETUP
#line 401 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
"unrecognized flag: '%s'", yytext);
}
- YY_BREAK
+ YY_BREAK
case 110:
YY_RULE_SETUP
#line 405 "pir.l"
@@ -2597,20 +2587,25 @@
char *str = Parrot_str_to_cstring(lexer->interp, pstr);
yylval->sval = str;
+
+ /* store the STRING in lexer's sval buffer; once PIRC is doing
+ only STRINGs, it can be stored in yylval.sval. */
+ lexer->sval = pstr;
+
return TK_STRINGC;
}
- YY_BREAK
+ YY_BREAK
case 111:
YY_RULE_SETUP
-#line 422 "pir.l"
+#line 427 "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 112:
YY_RULE_SETUP
-#line 427 "pir.l"
+#line 432 "pir.l"
{ /* XXX these double-quoted strings are not unescaped (yet) */
/* parse yytext, which contains the charset, a ':', and the quoted string */
char *colon = strchr(yytext, ':');
@@ -2639,10 +2634,10 @@
yylval->ustr = ustr;
return TK_USTRINGC;
}
- YY_BREAK
+ YY_BREAK
case 113:
YY_RULE_SETUP
-#line 456 "pir.l"
+#line 461 "pir.l"
{ /* XXX these double-quoted strings are not unescaped (yet) */
/* parse yytext, which contains the encoding, a ':', a charset,
* a ':', and the quoted string
@@ -2689,38 +2684,38 @@
return TK_USTRINGC;
}
- YY_BREAK
+ YY_BREAK
case 114:
YY_RULE_SETUP
-#line 504 "pir.l"
+#line 509 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_PREG; }
- YY_BREAK
+ YY_BREAK
case 115:
YY_RULE_SETUP
-#line 505 "pir.l"
+#line 510 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_SREG; }
- YY_BREAK
+ YY_BREAK
case 116:
YY_RULE_SETUP
-#line 506 "pir.l"
+#line 511 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_NREG; }
- YY_BREAK
+ YY_BREAK
case 117:
YY_RULE_SETUP
-#line 507 "pir.l"
+#line 512 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_IREG; }
- YY_BREAK
+ YY_BREAK
case 118:
YY_RULE_SETUP
-#line 509 "pir.l"
+#line 514 "pir.l"
{ /* make the label Id available in the parser. remove the ":" first. */
yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
return TK_LABEL;
}
- YY_BREAK
+ YY_BREAK
case 119:
YY_RULE_SETUP
-#line 514 "pir.l"
+#line 519 "pir.l"
{ /* give a warning when using PASM registers as PIR identifiers */
lexer_state * const lexer = yypirget_extra(yyscanner);
@@ -2732,10 +2727,10 @@
yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
return TK_IDENT;
}
- YY_BREAK
+ YY_BREAK
case 120:
YY_RULE_SETUP
-#line 526 "pir.l"
+#line 531 "pir.l"
{ /* identifier; can be a global (sub or const), local or parrot op */
lexer_state * const lexer = yypirget_extra(yyscanner);
constdecl * const c = find_global_constant(lexer, yytext);
@@ -2763,38 +2758,38 @@
yylval->sval = dupstr(lexer, yytext);
return TK_IDENT;
}
- YY_BREAK
+ YY_BREAK
case 121:
YY_RULE_SETUP
-#line 554 "pir.l"
+#line 559 "pir.l"
{ yylval->dval = atof(yytext); return TK_NUMC; }
- YY_BREAK
+ YY_BREAK
case 122:
YY_RULE_SETUP
-#line 555 "pir.l"
+#line 560 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
- YY_BREAK
+ YY_BREAK
case 123:
YY_RULE_SETUP
-#line 556 "pir.l"
+#line 561 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
- YY_BREAK
+ YY_BREAK
case 124:
YY_RULE_SETUP
-#line 557 "pir.l"
+#line 562 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
- YY_BREAK
+ YY_BREAK
case 125:
YY_RULE_SETUP
-#line 558 "pir.l"
+#line 563 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
- YY_BREAK
+ YY_BREAK
case 126:
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
yyg->yy_c_buf_p = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 560 "pir.l"
+#line 565 "pir.l"
{ /* Make sure the dot is followed by a character that
* starts a method object. $ for registers,
* quotes for quoted strings, and letters for identifiers.
@@ -2802,17 +2797,17 @@
*/
return '.';
}
- YY_BREAK
+ YY_BREAK
case 127:
/* rule 127 can match eol */
YY_RULE_SETUP
-#line 568 "pir.l"
+#line 573 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
"no space allowed before a methodcall dot, "
"or space expected after the '.' operator");
return '.';
}
- YY_BREAK
+ YY_BREAK
/* SCANSTR<<EOF>> and SCANMACRO<<EOF>> must be defined before <INTIAL><<EOF>>,
@@ -2829,15 +2824,15 @@
case YY_STATE_EOF(SCANSTR):
-#line 590 "pir.l"
+#line 595 "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 596 "pir.l"
+#line 601 "pir.l"
{ /* override the default <<EOF>> action; go back to normal state and
* switch back to the saved file.
*/
@@ -2860,10 +2855,10 @@
delete_macro_table(table);
}
- YY_BREAK
+ YY_BREAK
case 128:
YY_RULE_SETUP
-#line 619 "pir.l"
+#line 624 "pir.l"
{ /* when scanning a macro body, the @ marker indicates the {IDENT} must
* be munged.
*/
@@ -2872,21 +2867,21 @@
yylval->sval = munge_id(id, lexer);
return TK_IDENT;
}
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INITIAL):
-#line 628 "pir.l"
+#line 633 "pir.l"
{ /* end of file, stop scanning. */
yyterminate();
}
- YY_BREAK
+ YY_BREAK
case 129:
YY_RULE_SETUP
-#line 632 "pir.l"
+#line 637 "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
/*****************************************************************************
@@ -2902,50 +2897,50 @@
case 130:
YY_RULE_SETUP
-#line 654 "pir.l"
+#line 659 "pir.l"
{
yy_push_state(MACROCONST, yyscanner);
return TK_MACRO_CONST;
}
- YY_BREAK
+ YY_BREAK
case 131:
YY_RULE_SETUP
-#line 659 "pir.l"
+#line 664 "pir.l"
{
yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
return TK_IDENT;
}
- YY_BREAK
+ YY_BREAK
case 132:
YY_RULE_SETUP
-#line 664 "pir.l"
+#line 669 "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 133:
YY_RULE_SETUP
-#line 671 "pir.l"
+#line 676 "pir.l"
{ /* ignore whitespace */ }
- YY_BREAK
+ YY_BREAK
case 134:
YY_RULE_SETUP
-#line 672 "pir.l"
+#line 677 "pir.l"
{
yypirerror(yyscanner, yypirget_extra(yyscanner),
"unknown character: '%c'", yytext[0]);
}
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(MACROCONST):
-#line 676 "pir.l"
+#line 681 "pir.l"
{
yypirerror(yyscanner, yypirget_extra(yyscanner),
"read end of file during .macro_const definition");
}
- YY_BREAK
+ YY_BREAK
/**************** macro header (.macro <ident> <parameters> ) ***************/
@@ -2953,50 +2948,50 @@
case 135:
YY_RULE_SETUP
-#line 687 "pir.l"
+#line 692 "pir.l"
{ /* start a macro definition */
yy_push_state(MACROHEAD, yyscanner);
return TK_MACRO;
}
- YY_BREAK
+ YY_BREAK
case 136:
YY_RULE_SETUP
-#line 692 "pir.l"
+#line 697 "pir.l"
{ /* ignore whitespace */ }
- YY_BREAK
+ YY_BREAK
case 137:
YY_RULE_SETUP
-#line 693 "pir.l"
+#line 698 "pir.l"
{
yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
return TK_IDENT;
}
- YY_BREAK
+ YY_BREAK
case 138:
YY_RULE_SETUP
-#line 698 "pir.l"
+#line 703 "pir.l"
{ return '('; }
- YY_BREAK
+ YY_BREAK
case 139:
YY_RULE_SETUP
-#line 699 "pir.l"
+#line 704 "pir.l"
{ return ')'; }
- YY_BREAK
+ YY_BREAK
case 140:
YY_RULE_SETUP
-#line 700 "pir.l"
+#line 705 "pir.l"
{ return ','; }
- YY_BREAK
+ YY_BREAK
case 141:
/* rule 141 can match eol */
YY_RULE_SETUP
-#line 702 "pir.l"
+#line 707 "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 ***************************/
@@ -3008,7 +3003,7 @@
case 142:
YY_RULE_SETUP
-#line 718 "pir.l"
+#line 723 "pir.l"
{ /* .foo; it can be a macro, macro_local, or just $P0.foo(),
* but we need to check that.
*/
@@ -3062,10 +3057,10 @@
}
}
}
- YY_BREAK
+ YY_BREAK
case 143:
YY_RULE_SETUP
-#line 772 "pir.l"
+#line 777 "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);
@@ -3093,85 +3088,85 @@
else
yypirerror(yyscanner, lexer, "'%s' is not a macro", yytext + 1);
}
- YY_BREAK
+ YY_BREAK
case 144:
YY_RULE_SETUP
-#line 800 "pir.l"
+#line 805 "pir.l"
{
yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
return TK_MACRO_ARG_IDENT;
}
- YY_BREAK
+ YY_BREAK
case 145:
YY_RULE_SETUP
-#line 805 "pir.l"
+#line 810 "pir.l"
{
yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
return TK_MACRO_ARG_OTHER;
}
- YY_BREAK
+ YY_BREAK
case 146:
YY_RULE_SETUP
-#line 810 "pir.l"
+#line 815 "pir.l"
{ /* ignore whitespace */ }
- YY_BREAK
+ YY_BREAK
case 147:
YY_RULE_SETUP
-#line 811 "pir.l"
+#line 816 "pir.l"
{ return ','; }
- YY_BREAK
+ YY_BREAK
case 148:
YY_RULE_SETUP
-#line 812 "pir.l"
+#line 817 "pir.l"
{ return '('; }
- YY_BREAK
+ YY_BREAK
case 149:
YY_RULE_SETUP
-#line 813 "pir.l"
+#line 818 "pir.l"
{
yy_pop_state(yyscanner); /* leave MACROEXPAND state */
return ')';
}
- YY_BREAK
+ YY_BREAK
case 150:
YY_RULE_SETUP
-#line 818 "pir.l"
+#line 823 "pir.l"
{
yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
return TK_MACRO_ARG_OTHER;
}
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(STRINGEXPAND):
-#line 823 "pir.l"
+#line 828 "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 151:
YY_RULE_SETUP
-#line 829 "pir.l"
+#line 834 "pir.l"
{ return '{'; }
- YY_BREAK
+ YY_BREAK
case 152:
YY_RULE_SETUP
-#line 830 "pir.l"
+#line 835 "pir.l"
{ return '}'; }
- YY_BREAK
+ YY_BREAK
case 153:
/* rule 153 can match eol */
YY_RULE_SETUP
-#line 832 "pir.l"
+#line 837 "pir.l"
{ yylval->sval = "\n"; return TK_NL; }
- YY_BREAK
+ YY_BREAK
case 154:
YY_RULE_SETUP
-#line 834 "pir.l"
+#line 839 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
"unknown character in macro expansion: %c", yytext[0]);
}
- YY_BREAK
+ YY_BREAK
/******************************** .macro_local *****************************/
@@ -3179,7 +3174,7 @@
case 155:
YY_RULE_SETUP
-#line 845 "pir.l"
+#line 850 "pir.l"
{ /* give a warning if the right flag is set */
/*
lexer_state * const lexer = yypirget_extra(yyscanner);
@@ -3192,38 +3187,38 @@
Doesn't make sense to use it.
*/
}
- YY_BREAK
+ YY_BREAK
case 156:
YY_RULE_SETUP
-#line 859 "pir.l"
+#line 864 "pir.l"
{
yy_push_state(MACROLOCAL, yyscanner);
return TK_MACRO_LOCAL;
}
- YY_BREAK
+ YY_BREAK
case 157:
YY_RULE_SETUP
-#line 864 "pir.l"
+#line 869 "pir.l"
{ return TK_INT; }
- YY_BREAK
+ YY_BREAK
case 158:
YY_RULE_SETUP
-#line 865 "pir.l"
+#line 870 "pir.l"
{ return TK_PMC; }
- YY_BREAK
+ YY_BREAK
case 159:
YY_RULE_SETUP
-#line 866 "pir.l"
+#line 871 "pir.l"
{ return TK_NUM; }
- YY_BREAK
+ YY_BREAK
case 160:
YY_RULE_SETUP
-#line 867 "pir.l"
+#line 872 "pir.l"
{ return TK_STRING; }
- YY_BREAK
+ YY_BREAK
case 161:
YY_RULE_SETUP
-#line 869 "pir.l"
+#line 874 "pir.l"
{ /* normal .macro_local */
lexer_state * const lexer = yypirget_extra(yyscanner);
/* reserve space for {IDENT}, the @ marker and the NULL char. */
@@ -3238,10 +3233,10 @@
declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext));
return TK_MACRO_LOCAL_ID;
}
- YY_BREAK
+ YY_BREAK
case 162:
YY_RULE_SETUP
-#line 884 "pir.l"
+#line 889 "pir.l"
{ /* declare a .macro_local based on a parameter */
lexer_state * const lexer = yypirget_extra(yyscanner);
@@ -3255,10 +3250,10 @@
return TK_MACRO_LOCAL_ID;
}
- YY_BREAK
+ YY_BREAK
case 163:
YY_RULE_SETUP
-#line 898 "pir.l"
+#line 903 "pir.l"
{ /* .$foo */
lexer_state * const lexer = yypirget_extra(yyscanner);
macro_table * const table = peek_macro_table(lexer);
@@ -3287,10 +3282,10 @@
}
}
- YY_BREAK
+ YY_BREAK
case 164:
YY_RULE_SETUP
-#line 927 "pir.l"
+#line 932 "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);
@@ -3315,29 +3310,29 @@
return TK_IDENT;
}
- YY_BREAK
+ YY_BREAK
case 165:
YY_RULE_SETUP
-#line 952 "pir.l"
+#line 957 "pir.l"
{ /* ignore whitespace */ }
- YY_BREAK
+ YY_BREAK
case 166:
/* rule 166 can match eol */
YY_RULE_SETUP
-#line 954 "pir.l"
+#line 959 "pir.l"
{ /* newline after .macro_local <type> <ident> line */
yy_pop_state(yyscanner);
return TK_NL;
}
- YY_BREAK
+ YY_BREAK
case 167:
YY_RULE_SETUP
-#line 959 "pir.l"
+#line 964 "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 ********************************/
@@ -3345,15 +3340,15 @@
case 168:
YY_RULE_SETUP
-#line 969 "pir.l"
+#line 974 "pir.l"
{
yy_push_state(MACROLABEL, yyscanner);
return TK_MACRO_LABEL;
}
- YY_BREAK
+ YY_BREAK
case 169:
YY_RULE_SETUP
-#line 974 "pir.l"
+#line 979 "pir.l"
{ /* if the "$" is there, it's a macro label using a macro
* parameter's value; otherwise it's a normal macro label
*/
@@ -3370,29 +3365,29 @@
declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext));
return TK_MACRO_LABEL_ID;
}
- YY_BREAK
+ YY_BREAK
case 170:
/* rule 170 can match eol */
YY_RULE_SETUP
-#line 992 "pir.l"
+#line 997 "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 171:
YY_RULE_SETUP
-#line 998 "pir.l"
+#line 1003 "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 172:
YY_RULE_SETUP
-#line 1005 "pir.l"
+#line 1010 "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);
@@ -3418,7 +3413,7 @@
}
return TK_LABEL;
}
- YY_BREAK
+ YY_BREAK
/*************************** macro body scanning (storing) ****************************/
@@ -3427,31 +3422,31 @@
case 173:
/* rule 173 can match eol */
YY_RULE_SETUP
-#line 1038 "pir.l"
+#line 1043 "pir.l"
{ store_macro_char(CURRENT_MACRO(yypirget_extra(yyscanner)), '\n'); }
- YY_BREAK
+ YY_BREAK
case 174:
YY_RULE_SETUP
-#line 1040 "pir.l"
+#line 1045 "pir.l"
{
yy_pop_state(yyscanner); /* leave MACROBODY state */
return TK_ENDM;
}
- YY_BREAK
+ YY_BREAK
case 175:
YY_RULE_SETUP
-#line 1045 "pir.l"
+#line 1050 "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 1049 "pir.l"
+#line 1054 "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),
@@ -3478,93 +3473,93 @@
case 176:
YY_RULE_SETUP
-#line 1081 "pir.l"
+#line 1086 "pir.l"
{ return ','; }
- YY_BREAK
+ YY_BREAK
case 177:
YY_RULE_SETUP
-#line 1082 "pir.l"
+#line 1087 "pir.l"
{ return '['; }
- YY_BREAK
+ YY_BREAK
case 178:
YY_RULE_SETUP
-#line 1083 "pir.l"
+#line 1088 "pir.l"
{ return ']'; }
- YY_BREAK
+ YY_BREAK
case 179:
YY_RULE_SETUP
-#line 1085 "pir.l"
+#line 1090 "pir.l"
{ return TK_FLAG_MAIN; }
- YY_BREAK
+ YY_BREAK
case 180:
YY_RULE_SETUP
-#line 1086 "pir.l"
+#line 1091 "pir.l"
{ return TK_FLAG_LOAD; }
- YY_BREAK
+ YY_BREAK
case 181:
YY_RULE_SETUP
-#line 1087 "pir.l"
+#line 1092 "pir.l"
{ return TK_FLAG_INIT; }
- YY_BREAK
+ YY_BREAK
case 182:
YY_RULE_SETUP
-#line 1088 "pir.l"
+#line 1093 "pir.l"
{ return TK_FLAG_ANON; }
- YY_BREAK
+ YY_BREAK
case 183:
YY_RULE_SETUP
-#line 1089 "pir.l"
+#line 1094 "pir.l"
{ return TK_FLAG_POSTCOMP; }
- YY_BREAK
+ YY_BREAK
case 184:
YY_RULE_SETUP
-#line 1090 "pir.l"
+#line 1095 "pir.l"
{ return TK_FLAG_IMMEDIATE; }
- YY_BREAK
+ YY_BREAK
case 185:
YY_RULE_SETUP
-#line 1092 "pir.l"
+#line 1097 "pir.l"
{ return TK_PCC_SUB; }
- YY_BREAK
+ YY_BREAK
case 186:
YY_RULE_SETUP
-#line 1093 "pir.l"
+#line 1098 "pir.l"
{ return TK_LEX; }
- YY_BREAK
+ YY_BREAK
case 187:
YY_RULE_SETUP
-#line 1094 "pir.l"
+#line 1099 "pir.l"
{ return TK_NAMESPACE; }
- YY_BREAK
+ YY_BREAK
case 188:
YY_RULE_SETUP
-#line 1096 "pir.l"
+#line 1101 "pir.l"
{
yy_push_state(MACROHEAD, yyscanner);
return TK_MACRO;
}
- YY_BREAK
+ YY_BREAK
case 189:
YY_RULE_SETUP
-#line 1101 "pir.l"
+#line 1106 "pir.l"
{
yy_push_state(MACROCONST, yyscanner);
return TK_MACRO_CONST;
}
- YY_BREAK
+ YY_BREAK
case 190:
YY_RULE_SETUP
-#line 1106 "pir.l"
+#line 1111 "pir.l"
{ return TK_LINE; }
- YY_BREAK
+ YY_BREAK
case 191:
YY_RULE_SETUP
-#line 1107 "pir.l"
+#line 1112 "pir.l"
{ return TK_FILE; }
- YY_BREAK
+ YY_BREAK
case 192:
YY_RULE_SETUP
-#line 1110 "pir.l"
+#line 1115 "pir.l"
{ /* macro expansion in PASM mode. */
lexer_state * const lexer = yypirget_extra(yyscanner);
macro_def * const macro = find_macro(lexer->macros, yytext + 1);
@@ -3598,247 +3593,247 @@
}
}
}
- YY_BREAK
+ YY_BREAK
case 193:
YY_RULE_SETUP
-#line 1144 "pir.l"
+#line 1149 "pir.l"
{ /* a label in PASM */
yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
return TK_LABEL;
}
- YY_BREAK
+ YY_BREAK
case 194:
YY_RULE_SETUP
-#line 1149 "pir.l"
+#line 1154 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
"symbolic registers are not allowed in PASM mode");
}
- YY_BREAK
+ YY_BREAK
case 195:
YY_RULE_SETUP
-#line 1152 "pir.l"
+#line 1157 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_PREG; }
- YY_BREAK
+ YY_BREAK
case 196:
YY_RULE_SETUP
-#line 1153 "pir.l"
+#line 1158 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_NREG; }
- YY_BREAK
+ YY_BREAK
case 197:
YY_RULE_SETUP
-#line 1154 "pir.l"
+#line 1159 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_IREG; }
- YY_BREAK
+ YY_BREAK
case 198:
YY_RULE_SETUP
-#line 1155 "pir.l"
+#line 1160 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_SREG; }
- YY_BREAK
+ YY_BREAK
case 199:
YY_RULE_SETUP
-#line 1157 "pir.l"
+#line 1162 "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 200:
YY_RULE_SETUP
-#line 1162 "pir.l"
+#line 1167 "pir.l"
{ yylval->dval = atof(yytext); return TK_NUMC; }
- YY_BREAK
+ YY_BREAK
case 201:
YY_RULE_SETUP
-#line 1163 "pir.l"
+#line 1168 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
- YY_BREAK
+ YY_BREAK
case 202:
YY_RULE_SETUP
-#line 1164 "pir.l"
+#line 1169 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
- YY_BREAK
+ YY_BREAK
case 203:
YY_RULE_SETUP
-#line 1165 "pir.l"
+#line 1170 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
- YY_BREAK
+ YY_BREAK
case 204:
YY_RULE_SETUP
-#line 1166 "pir.l"
+#line 1171 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
- YY_BREAK
+ YY_BREAK
case 205:
YY_RULE_SETUP
-#line 1168 "pir.l"
+#line 1173 "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 206:
YY_RULE_SETUP
-#line 1173 "pir.l"
+#line 1178 "pir.l"
{ /* ignore whitespace */ }
- YY_BREAK
+ YY_BREAK
case 207:
/* rule 207 can match eol */
YY_RULE_SETUP
-#line 1175 "pir.l"
+#line 1180 "pir.l"
{ return TK_NL; }
- YY_BREAK
+ YY_BREAK
case 208:
YY_RULE_SETUP
-#line 1177 "pir.l"
+#line 1182 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
"unrecognized character: %c", yytext[0]);
}
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(PASM):
-#line 1180 "pir.l"
+#line 1185 "pir.l"
{ yyterminate(); }
- YY_BREAK
+ YY_BREAK
case 209:
YY_RULE_SETUP
-#line 1182 "pir.l"
+#line 1187 "pir.l"
ECHO;
- YY_BREAK
-#line 3706 "pirlexer.c"
+ YY_BREAK
+#line 3701 "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 */
@@ -3852,9 +3847,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)
@@ -3863,134 +3858,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()" );
- }
+ 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, 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;
- 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;
+ yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
- yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
- return ret_val;
+ return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
@@ -4003,38 +3990,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 >= 825 )
- 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 >= 825 )
+ 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)
@@ -4042,27 +4029,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 >= 825 )
- 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 == 824);
+ 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 >= 825 )
+ 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 == 824);
- return yy_is_jam ? 0 : yy_current_state;
+ return yy_is_jam ? 0 : yy_current_state;
}
/* %if-c-only */
@@ -4081,81 +4068,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.
- */
+ 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 0;
- /* Reset buffer status. */
- yypirrestart(yyin ,yyscanner);
-
- /*FALLTHROUGH*/
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( yypirwrap(yyscanner ) )
- return EOF;
-
- if ( ! yyg->yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
+ 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.
@@ -4171,14 +4158,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.
@@ -4193,32 +4180,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.
- */
- yyg->yy_did_buffer_switch_on_eof = 1;
+ 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;
}
/* %if-c-only */
@@ -4228,10 +4215,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.
@@ -4246,26 +4233,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_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()" );
- b->yy_is_our_buffer = 1;
+ b->yy_is_our_buffer = 1;
- yypir_init_buffer(b,file ,yyscanner);
+ yypir_init_buffer(b,file ,yyscanner);
- return b;
+ return b;
}
/** Destroy the buffer.
@@ -4280,16 +4267,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 */
@@ -4310,13 +4297,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.
@@ -4330,11 +4317,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.
@@ -4348,25 +4335,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++ */
@@ -4383,28 +4370,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 */
@@ -4420,18 +4407,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 */
@@ -4445,46 +4432,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 */
@@ -4493,42 +4476,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;
+ 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;
- 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;
+ yypir_switch_to_buffer(b ,yyscanner );
- yypir_switch_to_buffer(b ,yyscanner );
-
- return b;
+ 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
@@ -4536,8 +4519,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 */
@@ -4551,32 +4534,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()" );
+ 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;
- /* 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;
+ return b;
}
/* %endif */
@@ -4587,26 +4570,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 */
@@ -4616,10 +4600,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 */
@@ -4629,7 +4613,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
@@ -4639,8 +4623,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 */
@@ -4650,18 +4634,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. */
@@ -4685,10 +4669,10 @@
int yypirget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
-
+
return yylineno;
}
@@ -4698,10 +4682,10 @@
int yypirget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
-
+
return yycolumn;
}
@@ -4766,8 +4750,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;
}
@@ -4781,8 +4765,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;
}
@@ -4865,43 +4849,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)
@@ -4945,15 +4893,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 );
@@ -4979,20 +4927,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
@@ -5003,7 +4951,7 @@
/* %ok-for-header */
-#line 1182 "pir.l"
+#line 1187 "pir.l"
Modified: branches/pluggable_runcore/compilers/tge/TGE/Compiler.pir
==============================================================================
--- branches/pluggable_runcore/compilers/tge/TGE/Compiler.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/tge/TGE/Compiler.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -89,12 +89,11 @@
# Iterate over the list of statements, and generate a processed tree for
# each statement. Return an array of all the processed statements.
- .local pmc iter
- iter = new 'Iterator', node # loop over the array
- iter = 0 # start at the beginning
+ .local pmc it
+ it = iter node # loop over the array
loop_start:
- unless iter goto loop_end
- $P1 = shift iter
+ unless it goto loop_end
+ $P1 = shift it
$P2 = tree.'get'('result', $P1, 'statement')
push statements, $P2
goto loop_start
@@ -111,14 +110,13 @@
.param pmc node
.local pmc result
- .local pmc iter
+ .local pmc it
$P0 = node.'hash'()
- iter = new 'Iterator', $P0 # setup iterator for node
- iter = 0
+ it = iter $P0 # setup iterator for node
iter_loop:
- unless iter, iter_end # while (entries) ...
- shift $S1, iter # get the key of the iterator
- $P2 = iter[$S1]
+ unless it, iter_end # while (entries) ...
+ shift $S1, it # get the key of the iterator
+ $P2 = it[$S1]
result = tree.'get'('result', $P2, $S1)
@@ -134,15 +132,14 @@
.local pmc rule
rule = new 'Hash'
- .local pmc iter
+ .local pmc it
$P0 = node.'hash'()
- iter = new 'Iterator', $P0 # setup iterator for node
- iter = 0
+ it = iter $P0 # setup iterator for node
iter_loop:
- unless iter, iter_end # while (entries) ...
+ unless it, iter_end # while (entries) ...
$P3 = new 'Undef'
- shift $S1, iter # get the key of the iterator
- $P2 = iter[$S1]
+ shift $S1, it # get the key of the iterator
+ $P2 = it[$S1]
$P3 = tree.'get'('value', $P2, $S1)
@@ -169,15 +166,14 @@
.local pmc decl
decl = new 'Hash'
- .local pmc iter
+ .local pmc it
$P0 = node.'hash'()
- iter = new 'Iterator', $P0 # setup iterator for node
- iter = 0
+ it = iter $P0 # setup iterator for node
iter_loop:
- unless iter, iter_end # while (entries) ...
+ unless it, iter_end # while (entries) ...
$P3 = new 'Undef'
- shift $S1, iter # get the key of the iterator
- $P2 = iter[$S1]
+ shift $S1, it # get the key of the iterator
+ $P2 = it[$S1]
$P3 = tree.'get'('value', $P2, $S1)
@@ -296,12 +292,11 @@
# Construct grammar rules from the data structure of rule info
.local pmc statement
- .local pmc iter
- iter = new 'Iterator', rule_data # loop over the rule info
- iter = 0 # start at the beginning
+ .local pmc it
+ it = iter rule_data # loop over the rule info
loop_start:
- unless iter goto loop_end
- statement = shift iter
+ unless it goto loop_end
+ statement = shift it
$S0 = statement['build']
unless $S0 == 'rule' goto grammar_build
$S1 = self.'rule_string'(statement)
Modified: branches/pluggable_runcore/compilers/tge/TGE/Grammar.pir
==============================================================================
--- branches/pluggable_runcore/compilers/tge/TGE/Grammar.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/compilers/tge/TGE/Grammar.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -140,7 +140,7 @@
.sub 'symbol_iter' :method
$P1 = getattribute self, 'symbols'
- $P2 = new 'Iterator', $P1
+ $P2 = iter $P1
.return($P2)
.end
Deleted: branches/pluggable_runcore/config/auto/fink.pm
==============================================================================
--- branches/pluggable_runcore/config/auto/fink.pm Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,107 +0,0 @@
-# Copyright (C) 2005-2007, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-config/auto/fink.pm - Determine Fink location on Darwin
-
-=head1 DESCRIPTION
-
-If the operating system is Darwin, this class determines whether and where
-Fink is installed.
-
-=cut
-
-package auto::fink;
-
-use strict;
-use warnings;
-
-use base qw(Parrot::Configure::Step);
-
-use Parrot::Configure::Utils ':auto';
-use Parrot::BuildUtil;
-
-
-sub _init {
- my $self = shift;
- my %data;
- $data{description} = q{Determine Fink location on Darwin};
- $data{result} = q{};
- # Per fink(8), this is location for Fink configuration file, presumably
- # regardless of where Fink itself is installed.
- $data{fink_conf} = q{/sw/etc/fink.conf};
- return \%data;
-}
-
-sub runstep {
- my ( $self, $conf ) = ( shift, shift );
- my $osname = $conf->data->get_p5( 'OSNAME' );
- my $verbose = $conf->options->get( 'verbose' );
- unless ($osname =~ /darwin/) {
- print "Operating system is $osname; Fink is Darwin only\n"
- if $verbose;
- $self->set_result('skipped');
- return 1;
- }
- # Per fink(8), this is location for Fink configuration file, presumably
- # regardless of where Fink itself is installed.
- my $fink_conf = $self->{fink_conf};
- unless (-f $fink_conf) {
- print "Fink configuration file not located\n"
- if $verbose;
- $self->set_result('Fink not installed');
- return 1;
- }
- my $fink_conf_str = Parrot::BuildUtil::slurp_file($fink_conf);
- my @lines = split /\n/, $fink_conf_str;
- my $fink_base_dir;
- while (defined (my $l = shift @lines) ) {
- chomp $l;
- next unless $l =~ /^Basepath:\s(.*)/;
- $fink_base_dir = $1;
- last;
- }
- unless (defined $fink_base_dir) {
- print "Fink configuration file defective: no 'Basepath'\n"
- if $verbose;
- $self->set_result('failed');
- return;
- }
- my $fink_lib_dir = qq{$fink_base_dir/lib};
- my $fink_include_dir = qq{$fink_base_dir/include};
- my @unlocateables;
- foreach my $dir ($fink_base_dir, $fink_lib_dir, $fink_include_dir) {
- push @unlocateables, $dir unless (-d $dir);
- }
- if (@unlocateables) {
- print "Could not locate Fink directories: @unlocateables\n"
- if $verbose;
- $self->set_result('failed');
- return;
- }
- else {
- $conf->data->set(
- fink_base_dir => $fink_base_dir,
- fink_lib_dir => $fink_lib_dir,
- fink_include_dir => $fink_include_dir,
- );
- $self->set_result('Fink located');
- return 1;
- }
-}
-
-1;
-
-=head1 AUTHOR
-
-James E Keenan
-
-=cut
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
Modified: branches/pluggable_runcore/config/auto/gc.pm
==============================================================================
--- branches/pluggable_runcore/config/auto/gc.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/auto/gc.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
=head1 NAME
@@ -7,16 +7,15 @@
=head1 DESCRIPTION
-Checks whether the C<--gc> command-line option was passed to F<Configure.pl>
-and sets the memory allocator accordingly.
+Sets memory allocator.
-Eventually, C<--gc> will be able to take any of the following values:
+Currently, we have only one choice: the memory allocator in
+F<src/gc/alloc_resources.c>.
-=over
+In the future, we will have a C<--gc> command-line option which will enable
+the configurer to choose among the default and:
-=item C<gc>
-
-The default. Use the memory allocator in F<src/resources.c>.
+=over 4
=item C<libc>
@@ -25,19 +24,17 @@
=item C<malloc>
-Use the malloc in F<src/malloc.c> along with F<src/gc/res_lea.c>.
+Use the malloc in F<src/gc/malloc.c> along with F<src/gc/res_lea.c>.
Since this uses res_lea.c, it doesn't currently work either. See [perl #42774].
=item C<malloc-trace>
-Use the malloc in F<src/malloc-trace.c> with tracing enabled, along
+Use the malloc in F<src/gc/malloc-trace.c> with tracing enabled, along
with F<src/gc/res_lea.c>.
Since this uses res_lea.c, it doesn't work currently either. See [perl #42774].
=back
-So, for the time being, only the default value works.
-
=cut
package auto::gc;
@@ -49,8 +46,6 @@
use Parrot::Configure::Utils ':auto';
-
-# valid libc/malloc/malloc-trace/gc
sub _init {
my $self = shift;
my %data;
@@ -62,47 +57,15 @@
sub runstep {
my ( $self, $conf ) = @_;
- my $gc = $conf->options->get('gc');
+ my $gc = 'gc';
- # default is GC in alloc_resources.c
- $gc = 'gc' unless defined $gc;
-
- if ( $gc =~ /^malloc(?:-trace)?$/ ) {
- $conf->data->set(
- TEMP_gc_c => <<"EOF",
-\$(SRC_DIR)/$gc\$(O): \$(GENERAL_H_FILES) \$(SRC_DIR)/$gc.c
-\$(SRC_DIR)/gc/res_lea\$(O): \$(GENERAL_H_FILES) \$(SRC_DIR)/gc/res_lea.c
-EOF
- TEMP_gc_o => "\$(SRC_DIR)\/$gc\$(O) \$(SRC_DIR)/gc/res_lea\$(O)",
- gc_flag => '-DGC_IS_MALLOC',
- );
- }
- elsif ( $gc eq 'libc' ) {
- $conf->data->set(
- TEMP_gc_c => <<"EOF",
-\$(SRC_DIR)/gc/res_lea\$(O): \$(GENERAL_H_FILES) \$(SRC_DIR)/gc/res_lea.c
-EOF
- TEMP_gc_o => "\$(SRC_DIR)/gc/res_lea\$(O)",
- gc_flag => '-DGC_IS_MALLOC',
- );
- # tests mallinfo after allocation of 128 bytes
- if ( $conf->data->get('i_malloc') ) {
- $conf->data->set( malloc_header => 'malloc.h' );
- }
- else {
- $conf->data->set( malloc_header => 'stdlib.h' );
- }
- }
- else {
- $gc = 'gc';
- $conf->data->set(
- TEMP_gc_c => <<"EOF",
+ $conf->data->set(
+ TEMP_gc_c => <<"EOF",
\$(SRC_DIR)/gc/alloc_resources\$(O): \$(GENERAL_H_FILES) \$(SRC_DIR)/gc/alloc_resources.c
EOF
- TEMP_gc_o => "\$(SRC_DIR)/gc/alloc_resources\$(O)",
- gc_flag => '',
- );
- }
+ TEMP_gc_o => "\$(SRC_DIR)/gc/alloc_resources\$(O)",
+ gc_flag => '',
+ );
print(" ($gc) ") if $conf->options->get('verbose');
return 1;
Modified: branches/pluggable_runcore/config/auto/gdbm.pm
==============================================================================
--- branches/pluggable_runcore/config/auto/gdbm.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/auto/gdbm.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -61,10 +61,6 @@
default => '-lgdbm',
} );
- # On OS X check the presence of the gdbm header in the standard
- # Fink location.
- $self->_handle_darwin_for_fink($conf, $osname, 'gdbm.h');
-
$conf->cc_gen('config/auto/gdbm/gdbm_c.in');
eval { $conf->cc_build( q{}, $extra_libs ); };
my $has_gdbm = 0;
Modified: branches/pluggable_runcore/config/auto/gettext.pm
==============================================================================
--- branches/pluggable_runcore/config/auto/gettext.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/auto/gettext.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -61,11 +61,6 @@
default => defined $conf->data->get('glibc') ? '' : '-lintl',
} );
- # On OS X check the presence of the gettext header in the standard
- # Fink and MacPorts locations.
- $self->_handle_darwin_for_fink($conf, $osname, 'libintl.h');
- $self->_handle_darwin_for_macports($conf, $osname, 'libintl.h');
-
$conf->cc_gen('config/auto/gettext/gettext_c.in');
eval { $conf->cc_build( q{}, $extra_libs ); };
my $has_gettext = 0;
Modified: branches/pluggable_runcore/config/auto/gmp.pm
==============================================================================
--- branches/pluggable_runcore/config/auto/gmp.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/auto/gmp.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -66,11 +66,6 @@
default => '-lgmp',
} );
- # On OS X check the presence of the gmp header in the standard
- # Fink location.
- $self->_handle_darwin_for_fink($conf, $osname, 'gmp.h');
- $self->_handle_darwin_for_macports($conf, $osname, 'gmp.h');
-
$conf->cc_gen('config/auto/gmp/gmp_c.in');
eval { $conf->cc_build( q{}, $extra_libs); };
my $has_gmp = 0;
Deleted: branches/pluggable_runcore/config/auto/macports.pm
==============================================================================
--- branches/pluggable_runcore/config/auto/macports.pm Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,104 +0,0 @@
-# Copyright (C) 2005-2007, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-config/auto/macports.pm - Determine Macports location on Darwin
-
-=head1 DESCRIPTION
-
-If the operating system is Darwin, this class determines whether or not
-Macports is installed in the default location.
-
-B<Note:> No provision is yet made for Macports installation in non-default
-locations.
-
-B<Note:> This step is currently Darwin/Macports-specific because it
-consolidates code previously found in multiple configuration step classes.
-With some modification it may be suitable for application to BSD F<ports>
-programs in general, but as there was no BSD-specific code in the
-configuration step classes, that modification has not yet been made.
-
-=cut
-
-package auto::macports;
-
-use strict;
-use warnings;
-
-use File::Spec;
-use base qw(Parrot::Configure::Step);
-
-use Parrot::Configure::Utils ':auto';
-use Parrot::BuildUtil;
-
-sub _init {
- my $self = shift;
- my %data;
- $data{description} = q{Determine Macports location on Darwin};
- $data{result} = q{};
- my $optlocal = File::Spec->catdir( '/', 'opt', 'local' );
- $data{ports_root} = (defined $ENV{TEST_MACPORTS})
- ? $ENV{TEST_MACPORTS}
- : (-d $optlocal)
- ? $optlocal
- : undef;
- return \%data;
-}
-
-sub runstep {
- my ( $self, $conf ) = ( shift, shift );
- my $osname = $conf->data->get_p5( 'OSNAME' );
- my $verbose = $conf->options->get( 'verbose' );
- unless ($osname =~ /darwin/) {
- print "Operating system is $osname; Macports is Darwin only\n"
- if $verbose;
- $self->set_result('skipped');
- return 1;
- }
- if (! defined $self->{ports_root}) {
- print "Could not locate Macports root directory\n"
- if $verbose;
- $self->set_result('no');
- return 1;
- }
-
- my $ports_base_dir = $self->{ports_root};
- my $ports_lib_dir = qq{$ports_base_dir/lib};
- my $ports_include_dir = qq{$ports_base_dir/include};
- my @unlocateables;
- foreach my $dir ($ports_base_dir, $ports_lib_dir, $ports_include_dir) {
- push @unlocateables, $dir unless (-d $dir);
- }
- if (@unlocateables) {
- print "Could not locate Macports directories: @unlocateables\n"
- if $verbose;
- $self->set_result('no');
- return 1;
- }
- else {
- $conf->data->set(
- ports_base_dir => $ports_base_dir,
- ports_lib_dir => $ports_lib_dir,
- ports_include_dir => $ports_include_dir,
- );
- $self->set_result('yes');
- return 1;
- }
-}
-
-1;
-
-=head1 AUTHOR
-
-James E Keenan, consolidating code written by Alberto SimÃes, Leopold Toetsch
-and others.
-
-=cut
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
Modified: branches/pluggable_runcore/config/auto/opengl.pm
==============================================================================
--- branches/pluggable_runcore/config/auto/opengl.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/auto/opengl.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -179,12 +179,6 @@
default => '-lglut -lGLU -lGL',
} );
- # On OS X check the presence of the OpenGL headers in the standard
- # Fink/macports locations.
- # Mindlessly morphed from readline ... may need to be fixed
- $self->_handle_darwin_for_fink ($conf, $osname, 'GL/glut.h');
- $self->_handle_darwin_for_macports($conf, $osname, 'GL/glut.h');
-
$conf->cc_gen('config/auto/opengl/opengl_c.in');
my $has_glut = 0;
eval { $conf->cc_build( q{}, $extra_libs ) };
Modified: branches/pluggable_runcore/config/auto/pcre.pm
==============================================================================
--- branches/pluggable_runcore/config/auto/pcre.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/auto/pcre.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -56,11 +56,6 @@
default => '-lpcre',
} );
- # On OS X check the presence of the pcre headers in the standard
- # Fink/macports locations.
- $self->_handle_darwin_for_fink ($conf, $osname, 'pcre.h');
- $self->_handle_darwin_for_macports($conf, $osname, 'pcre.h');
-
$conf->cc_gen('config/auto/pcre/pcre_c.in');
eval { $conf->cc_build( q{}, $extra_libs ) };
my $has_pcre = 0;
Modified: branches/pluggable_runcore/config/auto/readline.pm
==============================================================================
--- branches/pluggable_runcore/config/auto/readline.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/auto/readline.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -49,11 +49,6 @@
default => '-lreadline',
} );
- # On OS X check the presence of the readline header in the standard
- # Fink/macports locations.
- $self->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h');
- $self->_handle_darwin_for_macports($conf, $osname, q{readline/readline.h});
-
$conf->cc_gen('config/auto/readline/readline_c.in');
my $has_readline = 0;
eval { $conf->cc_build( q{}, $extra_libs ) };
Modified: branches/pluggable_runcore/config/gen/call_list/misc.in
==============================================================================
--- branches/pluggable_runcore/config/gen/call_list/misc.in Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/gen/call_list/misc.in Fri Aug 14 01:24:23 2009 (r40541)
@@ -227,6 +227,8 @@
v pip
p pti
i ppp
+# added by RNH for the RenderXXX_XXXX text routines
+p ptii
# Used by SDL::Font
p ti
Modified: branches/pluggable_runcore/config/gen/config_pm/config_pir.in
==============================================================================
--- branches/pluggable_runcore/config/gen/config_pm/config_pir.in Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/gen/config_pm/config_pir.in Fri Aug 14 01:24:23 2009 (r40541)
@@ -49,7 +49,7 @@
$S0 = concat prefix, "/runtime"
$I0 = stat $S0, .STAT_EXISTS
if $I0 goto L1
- conf_file = prefix . "/lib at versiondir@/include/config.fpmc"
+ conf_file = "@libdir@@versiondir@/include/config.fpmc"
goto L2
L1:
conf_file = prefix . "/runtime/parrot/include/config.fpmc"
Modified: branches/pluggable_runcore/config/gen/makefiles/dynoplibs.in
==============================================================================
--- branches/pluggable_runcore/config/gen/makefiles/dynoplibs.in Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/gen/makefiles/dynoplibs.in Fri Aug 14 01:24:23 2009 (r40541)
@@ -10,13 +10,11 @@
RECONFIGURE := $(PERL) $(BUILD_DIR)/tools/dev/reconfigure.pl
INSTALL_DIR := $(BUILD_DIR)/runtime/parrot/dynext
O := @o@
-CC := @cc@ -c
+CC := @cc@
LD := @ld@
LDFLAGS := @ldflags@ @ld_debug@ @rpath_blib@ @linkflags@
LD_LOAD_FLAGS := @ld_load_flags@
CFLAGS := @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@
-CC_OUT := @cc_o_out@
-LD_OUT := @ld_out@
LIBPARROT := @libparrot_ldflags@
BUILD_TOOLS_DIR := $(BUILD_DIR)@slash at tools@slash at build
@@ -28,7 +26,11 @@
#IF(cg_flag): obscure_ops_cg$(LOAD_EXT) \
#IF(cg_flag): obscure_ops_cgp$(LOAD_EXT) \
obscure_ops$(LOAD_EXT) \
- obscure_ops_switch$(LOAD_EXT)
+ obscure_ops_switch$(LOAD_EXT) \
+#IF(cg_flag): math_ops_cg$(LOAD_EXT) \
+#IF(cg_flag): math_ops_cgp$(LOAD_EXT) \
+ math_ops$(LOAD_EXT) \
+ math_ops_switch$(LOAD_EXT)
CLEANUPS := \
"*.c" \
@@ -52,41 +54,77 @@
cd $(BUILD_DIR) && $(RECONFIGURE) --step=gen::makefiles --target=src/dynoplibs/Makefile
obscure_ops$(LOAD_EXT): obscure_ops$(O)
- $(LD) $(LD_OUT)obscure_ops$(LOAD_EXT) obscure_ops$(O) $(LINKARGS)
+ $(LD) @ld_out at obscure_ops$(LOAD_EXT) obscure_ops$(O) $(LINKARGS)
obscure_ops$(O): obscure_ops.c
- $(CC) $(CC_OUT)obscure_ops$(O) $(INCLUDES) $(CFLAGS) obscure_ops.c
+ $(CC) -c @cc_o_out at obscure_ops$(O) $(INCLUDES) $(CFLAGS) obscure_ops.c
obscure_ops.c: obscure.ops
$(OPS2C) C --dynamic obscure.ops
obscure_ops_switch$(LOAD_EXT): obscure_ops_switch$(O)
- $(LD) $(LD_OUT)obscure_ops_switch$(LOAD_EXT) obscure_ops_switch$(O) $(LINKARGS)
+ $(LD) @ld_out at obscure_ops_switch$(LOAD_EXT) obscure_ops_switch$(O) $(LINKARGS)
obscure_ops_switch$(O): obscure_ops_switch.c
- $(CC) $(CC_OUT)obscure_ops_switch$(O) $(INCLUDES) $(CFLAGS) obscure_ops_switch.c
+ $(CC) -c @cc_o_out at obscure_ops_switch$(O) $(INCLUDES) $(CFLAGS) obscure_ops_switch.c
obscure_ops_switch.c: obscure.ops
$(OPS2C) CSwitch --dynamic obscure.ops
obscure_ops_cg$(LOAD_EXT): obscure_ops_cg$(O)
- $(LD) $(LD_OUT)obscure_ops_cg$(LOAD_EXT) obscure_ops_cg$(O) $(LINKARGS)
+ $(LD) @ld_out at obscure_ops_cg$(LOAD_EXT) obscure_ops_cg$(O) $(LINKARGS)
obscure_ops_cg$(O): obscure_ops_cg.c
- $(CC) $(CC_OUT)obscure_ops_cg$(O) $(INCLUDES) $(CFLAGS) obscure_ops_cg.c
+ $(CC) -c @cc_o_out at obscure_ops_cg$(O) $(INCLUDES) $(CFLAGS) obscure_ops_cg.c
obscure_ops_cg.c: obscure.ops
$(OPS2C) CGoto --dynamic obscure.ops
obscure_ops_cgp$(LOAD_EXT): obscure_ops_cgp$(O)
- $(LD) $(LD_OUT)obscure_ops_cgp$(LOAD_EXT) obscure_ops_cgp$(O) $(LINKARGS)
+ $(LD) @ld_out at obscure_ops_cgp$(LOAD_EXT) obscure_ops_cgp$(O) $(LINKARGS)
obscure_ops_cgp$(O): obscure_ops_cgp.c
- $(CC) $(CC_OUT)obscure_ops_cgp$(O) $(INCLUDES) $(CFLAGS) obscure_ops_cgp.c
+ $(CC) -c @cc_o_out at obscure_ops_cgp$(O) $(INCLUDES) $(CFLAGS) obscure_ops_cgp.c
obscure_ops_cgp.c: obscure.ops
$(OPS2C) CGP --dynamic obscure.ops
+math_ops$(LOAD_EXT): math_ops$(O)
+ $(LD) @ld_out at math_ops$(LOAD_EXT) math_ops$(O) $(LINKARGS)
+
+math_ops$(O): math_ops.c
+ $(CC) -c @cc_o_out at math_ops$(O) $(INCLUDES) $(CFLAGS) math_ops.c
+
+math_ops.c: math.ops
+ $(OPS2C) C --dynamic math.ops
+
+math_ops_switch$(LOAD_EXT): math_ops_switch$(O)
+ $(LD) @ld_out at math_ops_switch$(LOAD_EXT) math_ops_switch$(O) $(LINKARGS)
+
+math_ops_switch$(O): math_ops_switch.c
+ $(CC) -c @cc_o_out at math_ops_switch$(O) $(INCLUDES) $(CFLAGS) math_ops_switch.c
+
+math_ops_switch.c: math.ops
+ $(OPS2C) CSwitch --dynamic math.ops
+
+math_ops_cg$(LOAD_EXT): math_ops_cg$(O)
+ $(LD) @ld_out at math_ops_cg$(LOAD_EXT) math_ops_cg$(O) $(LINKARGS)
+
+math_ops_cg$(O): math_ops_cg.c
+ $(CC) -c @cc_o_out at math_ops_cg$(O) $(INCLUDES) $(CFLAGS) math_ops_cg.c
+
+math_ops_cg.c: math.ops
+ $(OPS2C) CGoto --dynamic math.ops
+
+math_ops_cgp$(LOAD_EXT): math_ops_cgp$(O)
+ $(LD) @ld_out at math_ops_cgp$(LOAD_EXT) math_ops_cgp$(O) $(LINKARGS)
+
+math_ops_cgp$(O): math_ops_cgp.c
+ $(CC) -c @cc_o_out at math_ops_cgp$(O) $(INCLUDES) $(CFLAGS) math_ops_cgp.c
+
+math_ops_cgp.c: math.ops
+ $(OPS2C) CGP --dynamic math.ops
+
test : all
cd ../.. && $(PERL) -Ilib t/harness t/dynoplibs/*.t
Modified: branches/pluggable_runcore/config/gen/makefiles/dynpmc.in
==============================================================================
--- branches/pluggable_runcore/config/gen/makefiles/dynpmc.in Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/gen/makefiles/dynpmc.in Fri Aug 14 01:24:23 2009 (r40541)
@@ -10,13 +10,11 @@
RECONFIGURE := $(PERL) $(BUILD_DIR)/tools/dev/reconfigure.pl
INSTALL_DIR := $(BUILD_DIR)@slash at runtime@slash at parrot@slash at dynext
O := @o@
-CC := @cc@ -c
+CC := @cc@
LD := @ld@
LDFLAGS := @ldflags@ @ld_debug@ @rpath_blib@
LD_LOAD_FLAGS := @ld_load_flags@
CFLAGS := @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@
-CC_OUT := @cc_o_out@
-LD_OUT := @ld_out@
LIBPARROT := @libparrot_ldflags@
BUILD_TOOLS_DIR := $(BUILD_DIR)@slash at tools@slash at build
@@ -31,8 +29,7 @@
# add your dynamic pmcs here
PMC_TARGETS := \
dynlexpad$(LOAD_EXT) \
- foo$(LOAD_EXT) \
- pair$(LOAD_EXT) \
+ foo_group$(LOAD_EXT) \
rotest$(LOAD_EXT) \
#IF(has_gdbm): gdbmhash$(LOAD_EXT) \
rational$(LOAD_EXT) \
@@ -59,6 +56,14 @@
sha256$(O) \
sha512$(O)
+PMCS_FOO := \
+ foo.pmc \
+ foo2.pmc
+
+OBJS_FOO := \
+ foo$(O) \
+ foo2$(O)
+
#IF(win32 and cc==gcc):LIB_GDBM := -llibgdbm
#ELSIF(win32):LIB_GDBM := libgdbm.lib
#ELSE:LIB_GDBM := -lgdbm
@@ -93,10 +98,10 @@
cd $(BUILD_DIR) && $(RECONFIGURE) --step=gen::makefiles --target=src/dynpmc/Makefile
dynlexpad$(LOAD_EXT): dynlexpad$(O)
- $(LD) $(LD_OUT)dynlexpad$(LOAD_EXT) dynlexpad$(O) $(LINKARGS)
+ $(LD) @ld_out at dynlexpad$(LOAD_EXT) dynlexpad$(O) $(LINKARGS)
dynlexpad$(O): dynlexpad.c
- $(CC) $(CC_OUT)dynlexpad$(O) $(INCLUDES) $(CFLAGS) dynlexpad.c
+ $(CC) -c @cc_o_out at dynlexpad$(O) $(INCLUDES) $(CFLAGS) dynlexpad.c
dynlexpad.c: dynlexpad.dump
$(PMC2CC) dynlexpad.pmc
@@ -104,11 +109,17 @@
dynlexpad.dump: dynlexpad.pmc
$(PMC2CD) dynlexpad.pmc
-foo$(LOAD_EXT): foo$(O)
- $(LD) $(LD_OUT)foo$(LOAD_EXT) foo$(O) $(LINKARGS)
+foo_group$(LOAD_EXT): $(OBJS_FOO) lib-foo_group$(O)
+ $(LD) @ld_out at foo_group$(LOAD_EXT) lib-foo_group$(O) $(OBJS_FOO) $(LINKARGS)
+
+lib-foo_group$(O): foo_group.c
+ $(CC) -c @cc_o_out at lib-foo_group$(O) $(INCLUDES) $(CFLAGS) foo_group.c
+
+foo_group.c: $(OBJS_FOO)
+ $(PMC2C) --library foo_group --c $(PMCS_FOO)
foo$(O): foo.c
- $(CC) $(CC_OUT)foo$(O) $(INCLUDES) $(CFLAGS) foo.c
+ $(CC) -c @cc_o_out at foo$(O) $(INCLUDES) $(CFLAGS) foo.c
foo.c: foo.dump
$(PMC2CC) foo.pmc
@@ -116,23 +127,20 @@
foo.dump: foo.pmc
$(PMC2CD) foo.pmc
-pair$(LOAD_EXT): pair$(O)
- $(LD) $(LD_OUT)pair$(LOAD_EXT) pair$(O) $(LINKARGS)
-
-pair$(O): pair.c
- $(CC) $(CC_OUT)pair$(O) $(INCLUDES) $(CFLAGS) pair.c
+foo2$(O): foo2.c
+ $(CC) -c @cc_o_out at foo2$(O) $(INCLUDES) $(CFLAGS) foo2.c
-pair.c: pair.dump
- $(PMC2CC) pair.pmc
+foo2.c: foo2.dump foo.pmc
+ $(PMC2CC) foo2.pmc
-pair.dump: pair.pmc
- $(PMC2CD) pair.pmc
+foo2.dump: foo2.pmc foo.dump
+ $(PMC2CD) foo2.pmc
rotest$(LOAD_EXT): rotest$(O)
- $(LD) $(LD_OUT)rotest$(LOAD_EXT) rotest$(O) $(LINKARGS)
+ $(LD) @ld_out at rotest$(LOAD_EXT) rotest$(O) $(LINKARGS)
rotest$(O): rotest.c
- $(CC) $(CC_OUT)rotest$(O) $(INCLUDES) $(CFLAGS) rotest.c
+ $(CC) -c @cc_o_out at rotest$(O) $(INCLUDES) $(CFLAGS) rotest.c
rotest.c: rotest.dump
$(PMC2CC) rotest.pmc
@@ -141,10 +149,10 @@
$(PMC2CD) rotest.pmc
gdbmhash$(LOAD_EXT): gdbmhash$(O)
- $(LD) $(LD_OUT)gdbmhash$(LOAD_EXT) gdbmhash$(O) $(LINKARGS) $(LIB_GDBM)
+ $(LD) @ld_out at gdbmhash$(LOAD_EXT) gdbmhash$(O) $(LINKARGS) $(LIB_GDBM)
gdbmhash$(O): gdbmhash.c
- $(CC) $(CC_OUT)gdbmhash$(O) $(INCLUDES) $(CFLAGS) gdbmhash.c
+ $(CC) -c @cc_o_out at gdbmhash$(O) $(INCLUDES) $(CFLAGS) gdbmhash.c
gdbmhash.c: gdbmhash.dump
$(PMC2CC) gdbmhash.pmc
@@ -153,10 +161,10 @@
$(PMC2CD) gdbmhash.pmc
rational$(LOAD_EXT): rational$(O)
- $(LD) $(LD_OUT)rational$(LOAD_EXT) rational$(O) $(LINKARGS)
+ $(LD) @ld_out at rational$(LOAD_EXT) rational$(O) $(LINKARGS)
rational$(O): rational.c
- $(CC) $(CC_OUT)rational$(O) $(INCLUDES) $(CFLAGS) rational.c
+ $(CC) -c @cc_o_out at rational$(O) $(INCLUDES) $(CFLAGS) rational.c
rational.c: rational.dump
$(PMC2CC) rational.pmc
@@ -165,16 +173,16 @@
$(PMC2CD) rational.pmc
digest_group$(LOAD_EXT): $(OBJS_DIGEST) lib-digest_group$(O)
- $(LD) $(LD_OUT)digest_group$(LOAD_EXT) lib-digest_group$(O) $(OBJS_DIGEST) $(LINKARGS) $(LIB_CRYPTO)
+ $(LD) @ld_out at digest_group$(LOAD_EXT) lib-digest_group$(O) $(OBJS_DIGEST) $(LINKARGS) $(LIB_CRYPTO)
lib-digest_group$(O): digest_group.c
- $(CC) $(CC_OUT)lib-digest_group$(O) $(INCLUDES) $(CFLAGS) digest_group.c
+ $(CC) -c @cc_o_out at lib-digest_group$(O) $(INCLUDES) $(CFLAGS) digest_group.c
digest_group.c: $(OBJS_DIGEST)
$(PMC2C) --library digest_group --c $(PMCS_DIGEST)
md2$(O): md2.c
- $(CC) $(CC_OUT)md2$(O) $(INCLUDES) $(CFLAGS) md2.c
+ $(CC) -c @cc_o_out at md2$(O) $(INCLUDES) $(CFLAGS) md2.c
md2.c: md2.dump
$(PMC2CC) md2.pmc
@@ -183,7 +191,7 @@
$(PMC2CD) md2.pmc
md4$(O): md4.c
- $(CC) $(CC_OUT)md4$(O) $(INCLUDES) $(CFLAGS) md4.c
+ $(CC) -c @cc_o_out at md4$(O) $(INCLUDES) $(CFLAGS) md4.c
md4.c: md4.dump
$(PMC2CC) md4.pmc
@@ -192,7 +200,7 @@
$(PMC2CD) md4.pmc
md5$(O): md5.c
- $(CC) $(CC_OUT)md5$(O) $(INCLUDES) $(CFLAGS) md5.c
+ $(CC) -c @cc_o_out at md5$(O) $(INCLUDES) $(CFLAGS) md5.c
md5.c: md5.dump
$(PMC2CC) md5.pmc
@@ -201,7 +209,7 @@
$(PMC2CD) md5.pmc
ripemd160$(O): ripemd160.c
- $(CC) $(CC_OUT)ripemd160$(O) $(INCLUDES) $(CFLAGS) ripemd160.c
+ $(CC) -c @cc_o_out at ripemd160$(O) $(INCLUDES) $(CFLAGS) ripemd160.c
ripemd160.c: ripemd160.dump
$(PMC2CC) ripemd160.pmc
@@ -210,7 +218,7 @@
$(PMC2CD) ripemd160.pmc
sha$(O): sha.c
- $(CC) $(CC_OUT)sha$(O) $(INCLUDES) $(CFLAGS) sha.c
+ $(CC) -c @cc_o_out at sha$(O) $(INCLUDES) $(CFLAGS) sha.c
sha.c: sha.dump
$(PMC2CC) sha.pmc
@@ -219,7 +227,7 @@
$(PMC2CD) sha.pmc
sha1$(O): sha1.c
- $(CC) $(CC_OUT)sha1$(O) $(INCLUDES) $(CFLAGS) sha1.c
+ $(CC) -c @cc_o_out at sha1$(O) $(INCLUDES) $(CFLAGS) sha1.c
sha1.c: sha1.dump
$(PMC2CC) sha1.pmc
@@ -228,7 +236,7 @@
$(PMC2CD) sha1.pmc
sha256$(O): sha256.c
- $(CC) $(CC_OUT)sha256$(O) $(INCLUDES) $(CFLAGS) sha256.c
+ $(CC) -c @cc_o_out at sha256$(O) $(INCLUDES) $(CFLAGS) sha256.c
sha256.c: sha256.dump
$(PMC2CC) sha256.pmc
@@ -237,7 +245,7 @@
$(PMC2CD) sha256.pmc
sha512$(O): sha512.c
- $(CC) $(CC_OUT)sha512$(O) $(INCLUDES) $(CFLAGS) sha512.c
+ $(CC) -c @cc_o_out at sha512$(O) $(INCLUDES) $(CFLAGS) sha512.c
sha512.c: sha512.dump
$(PMC2CC) sha512.pmc
@@ -246,10 +254,10 @@
$(PMC2CD) sha512.pmc
subproxy$(LOAD_EXT): subproxy$(O)
- $(LD) $(LD_OUT)subproxy$(LOAD_EXT) subproxy$(O) $(LINKARGS)
+ $(LD) @ld_out at subproxy$(LOAD_EXT) subproxy$(O) $(LINKARGS)
subproxy$(O): subproxy.c
- $(CC) $(CC_OUT)subproxy$(O) $(INCLUDES) $(CFLAGS) subproxy.c
+ $(CC) -c @cc_o_out at subproxy$(O) $(INCLUDES) $(CFLAGS) subproxy.c
subproxy.c: subproxy.dump
$(PMC2CC) subproxy.pmc
Modified: branches/pluggable_runcore/config/gen/makefiles/root.in
==============================================================================
--- branches/pluggable_runcore/config/gen/makefiles/root.in Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/gen/makefiles/root.in Fri Aug 14 01:24:23 2009 (r40541)
@@ -112,6 +112,7 @@
RECONFIGURE := $(PERL) tools/dev/reconfigure.pl
INNO_SETUP := iscc
JIT_BUILD_TOOL := $(BUILD_TOOLS_DIR)/jit2c.pl
+TEMPDIR := @tempdir@
#IF(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
###############################################################################
@@ -318,7 +319,6 @@
$(LIBRARY_DIR)/YAML/Parser/Syck.pbc \
$(LIBRARY_DIR)/STM.pbc \
$(LIBRARY_DIR)/libpcre.pbc \
- $(LIBRARY_DIR)/Data/Replace.pbc \
$(LIBRARY_DIR)/postgres.pbc
# the dependencies of $(SRC_DIR)/jit_emit.h are done explicitly
@@ -461,7 +461,6 @@
$(SRC_DIR)/scheduler$(O) \
$(SRC_DIR)/spf_render$(O) \
$(SRC_DIR)/spf_vtable$(O) \
- $(SRC_DIR)/stacks$(O) \
$(SRC_DIR)/string/primitives$(O) \
$(SRC_DIR)/sub$(O) \
$(SRC_DIR)/thread$(O) \
@@ -502,7 +501,6 @@
MINIPARROT := $(CUR_DIR)/miniparrot$(EXE)
DIS := $(CUR_DIR)/pbc_disassemble$(EXE)
PDUMP := $(CUR_DIR)/pbc_dump$(EXE)
-PINFO := $(CUR_DIR)/pbc_info$(EXE)
PBCMERGE := $(CUR_DIR)/pbc_merge$(EXE)
PDB := $(CUR_DIR)/parrot_debugger$(EXE)
PBC_TO_EXE := $(CUR_DIR)/pbc_to_exe$(EXE)
@@ -513,7 +511,6 @@
INSTALLABLEPARROT := $(CUR_DIR)/installable_parrot$(EXE)
INSTALLABLEDIS := $(CUR_DIR)/installable_pbc_disassemble$(EXE)
INSTALLABLEPDUMP := $(CUR_DIR)/installable_pbc_dump$(EXE)
-INSTALLABLEPINFO := $(CUR_DIR)/installable_pbc_info$(EXE)
INSTALLABLEPBCMERGE := $(CUR_DIR)/installable_pbc_merge$(EXE)
INSTALLABLEPBCTOEXE := $(CUR_DIR)/installable_pbc_to_exe$(EXE)
INSTALLABLEPDB := $(CUR_DIR)/installable_parrot_debugger$(EXE)
@@ -588,17 +585,9 @@
###############################################################################
all : \
- flags_dummy \
- PARROT_LIBS \
- $(PARROT) \
- runtime/parrot/include/parrotlib.pbc \
- runtime/parrot/include/config.fpmc \
+ corevm \
docs \
- $(LIBNCI_TEST_SO) \
#IF(has_glut): $(LIBGLUTCB_SO) \
- $(GEN_LIBRARY) \
- dynpmc \
- dynoplibs \
compilers \
$(DIS) \
$(PARROT_CONFIG) \
@@ -606,7 +595,17 @@
$(PBCMERGE) \
$(PDB) \
$(PDUMP) \
- $(PINFO) \
+
+corevm : \
+ flags_dummy \
+ PARROT_LIBS \
+ $(PARROT) \
+ runtime/parrot/include/parrotlib.pbc \
+ runtime/parrot/include/config.fpmc \
+ $(LIBNCI_TEST_SO) \
+ $(GEN_LIBRARY) \
+ dynpmc \
+ dynoplibs \
$(GEN_LIBRARY) : $(PARROT)
@@ -641,7 +640,6 @@
$(SRC_DIR)/spf_vtable.str \
$(SRC_DIR)/string/api.str \
$(SRC_DIR)/sub.str \
- $(SRC_DIR)/stacks.str \
\
$(CLASS_STR_FILES)
@@ -678,13 +676,11 @@
@echo " world: 'all' and 'parrot_utils'."
@echo " installable: same as 'world', but targets for installation"
@echo ""
- @echo " parrot_utils: $(PDUMP), $(DIS), $(PINFO), $(PDB), $(PBCMERGE) and $(PBC_TO_EXE) $(PARROT_CONFIG)"
+ @echo " parrot_utils: $(PDUMP), $(DIS), $(PDB), $(PBCMERGE) and $(PBC_TO_EXE) $(PARROT_CONFIG)"
@echo " $(PDUMP):"
@echo " Parrot Dumper"
@echo " $(DIS):"
@echo " Parrot Disassembler"
- @echo " $(PINFO):"
- @echo " Information about Parrot Byte Code"
@echo " $(PDB):"
@echo " Parrot Debugger"
@echo " $(PBCMERGE):"
@@ -782,9 +778,9 @@
world : all parrot_utils
-parrot_utils : $(PDUMP) $(DIS) $(PINFO) $(PDB) $(PBCMERGE) $(PBC_TO_EXE) $(PARROT_CONFIG)
+parrot_utils : $(PDUMP) $(DIS) $(PDB) $(PBCMERGE) $(PBC_TO_EXE) $(PARROT_CONFIG)
-installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPINFO) $(INSTALLABLEPDB) $(INSTALLABLEPBCMERGE) $(INSTALLABLEPBCTOEXE) $(INSTALLABLECONFIG)
+installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPDB) $(INSTALLABLEPBCMERGE) $(INSTALLABLEPBCTOEXE) $(INSTALLABLECONFIG)
flags_dummy :
@@ -981,20 +977,6 @@
#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
-# pbc_info
-$(PINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT)
- $(LINK) @ld_out@$@ \
- $(SRC_DIR)/pbc_info$(O) \
- @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
-#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
-
-$(SRC_DIR)/pbc_info$(O) : $(INC_DIR)/parrot.h $(GEN_HEADERS)
-
-$(INSTALLABLEPINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT)
- $(LINK) @ld_out@$@ \
- $(SRC_DIR)/pbc_info$(O) \
- @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
-#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
#
# Parrot Bytecode File Merger
@@ -1073,7 +1055,7 @@
$(SRC_DIR)/global$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/global.str \
$(SRC_DIR)/pmc/pmc_sub.h
-$(SRC_DIR)/pmc$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/pmc$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_class.h
$(SRC_DIR)/pmc_freeze$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc_freeze.str
@@ -1180,7 +1162,7 @@
$(SRC_DIR)/call/ops$(O) : $(SRC_DIR)/call/ops.c $(GENERAL_H_FILES) \
$(SRC_DIR)/pmc/pmc_continuation.h
-$(IO_DIR)/api$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h $(IO_DIR)/api.str
+$(IO_DIR)/api$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h $(IO_DIR)/api.str $(SRC_DIR)/pmc/pmc_filehandle.h
$(IO_DIR)/buffer$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
@@ -1217,8 +1199,6 @@
$(SRC_DIR)/runcore/cores$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/runcore/cores.str
-$(SRC_DIR)/stacks$(O) : $(GENERAL_H_FILES)
-
$(SRC_DIR)/tsq$(O) : $(GENERAL_H_FILES)
$(SRC_DIR)/embed$(O) : $(GENERAL_H_FILES) $(INC_DIR)/debugger.h \
@@ -1530,7 +1510,7 @@
smoke : smolder_test
# "core tests" -- test basic functionality but not ancillaries
-coretest : test_prep
+coretest : corevm
$(PERL) t/harness $(EXTRA_TEST_ARGS) --core-tests
# automake compatibility
@@ -1556,23 +1536,6 @@
examples_tests \
distro_tests
-fulltest_all :
- - at make@ testb
-#IF(cg_flag): - at make@ testC
- - at make@ testf
-#IF(cg_flag): - at make@ testg
-#IF(jitcapable): - at make@ testj
- - at make@ testr
- - at make@ testS
- - at make@ src_tests
- - at make@ run_tests
- - at make@ perl_tests
- - at make@ codetest
- - at make@ manifest_tests
- - at make@ examples_tests
- - at make@ distro_tests
- - at make@ benchmark_tests
-
# bounds checking, slow core
testb : test_prep
$(PERL) t/harness $(EXTRA_TEST_ARGS) -b $(RUNCORE_TEST_FILES)
@@ -1695,7 +1658,6 @@
$(INSTALLABLEPARROT) \
$(INSTALLABLEDIS) \
$(INSTALLABLEPDUMP) \
- $(INSTALLABLEPINFO) \
$(INSTALLABLEPBCMERGE) \
$(INSTALLABLEPBCTOEXE) \
$(INSTALLABLEPDB) \
@@ -1704,7 +1666,6 @@
parrot_config$(EXE) parrot_config.c parrot_config$(O) parrot_config.pbc \
$(IMCC_DIR)/main$(O) \
$(PDUMP) $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \
- $(SRC_DIR)/pbc_info$(O) $(PINFO) \
$(PDB) $(SRC_DIR)/parrot_debugger$(O) \
$(PBCMERGE) $(SRC_DIR)/pbc_merge$(O) \
$(DIS) $(SRC_DIR)/pbc_disassemble$(O)
@@ -1735,13 +1696,11 @@
$(INSTALLABLEPARROT) \
$(INSTALLABLEDIS) \
$(INSTALLABLEPDUMP) \
- $(INSTALLABLEPINFO) \
$(INSTALLABLEPBCMERGE) \
$(INSTALLABLEPDB) \
$(INSTALLABLECONFIG) \
$(IMCC_DIR)/main$(O) \
$(PDUMP) $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \
- $(PINFO) $(SRC_DIR)/pbc_info$(O) \
$(PDB) $(SRC_DIR)/parrot_debugger$(O) \
$(PBCMERGE) $(SRC_DIR)/pbc_merge$(O) \
$(DIS) $(SRC_DIR)/pbc_disassemble$(O) \
@@ -1953,7 +1912,7 @@
# Temp directory for splint. Add +keep to splintflags if you want work files
# kept in there after completion.
-SPLINT_TMP := $(TMP)/splint
+SPLINT_TMP := $(TEMPDIR)/splint
# Splint flags: http://splint.org/manual/html/appB.html
# The dashes in the names don't make any difference to Splint, but I've
Modified: branches/pluggable_runcore/config/gen/opengl.pm
==============================================================================
--- branches/pluggable_runcore/config/gen/opengl.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/gen/opengl.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -1074,7 +1074,7 @@
callback_data[GLUT_CB_TIMER].interp = interp;
callback_data[GLUT_CB_TIMER].sub = sub;
- if (sub == PMCNULL)
+ if (PMC_IS_NULL(sub))
glutTimerFunc(0, NULL, 0);
else
glutTimerFunc(milliseconds, glut_timer_func, data);
@@ -1109,7 +1109,7 @@
callback_data[GLUT_CB_JOYSTICK].interp = interp;
callback_data[GLUT_CB_JOYSTICK].sub = sub;
- if (sub == PMCNULL)
+ if (PMC_IS_NULL(sub))
glutJoystickFunc(NULL, 0);
else
glutJoystickFunc(glut_joystick_func, pollinterval);
@@ -1149,7 +1149,7 @@
callback_data[$_->{enum}].interp = interp;
callback_data[$_->{enum}].sub = sub;
- if (sub == PMCNULL)
+ if (PMC_IS_NULL(sub))
$_->{glut}(NULL);
else
$_->{glut}($_->{thunk});
Modified: branches/pluggable_runcore/config/gen/parrot_include.pm
==============================================================================
--- branches/pluggable_runcore/config/gen/parrot_include.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/gen/parrot_include.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -33,8 +33,10 @@
include/parrot/events.h
include/parrot/scheduler.h
include/parrot/exceptions.h
+ include/parrot/hash.h
include/parrot/interpreter.h
include/parrot/io.h
+ include/parrot/library.h
include/parrot/longopt.h
include/parrot/multidispatch.h
include/parrot/packfile.h
Modified: branches/pluggable_runcore/config/gen/platform/generic/exec.c
==============================================================================
--- branches/pluggable_runcore/config/gen/platform/generic/exec.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/gen/platform/generic/exec.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2004-2008, Parrot Foundation.
+ * Copyright (C) 2004-2009, Parrot Foundation.
*/
/*
@@ -48,24 +48,25 @@
/* Are we the parent or child? */
if (child) {
/* parent */
- int status;
- pid_t returnstat;
- returnstat = waitpid(child, &status, 0);
+ int status;
+ pid_t returnstat = waitpid(child, &status, 0);
UNUSED(returnstat);
return status;
}
else {
- /* child. Be horribly profligate with memory, since we're
- about to be something else */
- int status;
- status = execlp("sh", "sh", "-c",
- Parrot_str_to_cstring(interp, command), (void *)NULL);
- /* if we get here, something's horribly wrong... */
- if (status) {
+ /* child */
+ char *cmd = Parrot_str_to_cstring(interp, command);
+ int status = execlp("sh", "sh", "-c", cmd, (void *)NULL);
+
+ /* if we get here, something's horribly wrong, but free anyway... */
+ mem_sys_free(cmd);
+
+ if (status)
exit(status);
- }
}
- return 1; /* make gcc happy */
+
+ /* make gcc happy */
+ return 1;
}
/*
Modified: branches/pluggable_runcore/config/gen/platform/generic/platform_limits.h
==============================================================================
--- branches/pluggable_runcore/config/gen/platform/generic/platform_limits.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/gen/platform/generic/platform_limits.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -9,10 +9,20 @@
/*
* Define the values for PARROT_INTVAL_MAX and PARROT_INTVAL_MIN
* in platforms that does no have limits.h or gives wrong values.
- * The generic versions assumes limits.h availability,
- * and does nothing.
+ * The generic versions assumes limits.h availability.
*/
+/* LLONG_MAX doesn't appear to be provided for some compilers of Win64, so
+ try to define them here. */
+#ifdef _MSC_VER
+# ifndef LLONG_MAX
+# define LLONG_MAX _I64_MAX
+# endif
+# ifndef LLONG_MIN
+# define LLONG_MIN _I64_MIN
+# endif
+#endif
+
#endif /* PARROT_PLATFORM_GENERIC_PLATFORM_LIMITS_GUARD */
/*
Modified: branches/pluggable_runcore/config/gen/platform/win32/time.c
==============================================================================
--- branches/pluggable_runcore/config/gen/platform/win32/time.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/gen/platform/win32/time.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -37,10 +37,10 @@
Parrot_intval_time(void)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400
-# if INTVAL_SIZE <= 4
- return _time32(NULL);
+# ifdef _WIN64
+ return (INTVAL)_time64(NULL);
# else
- return _time64(NULL);
+ return _time32(NULL);
# endif
#else
return time(NULL);
Modified: branches/pluggable_runcore/config/init/defaults.pm
==============================================================================
--- branches/pluggable_runcore/config/init/defaults.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/init/defaults.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -72,6 +72,9 @@
# to their 'use English' names as documented in 'perlvar'.)
$conf->data->set_p5( OSNAME => $^O );
+ my $ccdlflags = $Config{ccdlflags};
+ $ccdlflags =~ s/\s*-Wl,-rpath,\S*//g if $conf->options->get('disable-rpath');
+
# We need a Glossary somewhere!
$conf->data->set(
debugging => $conf->options->get('debugging') ? 1 : 0,
@@ -112,7 +115,7 @@
# Linker Flags to have this binary work with the shared and dynamically
# loadable libraries we're building. On HP-UX, for example, we need to
# allow dynamic libraries to access the binary's symbols
- link_dynamic => $Config{ccdlflags}, # e.g. -Wl,-E on HP-UX
+ link_dynamic => $ccdlflags, # e.g. -Wl,-E on HP-UX
# ld: Tool used to build shared libraries and dynamically loadable
# modules. Often $cc on Unix-ish systems, but apparently sometimes
@@ -240,12 +243,12 @@
# generate #line directives. These can confuse
# debugging internals.
no_lines_flag => $conf->options->get('no-line-directives') ? '--no-lines' : '',
+
+ tempdir => File::Spec->tmpdir,
);
# add profiling if needed
- # RT#41497 gcc syntax
- # we should have this in the hints files e.g. cc_profile
- # RT#41496 move profiling to it's own step
+ # RT #41497 gcc syntax
if ( $conf->options->get('profile') ) {
$conf->data->set(
cc_debug => " -pg ",
Modified: branches/pluggable_runcore/config/init/hints.pm
==============================================================================
--- branches/pluggable_runcore/config/init/hints.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/init/hints.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -37,6 +37,7 @@
my $hints_used = 0;
my $osname = lc( $conf->data->get_p5('OSNAME') );
+ $osname = 'linux' if ($osname eq 'gnukfreebsd');
my $hints_file = catfile('config', 'init', 'hints', "$osname.pm");
if ( -f $hints_file ) {
my $hints_pkg = "init::hints::" . $osname;
Modified: branches/pluggable_runcore/config/init/hints/darwin.pm
==============================================================================
--- branches/pluggable_runcore/config/init/hints/darwin.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/init/hints/darwin.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, Parrot Foundation.
+# Copyright (C) 2005-2009, Parrot Foundation.
# $Id$
package init::hints::darwin;
@@ -6,11 +6,18 @@
use strict;
use warnings;
+use lib qw( lib );
+use File::Spec ();
+use base qw(Parrot::Configure::Step);
+use Parrot::BuildUtil;
+
our %defaults = (
uname => `uname -r`,
sw_vers => `sw_vers -productVersion`,
problem_flags => [ qw( ccflags ldflags ) ],
architectures => [ qw( i386 ppc64 ppc x86_64 ) ],
+ fink_conf => q{/sw/etc/fink.conf},
+ ports_base_dir => q{/opt/local},
);
sub runstep {
@@ -39,7 +46,22 @@
my $lib_dir = $conf->data->get('build_dir') . "/blib/lib";
$flagsref->{ldflags} .= " -L$lib_dir";
- $flagsref->{ccflags} .= " -pipe -fno-common -Wno-long-double ";
+
+ if ($ENV{'MACOSX_DEPLOYMENT_TARGET'} eq '10.6') {
+ $flagsref->{ccflags} .= ' -pipe -fno-common ';
+ }
+ else {
+ $flagsref->{ccflags} .= ' -pipe -fno-common -Wno-long-double ';
+ }
+
+ $flagsref->{linkflags} .= " -undefined dynamic_lookup";
+
+ _probe_for_libraries($conf, $flagsref, 'fink');
+ _probe_for_libraries($conf, $flagsref, 'macports');
+
+ for my $flag ( keys %$flagsref ) {
+ $flagsref->{$flag} =~ s/^\s+//;
+ }
$conf->data->set(
darwin => 1,
@@ -51,7 +73,7 @@
share_ext => '.dylib',
load_ext => '.bundle',
link => 'c++',
- linkflags => '-undefined dynamic_lookup',
+ linkflags => $flagsref->{linkflags},
ld => 'c++',
ld_share_flags => '-dynamiclib -undefined dynamic_lookup',
ld_load_flags => '-undefined dynamic_lookup -bundle',
@@ -86,7 +108,7 @@
sub _strip_arch_flags_engine {
my ($arches, $stored, $flagsref, $flag) = @_;
- for my $arch ( @{ $defaults{architectures} } ) {
+ for my $arch ( @{ $arches } ) {
$stored =~ s/-arch\s+$arch//g;
$stored =~ s/\s+/ /g;
$flagsref->{$flag} = $stored;
@@ -144,8 +166,139 @@
}
}
+sub _probe_for_fink {
+ my $conf = shift;
+ my $verbose = $conf->options->get( 'verbose' );
+ # Per fink(8), this is location for Fink configuration file, presumably
+ # regardless of where Fink itself is installed.
+ my $fink_conf = $defaults{fink_conf};
+ unless (-f $fink_conf) {
+ print "Fink configuration file not located\n" if $verbose;
+ return;
+ }
+ my $fink_conf_str = Parrot::BuildUtil::slurp_file($fink_conf);
+ my @lines = split /\n/, $fink_conf_str;
+ my $fink_base_dir;
+ while (defined (my $l = shift @lines) ) {
+ chomp $l;
+ next unless $l =~ /^Basepath:\s(.*)/;
+ $fink_base_dir = $1;
+ last;
+ }
+ unless (defined $fink_base_dir) {
+ print "Fink configuration file defective: no 'Basepath'\n"
+ if $verbose;
+ return;
+ }
+ my $fink_lib_dir = qq{$fink_base_dir/lib};
+ my $fink_include_dir = qq{$fink_base_dir/include};
+ my @unlocateables;
+ foreach my $dir ($fink_base_dir, $fink_lib_dir, $fink_include_dir) {
+ push @unlocateables, $dir unless (-d $dir);
+ }
+ if (@unlocateables) {
+ print "Could not locate Fink directories: @unlocateables\n"
+ if $verbose;
+ return;
+ }
+ else {
+ my %addl_flags = (
+ linkflags => "-L$fink_lib_dir",
+ ldflags => "-L$fink_lib_dir",
+ ccflags => "-I$fink_include_dir",
+ );
+ return \%addl_flags;
+ }
+}
+
+sub _probe_for_macports {
+ my $conf = shift;
+ my $verbose = $conf->options->get( 'verbose' );
+ my $ports_base_dir = $defaults{ports_base_dir};
+ my $ports_lib_dir = qq{$ports_base_dir/lib};
+ my $ports_include_dir = qq{$ports_base_dir/include};
+ my @unlocateables;
+ foreach my $dir ($ports_base_dir, $ports_lib_dir, $ports_include_dir) {
+ push @unlocateables, $dir unless (-d $dir);
+ }
+ if (@unlocateables) {
+ print "Could not locate Macports directories: @unlocateables\n"
+ if $verbose;
+ return;
+ }
+ else {
+ my %addl_flags = (
+ linkflags => "-L$ports_lib_dir",
+ ldflags => "-L$ports_lib_dir",
+ ccflags => "-I$ports_include_dir",
+ );
+ return \%addl_flags;
+ }
+}
+
+sub _probe_for_libraries {
+ my ($conf, $flagsref, $library) = @_;
+ my $no_library_option = "darwin_no_$library";
+ my $title = ucfirst(lc($library));
+ my $verbose = $conf->options->get( 'verbose' );
+ unless ($conf->options->get( $no_library_option ) ) {
+ my $addl_flags_ref;
+ if ($library eq 'fink') {
+ $addl_flags_ref = _probe_for_fink($conf);
+ }
+ if ($library eq 'macports') {
+ $addl_flags_ref = _probe_for_macports($conf);
+ }
+ my $rv = _add_to_flags( $addl_flags_ref, $flagsref, $title, $verbose );
+ return $rv;
+ }
+ return;
+}
+
+sub _add_to_flags {
+ my ( $addl_flags_ref, $flagsref, $title, $verbose ) = @_;
+ if ( defined $addl_flags_ref ) {
+ foreach my $addl ( keys %{ $addl_flags_ref } ) {
+ my %seen;
+ if ( defined $flagsref->{$addl} ) {
+ my @elements = split /\s+/, $flagsref->{$addl};
+ %seen = map {$_, 1} @elements;
+ }
+ $flagsref->{$addl} .= " $addl_flags_ref->{$addl}"
+ unless $seen{ $addl_flags_ref->{$addl} };
+ }
+ print "Probe for $title successful\n" if $verbose;
+ }
+ else {
+ print "Probe for $title unsuccessful\n" if $verbose;
+ }
+ return 1;
+}
+
1;
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+init::hints::Darwin - hints for the Darwin compiler
+
+=head1 DESCRIPTION
+
+The functionality in this package is run automatically during configuration
+step F<init::hints> when run on Darwin.
+
+Among other things, this step probes for Fink and Macports libraries --
+functionality previously provided by configuration steps F<auto::fink> and
+F<auto::macports>, which have now been eliminated.
+
+Should you not want to search for either of these packages, you may specify
+the command-line options C<darwin_no_fink> and/or C<darwin_no_macports>.
+
+The functionality is tested in F<t/steps/init/hints/darwin-01.t>.
+
+=cut
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Modified: branches/pluggable_runcore/config/init/hints/mswin32.pm
==============================================================================
--- branches/pluggable_runcore/config/init/hints/mswin32.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/config/init/hints/mswin32.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -114,6 +114,8 @@
# Unclear if it's needed both for ld and link.
$conf->data->set( libparrot_ldflags => "\"$build_dir\\libparrot.lib\"" );
$conf->data->set( libparrot_linkflags => "\"$build_dir\\libparrot.lib\"" );
+ $conf->data->set( inst_libparrot_ldflags => "\"$bindir\\libparrot.lib\"" );
+ $conf->data->set( inst_libparrot_linkflags => "\"$bindir\\libparrot.lib\"" );
# 'link' needs to be link.exe, not cl.exe.
# This makes 'link' and 'ld' the same.
Deleted: branches/pluggable_runcore/docs/book/draft/ch04_compiler_tools.pod
==============================================================================
--- branches/pluggable_runcore/docs/book/draft/ch04_compiler_tools.pod Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,273 +0,0 @@
-=pod
-
-=head1 Parrot Compiler Tools
-
-Z<CHP-4>
-
-The previous chapters demonstrated low-level Parrot programming in PIR. That's
-fun, but Parrot's true power is to host programs written in high level
-languages such as Perl 6, Python, Ruby, Tcl, and PHP.
-
-Parrot's language neutrality was a conscious design decision. Parrot and Perl
-6 hewed closely in the early days; it would have been easy for the two to
-overlap and intermingle.
-
-By keeping the two projects separate and encapsulated, the possibility arose to
-support many other dynamic languages equally well. This modular design also
-benefits designers of future languages. Instead of having to reimplement
-low-level features such as garbage collection and dynamic data types, language
-designers and compiler implementers can leave these details of infrastructure
-to Parrot and focus on the syntax, capabilities, and libraries of their
-high-level languages instead.
-
-Parrot exposes a rich interface for these languages to use, offering several
-important features: a robust exceptions system, compilation into
-platform-independent bytecode, a clean extension and embedding interface,
-just-in-time compilation to machine code, native library interface mechanisms,
-garbage collection, support for objects and classes, and a robust concurrency
-model. Designing a new language or implementing a new compiler for an old
-language is easier with all of these features designed, implemented, tested,
-and supported in a VM already.
-
-Language interoperability is a core goal for Parrot. Different languages are
-suited to different tasks; heated debates explode across the Internet about
-which language is right for which project. There's rarely a perfect fit.
-Developers often settle for one particular language if only because it offers
-the fewest I<disadvantages>. Parrot changes this game by allowing developers
-to combine multiple languages seamlessly within a single project. Well-tested
-libraries written in one languages can interoperate with clean problem-domain
-expression in a second language, glued together by a third language which
-elegantly describes the entire system's architecture. You can use the
-strengths of multiple language and mitigate their weaknesses.
-
-For language hosting and interoperability to work, languages developers need to
-write compilers that convert source code written in high level languages to
-bytecode. This process is analogous to how a compiler such as GCC converts C
-or C++ into machine code -- though instead of targeting machine code for a
-specific hardware platform, compilers written in Parrot produce Parrot code
-which can run on any hardware platform that can run Parrot.
-
-Parrot includes a suite of compiler tools for every step of this conversion:
-lexical analysis, parsing, optimization, resource allocation, and code
-generation. Instead of using traditional low-level languages -- such as the C
-produced by C<lex> and C<yacc> -- to write compilers, Parrot can use any
-language hosted on Parrot in its compiler process. As a practical matter, the
-prevalent tool uses a subset of the Perl 6 programming language called I<Not
-Quite Perl>X<Not Quite Perl> (NQP) and an implementation of the Perl 6 Grammar
-Engine X<Perl 6 Grammar Engine> (PGE) to build compilers for Parrot.
-
-=begin notetip
-
-Yes, the Perl 6 compiler on Parrot is itself written in Perl 6. This
-X<bootstrapping> I<bootstrapping> process is mind-boggling at first.
-
-=end notetip
-
-PGE and NQP are part of the Parrot Compiler Tools. A<CHP-5> Chapter 5
-discusses PGE and A<CHP-6> Chapter 6 explains NQP.
-
-=head2 PCT Overview
-
-The X<Parrot Compiler Tools;PCT> Parrot Compiler Tools (PCT) enable the
-creation of high-level language compilers and runtimes. Though the Perl 6
-development team originally created these tools to produce Rakudo (Perl 6 on
-Parrot), several other Parrot-hosted compilers use them to great effect.
-Writing a compiler using Perl 6 syntax and dynamic language tools is much
-easier than writing a compiler in C, C<lex>, and C<yacc>.
-
-PCT contains several classes that implement various parts of a compiler. HLL
-developers write language-specific subclasses to fill in the details their
-languages require. The X<HLLCompiler> C<PCT::HLLCompiler> class specifies the
-compiler's interface and represents the object used to parse and execute code.
-The X<Parrot Compiler Tools;PCT::Grammar> C<PCT::Grammar> and X<Parrot Compiler
-Tools;PCT::Grammar::Actions> C<PCT::Grammar::Actions> classes represent the
-parser and syntax tree generators, respectively. Creating a new HLL compiler is
-as easy as subclassing these three entities with methods specific to your
-language.
-
-=head3 Grammars and Action Files
-
-A PCT-based compiler requires three basic files: the main entry point file, the
-grammar specification file, and the grammar actions file. In addition,
-compilers and the languages they implement often use large libaries of built-in
-routines to provide language-specific behaviors.
-
-=over 4
-
-=item * The main file
-
-The main file is (often) a PIR program which contains the C<:main> function
-that creates and executes the compiler object. This program instantiates a
-C<PCT::HLLCompiler> subclass, loads any necessary support libraries, and
-initializes any compiler- or languages-specific data.
-
-The main file tends to be short. The guts of the compiler logic is in the
-grammar and actions files. Runtime support and auxiliary functions often
-appear in other files, by convention. This separation of concerns tends to
-make compilers easier to maintain.
-
-=item * A grammar file
-
-The high-level language's grammar appears in a F<.pg> file. This file
-subclasses C<PCT::Grammar> class and implements all of the necessary rules --
-written using PGE -- to parse the languages.
-
-=item * An actions file
-
-Actions contains methods -- written in NQP -- on the C<PCT::Grammar:Actions>
-object which receive parse data from the grammar rules and construct an
-X<Abstract Syntax Tree;Parrot Abstract Syntax Tree;AST;PAST> Abstract Syntax
-Tree (AST).N<The Parrot version of an AST is, of course, the Parrot Abstract
-Syntax Tree, or PAST.>
-
-=back
-
-PCT's workflow is customizable, but simple. The compiler passes the source
-code of the HLL into the grammar engine. The grammer engine parses this code
-and returns a X<PGE;Match Object> special Match object which represents a
-parsed version of the code. The compiler then passes this match object to the
-action methods, which convert it in stages into PAST. The compiler finally
-converts this PAST into PIR code, which it can save to a file, convert to
-bytecode, or execute directly.
-
-=head3 C<mk_language_shell.pl>
-
-The only way creating a new language compiler could be easier is if these files
-created themselves. PCT includes a tool to do just that:
-C<mk_language_shell.pl>. This program automatically creates a new directory in
-F<languages/> for your new language, the necessary three files, starter files
-for libraries, a F<Makefile> to automate the build process, and a basic test
-harness to demonstrate that your language works as expects.
-
-These generated files are all stubs which will require extensive editing to
-implement a full language, but they are a well-understood and working starting
-point. With this single command you can create a working compiler. It's up to
-you to fill the details.
-
-C<mk_language_shell.pl> prefers to run from within a working Parrot repository.
-It requires a single argument, the name of the new project to create. There
-are no hard-and-fast rules about names, but the Parrot developers reccomend
-that Parrot-based implementations of existing languages use unique names.
-
-Consider the names of Perl 5 distributions: Active Perl and Strawberry Perl.
-Python implementations are IronPython (running on the CLR) and Jython (running
-on the JVM). The Ruby-on-Parrot compiler isn't just "Ruby": it's Cardinal.
-The Tcl compiler on Parrot is Partcl.
-
-An entirely new language has no such constraints.
-
-From the Parrot directory, invoke C<mk_language_shell.pl> like:
-
- $ B<cd languages/>
- $ B<perl ../tools/build/mk_language_shell.pl <project name>>
-
-=head3 Parsing Fundamentals
-
-An important part of a compiler is the parser and lexical analyzer. The
-lexical analyzer converts the HLL input file into individual tokens. A token
-may consist of an individual punctuation ("+"), an identifier ("myVar"), a
-keyword ("while"), or any other artifact that stands on its own as a single
-unit. The parser attempts to match a stream of these input tokens against a
-given pattern, or grammar. The matching process orders the input tokens into an
-abstract syntax tree which the other portions of the compiler can process.
-
-X<top-down parser>
-X<bottom-up parser>
-X<parsers; top-down>
-X<parsers; bottom-up>
-Parsers come in top-down and bottom-up varieties. Top-down parsers start with a
-top-level rule which represents the entire input. It attempts to match various
-combination of subrules until it has consumed the entire input. Bottom-down
-parsers start with individual tokens from the lexical analyzer and attempt to
-combine them together into larger and larger patterns until they produce a
-top-level token.
-
-PGE is a top-down parser, although it also contains a bottom-up I<operator
-precedence> parser to make processing token clusters such as mathematical
-expressions more efficient.
-
-=head2 Driver Programs
-
-The driver program for the new compiler must create instances of the various
-necessary classes that run the parser. It must also include the standard
-function libraries, create global variables, and handle commandline options.
-PCT provides several useful command-line options, but driver programs may need
-to override several behaviors.
-
-PCT programs can run in two ways. An interactive mode runs one statement at a
-time in the console. A file mode loads and runs an entire file at once. A
-driver program may specificy information about the interactive prompt and
-environment, as well as help and error messages.
-
-=head3 C<HLLCompiler> class
-
-The C<HLLCompiler> class implements a compiler object. This object contains
-references to language-specific parser grammar and actions files, as well as
-the steps involved in the compilation process. The stub compiler created by
-C<mk_language_shell.pl> might resemble:
-
- .sub 'onload' :anon :load :init
- load_bytecode 'PCT.pbc'
- $P0 = get_hll_global ['PCT'], 'HLLCompiler'
- $P1 = $P0.'new'()
- $P1.'language'('MyCompiler')
- $P1.'parsegrammar'('MyCompiler::Grammar')
- $P1.'parseactions'('MyCompiler::Grammar::Actions')
- .end
-
- .sub 'main' :main
- .param pmc args
- $P0 = compreg 'MyCompiler'
- $P1 = $P0.'command_line'(args)
- .end
-
-The C<:onload> function creates the driver object as an instance of
-C<HLLCompiler>, sets the necessary options, and registers the compiler with
-Parrot. The C<:main> function drives parsing and execution begin. It calls the
-C<compreg> opcode to retrieve the registered compiler object for the language
-"MyCompiler" and invokes that compiler object using the options received from
-the commandline.
-
-The C<compreg> opcode hides some of Parrot's magic; you can use it multiple
-times in a program to compile and run different languages. You can create
-multiple instances of a compiler object for a single language (such as for
-runtime C<eval>) or you can create compiler objects for multiple languages for
-easy interoperability. The Rakudo Perl 6 C<eval> function uses this mechanism
-to allow runtime eval of code snippets in other languages:
-
- eval("puts 'Konnichiwa'", :lang<Ruby>);
-
-=head3 C<HLLCompiler> methods
-
-The previous example showed the use of several HLLCompiler methods:
-C<language>, C<parsegrammar>, and C<parseactions>. These three methods are the
-bare minimum interface any PCT-based compiler should provide. The C<language>
-method takes a string argument that is the name of the compiler. The
-HLLCompiler object uses this name to register the compiler object with Parrot.
-The C<parsegrammar> method creates a reference to the grammar file that you
-write with PGE. The C<parseactions> method takes the class name of the NQP file
-used to create the AST-generator for the compiler.
-
-If your compiler needs additional features, there are several other available
-methods:
-
-=over 4
-
-=item * C<commandline_prompt>
-
-The C<commandline_prompt> method allows you to specify a custom prompt to
-display to users in interactive mode.
-
-=item * C<commandline_banner>
-
-The C<commandline_banner> method allows you to specify a banner message that
-displays at the beginning of interactive mode.
-
-=back
-
-=cut
-
-# Local variables:
-# c-file-style: "parrot"
-# End:
-# vim: expandtab shiftwidth=4:
Deleted: branches/pluggable_runcore/docs/book/draft/ch05_pge.pod
==============================================================================
--- branches/pluggable_runcore/docs/book/draft/ch05_pge.pod Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,1558 +0,0 @@
-=pod
-
-=head1 Grammar Engine
-
-X<Parrot Grammar Engine>
-X<PGE (Parrot Grammar Engine)>
-The Parrot Grammar Engine (PGE) is a parser generator, one of the key
-components of the Parrot Compiler Toolkit. It reads grammar files written in
-the PGE rules format and generates parser modules written in PIR code. PGE
-rules provide the full power of I<recursive descent parsing> and I<operator
-precedence parsing>. Fortunately, you don't need to know what those terms
-mean in order to make good use of PGE. We'll introduce the necessary
-concepts as we talk about various features in this chapter.
-
-=head2 Grammars
-
-The ultimate goal of a parser is to match patterns in a source language and
-convert them to an internal data structure for later manipulations. As a
-programmer, you're probably already familiar with some of these types of
-patterns: function declarations, function calls, statements, and assignments.
-Each of these different concepts have a particular form called a I<syntax>.
-In C for example, the syntax to define a function looks something like this:
-
- <return_type> <function_name> ( <arguments> ) { <function_body> }
-
-Things that fit this pattern, so long as all the sub-patterns use the proper
-syntax also, are valid subroutines in C. Similarly, we can use a slightly
-different pattern to create a subroutine:
-
- sub <function_name> { <function_body> }
-
-A grammar is a collection of rules like the ones above that specify all the
-acceptable patterns in a language. Grammars group together these rules in
-much the same way that a groups together related data fields and methods
-N<In languages like Perl 6 for instance, a grammar is just a special kind
-of class and a rule is just a special kind of method.>. Each rule defines
-a pattern for matching one unit of text, and can be made up of various other
-rules which are called recursively to make a complete match.
-
-A rule can contain regular expressions to match patterns of characters:
-
- rule id { \d+ }
-
-A rule can also contain patterns of references to other rules:
-
- rule record { <id> <name> <phone> }
-
-A grammar contains a group of rules that work together to match the entire
-language:
-
- grammar Contacts;
-
- rule name { 'John' | 'Bob ' | 'Fred' }
-
- rule id { \d+ }
-
- rule record { <id> <name> }
-
- ...
-
-=head3 Rules and Tokens
-
-X<rule>
-X<token>
-There are two different kinds of rules: C<rule>, which we saw above, and
-C<token>. A C<rule> performs smart whitespace matching between the various
-pieces of the pattern. The C<record> rule given previously would match
-"6355 John" or "6355 John" but not "6355John".
-
-A C<token> matches whitespace only if you specifically request it. To get the
-same effect with a token, add the C<\s> (match a space character) and C<+>
-(match the preceding atom -- the space character, in this case -- one or more
-times) pattern to the rule:
-
- token record { <id> \s+ <name> }
-
-=head3 The Start Rule
-
-X<top>
-X<top-down parser>
-A recursive descent parser is what's called a I<top-down parser>. It starts
-at the highest-level rule, called C<TOP>, and works its way down through
-individual rules to match an entire string or file. Real Perl 6 allows any
-name for the top-level rule, but PCT expects a rule called C<TOP>. If PCT
-was as fully-featured as Perl 6, people would use it instead! Here's an
-example of a TOP rule:
-
- rule TOP { <record> }
-
-This rule matches a single C<record> pattern in a string or file. Once the
-parser has succeeded in matching the entire string or file passed to the
-start rule, it returns a parse tree. If it cannot match the entire input
-with the rules provided, it can either return a partial match, or it can
-throw a parse error.
-
-=head3 Testing a Grammar
-
-Let's do a small example grammar. Save this example to a file called
-F<Contacts.pg>:
-
- grammar Contacts is PGE::Grammar;
-
- rule TOP { <record> }
- rule record { <id> <name> }
- token name { 'John' | 'Bob ' | 'Fred' }
- token id { \d+ }
-
-Then compile the grammar:
-
- $ B<parrot Perl6Grammar.pbc --output=Contacts.pir Contacts.pg>
-
-=for author
-
-Assume an installed Parrot for all examples? Anyone working from the source
-tree should be able to mangle paths appropriately.
-
-=end for
-
-The path to F<parrot> and to the F<Perl6Grammar.pbc> file will vary on
-different systems. If you compiled Parrot from source, it will be:
-
- $ B<./parrot runtime/parrot/library/PGE/Perl6Grammar.pbc \>
- B<--output=Contacts.pir Contacts.pg>
-
-Next, create a small PIR script to run your grammar. Save it as
-F<grammar_test.pir>:
-
-=begin PIR
-
- .sub main :main
- load_bytecode 'PGE.pbc' # load some required modules
- load_bytecode 'dumper.pbc'
- load_bytecode 'PGE/Dumper.pbc'
-
- load_bytecode 'Contacts.pir' # load your grammar
-
- .local string source
- source = "3 John"
-
- .local pmc top, grammar, match
- top = get_hll_global ['Contacts'], 'TOP'
- grammar = get_class 'Contacts'
- match = top(source, 'grammar' => grammar)
-
- _dumper(match, "match")
- .end
-
-=end PIR
-
-Run the test script:
-
- $ B<parrot grammar_test.pir>
-
-It will print out a text representation of the raw parse tree stored in the
-C<match> variable:
-
- "match" => PMC 'Contacts' => "3 John" @ 0 {
- <record> => PMC 'Contacts' => "3 John" @ 0 {
- <id> => PMC 'Contacts' => "3" @ 0
- <name> => PMC 'Contacts' => "John" @ 2
- }
- }
-
-Each node in the tree corresponds to a rule in the grammar. The top-level
-match variable contains one child named C<record>, which contains two children
-named C<id> and C<name>. C<id> contains the number 3, and C<name> contains the
-string "John". This is exactly what the simple grammar should have matched.
-
-=head2 Rule Syntax
-
-Every language has a set of basic components (words or parts of words) and
-syntax conventions for combining them. The "words" in rules are literal
-characters or symbols, some X<metacharacters> metacharacters (or metasymbols),
-and X<rules;escape sequences>X<escape sequences, rules> escape sequences, while
-the combining syntax includes other metacharacters, X<quantifiers, rules>
-X<rules;quantifiers> quantifiers, bracketing characters, and assertions.
-
-=head3 Metacharacters
-
-The C<.> metacharacter matches any single character, even a newline character.
-The C<^> and C<$> metacharacters are zero-width matches which represent the
-beginning and end of a string. They each have doubled alternates C<^^> and
-C<$$> that match at the beginning and end of every (newline-delimited) line
-within a string.
-
-The C<|>, C<&>, C<\>, C<#>, and C<:=> metacharacters are all syntax structure
-elements. C<|> alternates between two options. C<&> matches two patterns
-simultaneously (the patterns must be the same length). C<\> turns literal
-characters into metacharacters (producing escape sequences). C<#> starts a
-comment which proceeds until the end of the line. You can start a comment at
-any point on any line in a rule. C<:=> binds a hypothetical variable to the
-result of a subrule or grouped pattern (see L<Hypothetical Variables>).
-
-The metacharacters C<()>, C<[]>, C<{}> and C<E<lt>E<gt>> are bracketing pairs.
-Bracketing pairs must always be balanced within the rule; to use a literal
-character, escape it with a C<\>. The C<()> and C<[]> pairs group patterns as
-a single atom. They often capture a result, mark the boundaries of an
-alternation, or mark a group of patterns with a quantifier. Parentheses C<()>
-capture, but square brackets C<[]> do not. The C<{}> brackets define a section
-of code (a closure) within a rule. These closures are always a successful
-zero-width match. The C<E<lt>...E<gt>> brackets mark assertions, which handle a
-variety of constructs including character classes and user-defined quantifiers
-(see L<Assertions>).
-
-Table 7-2 summarizes the basic metacharacters.
-
-=begin table picture Metacharacters
-
-Z<CHP-7-TABLE-2>
-
-=headrow
-
-=row
-
-=cell Symbol
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<.>
-
-=cell Match any single character, including a newline.
-X<. (dot);. match single character (rules)>
-
-=row
-
-=cell C<^>
-
-=cell Match the beginning of a string.
-X<^ (caret);^ beginning of string (rules)>
-
-=row
-
-=cell C<$>
-
-=cell Match the end of a string.
-X<$ (dollar sign);$ end of string (rules)>
-
-=row
-
-=cell C<^^>
-
-=cell Match the beginning of a line within the string.
-X<^ (caret);^^ beginning of line (rules)>
-
-=row
-
-=cell C<$$>
-
-=cell Match the end of a line within the string.
-X<$ (dollar sign);$$ end of line (rules)>
-
-=row
-
-=cell C<|>
-
-=cell Match alternate patterns (OR).
-
-=row
-
-=cell C<&>
-
-=cell Match multiple patterns (AND).
-
-=row
-
-=cell C<\>
-
-=cell Escape a metacharacter to get a literal character, or escape a
-literal character to get a metacharacter.
-X<\ (backslash);\ escape sequences (rules)>
-X<\ (backslash);\ to escape metacharacters (rules)>
-
-=row
-
-=cell C<#>
-
-=cell Mark a comment (to the end of the line).
-
-=row
-
-=cell C<:=>
-
-=cell Bind the result of a match to a hypothetical variable.
-X<: (colon);:= (binding);in rules>
-
-=row
-
-=cell C<(...)>
-
-=cell Group patterns and capture the result.
-
-=row
-
-=cell C<[...]>
-
-=cell Group patterns without capturing.
-
-=row
-
-=cell C<{...}>
-
-=cell Execute a closure (Perl 6 code) within a rule.
-
-=row
-
-=cell C<E<lt>...E<gt>>
-
-=cell Match an assertion.
-
-=end table
-
-=head3 Escape Sequences
-
-Z<CHP-7-SECT-2.2>
-
-X<escape sequences, rules>
-X<rules;escape sequences>
-X<\ (backslash);\ escape sequences (rules)>
-
-Escape sequences are literal characters acting as metacharacters. A preceding
-backslash (C<\>) identifies them as escapes. Some escape sequences represent
-single characters that are difficult to represent literally, such as C<\t> for
-tab, or C<\x[...]> to specify a character by its hexadecimal number. Some
-represent limited character classes, such as C<\d> for digits or C<\w> for word
-characters. Some represent zero-width positions in a match, such as C<\b> for a
-word boundary.
-
-X<variable interpolation in rules>
-X<rules;variable interpolation>
-If you've used Perl 5 regexps, you may remember the C<\Q> escape sequence which
-treats everything until the following C<\E> sequence as literal text,
-containing no escape sequences. Because ordinary variables now interpolate as
-literal strings by default, the C<\Q> escape sequence is rarely needed.
-
-A<CHP-7-TABLE-3>Table 7-3 shows the escape sequences for rules.
-
-=begin table picture Escape sequences
-
-Z<CHP-7-TABLE-3>
-
-=headrow
-
-=row
-
-=cell Escape
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<\0[...]>
-
-=cell Match a character given in octal (brackets optional).
-
-=row
-
-=cell C<\b>
-
-=cell Match a word boundary.
-
-=row
-
-=cell C<\B>
-
-=cell Match when not on a word boundary.
-
-=row
-
-=cell C<\c[...]>
-
-=cell Match a named character or control character.
-
-=row
-
-=cell C<\C[...]>
-
-=cell Match any character except the bracketed named or control character.
-
-=row
-
-=cell C<\d>
-
-=cell Match a digit.
-
-=row
-
-=cell C<\D>
-
-=cell Match a non-digit.
-
-=row
-
-=cell C<\e>
-
-=cell Match an escape character.
-
-=row
-
-=cell C<\E>
-
-=cell Match anything but an escape character.
-
-=row
-
-=cell C<\f>
-
-=cell Match the form feed character.
-
-=row
-
-=cell C<\F>
-
-=cell Match anything but a form feed.
-
-=row
-
-=cell C<\n>
-
-=cell Match a (logical) newline.
-
-=row
-
-=cell C<\N>
-
-=cell Match anything but a (logical) newline.
-
-=row
-
-=cell C<\h>
-
-=cell Match horizontal whitespace.
-
-=row
-
-=cell C<\H>
-
-=cell Match anything but horizontal whitespace.
-
-=row
-
-=cell C<\L[...]>
-
-=cell Everything within the brackets is lowercase.
-
-=row
-
-=cell C<\Q[...]>
-
-=cell All metacharacters within the brackets match as literal characters.
-
-=row
-
-=cell C<\r>
-
-=cell Match a return.
-
-=row
-
-=cell C<\R>
-
-=cell Match anything but a return.
-
-=row
-
-=cell C<\s>
-
-=cell Match any whitespace character.
-
-=row
-
-=cell C<\S>
-
-=cell Match anything but whitespace.
-
-=row
-
-=cell C<\t>
-
-=cell Match a tab.
-
-=row
-
-=cell C<\T>
-
-=cell Match anything but a tab.
-
-=row
-
-=cell C<\U[...]>
-
-=cell Everything within the brackets is uppercase.
-
-=row
-
-=cell C<\v>
-
-=cell Match vertical whitespace.
-
-=row
-
-=cell C<\V>
-
-=cell Match anything but vertical whitespace.
-
-=row
-
-=cell C<\w>
-
-=cell Match a word character (Unicode alphanumeric characters plus the
-underscore C<_>).
-
-=row
-
-=cell C<\W>
-
-=cell Match anything but a word character.
-
-=row
-
-=cell C<\x[...]>
-
-=cell Match a character given in hexadecimal (brackets optional).
-
-=row
-
-=cell C<\X[...]>
-
-=cell Match anything but the character given in hexadecimal (brackets
-optional).
-
-=end table
-
-=head3 Quantifiers
-
-Z<CHP-7-SECT-2.3>
-
-Quantifiers specify the number of times an atom (a single character,
-metacharacter, escape sequence, grouped pattern, assertion, etc) will match.
-
-X<. (dot);.. (range);quantifier (rules)>
-X<. (dot);... (infinite range);quantifier (rules)>
-The numeric quantifiers use assertion syntax. A single number (C<E<lt>3E<gt>>)
-requires exactly that many matches. A numeric range quantifier
-(C<E<lt>3C<..>5E<gt>>) succeeds if the number of matches is between the minimum
-and maximum numbers, inclusive. A range with three trailing dots
-(C<E<lt>2...E<gt>>) is shorthand for C<E<lt>R<n>..InfE<gt>>; it matches as many
-times as possible.
-
-Each quantifier has a minimal alternate form -- marked with a trailing C<?> --
-which matches the shortest possible sequence first. That is, given the string
-C<aaaaaa>, C<aE<lt>3C<..>5E<gt>> will match C<aaaaa> and C<aE<lt>3C<..>5E<gt>?>
-will match C<aaa>.
-
-A<CHP-7-TABLE-4>Table 7-4 shows the built-in
-X<quantifiers, rules> X<rules;quantifiers> quantifiers.
-
-=begin table picture Quantifiers
-
-Z<CHP-7-TABLE-4>
-
-=headrow
-
-=row
-
-=cell Maximal
-
-=cell Minimal
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<*>
-
-=cell C<*?>
-
-=cell Match 0 or more times.
-
-=row
-
-=cell C<+>
-
-=cell C<+?>
-
-=cell Match 1 or more times.
-
-=row
-
-=cell C<?>
-
-=cell C<??>
-
-=cell Match 0 or 1 times.
-
-=row
-
-=cell C<E<lt>>R<n>C<E<gt>>
-
-=cell C<E<lt>>R<n>C<E<gt>?>
-
-=cell Match exactly R<n> times.
-
-=row
-
-=cell C<E<lt>>R<n>C<..>R<m>C<E<gt>>
-
-=cell C<E<lt>>R<n>C<..>R<m>C<E<gt>?>
-
-=cell Match at least R<n> and no more than R<m> times.
-
-=row
-
-=cell C<E<lt>>R<n>C<...E<gt>>
-
-=cell C<E<lt>>R<n>C<...E<gt>?>
-
-=cell Match at least R<n> times.
-
-=end table
-
-=head3 Assertions
-
-Z<CHP-7-SECT-2.4>
-
-X<assertions, rules>
-X<rules;assertions>
-An assertion states that some condition or state is true. The match fails when
-that assertion is false.
-
-X<variable interpolation in rules>
-X<rules;variable interpolation>
-
-Assertions match named and anonymous rules, arrays or hashes containing
-anonymous rules, and subroutines or closures that return anonymous rules.
-
-To interpolate a variable in assertion rules, enclose it in assertion
-delimiters.
-A bare scalar in a pattern
-interpolates as a literal string, while a scalar variable in assertion
-brackets interpolates as an anonymous rule. A bare array in a pattern
-matches as a series of alternate literal strings, while an array in
-assertion brackets interpolates as a series of alternate anonymous
-rules.
-
-A bare hash in a pattern matches a word (C<\w+>) if and only if that word is
-one of its keysN<The effect is similar to matching the keys as a series of
-alternates, but it prefers to match the longest possible key, instead of the
-first potential match.>, while a hash in assertion brackets also matches the
-associated value as an anonymous rule.
-
-X<fail keyword>
-A bare closure in a pattern always matches (unless it calls C<fail>), but a
-closure in assertion brackets C<E<lt>{...}E<gt>> must return an anonymous rule
-to match.
-
-An assertion with parentheses C<E<lt>(...)E<gt>> resembles a bare closure in a
-pattern in that it allows you to include Perl code within a rule.
-C<E<lt>(...)E<gt>> evaluates the return value of the closure in boolean
-context. The match succeeds or fails based on that return value.
-
-Assertions match character classes, both named and enumerated. A named rule
-character class is often more accurate than an enumerated character class. The
-common C<E<lt>[a-zA-Z]E<gt>> idiom matches ASCII alphabetic characters, but the
-more comprehensive built-in rule C<E<lt>alphaE<gt>> matches the full set of
-Unicode alphabetic characters.
-
-A<CHP-7-TABLE-5>Table 7-5 shows the syntax of assertions.
-
-=begin table picture Assertions
-
-Z<CHP-7-TABLE-5>
-
-=headrow
-
-=row
-
-=cell Syntax
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<E<lt>...E<gt>>
-
-=cell Generic assertion delimiter.
-
-=row
-
-=cell C<E<lt>!...E<gt>>
-
-=cell Negate any assertion.
-
-=row
-
-=cell C<E<lt>>R<name>C<E<gt>>
-
-=cell Match a named rule or character class.
-
-=row
-
-=cell C<E<lt>[...]E<gt>>
-
-=cell Match an enumerated character class.
-
-=row
-
-=cell C<E<lt>-...E<gt>>
-
-=cell Complement a character class (named or enumerated).
-
-=row
-
-=cell C<E<lt>"..."E<gt>>
-
-=cell Match a literal string (interpolated at match time).
-
-=row
-
-=cell C<E<lt>'...'E<gt>>
-
-=cell Match a literal string (not interpolated).
-
-=row
-
-=cell C<E<lt>(...)E<gt>>
-
-=cell Boolean assertion. Execute a closure and match if it returns a true
-result.
-
-=row
-
-=cell C<E<lt>$scalarE<gt>>
-
-=cell Match an anonymous rule.
-
-=row
-
-=cell C<E<lt>@arrayE<gt>>
-
-=cell Match a series of anonymous rules as alternates.
-
-=row
-
-=cell C<E<lt>%hashE<gt>>
-
-=cell Match a key from the hash, then its value (as an anonymous rule).
-
-=row
-
-=cell C<E<lt>E<amp>sub()E<gt>>
-
-=cell Match an anonymous rule returned by a sub.
-
-=row
-
-=cell C<E<lt>{>R<code>C<}E<gt>>
-
-=cell Match an anonymous rule returned by a closure.
-
-=row
-
-=cell C<E<lt>.E<gt>>
-
-=cell Match any logical grapheme, including combining character sequences.
-
-=end table
-
-=head3 Modifiers
-
-Z<CHP-7-SECT-2.5>
-
-X<modifiers>
-X<: (colon);: modifier delimiter in rules>
-Modifiers alter the meaning of a pattern. The standard position for modifiers
-is at the beginning of the rule, right after the C<m>, C<s>, or C<rx>, or after
-the name in a named rule. Modifiers cannot attach to the outside of a bare
-C</.../>. For example:
-
- m:i/marvin/ # case insensitive
- rule names :i { marvin | ford | arthur }
-
-You may group single-character modifiers, but you must separate longer
-modifiers by colons:
-
- m:wig/ zaphod / # OK
- m:words:ignorecase:globally / zaphod / # OK
- m:wordsignorecaseglobally / zaphod / # Not OK
-
-Most modifiers can also appear inside the rule when attached to rule or
-grouping delimiters. Internal modifiers are lexically scoped to their enclosing
-delimiters, so can alter subpatterns:
-
- m/:w I saw [:i zaphod] / # only 'zaphod' is case insensitive
-
-The repetition modifiers (C<:R<N>x>, C<:R<N>th>, C<:once>, C<:globally>, and
-C<:exhaustive>) and the continue modifier (C<:cont>) alter the return value of
-the rule as a whole, so you cannot use them lexically inside a rule.
-
-The C<:R<N>x> modifier matches the rule a specific number of times. If the
-modifier expects more matches than the string has, the match fails. Its
-alternate form (C<:x(R<N>)>) can take a variable in place of the number.
-
-The C<:once> modifier on a rule only allows it to match once. The rule will not
-match again until the you call the C<.reset> method on the rule object.
-
-The C<:globally> modifier matches as many times as possible. The C<:exhaustive>
-modifier also matches as many times as possible, in as many different ways as
-possible.
-
-The C<:R<N>th> modifier preserves one result from a particular counted match.
-If the rule matches fewer times than the modifier expects, the match fails. It
-has several alternate forms. One form, C<:th(R<N>)>, takes a variable in place
-of the number. The other forms -- C<:R<N>st>, C<:R<N>nd>, and C<:R<N>rd> --
-allow you to write more naturally C<:1st>, C<:2nd>, C<:3rd>. The other way is
-valid as well; choose whichever is most comfortable.
-
-By default, rules ignore literal whitespace within the pattern. The C<:w>
-modifier makes rules sensitive to literal whitespace, but in an intelligent
-way. Any cluster of literal whitespace acts like an explicit C<\s+> when it
-separates two identifiers and C<\s*> everywhere else.
-
-I<No> modifiers exist to treat the matched string as a single line or multiple
-lines. Instead, use the "beginning of string" and "end of string" or
-"beginning of line" and "end of line" metacharacters.
-
-A<CHP-7-TABLE-6>Table 7-6 lists the available modifiers.
-
-=begin table picture Modifiers
-
-Z<CHP-7-TABLE-6>
-
-=headrow
-
-=row
-
-=cell Short
-
-=cell Long
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<:i>
-
-=cell C<:ignorecase>
-
-=cell Case-insensitive match.
-
-=row
-
-=cell C<:I>
-
-=cell
-
-=cell Case-sensitive match (on by default).
-
-=row
-
-=cell C<:c>
-
-=cell C<:cont>
-
-=cell Continue where the previous match on the string left off.
-
-=row
-
-=cell C<:w>
-
-=cell C<:words>
-
-=cell Literal whitespace in the pattern matches as C<\s+>
-or C<\s*>.
-
-=row
-
-=cell C<:W>
-
-=cell
-
-=cell Turn off intelligent whitespace matching (return to default).
-
-=row
-
-=cell
-
-=cell :R<N>C<x>/C<:x(>R<N>C<)>
-
-=cell Match the pattern R<N> times.
-
-=row
-
-=cell
-
-=cell C<:>R<N>C<th>/C<:nth(>R<N>C<)>
-
-=cell Match the R<N>th occurrence of a pattern.
-
-=row
-
-=cell
-
-=cell C<:once>
-
-=cell Match the pattern once and only once.
-
-=row
-
-=cell C<:g>
-
-=cell C<:globally>
-
-=cell Match the pattern as many times as possible without overlapping
-possibilities.
-
-=row
-
-=cell C<:e>
-
-=cell C<:exhaustive>
-
-=cell Match every possible occurrence of a pattern, including overlapping
-possibilities.
-
-=row
-
-=cell
-
-=cell C<:u0>
-
-=cell . is a byte.
-
-=row
-
-=cell
-
-=cell C<:u1>
-
-=cell . is a Unicode codepoint.
-
-=row
-
-=cell
-
-=cell C<:u2>
-
-=cell . is a Unicode grapheme.
-
-=row
-
-=cell
-
-=cell C<:u3>
-
-=cell . is language dependent.
-
-=row
-
-=cell
-
-=cell C<:p5>
-
-=cell The pattern uses Perl 5 regex syntax.
-
-=end table
-
-=head3 Built-in Rules
-
-Z<CHP-7-SECT-3>
-
-X<rules;built-in>
-PGE provides several named rules, including a complete set of X<POSIX-style
-classes> POSIX-style classes, and X<Unicode property classes> Unicode property
-classes. The list isn't fully defined yet, but A<CHP-7-TABLE-7>Table 7-7 shows
-a few you're likely to see.
-
-The C<E<lt>nullE<gt>> rule matches a zero-width string (it always matches) and
-C<E<lt>priorE<gt>> matches whatever the most recent successful rule matched.
-These replace the two behaviors of X</ (slash);// invalid null pattern>
-X<invalid null pattern //> the Perl 5 null pattern C<//>, which is no longer
-valid syntax for rules.
-
-=begin table picture Built-in rules
-
-Z<CHP-7-TABLE-7>
-
-=headrow
-
-=row
-
-=cell Rule
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<E<lt>alphaE<gt>>
-
-=cell Match a Unicode alphabetic character.
-
-=row
-
-=cell C<E<lt>digitE<gt>>
-
-=cell Match a Unicode digit.
-
-=row
-
-=cell C<E<lt>spE<gt>>
-
-=cell Match a single space character (the same as C<\s>).
-
-=row
-
-=cell C<E<lt>wsE<gt>>
-
-=cell Match any whitespace (the same as C<\s+>).
-
-=row
-
-=cell C<E<lt>nullE<gt>>
-
-=cell Match the null string.
-
-=row
-
-=cell C<E<lt>priorE<gt>>
-
-=cell Match the same thing as the previous match.
-
-=row
-
-=cell C<E<lt>before ...E<gt>>
-
-=cell Zero-width lookahead. Assert that the current position I<precedes> a
-pattern.
-
-=row
-
-=cell C<E<lt>after ...E<gt>>
-
-=cell Zero-width lookbehind. Assert that the current position I<follows> a
-pattern.
-
-=row
-
-=cell C<E<lt>prop ...E<gt>>
-
-=cell Match any character with the named property.
-
-=row
-
-=cell C<E<lt>replace(...)E<gt>>
-
-=cell Replace everything matched so far in the rule or subrule with the
-given string (under consideration).
-
-=end table
-
-=head3 Backtracking Control
-
-Z<CHP-7-SECT-4>
-
-X<backtracking controls>
-X<fail keyword>
-Whenever part of the pattern fails to match, PGE performs backtracking --
-backing up to the previous point at which the match could succeed and trying
-again. You can explicitly trigger backtracking by calling the C<fail> function
-within a closure. A<CHP-7-TABLE-8>Table 7-8 displays metacharacters and
-built-in rules relevant to backtracking.
-
-=for author
-
-This could use an example.
-
-=end for
-
-=begin table picture Backtracking controls
-
-Z<CHP-7-TABLE-8>
-
-=headrow
-
-=row
-
-=cell Operator
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<:>
-
-=cell Don't retry the previous atom. Instead, fail to the next earlier atom.
-X<: (colon);: fail to atom before last (rules)>
-X<backtracking controls;: fail to atom before last>
-
-=row
-
-=cell C<::>
-
-=cell Don't backtrack over this point. Instead fail out of the closest
-enclosing group (C<(...)>, C<[...]>, or the rule delimiters).
-X<: (colon);:: fail out of group (rules)>
-X<backtracking controls;: fail out of group>
-
-=row
-
-=cell C<:::>
-
-=cell Don't backtrack over this point. Instead, fail out of the current rule
-or subrule.
-X<: (colon);::: fail out of rule (rules)>
-X<backtracking controls;: fail out of rule>
-
-=row
-
-=cell C<E<lt>commitE<gt>>
-
-=cell Don't backtrack over this point. Instead, fail out of the entire match
-(even from within a subrule).
-
-=row
-
-=cell C<E<lt>cutE<gt>>
-
-=cell Like C<E<lt>commitE<gt>>, but also cuts the string matched. The current
-matching position at this point becomes the new beginning of the string.
-
-=end table
-
-=head3 Calling Actions
-
-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 has succeeded. The
-generated AST is now available to the code generator for conversion into PIR.
-
-=for author
-
-Please review. The forward declaration is awkward here, but a little bit of
-explanation might ameliorate this.
-
-=end for
-
-This AST gets built up by actions -- code snippets attached to rules and
-tokens. To call an action, insert the C<{*}> token into the rule. When PGE
-encounters C<{*}>, it will call the associated action method with the current
-match object as an argument.
-
-The best way to demonstrate this is by example. Sprinkle the C<persons_name>
-rule liberally with action calls:
-
- rule persons_name {
- {*} <first_name> {*} <last_name> {*}
- }
-
-The first call to the action method contains an empty match object because the
-parser hasn't matched anything yet. The second call contains only the first
-name of the match. The third and final call contains both the matched first and
-last name.
-
-If the match fails halfway through, PGE will still call the actions that have
-succeeded; it will not call the actions after the failure. If you try to match
-the string "Leia", PGE will call the first two action methods. When the rule
-tries to match the last name, it fails, and PGE will not call the third action
-method.
-
-=head3 Alternations and Keys
-
-In addition to sub-rules, groups, and quantifiers, you can also express
-either-or alternations between options. The vertical bar token (C<|>)
-distinguishes between options where only one may match:
-
- rule hero {
- ['Luke' | 'Leia'] 'Skywalker'
- }
-
-This rule will match either "Luke Skywalker" or "Leia Skywalker" but won't
-match "Luke Leia Skywalker"N<nor anything else.>. Given alternations and
-action methods, it's often important to distinguish which alternation matched:
-
- rule hero {
- [
- 'Luke' {*} #= Luke
- | 'Leia' {*} #= Leia
- ]
- 'Skywalker'
- }
-
-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 matched.
-
-=head3 Warning: Left Recursion
-
-If you've worked with parsers before, you may have seen this coming. If not,
-don't fear. Like functions in ordinary procedural or functional languages, the
-methods in the PGE parser grammar can call themselves recursively. Consider
-some rules derived in part from the grammar for the C programming language:
-
- rule if_statement {
- 'if' <condition> '{' <statement>* '}' <else_block>?
- }
-
- rule statement {
- <if_statement> | <expression>
- }
-
- rule else_block {
- 'else' '{' <statements>* '}'
- }
-
-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 I<recursion> X<Recursion>; it's one
-of the reasons PGE is a "Recursive descent" parser.
-
-Consider the more direct example of a comma-separated list of integer digits
-which form a list. A recursive definition might be:
-
- rule list {
- <list> ',' <digit> | <digit>
- }
-
-If there is only one digit, the second option in the alternation matches. If
-there are multiple digits, recursion will match them through the first
-alternation.
-
-That's the intention. The results are insidious.
-
-The recursive descent parser enters the C<list> rule. Its first option is to
-enter the list rule again, so it does. Recursive descent is a X<depth-first
-algorithm> depth-first algorithm; PGE will continue to descend down a
-particular path until it finds a successful match or a match failure. In this
-case, it matches C<list>, then it matches C<list> again, then it matches
-C<list> again, and so on. This rule forms an infinite loop -- a pattern called
-X<left recursion> I<left recursion>. The problem is that the left-most item of
-the left-most alternation is itself a recursion.
-
-The rule above does not recurse infinitely when rewritten as:
-
- rule list {
- <digit> | <list> ',' <digit>
- }
-
-... or even:
-
- rule list {
- <digit> ',' <list> | <digit>
- }
-
-Both options ensure that the left-most item in the rule is recursive.
-
-Left recursion may be trickier. It's not immediately obvious in this grammar:
-
- rule term {
- <expression> '*' <term> | <digit>
- }
-
- rule expression {
- <term> '+' <expression> | <term>
- }
-
-Even this common, limited subset of mathematical equations has the same
-problem. To match a C<term>, the parser first tries to match an C<expression>,
-which in turn matches a C<term> and then an C<expression> ....
-
-Again, the solution is simple. Rewrite at least one of the rules so that the
-first condition it tries to match is not itself a recursive situation.
-
-=head3 Operator Precedence Parser
-
-Recursive descent parsing can be inefficient where statements have lots of
-little tokens and many possible options to match. For example, mathematical
-expressions are very open-ended, with many valid forms which are difficult to
-anticipate. Consider the expression:
-
- a + b * c + d
-
-A recursive descent parser will undergo significant trial and error to parse
-this statement. Recursive descent parsing is not ideal for these situations.
-Instead, a type of bottom-up parser called an I<operator precedence> X<Parser,
-Operator precedence> parser is much better.
-
-=for author
-
-Is this a categorization of all opps or just PGE's opp?
-
-=end for
-
-Operator precedence parsers work similarly to more versatile bottom-up parsers
-such as Lex or Yacc, but are optimized for use with expressions and equations.
-Equations have two subtypes, I<terms> and I<operators>. Operators themselves
-have several subtypes, including prefix (C<-a>), postfix (C<i++>), infix (C<x +
-y>), circumfix (C<[z]>), postcircumfix (C<a[b]>), and list (C<1, 2, 3>). Each
-operator gets its own precedence number that specifies how closely it binds to
-the terms. The previous example should parse as:
-
- a + (b * c) + d
-
-... because the C<*> operator has a higher precedence -- binding more tightly
-to its terms -- than the C<+> operator.
-
-Within a grammar, switch from the top-down recursive descent parser to the
-bottom-up operator precedence parser with an C<optable> X<Parser, optable>
-rule:
-
- rule expression is optable { ... }
-
-The C<...> ellipsis isn't an editorial shortcut, it's the Perl 6 operator to to
-define a function signature. The C<...> indicates that this is just a
-signature; the actual implementation is elsewhere. In this case, that location
-in the definition of the optable.
-
-=head3 Protofunction Definitions
-
-X<Protofunctions>
-
-Protofunctions define operators in the optable in the same way that rules and
-tokens make up the grammar. A proto declares a rule, defined elsewhere, which
-other code may override dynamically. In this case, PCT takes information from
-the proto declaration and fills in the details. The "dynamic overriding"
-implies that a high-level language itself itself can modify its own grammar at
-run time, by overriding the proto definitions for its operator table. Some
-languages call this process X<operator overloading> I<operator overloading>.
-
-A proto definition resembles:
-
- 'proto' <proto_name> [ 'is' <property> ] '{' '...' '}'
-
-The name of the operator, noted as C<< <proto_name> >>, contains both a
-location part and an identifier part. The location is the type of the operator,
-such as infix, postfix, prefix, circumfix, and postcircumfix. The name of the
-operator is the symbol used for the operator in any of the quotes that Perl 6
-understands:
-
- proto infix:<+> # a + b
- proto postfix:'--' # i--
- proto circumfix:«<>» # <x>
-
-The C<is> X<Parser, is> keyword defines a property of the rule. Examples
-include:
-
- is precedence(1) # Specifies an exact precedence
- is equiv('+') # Has the same precedence as the "+" operator
- is assoc('right') # Right associative. May also be "left" or "list"
- is pirop('add') # Operands are passed to the PIR operator "and"
- is subname('mySub') # Operands are passed to the function "mySub"
- is pasttype('if') # Operands are passed as children to an "if" PAST node in
- # the parse tree
- is parsed(&myRule) # The token is parsed and identified using the rule
- # "myRule" from the top-down parser
-
-=for author
-
-Please review.
-
-=end for
-
-Protofunction definitions are function signatures; you can override them with
-multimethod dispatch. This means that you can write functions I<with the same
-name> as the rule to implement the behavior of the operator. Here's a proto:
-
- rule infix:"+" { ... }
-
-... and its corresponding PIR rule:
-
-=begin PIR
-
- .sub 'infix:+'
- .param pmc a
- .param pmc b
- .local pmc c
- c = a + b
- .return(c)
- .end
-
-=end PIR
-
-You may ask "Why have an C<is subname()> property, if you can define all
-operators as subroutines?" Using the C<is subname()> property allows PCT to
-call a subroutine of a different name then the operator. This is a good idea
-if there is already a built-in function in the language that duplicates the
-functionality of the operator. There is no sense in duplicating behavior.
-
-The great thing about protos being overloadable is that you can specify
-different functions to call with different signatures:
-
-=begin PIR
-
- .sub 'infix:+' :multi('Integer', 'Integer')
- #...
- .end
-
- .sub 'infix:+' :multi('CLispRatio', 'Number')
- #...
- .end
-
- .sub 'infix:+' :multi('Perl6Double', 'PythonInteger')
- #...
- .end
-
-=end PIR
-
-This list can be a bit intimidating, and it's hard to imagine that it would be
-necessary to write up a new function to handle addition between every
-conceivable pair of operands. Fortunately, this is rarely the case in Parrot,
-because all these data types support common the VTABLE interface. For most data
-types Parrot already has basic arithmetic operations built in, and it's only
-necessary to override for those data types with special needs.
-
-=head3 Hypothetical Variables
-
-Z<CHP-7-SECT-5>
-
-X<variables;hypothetical>
-X<hypothetical variables>
-X<rules;captures>
-Hypothetical variables are a powerful way of building up data structures from
-within a match. Ordinary captures with C<()> store the result of the captures
-in C<$1>, C<$2>, etc. PGE stores values in these variables if the match is
-successful, but throws them away if the match fails. The numbered capture
-variables are accessible outside the match, but only within the immediate
-surrounding lexical scope:
-
- "Zaphod Beeblebrox" ~~ m:w/ (\w+) (\w+) /;
-
- print $1; # prints Zaphod
-
-You can also capture into any user-defined variable with the binding operator
-C<:=> -- I<if> you have declared these variables in a lexical scope enclosing
-the rule:
-
- my $person;
- "Zaphod's just this guy." ~~ / ^ $person := (\w+) /;
- print $person; # prints Zaphod
-
-You may capture repeated matches into an array:
-
- my @words;
- "feefifofum" ~~ / @words := (f<-[f]>+)* /;
- # @words contains ("fee", "fi", "fo", "fum")
-
-You may capture pairs of repeated matches into a hash:
-
- my %customers;
- $records ~~ m:w/ %customers := [ E<lt>idE<gt> = E<lt>nameE<gt> \n]* /;
-
-If you don't need the captured value outside the rule, use a C<$?> variable
-instead. These are only directly accessible within the rule:
-
- "Zaphod saw Zaphod" ~~ m:w/ $?name := (\w+) \w+ $?name/;
-
-A match of a named rule stores the result in a C<$?> variable with the same
-name as the rule. These variables are also accessible only within the rule:
-
- "Zaphod saw Zaphod" ~~ m:w/ E<lt>nameE<gt> \w+ $?name /;
-
-=for author
-
-This next paragraph feels out of place; is there more?
-
-=end for
-
-When a rule matches a sequence of input tokens, PCT calls an associated method
-within NQP to convert that match into an AST node, which it inserts into the
-I<parse tree>.
-
-=head3 Basic Rules
-
-Consider the simple example rule:
-
- rule persons_name {
- <first_name> <last_name>
- }
-
-... and two example tokens:
-
- token first_name { <alpha>+ }
- token last_name { <alpha>+ }
-
-The special token C<< <alpha> >> is a built-in construct that only accepts
-upper case and lower case letters. The C<+> after the C<< <alpha> >> tag is a
-short way of saying "one or more". The rule will match names like C<Darth
-Vader>N<It also matches many strings that I<aren't> real names>, but won't
-match something like C<C 3P0>.
-
-This rule I<will> match C<Jar Jar Binks>, but not as you might expect: way you
-would expect: It would match the first "Jar" as C<< <first_name> >>, the second
-"Jar" as C<< <last_name> >>, and ignore "Binks"N<You should ignore the whole
-thing.>.
-
-=for author
-
-The rest seems vestigial. An example like this should precede the rest of the
-chapter. There are forward references, but it's a decent overview for people
-who haven't used similar systems before -- if you avoid going out in the weeds.
-
-=end for
-
-this example shows another new construct, the square brackets. Square
-brackets are ways to group things together. The star at the end means
-that we take all the things inside the brackets zero or more times.
-This is similar to the plus, except the plus matches one or more times.
-Notice, however, that the above rule always matches a comma at the end,
-so we would need to have something like:
-
- Darth Vader, Luke Skywalker,
-
-Instead of something more natural like:
-
- Darth Vader, Luke Skywalker
-
-We can modify the rule a little bit so that it always ends with a name
-instead of a comma:
-
- rule TOP {
- [ <persons_name> ',' ]* <persons_name>
- }
-
-Now we don't need a trailing comma, but at the same time we can't match
-an empty file because it always expects to have at least one name at the
-end. If we still want to match empty files successfully, we need to make
-the whole rule optional:
-
- rule TOP {
- [ [ <persons_name> ',' ]* <persons_name> ]?
- }
-
-We've grouped the whole rule together in another set of brackets, and
-put a "?" question mark at the end. The question mark means zero or
-one of the prior item.
-
-The symbols "*" (zero or more), "+" (one or more) and "?" are called
-I<quantifiers>, and allow an item in the rule to match a variable
-number of times. These aren't the only quantifiers, but they are the
-most common. We will talk about other quantifiers later on.
-
-=cut
-
-# Local variables:
-# c-file-style: "parrot"
-# End:
-# vim: expandtab shiftwidth=4:
Deleted: branches/pluggable_runcore/docs/book/draft/ch06_nqp.pod
==============================================================================
--- branches/pluggable_runcore/docs/book/draft/ch06_nqp.pod Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,219 +0,0 @@
-=pod
-
-=head1 Grammar Actions
-
-The job of the grammar is to match input patterns from the source language.
-These patterns then need to get converted to nodes in the abstract syntax
-tree for manipulation in other stages of the compiler. We've already seen
-one example of a subroutine structure that takes a match and produces a
-tree node: Protofunctions. Protofunction signatures aren't the only way to
-apply functions to rules matched by a parser. They are limited and are
-slightly primitive, but effective for handling operators. There is an
-easier and more powerful way to write subroutines to convert match objects
-into parse tree nodes, using a language that's almost, but Not Quite Perl.
-
-X<NQP>
-X<Not Quite Perl>
-NQP (Not Quite Perl) is a small language which offers a limited subset of
-Perl 6's syntax and semantics. Though it originated as a bootstrapping tool
-for the Rakudo Perl 6 compiler, several other Parrot-based compilers use it
-as well. It has become a permanent member of PCT, and therefore a permanent
-part of the Parrot code base.
-
-NQP represents almost the smallest subset of the Perl 6 language necessary to
-implement parser transformations, plus a few syntactic convenience features
-that developers have requested. NQP's Perl 6 subset shows its Perl 5 roots,
-so existing Perl 5 programmers should find much of it familiar and should be
-able to leverage their existing skills for writing compilers.
-
-In PGE, at the time of a match the grammar we can invoke an action using the
-special <code>{*}</code> symbol. In general, these action methods are
-written in NQP, although it is possible for them to be written in PIR N<In
-fact, this is how the NQP compiler itself is written>. We won't discuss the
-PIR case here because it's uncommon and needlessly difficult. NQP is the
-standard and preferred choice for this.
-
-=head2 NQP Basics
-
-X<sigils>
-X<scalar>
-Like all flavors and versions of Perl, NQP uses special prefix symbols called
-I<sigils> to distinguish variable types. The C<$> sigil represents scalars,
-C<@> arrays, and C<%> for hashes. A scalar is any single value which can
-interchangeably contain given a string value, an integer value, or an object
-reference. Simple NQP assignments are:
-
- $scalar := "This is a string"
- $x := 123
- $pi := 3.1415 # rounding
-
-X<bind operator>
-X<operators; binding>
-X<:=>
-The C<:=> I<bind> operator performs reference assignment in NQP. Reference
-assignment makes one variable into an alias for another. This means that
-the two variables are just different names for the same storage location,
-and changes to one will change both. It's important to remember that a bind
-is not a copy!
-
-NQP has hashes and arrays just like other flavors of Perl and various
-dynamic languages. NQP does not have a notion of hash and array context,
-but otherwise it works the way you would expect. Arrays have the C<@> sigil,
-and hashes have the C<%> sigil. Here are some examples:
-
- @ary[0] := 1;
- @ary[1] := "foo";
- ...
-
- %hsh{'bar'} := 2;
- %hsh{'baz'} := "parrot";
- ...
-
-There is also a nice shorthand way to index hashes, using angle brackets:
-
- %hsh<bar> := "parrot";
-
-It's also possible to assign a list in I<scalar context>:
-
- $array_but_a_scalar := (1, 2, 3, 4)
-
-Or you could write a new function in PIR to create a new array from a variadic
-argument list:
-
- @my_array := create_new_array(1, 2, 3, 4)
-
-... which calls the PIR function:
-
-=begin PIR
-
- .namespace []
-
- .sub 'create_new_array'
- .param pmc elems :slurpy
- .return(elems)
- .end
-
-=end PIR
-
-=head3 Calling Actions From Rules
-
-=for editor
-
-Needs a link to that section.
-
-=end for
-
-As mentioned in the chapter on grammar rules, the funny little C<{*}> symbol
-calls an action. The action in question is an NQP method with the same name as
-the rule that calls it. NQP rules can have two different signatures:
-
- method name ($/) { ... }
- method name($/, $key) { ... }
-
-Where does the key come from? Consider this grammar:
-
- rule cavepeople {
- 'Fred' {*} #= Caveman
- | 'Wilma' {*} #= Cavewoman
- | 'Dino' {*} #= Dinosaur
- }
-
-The C<cavepeople> rule demonstrates the result:
-
- method cavepeople($/, $key) {
- if $key eq 'Caveman' {
- say "We've found a caveman!";
- } elsif $key eq 'Cavewoman' {
- say "We've found a cavewoman!";
- } elsif $key eq 'Dinosaur' {
- say "A dinosaur isn't a caveperson at all!";
- }
- }
-
-The key is a string that contains whatever any text following the C<#=> symbol.
-Without a C<#=> following the rule invocation, there's no C<$key> to use in the
-method. If you attempt to use one without the other, the NQP compiler will die
-with error messages about mismatched argument/parameter numbers.
-
-=head3 The Match Object C<$/>
-
-X<match object>
-X<$/>
-The match object C<$/> it's a data structure that's all business: it's both a
-hash and an array. Because it's a special variable used pervasively in PCT, it
-has a special shortcut syntax:
-
- $/{'Match_item'} is the same as $<Match_item>
- $/[0] is the same as $[0]
-
-Each key in the match object's hash is the name of a matched rule. Given a
-file containing "C<X + 5>" and a rule:
-
- rule introductions {
- <variable> <operator> <number>
- }
-
-The resulting match object will contain the key/value pairs:
-
- "variable" => "x"
- "operator" => "+"
- "number" => "5"
-
-When the match contains multiple values with the same name, or when rules have
-quantifiers such as C<*> or C<+>, the values in the hash may be arrays. Given
-the input "A A A B B" and the rule:
-
- rule letters {
- <vowel>* <consonant>*
- }
-
-The match object will contain the pairs:
-
- "vowel" => ["A", "A", "A"]
- "consonant" => ["B", "B"]
-
-X<$( ) operator>
-
-Use the C<$( )> operator to count the number of matches in each group (by
-casting it to a scalar):
-
- $($<vowel>) == 3
-
-=head3 Inline PIR
-
-=for author
-
-Needs expansion.
-
-=end for
-
-X<{{ }}>
-X<double curly brackets>
-Sometimes NQP isn't quite flexible enough to handle transforms appropriately.
-In a PGE rule, the C<{{ }}> double curly brackets demarcate inline-PIR mode.
-PGE will execute any PIR code in those brackets. You can access C<$/> directly
-in the grammar without having to jump into NQP.
-
-=head3 PAST Nodes
-
-X<PAST>
-X<PAST nodes>
-NQP's job is to make abstract syntax trees. These trees are all objects -- and
-as such, instances of PAST nodes. Each PAST class represents a unique program
-construct. These constructs are common and simple, but combine to represent
-complicated programming structures.
-
-=head3 Making Trees
-
-Every action has the ability to create a PAST node that represents that action,
-as well as any children of that node. Calling C<make> on that node adds it into
-the growing PAST tree that PCT maintains. Once the C<TOP> rule matches
-successfully and returns, PCT optimizes and converts that tree into PIR and PBC
-for execution.
-
-=cut
-
-# Local variables:
-# c-file-style: "parrot"
-# End:
-# vim: expandtab shiftwidth=4:
Modified: branches/pluggable_runcore/docs/book/draft/ch08_dynops.pod
==============================================================================
--- branches/pluggable_runcore/docs/book/draft/ch08_dynops.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/book/draft/ch08_dynops.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -206,13 +206,6 @@
Here, C<x> is an offset in C<size_t> units that represents how far forward
(positive) or how far backwards (negative) to jump to.
-=item * POP()
-
-C<POP> pops the next opcode address off the control stack. To put an address
-onto the control stack, use the C<PUSH> keyword instead. C<PUSH> takes a single
-C<opcode_t *> argument to store, and C<POP> returns a single C<opcode_ *>
-value.
-
=back
=head2 The Opcode Compiler
Modified: branches/pluggable_runcore/docs/book/draft/ch10_opcode_reference.pod
==============================================================================
--- branches/pluggable_runcore/docs/book/draft/ch10_opcode_reference.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/book/draft/ch10_opcode_reference.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -215,27 +215,6 @@
I<Arguments: I>
-=head3 branch_cs
-
-X<branch_cs opcode (PASM)>
-
- branch_cs R<FIXUP_ENTRY>
-
-Intersegment branch to the location of the given fixup table entry.
-
-I<Arguments: S>
-
-=head3 bsr
-
-X<bsr opcode (PASM)>
-
- bsr R<LABEL>
-
-Branch to a label, like C<branch>, but also push the current location
-onto the call stack so C<ret> can return to it.
-
-I<Arguments: I>
-
=head3 bxor
X<bxor opcode (PASM)>
@@ -2046,15 +2025,6 @@
See also: C<savetop>.
-=head3 ret
-
-X<ret opcode (PASM)>
-
- ret
-
-Pop a location off the top of the call stack, and go there.
-Often used with C<bsr> and C<jsr>.
-
=head3 rethrow
X<rethrow opcode (PASM)>
Copied: branches/pluggable_runcore/docs/book/pct/ch01_introduction.pod (from r40540, trunk/docs/book/pct/ch01_introduction.pod)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/docs/book/pct/ch01_introduction.pod Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/docs/book/pct/ch01_introduction.pod)
@@ -0,0 +1,215 @@
+=pod
+
+=head1 Introduction
+
+Parrot is a language-neutral virtual machine for dynamic languages such as
+Ruby, Python, PHP, and Perl. It hosts a powerful suite of compiler tools
+tailored to dynamic languages and a next generation regular expression engine.
+Its architecture is fundamentally different than existing virtual machines such
+as the JVM or CLR, with optimizations for dynamic languages included, a
+register-based system rather than stack-based, and the use of continuations as
+the core means of flow control.
+
+The name "Parrot" was inspired by Monty Python's Parrot sketch. As an April
+Fools' Day joke in 2001, Simon Cozens published "Programming Parrot", a
+fictional interview between Guido van Rossum and Larry Wall detailing their
+plans to merge Python and Perl into a new language called Parrot
+(U<http://www.perl.com/pub/a/2001/04/01/parrot.htm>).
+
+=head2 Parrot Resources
+
+The starting point for all things related to Parrot is the main website
+U<http://www.parrot.org/>. The site lists additional resources, well as recent
+news and information about the project and the Parrot Foundation, which holds
+the copyright over Parrot and helps guide development and the community.
+
+=head3 Documentation
+
+Parrot includes extensive documentation in the distribution. The full
+documentation for the latest release is available online at
+U<http://docs.parrot.org/>.
+
+=head3 Mailing Lists
+
+X<parrot-dev (Parrot mailing list)>
+X<mailing lists>
+
+The primary mailing list for Parrot is I<parrot-dev at lists.parrot.org>. If
+you're interested in getting involved in development, you may also want to
+follow the I<parrot-commits> and I<parrot-tickets> lists. Information on all
+the Parrot mailing lists and subscription forms for each is available at
+U<http://lists.parrot.org/mailman/listinfo>.
+
+The archives for I<parrot-dev> are also available on Google Groups at
+U<http://groups.google.com/group/parrot-dev> and via NNTP at
+U<nntp://news.gmane.org/gmane.comp.compilers.parrot.devel>.
+
+=head3 IRC
+
+X<#parrot (Parrot IRC channel)>
+X<IRC channel (#parrot)>
+
+Parrot developers and users congregate on IRC at C<#parrot> on the
+U<irc://irc.parrot.org> server. It's a good place to get real-time answers to
+questions or see how things are progressing.
+
+=head3 Issue Tracking & Wiki
+
+X<trac.parrot.org website>
+X<issue tracking (trac.parrot.org)>
+
+Parrot developers track issues with a Trac site at U<https://trac.parrot.org/>.
+Users can submit new tickets and track the status of existing tickets. The
+site also includes a wiki used in project development, a source code browser,
+and the project roadmap.
+
+=head2 Parrot Development
+
+X<development cycles>
+
+Parrot's first release occurred in September 2001. It reached 1.0 in March
+2009. The Parrot project makes releases on the third Tuesday of each month. Two
+releases a year E<mdash> occuring every January and July E<mdash> are
+"supported" releases intended for production use. The other ten releases are
+development releases for language implementers and testers.
+
+Development proceeds in cycles around releases. Activity just before a release
+focuses on closing tickets, fixing bugs, reviewing documentation, and preparing
+for the release. Immediately after the release, larger changes occur, such as
+merging branches, adding large features, or removing deprecated features. This
+allows developers to ensure that changes have sufficient testing time before
+the next release. Releases also encourage feedback as casual users and testers
+explore the newest versions.
+
+=head2 The Parrot Team
+
+Parrot developers fulfill several rules according to their skills and interests.
+
+=over 4
+
+=item Architect
+
+X<architect role>
+
+The architect has primary responsibility for setting the overall direction of
+the project, facilitating team communication, and explaining and evaluating
+architectural issues. The architect makes design decisions and documents them
+in Parrot Design Documents, and oversees design and documentation work
+delegated to other members of the team to provide a coherent vision across the
+project. The architect also works with the release managers to develop and
+maintain the release schedule. Allison Randal currently leads the Parrot
+project as architect.
+
+=item Release Managers
+
+X<release manager role>
+
+Release managers manage and produce monthly releases according to the release
+schedule. Parrot has multiple release managers who rotate the responsibility
+for each monthly release. The release managers develop and maintain the release
+schedule jointly with the project architect.
+
+=item Metacommitter
+
+X<metacommitter role>
+
+Metacommitters manage commit access to the Parrot repository. Once a
+contributor is selected for commit access, a metacommitter gives the new
+committer access to the SVN repository and the bugtracker. The architect is a
+metacommitter, but other team members also hold this role.
+
+=item Committer
+
+X<committer role>
+
+Contributors who submit numerous, high-quality patches may be considered to
+become a committer. Committers have commit access to the full Parrot
+repository, though they often specialize on particular parts of the project.
+Contributors may be considered for commit access either by being nominated by
+another committer, or by requesting it.
+
+=item Core Developer
+
+X<core developer role>
+
+Core developers develop and maintain core subsystems such as the I/O
+subsystem, the exceptions system, or the concurrency scheduler.
+
+=item Compiler Developer
+
+X<compiler developer role>
+
+Compiler developers develop and maintain one or more Parrot front-end
+compilers such as IMCC, PIRC, PGE and TGE.
+
+=item High-Level Language Developer
+
+X<HLL developer role>
+
+Developers who work on any of the high-level languages that target
+ParrotE<mdash>such as Lua, Perl, PHP, Python, Ruby, or TclE<mdash>are
+high-level language developers. The Parrot repository includes a few example
+languages. A full list of languages is available at
+U<https://trac.parrot.org/parrot/wiki/Languages>.
+
+=item Build Manager
+
+X<build manager role>
+
+Build managers maintain and extend configuration and build subsystems.
+They review smoke reports and attempt to extend platform support.
+
+=item Tester
+
+X<tester role>
+
+Testers develop, maintain, and extend the core test suite coverage and testing
+tools. Testers are also responsible for testing goals, including complete
+coverage of core components on targeted platforms.
+
+=item Patch Monsters
+
+X<patch monster role>
+
+Hackers and developers submit patches to Parrot every day, and it takes a keen
+eye and a steady hand to review and apply them all. Patch monsters check
+patches for conformance with coding standards and desirability of features,
+rework them as necessary, verify that the patches work as desired, and apply
+them.
+
+=item Cage Cleaners
+
+X<cage cleaner role>
+
+The cage cleaners ensure that development follows the project's coding
+standards, documentation is complete and accurate, all tests function properly,
+and new users have accurate and comprehensive coding examples. A special class
+of Trac tickets is available for these tasks. Cage cleaning tasks run the
+gamut from entry-level to advanced; this is a good entry point for new users
+to work on Parrot.
+
+=item General Contributor
+
+X<contributor role>
+
+Contributors write code or documentation, report bugs, take part in email or
+online conversations, or contribute to the project in other ways. All volunteer
+contributions are appreciated.
+
+=back
+
+=head2 Licensing
+
+X<license>
+
+The Parrot foundation supports the Parrot development community and holds
+trademarks and copyrights to Parrot. The project is available under the
+Artistic License 2.0, allowing free use in commercial and open source/free
+software contexts.
+
+=cut
+
+# Local variables:
+# c-file-style: "parrot"
+# End:
+# vim: expandtab shiftwidth=4:
Copied: branches/pluggable_runcore/docs/book/pct/ch02_getting_started.pod (from r40540, trunk/docs/book/pct/ch02_getting_started.pod)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/docs/book/pct/ch02_getting_started.pod Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/docs/book/pct/ch02_getting_started.pod)
@@ -0,0 +1,182 @@
+=pod
+
+=head1 Getting Started
+
+Before you can use Parrot, you have to get it running on your machine.
+
+=head2 Installing Parrot
+
+The simplest way to install Parrot is to use a pre-compiled binary for your
+operating system or distribution. Packages are available for many packaging
+systems, including Debian, Ubuntu, Fedora, Mandriva, FreeBSD, Cygwin, and
+MacPorts. The Parrot website lists all known packages at
+U<http://www.parrot.org/download>. A binary installer for Windows is also
+available at U<http://parrotwin32.sourceforge.net/>.
+
+If packages aren't available on your system, download the latest supported
+release from U<http://www.parrot.org/release/supported>.
+
+You need a C compiler and a make utility to build Parrot from source code --
+usually C<gcc> and C<make>, but Parrot can build with standard compiler
+toolchains on different operating systems. Perl 5.8 is also a prerequiste for
+configuring and building Parrot.
+
+If you have these dependencies installed, build the core virtual machine and
+compiler toolkit and run the standard test suite with the commands:
+
+ $ B<perl Configure.pl>
+ $ B<make>
+ $ B<make test>
+
+By default, Parrot installs to directories F<bin/>, C<lib/>, et cetera under
+the prefix F</usr/local>. If you have privileges to write to these
+directories, install Parrot with:
+
+ $ B<make install>
+
+To install Parrot beneath a different prefix, use the C<--prefix> option to
+C<Configure.pl>:
+
+ $ B<perl Configure.pl --prefix=/home/me/parrot>
+
+If you intend to I<develop> -- not just I<use> -- a language on Parrot, install
+the Parrot developer tools as well:
+
+ $ B<make install-dev>
+
+=head2 Running Parrot
+
+Once you've installed Parrot, run it. Create a test file called F<news.pasm>.
+C<.pasm> files contain Parrot Assembly Language (PASM) instructions; this is a
+low-level language native to the Parrot virtual machine.
+
+=begin PASM
+
+ say "Here is the news for Parrots."
+ end
+
+=end PASM
+
+Now run this file with:
+
+ $ B<parrot news.pasm>
+
+which will print:
+
+ Here is the news for Parrots.
+
+=head2 Running a Language on Parrot
+
+Next, try out one of Parrot's high-level languages. Create a test file
+called F<more_news.nqp>:
+
+ say "No parrots were involved in an accident on the M1 today..."
+
+Then run it as:
+
+ $ nqp more_news.nqp
+
+which will print:
+
+ No parrots were involved in an accident on the M1 today...
+
+=head2 What Next?
+
+This book describes Parrot in terms of tasks it supports. You may pick and
+choose chapters based on your area of interest:
+
+=over 4
+
+=item Chapter 3, I<Parrot Intermediate Representation>
+
+Parrot Intermediate Representation (PIR) is a mid-level language native to the
+Parrot virtual machine s commonly used for writing extensions and tools for
+Parrot.
+
+=item Chapter 4, I<Compiler Tools>
+
+The Parrot Compiler Toolkit (PCT) provides a common infrastructure and
+utilities for implementing languages on Parrot.
+
+=item Chapter 5, I<Grammar Engine>
+
+The Parrot Grammar Engine (PGE) is a powerful regular expression engine and
+recursive descent parser. PGE is part of the compiler tools; understanding PGE
+is essential to implementing a language on Parrot.
+
+=item Chapter 6, I<Grammar Actions>
+
+NQP (Not Quite Perl) is a lightweight language loosely inspired by Perl 6. NQP
+is part of the compiler tools used for transforming a Parrot-hosted language
+into instructions for Parrot to execute.
+
+=item Chapter 7, I<Dynamic PMCs>
+
+=for author
+
+This chapter suggests the need for a chapter on core PMCs. Alternately, this
+chapter could cover PMCs in general and dynpmcs as a special case of PMCs.
+
+=end for
+
+Parrot allows language developers to extend Parrot's core data types to suit
+the needs of advanced languages.
+
+=item Chapter 8, I<Dynamic Opcodes>
+
+=for author
+
+The same point applies for ops and dynops.
+
+=end for
+
+Parrot allows language developers to extend Parrot's core instruction set --
+again to suit the needs of advanced languages.
+
+=item Chapter 10, I<Instruction Reference>
+
+Parrot's standard instruction set provides powerful behavior for primitive
+operations, control flow, object orientation, exception handling, and more.
+
+=item Chapter 11, I<Directive Reference>
+
+Parrot supports directives used within PIR and PASM code to change the behavior
+of code and to control what happens in bytecode.
+
+=item Chapter 13, I<Operator Reference>
+
+PIR provides several higher-level operators as a convenience to programmers and
+code generators.
+
+=item Appendix A, I<Glossary>
+
+Parrot and its environment have common jargon.
+
+=item Appendix B, I<Command-Line Options>
+
+Parrot supports several flags to control execution modes, debugging, library
+loading, and more.
+
+=item Appendix C, I<Build Options>
+
+Parrot's configuration process gives administrators and developers tremendous
+control over the build system.
+
+=item Appendix D, I<Source Code>
+
+Parrot's source code is organized along logical lines -- logical, once you know
+the layout.
+
+=item Appendix E, I<Patch Submission>
+
+Parrot depends on the combined efforts of numerous volunteers. Your
+contributions are very welcome.
+
+=back
+
+=cut
+
+# Local variables:
+# c-file-style: "parrot"
+# End:
+# vim: expandtab shiftwidth=4:
Copied: branches/pluggable_runcore/docs/book/pct/ch03_compiler_tools.pod (from r40540, trunk/docs/book/pct/ch03_compiler_tools.pod)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/docs/book/pct/ch03_compiler_tools.pod Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/docs/book/pct/ch03_compiler_tools.pod)
@@ -0,0 +1,333 @@
+=pod
+
+=head1 Parrot Compiler Tools
+
+Z<CHP-4>
+
+Parrot is able to natively compile and execute code in two low-level
+languages, PASM and PIR. These two languages, which are very similar to
+one another, are very close to the machine and analagous to assembly
+languages from hardware processors and other virtual machines. While they
+do expose the power of the PVM in a very direct way, PASM and PIR are not
+designed to be used for writing large or maintainable programs. For these
+tasks, higher level languages such as Perl 6, Python 3, Tcl, Ruby, and PHP
+are preferred instead, and the ultimate goal of Parrot is to support these
+languages and more. The question is, how do we get programs written in these
+languages running on Parrot? The answer is PCT.
+
+PCT is a set of classes and tools that enable the easy creation of
+compilers for high level languages (HLLs) that will run on Parrot. PCT is
+itself written in PIR, and compiles HLL code down to PIR for compilation
+and execution on Parrot, but allows the compiler designer to do most work
+in a high-level dialect of the Perl 6 language. The result is a flexible,
+dynamic language that can be used for creating other flexible, dynamic
+languages.
+
+
+=head2 History
+
+The Parrot Virtual Machine was originally conceived of as the engine for
+executing the new Perl 6 language, when specifications for that were first
+starting to be drafted. However, as time went on it was decided that Parrot
+would benefit from having a clean abstraction layer between it's internals
+and the Perl 6 language syntax. This clean abstraction layer brough with it
+the side effect that Parrot could be used to host a wide variety of dynamic
+languages, not just Perl 6. And beyond just hosting them, it could
+facilitate their advancement, interaction, and code sharing.
+
+The end result is that Parrot is both powerful enough to support one of the
+most modern and powerful dynamic languages, Perl 6, but well-encapsulated
+enough to host other languages as well. Parrot would be more powerful and
+feature-full than any single language, and would provide all that power and
+all those features to any languages that wanted them.
+
+Perl 6, under the project name Rakudo N<http://www.rakudo.org>, is still one
+of the primary user of Parrot and therefore one of the primary drivers in
+its development. However, compilers for other dynamic languages such as
+Python 3, Ruby, Tcl, are under active development. Several compilers exist
+which are not being as actively developed, and many compilers exist for
+new languages and toy languages which do not exist anywhere else.
+
+=head2 Capabilities and Benefits
+
+Parrot exposes a rich interface for high level languages to use, including
+several important features: a robust exceptions system, compilation into
+platform-independent bytecode, a clean extension and embedding interface,
+just-in-time compilation to machine code, native library interface mechanisms,
+garbage collection, support for objects and classes, and a robust concurrency
+model. Designing a new language or implementing a new compiler for an old
+language is easier with all of these features designed, implemented, tested,
+and supported in a VM already. In fact, the only tasks required of compiler
+implementers who target the Parrot platform is the creation of the parser
+and the language runtime.
+
+Parrot also has a number of other benefits for compiler writers to tap into:
+
+=over 4
+
+=item * Write Once and Share
+
+All HLLs on Parrot ultimately compile down to Parrot's platform-independent
+bytecode which Parrot can execute natively. This means at the lowest level
+Parrot supports interoperability between programs written in multiple high
+level languages. Find a library you want to use in Perl's CPAN
+N<http://www.cpan.org>? Have a web framework you want to use that's written
+in Ruby? A mathematics library that only has C bindings? Want to plug all
+of these things into a web application you are writing in PHP? Parrot
+supports this and more.
+
+=item * Native Library Support
+
+Parrot has a robust system for interfacing with external native code
+libraries, such as those commonly written in C, C++, Fortran and other
+compiled languages. Where previously every interpreter would need to
+maintain it's own bindings and interfaces to libraries, Parrot enables
+developers to write library bindings once and use them seamlessly from
+any language executing on Parrot. Want to use Tcl's Tk libraries, along with
+Python's image manipulation libraries in a program you are writing in Perl?
+Parrot supports that.
+
+=back
+
+=head2 Compilation and Hosting
+
+For language hosting and interoperability to work, languages developers need
+to write compilers that convert source code written in high level languages
+to Parrot's bytecode. This process is analogous to how a compiler such as
+GCC converts C or C++ into machine code -- though instead of targeting
+machine code for a specific hardware platform, compilers written in Parrot
+produce Parrot code which can run on any hardware platform that can run
+Parrot.
+
+Creating a compiler for Parrot written directly in PIR is possible. Creating
+a compiler in C using the common tools lex and yacc is also possible.
+Neither of these options are really as good, as fast, or as powerful as
+writing a compiler using PCT.
+
+PCT is a suite of compiler tools that helps to abstract and automate the
+process of writing a new compiler on Parrot. Lexical analysis, parsing,
+optimization, resource allocation, and code generation are all handled
+internally by PCT and the compiler designer does not need to be concerned
+with any of it.
+
+
+=head2 PCT Overview
+
+The X<Parrot Compiler Tools;PCT> Parrot Compiler Tools (PCT) enable the
+creation of high-level language compilers and runtimes. Though the Perl 6
+development team originally created these tools to aide in the development
+of the Rakudo Perl 6 implementation, several other Parrot-hosted compilers
+also use PCT to great effect. Writing a compiler using Perl 6 syntax and
+dynamic language tools is much easier than writing a compiler in C,
+C<lex>, and C<yacc>.
+
+PCT is broken down into three separate tools:
+
+=over 4
+
+=item * Not Quite Perl (NQP)
+
+NQP a subset of the Perl 6 language that requires no runtime library to
+execute.
+
+=item * Perl Grammar Engine (PGE)
+
+PGE is an implementation of Perl 6's powerful regular expression and grammar
+tools.
+
+=item * HLLCompiler
+
+The HLLCompiler compiler helps to manage and encapsulate the compilation
+process. An HLLCompiler object, once created, enables the user to use the
+compiler interactively from the commandline, in batch mode from code files,
+or at runtime using a runtime eval.
+
+=back
+
+=head2 Grammars and Action Files
+
+A PCT-based compiler requires three basic files: the main entry point file
+which is typically written in PIR, the grammar specification file which uses
+PGE, and the grammar actions file which is in NQP. These are just the three
+mandatory components, most languages are also going to require additional
+files for runtime libraries and other features as well.
+
+=over 4
+
+=item * The main file
+
+The main file is (often) a PIR program which contains the C<:main> function
+that creates and executes the compiler object. This program instantiates a
+C<PCT::HLLCompiler> subclass, loads any necessary support libraries, and
+initializes any compiler- or languages-specific data.
+
+The main file tends to be short. The guts of the compiler logic is in the
+grammar and actions files. Runtime support and auxiliary functions often
+appear in other files, by convention. This separation of concerns tends to
+make compilers easier to maintain.
+
+=item * A grammar file
+
+The high-level language's grammar appears in a F<.pg> file. This file
+subclasses the C<PCT::Grammar> class and implements all of the necessary
+rules -- written using PGE -- to parse the language.
+
+=item * An actions file
+
+Actions contains methods -- written in NQP -- on the C<PCT::Grammar:Actions>
+object which receive parse data from the grammar rules and construct an
+X<Abstract Syntax Tree;Parrot Abstract Syntax Tree;AST;PAST> Abstract Syntax
+Tree (AST).N<The Parrot version of an AST is, of course, the Parrot Abstract
+Syntax Tree, or PAST.>
+
+=back
+
+PCT's workflow is customizable, but simple. The compiler passes the source
+code of the HLL into the grammar engine. The grammer engine parses this code
+and returns a X<PGE;Match Object> special Match object which represents a
+parsed version of the code. The compiler then passes this match object to the
+action methods, which convert it in stages into PAST. The compiler finally
+converts this PAST into PIR code, which it can save to a file, convert to
+bytecode, or execute directly.
+
+=head3 C<mk_language_shell.pl>
+
+The only way creating a new language compiler could be easier is if these files
+created themselves. PCT includes a tool to do just that:
+C<mk_language_shell.pl>. This program automatically creates a new directory in
+F<languages/> for your new language, the necessary three files, starter files
+for libraries, a F<Makefile> to automate the build process, and a basic test
+harness to demonstrate that your language works as expects.
+
+These generated files are all stubs which will require extensive editing to
+implement a full language, but they are a well-understood and working starting
+point. With this single command you can create a working compiler. It's up to
+you to fill the details.
+
+C<mk_language_shell.pl> prefers to run from within a working Parrot repository.
+It requires a single argument, the name of the new project to create. There
+are no hard-and-fast rules about names, but the Parrot developers reccomend
+that Parrot-based implementations of existing languages use unique names.
+
+Consider the names of Perl 5 distributions: Active Perl and Strawberry Perl.
+Python implementations are IronPython (running on the CLR) and Jython (running
+on the JVM). The Ruby-on-Parrot compiler isn't just "Ruby": it's Cardinal.
+The Tcl compiler on Parrot is Partcl.
+
+An entirely new language has no such constraints.
+
+From the Parrot directory, invoke C<mk_language_shell.pl> like:
+
+ $ B<cd languages/>
+ $ B<perl ../tools/build/mk_language_shell.pl <project name>>
+
+=head3 Parsing Fundamentals
+
+An important part of a compiler is the parser and lexical analyzer. The
+lexical analyzer converts the HLL input file into individual tokens. A token
+may consist of an individual punctuation ("+"), an identifier ("myVar"), a
+keyword ("while"), or any other artifact that stands on its own as a single
+unit. The parser attempts to match a stream of these input tokens against a
+given pattern, or grammar. The matching process orders the input tokens into an
+abstract syntax tree which the other portions of the compiler can process.
+
+X<top-down parser>
+X<bottom-up parser>
+X<parsers; top-down>
+X<parsers; bottom-up>
+Parsers come in top-down and bottom-up varieties. Top-down parsers start with a
+top-level rule which represents the entire input. It attempts to match various
+combination of subrules until it has consumed the entire input. Bottom-down
+parsers start with individual tokens from the lexical analyzer and attempt to
+combine them together into larger and larger patterns until they produce a
+top-level token.
+
+PGE is a top-down parser, although it also contains a bottom-up I<operator
+precedence> parser to make processing token clusters such as mathematical
+expressions more efficient.
+
+=head2 Driver Programs
+
+The driver program for the new compiler must create instances of the various
+necessary classes that run the parser. It must also include the standard
+function libraries, create global variables, and handle commandline options.
+PCT provides several useful command-line options, but driver programs may need
+to override several behaviors.
+
+PCT programs can run in two ways. An interactive mode runs one statement at a
+time in the console. A file mode loads and runs an entire file at once. A
+driver program may specificy information about the interactive prompt and
+environment, as well as help and error messages.
+
+=head3 C<HLLCompiler> class
+
+The C<HLLCompiler> class implements a compiler object. This object contains
+references to language-specific parser grammar and actions files, as well as
+the steps involved in the compilation process. The stub compiler created by
+C<mk_language_shell.pl> might resemble:
+
+ .sub 'onload' :anon :load :init
+ load_bytecode 'PCT.pbc'
+ $P0 = get_hll_global ['PCT'], 'HLLCompiler'
+ $P1 = $P0.'new'()
+ $P1.'language'('MyCompiler')
+ $P1.'parsegrammar'('MyCompiler::Grammar')
+ $P1.'parseactions'('MyCompiler::Grammar::Actions')
+ .end
+
+ .sub 'main' :main
+ .param pmc args
+ $P0 = compreg 'MyCompiler'
+ $P1 = $P0.'command_line'(args)
+ .end
+
+The C<:onload> function creates the driver object as an instance of
+C<HLLCompiler>, sets the necessary options, and registers the compiler with
+Parrot. The C<:main> function drives parsing and execution begin. It calls the
+C<compreg> opcode to retrieve the registered compiler object for the language
+"MyCompiler" and invokes that compiler object using the options received from
+the commandline.
+
+The C<compreg> opcode hides some of Parrot's magic; you can use it multiple
+times in a program to compile and run different languages. You can create
+multiple instances of a compiler object for a single language (such as for
+runtime C<eval>) or you can create compiler objects for multiple languages for
+easy interoperability. The Rakudo Perl 6 C<eval> function uses this mechanism
+to allow runtime eval of code snippets in other languages:
+
+ eval("puts 'Konnichiwa'", :lang<Ruby>);
+
+=head3 C<HLLCompiler> methods
+
+The previous example showed the use of several HLLCompiler methods:
+C<language>, C<parsegrammar>, and C<parseactions>. These three methods are the
+bare minimum interface any PCT-based compiler should provide. The C<language>
+method takes a string argument that is the name of the compiler. The
+HLLCompiler object uses this name to register the compiler object with Parrot.
+The C<parsegrammar> method creates a reference to the grammar file that you
+write with PGE. The C<parseactions> method takes the class name of the NQP file
+used to create the AST-generator for the compiler.
+
+If your compiler needs additional features, there are several other available
+methods:
+
+=over 4
+
+=item * C<commandline_prompt>
+
+The C<commandline_prompt> method allows you to specify a custom prompt to
+display to users in interactive mode.
+
+=item * C<commandline_banner>
+
+The C<commandline_banner> method allows you to specify a banner message that
+displays at the beginning of interactive mode.
+
+=back
+
+=cut
+
+# Local variables:
+# c-file-style: "parrot"
+# End:
+# vim: expandtab shiftwidth=4:
Copied: branches/pluggable_runcore/docs/book/pct/ch04_pge.pod (from r40540, trunk/docs/book/pct/ch04_pge.pod)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/docs/book/pct/ch04_pge.pod Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/docs/book/pct/ch04_pge.pod)
@@ -0,0 +1,1558 @@
+=pod
+
+=head1 Grammar Engine
+
+X<Parrot Grammar Engine>
+X<PGE (Parrot Grammar Engine)>
+The Parrot Grammar Engine (PGE) is a parser generator, one of the key
+components of the Parrot Compiler Toolkit. It reads grammar files written in
+the PGE rules format and generates parser modules written in PIR code. PGE
+rules provide the full power of I<recursive descent parsing> and I<operator
+precedence parsing>. Fortunately, you don't need to know what those terms
+mean in order to make good use of PGE. We'll introduce the necessary
+concepts as we talk about various features in this chapter.
+
+=head2 Grammars
+
+The ultimate goal of a parser is to match patterns in a source language and
+convert them to an internal data structure for later manipulations. As a
+programmer, you're probably already familiar with some of these types of
+patterns: function declarations, function calls, statements, and assignments.
+Each of these different concepts have a particular form called a I<syntax>.
+In C for example, the syntax to define a function looks something like this:
+
+ <return_type> <function_name> ( <arguments> ) { <function_body> }
+
+Things that fit this pattern, so long as all the sub-patterns use the proper
+syntax also, are valid subroutines in C. Similarly, we can use a slightly
+different pattern to create a subroutine:
+
+ sub <function_name> { <function_body> }
+
+A grammar is a collection of rules like the ones above that specify all the
+acceptable patterns in a language. Grammars group together these rules in
+much the same way that a groups together related data fields and methods
+N<In languages like Perl 6 for instance, a grammar is just a special kind
+of class and a rule is just a special kind of method.>. Each rule defines
+a pattern for matching one unit of text, and can be made up of various other
+rules which are called recursively to make a complete match.
+
+A rule can contain regular expressions to match patterns of characters:
+
+ rule id { \d+ }
+
+A rule can also contain patterns of references to other rules:
+
+ rule record { <id> <name> <phone> }
+
+A grammar contains a group of rules that work together to match the entire
+language:
+
+ grammar Contacts;
+
+ rule name { 'John' | 'Bob ' | 'Fred' }
+
+ rule id { \d+ }
+
+ rule record { <id> <name> }
+
+ ...
+
+=head3 Rules and Tokens
+
+X<rule>
+X<token>
+There are two different kinds of rules: C<rule>, which we saw above, and
+C<token>. A C<rule> performs smart whitespace matching between the various
+pieces of the pattern. The C<record> rule given previously would match
+"6355 John" or "6355 John" but not "6355John".
+
+A C<token> matches whitespace only if you specifically request it. To get the
+same effect with a token, add the C<\s> (match a space character) and C<+>
+(match the preceding atom -- the space character, in this case -- one or more
+times) pattern to the rule:
+
+ token record { <id> \s+ <name> }
+
+=head3 The Start Rule
+
+X<top>
+X<top-down parser>
+A recursive descent parser is what's called a I<top-down parser>. It starts
+at the highest-level rule, called C<TOP>, and works its way down through
+individual rules to match an entire string or file. Real Perl 6 allows any
+name for the top-level rule, but PCT expects a rule called C<TOP>. If PCT
+was as fully-featured as Perl 6, people would use it instead! Here's an
+example of a TOP rule:
+
+ rule TOP { <record> }
+
+This rule matches a single C<record> pattern in a string or file. Once the
+parser has succeeded in matching the entire string or file passed to the
+start rule, it returns a parse tree. If it cannot match the entire input
+with the rules provided, it can either return a partial match, or it can
+throw a parse error.
+
+=head3 Testing a Grammar
+
+Let's do a small example grammar. Save this example to a file called
+F<Contacts.pg>:
+
+ grammar Contacts is PGE::Grammar;
+
+ rule TOP { <record> }
+ rule record { <id> <name> }
+ token name { 'John' | 'Bob ' | 'Fred' }
+ token id { \d+ }
+
+Then compile the grammar:
+
+ $ B<parrot Perl6Grammar.pbc --output=Contacts.pir Contacts.pg>
+
+=for author
+
+Assume an installed Parrot for all examples? Anyone working from the source
+tree should be able to mangle paths appropriately.
+
+=end for
+
+The path to F<parrot> and to the F<Perl6Grammar.pbc> file will vary on
+different systems. If you compiled Parrot from source, it will be:
+
+ $ B<./parrot runtime/parrot/library/PGE/Perl6Grammar.pbc \>
+ B<--output=Contacts.pir Contacts.pg>
+
+Next, create a small PIR script to run your grammar. Save it as
+F<grammar_test.pir>:
+
+=begin PIR
+
+ .sub main :main
+ load_bytecode 'PGE.pbc' # load some required modules
+ load_bytecode 'dumper.pbc'
+ load_bytecode 'PGE/Dumper.pbc'
+
+ load_bytecode 'Contacts.pir' # load your grammar
+
+ .local string source
+ source = "3 John"
+
+ .local pmc top, grammar, match
+ top = get_hll_global ['Contacts'], 'TOP'
+ grammar = get_class 'Contacts'
+ match = top(source, 'grammar' => grammar)
+
+ _dumper(match, "match")
+ .end
+
+=end PIR
+
+Run the test script:
+
+ $ B<parrot grammar_test.pir>
+
+It will print out a text representation of the raw parse tree stored in the
+C<match> variable:
+
+ "match" => PMC 'Contacts' => "3 John" @ 0 {
+ <record> => PMC 'Contacts' => "3 John" @ 0 {
+ <id> => PMC 'Contacts' => "3" @ 0
+ <name> => PMC 'Contacts' => "John" @ 2
+ }
+ }
+
+Each node in the tree corresponds to a rule in the grammar. The top-level
+match variable contains one child named C<record>, which contains two children
+named C<id> and C<name>. C<id> contains the number 3, and C<name> contains the
+string "John". This is exactly what the simple grammar should have matched.
+
+=head2 Rule Syntax
+
+Every language has a set of basic components (words or parts of words) and
+syntax conventions for combining them. The "words" in rules are literal
+characters or symbols, some X<metacharacters> metacharacters (or metasymbols),
+and X<rules;escape sequences>X<escape sequences, rules> escape sequences, while
+the combining syntax includes other metacharacters, X<quantifiers, rules>
+X<rules;quantifiers> quantifiers, bracketing characters, and assertions.
+
+=head3 Metacharacters
+
+The C<.> metacharacter matches any single character, even a newline character.
+The C<^> and C<$> metacharacters are zero-width matches which represent the
+beginning and end of a string. They each have doubled alternates C<^^> and
+C<$$> that match at the beginning and end of every (newline-delimited) line
+within a string.
+
+The C<|>, C<&>, C<\>, C<#>, and C<:=> metacharacters are all syntax structure
+elements. C<|> alternates between two options. C<&> matches two patterns
+simultaneously (the patterns must be the same length). C<\> turns literal
+characters into metacharacters (producing escape sequences). C<#> starts a
+comment which proceeds until the end of the line. You can start a comment at
+any point on any line in a rule. C<:=> binds a hypothetical variable to the
+result of a subrule or grouped pattern (see L<Hypothetical Variables>).
+
+The metacharacters C<()>, C<[]>, C<{}> and C<E<lt>E<gt>> are bracketing pairs.
+Bracketing pairs must always be balanced within the rule; to use a literal
+character, escape it with a C<\>. The C<()> and C<[]> pairs group patterns as
+a single atom. They often capture a result, mark the boundaries of an
+alternation, or mark a group of patterns with a quantifier. Parentheses C<()>
+capture, but square brackets C<[]> do not. The C<{}> brackets define a section
+of code (a closure) within a rule. These closures are always a successful
+zero-width match. The C<E<lt>...E<gt>> brackets mark assertions, which handle a
+variety of constructs including character classes and user-defined quantifiers
+(see L<Assertions>).
+
+Table 7-2 summarizes the basic metacharacters.
+
+=begin table picture Metacharacters
+
+Z<CHP-7-TABLE-2>
+
+=headrow
+
+=row
+
+=cell Symbol
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<.>
+
+=cell Match any single character, including a newline.
+X<. (dot);. match single character (rules)>
+
+=row
+
+=cell C<^>
+
+=cell Match the beginning of a string.
+X<^ (caret);^ beginning of string (rules)>
+
+=row
+
+=cell C<$>
+
+=cell Match the end of a string.
+X<$ (dollar sign);$ end of string (rules)>
+
+=row
+
+=cell C<^^>
+
+=cell Match the beginning of a line within the string.
+X<^ (caret);^^ beginning of line (rules)>
+
+=row
+
+=cell C<$$>
+
+=cell Match the end of a line within the string.
+X<$ (dollar sign);$$ end of line (rules)>
+
+=row
+
+=cell C<|>
+
+=cell Match alternate patterns (OR).
+
+=row
+
+=cell C<&>
+
+=cell Match multiple patterns (AND).
+
+=row
+
+=cell C<\>
+
+=cell Escape a metacharacter to get a literal character, or escape a
+literal character to get a metacharacter.
+X<\ (backslash);\ escape sequences (rules)>
+X<\ (backslash);\ to escape metacharacters (rules)>
+
+=row
+
+=cell C<#>
+
+=cell Mark a comment (to the end of the line).
+
+=row
+
+=cell C<:=>
+
+=cell Bind the result of a match to a hypothetical variable.
+X<: (colon);:= (binding);in rules>
+
+=row
+
+=cell C<(...)>
+
+=cell Group patterns and capture the result.
+
+=row
+
+=cell C<[...]>
+
+=cell Group patterns without capturing.
+
+=row
+
+=cell C<{...}>
+
+=cell Execute a closure (Perl 6 code) within a rule.
+
+=row
+
+=cell C<E<lt>...E<gt>>
+
+=cell Match an assertion.
+
+=end table
+
+=head3 Escape Sequences
+
+Z<CHP-7-SECT-2.2>
+
+X<escape sequences, rules>
+X<rules;escape sequences>
+X<\ (backslash);\ escape sequences (rules)>
+
+Escape sequences are literal characters acting as metacharacters. A preceding
+backslash (C<\>) identifies them as escapes. Some escape sequences represent
+single characters that are difficult to represent literally, such as C<\t> for
+tab, or C<\x[...]> to specify a character by its hexadecimal number. Some
+represent limited character classes, such as C<\d> for digits or C<\w> for word
+characters. Some represent zero-width positions in a match, such as C<\b> for a
+word boundary.
+
+X<variable interpolation in rules>
+X<rules;variable interpolation>
+If you've used Perl 5 regexps, you may remember the C<\Q> escape sequence which
+treats everything until the following C<\E> sequence as literal text,
+containing no escape sequences. Because ordinary variables now interpolate as
+literal strings by default, the C<\Q> escape sequence is rarely needed.
+
+A<CHP-7-TABLE-3>Table 7-3 shows the escape sequences for rules.
+
+=begin table picture Escape sequences
+
+Z<CHP-7-TABLE-3>
+
+=headrow
+
+=row
+
+=cell Escape
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<\0[...]>
+
+=cell Match a character given in octal (brackets optional).
+
+=row
+
+=cell C<\b>
+
+=cell Match a word boundary.
+
+=row
+
+=cell C<\B>
+
+=cell Match when not on a word boundary.
+
+=row
+
+=cell C<\c[...]>
+
+=cell Match a named character or control character.
+
+=row
+
+=cell C<\C[...]>
+
+=cell Match any character except the bracketed named or control character.
+
+=row
+
+=cell C<\d>
+
+=cell Match a digit.
+
+=row
+
+=cell C<\D>
+
+=cell Match a non-digit.
+
+=row
+
+=cell C<\e>
+
+=cell Match an escape character.
+
+=row
+
+=cell C<\E>
+
+=cell Match anything but an escape character.
+
+=row
+
+=cell C<\f>
+
+=cell Match the form feed character.
+
+=row
+
+=cell C<\F>
+
+=cell Match anything but a form feed.
+
+=row
+
+=cell C<\n>
+
+=cell Match a (logical) newline.
+
+=row
+
+=cell C<\N>
+
+=cell Match anything but a (logical) newline.
+
+=row
+
+=cell C<\h>
+
+=cell Match horizontal whitespace.
+
+=row
+
+=cell C<\H>
+
+=cell Match anything but horizontal whitespace.
+
+=row
+
+=cell C<\L[...]>
+
+=cell Everything within the brackets is lowercase.
+
+=row
+
+=cell C<\Q[...]>
+
+=cell All metacharacters within the brackets match as literal characters.
+
+=row
+
+=cell C<\r>
+
+=cell Match a return.
+
+=row
+
+=cell C<\R>
+
+=cell Match anything but a return.
+
+=row
+
+=cell C<\s>
+
+=cell Match any whitespace character.
+
+=row
+
+=cell C<\S>
+
+=cell Match anything but whitespace.
+
+=row
+
+=cell C<\t>
+
+=cell Match a tab.
+
+=row
+
+=cell C<\T>
+
+=cell Match anything but a tab.
+
+=row
+
+=cell C<\U[...]>
+
+=cell Everything within the brackets is uppercase.
+
+=row
+
+=cell C<\v>
+
+=cell Match vertical whitespace.
+
+=row
+
+=cell C<\V>
+
+=cell Match anything but vertical whitespace.
+
+=row
+
+=cell C<\w>
+
+=cell Match a word character (Unicode alphanumeric characters plus the
+underscore C<_>).
+
+=row
+
+=cell C<\W>
+
+=cell Match anything but a word character.
+
+=row
+
+=cell C<\x[...]>
+
+=cell Match a character given in hexadecimal (brackets optional).
+
+=row
+
+=cell C<\X[...]>
+
+=cell Match anything but the character given in hexadecimal (brackets
+optional).
+
+=end table
+
+=head3 Quantifiers
+
+Z<CHP-7-SECT-2.3>
+
+Quantifiers specify the number of times an atom (a single character,
+metacharacter, escape sequence, grouped pattern, assertion, etc) will match.
+
+X<. (dot);.. (range);quantifier (rules)>
+X<. (dot);... (infinite range);quantifier (rules)>
+The numeric quantifiers use assertion syntax. A single number (C<E<lt>3E<gt>>)
+requires exactly that many matches. A numeric range quantifier
+(C<E<lt>3C<..>5E<gt>>) succeeds if the number of matches is between the minimum
+and maximum numbers, inclusive. A range with three trailing dots
+(C<E<lt>2...E<gt>>) is shorthand for C<E<lt>R<n>..InfE<gt>>; it matches as many
+times as possible.
+
+Each quantifier has a minimal alternate form -- marked with a trailing C<?> --
+which matches the shortest possible sequence first. That is, given the string
+C<aaaaaa>, C<aE<lt>3C<..>5E<gt>> will match C<aaaaa> and C<aE<lt>3C<..>5E<gt>?>
+will match C<aaa>.
+
+A<CHP-7-TABLE-4>Table 7-4 shows the built-in
+X<quantifiers, rules> X<rules;quantifiers> quantifiers.
+
+=begin table picture Quantifiers
+
+Z<CHP-7-TABLE-4>
+
+=headrow
+
+=row
+
+=cell Maximal
+
+=cell Minimal
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<*>
+
+=cell C<*?>
+
+=cell Match 0 or more times.
+
+=row
+
+=cell C<+>
+
+=cell C<+?>
+
+=cell Match 1 or more times.
+
+=row
+
+=cell C<?>
+
+=cell C<??>
+
+=cell Match 0 or 1 times.
+
+=row
+
+=cell C<E<lt>>R<n>C<E<gt>>
+
+=cell C<E<lt>>R<n>C<E<gt>?>
+
+=cell Match exactly R<n> times.
+
+=row
+
+=cell C<E<lt>>R<n>C<..>R<m>C<E<gt>>
+
+=cell C<E<lt>>R<n>C<..>R<m>C<E<gt>?>
+
+=cell Match at least R<n> and no more than R<m> times.
+
+=row
+
+=cell C<E<lt>>R<n>C<...E<gt>>
+
+=cell C<E<lt>>R<n>C<...E<gt>?>
+
+=cell Match at least R<n> times.
+
+=end table
+
+=head3 Assertions
+
+Z<CHP-7-SECT-2.4>
+
+X<assertions, rules>
+X<rules;assertions>
+An assertion states that some condition or state is true. The match fails when
+that assertion is false.
+
+X<variable interpolation in rules>
+X<rules;variable interpolation>
+
+Assertions match named and anonymous rules, arrays or hashes containing
+anonymous rules, and subroutines or closures that return anonymous rules.
+
+To interpolate a variable in assertion rules, enclose it in assertion
+delimiters.
+A bare scalar in a pattern
+interpolates as a literal string, while a scalar variable in assertion
+brackets interpolates as an anonymous rule. A bare array in a pattern
+matches as a series of alternate literal strings, while an array in
+assertion brackets interpolates as a series of alternate anonymous
+rules.
+
+A bare hash in a pattern matches a word (C<\w+>) if and only if that word is
+one of its keysN<The effect is similar to matching the keys as a series of
+alternates, but it prefers to match the longest possible key, instead of the
+first potential match.>, while a hash in assertion brackets also matches the
+associated value as an anonymous rule.
+
+X<fail keyword>
+A bare closure in a pattern always matches (unless it calls C<fail>), but a
+closure in assertion brackets C<E<lt>{...}E<gt>> must return an anonymous rule
+to match.
+
+An assertion with parentheses C<E<lt>(...)E<gt>> resembles a bare closure in a
+pattern in that it allows you to include Perl code within a rule.
+C<E<lt>(...)E<gt>> evaluates the return value of the closure in boolean
+context. The match succeeds or fails based on that return value.
+
+Assertions match character classes, both named and enumerated. A named rule
+character class is often more accurate than an enumerated character class. The
+common C<E<lt>[a-zA-Z]E<gt>> idiom matches ASCII alphabetic characters, but the
+more comprehensive built-in rule C<E<lt>alphaE<gt>> matches the full set of
+Unicode alphabetic characters.
+
+A<CHP-7-TABLE-5>Table 7-5 shows the syntax of assertions.
+
+=begin table picture Assertions
+
+Z<CHP-7-TABLE-5>
+
+=headrow
+
+=row
+
+=cell Syntax
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<E<lt>...E<gt>>
+
+=cell Generic assertion delimiter.
+
+=row
+
+=cell C<E<lt>!...E<gt>>
+
+=cell Negate any assertion.
+
+=row
+
+=cell C<E<lt>>R<name>C<E<gt>>
+
+=cell Match a named rule or character class.
+
+=row
+
+=cell C<E<lt>[...]E<gt>>
+
+=cell Match an enumerated character class.
+
+=row
+
+=cell C<E<lt>-...E<gt>>
+
+=cell Complement a character class (named or enumerated).
+
+=row
+
+=cell C<E<lt>"..."E<gt>>
+
+=cell Match a literal string (interpolated at match time).
+
+=row
+
+=cell C<E<lt>'...'E<gt>>
+
+=cell Match a literal string (not interpolated).
+
+=row
+
+=cell C<E<lt>(...)E<gt>>
+
+=cell Boolean assertion. Execute a closure and match if it returns a true
+result.
+
+=row
+
+=cell C<E<lt>$scalarE<gt>>
+
+=cell Match an anonymous rule.
+
+=row
+
+=cell C<E<lt>@arrayE<gt>>
+
+=cell Match a series of anonymous rules as alternates.
+
+=row
+
+=cell C<E<lt>%hashE<gt>>
+
+=cell Match a key from the hash, then its value (as an anonymous rule).
+
+=row
+
+=cell C<E<lt>E<amp>sub()E<gt>>
+
+=cell Match an anonymous rule returned by a sub.
+
+=row
+
+=cell C<E<lt>{>R<code>C<}E<gt>>
+
+=cell Match an anonymous rule returned by a closure.
+
+=row
+
+=cell C<E<lt>.E<gt>>
+
+=cell Match any logical grapheme, including combining character sequences.
+
+=end table
+
+=head3 Modifiers
+
+Z<CHP-7-SECT-2.5>
+
+X<modifiers>
+X<: (colon);: modifier delimiter in rules>
+Modifiers alter the meaning of a pattern. The standard position for modifiers
+is at the beginning of the rule, right after the C<m>, C<s>, or C<rx>, or after
+the name in a named rule. Modifiers cannot attach to the outside of a bare
+C</.../>. For example:
+
+ m:i/marvin/ # case insensitive
+ rule names :i { marvin | ford | arthur }
+
+You may group single-character modifiers, but you must separate longer
+modifiers by colons:
+
+ m:wig/ zaphod / # OK
+ m:words:ignorecase:globally / zaphod / # OK
+ m:wordsignorecaseglobally / zaphod / # Not OK
+
+Most modifiers can also appear inside the rule when attached to rule or
+grouping delimiters. Internal modifiers are lexically scoped to their enclosing
+delimiters, so can alter subpatterns:
+
+ m/:w I saw [:i zaphod] / # only 'zaphod' is case insensitive
+
+The repetition modifiers (C<:R<N>x>, C<:R<N>th>, C<:once>, C<:globally>, and
+C<:exhaustive>) and the continue modifier (C<:cont>) alter the return value of
+the rule as a whole, so you cannot use them lexically inside a rule.
+
+The C<:R<N>x> modifier matches the rule a specific number of times. If the
+modifier expects more matches than the string has, the match fails. Its
+alternate form (C<:x(R<N>)>) can take a variable in place of the number.
+
+The C<:once> modifier on a rule only allows it to match once. The rule will not
+match again until the you call the C<.reset> method on the rule object.
+
+The C<:globally> modifier matches as many times as possible. The C<:exhaustive>
+modifier also matches as many times as possible, in as many different ways as
+possible.
+
+The C<:R<N>th> modifier preserves one result from a particular counted match.
+If the rule matches fewer times than the modifier expects, the match fails. It
+has several alternate forms. One form, C<:th(R<N>)>, takes a variable in place
+of the number. The other forms -- C<:R<N>st>, C<:R<N>nd>, and C<:R<N>rd> --
+allow you to write more naturally C<:1st>, C<:2nd>, C<:3rd>. The other way is
+valid as well; choose whichever is most comfortable.
+
+By default, rules ignore literal whitespace within the pattern. The C<:w>
+modifier makes rules sensitive to literal whitespace, but in an intelligent
+way. Any cluster of literal whitespace acts like an explicit C<\s+> when it
+separates two identifiers and C<\s*> everywhere else.
+
+I<No> modifiers exist to treat the matched string as a single line or multiple
+lines. Instead, use the "beginning of string" and "end of string" or
+"beginning of line" and "end of line" metacharacters.
+
+A<CHP-7-TABLE-6>Table 7-6 lists the available modifiers.
+
+=begin table picture Modifiers
+
+Z<CHP-7-TABLE-6>
+
+=headrow
+
+=row
+
+=cell Short
+
+=cell Long
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<:i>
+
+=cell C<:ignorecase>
+
+=cell Case-insensitive match.
+
+=row
+
+=cell C<:I>
+
+=cell
+
+=cell Case-sensitive match (on by default).
+
+=row
+
+=cell C<:c>
+
+=cell C<:cont>
+
+=cell Continue where the previous match on the string left off.
+
+=row
+
+=cell C<:w>
+
+=cell C<:words>
+
+=cell Literal whitespace in the pattern matches as C<\s+>
+or C<\s*>.
+
+=row
+
+=cell C<:W>
+
+=cell
+
+=cell Turn off intelligent whitespace matching (return to default).
+
+=row
+
+=cell
+
+=cell :R<N>C<x>/C<:x(>R<N>C<)>
+
+=cell Match the pattern R<N> times.
+
+=row
+
+=cell
+
+=cell C<:>R<N>C<th>/C<:nth(>R<N>C<)>
+
+=cell Match the R<N>th occurrence of a pattern.
+
+=row
+
+=cell
+
+=cell C<:once>
+
+=cell Match the pattern once and only once.
+
+=row
+
+=cell C<:g>
+
+=cell C<:globally>
+
+=cell Match the pattern as many times as possible without overlapping
+possibilities.
+
+=row
+
+=cell C<:e>
+
+=cell C<:exhaustive>
+
+=cell Match every possible occurrence of a pattern, including overlapping
+possibilities.
+
+=row
+
+=cell
+
+=cell C<:u0>
+
+=cell . is a byte.
+
+=row
+
+=cell
+
+=cell C<:u1>
+
+=cell . is a Unicode codepoint.
+
+=row
+
+=cell
+
+=cell C<:u2>
+
+=cell . is a Unicode grapheme.
+
+=row
+
+=cell
+
+=cell C<:u3>
+
+=cell . is language dependent.
+
+=row
+
+=cell
+
+=cell C<:p5>
+
+=cell The pattern uses Perl 5 regex syntax.
+
+=end table
+
+=head3 Built-in Rules
+
+Z<CHP-7-SECT-3>
+
+X<rules;built-in>
+PGE provides several named rules, including a complete set of X<POSIX-style
+classes> POSIX-style classes, and X<Unicode property classes> Unicode property
+classes. The list isn't fully defined yet, but A<CHP-7-TABLE-7>Table 7-7 shows
+a few you're likely to see.
+
+The C<E<lt>nullE<gt>> rule matches a zero-width string (it always matches) and
+C<E<lt>priorE<gt>> matches whatever the most recent successful rule matched.
+These replace the two behaviors of X</ (slash);// invalid null pattern>
+X<invalid null pattern //> the Perl 5 null pattern C<//>, which is no longer
+valid syntax for rules.
+
+=begin table picture Built-in rules
+
+Z<CHP-7-TABLE-7>
+
+=headrow
+
+=row
+
+=cell Rule
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<E<lt>alphaE<gt>>
+
+=cell Match a Unicode alphabetic character.
+
+=row
+
+=cell C<E<lt>digitE<gt>>
+
+=cell Match a Unicode digit.
+
+=row
+
+=cell C<E<lt>spE<gt>>
+
+=cell Match a single space character (the same as C<\s>).
+
+=row
+
+=cell C<E<lt>wsE<gt>>
+
+=cell Match any whitespace (the same as C<\s+>).
+
+=row
+
+=cell C<E<lt>nullE<gt>>
+
+=cell Match the null string.
+
+=row
+
+=cell C<E<lt>priorE<gt>>
+
+=cell Match the same thing as the previous match.
+
+=row
+
+=cell C<E<lt>before ...E<gt>>
+
+=cell Zero-width lookahead. Assert that the current position I<precedes> a
+pattern.
+
+=row
+
+=cell C<E<lt>after ...E<gt>>
+
+=cell Zero-width lookbehind. Assert that the current position I<follows> a
+pattern.
+
+=row
+
+=cell C<E<lt>prop ...E<gt>>
+
+=cell Match any character with the named property.
+
+=row
+
+=cell C<E<lt>replace(...)E<gt>>
+
+=cell Replace everything matched so far in the rule or subrule with the
+given string (under consideration).
+
+=end table
+
+=head3 Backtracking Control
+
+Z<CHP-7-SECT-4>
+
+X<backtracking controls>
+X<fail keyword>
+Whenever part of the pattern fails to match, PGE performs backtracking --
+backing up to the previous point at which the match could succeed and trying
+again. You can explicitly trigger backtracking by calling the C<fail> function
+within a closure. A<CHP-7-TABLE-8>Table 7-8 displays metacharacters and
+built-in rules relevant to backtracking.
+
+=for author
+
+This could use an example.
+
+=end for
+
+=begin table picture Backtracking controls
+
+Z<CHP-7-TABLE-8>
+
+=headrow
+
+=row
+
+=cell Operator
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<:>
+
+=cell Don't retry the previous atom. Instead, fail to the next earlier atom.
+X<: (colon);: fail to atom before last (rules)>
+X<backtracking controls;: fail to atom before last>
+
+=row
+
+=cell C<::>
+
+=cell Don't backtrack over this point. Instead fail out of the closest
+enclosing group (C<(...)>, C<[...]>, or the rule delimiters).
+X<: (colon);:: fail out of group (rules)>
+X<backtracking controls;: fail out of group>
+
+=row
+
+=cell C<:::>
+
+=cell Don't backtrack over this point. Instead, fail out of the current rule
+or subrule.
+X<: (colon);::: fail out of rule (rules)>
+X<backtracking controls;: fail out of rule>
+
+=row
+
+=cell C<E<lt>commitE<gt>>
+
+=cell Don't backtrack over this point. Instead, fail out of the entire match
+(even from within a subrule).
+
+=row
+
+=cell C<E<lt>cutE<gt>>
+
+=cell Like C<E<lt>commitE<gt>>, but also cuts the string matched. The current
+matching position at this point becomes the new beginning of the string.
+
+=end table
+
+=head3 Calling Actions
+
+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 has succeeded. The
+generated AST is now available to the code generator for conversion into PIR.
+
+=for author
+
+Please review. The forward declaration is awkward here, but a little bit of
+explanation might ameliorate this.
+
+=end for
+
+This AST gets built up by actions -- code snippets attached to rules and
+tokens. To call an action, insert the C<{*}> token into the rule. When PGE
+encounters C<{*}>, it will call the associated action method with the current
+match object as an argument.
+
+The best way to demonstrate this is by example. Sprinkle the C<persons_name>
+rule liberally with action calls:
+
+ rule persons_name {
+ {*} <first_name> {*} <last_name> {*}
+ }
+
+The first call to the action method contains an empty match object because the
+parser hasn't matched anything yet. The second call contains only the first
+name of the match. The third and final call contains both the matched first and
+last name.
+
+If the match fails halfway through, PGE will still call the actions that have
+succeeded; it will not call the actions after the failure. If you try to match
+the string "Leia", PGE will call the first two action methods. When the rule
+tries to match the last name, it fails, and PGE will not call the third action
+method.
+
+=head3 Alternations and Keys
+
+In addition to sub-rules, groups, and quantifiers, you can also express
+either-or alternations between options. The vertical bar token (C<|>)
+distinguishes between options where only one may match:
+
+ rule hero {
+ ['Luke' | 'Leia'] 'Skywalker'
+ }
+
+This rule will match either "Luke Skywalker" or "Leia Skywalker" but won't
+match "Luke Leia Skywalker"N<nor anything else.>. Given alternations and
+action methods, it's often important to distinguish which alternation matched:
+
+ rule hero {
+ [
+ 'Luke' {*} #= Luke
+ | 'Leia' {*} #= Leia
+ ]
+ 'Skywalker'
+ }
+
+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 matched.
+
+=head3 Warning: Left Recursion
+
+If you've worked with parsers before, you may have seen this coming. If not,
+don't fear. Like functions in ordinary procedural or functional languages, the
+methods in the PGE parser grammar can call themselves recursively. Consider
+some rules derived in part from the grammar for the C programming language:
+
+ rule if_statement {
+ 'if' <condition> '{' <statement>* '}' <else_block>?
+ }
+
+ rule statement {
+ <if_statement> | <expression>
+ }
+
+ rule else_block {
+ 'else' '{' <statements>* '}'
+ }
+
+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 I<recursion> X<Recursion>; it's one
+of the reasons PGE is a "Recursive descent" parser.
+
+Consider the more direct example of a comma-separated list of integer digits
+which form a list. A recursive definition might be:
+
+ rule list {
+ <list> ',' <digit> | <digit>
+ }
+
+If there is only one digit, the second option in the alternation matches. If
+there are multiple digits, recursion will match them through the first
+alternation.
+
+That's the intention. The results are insidious.
+
+The recursive descent parser enters the C<list> rule. Its first option is to
+enter the list rule again, so it does. Recursive descent is a X<depth-first
+algorithm> depth-first algorithm; PGE will continue to descend down a
+particular path until it finds a successful match or a match failure. In this
+case, it matches C<list>, then it matches C<list> again, then it matches
+C<list> again, and so on. This rule forms an infinite loop -- a pattern called
+X<left recursion> I<left recursion>. The problem is that the left-most item of
+the left-most alternation is itself a recursion.
+
+The rule above does not recurse infinitely when rewritten as:
+
+ rule list {
+ <digit> | <list> ',' <digit>
+ }
+
+... or even:
+
+ rule list {
+ <digit> ',' <list> | <digit>
+ }
+
+Both options ensure that the left-most item in the rule is recursive.
+
+Left recursion may be trickier. It's not immediately obvious in this grammar:
+
+ rule term {
+ <expression> '*' <term> | <digit>
+ }
+
+ rule expression {
+ <term> '+' <expression> | <term>
+ }
+
+Even this common, limited subset of mathematical equations has the same
+problem. To match a C<term>, the parser first tries to match an C<expression>,
+which in turn matches a C<term> and then an C<expression> ....
+
+Again, the solution is simple. Rewrite at least one of the rules so that the
+first condition it tries to match is not itself a recursive situation.
+
+=head3 Operator Precedence Parser
+
+Recursive descent parsing can be inefficient where statements have lots of
+little tokens and many possible options to match. For example, mathematical
+expressions are very open-ended, with many valid forms which are difficult to
+anticipate. Consider the expression:
+
+ a + b * c + d
+
+A recursive descent parser will undergo significant trial and error to parse
+this statement. Recursive descent parsing is not ideal for these situations.
+Instead, a type of bottom-up parser called an I<operator precedence> X<Parser,
+Operator precedence> parser is much better.
+
+=for author
+
+Is this a categorization of all opps or just PGE's opp?
+
+=end for
+
+Operator precedence parsers work similarly to more versatile bottom-up parsers
+such as Lex or Yacc, but are optimized for use with expressions and equations.
+Equations have two subtypes, I<terms> and I<operators>. Operators themselves
+have several subtypes, including prefix (C<-a>), postfix (C<i++>), infix (C<x +
+y>), circumfix (C<[z]>), postcircumfix (C<a[b]>), and list (C<1, 2, 3>). Each
+operator gets its own precedence number that specifies how closely it binds to
+the terms. The previous example should parse as:
+
+ a + (b * c) + d
+
+... because the C<*> operator has a higher precedence -- binding more tightly
+to its terms -- than the C<+> operator.
+
+Within a grammar, switch from the top-down recursive descent parser to the
+bottom-up operator precedence parser with an C<optable> X<Parser, optable>
+rule:
+
+ rule expression is optable { ... }
+
+The C<...> ellipsis isn't an editorial shortcut, it's the Perl 6 operator to to
+define a function signature. The C<...> indicates that this is just a
+signature; the actual implementation is elsewhere. In this case, that location
+in the definition of the optable.
+
+=head3 Protofunction Definitions
+
+X<Protofunctions>
+
+Protofunctions define operators in the optable in the same way that rules and
+tokens make up the grammar. A proto declares a rule, defined elsewhere, which
+other code may override dynamically. In this case, PCT takes information from
+the proto declaration and fills in the details. The "dynamic overriding"
+implies that a high-level language itself itself can modify its own grammar at
+run time, by overriding the proto definitions for its operator table. Some
+languages call this process X<operator overloading> I<operator overloading>.
+
+A proto definition resembles:
+
+ 'proto' <proto_name> [ 'is' <property> ] '{' '...' '}'
+
+The name of the operator, noted as C<< <proto_name> >>, contains both a
+location part and an identifier part. The location is the type of the operator,
+such as infix, postfix, prefix, circumfix, and postcircumfix. The name of the
+operator is the symbol used for the operator in any of the quotes that Perl 6
+understands:
+
+ proto infix:<+> # a + b
+ proto postfix:'--' # i--
+ proto circumfix:«<>» # <x>
+
+The C<is> X<Parser, is> keyword defines a property of the rule. Examples
+include:
+
+ is precedence(1) # Specifies an exact precedence
+ is equiv('+') # Has the same precedence as the "+" operator
+ is assoc('right') # Right associative. May also be "left" or "list"
+ is pirop('add') # Operands are passed to the PIR operator "and"
+ is subname('mySub') # Operands are passed to the function "mySub"
+ is pasttype('if') # Operands are passed as children to an "if" PAST node in
+ # the parse tree
+ is parsed(&myRule) # The token is parsed and identified using the rule
+ # "myRule" from the top-down parser
+
+=for author
+
+Please review.
+
+=end for
+
+Protofunction definitions are function signatures; you can override them with
+multimethod dispatch. This means that you can write functions I<with the same
+name> as the rule to implement the behavior of the operator. Here's a proto:
+
+ rule infix:"+" { ... }
+
+... and its corresponding PIR rule:
+
+=begin PIR
+
+ .sub 'infix:+'
+ .param pmc a
+ .param pmc b
+ .local pmc c
+ c = a + b
+ .return(c)
+ .end
+
+=end PIR
+
+You may ask "Why have an C<is subname()> property, if you can define all
+operators as subroutines?" Using the C<is subname()> property allows PCT to
+call a subroutine of a different name then the operator. This is a good idea
+if there is already a built-in function in the language that duplicates the
+functionality of the operator. There is no sense in duplicating behavior.
+
+The great thing about protos being overloadable is that you can specify
+different functions to call with different signatures:
+
+=begin PIR
+
+ .sub 'infix:+' :multi('Integer', 'Integer')
+ #...
+ .end
+
+ .sub 'infix:+' :multi('CLispRatio', 'Number')
+ #...
+ .end
+
+ .sub 'infix:+' :multi('Perl6Double', 'PythonInteger')
+ #...
+ .end
+
+=end PIR
+
+This list can be a bit intimidating, and it's hard to imagine that it would be
+necessary to write up a new function to handle addition between every
+conceivable pair of operands. Fortunately, this is rarely the case in Parrot,
+because all these data types support common the VTABLE interface. For most data
+types Parrot already has basic arithmetic operations built in, and it's only
+necessary to override for those data types with special needs.
+
+=head3 Hypothetical Variables
+
+Z<CHP-7-SECT-5>
+
+X<variables;hypothetical>
+X<hypothetical variables>
+X<rules;captures>
+Hypothetical variables are a powerful way of building up data structures from
+within a match. Ordinary captures with C<()> store the result of the captures
+in C<$1>, C<$2>, etc. PGE stores values in these variables if the match is
+successful, but throws them away if the match fails. The numbered capture
+variables are accessible outside the match, but only within the immediate
+surrounding lexical scope:
+
+ "Zaphod Beeblebrox" ~~ m:w/ (\w+) (\w+) /;
+
+ print $1; # prints Zaphod
+
+You can also capture into any user-defined variable with the binding operator
+C<:=> -- I<if> you have declared these variables in a lexical scope enclosing
+the rule:
+
+ my $person;
+ "Zaphod's just this guy." ~~ / ^ $person := (\w+) /;
+ print $person; # prints Zaphod
+
+You may capture repeated matches into an array:
+
+ my @words;
+ "feefifofum" ~~ / @words := (f<-[f]>+)* /;
+ # @words contains ("fee", "fi", "fo", "fum")
+
+You may capture pairs of repeated matches into a hash:
+
+ my %customers;
+ $records ~~ m:w/ %customers := [ E<lt>idE<gt> = E<lt>nameE<gt> \n]* /;
+
+If you don't need the captured value outside the rule, use a C<$?> variable
+instead. These are only directly accessible within the rule:
+
+ "Zaphod saw Zaphod" ~~ m:w/ $?name := (\w+) \w+ $?name/;
+
+A match of a named rule stores the result in a C<$?> variable with the same
+name as the rule. These variables are also accessible only within the rule:
+
+ "Zaphod saw Zaphod" ~~ m:w/ E<lt>nameE<gt> \w+ $?name /;
+
+=for author
+
+This next paragraph feels out of place; is there more?
+
+=end for
+
+When a rule matches a sequence of input tokens, PCT calls an associated method
+within NQP to convert that match into an AST node, which it inserts into the
+I<parse tree>.
+
+=head3 Basic Rules
+
+Consider the simple example rule:
+
+ rule persons_name {
+ <first_name> <last_name>
+ }
+
+... and two example tokens:
+
+ token first_name { <alpha>+ }
+ token last_name { <alpha>+ }
+
+The special token C<< <alpha> >> is a built-in construct that only accepts
+upper case and lower case letters. The C<+> after the C<< <alpha> >> tag is a
+short way of saying "one or more". The rule will match names like C<Darth
+Vader>N<It also matches many strings that I<aren't> real names>, but won't
+match something like C<C 3P0>.
+
+This rule I<will> match C<Jar Jar Binks>, but not as you might expect: way you
+would expect: It would match the first "Jar" as C<< <first_name> >>, the second
+"Jar" as C<< <last_name> >>, and ignore "Binks"N<You should ignore the whole
+thing.>.
+
+=for author
+
+The rest seems vestigial. An example like this should precede the rest of the
+chapter. There are forward references, but it's a decent overview for people
+who haven't used similar systems before -- if you avoid going out in the weeds.
+
+=end for
+
+this example shows another new construct, the square brackets. Square
+brackets are ways to group things together. The star at the end means
+that we take all the things inside the brackets zero or more times.
+This is similar to the plus, except the plus matches one or more times.
+Notice, however, that the above rule always matches a comma at the end,
+so we would need to have something like:
+
+ Darth Vader, Luke Skywalker,
+
+Instead of something more natural like:
+
+ Darth Vader, Luke Skywalker
+
+We can modify the rule a little bit so that it always ends with a name
+instead of a comma:
+
+ rule TOP {
+ [ <persons_name> ',' ]* <persons_name>
+ }
+
+Now we don't need a trailing comma, but at the same time we can't match
+an empty file because it always expects to have at least one name at the
+end. If we still want to match empty files successfully, we need to make
+the whole rule optional:
+
+ rule TOP {
+ [ [ <persons_name> ',' ]* <persons_name> ]?
+ }
+
+We've grouped the whole rule together in another set of brackets, and
+put a "?" question mark at the end. The question mark means zero or
+one of the prior item.
+
+The symbols "*" (zero or more), "+" (one or more) and "?" are called
+I<quantifiers>, and allow an item in the rule to match a variable
+number of times. These aren't the only quantifiers, but they are the
+most common. We will talk about other quantifiers later on.
+
+=cut
+
+# Local variables:
+# c-file-style: "parrot"
+# End:
+# vim: expandtab shiftwidth=4:
Copied: branches/pluggable_runcore/docs/book/pct/ch05_nqp.pod (from r40540, trunk/docs/book/pct/ch05_nqp.pod)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/docs/book/pct/ch05_nqp.pod Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/docs/book/pct/ch05_nqp.pod)
@@ -0,0 +1,219 @@
+=pod
+
+=head1 Grammar Actions
+
+The job of the grammar is to match input patterns from the source language.
+These patterns then need to get converted to nodes in the abstract syntax
+tree for manipulation in other stages of the compiler. We've already seen
+one example of a subroutine structure that takes a match and produces a
+tree node: Protofunctions. Protofunction signatures aren't the only way to
+apply functions to rules matched by a parser. They are limited and are
+slightly primitive, but effective for handling operators. There is an
+easier and more powerful way to write subroutines to convert match objects
+into parse tree nodes, using a language that's almost, but Not Quite Perl.
+
+X<NQP>
+X<Not Quite Perl>
+NQP (Not Quite Perl) is a small language which offers a limited subset of
+Perl 6's syntax and semantics. Though it originated as a bootstrapping tool
+for the Rakudo Perl 6 compiler, several other Parrot-based compilers use it
+as well. It has become a permanent member of PCT, and therefore a permanent
+part of the Parrot code base.
+
+NQP represents almost the smallest subset of the Perl 6 language necessary to
+implement parser transformations, plus a few syntactic convenience features
+that developers have requested. NQP's Perl 6 subset shows its Perl 5 roots,
+so existing Perl 5 programmers should find much of it familiar and should be
+able to leverage their existing skills for writing compilers.
+
+In PGE, at the time of a match the grammar we can invoke an action using the
+special C<{*}> symbol. In general, these action methods are
+written in NQP, although it is possible for them to be written in PIR N<In
+fact, this is how the NQP compiler itself is written>. We won't discuss the
+PIR case here because it's uncommon and needlessly difficult. NQP is the
+standard and preferred choice for this.
+
+=head2 NQP Basics
+
+X<sigils>
+X<scalar>
+Like all flavors and versions of Perl, NQP uses special prefix symbols called
+I<sigils> to distinguish variable types. The C<$> sigil represents scalars,
+C<@> arrays, and C<%> for hashes. A scalar is any single value which can
+interchangeably contain given a string value, an integer value, or an object
+reference. Simple NQP assignments are:
+
+ $scalar := "This is a string"
+ $x := 123
+ $pi := 3.1415 # rounding
+
+X<bind operator>
+X<operators; binding>
+X<:=>
+The C<:=> I<bind> operator performs reference assignment in NQP. Reference
+assignment makes one variable into an alias for another. This means that
+the two variables are just different names for the same storage location,
+and changes to one will change both. It's important to remember that a bind
+is not a copy!
+
+NQP has hashes and arrays just like other flavors of Perl and various
+dynamic languages. NQP does not have a notion of hash and array context,
+but otherwise it works the way you would expect. Arrays have the C<@> sigil,
+and hashes have the C<%> sigil. Here are some examples:
+
+ @ary[0] := 1;
+ @ary[1] := "foo";
+ ...
+
+ %hsh{'bar'} := 2;
+ %hsh{'baz'} := "parrot";
+ ...
+
+There is also a nice shorthand way to index hashes, using angle brackets:
+
+ %hsh<bar> := "parrot";
+
+It's also possible to assign a list in I<scalar context>:
+
+ $array_but_a_scalar := (1, 2, 3, 4)
+
+Or you could write a new function in PIR to create a new array from a variadic
+argument list:
+
+ @my_array := create_new_array(1, 2, 3, 4)
+
+... which calls the PIR function:
+
+=begin PIR
+
+ .namespace []
+
+ .sub 'create_new_array'
+ .param pmc elems :slurpy
+ .return(elems)
+ .end
+
+=end PIR
+
+=head3 Calling Actions From Rules
+
+=for editor
+
+Needs a link to that section.
+
+=end for
+
+As mentioned in the chapter on grammar rules, the funny little C<{*}> symbol
+calls an action. The action in question is an NQP method with the same name as
+the rule that calls it. NQP rules can have two different signatures:
+
+ method name ($/) { ... }
+ method name($/, $key) { ... }
+
+Where does the key come from? Consider this grammar:
+
+ rule cavepeople {
+ 'Fred' {*} #= Caveman
+ | 'Wilma' {*} #= Cavewoman
+ | 'Dino' {*} #= Dinosaur
+ }
+
+The C<cavepeople> rule demonstrates the result:
+
+ method cavepeople($/, $key) {
+ if $key eq 'Caveman' {
+ say "We've found a caveman!";
+ } elsif $key eq 'Cavewoman' {
+ say "We've found a cavewoman!";
+ } elsif $key eq 'Dinosaur' {
+ say "A dinosaur isn't a caveperson at all!";
+ }
+ }
+
+The key is a string that contains whatever any text following the C<#=> symbol.
+Without a C<#=> following the rule invocation, there's no C<$key> to use in the
+method. If you attempt to use one without the other, the NQP compiler will die
+with error messages about mismatched argument/parameter numbers.
+
+=head3 The Match Object C<$/>
+
+X<match object>
+X<$/>
+The match object C<$/> it's a data structure that's all business: it's both a
+hash and an array. Because it's a special variable used pervasively in PCT, it
+has a special shortcut syntax:
+
+ $/{'Match_item'} is the same as $<Match_item>
+ $/[0] is the same as $[0]
+
+Each key in the match object's hash is the name of a matched rule. Given a
+file containing "C<X + 5>" and a rule:
+
+ rule introductions {
+ <variable> <operator> <number>
+ }
+
+The resulting match object will contain the key/value pairs:
+
+ "variable" => "x"
+ "operator" => "+"
+ "number" => "5"
+
+When the match contains multiple values with the same name, or when rules have
+quantifiers such as C<*> or C<+>, the values in the hash may be arrays. Given
+the input "A A A B B" and the rule:
+
+ rule letters {
+ <vowel>* <consonant>*
+ }
+
+The match object will contain the pairs:
+
+ "vowel" => ["A", "A", "A"]
+ "consonant" => ["B", "B"]
+
+X<$( ) operator>
+
+Use the C<$( )> operator to count the number of matches in each group (by
+casting it to a scalar):
+
+ $($<vowel>) == 3
+
+=head3 Inline PIR
+
+=for author
+
+Needs expansion.
+
+=end for
+
+X<{{ }}>
+X<double curly brackets>
+Sometimes NQP isn't quite flexible enough to handle transforms appropriately.
+In a PGE rule, the C<{{ }}> double curly brackets demarcate inline-PIR mode.
+PGE will execute any PIR code in those brackets. You can access C<$/> directly
+in the grammar without having to jump into NQP.
+
+=head3 PAST Nodes
+
+X<PAST>
+X<PAST nodes>
+NQP's job is to make abstract syntax trees. These trees are all objects -- and
+as such, instances of PAST nodes. Each PAST class represents a unique program
+construct. These constructs are common and simple, but combine to represent
+complicated programming structures.
+
+=head3 Making Trees
+
+Every action has the ability to create a PAST node that represents that action,
+as well as any children of that node. Calling C<make> on that node adds it into
+the growing PAST tree that PCT maintains. Once the C<TOP> rule matches
+successfully and returns, PCT optimizes and converts that tree into PIR and PBC
+for execution.
+
+=cut
+
+# Local variables:
+# c-file-style: "parrot"
+# End:
+# vim: expandtab shiftwidth=4:
Modified: branches/pluggable_runcore/docs/book/pir/ch01_introduction.pod
==============================================================================
--- branches/pluggable_runcore/docs/book/pir/ch01_introduction.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/book/pir/ch01_introduction.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -83,10 +83,10 @@
X<development cycles>
Parrot's first release occurred in September 2001. The 1.0 release took place
-on March 17, 2009. 2009. The Parrot project makes releases on the third
-Tuesday of each month. Two releases a year E<mdash> occuring every January and
-July E<mdash> are "supported" releases intended for production use. The other
-ten releases are development releases intended for language implementers and
+on March 17, 2009. The Parrot project makes releases on the third Tuesday of
+each month. Two releases a year E<mdash> occuring every January and July
+E<mdash> are "supported" releases intended for production use. The other ten
+releases are development releases intended for language implementers and
testers.
Development proceeds in cycles around releases. Activity just before a release
Modified: branches/pluggable_runcore/docs/book/pir/ch04_variables.pod
==============================================================================
--- branches/pluggable_runcore/docs/book/pir/ch04_variables.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/book/pir/ch04_variables.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -188,7 +188,7 @@
=end PIR_FRAGMENT
Both C<and> and C<or> are short-circuiting ops. If they can determine what
-value to return from the first argument, they'll never evaluate the third.
+value to return from the first argument, they'll never evaluate the second.
This is significant only for PMCs, as they might have side effects on
evaluation.
@@ -1785,7 +1785,7 @@
$P1 = $P0.'find_namespace'("Duck")
-The C<add_namespace>C<add_namespace method> method adds a new namespace
+The C<add_namespace>X<add_namespace method> method adds a new namespace
as a child of the namespace object:
$P0.'add_namespace'($P1)
Modified: branches/pluggable_runcore/docs/book/pir/ch06_subroutines.pod
==============================================================================
--- branches/pluggable_runcore/docs/book/pir/ch06_subroutines.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/book/pir/ch06_subroutines.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -76,7 +76,7 @@
By default, Parrot stores all subroutines in the namespace currently
active at the point of their declaration. The C<:anon>X<:anon subroutine
modifier> modifier tells Parrot not to store the subroutine in the
-namespace. The C<:nsentry>X:nsentry subroutine modifier> modifier stores
+namespace. The C<:nsentry>X<:nsentry subroutine modifier> modifier stores
the subroutine in the currenly active namespace with a different name.
For example, Parrot will store this subroutine in the current namespace
as C<bar>, not C<foo>:
Modified: branches/pluggable_runcore/docs/debugger.pod
==============================================================================
--- branches/pluggable_runcore/docs/debugger.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/debugger.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2006, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
=head1 NAME
@@ -38,8 +38,9 @@
parrot_debugger file.pbc
-That is, F<parrot_debugger> takes exactly one argument, which is the Parrot bytecode that
-you're going to debug. F<parrot_debugger> will automatically load and disassemble the
+That is, F<parrot_debugger> takes exactly one argument, which is the Parrot file that
+you're going to debug. This file may be Parrot bytecode (*.pbc), PASM source code (*.pasm)
+or PIR (*.pir). F<parrot_debugger> will automatically load and disassemble the
bytecode file for you.
Note that you can't pass command line arguments to your program when you invoke
@@ -235,6 +236,8 @@
=item eval (e)
+The eval command is currently unimplemeneted.
+
Run an instruction. The syntax is:
eval INSTRUCTION
@@ -297,54 +300,24 @@
For PMC registers, the command will print the number, the class of the PMC (in
square brackets) and its string representation (when available). It prints
-<null pmc> for uninitialized PMC registers.
+<PMCNULL> for uninitialized PMC registers.
-Example:
+Examples:
# prints the content of I2
(pdb) p i2
- Integer Registers:
I2 = 0
# prints the content of P0
(pdb) p P0
- PMC Registers:
P0 = [ResizablePMCArray]
# prints the content of all string registers
(pdb) p s
- String Registers:
- 0 =
- Buflen = 4
- Flags = 0
- Bufused = 4
- Strlen = 4
- Offset = 0
- String = Just
- 1 =
- Buflen = 8
- Flags = 0
- Bufused = 7
- Strlen = 7
- String = another
- 2 =
- Buflen = 8
- Flags = 0
- Bufused = 6
- Strlen = 6
- String = Parrot
- 3 =
- Buflen = 8
- Flags = 0
- Bufused = 6
- Strlen = 6
- String = hacker
- 4 =
- 5 =
- 6 =
- 7 =
- 8 =
- # ... and so on
+ S0 = Just
+ S1 = Another
+ S2 = Parrot
+ S3 = Hacker
=item info
@@ -381,10 +354,10 @@
=over 4
-=item src/pdb.c
+=item src/parrot_debugger.c
-This is the file that will produce the executable. Nothing fancy here, only
-the C<main> function.
+This is the file that will produce the executable. Nothing fancy here, it
+mostly consists of the C<main> function.
=item src/debug.c
@@ -395,7 +368,7 @@
C<Parrot_debug>, the function which launches the debugger, is implemented here.
-=item include/parrot/debug.h
+=item include/parrot/debugger.h
This defines all the PDB structures, which hold data used by the debugger.
Deleted: branches/pluggable_runcore/docs/dev/fhs.pod
==============================================================================
--- branches/pluggable_runcore/docs/dev/fhs.pod Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,171 +0,0 @@
-# Copyright (C) 2001-2007, Parrot Foundation.
-# $Id$
-
-=pod
-
-=head1 Title
-
-FHS - Filesystem Hierarchy Standard and Parrot
-
-=head1 AUTHOR
-
-Florian Ragwitz E<lt>rafl at debian.orgE<gt>
-
-=head1 VERSION
-
- Maintainer: Florian Ragwitz
- Date: 5 Dez 2005
- Last Modified: 5 Dez 2005
- Number: 0
- Version: 1
-
-This document introduces to the FHS, the Filesystem Hierarchy Standard,
-and how those concern Parrot.
-
-=head1 INTRODUCTION
-
-The FHS defines some rules for file and directory placement under
-UNIX-like operating systems. This supports interoperability of
-applications, system administration tools, development tools, and
-scripts as well as greater uniformity of documentation for these
-systems.
-
-=head1 DIRECTORIES
-
-There's a large amount of directories explained in the FHS that are not
-explained here. The reason for this is that not all of them are
-concerning Parrot.
-
-=head2 /etc
-
-Does parrot have things where it makes sense to configure them using a
-config file? I don't think so.
-
-=head2 /tmp
-
-All temporary files should be placed here. Parrot could use this
-directory for files that are generated during the compile of parrot code
-to native executables.
-
-=head2 /usr
-
-I</usr> contains is shareable, read-only data. Any information that is
-host-specific or varies with time is stored elsewhere.
-
-=head3 /usr/bin
-
-This is the primary directory of executable commands on the system. All
-executables that are intended to be called directly by the user (i.e.
-parrot, parrot_debugger, pbc_disassemble, pbc_dump, pbc_info, pbg_merge, ...)
-should go here. The current version number should be appended to the
-binaries itself and a symlink needs to be created that points from the
-binary with version number to the normal name of the file without a
-version. That makes installing more than one version possible.
-
-Executables that are for internal use only are stored elsewhere.
-
-=head3 /usr/include
-
-This is where all of the system's general-use include files for the C
-programming language should be placed.
-
-For parrot this is the content of I<include/parrot>. It should be placed
-in I</usr/include/parrot/$(VERSION> (i.e. I</usr/include/parrot/0.4.0>),
-including those files in I<include/parrot> that are generated during
-build time.
-
-=head3 /usr/lib
-
-I</usr/lib> includes object files, libraries, and internal binaries that
-are not intended to be executed directly by users or scripts.
-
-This is libparrot$(SOEXT).$(SOVERSION) if the parrot binary was linked
-dynamically. Otherwise nothing.
-
-Also Parrot uses a single subdirectory called I</usr/lib/parrot> to
-store all architecture-dependent data exclusively used by parrot. These
-files are grouped by the parrot version they belong to. So we'll have
-I</usr/lib/parrot/0.4.0>, I</usr/lib/parrot/0.4.1>, etc.
-
-All .pbc and .fpmc files should go there.
-
-.pbc files are kind of architecture independent, because parrot can run
-PBCs created on any architecture on any architecture, but because .pbc
-files created on 32 bit platforms differ from those created on 64 bit
-platforms and the performance of executing bytecode created on an
-architecture with another address width is much slower we consider
-parrot bytecode to be architecture dependent.
-
-=head3 /usr/share
-
-The I</usr/share> hierarchy is for all read-only architecture
-independent data files. Parrot stores those files in
-I</usr/share/parrot/$(VERSION)>. For example all .pasm and .pir
-files should go there as well as data files for libraries like images
-and such.
-
-=head4 /usr/share/man
-
-Manpages are read-only architecture independent data files as well, but
-they belong into I</usr/share/man> instead of I</usr/share/parrot/> so
-they are in $MANPATH and can be viewed using the I<man> command.
-
-=head4 /usr/share/doc
-
-All documentation as well as examples should go into a subdirectory of
-I</usr/share/doc>.
-
-=head1 VIOLATIONS
-
-=over 2
-
-=item /usr/examples
-
-Examples should go into I</usr/share/doc/examples>.
-
-=item /usr/docs
-
-This belongs into I</usr/share/doc/docs> or something similar.
-
-=item /usr/runtime
-
-This needs to be split up into I</usr/lib> and I</usr/share> according
-to the rules that are given in the B<DIRECTORIES> section.
-
-=item /usr/include/parrot
-
-This directory conforms to the FHS, but makes it impossible to have more
-than one version of parrot installed at once. It should be
-I</usr/include/parrot/$(VERSION)>.
-
-=item /usr/bin
-
-The files in I</usr/bin> also lack support for multiple installed parrot
-versions. Also if we build a shared parrot and shared parrot utils the
-executables in this directory have a '_shared' suffix which is bad.
-
-=item /usr/imcc
-
-This directory should be removed. It only contains documentation and
-examples which belong somewhere else.
-
-=item /usr/LICENSES
-
-Move this to I</usr/share/doc/> or just remove it if it's legal.
-
-=item /usr/NEWS, /usr/PBC_COMPAT, ...
-
-This is also documentation for I</usr/share/doc>.
-
-=item /usr/parrot-config.pir
-
-This is a command which can be called from the user. It should be in
-I</usr/bin>, maybe without the .pir suffix.
-
-=back
-
-=head1 SOURCES
-
-FHS 2.3 - L<http://www.pathname.com/fhs/>
-
-=cut
Modified: branches/pluggable_runcore/docs/dev/jit_i386.pod
==============================================================================
--- branches/pluggable_runcore/docs/dev/jit_i386.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/dev/jit_i386.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -34,7 +34,8 @@
set I0, 10 # set_i_ic
print I0 # (call) print_i
print "\n" # print_sc
- bsr inc # (call) bsr_ic cpu_ret
+ new P1, 'ResizableIntegerArray'
+ local_branch P0, inc # (call) local_branch_p_ic cpu_ret
end # (jmp) HALT end (ret)
# end (ret)
inc:
@@ -43,7 +44,7 @@
set P0, I0 # set_p_i
print P0 # (call) print_p
print "\n" # print_sc
- ret # (call) ret cpu_ret
+ local_return P1 # (call) local_return_p cpu_ret
=end PASM
Modified: branches/pluggable_runcore/docs/embed.pod
==============================================================================
--- branches/pluggable_runcore/docs/embed.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/embed.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -230,10 +230,6 @@
The handler function should accept as arguments an interpreter, an integer
exit code, and an argument (which can be NULL).
-=item C<void imcc_init(PARROT_INTERP)>
-
-Initializes the IMCC subsystem. Required for compiling PIR.
-
=back
=head2 Loading and running bytecode
@@ -280,7 +276,7 @@
Returns the internal type number corresponding to C<type>. Useful for
instantiating various Parrot data types.
-=item C<char *Parrot_str_to_cstring(PARROT_INTERP)>
+=item C<char *Parrot_str_to_cstring(PARROT_INTERP, const STRING *s)>
XXX needs to be a formal Parrot_* API.
Returns the C string representation of a Parrot string.
@@ -329,18 +325,19 @@
Find and return a global called C<name> in the current namespace. Returns
C<PMCNULL> if not found.
-=item C<Parrot_PMC Parrot_find_global_n(PARROT_INTERP, Parrot_String namespace, Parrot_String name)>
+=item C<Parrot_PMC Parrot_find_global_n(PARROT_INTERP, PMC namespace, Parrot_String name)>
-Not documented yet.
+Search the namespace PMC C<namespace> for an object with name C<globalname>.
+Return the object, or NULL if not found.
=item C<Parrot_PMC Parrot_find_global_s(PARROT_INTERP, Parrot_String namespace, Parrot_String name)>
Find and return a global called C<name> in the namespace C<namespace>. Returns
C<PMCNULL> if not found.
-=item C<void Parrot_store_global_n(PARROT_INTERP, Parrot_String namespace, Parrot_String name, Parrot_PMC val)>
+=item C<void Parrot_store_global_n(PARROT_INTERP, PMC namespace, Parrot_String name, Parrot_PMC val)>
-Not documented yet.
+Store the PMC C<val> into the namespace PMC C<namespace> with name C<globalname>.
=item C<void Parrot_store_global_s(PARROT_INTERP, Parrot_String namespace, Parrot_String name, Parrot_PMC val)>
@@ -386,7 +383,7 @@
Returns the class corresponding to the supplied namespace.
-=item C<Parrot_PMC VTABLE_instantiate(PARROT_INTERP, Parrot_PMC the_class Parrot_PMC arg)>
+=item C<Parrot_PMC Parrot_PMC_instantiate(PARROT_INTERP, Parrot_PMC the_class, Parrot_PMC arg)>
Instantiates a new object of class C<the_class>, which can be obtained from
C<Parrot_oo_get_class()>. Passes an optional PMC argument C<arg> to the
@@ -515,6 +512,1376 @@
return(0);
}
+=head1 EXPORTED FUNCTIONS
+
+The Parrot embedding API is not finalized, and it will go through several
+deprecation cycles before stabilizing. Below is the comprehensive list of
+candidates for inclusion in the Parrot embedding API. It includes the
+following types of functions:
+
+=over 4
+
+=item * The core functions documented above
+
+=item * Functions required by macros
+
+=item * Parrot_PMC_* VTABLE wrappers
+
+=item * Miscellaneous functions whose utility outside of the core is
+uncertain. This includes functions used by HLLs.
+
+=item * Functions that should be removed in a future deprecation cycle. A
+good example of this is most of the internal string_* functions, which now
+have formal Parrot_str_* wrappers.
+
+=back
+
+The list may also be augmented if additional functionality is required.
+
+=over 4
+
+=item C<disable_event_checking>
+
+=item C<enable_event_checking>
+
+=item C<interpinfo>
+
+=item C<interpinfo_p>
+
+=item C<interpinfo_s>
+
+=item C<mem_allocate_n_typed>
+
+=item C<mem_allocate_n_zeroed_typed>
+
+=item C<mem_allocate_zeroed_typed>
+
+=item C<mem_sys_allocate>
+
+=item C<mem_sys_allocate_zeroed>
+
+=item C<mem_sys_free>
+
+=item C<mem_sys_realloc>
+
+=item C<mem_sys_realloc_zeroed>
+
+=item C<PackFile_Constant_pack>
+
+=item C<PackFile_ConstTable_pack>
+
+=item C<PackFile_ConstTable_pack_size>
+
+=item C<PackFile_destroy>
+
+=item C<PackFile_find_in_const>
+
+=item C<PackFile_fixup_subs>
+
+=item C<PackFile_new>
+
+=item C<PackFile_new_dummy>
+
+=item C<PackFile_pack>
+
+=item C<PackFile_pack_size>
+
+=item C<Parrot_assert>
+
+=item C<Parrot_block_GC_mark>
+
+=item C<Parrot_block_GC_sweep>
+
+=item C<Parrot_byte_index>
+
+=item C<Parrot_byte_rindex>
+
+=item C<Parrot_callback_C>
+
+=item C<Parrot_callback_D>
+
+=item C<Parrot_call_method>
+
+=item C<Parrot_call_method_ret_float>
+
+=item C<Parrot_call_method_ret_int>
+
+=item C<Parrot_call_sub>
+
+=item C<Parrot_call_sub_ret_float>
+
+=item C<Parrot_call_sub_ret_int>
+
+=item C<Parrot_char_digit_value>
+
+=item C<Parrot_charset_c_name>
+
+=item C<Parrot_charset_name>
+
+=item C<Parrot_charset_number>
+
+=item C<Parrot_charset_number_of_str>
+
+=item C<Parrot_charsets_encodings_deinit>
+
+=item C<Parrot_charsets_encodings_init>
+
+=item C<Parrot_clear_debug>
+
+=item C<Parrot_clear_flag>
+
+=item C<Parrot_clear_i>
+
+=item C<Parrot_clear_n>
+
+=item C<Parrot_clear_p>
+
+=item C<Parrot_clear_s>
+
+=item C<Parrot_clear_trace>
+
+=item C<Parrot_clone>
+
+=item C<Parrot_compile_file>
+
+=item C<Parrot_compile_string>
+
+=item C<Parrot_ComposeRole>
+
+=item C<Parrot_compreg>
+
+=item C<Parrot_ComputeMRO_C3>
+
+=item C<Parrot_confess>
+
+=item C<Parrot_context_ref_trace>
+
+=item C<Parrot_cx_add_handler>
+
+=item C<Parrot_cx_add_handler_local>
+
+=item C<Parrot_cx_broadcast_message>
+
+=item C<Parrot_cx_count_handlers_local>
+
+=item C<Parrot_cx_count_handlers_typed>
+
+=item C<Parrot_cx_delete_handler_local>
+
+=item C<Parrot_cx_delete_handler_typed>
+
+=item C<Parrot_cx_delete_suspend_for_gc>
+
+=item C<Parrot_cx_delete_task>
+
+=item C<Parrot_cx_find_handler_for_task>
+
+=item C<Parrot_cx_find_handler_local>
+
+=item C<Parrot_cx_handle_tasks>
+
+=item C<Parrot_cx_peek_task>
+
+=item C<Parrot_cx_request_suspend_for_gc>
+
+=item C<Parrot_cx_runloop_end>
+
+=item C<Parrot_cx_schedule_callback>
+
+=item C<Parrot_cx_schedule_repeat>
+
+=item C<Parrot_cx_schedule_sleep>
+
+=item C<Parrot_cx_schedule_task>
+
+=item C<Parrot_cx_schedule_timer>
+
+=item C<Parrot_cx_send_message>
+
+=item C<Parrot_default_charset>
+
+=item C<Parrot_default_encoding>
+
+=item C<Parrot_del_timer_event>
+
+=item C<Parrot_destroy>
+
+=item C<Parrot_disassemble>
+
+=item C<Parrot_do_check_events>
+
+=item C<Parrot_do_handle_events>
+
+=item C<Parrot_dump_dynamic_environment>
+
+=item C<Parrot_encoding_c_name>
+
+=item C<Parrot_encoding_name>
+
+=item C<Parrot_encoding_number>
+
+=item C<Parrot_encoding_number_of_str>
+
+=item C<Parrot_eprintf>
+
+=item C<Parrot_event_add_io_event>
+
+=item C<Parrot_ex_add_c_handler>
+
+=item C<Parrot_ex_build_exception>
+
+=item C<Parrot_ex_calc_handler_offset>
+
+=item C<Parrot_exit>
+
+=item C<Parrot_ex_mark_unhandled>
+
+=item C<Parrot_ex_rethrow_from_c>
+
+=item C<Parrot_ex_rethrow_from_op>
+
+=item C<Parrot_ex_throw_from_c>
+
+=item C<Parrot_ex_throw_from_c_args>
+
+=item C<Parrot_ex_throw_from_op>
+
+=item C<Parrot_ex_throw_from_op_args>
+
+=item C<Parrot_find_charset>
+
+=item C<Parrot_find_charset_converter>
+
+=item C<Parrot_find_encoding>
+
+=item C<Parrot_find_encoding_converter>
+
+=item C<Parrot_find_global_cur>
+
+=item C<Parrot_find_global_k>
+
+=item C<Parrot_find_global_n>
+
+=item C<Parrot_find_global_op>
+
+=item C<Parrot_find_global_s>
+
+=item C<Parrot_find_language>
+
+=item C<Parrot_find_method_direct>
+
+=item C<Parrot_find_method_with_cache>
+
+=item C<Parrot_find_name_op>
+
+=item C<Parrot_float_rand>
+
+=item C<Parrot_fprintf>
+
+=item C<Parrot_free_context>
+
+=item C<Parrot_free_cstring>
+
+=item C<Parrot_freeze>
+
+=item C<Parrot_freeze_at_destruct>
+
+=item C<Parrot_full_sub_name>
+
+=item C<parrot_gc_context>
+
+=item C<Parrot_gc_gms_init>
+
+=item C<parrot_gc_gms_Parrot_gc_mark_PObj_alive>
+
+=item C<Parrot_gc_mark_PObj_alive>
+
+=item C<Parrot_get_charset>
+
+=item C<Parrot_get_ctx_HLL_namespace>
+
+=item C<Parrot_get_ctx_HLL_type>
+
+=item C<Parrot_get_datatype_enum>
+
+=item C<Parrot_get_datatype_name>
+
+=item C<Parrot_get_encoding>
+
+=item C<Parrot_get_global>
+
+=item C<Parrot_get_HLL_id>
+
+=item C<Parrot_get_HLL_name>
+
+=item C<Parrot_get_HLL_namespace>
+
+=item C<Parrot_get_HLL_type>
+
+=item C<Parrot_get_intreg>
+
+=item C<Parrot_get_namespace_autobase>
+
+=item C<Parrot_get_namespace_keyed>
+
+=item C<Parrot_get_namespace_keyed_str>
+
+=item C<Parrot_get_numreg>
+
+=item C<Parrot_get_pmcreg>
+
+=item C<Parrot_get_root_namespace>
+
+=item C<Parrot_get_runtime_path>
+
+=item C<Parrot_get_runtime_prefix>
+
+=item C<Parrot_get_strreg>
+
+=item C<Parrot_get_vtable>
+
+=item C<Parrot_get_vtable_index>
+
+=item C<Parrot_get_vtable_name>
+
+=item C<Parrot_init_events>
+
+=item C<Parrot_init_signals>
+
+=item C<Parrot_init_stacktop>
+
+=item C<Parrot_int_rand>
+
+=item C<Parrot_invalidate_method_cache>
+
+=item C<Parrot_io_accept>
+
+=item C<Parrot_io_bind>
+
+=item C<Parrot_io_close>
+
+=item C<Parrot_io_close_filehandle>
+
+=item C<Parrot_io_close_piohandle>
+
+=item C<Parrot_io_connect>
+
+=item C<Parrot_IOData_mark>
+
+=item C<Parrot_io_eof>
+
+=item C<Parrot_io_eprintf>
+
+=item C<Parrot_io_fdopen>
+
+=item C<Parrot_io_finish>
+
+=item C<Parrot_io_flush>
+
+=item C<Parrot_io_flush_filehandle>
+
+=item C<Parrot_io_fprintf>
+
+=item C<Parrot_io_get_buffer_end>
+
+=item C<Parrot_io_get_buffer_next>
+
+=item C<Parrot_io_get_buffer_start>
+
+=item C<Parrot_io_getfd>
+
+=item C<Parrot_io_get_file_position>
+
+=item C<Parrot_io_get_file_size>
+
+=item C<Parrot_io_get_flags>
+
+=item C<Parrot_io_get_last_file_position>
+
+=item C<Parrot_io_get_os_handle>
+
+=item C<Parrot_io_init>
+
+=item C<Parrot_io_is_closed>
+
+=item C<Parrot_io_is_closed_filehandle>
+
+=item C<Parrot_io_is_encoding>
+
+=item C<Parrot_io_is_tty>
+
+=item C<Parrot_io_listen>
+
+=item C<Parrot_io_make_offset>
+
+=item C<Parrot_io_new_pmc>
+
+=item C<Parrot_io_new_socket_pmc>
+
+=item C<Parrot_io_open>
+
+=item C<Parrot_io_parse_open_flags>
+
+=item C<Parrot_io_peek>
+
+=item C<Parrot_io_poll>
+
+=item C<Parrot_io_printf>
+
+=item C<Parrot_io_putps>
+
+=item C<Parrot_io_puts>
+
+=item C<Parrot_io_readline>
+
+=item C<Parrot_io_reads>
+
+=item C<Parrot_io_recv>
+
+=item C<Parrot_io_seek>
+
+=item C<Parrot_io_send>
+
+=item C<Parrot_io_set_file_position>
+
+=item C<Parrot_io_set_file_size>
+
+=item C<Parrot_io_set_flags>
+
+=item C<Parrot_io_set_os_handle>
+
+=item C<Parrot_io_socket>
+
+=item C<Parrot_io_socket_is_closed>
+
+=item C<Parrot_io_STDERR>
+
+=item C<Parrot_io_stdhandle>
+
+=item C<Parrot_io_STDIN>
+
+=item C<Parrot_io_STDOUT>
+
+=item C<Parrot_io_tell>
+
+=item C<Parrot_io_write>
+
+=item C<Parrot_is_blocked_GC_mark>
+
+=item C<Parrot_is_blocked_GC_sweep>
+
+=item C<Parrot_kill_event_loop>
+
+=item C<Parrot_lib_add_path>
+
+=item C<Parrot_lib_add_path_from_cstring>
+
+=item C<Parrot_load_bytecode>
+
+=item C<Parrot_load_charset>
+
+=item C<Parrot_load_encoding>
+
+=item C<Parrot_load_language>
+
+=item C<Parrot_load_lib>
+
+=item C<Parrot_locate_runtime_file>
+
+=item C<Parrot_locate_runtime_file_str>
+
+=item C<Parrot_make_cb>
+
+=item C<Parrot_make_default_charset>
+
+=item C<Parrot_make_default_encoding>
+
+=item C<Parrot_make_namespace_autobase>
+
+=item C<Parrot_make_namespace_keyed>
+
+=item C<Parrot_make_namespace_keyed_str>
+
+=item C<Parrot_mmd_cache_create>
+
+=item C<Parrot_mmd_cache_destroy>
+
+=item C<Parrot_mmd_cache_lookup_by_values>
+
+=item C<Parrot_mmd_cache_mark>
+
+=item C<Parrot_mmd_cache_store_by_values>
+
+=item C<Parrot_new>
+
+=item C<Parrot_new_cb_event>
+
+=item C<Parrot_new_charset>
+
+=item C<Parrot_new_encoding>
+
+=item C<Parrot_new_string>
+
+=item C<Parrot_new_suspend_for_gc_event>
+
+=item C<Parrot_new_terminate_event>
+
+=item C<Parrot_new_timer_event>
+
+=item C<Parrot_ns_get_name>
+
+=item C<Parrot_on_exit>
+
+=item C<Parrot_oo_get_class>
+
+=item C<Parrot_oo_get_class_str>
+
+=item C<Parrot_pbc_load>
+
+=item C<Parrot_pbc_read>
+
+=item C<Parrot_PMC_absolute>
+
+=item C<Parrot_PMC_add>
+
+=item C<Parrot_PMC_add_attribute>
+
+=item C<Parrot_PMC_add_float>
+
+=item C<Parrot_PMC_add_int>
+
+=item C<Parrot_PMC_add_method>
+
+=item C<Parrot_PMC_add_parent>
+
+=item C<Parrot_PMC_add_role>
+
+=item C<Parrot_PMC_add_vtable_override>
+
+=item C<Parrot_PMC_assign_pmc>
+
+=item C<Parrot_PMC_assign_string_native>
+
+=item C<Parrot_PMC_bitwise_and>
+
+=item C<Parrot_PMC_bitwise_and_int>
+
+=item C<Parrot_PMC_bitwise_ands>
+
+=item C<Parrot_PMC_bitwise_ands_str>
+
+=item C<Parrot_PMC_bitwise_lsr>
+
+=item C<Parrot_PMC_bitwise_lsr_int>
+
+=item C<Parrot_PMC_bitwise_not>
+
+=item C<Parrot_PMC_bitwise_nots>
+
+=item C<Parrot_PMC_bitwise_or>
+
+=item C<Parrot_PMC_bitwise_or_int>
+
+=item C<Parrot_PMC_bitwise_ors>
+
+=item C<Parrot_PMC_bitwise_ors_str>
+
+=item C<Parrot_PMC_bitwise_shl>
+
+=item C<Parrot_PMC_bitwise_shl_int>
+
+=item C<Parrot_PMC_bitwise_shr>
+
+=item C<Parrot_PMC_bitwise_shr_int>
+
+=item C<Parrot_PMC_bitwise_xor>
+
+=item C<Parrot_PMC_bitwise_xor_int>
+
+=item C<Parrot_PMC_bitwise_xors>
+
+=item C<Parrot_PMC_bitwise_xors_str>
+
+=item C<Parrot_PMC_can>
+
+=item C<Parrot_PMC_clone>
+
+=item C<Parrot_PMC_clone_pmc>
+
+=item C<Parrot_PMC_cmp>
+
+=item C<Parrot_PMC_cmp_num>
+
+=item C<Parrot_PMC_cmp_pmc>
+
+=item C<Parrot_PMC_cmp_string>
+
+=item C<Parrot_PMC_concatenate>
+
+=item C<Parrot_PMC_concatenate_str>
+
+=item C<Parrot_PMC_decrement>
+
+=item C<Parrot_PMC_defined>
+
+=item C<Parrot_PMC_defined_keyed>
+
+=item C<Parrot_PMC_defined_keyed_int>
+
+=item C<Parrot_PMC_defined_keyed_str>
+
+=item C<Parrot_PMC_delete_keyed>
+
+=item C<Parrot_PMC_delete_keyed_int>
+
+=item C<Parrot_PMC_delete_keyed_str>
+
+=item C<Parrot_PMC_delete_pmckey>
+
+=item C<Parrot_PMC_delprop>
+
+=item C<Parrot_PMC_destroy>
+
+=item C<Parrot_PMC_divide>
+
+=item C<Parrot_PMC_divide_float>
+
+=item C<Parrot_PMC_divide_int>
+
+=item C<Parrot_PMC_does>
+
+=item C<Parrot_PMC_does_pmc>
+
+=item C<Parrot_PMC_elements>
+
+=item C<Parrot_PMC_exists_keyed>
+
+=item C<Parrot_PMC_exists_keyed_int>
+
+=item C<Parrot_PMC_exists_keyed_str>
+
+=item C<Parrot_PMC_find_method>
+
+=item C<Parrot_PMC_floor_divide>
+
+=item C<Parrot_PMC_floor_divide_float>
+
+=item C<Parrot_PMC_floor_divide_int>
+
+=item C<Parrot_PMC_get_attr_keyed>
+
+=item C<Parrot_PMC_get_attr_str>
+
+=item C<Parrot_PMC_get_bignum>
+
+=item C<Parrot_PMC_get_bool>
+
+=item C<Parrot_PMC_get_class>
+
+=item C<Parrot_PMC_get_cstring>
+
+=item C<Parrot_PMC_get_cstring_intkey>
+
+=item C<Parrot_PMC_get_cstringn>
+
+=item C<Parrot_PMC_get_cstringn_intkey>
+
+=item C<Parrot_PMC_get_integer>
+
+=item C<Parrot_PMC_get_integer_keyed>
+
+=item C<Parrot_PMC_get_integer_keyed_int>
+
+=item C<Parrot_PMC_get_integer_keyed_str>
+
+=item C<Parrot_PMC_get_intval>
+
+=item C<Parrot_PMC_get_intval_intkey>
+
+=item C<Parrot_PMC_get_intval_pmckey>
+
+=item C<Parrot_PMC_get_iter>
+
+=item C<Parrot_PMC_get_namespace>
+
+=item C<Parrot_PMC_get_number>
+
+=item C<Parrot_PMC_get_number_keyed>
+
+=item C<Parrot_PMC_get_number_keyed_int>
+
+=item C<Parrot_PMC_get_number_keyed_str>
+
+=item C<Parrot_PMC_get_numval>
+
+=item C<Parrot_PMC_get_numval_intkey>
+
+=item C<Parrot_PMC_get_pmc>
+
+=item C<Parrot_PMC_get_pmc_intkey>
+
+=item C<Parrot_PMC_get_pmc_keyed>
+
+=item C<Parrot_PMC_get_pmc_keyed_int>
+
+=item C<Parrot_PMC_get_pmc_keyed_str>
+
+=item C<Parrot_PMC_get_pmc_strkey>
+
+=item C<Parrot_PMC_get_pointer>
+
+=item C<Parrot_PMC_get_pointer_intkey>
+
+=item C<Parrot_PMC_get_pointer_keyed>
+
+=item C<Parrot_PMC_get_pointer_keyed_int>
+
+=item C<Parrot_PMC_get_pointer_keyed_str>
+
+=item C<Parrot_PMC_getprop>
+
+=item C<Parrot_PMC_getprops>
+
+=item C<Parrot_PMC_get_repr>
+
+=item C<Parrot_PMC_get_string>
+
+=item C<Parrot_PMC_get_string_intkey>
+
+=item C<Parrot_PMC_get_string_keyed>
+
+=item C<Parrot_PMC_get_string_keyed_int>
+
+=item C<Parrot_PMC_get_string_keyed_str>
+
+=item C<Parrot_PMC_i_absolute>
+
+=item C<Parrot_PMC_i_add>
+
+=item C<Parrot_PMC_i_add_float>
+
+=item C<Parrot_PMC_i_add_int>
+
+=item C<Parrot_PMC_i_bitwise_and>
+
+=item C<Parrot_PMC_i_bitwise_and_int>
+
+=item C<Parrot_PMC_i_bitwise_ands>
+
+=item C<Parrot_PMC_i_bitwise_ands_str>
+
+=item C<Parrot_PMC_i_bitwise_lsr>
+
+=item C<Parrot_PMC_i_bitwise_lsr_int>
+
+=item C<Parrot_PMC_i_bitwise_not>
+
+=item C<Parrot_PMC_i_bitwise_nots>
+
+=item C<Parrot_PMC_i_bitwise_or>
+
+=item C<Parrot_PMC_i_bitwise_or_int>
+
+=item C<Parrot_PMC_i_bitwise_ors>
+
+=item C<Parrot_PMC_i_bitwise_ors_str>
+
+=item C<Parrot_PMC_i_bitwise_shl>
+
+=item C<Parrot_PMC_i_bitwise_shl_int>
+
+=item C<Parrot_PMC_i_bitwise_shr>
+
+=item C<Parrot_PMC_i_bitwise_shr_int>
+
+=item C<Parrot_PMC_i_bitwise_xor>
+
+=item C<Parrot_PMC_i_bitwise_xor_int>
+
+=item C<Parrot_PMC_i_bitwise_xors>
+
+=item C<Parrot_PMC_i_bitwise_xors_str>
+
+=item C<Parrot_PMC_i_concatenate>
+
+=item C<Parrot_PMC_i_concatenate_str>
+
+=item C<Parrot_PMC_i_divide>
+
+=item C<Parrot_PMC_i_divide_float>
+
+=item C<Parrot_PMC_i_divide_int>
+
+=item C<Parrot_PMC_i_floor_divide>
+
+=item C<Parrot_PMC_i_floor_divide_float>
+
+=item C<Parrot_PMC_i_floor_divide_int>
+
+=item C<Parrot_PMC_i_logical_not>
+
+=item C<Parrot_PMC_i_modulus>
+
+=item C<Parrot_PMC_i_modulus_float>
+
+=item C<Parrot_PMC_i_modulus_int>
+
+=item C<Parrot_PMC_i_multiply>
+
+=item C<Parrot_PMC_i_multiply_float>
+
+=item C<Parrot_PMC_i_multiply_int>
+
+=item C<Parrot_PMC_increment>
+
+=item C<Parrot_PMC_i_neg>
+
+=item C<Parrot_PMC_init>
+
+=item C<Parrot_PMC_init_pmc>
+
+=item C<Parrot_PMC_inspect>
+
+=item C<Parrot_PMC_inspect_str>
+
+=item C<Parrot_PMC_instantiate>
+
+=item C<Parrot_PMC_instantiate_str>
+
+=item C<Parrot_PMC_invoke>
+
+=item C<Parrot_PMC_i_pow>
+
+=item C<Parrot_PMC_i_pow_float>
+
+=item C<Parrot_PMC_i_pow_int>
+
+=item C<Parrot_PMC_i_repeat>
+
+=item C<Parrot_PMC_i_repeat_int>
+
+=item C<Parrot_PMC_isa>
+
+=item C<Parrot_PMC_isa_pmc>
+
+=item C<Parrot_PMC_is_equal>
+
+=item C<Parrot_PMC_is_equal_num>
+
+=item C<Parrot_PMC_is_equal_string>
+
+=item C<Parrot_PMC_is_same>
+
+=item C<Parrot_PMC_i_subtract>
+
+=item C<Parrot_PMC_i_subtract_float>
+
+=item C<Parrot_PMC_i_subtract_int>
+
+=item C<Parrot_PMC_logical_and>
+
+=item C<Parrot_PMC_logical_not>
+
+=item C<Parrot_PMC_logical_or>
+
+=item C<Parrot_PMC_logical_xor>
+
+=item C<Parrot_PMC_mark>
+
+=item C<Parrot_PMC_modulus>
+
+=item C<Parrot_PMC_modulus_float>
+
+=item C<Parrot_PMC_modulus_int>
+
+=item C<Parrot_PMC_morph>
+
+=item C<Parrot_PMC_multiply>
+
+=item C<Parrot_PMC_multiply_float>
+
+=item C<Parrot_PMC_multiply_int>
+
+=item C<Parrot_PMC_name>
+
+=item C<Parrot_PMC_neg>
+
+=item C<Parrot_PMC_new>
+
+=item C<Parrot_PMC_newclass>
+
+=item C<Parrot_PMC_null>
+
+=item C<Parrot_PMC_pop_float>
+
+=item C<Parrot_PMC_pop_integer>
+
+=item C<Parrot_PMC_pop_pmc>
+
+=item C<Parrot_PMC_pop_string>
+
+=item C<Parrot_PMC_pow>
+
+=item C<Parrot_PMC_pow_float>
+
+=item C<Parrot_PMC_pow_int>
+
+=item C<Parrot_PMC_push_float>
+
+=item C<Parrot_PMC_push_integer>
+
+=item C<Parrot_PMC_push_intval>
+
+=item C<Parrot_PMC_push_numval>
+
+=item C<Parrot_PMC_push_pmc>
+
+=item C<Parrot_PMC_push_pmcval>
+
+=item C<Parrot_PMC_push_string>
+
+=item C<Parrot_PMC_remove_attribute>
+
+=item C<Parrot_PMC_remove_method>
+
+=item C<Parrot_PMC_remove_parent>
+
+=item C<Parrot_PMC_remove_role>
+
+=item C<Parrot_PMC_remove_vtable_override>
+
+=item C<Parrot_PMC_repeat>
+
+=item C<Parrot_PMC_repeat_int>
+
+=item C<Parrot_PMC_set_attr_keyed>
+
+=item C<Parrot_PMC_set_attr_str>
+
+=item C<Parrot_PMC_set_bignum_int>
+
+=item C<Parrot_PMC_set_bignum_num>
+
+=item C<Parrot_PMC_set_bignum_str>
+
+=item C<Parrot_PMC_set_bool>
+
+=item C<Parrot_PMC_set_cstring>
+
+=item C<Parrot_PMC_set_cstring_intkey>
+
+=item C<Parrot_PMC_set_cstringn>
+
+=item C<Parrot_PMC_set_cstringn_intkey>
+
+=item C<Parrot_PMC_set_integer_keyed>
+
+=item C<Parrot_PMC_set_integer_keyed_int>
+
+=item C<Parrot_PMC_set_integer_keyed_str>
+
+=item C<Parrot_PMC_set_integer_native>
+
+=item C<Parrot_PMC_set_integer_same>
+
+=item C<Parrot_PMC_set_intval>
+
+=item C<Parrot_PMC_set_intval_intkey>
+
+=item C<Parrot_PMC_set_number_keyed>
+
+=item C<Parrot_PMC_set_number_keyed_int>
+
+=item C<Parrot_PMC_set_number_keyed_str>
+
+=item C<Parrot_PMC_set_number_native>
+
+=item C<Parrot_PMC_set_number_same>
+
+=item C<Parrot_PMC_set_numval>
+
+=item C<Parrot_PMC_set_numval_intkey>
+
+=item C<Parrot_PMC_set_pmc>
+
+=item C<Parrot_PMC_set_pmc_intkey>
+
+=item C<Parrot_PMC_set_pmc_keyed>
+
+=item C<Parrot_PMC_set_pmc_keyed_int>
+
+=item C<Parrot_PMC_set_pmc_keyed_str>
+
+=item C<Parrot_PMC_set_pmc_pmckey>
+
+=item C<Parrot_PMC_set_pmc_strkey>
+
+=item C<Parrot_PMC_set_pointer>
+
+=item C<Parrot_PMC_set_pointer_intkey>
+
+=item C<Parrot_PMC_set_pointer_keyed>
+
+=item C<Parrot_PMC_set_pointer_keyed_int>
+
+=item C<Parrot_PMC_set_pointer_keyed_str>
+
+=item C<Parrot_PMC_setprop>
+
+=item C<Parrot_PMC_set_string>
+
+=item C<Parrot_PMC_set_string_intkey>
+
+=item C<Parrot_PMC_set_string_keyed>
+
+=item C<Parrot_PMC_set_string_keyed_int>
+
+=item C<Parrot_PMC_set_string_keyed_str>
+
+=item C<Parrot_PMC_set_string_native>
+
+=item C<Parrot_PMC_set_string_same>
+
+=item C<Parrot_PMC_set_vtable>
+
+=item C<Parrot_PMC_share>
+
+=item C<Parrot_PMC_share_ro>
+
+=item C<Parrot_PMC_shift_float>
+
+=item C<Parrot_PMC_shift_integer>
+
+=item C<Parrot_PMC_shift_pmc>
+
+=item C<Parrot_PMC_shift_string>
+
+=item C<Parrot_PMC_slice>
+
+=item C<Parrot_PMC_splice>
+
+=item C<Parrot_PMC_substr>
+
+=item C<Parrot_PMC_substr_str>
+
+=item C<Parrot_PMC_subtract>
+
+=item C<Parrot_PMC_subtract_float>
+
+=item C<Parrot_PMC_subtract_int>
+
+=item C<Parrot_PMC_type_keyed>
+
+=item C<Parrot_PMC_typenum>
+
+=item C<Parrot_PMC_unshift_float>
+
+=item C<Parrot_PMC_unshift_integer>
+
+=item C<Parrot_PMC_unshift_pmc>
+
+=item C<Parrot_PMC_unshift_string>
+
+=item C<Parrot_pop_context>
+
+=item C<Parrot_pop_mark>
+
+=item C<Parrot_printf>
+
+=item C<Parrot_psprintf>
+
+=item C<Parrot_push_action>
+
+=item C<Parrot_push_context>
+
+=item C<Parrot_push_mark>
+
+=item C<Parrot_range_rand>
+
+=item C<Parrot_regenerate_HLL_namespaces>
+
+=item C<Parrot_register_charset>
+
+=item C<Parrot_register_charset_converter>
+
+=item C<Parrot_register_encoding>
+
+=item C<Parrot_register_HLL>
+
+=item C<Parrot_register_HLL_lib>
+
+=item C<Parrot_register_HLL_type>
+
+=item C<Parrot_register_move>
+
+=item C<Parrot_register_pmc>
+
+=item C<Parrot_run_callback>
+
+=item C<Parrot_runcode>
+
+=item C<Parrot_run_meth_fromc>
+
+=item C<Parrot_run_meth_fromc_arglist>
+
+=item C<Parrot_run_meth_fromc_arglist_retf>
+
+=item C<Parrot_run_meth_fromc_arglist_reti>
+
+=item C<Parrot_run_meth_fromc_args>
+
+=item C<Parrot_run_meth_fromc_args_retf>
+
+=item C<Parrot_run_meth_fromc_args_reti>
+
+=item C<Parrot_run_native>
+
+=item C<Parrot_runops_fromc>
+
+=item C<Parrot_runops_fromc_arglist>
+
+=item C<Parrot_runops_fromc_arglist_retf>
+
+=item C<Parrot_runops_fromc_arglist_reti>
+
+=item C<Parrot_runops_fromc_args>
+
+=item C<Parrot_runops_fromc_args_event>
+
+=item C<Parrot_runops_fromc_args_retf>
+
+=item C<Parrot_runops_fromc_args_reti>
+
+=item C<Parrot_schedule_event>
+
+=item C<Parrot_schedule_interp_qentry>
+
+=item C<Parrot_secret_snprintf>
+
+=item C<Parrot_set_config_hash_internal>
+
+=item C<Parrot_set_context_threshold>
+
+=item C<Parrot_set_debug>
+
+=item C<Parrot_set_executable_name>
+
+=item C<Parrot_set_flag>
+
+=item C<Parrot_set_global>
+
+=item C<Parrot_set_intreg>
+
+=item C<Parrot_set_numreg>
+
+=item C<Parrot_set_pmcreg>
+
+=item C<Parrot_set_run_core>
+
+=item C<Parrot_set_strreg>
+
+=item C<Parrot_set_trace>
+
+=item C<Parrot_setwarnings>
+
+=item C<Parrot_shared_gc_block>
+
+=item C<Parrot_shared_gc_unblock>
+
+=item C<Parrot_sleep_on_event>
+
+=item C<Parrot_snprintf>
+
+=item C<Parrot_sprintf_c>
+
+=item C<Parrot_sprintf_s>
+
+=item C<Parrot_srand>
+
+=item C<Parrot_store_global_n>
+
+=item C<Parrot_store_global_s>
+
+=item C<Parrot_store_sub_in_namespace>
+
+=item C<Parrot_str_append>
+
+=item C<Parrot_str_bitwise_and>
+
+=item C<Parrot_str_bitwise_not>
+
+=item C<Parrot_str_bitwise_or>
+
+=item C<Parrot_str_bitwise_xor>
+
+=item C<Parrot_str_boolean>
+
+=item C<Parrot_str_byte_length>
+
+=item C<Parrot_str_change_charset>
+
+=item C<Parrot_str_change_encoding>
+
+=item C<Parrot_str_chopn>
+
+=item C<Parrot_str_chopn_inplace>
+
+=item C<Parrot_str_compare>
+
+=item C<Parrot_str_compose>
+
+=item C<Parrot_str_concat>
+
+=item C<Parrot_str_copy>
+
+=item C<Parrot_str_downcase>
+
+=item C<Parrot_str_downcase_inplace>
+
+=item C<Parrot_str_equal>
+
+=item C<Parrot_str_escape>
+
+=item C<Parrot_str_escape_truncate>
+
+=item C<Parrot_str_find_cclass>
+
+=item C<Parrot_str_find_index>
+
+=item C<Parrot_str_find_not_cclass>
+
+=item C<Parrot_str_finish>
+
+=item C<Parrot_str_format_data>
+
+=item C<Parrot_str_free_cstring>
+
+=item C<Parrot_str_from_int>
+
+=item C<Parrot_str_from_num>
+
+=item C<Parrot_str_indexed>
+
+=item C<Parrot_string_cstring>
+
+=item C<Parrot_str_init>
+
+=item C<Parrot_str_is_cclass>
+
+=item C<Parrot_str_join>
+
+=item C<Parrot_str_length>
+
+=item C<Parrot_str_new>
+
+=item C<Parrot_str_new_constant>
+
+=item C<Parrot_str_new_COW>
+
+=item C<Parrot_str_new_init>
+
+=item C<Parrot_str_new_noinit>
+
+=item C<Parrot_str_not_equal>
+
+=item C<Parrot_str_pin>
+
+=item C<Parrot_str_repeat>
+
+=item C<Parrot_str_replace>
+
+=item C<Parrot_str_resize>
+
+=item C<Parrot_str_reuse_COW>
+
+=item C<Parrot_str_set>
+
+=item C<Parrot_str_split>
+
+=item C<Parrot_str_substr>
+
+=item C<Parrot_str_titlecase>
+
+=item C<Parrot_str_titlecase_inplace>
+
+=item C<Parrot_str_to_cstring>
+
+=item C<Parrot_str_to_hashval>
+
+=item C<Parrot_str_to_int>
+
+=item C<Parrot_str_to_num>
+
+=item C<Parrot_str_unescape>
+
+=item C<Parrot_str_unpin>
+
+=item C<Parrot_str_upcase>
+
+=item C<Parrot_str_upcase_inplace>
+
+=item C<Parrot_str_write_COW>
+
+=item C<Parrot_sub_new_from_c_func>
+
+=item C<Parrot_test_debug>
+
+=item C<Parrot_test_flag>
+
+=item C<Parrot_test_trace>
+
+=item C<Parrot_thaw>
+
+=item C<Parrot_thaw_constants>
+
+=item C<Parrot_uint_rand>
+
+=item C<Parrot_unblock_GC_mark>
+
+=item C<Parrot_unblock_GC_sweep>
+
+=item C<Parrot_unregister_pmc>
+
+=item C<Parrot_vfprintf>
+
+=item C<Parrot_vsnprintf>
+
+=item C<Parrot_vsprintf_c>
+
+=item C<Parrot_vsprintf_s>
+
+=item C<Parrot_warn>
+
+=item C<PMC_is_null>
+
+=item C<pmc_new>
+
+=item C<pmc_type>
+
+=item C<PObj_active_destroy_SET>
+
+=item C<PObj_custom_mark_SET>
+
+=item C<string_capacity>
+
+=item C<string_chr>
+
+=item C<string_make>
+
+=item C<string_make_from_charset>
+
+=item C<string_max_bytes>
+
+=item C<string_ord>
+
+=item C<string_primary_encoding_for_representation>
+
+=item C<string_rep_compatible>
+
+=item C<string_to_cstring_nullable>
+
+=back
+
=head1 SEE ALSO
F<src/main.c> and F<t/src/*.t> for Parrot's use of the embedding system.
Modified: branches/pluggable_runcore/docs/parrothist.pod
==============================================================================
--- branches/pluggable_runcore/docs/parrothist.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/parrothist.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -93,4 +93,6 @@
Infinoid 1.2.0 2009-May-19 "Bird Brain"
Whiteknight 1.3.0 2009-Jun-16 "Andean Swift"
+ cotto 1.4.0 2009-Jul-21 "Mundo Cani"
+
=cut
Modified: branches/pluggable_runcore/docs/pdds/draft/pdd06_pasm.pod
==============================================================================
--- branches/pluggable_runcore/docs/pdds/draft/pdd06_pasm.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/pdds/draft/pdd06_pasm.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -203,20 +203,6 @@
Branch forward or backward by the amount in register x. (X may be either Ix,
Nx, or Px) Branch offset may also be an integer constant.
-=item jsr tx
-
-Jump to the location specified by register X. Push the current location onto
-the call stack for later returning.
-
-=item bsr ix
-
-Branch to the location specified by X (either register or label). Push the
-current location onto the call stack for later returning.
-
-=item ret
-
-Pop the location off the top of the stack and go there.
-
=back
=head3 Data manipulation
Modified: branches/pluggable_runcore/docs/pdds/draft/pdd16_native_call.pod
==============================================================================
--- branches/pluggable_runcore/docs/pdds/draft/pdd16_native_call.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/pdds/draft/pdd16_native_call.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -36,16 +36,16 @@
=head3 Function signatures
-The following list are the valid letters in the function signatures for
-Parrot's NCI. Note that only letters and numbers are valid, and each letter
-represents a single parameter passed into the NCI. Note that the letters are
+The following list are the valid symbols in the function signatures for
+Parrot's NCI. Note that only letters and numbers are valid, and each symbol
+represents a single parameter passed into the NCI. Note that the symbols are
case-sensitive, and must be within the base 7-bit ASCII character set.
At some point punctuation may be used as modifiers on the function
parameters, in which case each parameter may be represented by multiple
-letters.
+symbols.
-In I<no> case should the signature letters be separated by whitespace. This
+In I<no> case should the signature symbols be separated by whitespace. This
restriction may be lifted in the future, but for now remains as an avenue
for adding additional functionality.
Modified: branches/pluggable_runcore/docs/pdds/pdd17_pmc.pod
==============================================================================
--- branches/pluggable_runcore/docs/pdds/pdd17_pmc.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/pdds/pdd17_pmc.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -1062,15 +1062,6 @@
Delete the element indexed by a PMC, integer, or string key.
-=item nextkey_keyed
-
- PMC* nextkey_keyed(INTERP, PMC *self, PMC *key, INTVAL what)
- PMC* nextkey_keyed_int(INTERP, PMC *self, INTVAL key, INTVAL what)
- PMC* nextkey_keyed_str(INTERP, PMC *self, STRING *key, INTVAL what)
-
-Advance to the next position while iterating through an aggregate. [NOTE: this
-feature needs review together with the Iterator PMC.]
-
=back
=head4 Math Vtable Functions
Modified: branches/pluggable_runcore/docs/pdds/pdd22_io.pod
==============================================================================
--- branches/pluggable_runcore/docs/pdds/pdd22_io.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/pdds/pdd22_io.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -1053,12 +1053,12 @@
=head2 References
- F<src/io/io.c>
+ F<src/io/core.c>
F<src/ops/io.ops>
F<include/parrot/io.h>
F<runtime/parrot/library/Stream/*>
- F<src/io/io_unix.c>
- F<src/io/io_win32.c>
+ F<src/io/unix.c>
+ F<src/io/win32.c>
Perl 5's IO::AIO
Perl 5's POE
Modified: branches/pluggable_runcore/docs/pdds/pdd28_strings.pod
==============================================================================
--- branches/pluggable_runcore/docs/pdds/pdd28_strings.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/pdds/pdd28_strings.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -575,10 +575,6 @@
Terminate and clean up Parrot's string subsystem, including string allocation
and garbage collection.
-=head4 Parrot_str_free (was string_free)
-
-Free the string's header.
-
=head4 string_max_bytes
Calculate the number of bytes needed to hold a given number of characters in a
@@ -642,6 +638,10 @@
Is the same as Parrot_str_split.
+=head4 Parrot_str_free (was string_free)
+
+Unsafe and unuseful, let the garbage collector take care.
+
=head3 String PMC API
The String PMC provides a high-level object interface to the string
Modified: branches/pluggable_runcore/docs/pdds/pdd30_install.pod
==============================================================================
--- branches/pluggable_runcore/docs/pdds/pdd30_install.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/pdds/pdd30_install.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -99,12 +99,20 @@
formatted HTML. Has subdirectories for each format of documentation:
F<pod/>, F<html/>, etc.
+=item F</usr/include/parrot/E<lt>versionE<gt>/>
+
+C header files for Parrot.
+
+=item F</usr/src/parrot/E<lt>versionE<gt>/>
+
+PMC source files needed for building dynamic PMCs.
+
=back
=head2 Dependencies
-Building core Parrot depends on Perl (including perldoc, which may be a
-separate package), libgdm and libreadline.
+Building core Parrot depends on Perl (including F<perldoc>, which may be a
+separate package), F<libgdm> and F<libreadline>.
Building a language depends on a series of Parrot build tools, installed in
F</usr/lib/parrot/E<lt>version/tools>. These tools will generally not be
@@ -144,6 +152,15 @@
converted to C<\r\n> for MSWin32 nmake. See
L<Parrot::Configure::Compiler>.
+=head3 Packaging and Distribution
+
+Each language, operating system, or distribution is free to package
+modules in their own way, using their own usual build and install tools.
+The default distribution format is a tarball containing the source files
+and a cross-platform build infrastructure (the 'make' variants are a
+good choice, and can be combined with Autoconf, CMake, Perl, Python,
+etc. for more complex conditional builds).
+
=head2 Attachments
None.
Modified: branches/pluggable_runcore/docs/pmc2c.pod
==============================================================================
--- branches/pluggable_runcore/docs/pmc2c.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/pmc2c.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -185,11 +185,7 @@
=item C<SUPER(a,b,c)>
Calls the overridden implementation of the current method in the nearest
-superclass, using the static type of C<SELF>.
-
-=item C<DYNSUPER(a,b,c)>
-
-As above, but uses the actual dynamic type of C<SELF>.
+superclass, using the type of C<SELF>.
=back
Modified: branches/pluggable_runcore/docs/project/debian_packaging_guide.pod
==============================================================================
--- branches/pluggable_runcore/docs/project/debian_packaging_guide.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/project/debian_packaging_guide.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -45,11 +45,6 @@
=item 3.
-Update the debian/parrot-doc.docs file by running the script
-tools/dev/debian_docs.sh in the Parrot repository.
-
-=item 4.
-
Update the debian/changelog file in ~/deb/parrot/parrot-<version>/. The format
of the changelog file is strict (automatically parsed). The first line of the
log entry gives the package version and categorization. For a new version
@@ -73,50 +68,50 @@
-- Your Name <you at example.org> Sun, 30 Dec 2007 17:21:45 +0000
-=item 5.
+=item 4.
Update the debian/control.in file in ~/deb/parrot/parrot-<version>/. Make sure
you are listed in "Uploaders". The "Maintainer" will always be "Debian
Parrot Maintainers <pkg-parrot-devel at lists.alioth.debian.org>".
-=item 6.
+=item 5.
Update the debian/copyright file in ~/deb/parrot/parrot-<version>/. Check for
any removed files that no longer need copyright notices. Update the years in
the Parrot Foundation copyright line if needed.
-=item 7.
+=item 6.
Regenerate the debian/control file. From the
~/deb/parrot/parrot-<version>/ directory, run:
$ debian/rules debian-control-stamp
-=item 8.
+=item 7.
Install all dependencies:
$ sudo /usr/lib/pbuilder/pbuilder-satisfydepends
-=item 9.
+=item 8.
Build the packages. From ~/deb/parrot/parrot_<version>/, run:
$ export DEBSIGN_KEYID="<gpg key id>"
$ debuild
-=item 10.
+=item 9.
Check the package for errors. From ~/deb/parrot, run:
$ lintian -i parrot_<version>.changes
-=item 11.
+=item 10.
Commit all changes made to the files in the debian/ directory to the Parrot
repository.
-=item 12.
+=item 11.
Upload the packages to http://alioth.debian.org. (If you don't have admin
privileges, ask someone who does.) From any of the project pages, click on the
Modified: branches/pluggable_runcore/docs/project/release_manager_guide.pod
==============================================================================
--- branches/pluggable_runcore/docs/project/release_manager_guide.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/project/release_manager_guide.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -125,6 +125,9 @@
policy. (Those changes are all included within the major version number
increase for the supported release.)
+Once you've updated PBC_COMPAT, run C<tools/dev/mk_native_pbc> to update the
+pbc files used in the native pbc tests.
+
=item h
Make sure everything works:
@@ -361,8 +364,7 @@
The starred releases are Parrot's twice-yearly supported releases, see
F<docs/project/support_policy.pod>.
- - July 21, 2009 - 1.4* - cotto
- - August 18, 2009 - 1.5 - rgrjr
+ - August 18, 2009 - 1.5 - Whiteknight
- Sept 15, 2009 - 1.6 - particle
- Oct 20, 2009 - 1.7 -
- Nov 17, 2009 - 1.8 -
Modified: branches/pluggable_runcore/docs/project/ubuntu_packaging_guide.pod
==============================================================================
--- branches/pluggable_runcore/docs/project/ubuntu_packaging_guide.pod Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/project/ubuntu_packaging_guide.pod Fri Aug 14 01:24:23 2009 (r40541)
@@ -67,7 +67,7 @@
The changelog entry for the Ubuntu release is generally:
- * Resynchronize with Debian unstable.
+ * Synchronize with Debian unstable.
Add any custom changes for Ubuntu packaging (rare). The final line gives the
maintainer's name, email address, and the date. The date must be in RFC822
Modified: branches/pluggable_runcore/docs/resources/parrot.css
==============================================================================
--- branches/pluggable_runcore/docs/resources/parrot.css Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/docs/resources/parrot.css Fri Aug 14 01:24:23 2009 (r40541)
@@ -90,8 +90,9 @@
/* =item constructs no <dt><dd> just <dt>, so we fake it */
dt {
- padding-top: 0.5em;
- padding-bottom: 1em;
+ margin-top: 1em;
+ margin-bottom: 0.5em;
+ font-weight: bold;
}
pre {
Modified: branches/pluggable_runcore/examples/benchmarks/addit.pasm
==============================================================================
--- branches/pluggable_runcore/examples/benchmarks/addit.pasm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/benchmarks/addit.pasm Fri Aug 14 01:24:23 2009 (r40541)
@@ -18,6 +18,7 @@
=cut
_main:
+ new P10, 'ResizableIntegerArray'
new P5, 'ResizablePMCArray'
push P5, 1000
push P5, 7.100
@@ -28,7 +29,7 @@
AGAIN:
dec I9
lt I9, 0, FIN
- bsr _varargs_adder
+ local_branch P10, _varargs_adder
branch AGAIN
FIN:
print N5
@@ -46,7 +47,7 @@
branch LOOP
DONE:
set N5, P2
- ret
+ local_return P10
=head1 SEE ALSO
Modified: branches/pluggable_runcore/examples/benchmarks/overload.pir
==============================================================================
--- branches/pluggable_runcore/examples/benchmarks/overload.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/benchmarks/overload.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,7 +3,6 @@
.sub bench :main
.include "pmctypes.pasm"
-.include "mmd.pasm"
.local int i
.local pmc r
.local pmc a
Modified: branches/pluggable_runcore/examples/benchmarks/stress.pasm
==============================================================================
--- branches/pluggable_runcore/examples/benchmarks/stress.pasm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/benchmarks/stress.pasm Fri Aug 14 01:24:23 2009 (r40541)
@@ -16,10 +16,11 @@
=cut
+ new P10, 'ResizableIntegerArray'
set I0, 10
new P0, 'ResizablePMCArray'
-ol: bsr buildarray
+ol: local_branch P10, buildarray
set P0[I0], P1
dec I0
# print I0
@@ -29,7 +30,7 @@
set I0, 20
new P2, 'ResizablePMCArray'
-ol1: bsr buildarray
+ol1: local_branch P10, buildarray
set P2[I0], P1
dec I0
# print I0
@@ -39,7 +40,7 @@
set I0, 20
new P3, 'ResizablePMCArray'
-ol2: bsr buildarray
+ol2: local_branch P10, buildarray
set P3[I0], P1
dec I0
# print I0
@@ -63,7 +64,7 @@
set P1[I1], P9
dec I1
if I1, loop1
- ret
+ local_return P10
=head1 SEE ALSO
Modified: branches/pluggable_runcore/examples/benchmarks/stress1.pasm
==============================================================================
--- branches/pluggable_runcore/examples/benchmarks/stress1.pasm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/benchmarks/stress1.pasm Fri Aug 14 01:24:23 2009 (r40541)
@@ -19,12 +19,13 @@
# Our master loop, I20 times
set I20, 10
time N0
+ new P10, 'ResizableIntegerArray'
mloop:
set I0, 10
new P0, 'ResizablePMCArray'
-ol: bsr buildarray
+ol: local_branch P10, buildarray
set P0[I0], P1
dec I0
if I0, ol
@@ -32,7 +33,7 @@
set I0, 20
new P2, 'ResizablePMCArray'
-ol1: bsr buildarray
+ol1: local_branch P10, buildarray
set P2[I0], P1
dec I0
if I0, ol1
@@ -40,7 +41,7 @@
set I0, 20
new P3, 'ResizablePMCArray'
-ol2: bsr buildarray
+ol2: local_branch P10, buildarray
set P3[I0], P1
dec I0
if I0, ol2
@@ -71,7 +72,7 @@
set P1[I1], P9
dec I1
if I1, loop1
- ret
+ local_return P10
=head1 SEE ALSO
Modified: branches/pluggable_runcore/examples/benchmarks/stress2.pasm
==============================================================================
--- branches/pluggable_runcore/examples/benchmarks/stress2.pasm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/benchmarks/stress2.pasm Fri Aug 14 01:24:23 2009 (r40541)
@@ -16,28 +16,32 @@
=cut
set I3, 20
-ol: set I0, 10
- new P0, 'ResizablePMCArray'
+ new P10, 'ResizableIntegerArray'
+ol:
+ set I0, 10
+ new P0, 'ResizablePMCArray'
+
+ol1:
+ local_branch P10, buildarray
+ set P0[I0], P1
+ dec I0
+ if I0, ol1
-ol1: bsr buildarray
- set P0[I0], P1
- dec I0
- if I0, ol1
+ dec I3
+ if I3, ol
- dec I3
- if I3, ol
-
- end
+ end
buildarray:
- set I1, 10000
- new P1, 'ResizablePMCArray'
-loop1: new P2, 'Integer'
- set P2, I1
- set P1[I1], P2
- dec I1
- if I1, loop1
- ret
+ set I1, 10000
+ new P1, 'ResizablePMCArray'
+loop1:
+ new P2, 'Integer'
+ set P2, I1
+ set P1[I1], P2
+ dec I1
+ if I1, loop1
+ local_return P10
=head1 SEE ALSO
Modified: branches/pluggable_runcore/examples/benchmarks/stress3.pasm
==============================================================================
--- branches/pluggable_runcore/examples/benchmarks/stress3.pasm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/benchmarks/stress3.pasm Fri Aug 14 01:24:23 2009 (r40541)
@@ -37,11 +37,12 @@
#lt I10, 2, noarg
#set I11, P5[1]
set I11, 0
+ new P10, 'ResizableIntegerArray'
noarg:
set I0, 100
new P0, 'ResizablePMCArray'
-ol: bsr buildarray
+ol: local_branch P10, buildarray
set P0[I0], P1
dec I0
if I0, ol
@@ -81,7 +82,7 @@
set P1[I1], P9
dec I1
if I1, loop1
- ret
+ local_return P10
=head1 SEE ALSO
Copied: branches/pluggable_runcore/examples/c/pbc_info.c (from r40540, trunk/examples/c/pbc_info.c)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/examples/c/pbc_info.c Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/examples/c/pbc_info.c)
@@ -0,0 +1,112 @@
+/*
+Copyright (C) 2001-2003, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+pbc_info - PackFile demo
+
+=head1 SYNOPSIS
+
+ pbc_info file.pbc
+
+=head1 DESCRIPTION
+
+Sample program for dumping PackFile segment names by iterating
+over the main directory.
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
+#include "parrot/parrot.h"
+#include "parrot/embed.h"
+
+/*
+
+=item C<static INTVAL iter(PARROT_INTERP, PackFile_Segment *seg, void *user_data)>
+
+This function is passed the callback to PackFile_map_segments() to print out
+the name of each segment in the directory.
+
+=cut
+
+*/
+
+static INTVAL
+iter(PARROT_INTERP, PackFile_Segment *seg, void *user_data)
+{
+ long ident = (long)user_data;
+ int length = ident;
+ printf("%*.0s%s\n", length, "", seg->name);
+ if (seg->type == PF_DIR_SEG)
+ PackFile_map_segments(interp, (PackFile_Directory*)seg,
+ iter, (void*)(ident+2));
+ return 0;
+}
+
+/*
+
+=item C<int main(int argc, char *argv[])>
+
+Reads the PBC from argv[1], adds a few extra sections, and then iterates over
+the directory using PackFile_map_segments() and iter().
+
+=cut
+
+*/
+
+int
+main(SHIM(int argc), char *argv[])
+{
+ PackFile *pf;
+ Interp *interp;
+ PackFile_Segment *seg;
+
+ interp = Parrot_new(NULL);
+
+ pf = Parrot_pbc_read(interp, argv[1], PFOPT_UTILS);
+
+ /*
+ * add some more segments
+ */
+ seg = PackFile_Segment_new_seg(interp,
+ &pf->directory, PF_DIR_SEG, "dir2", 1);
+ seg = PackFile_Segment_new_seg(interp,
+ (PackFile_Directory*)seg, PF_BYTEC_SEG, "code", 1);
+ seg = PackFile_Segment_new_seg(interp,
+ &pf->directory, PF_DIR_SEG, "dir3", 1);
+
+ /*
+ * show these
+ */
+ printf("%s\n", pf->directory.base.name);
+ PackFile_map_segments(interp, &pf->directory, iter, (void*)2);
+
+ Parrot_exit(interp, 0);
+}
+
+/*
+
+=back
+
+=head1 SEE ALSO
+
+F<src/packfile.c>, F<include/parrot/packfile.h>.
+
+=cut
+
+*/
+
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+
Copied: branches/pluggable_runcore/examples/config/file/configcompiler (from r40540, trunk/examples/config/file/configcompiler)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/examples/config/file/configcompiler Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/examples/config/file/configcompiler)
@@ -0,0 +1,87 @@
+# $Id$
+
+=variables
+
+CC=/usr/bin/gcc
+CX=/usr/bin/g++
+
+=general
+
+cc=$CC
+cxx=$CX
+link=$CX
+ld=/usr/bin/g++
+
+=steps
+
+init::manifest nomanicheck
+init::defaults
+init::install
+init::hints verbose-step
+init::headers
+inter::progs
+inter::make
+inter::lex
+inter::yacc
+auto::gcc
+auto::glibc
+auto::backtrace
+auto::fink
+auto::macports
+auto::msvc
+auto::attributes
+auto::warnings
+init::optimize
+inter::shlibs
+inter::libparrot
+inter::charset
+inter::encoding
+inter::types
+auto::ops
+auto::pmc
+auto::alignptrs
+auto::headers
+auto::sizes
+auto::byteorder
+auto::va_ptr
+auto::format
+auto::isreg
+auto::arch
+auto::jit
+auto::cpu
+auto::funcptr
+auto::cgoto
+auto::inline
+auto::gc
+auto::memalign
+auto::signal
+auto::socklen_t
+auto::neg_0
+auto::env
+auto::gmp
+auto::readline
+auto::gdbm
+auto::pcre
+auto::opengl
+auto::crypto
+auto::gettext
+auto::snprintf
+# auto::perldoc
+# auto::pod2man
+auto::ctags
+auto::revision
+auto::icu
+gen::config_h
+gen::core_pmcs
+gen::crypto
+gen::parrot_include
+gen::opengl
+gen::call_list
+gen::languages
+gen::makefiles
+gen::platform
+gen::config_pm
+
+=cut
+
+
Copied: branches/pluggable_runcore/examples/config/file/configwithfatalstep (from r40540, trunk/examples/config/file/configwithfatalstep)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/examples/config/file/configwithfatalstep Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/examples/config/file/configwithfatalstep)
@@ -0,0 +1,78 @@
+# $Id$
+
+=variables
+
+=general
+
+=steps
+
+init::manifest nomanicheck
+init::defaults
+init::install
+init::hints verbose-step fatal-step
+init::headers
+inter::progs
+inter::make
+inter::lex
+inter::yacc
+auto::gcc
+auto::glibc
+auto::backtrace
+auto::fink
+auto::macports
+auto::msvc
+auto::attributes
+auto::warnings
+init::optimize
+inter::shlibs
+inter::libparrot
+inter::charset
+inter::encoding
+inter::types
+auto::ops
+auto::pmc
+auto::alignptrs
+auto::headers
+auto::sizes
+auto::byteorder
+auto::va_ptr
+auto::format
+auto::isreg
+auto::arch
+auto::jit
+auto::cpu
+auto::funcptr
+auto::cgoto
+auto::inline
+auto::gc
+auto::memalign
+auto::signal
+auto::socklen_t
+auto::neg_0
+auto::env
+auto::gmp
+auto::readline
+auto::gdbm
+auto::pcre
+auto::opengl
+auto::crypto
+auto::gettext
+auto::snprintf
+# auto::perldoc
+# auto::pod2man
+auto::ctags
+auto::revision
+auto::icu
+gen::config_h
+gen::core_pmcs
+gen::crypto
+gen::parrot_include
+gen::opengl
+gen::call_list
+gen::languages
+gen::makefiles
+gen::platform
+gen::config_pm
+
+=cut
+
Modified: branches/pluggable_runcore/examples/embed/Makefile
==============================================================================
--- branches/pluggable_runcore/examples/embed/Makefile Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/embed/Makefile Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,37 +1,39 @@
# Copyright (C) 2009, Parrot Foundation.
## $Id$
-# To build this example in a parrot development environment:
-
-# PATH=/parrot_directory:$PATH
-# export LD_RUN_PATH=/parrot_directory/blib/lib
+# To build this example with an installed parrot:
+#
+# PATH=/parrot_install_directory/bin:$PATH
# make
# This assumes a posix environment with sh style shell.
# May need changes with other shells or other make tools.
-# For MSVC use nmake -f Makefile.msvc
+# For MSVC use see nmake -f Makefile.msvc (may not be up-to-date)
CC = $(shell parrot_config cc)
CCFLAGS = $(shell parrot_config ccflags)
LD = $(shell parrot_config ld)
LD_OUT = $(shell parrot_config ld_out)
-LDFLAGS = $(shell parrot_config libparrot_ldflags)
+LINKFLAGS = $(shell parrot_config inst_libparrot_linkflags) $(shell parrot_config rpath_lib)
O = $(shell parrot_config o)
EXE = $(shell parrot_config exe)
-INCLUDEDIR = $(shell parrot_config prefix)/include
-CONFIG = $(shell parrot_config prefix)/src/parrot_config
-all: lorito$(EXE)
+VERSIONDIR = $(shell parrot_config versiondir)
+INCLUDEDIR = $(shell parrot_config includedir)$(VERSIONDIR)
+LIBDIR = $(shell parrot_config libdir)$(VERSIONDIR)
+CONFIG = $(LIBDIR)/parrot_config
+
+all: cotorra$(EXE)
#-----------------------------------------------------------------------
-lorito$(O): lorito.c
- $(CC) $(CCFLAGS) -c -I $(INCLUDEDIR) lorito.c
+cotorra$(O): cotorra.c
+ $(CC) $(CCFLAGS) -c -I $(INCLUDEDIR) cotorra.c
-lorito$(EXE): lorito$(O)
- $(LD) $(LD_OUT)lorito$(EXE) lorito$(O) $(CONFIG)$(O) $(LDFLAGS)
+cotorra$(EXE): cotorra$(O)
+ $(LD) $(LD_OUT)cotorra$(EXE) cotorra$(O) $(CONFIG)$(O) $(LINKFLAGS)
#-----------------------------------------------------------------------
clean:
- rm -f lorito$(EXE) lorito$(O)
+ rm -f cotorra$(EXE) cotorra$(O)
Modified: branches/pluggable_runcore/examples/embed/Makefile.msvc
==============================================================================
--- branches/pluggable_runcore/examples/embed/Makefile.msvc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/embed/Makefile.msvc Fri Aug 14 01:24:23 2009 (r40541)
@@ -17,17 +17,17 @@
O = .obj
EXE = .exe
-all: lorito$(EXE)
+all: cotorra$(EXE)
#-----------------------------------------------------------------------
-lorito$(O): lorito.c
- $(CC) $(CCFLAGS) -c -I $(INCLUDEDIR) lorito.c
+cotorra$(O): cotorra.c
+ $(CC) $(CCFLAGS) -c -I $(INCLUDEDIR) cotorra.c
-lorito$(EXE): lorito$(O)
- $(LD) -out:lorito$(EXE) lorito$(O) $(LDFLAGS)
+cotorra$(EXE): cotorra$(O)
+ $(LD) -out:cotorra$(EXE) cotorra$(O) $(LDFLAGS)
#-----------------------------------------------------------------------
clean:
- rm -f lorito$(EXE) lorito$(O)
+ rm -f cotorra$(EXE) cotorra$(O)
Copied: branches/pluggable_runcore/examples/embed/cotorra.c (from r40540, trunk/examples/embed/cotorra.c)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/examples/embed/cotorra.c Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/examples/embed/cotorra.c)
@@ -0,0 +1,279 @@
+/*
+Copyright (C) 2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+cotorra - A parrot embedding test
+
+=head1 SYNOPSIS
+
+cotorra file.pbc
+
+=head1 DESCRIPTION
+
+A test of parrot embedding in a C program.
+
+Is a simplified form of the parrot main executable, with just a few
+options and able to run only pbc files.
+
+=cut
+
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "parrot/embed.h"
+#include "parrot/extend.h"
+
+/**********************************************************************/
+
+void fail(const char *msg);
+unsigned int getuintval(const char *s);
+Parrot_Run_core_t getruncore(const char *name);
+
+Parrot_String create_string(Parrot_Interp interp, const char *name);
+int cotorra_main(Parrot_Interp interp, int argc, char **argv);
+
+/**********************************************************************/
+
+/*
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
+/* Auxiliary generic functions */
+
+/*
+
+=item C<void fail(const char *msg)>
+
+Fatal error, print the msg to stderr and exit.
+
+=cut
+
+*/
+
+void fail(const char *msg)
+{
+ fprintf(stderr, "cotorra failed: %s\n", msg);
+ exit(EXIT_FAILURE);
+}
+
+/*
+
+=item C<unsigned int getuintval(const char *s)>
+
+Get an unsigned int value from a C string.
+Fails on invalid argument.
+
+=cut
+
+*/
+
+unsigned int getuintval(const char *s)
+{
+ char *aux;
+ unsigned long int n = strtoul(s, &aux, 0);
+ if (*aux != '\0')
+ fail("Invalid number");
+ return n;
+}
+
+struct runcoreinfo {
+ Parrot_Run_core_t id;
+ const char *name;
+};
+
+/*
+
+=item C<Parrot_Run_core_t getruncore(const char *name)>
+
+Get a runcore id from his name.
+Fails on invalid argument.
+
+=cut
+
+*/
+
+Parrot_Run_core_t getruncore(const char *name)
+{
+ static const struct runcoreinfo cores [] = {
+ { PARROT_SLOW_CORE, "slow" },
+ { PARROT_FAST_CORE, "fast" },
+ { PARROT_CGOTO_CORE, "cgoto" },
+ { PARROT_JIT_CORE, "jit" },
+ { PARROT_GC_DEBUG_CORE, "gcdebug" },
+ { PARROT_SWITCH_CORE, "switch" }
+ };
+ static const unsigned int n = sizeof (cores)/sizeof (struct runcoreinfo);
+ unsigned int i;
+ for (i= 0; i < n; ++i) {
+ if (strcmp(name, cores[i].name) == 0)
+ break;
+ }
+ if (i >= n)
+ fail("Invalid runcore");
+ return cores[i].id;
+}
+
+/**********************************************************************/
+
+/* Auxiliary parrot functions */
+
+/*
+
+=item C<Parrot_String create_string(Parrot_Interp interp, const char *name)>
+
+Auxiliary function to shorten Parrot String creation,
+
+=cut
+
+*/
+
+Parrot_String create_string(Parrot_Interp interp, const char *name)
+{
+ return Parrot_new_string(interp, name, strlen(name), (const char *) NULL, 0);
+}
+
+/**********************************************************************/
+
+/*
+
+=item C<int cotorra_main(Parrot_Interp interp, int argc, char **argv)>
+
+Auxiliary function to minimize the size of main.
+
+=cut
+
+*/
+
+int cotorra_main(Parrot_Interp interp, int argc, char **argv)
+{
+ char *source;
+ Parrot_PackFile pf;
+ const char *stname = NULL;
+ const char *exec = NULL;
+ int i;
+
+ /* Incompatible options are not checked yet */
+ for (i = 1; i < argc; ++i) {
+ if (strcmp(argv[i], "--trace") == 0) {
+ ++i;
+ if (i >= argc)
+ fail("Option needs argument");
+ Parrot_set_trace(interp, getuintval(argv[i]));
+ }
+ if (strcmp(argv[i], "--warnings") == 0) {
+ ++i;
+ if (i >= argc)
+ fail("Option needs argument");
+ Parrot_setwarnings(interp, getuintval(argv[i]));
+ }
+ else if (strcmp(argv[i], "-e") == 0) {
+ ++i;
+ if (i >= argc)
+ fail("Option needs argument");
+ exec = argv[i];
+ }
+ else if (strcmp(argv[i], "--start") == 0) {
+ ++i;
+ if (i >= argc)
+ fail("Option needs argument");
+ stname = argv[i];
+ }
+ else if (strcmp(argv[i], "--runcore") == 0) {
+ ++i;
+ if (i >= argc)
+ fail("Option needs argument");
+ Parrot_set_run_core(interp, getruncore(argv[i]));
+ }
+ else
+ break;
+ }
+
+ if (exec) {
+ Parrot_String compiler = create_string(interp, "PIR");
+ Parrot_String errstr;
+ Parrot_PMC code = Parrot_compile_string(interp, compiler, exec, &errstr);
+ void *discard = Parrot_call_sub(interp, code, "v");
+ return 0;
+ }
+
+ if (i >= argc)
+ fail("No file to load");
+ source = argv[i];
+
+ pf = Parrot_pbc_read(interp, source, 0);
+ if (! pf)
+ fail("Cannot load file");
+
+ Parrot_pbc_load(interp, pf);
+ Parrot_pbc_fixup_loaded(interp);
+
+ if (stname) {
+ Parrot_PMC rootns = Parrot_get_root_namespace(interp);
+ Parrot_String parrotname = create_string(interp, "parrot");
+ Parrot_PMC parrotns = Parrot_PMC_get_pmc_strkey(interp, rootns, parrotname);
+ Parrot_String name = create_string(interp, stname);
+ Parrot_PMC start = Parrot_PMC_get_pmc_strkey(interp, parrotns, name);
+ void *discard;
+ discard = Parrot_call_sub(interp, start, "v");
+ }
+ else {
+ Parrot_runcode(interp, argc - i, argv + i);
+ }
+
+ return 0;
+}
+
+/*
+
+=item C<int main(int argc, char **argv)>
+
+Main function. Create the parrot interpreter and call cotorra_main.
+
+=cut
+
+*/
+
+int main(int argc, char **argv)
+{
+ Parrot_Interp interp;
+ int r;
+
+ Parrot_set_config_hash();
+ interp = Parrot_new(NULL);
+ if (! interp)
+ fail("Cannot create parrot interpreter");
+
+ Parrot_set_executable_name(interp, create_string(interp, argv[0]));
+
+ r = cotorra_main(interp, argc, argv);
+
+ Parrot_destroy(interp);
+ return r;
+}
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Deleted: branches/pluggable_runcore/examples/embed/lorito.c
==============================================================================
--- branches/pluggable_runcore/examples/embed/lorito.c Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,184 +0,0 @@
-/*
-Copyright (C) 2009, Parrot Foundation.
-$Id$
-
-A parrot embedding test
-'lorito' is 'little parrot' in spanish
-*/
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "parrot/embed.h"
-#include "parrot/extend.h"
-
-/**********************************************************************/
-
-void fail(const char *msg);
-unsigned int getuintval(const char *s);
-Parrot_Run_core_t getruncore(const char *name);
-
-Parrot_String create_string(Parrot_Interp interp, const char *name);
-int lorito_main(Parrot_Interp interp, int argc, char **argv);
-
-/**********************************************************************/
-
-/* Auxiliary generic functions */
-
-void fail(const char *msg)
-{
- fprintf(stderr, "lorito failed: %s\n", msg);
- exit(EXIT_FAILURE);
-}
-
-unsigned int getuintval(const char *s)
-{
- char *aux;
- unsigned long int n = strtoul(s, &aux, 0);
- if (*aux != '\0')
- fail("Invalid number");
- return n;
-}
-
-struct runcoreinfo {
- Parrot_Run_core_t id;
- const char *name;
-};
-
-Parrot_Run_core_t getruncore(const char *name)
-{
- static const struct runcoreinfo cores [] = {
- { PARROT_SLOW_CORE, "slow" },
- { PARROT_FAST_CORE, "fast" },
- { PARROT_CGOTO_CORE, "cgoto" },
- { PARROT_JIT_CORE, "jit" },
- { PARROT_GC_DEBUG_CORE, "gcdebug" },
- { PARROT_SWITCH_CORE, "switch" }
- };
- static const unsigned int n = sizeof (cores)/sizeof (struct runcoreinfo);
- unsigned int i;
- for (i= 0; i < n; ++i) {
- if (strcmp(name, cores[i].name) == 0)
- break;
- }
- if (i >= n)
- fail("Invalid runcore");
- return cores[i].id;
-}
-
-/**********************************************************************/
-
-/* Auxiliary parrot functions */
-
-Parrot_String create_string(Parrot_Interp interp, const char *name)
-{
- return Parrot_new_string(interp, name, strlen(name), (const char *) NULL, 0);
-}
-
-/**********************************************************************/
-
-int lorito_main(Parrot_Interp interp, int argc, char **argv)
-{
- char *source;
- Parrot_PackFile pf;
- const char *stname = NULL;
- const char *exec = NULL;
- int i;
-
- /* Incompatible options are not checked yet */
- for (i = 1; i < argc; ++i) {
- if (strcmp(argv[i], "--trace") == 0) {
- ++i;
- if (i >= argc)
- fail("Option needs argument");
- Parrot_set_trace(interp, getuintval(argv[i]));
- }
- if (strcmp(argv[i], "--warnings") == 0) {
- ++i;
- if (i >= argc)
- fail("Option needs argument");
- Parrot_setwarnings(interp, getuintval(argv[i]));
- }
- else if (strcmp(argv[i], "-e") == 0) {
- ++i;
- if (i >= argc)
- fail("Option needs argument");
- exec = argv[i];
- }
- else if (strcmp(argv[i], "--start") == 0) {
- ++i;
- if (i >= argc)
- fail("Option needs argument");
- stname = argv[i];
- }
- else if (strcmp(argv[i], "--runcore") == 0) {
- ++i;
- if (i >= argc)
- fail("Option needs argument");
- Parrot_set_run_core(interp, getruncore(argv[i]));
- }
- else
- break;
- }
-
- if (exec) {
- Parrot_String compiler = create_string(interp, "PIR");
- Parrot_String errstr;
- Parrot_PMC code = Parrot_compile_string(interp, compiler, exec, &errstr);
- void *discard = Parrot_call_sub(interp, code, "v");
- return 0;
- }
-
- if (i >= argc)
- fail("No file to load");
- source = argv[i];
-
- pf = Parrot_pbc_read(interp, source, 0);
- if (! pf)
- fail("Cannot load file");
-
- Parrot_pbc_load(interp, pf);
- Parrot_pbc_fixup_loaded(interp);
-
- if (stname) {
- Parrot_PMC rootns = Parrot_get_root_namespace(interp);
- Parrot_String parrotname = create_string(interp, "parrot");
- Parrot_PMC parrotns = Parrot_PMC_get_pmc_strkey(interp, rootns, parrotname);
- Parrot_String name = create_string(interp, stname);
- Parrot_PMC start = Parrot_PMC_get_pmc_strkey(interp, parrotns, name);
- void *discard;
- discard = Parrot_call_sub(interp, start, "v");
- }
- else {
- Parrot_runcode(interp, argc - i, argv + i);
- }
-
- return 0;
-}
-
-int main(int argc, char **argv)
-{
- Parrot_Interp interp;
- int r;
-
- Parrot_set_config_hash();
- interp = Parrot_new(NULL);
- if (! interp)
- fail("Cannot create parrot interpreter");
-
- Parrot_set_executable_name(interp, create_string(interp, argv[0]));
-
- r = lorito_main(interp, argc, argv);
-
- Parrot_destroy(interp);
- return r;
-}
-
-/*
- * Local variables:
- * c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
Modified: branches/pluggable_runcore/examples/japh/japh3.pasm
==============================================================================
--- branches/pluggable_runcore/examples/japh/japh3.pasm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/japh/japh3.pasm Fri Aug 14 01:24:23 2009 (r40541)
@@ -10,11 +10,8 @@
substr S3, 5, 1, S2
substr S3, 13, 1, S1
substr S3, 20, 1, S0
- set I3, 3
- bsr I3
- end
print S3
- ret
+ end
# Local Variables:
# mode: pir
Modified: branches/pluggable_runcore/examples/json/postalcodes.pir
==============================================================================
--- branches/pluggable_runcore/examples/json/postalcodes.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/json/postalcodes.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -78,12 +78,12 @@
unless null $P3 goto bad_code
$P2 = $P2['postalCodes']
- .local pmc iter, code
- iter = new 'Iterator', $P2
+ .local pmc it, code
+ it = iter $P2
code_loop:
push_eh code_end
- code = shift iter
+ code = shift it
pop_eh
unless code goto code_end
Modified: branches/pluggable_runcore/examples/languages/squaak/src/builtins/say.pir
==============================================================================
--- branches/pluggable_runcore/examples/languages/squaak/src/builtins/say.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/languages/squaak/src/builtins/say.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -12,11 +12,11 @@
.sub 'print'
.param pmc args :slurpy
- .local pmc iter
- iter = new 'Iterator', args
+ .local pmc it
+ it = iter args
iter_loop:
- unless iter goto iter_end
- $P0 = shift iter
+ unless it goto iter_end
+ $P0 = shift it
print $P0
goto iter_loop
iter_end:
Copied: branches/pluggable_runcore/examples/opengl/static-triangle-hll.pir (from r40540, trunk/examples/opengl/static-triangle-hll.pir)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/examples/opengl/static-triangle-hll.pir Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/examples/opengl/static-triangle-hll.pir)
@@ -0,0 +1,92 @@
+# Copyright (C) 2006-2009, Parrot Foundation.
+# $Id$
+
+=head1 TITLE
+
+static-triangle-hll.pir - Minimal OpenGL/GLUT setup and render for NCI tests
+
+=head1 SYNOPSIS
+
+ $ cd parrot-home
+ $ ./parrot examples/opengl/static-triangle-hll.pir
+
+=head1 DESCRIPTION
+
+This is a version of F<static-triangle.pir>, to examplify and test usage
+from HLLs.
+
+To quit the example, close the window using your window manager (using
+the X in the corner of the window title bar, for example), since all
+keyboard handling has been removed.
+
+=cut
+
+
+.include 'opengl_defines.pasm'
+
+.HLL 'somelanguage'
+
+.sub main :main
+ .param pmc argv
+
+ # Load OpenGL libary and a helper library for calling glutInit
+ load_bytecode 'OpenGL.pbc'
+ load_bytecode 'NCI/Utils.pbc'
+
+ # Import all OpenGL/GLU/GLUT functions to current namespace
+ # (in this example, the HLL namespace).
+ .local pmc import_gl
+ import_gl = get_root_global ['parrot';'OpenGL'], '_export_all_functions'
+ import_gl()
+
+ # Initialize GLUT
+ .local pmc call_toolkit_init
+ call_toolkit_init = get_root_global ['parrot';'NCI'; 'Utils'], 'call_toolkit_init'
+
+ .const 'Sub' glutInit = 'glutInit'
+ argv = call_toolkit_init(glutInit, argv)
+
+ # Set display mode, create GLUT window, save window handle
+ .local int mode
+ mode = .GLUT_DOUBLE | .GLUT_RGBA
+ glutInitDisplayMode(mode)
+
+ .local pmc window
+ window = new 'Integer'
+ window = glutCreateWindow('Static Triangle NCI Test')
+ set_global 'glut_window', window
+
+ # Set up GLUT callbacks
+ .const 'Sub' draw = 'draw'
+ glutDisplayFunc (draw)
+
+ # Enter the GLUT main loop
+ glutMainLoop()
+.end
+
+.sub draw
+ .local int buffers
+ buffers = .GL_COLOR_BUFFER_BIT | .GL_DEPTH_BUFFER_BIT
+ glClear(buffers)
+
+ glBegin(.GL_TRIANGLES)
+
+ glColor3d(1,0,0)
+ glVertex3f(-1, -1, 0)
+
+ glColor3d(0, 1, 0)
+ glVertex3f(1, -1, 0)
+
+ glColor3d(0, 0, 1)
+ glVertex3f(0, 1, 0)
+
+ glEnd()
+
+ glutSwapBuffers()
+.end
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/examples/pasm/fact.pasm
==============================================================================
--- branches/pluggable_runcore/examples/pasm/fact.pasm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/pasm/fact.pasm Fri Aug 14 01:24:23 2009 (r40541)
@@ -27,6 +27,7 @@
=cut
main:
+ new P10, 'ResizableIntegerArray'
set I1,0
## P9 is used as a stack for temporaries.
new P9, 'ResizableIntegerArray'
@@ -36,7 +37,7 @@
print " is: "
new P0, 'Integer'
set P0,I1
- bsr fact
+ local_branch P10, fact
print P0
print "\n"
inc I1
@@ -52,13 +53,13 @@
push P9,I2
set I2,P0
dec P0
- bsr fact
+ local_branch P10, fact
mul P0,P0,I2
pop I2,P9
- ret
+ local_return P10
is_one:
set P0,1
- ret
+ local_return P10
# Local Variables:
# mode: pir
Modified: branches/pluggable_runcore/examples/past/01-sub.pir
==============================================================================
--- branches/pluggable_runcore/examples/past/01-sub.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/past/01-sub.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -100,11 +100,11 @@
.sub 'say'
.param pmc args :slurpy
if null args goto end
- .local pmc iter
- iter = new 'Iterator', args
+ .local pmc it
+ it = iter args
loop:
- unless iter goto end
- $P0 = shift iter
+ unless it goto end
+ $P0 = shift it
print $P0
goto loop
end:
Modified: branches/pluggable_runcore/examples/past/four_plus_one.pir
==============================================================================
--- branches/pluggable_runcore/examples/past/four_plus_one.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/past/four_plus_one.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -116,11 +116,11 @@
.sub 'say'
.param pmc args :slurpy
if null args goto end
- .local pmc iter
- iter = new 'Iterator', args
+ .local pmc it
+ it = iter args
loop:
- unless iter goto end
- $P0 = shift iter
+ unless it goto end
+ $P0 = shift it
print $P0
goto loop
end:
Modified: branches/pluggable_runcore/examples/pir/life.pir
==============================================================================
--- branches/pluggable_runcore/examples/pir/life.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/pir/life.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -27,6 +27,8 @@
.sub 'life' :main
.param pmc argv
.local int max_generations
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
# First the generation count
$I15 = argv
@@ -78,7 +80,7 @@
concat $S15, $S12
concat $S15, $S13
concat $S15, $S14
- bsr dump
+ local_branch jmpstack, dump
set $I0, 0
loop: ge $I0, $I2, getout
inc $I0
@@ -87,9 +89,9 @@
printerr "."
skip:
- bsr generate
+ local_branch jmpstack, generate
- bsr dump
+ local_branch jmpstack, dump
branch loop
getout: time $N6
sub $N7, $N6, $N5
@@ -246,7 +248,7 @@
$I2 = save_I2
$I1 = save_I1
$I0 = save_I0
- ret
+ local_return jmpstack
# $S15 has the incoming string, $S0 is scratch
dump:
@@ -267,7 +269,7 @@
ge $I11, 0, printloop
sleep 1
dumpend:
- ret
+ local_return jmpstack
.end
Modified: branches/pluggable_runcore/examples/pir/pirric.pir
==============================================================================
--- branches/pluggable_runcore/examples/pir/pirric.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/pir/pirric.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -2452,7 +2452,7 @@
.sub begin :method
.local pmc text
text = getattribute self, 'lines'
- new $P0, 'Iterator', text
+ iter $P0, text
set $P0, .ITERATE_FROM_START
.return($P0)
.end
Modified: branches/pluggable_runcore/examples/pir/quine_ord.pir
==============================================================================
--- branches/pluggable_runcore/examples/pir/quine_ord.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/pir/quine_ord.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -2171,8 +2171,6 @@
push code_as_data, 32
push code_as_data, 105
push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
push code_as_data, 10
push code_as_data, 32
push code_as_data, 32
@@ -2203,26 +2201,13 @@
push code_as_data, 32
push code_as_data, 105
push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
push code_as_data, 32
push code_as_data, 61
push code_as_data, 32
-push code_as_data, 110
-push code_as_data, 101
-push code_as_data, 119
-push code_as_data, 32
-push code_as_data, 39
-push code_as_data, 73
+push code_as_data, 105
push code_as_data, 116
push code_as_data, 101
push code_as_data, 114
-push code_as_data, 97
-push code_as_data, 116
-push code_as_data, 111
-push code_as_data, 114
-push code_as_data, 39
-push code_as_data, 44
push code_as_data, 32
push code_as_data, 100
push code_as_data, 97
@@ -2235,8 +2220,6 @@
push code_as_data, 32
push code_as_data, 105
push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
push code_as_data, 32
push code_as_data, 61
push code_as_data, 32
@@ -2321,8 +2304,6 @@
push code_as_data, 32
push code_as_data, 105
push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
push code_as_data, 32
push code_as_data, 103
push code_as_data, 111
@@ -2395,8 +2376,6 @@
push code_as_data, 32
push code_as_data, 105
push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
push code_as_data, 32
push code_as_data, 32
push code_as_data, 32
@@ -2630,8 +2609,6 @@
push code_as_data, 32
push code_as_data, 105
push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
push code_as_data, 10
push code_as_data, 32
push code_as_data, 32
@@ -2639,26 +2616,13 @@
push code_as_data, 32
push code_as_data, 105
push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
push code_as_data, 32
push code_as_data, 61
push code_as_data, 32
-push code_as_data, 110
-push code_as_data, 101
-push code_as_data, 119
-push code_as_data, 32
-push code_as_data, 39
-push code_as_data, 73
+push code_as_data, 105
push code_as_data, 116
push code_as_data, 101
push code_as_data, 114
-push code_as_data, 97
-push code_as_data, 116
-push code_as_data, 111
-push code_as_data, 114
-push code_as_data, 39
-push code_as_data, 44
push code_as_data, 32
push code_as_data, 100
push code_as_data, 97
@@ -2671,8 +2635,6 @@
push code_as_data, 32
push code_as_data, 105
push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
push code_as_data, 32
push code_as_data, 61
push code_as_data, 32
@@ -2814,8 +2776,6 @@
push code_as_data, 32
push code_as_data, 105
push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
push code_as_data, 32
push code_as_data, 103
push code_as_data, 111
@@ -2888,8 +2848,6 @@
push code_as_data, 32
push code_as_data, 105
push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
push code_as_data, 32
push code_as_data, 32
push code_as_data, 32
@@ -3622,14 +3580,14 @@
.param pmc data
.include "iterator.pasm"
- .local pmc iter
+ .local pmc it
.local int char_int
- iter = new 'Iterator', data
- iter = .ITERATE_FROM_START # reset iterator, begin at start
+ it = iter data
+ it = .ITERATE_FROM_START # reset iterator, begin at start
ITER_LOOP:
- unless iter goto ITER_END # while (entries) ...
- char_int = shift iter # get entry
+ unless it goto ITER_END # while (entries) ...
+ char_int = shift it # get entry
print 'push code_as_data, '
print char_int
print "\n"
@@ -3643,16 +3601,16 @@
.include "iterator.pasm"
- .local pmc iter
- iter = new 'Iterator', data
- iter = .ITERATE_FROM_START # reset iterator, begin at start
+ .local pmc it
+ it = iter data
+ it = .ITERATE_FROM_START # reset iterator, begin at start
.local int char_int
.local string char_string
ITER_LOOP:
- unless iter goto ITER_END # while (entries) ...
- char_int = shift iter # get entry
+ unless it goto ITER_END # while (entries) ...
+ char_int = shift it # get entry
char_string = chr char_int
print char_string
goto ITER_LOOP
Modified: branches/pluggable_runcore/examples/pir/sudoku.pir
==============================================================================
--- branches/pluggable_runcore/examples/pir/sudoku.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/pir/sudoku.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -339,7 +339,7 @@
if name goto sel_name
list_names:
- new it, 'Iterator', b
+ it = iter b
it = .ITERATE_FROM_START
loop:
unless it goto fin
@@ -901,7 +901,7 @@
.sub check_seen
.param pmc seen
.local pmc it
- new it, 'Iterator', seen
+ it = iter seen
it = .ITERATE_FROM_START
loop:
unless it goto ok
Modified: branches/pluggable_runcore/examples/sdl/minesweeper/field.pir
==============================================================================
--- branches/pluggable_runcore/examples/sdl/minesweeper/field.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/sdl/minesweeper/field.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -290,11 +290,11 @@
.local pmc status
getattribute field, self, 'field'
- field = new "Iterator", field
+ field = iter field
field = .ITERATE_FROM_START
cache = getattribute self, 'cache'
- cacheit = new "Iterator", cache
+ cacheit = iter cache
cacheit = .ITERATE_FROM_START
screen = getattribute self, 'screen'
@@ -839,7 +839,7 @@
.local pmc field
field = getattribute self, 'field'
- field = new 'Iterator', field
+ field = iter field
field = .ITERATE_FROM_START
LOOP:
unless field goto WON
@@ -910,7 +910,7 @@
mines_lcd = getattribute self, 'mines_lcd'
size = field
- field = new 'Iterator', field
+ field = iter field
field = .ITERATE_FROM_START
count = new 'ResizablePMCArray'
Modified: branches/pluggable_runcore/examples/shootout/knucleotide.pir
==============================================================================
--- branches/pluggable_runcore/examples/shootout/knucleotide.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/shootout/knucleotide.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -65,13 +65,13 @@
$I0 = elements table
array = $I0
- .local pmc iter
- iter = new 'Iterator', table
- set iter, .ITERATE_FROM_START
+ .local pmc it
+ it = iter table
+ set it, .ITERATE_FROM_START
i = 0
iter_loop_1:
- unless iter goto iter_end_1
- $S0 = shift iter
+ unless it goto iter_end_1
+ $S0 = shift it
$I0 = table[$S0]
$P0 = new 'FixedPMCArray'
$P0 = 2
Modified: branches/pluggable_runcore/examples/shootout/random.pasm
==============================================================================
--- branches/pluggable_runcore/examples/shootout/random.pasm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/shootout/random.pasm Fri Aug 14 01:24:23 2009 (r40541)
@@ -10,6 +10,7 @@
# N2 is the argument for gen_random
# N3 is the return from gen_random
main:
+ new P10, 'ResizableIntegerArray'
get_params "0", P0
elements I0, P0
eq I0, 2, hasargs
@@ -23,7 +24,7 @@
unless I1, ex
set N2, 100.0
while_1:
- bsr gen_random
+ local_branch P10, gen_random
dec I1
if I1, while_1
new P0, 'FixedFloatArray'
@@ -45,7 +46,7 @@
set N1, I0
mul N3, N2, N1
div N3, .IM
- ret
+ local_return P10
# Local Variables:
# mode: pir
Modified: branches/pluggable_runcore/examples/shootout/regexdna.pir
==============================================================================
--- branches/pluggable_runcore/examples/shootout/regexdna.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/shootout/regexdna.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,7 +3,7 @@
.sub main :main
load_bytecode "PGE.pbc"
- .local pmc p6rule_compile, rulesub, match, variants, variants_p5, iub, iter, matches, capt
+ .local pmc p6rule_compile, rulesub, match, variants, variants_p5, iub, it, matches, capt
.local string pattern, chunk, seq, key, replacement
.local int readlen, chunklen, seqlen, finallen, i, varnum, count
p6rule_compile = compreg "PGE::Perl6Regex"
@@ -121,12 +121,12 @@
#####################################################
# Final replace to make the sequence a p5 style regex
.include "iterator.pasm"
- iter = new 'Iterator', iub
- set iter, .ITERATE_FROM_START
+ it = iter iub
+ set it, .ITERATE_FROM_START
matches = new 'ResizablePMCArray'
iter_loop:
- unless iter goto iter_end
- key = shift iter
+ unless it goto iter_end
+ key = shift it
replacement = iub[key]
# Ok, using a regex to match a single fixed character is probably excessive
# But it's what's wanted...
Modified: branches/pluggable_runcore/examples/subs/bsr_ret.pasm
==============================================================================
--- branches/pluggable_runcore/examples/subs/bsr_ret.pasm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/subs/bsr_ret.pasm Fri Aug 14 01:24:23 2009 (r40541)
@@ -20,21 +20,24 @@
=cut
-MAIN: print "Main\n"
- bsr TESTSUB
- print "Main: Return from TestSub\n"
-END: end
+MAIN:
+ new P1, 'ResizableIntegerArray'
+ print "Main\n"
+ local_branch P1, TESTSUB
+ print "Main: Return from TestSub\n"
+END:
+ end
TESTSUB:
- print "TestSub\n"
- bsr NESTSUB
- print "TestSub: Ret from NestSub\n"
- ret
+ print "TestSub\n"
+ local_branch P1, NESTSUB
+ print "TestSub: Ret from NestSub\n"
+ local_return P1
NESTSUB:
- print "NestSub\n"
- ret
+ print "NestSub\n"
+ local_return P1
# Local Variables:
# mode: pir
Deleted: branches/pluggable_runcore/examples/subs/jsr_ret.pasm
==============================================================================
--- branches/pluggable_runcore/examples/subs/jsr_ret.pasm Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,52 +0,0 @@
-# Copyright (C) 2001-2005, Parrot Foundation.
-# This program is free software. It is subject to the same
-# license as Parrot.
-#
-# $Id$
-
-=head1 NAME
-
-examples/subs/jsr_ret.pasm - Jumping to subroutine
-
-=head1 SYNOPSIS
-
- % ./parrot examples/subs/jsr_ret.pasm
-
-=head1 DESCRIPTION
-
-A program to demonstrate the use of the C<jump> and of the C<jsr> opcode.
-
-=head1 SEE ALSO
-
-F<docs/ops/core.pod>
-F<docs/pdds/pdd03_calling_conventions.pod>
-
-=cut
-
-MAIN: print "Example of the jump op.\n"
- print "\n"
- print "Jumping to subroutine SUB_1.\n"
- set_addr I1, SUB_1
- jump I1
-
-RET: print "Returned from subroutine SUB_1.\n"
- print "Jumping to subroutine SUB_2.\n"
- set_addr I3, SUB_2
- jsr I3
- print "Returned from subroutine SUB_2.\n"
- end
-
-SUB_1: print "Entered subroutine SUB_1.\n"
- set_addr I2, RET
- print "Returning from subroutine SUB_1.\n"
- jump I2
-
-SUB_2: print "Entered subroutine SUB_2.\n"
- print "Returning from subroutine SUB_2.\n"
- ret
-
-# Local Variables:
-# mode: pir
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/examples/tutorial/01_temp_var.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/01_temp_var.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/01_temp_var.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,15 +3,15 @@
=head1 Simple Variables
-PIR has two kinds of variables. The most simple kind are Parrot
-registers. Registers are named with a dollar sign followed by a single
-letter type indicator and an integer. The letter in the name corresponds
-to the type of the variable, I for integer, N for number (float), S for
-string, and P for PMC (any kind of object). There are an unlimited
-number of each type of register per call frame, and you can use them
-in any order.
+PIR has two kinds of variables. The most simple kind are
+Parrot register variables. Register variables are named with
+a dollar sign followed by a single letter and an integer.
+The letter corresponds to the type of the variable, I for
+integer, N for number (float), S for string, and P for PMC
+(any kind of object).
-The C<=> symbol can be used to assign a value to one of these registers.
+The C<=> symbol can be used to assign a value to one of
+these register variables.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/02_local_var.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/02_local_var.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/02_local_var.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -4,17 +4,17 @@
=head1 Named Variables
The other kind of variables in PIR are named variables.
-You declare these with the .local directive, followed by
-the type of the variable, followed by the name. The types
-of named variables are the same set as the types of
-temporary variables, int for integer, num for numbers
-(floats), string for strings, and pmc for PMCs (objects).
-
-A simple rule of thumb is to use temporary variables
-for variables that are used on 3 or fewer lines of
-code, and named variables for any longer-lived variables.
-This is just a suggestion, but we think it really helps
-improve code readability.
+You declare these with the .local directive, with the type
+of the variable, followed by the name. The types of named
+variables are the same set as the types of register
+variables, int for integer, num for numbers (floats), string
+for strings, and pmc for PMCs (objects).
+
+A simple rule of thumb is to use register variables for
+variables that are used on 3 or fewer lines of code, and
+named variables for any longer-lived variables. This is
+just a suggestion, but we think it really helps improve code
+readability.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/03_temp_var_basic_pmcs.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/03_temp_var_basic_pmcs.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/03_temp_var_basic_pmcs.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,17 +3,19 @@
=head1 Basic PMC Types
-PMCs are objects, so to use a PMC, you first have to instantiate an object for
-the PMC using the 'new' opcode and the name of the class to instantiate it
-in.
-
-The simple data types have a corresponding PMC type. The Integer type is like
-$I0, the Float type is like $N0, and the String type is like $S0.
-
-Any data type more complex than a simple integer, float, or string (such as an
-array or hash) is also a PMC. Some PMC types are built into Parrot directly.
-Some can be loaded as a dynpmc. Some types are defined as classes in PIR
-code. We'l talk about some of these other types later.
+PMCs are objects, so to use a PMC, you first have to
+instantiate an object for the PMC using the 'new' opcode and
+the name of a class.
+
+The simple data types have a corresponding PMC type. The
+Integer type is like $I0, the Float type is like $N0, and
+the String type is like $S0.
+
+Any data type more complex than a simple integer, float, or
+string (such as an array or hash) is also a PMC. Some PMC
+types are built into Parrot directly. Some can be loaded
+dynamically. Some types are defined as classes in PIR code.
+We'll talk about some of these other types later.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/04_pod_comments.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/04_pod_comments.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/04_pod_comments.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,7 +3,7 @@
=head1 Pod Documentation
-As you may have noticed, PIR files can contain POD documentation.
+As you may have noticed, PIR files can contain Pod documentation.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/10_math_ops.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/10_math_ops.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/10_math_ops.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,13 +3,10 @@
=head1 Math Operations
-Many common math operations have simple operator syntax in PIR. Operators
-like C<+>, C<->, C</> and C<*> are all implemented in PIR, but so are a
-few others: C<<< << >>>, C<<< >> >>>, C<|>, C<&>, C<^> and C<%> are some
-examples.
-
-These math operation symbols are all I<infix operators> and are used the
-way most people would expect.
+Many common math operations have simple operator syntax in
+PIR. Operators like C<+>, C<->, C</> and C<*> are all
+implemented in PIR, but so are a few less common ones such
+as C<<< << >>>, C<<< >> >>>, C<|>, C<&>, C<^> and C<%>.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/13_logical_ops.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/13_logical_ops.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/13_logical_ops.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,14 +3,15 @@
=head1 Logical Operations
-The logical operations are short-circuiting, so if the first argument to an
-'or' is true, the second will never be evaluated because it never needs to
-be. If the first argument to an 'and' operation is false, the other
-arguments are never evaluated either. This is a common logical optimization
-used by compiler designers. PIR only allows variables as arguments to
-operations, so the short-circuiting is only relevant if the argument is a
-PMC that has side-effects on access to the boolean value. We'll talk about
-these side effects later.
+The logical operations are short-circuiting, so if the first
+argument to an 'or' is true, the second will never be
+evaluated. If the first argument to an 'and' operation is
+false, the other arguments are never evaluated either. This
+is a common logical optimization used by compiler designers.
+PIR only allows variables as arguments to operations, so the
+short-circuiting is only relevant if the argument is a PMC
+that has side-effects on access to the boolean value. We'll
+talk about these side effects later.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/20_string_ops.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/20_string_ops.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/20_string_ops.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,11 +3,12 @@
=head1 String Operations
-Some operations aren't mathematical at all. Concatenation is an example
-of this type of operation that joins two strings together to form a
-larger string. Like the other operations we've seen, concatenation also
-has one form that returns the result, and one form that modifies the
-result in place.
+Some operations are specifically for strings. Concatenation
+is an example of this type of operation; it joins two
+strings together to form a larger string. Like the other
+operations we've seen, concatenation also has one form that
+returns the result, and one form that modifies the result in
+place.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/22_string_ops_length.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/22_string_ops_length.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/22_string_ops_length.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -4,8 +4,8 @@
=head1 String Operations (continued)
To find the length of a string in PIR, use the length opcode. It works on
-any register containing a basic Parrot string, but not the String PMC.
-C<length> returns an integer value with 0 being an empty string.
+any variable containing a basic Parrot string, but not the String PMC.
+C<length> returns an integer value, and 0 means an empty string.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/23_string_ops_substr.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/23_string_ops_substr.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/23_string_ops_substr.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -10,7 +10,7 @@
position is left out, C<substr> returns all the characters until the
end of the string.
-An optional fourth argument can be a string that will be used to
+An optional fourth argument is a string that will be used to
replace the characters between the start and end positions.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/30_arrays_basic.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/30_arrays_basic.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/30_arrays_basic.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,15 +3,16 @@
=head1
-PMC registers can contain instances of array or hash data types, or
-more advanced types based on these two. If a PMC type implements the
-array or hash interfaces, they can be accessed using integer or string
-keys.
-
-An array is a type of PMC that contains elements that are indexed by
-number. Array indices must be integer values, not floating point ones.
-Arrays also have a large group of special opcodes that operate on them:
-C<push>, C<pop>, C<shift>, and C<unshift>.
+PMC registers can contain array or hash data types, or more
+advanced types based on these two. If a PMC type implements
+the array or hash interfaces, they can be accessed using
+integer or string keys.
+
+An array is a type of PMC that contains a collection
+elements indexed by number. Array indices must be integer
+values, not floating point ones. Arrays also have a large
+group of special opcodes that operate on them: C<push>,
+C<pop>, C<shift>, and C<unshift>.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/33_hashes.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/33_hashes.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/33_hashes.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,21 +1,21 @@
# Copyright (C) 2007-2009, Parrot Foundation.
# $Id$
-=head1 Hashes
+=head1 Associative Arrays
-Hashes, also known in some places as "dictionaries" or "associative arrays"
-are like array structures except they are indexed by strings instead of
-integers. There are dedicated Hash PMCs, and a number of other PMCs that
-implement the hash interface as well.
-
-Hash PMCs are indexed using C<[ ]> square brackets with a string inside them.
-
-Arrays are typically considered to be homogeneous structures where all
-elements in the array are of the same type. This is why Parrot has types
-like "FixedIntegerArray" and "ResizableStringArray", which only contain
-integers or strings respectively. Hashes are usually treated as being
-heterogeneous, where each bucket in the hash can contain an element of a
-different type.
+Associative arrays, also known in some places as "dictionaries" or
+"hashes" are like ordered arrays except they are indexed by strings
+instead of integers. Parrot has a dedicated Hash PMC, and a number of
+other PMCs that implement the associative array interface as well.
+
+Associative arryas are indexed using C<[ ]> square brackets with a
+string inside them.
+
+Ordered arrays are often homogeneous structures where all elements in
+the array are of the same type. This is why Parrot has types like
+"FixedIntegerArray" and "ResizableStringArray", which only contain
+integers or strings respectively. Associative arrays are often
+heterogeneous, where each element may be a different type.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/34_multikey.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/34_multikey.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/34_multikey.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,14 +3,15 @@
=head1 Multi-Level Keys
-Hashes and arrays can be combined in a number of ways to make interesting
-and complex data structures. A hash bucket may contain an array PMC, which
-in turn can contain other arrays or hashes. In these cases, the keys for
-each level can be combined together to form a single unique key for
-a data element in the structure.
+Hashes and arrays can be combined in a number of ways to
+make interesting and complex data structures. A hash may
+contain an array PMC, which in turn can contain other arrays
+or hashes. In these cases, the keys for each level can be
+combined together to form a single unique key for a data
+element in the structure.
-This technique works equally well for arrays-of-arrays, hashes-of-hashes,
-and combination structures as well.
+This technique works equally well for arrays-of-arrays,
+hashes-of-hashes, and combination structures as well.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/40_file_ops.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/40_file_ops.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/40_file_ops.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,7 +3,7 @@
=head1 File Operations
-This example demonstrates basic file operations. Note the readmode.
+This example demonstrates basic file operations.
=cut
Modified: branches/pluggable_runcore/examples/tutorial/55_iterator.pir
==============================================================================
--- branches/pluggable_runcore/examples/tutorial/55_iterator.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/examples/tutorial/55_iterator.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -17,15 +17,15 @@
=cut
.sub main :main
- .local pmc myarray, iter
+ .local pmc myarray, it
myarray = split " ", "foo bar baz boz"
- iter = new ['Iterator'], myarray
+ it = iter myarray
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
- $P0 = shift iter
+ $P0 = shift it
say $P0
goto iter_loop
Modified: branches/pluggable_runcore/ext/SQLite3/gen_sqlite3.pl
==============================================================================
--- branches/pluggable_runcore/ext/SQLite3/gen_sqlite3.pl Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ext/SQLite3/gen_sqlite3.pl Fri Aug 14 01:24:23 2009 (r40541)
@@ -17,17 +17,17 @@
for (parse_ast($fn).hash().kv) -> $k,$v {
#dump_node($v);
- if ($v.WHAT eq "FuncDecl") {
+ if ($v.WHAT eq "NCIGENAST::FuncDecl()") {
my @result = pir($v);
my $cname = @result[0];
my $signature = @result[1];
my $source = @result[2];
my $suffix_name = @result[0];
- my $suffix_name .= subst( /sqlite3_/, '' );
+ $suffix_name .= subst( /sqlite3_/, '' );
my $pirname = %rename_table{$suffix_name} || $suffix_name;
- say " '_nci_init_symbol_'(lib, '$pirname', '$cname', '$signature') #$source";
+ say " '_nci_init_symbol_'(lib, '$pirname', '$cname', '$signature')";
}
}
print postamble();
Modified: branches/pluggable_runcore/include/parrot/compiler.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/compiler.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/compiler.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -99,6 +99,17 @@
*/
#define UNUSED(a) /*@-noeffect*/if (0) (void)(a)/*@=noeffect*/;
+/* 64-bit CL has some problems, so this section here is going to try to fix them */
+#ifdef PARROT_HAS_MSVC_SAL
+# ifdef _WIN64
+ /* CL64 can't seem to find sal.h, so take that out of the equation */
+# undef PARROT_HAS_MSVC_SAL
+ /* CL64 complains about not finding _iob, so this might fix it */
+
+
+# endif
+#endif
+
#ifdef PARROT_HAS_MSVC_SAL
# include <sal.h>
# define PARROT_CAN_RETURN_NULL /*@null@*/ __maybenull
Modified: branches/pluggable_runcore/include/parrot/debugger.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/debugger.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/debugger.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,9 +1,9 @@
/*
- * Copyright (C) 2002-2008, Parrot Foundation.
+ * Copyright (C) 2002-2009, Parrot Foundation.
*/
/*
- * debug.h
+ * debugger.h
*
* SVN Info
* $Id$
@@ -222,6 +222,10 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*file);
+void PDB_assign(PARROT_INTERP, ARGIN(const char *command))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
void PDB_backtrace(PARROT_INTERP)
__attribute__nonnull__(1);
@@ -377,6 +381,9 @@
#define ASSERT_ARGS_PDB_add_label __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(file) \
|| PARROT_ASSERT_ARG(cur_opcode)
+#define ASSERT_ARGS_PDB_assign __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(command)
#define ASSERT_ARGS_PDB_backtrace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_PDB_break __attribute__unused__ int _ASSERT_ARGS_CHECK = \
Modified: branches/pluggable_runcore/include/parrot/gc_api.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/gc_api.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/gc_api.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -189,6 +189,18 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*buffer);
+PARROT_CANNOT_RETURN_NULL
+void * Parrot_gc_allocate_fixed_size_storage(PARROT_INTERP, size_t size)
+ __attribute__nonnull__(1);
+
+PARROT_CANNOT_RETURN_NULL
+void * Parrot_gc_allocate_pmc_attributes(PARROT_INTERP,
+ ARGMOD(PMC *pmc),
+ size_t size)
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ FUNC_MODIFIES(*pmc);
+
void Parrot_gc_allocate_string_storage(PARROT_INTERP,
ARGOUT(STRING *str),
size_t size)
@@ -233,6 +245,20 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*obj);
+void Parrot_gc_free_fixed_size_storage(PARROT_INTERP,
+ size_t size,
+ ARGMOD(void * data))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(3)
+ FUNC_MODIFIES(* data);
+
+void Parrot_gc_free_pmc_attributes(PARROT_INTERP,
+ ARGMOD(PMC *pmc),
+ size_t item_size)
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ FUNC_MODIFIES(*pmc);
+
void Parrot_gc_free_pmc_ext(PARROT_INTERP, ARGMOD(PMC *p))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
@@ -360,6 +386,13 @@
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(buffer)
+#define ASSERT_ARGS_Parrot_gc_allocate_fixed_size_storage \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_allocate_pmc_attributes \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(pmc)
#define ASSERT_ARGS_Parrot_gc_allocate_string_storage \
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
@@ -391,6 +424,13 @@
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(obj)
+#define ASSERT_ARGS_Parrot_gc_free_fixed_size_storage \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(data)
+#define ASSERT_ARGS_Parrot_gc_free_pmc_attributes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(pmc)
#define ASSERT_ARGS_Parrot_gc_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(p)
@@ -458,12 +498,6 @@
void Parrot_gc_inf_init(PARROT_INTERP);
-
-/* DEPRECATED. pobject_lives is being renamed to Parrot_gc_mark_PObj_alive.
- this macro is provided for compatibility until version 1.4 or later when
- it can be removed per the deprecation policy. See TT #664 for details */
-#define pobject_lives Parrot_gc_mark_PObj_alive
-
/* write barrier */
#if PARROT_GC_MS
# define GC_WRITE_BARRIER(interp, agg, old, _new) do { } while (0)
Modified: branches/pluggable_runcore/include/parrot/global.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/global.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/global.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -26,15 +26,6 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
-PMC * Parrot_find_global_k(PARROT_INTERP,
- ARGIN_NULLOK(PMC *pmc_key),
- ARGIN(STRING *globalname))
- __attribute__nonnull__(1)
- __attribute__nonnull__(3);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
PMC * Parrot_find_global_n(PARROT_INTERP,
ARGIN_NULLOK(PMC *ns),
ARGIN_NULLOK(STRING *globalname))
@@ -78,17 +69,12 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
-PMC * Parrot_get_namespace_autobase(PARROT_INTERP, ARGIN_NULLOK(PMC *key))
- __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
PMC * Parrot_get_namespace_keyed(PARROT_INTERP,
ARGIN(PMC *base_ns),
- ARGIN_NULLOK(PMC *pmc_key))
+ ARGIN(PMC *pmc_key))
__attribute__nonnull__(1)
- __attribute__nonnull__(2);
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3);
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
@@ -110,9 +96,10 @@
PARROT_CAN_RETURN_NULL
PMC * Parrot_make_namespace_keyed(PARROT_INTERP,
ARGIN(PMC *base_ns),
- ARGIN_NULLOK(PMC *pmc_key))
+ ARGIN(PMC *pmc_key))
__attribute__nonnull__(1)
- __attribute__nonnull__(2);
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3);
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
@@ -159,9 +146,6 @@
#define ASSERT_ARGS_Parrot_find_global_cur __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_find_global_k __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(globalname)
#define ASSERT_ARGS_Parrot_find_global_n __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_find_global_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -174,11 +158,10 @@
|| PARROT_ASSERT_ARG(name)
#define ASSERT_ARGS_Parrot_get_global __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_namespace_autobase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_get_namespace_keyed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(base_ns)
+ || PARROT_ASSERT_ARG(base_ns) \
+ || PARROT_ASSERT_ARG(pmc_key)
#define ASSERT_ARGS_Parrot_get_namespace_keyed_str \
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
@@ -188,7 +171,8 @@
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_make_namespace_keyed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(base_ns)
+ || PARROT_ASSERT_ARG(base_ns) \
+ || PARROT_ASSERT_ARG(pmc_key)
#define ASSERT_ARGS_Parrot_make_namespace_keyed_str \
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
Modified: branches/pluggable_runcore/include/parrot/hash.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/hash.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/hash.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -46,6 +46,7 @@
typedef void (*hash_mark_key_fn)(PARROT_INTERP, PObj *);
typedef size_t (*hash_hash_key_fn)(PARROT_INTERP, ARGIN(const void *), size_t seed);
+/* &gen_from_enum(hash_key_type.pasm) */
typedef enum {
Hash_key_type_int,
Hash_key_type_cstring,
@@ -53,6 +54,7 @@
Hash_key_type_PMC,
Hash_key_type_ptr
} Hash_key_type;
+/* &end_gen */
typedef struct _hashbucket {
struct _hashbucket *next;
@@ -128,10 +130,9 @@
PARROT_CAN_RETURN_NULL
HashBucket * parrot_hash_get_bucket(PARROT_INTERP,
ARGIN(const Hash *hash),
- ARGIN(const void *key))
+ ARGIN_NULLOK(const void *key))
__attribute__nonnull__(1)
- __attribute__nonnull__(2)
- __attribute__nonnull__(3);
+ __attribute__nonnull__(2);
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
@@ -149,11 +150,10 @@
PARROT_CANNOT_RETURN_NULL
HashBucket* parrot_hash_put(PARROT_INTERP,
ARGMOD(Hash *hash),
- ARGIN(void *key),
+ ARGIN_NULLOK(void *key),
ARGIN_NULLOK(void *value))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
- __attribute__nonnull__(3)
FUNC_MODIFIES(*hash);
PARROT_EXPORT
@@ -194,12 +194,6 @@
__attribute__nonnull__(1);
PARROT_EXPORT
-void parrot_new_pmc_hash(PARROT_INTERP, ARGOUT(PMC *container))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(*container);
-
-PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
Hash * parrot_new_pointer_hash(PARROT_INTERP)
__attribute__nonnull__(1);
@@ -212,8 +206,9 @@
PARROT_WARN_UNUSED_RESULT
PARROT_PURE_FUNCTION
-size_t key_hash_int(SHIM_INTERP, ARGIN(const void *value), size_t seed)
- __attribute__nonnull__(2);
+size_t key_hash_int(SHIM_INTERP,
+ ARGIN_NULLOK(const void *value),
+ size_t seed);
void parrot_chash_destroy(PARROT_INTERP, ARGMOD(Hash *hash))
__attribute__nonnull__(1)
@@ -261,16 +256,14 @@
|| PARROT_ASSERT_ARG(key)
#define ASSERT_ARGS_parrot_hash_get_bucket __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(hash) \
- || PARROT_ASSERT_ARG(key)
+ || PARROT_ASSERT_ARG(hash)
#define ASSERT_ARGS_parrot_hash_get_idx __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(hash) \
|| PARROT_ASSERT_ARG(key)
#define ASSERT_ARGS_parrot_hash_put __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(hash) \
- || PARROT_ASSERT_ARG(key)
+ || PARROT_ASSERT_ARG(hash)
#define ASSERT_ARGS_parrot_hash_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(hash)
#define ASSERT_ARGS_parrot_hash_visit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -286,14 +279,10 @@
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_parrot_new_intval_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_new_pmc_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(container)
#define ASSERT_ARGS_parrot_new_pointer_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_int_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_key_hash_int __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(value)
+#define ASSERT_ARGS_key_hash_int __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
#define ASSERT_ARGS_parrot_chash_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(hash)
Modified: branches/pluggable_runcore/include/parrot/interpreter.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/interpreter.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/interpreter.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -359,7 +359,7 @@
PDB_t *pdb; /* debug /trace system */
- struct Stack_Chunk *dynamic_env; /* current dynamic environment */
+ PMC * dynamic_env; /* Dynamic environment stack */
void *lo_var_ptr; /* Pointer to memory on runops
* system stack */
Modified: branches/pluggable_runcore/include/parrot/key.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/key.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/key.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -15,30 +15,29 @@
#include "parrot/parrot.h"
+/*
+ Type of Keys.
+ C<KEY_register_FLAG> used for indirect referencing. E.g.
+ $S0 = "foo"
+ $P1 = $P0[$S0]
+ In this case C<[$S0]> will have type C<KEY_string_FLAG | KEY_register_FLAG>
+ and store I<integer> value of string register number.
+*/
typedef enum {
KEY_integer_FLAG = PObj_private0_FLAG,
KEY_number_FLAG = PObj_private1_FLAG,
- KEY_hash_iterator_FLAGS = PObj_private0_FLAG | PObj_private1_FLAG,
KEY_string_FLAG = PObj_private2_FLAG,
KEY_pmc_FLAG = PObj_private3_FLAG,
KEY_register_FLAG = PObj_private4_FLAG,
- KEY_start_slice_FLAG = PObj_private5_FLAG,
- KEY_end_slice_FLAG = PObj_private6_FLAG,
- KEY_inf_slice_FLAG = PObj_private7_FLAG,
-
KEY_type_FLAGS = KEY_integer_FLAG |
KEY_number_FLAG |
KEY_string_FLAG |
KEY_pmc_FLAG |
- KEY_register_FLAG |
- KEY_hash_iterator_FLAGS
+ KEY_register_FLAG
} KEY_flags;
-#define KEY_IS_HASH_ITERATOR(k) \
- ((PObj_get_FLAGS((k)) & KEY_type_FLAGS) == KEY_hash_iterator_FLAGS)
-
/* HEADERIZER BEGIN: src/key.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
Modified: branches/pluggable_runcore/include/parrot/library.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/library.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/library.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -25,6 +25,7 @@
PARROT_RUNTIME_FT_SOURCE = 0x0F00
} enum_runtime_ft;
+/* &gen_from_enum(libpaths.pasm) */
typedef enum {
PARROT_LIB_PATH_INCLUDE, /* .include "foo" */
PARROT_LIB_PATH_LIBRARY, /* load_bytecode "bar" */
@@ -34,6 +35,7 @@
/* must be last: */
PARROT_LIB_PATH_SIZE
} enum_lib_paths;
+/* &end_gen */
/* HEADERIZER BEGIN: src/library.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
Modified: branches/pluggable_runcore/include/parrot/oo.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/oo.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/oo.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -104,9 +104,24 @@
__attribute__nonnull__(1);
PARROT_EXPORT
-PARROT_PURE_FUNCTION
PARROT_CAN_RETURN_NULL
-const char* Parrot_MMD_method_name(SHIM_INTERP, INTVAL idx);
+PARROT_WARN_UNUSED_RESULT
+PMC * Parrot_oo_find_vtable_override(PARROT_INTERP,
+ ARGIN(PMC *classobj),
+ ARGIN(STRING *name))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC * Parrot_oo_find_vtable_override_for_class(PARROT_INTERP,
+ ARGIN(PMC *classobj),
+ ARGIN(STRING *name))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3);
PARROT_EXPORT
PARROT_CAN_RETURN_NULL
@@ -150,24 +165,6 @@
PARROT_CAN_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
-PMC * Parrot_oo_find_vtable_override(PARROT_INTERP,
- ARGIN(PMC *classobj),
- ARGIN(STRING *name))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- __attribute__nonnull__(3);
-
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-PMC * Parrot_oo_find_vtable_override_for_class(PARROT_INTERP,
- ARGIN(PMC *classobj),
- ARGIN(STRING *name))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- __attribute__nonnull__(3);
-
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
PMC * Parrot_oo_get_namespace(SHIM_INTERP, ARGIN(const PMC *classobj))
__attribute__nonnull__(2);
@@ -215,7 +212,16 @@
#define ASSERT_ARGS_Parrot_invalidate_method_cache \
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_MMD_method_name __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+#define ASSERT_ARGS_Parrot_oo_find_vtable_override \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(classobj) \
+ || PARROT_ASSERT_ARG(name)
+#define ASSERT_ARGS_Parrot_oo_find_vtable_override_for_class \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(classobj) \
+ || PARROT_ASSERT_ARG(name)
#define ASSERT_ARGS_Parrot_oo_get_class __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(key)
@@ -236,16 +242,6 @@
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(self) \
|| PARROT_ASSERT_ARG(ns)
-#define ASSERT_ARGS_Parrot_oo_find_vtable_override \
- __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(classobj) \
- || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_Parrot_oo_find_vtable_override_for_class \
- __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(classobj) \
- || PARROT_ASSERT_ARG(name)
#define ASSERT_ARGS_Parrot_oo_get_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(classobj)
#define ASSERT_ARGS_Parrot_oo_new_object_attrs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
Modified: branches/pluggable_runcore/include/parrot/packfile.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/packfile.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/packfile.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -55,7 +55,7 @@
/*
** Parrot_pbc_read() options:
** parrot, pbc_merge, parrot_debugger use 0
-** pbc_dump, pbc_disassemble, pbc_info use 1 to skip the version check
+** pbc_dump, pbc_disassemble use 1 to skip the version check
** pbc_dump -h requires 2
** The rest is for TRACE_PACKFILE debugging with switch -D in pbc_dump
*/
Modified: branches/pluggable_runcore/include/parrot/parrot.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/parrot.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/parrot.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,5 +1,5 @@
/* parrot.h
- * Copyright (C) 2001-2008, Parrot Foundation.
+ * Copyright (C) 2001-2009, Parrot Foundation.
* SVN Info
* $Id$
* Overview:
@@ -136,8 +136,8 @@
A. D. Aug. 6, 2002.
*/
#if PTR_SIZE == INTVAL_SIZE
-# define INTVAL2PTR(any, d) (any)(d)
-# define UINTVAL2PTR(any, d) (any)(d)
+# define INTVAL2PTR(any, d) ((any)(d))
+# define UINTVAL2PTR(any, d) ((any)(d))
#else
# if PTR_SIZE == LONG_SIZE
# define INTVAL2PTR(any, d) ((any)(unsigned long)(d))
@@ -267,7 +267,6 @@
#include "parrot/list.h"
#include "parrot/pmc_freeze.h"
#include "parrot/vtable.h"
-#include "parrot/stacks.h"
#include "parrot/register.h"
#include "parrot/exceptions.h"
#include "parrot/warnings.h"
Modified: branches/pluggable_runcore/include/parrot/pmc.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/pmc.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/pmc.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -85,7 +85,7 @@
PMC * pmc_reuse(PARROT_INTERP,
ARGIN(PMC *pmc),
INTVAL new_type,
- NULLOK(UINTVAL flags))
+ UINTVAL flags)
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -102,6 +102,18 @@
FUNC_MODIFIES(*pmc);
PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+PARROT_IGNORABLE_RESULT
+PMC * pmc_reuse_init(PARROT_INTERP,
+ ARGIN(PMC *pmc),
+ INTVAL new_type,
+ ARGIN(PMC *init),
+ UINTVAL flags)
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(4);
+
+PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
INTVAL pmc_type(PARROT_INTERP, ARGIN_NULLOK(STRING *name))
__attribute__nonnull__(1);
@@ -155,6 +167,10 @@
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pmc) \
|| PARROT_ASSERT_ARG(class_)
+#define ASSERT_ARGS_pmc_reuse_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(pmc) \
+ || PARROT_ASSERT_ARG(init)
#define ASSERT_ARGS_pmc_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_pmc_type_p __attribute__unused__ int _ASSERT_ARGS_CHECK = \
Modified: branches/pluggable_runcore/include/parrot/register.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/register.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/register.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -15,7 +15,6 @@
#include "parrot/string.h"
#include "parrot/compiler.h"
-#include "parrot/stacks.h"
/*
* Macros to make accessing registers more convenient/readable.
@@ -57,7 +56,6 @@
#define REG_OFFS_STR(x) (sizeof (STRING*) * (x) + _SIZEOF_INTS + _SIZEOF_PMCS)
-struct Stack_Chunk;
typedef struct Parrot_Context Parrot_Context; /* parrot/interpreter.h */
/* HEADERIZER BEGIN: src/gc/alloc_register.c */
Deleted: branches/pluggable_runcore/include/parrot/stacks.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/stacks.h Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,223 +0,0 @@
-/* stacks.h
- * Copyright (C) 2001-2008, Parrot Foundation.
- * SVN Info
- * $Id$
- * Overview:
- * Stack handling routines for Parrot
- * Data Structure and Algorithms:
- * History:
- * Notes:
- * References: See also enums.h
- */
-
-#ifndef PARROT_STACKS_H_GUARD
-#define PARROT_STACKS_H_GUARD
-
-#include "parrot/parrot.h"
-#include "parrot/compiler.h"
-
-#define STACK_CHUNK_LIMIT 100000
-
-typedef struct Stack_Entry {
- UnionVal entry;
- Stack_entry_type entry_type;
- void (*cleanup)(PARROT_INTERP, ARGIN(struct Stack_Entry *));
-} Stack_Entry_t;
-
-typedef struct Stack_Chunk {
- UnionVal cache;
- Parrot_UInt flags;
- const char *name;
- struct Stack_Chunk *prev;
- Parrot_UInt refcount;
- Stack_Entry_t data;
-} Stack_Chunk_t;
-
-#define STACK_DATAP(chunk) &((chunk)->data)
-/* #define STACK_ITEMSIZE(chunk) PObj_buflen(chunk) */
-
-
-typedef void (*Stack_cleanup_method)(PARROT_INTERP, ARGIN(struct Stack_Entry *));
-
-#define STACK_CLEANUP_NULL ((Stack_cleanup_method)NULLfunc)
-
-/* HEADERIZER BEGIN: src/stacks.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Chunk_t * cst_new_stack_chunk(PARROT_INTERP,
- ARGIN(const Stack_Chunk_t *chunk))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_EXPORT
-void mark_stack(PARROT_INTERP, ARGMOD(Stack_Chunk_t *chunk))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(*chunk);
-
-PARROT_EXPORT
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Stack_Chunk_t * new_stack(PARROT_INTERP, ARGIN(const char *name))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_EXPORT
-void Parrot_dump_dynamic_environment(PARROT_INTERP,
- ARGIN(Stack_Chunk_t *dynamic_env))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_EXPORT
-void Parrot_pop_mark(PARROT_INTERP, INTVAL mark)
- __attribute__nonnull__(1);
-
-PARROT_EXPORT
-void Parrot_push_action(PARROT_INTERP, ARGIN(PMC *sub))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_EXPORT
-void Parrot_push_mark(PARROT_INTERP, INTVAL mark)
- __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-void * pop_dest(PARROT_INTERP)
- __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Stack_Entry_t * stack_entry(SHIM_INTERP,
- ARGIN(Stack_Chunk_t *stack),
- INTVAL depth)
- __attribute__nonnull__(2);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-size_t stack_height(SHIM_INTERP, ARGIN(const Stack_Chunk_t *chunk))
- __attribute__nonnull__(2);
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-void * stack_peek(PARROT_INTERP,
- ARGIN(Stack_Chunk_t *stack_base),
- ARGMOD_NULLOK(Stack_entry_type *type))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(*type);
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-void * stack_pop(PARROT_INTERP,
- ARGMOD(Stack_Chunk_t **stack_p),
- ARGOUT_NULLOK(void *where),
- Stack_entry_type type)
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(*stack_p)
- FUNC_MODIFIES(*where);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Entry_t* stack_prepare_pop(PARROT_INTERP,
- ARGMOD(Stack_Chunk_t **stack_p))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(*stack_p);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Entry_t* stack_prepare_push(PARROT_INTERP,
- ARGMOD(Stack_Chunk_t **stack_p))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(*stack_p);
-
-PARROT_EXPORT
-void stack_push(PARROT_INTERP,
- ARGMOD(Stack_Chunk_t **stack_p),
- ARGIN(void *thing),
- Stack_entry_type type,
- NULLOK(Stack_cleanup_method cleanup))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- __attribute__nonnull__(3)
- FUNC_MODIFIES(*stack_p);
-
-PARROT_EXPORT
-void stack_system_init(SHIM_INTERP);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_PURE_FUNCTION
-Stack_entry_type get_entry_type(ARGIN(const Stack_Entry_t *entry))
- __attribute__nonnull__(1);
-
-#define ASSERT_ARGS_cst_new_stack_chunk __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(chunk)
-#define ASSERT_ARGS_mark_stack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(chunk)
-#define ASSERT_ARGS_new_stack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_Parrot_dump_dynamic_environment \
- __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(dynamic_env)
-#define ASSERT_ARGS_Parrot_pop_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_push_action __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(sub)
-#define ASSERT_ARGS_Parrot_push_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pop_dest __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_stack_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(stack)
-#define ASSERT_ARGS_stack_height __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(chunk)
-#define ASSERT_ARGS_stack_peek __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(stack_base)
-#define ASSERT_ARGS_stack_pop __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(stack_p)
-#define ASSERT_ARGS_stack_prepare_pop __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(stack_p)
-#define ASSERT_ARGS_stack_prepare_push __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(stack_p)
-#define ASSERT_ARGS_stack_push __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(stack_p) \
- || PARROT_ASSERT_ARG(thing)
-#define ASSERT_ARGS_stack_system_init __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_get_entry_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(entry)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-/* HEADERIZER END: src/stacks.c */
-
-#define ERROR_STACK_EMPTY 1
-#define ERROR_STACK_SHALLOW 1
-#define ERROR_BAD_STACK_TYPE 1
-
-#endif /* PARROT_STACKS_H_GUARD */
-
-/*
- * Local variables:
- * c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
Modified: branches/pluggable_runcore/include/parrot/string_funcs.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/string_funcs.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/string_funcs.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -540,10 +540,6 @@
char * string_to_cstring_nullable(SHIM_INTERP,
ARGIN_NULLOK(const STRING *s));
-void Parrot_str_free(PARROT_INTERP, ARGIN(STRING *s))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
STRING * Parrot_str_from_int_base(PARROT_INTERP,
@@ -734,9 +730,6 @@
|| PARROT_ASSERT_ARG(b) \
|| PARROT_ASSERT_ARG(e)
#define ASSERT_ARGS_string_to_cstring_nullable __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_str_free __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(s)
#define ASSERT_ARGS_Parrot_str_from_int_base __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(tc)
Modified: branches/pluggable_runcore/include/parrot/string_primitives.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/string_primitives.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/string_primitives.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -25,12 +25,6 @@
PARROT_EXPORT
PARROT_MALLOC
PARROT_CANNOT_RETURN_NULL
-char * str_dup(ARGIN(const char *old))
- __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
char * str_dup_remove_quotes(ARGIN(const char *old))
__attribute__nonnull__(1);
@@ -50,8 +44,6 @@
FUNC_MODIFIES(*string);
#define ASSERT_ARGS_Parrot_char_digit_value __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_str_dup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(old)
#define ASSERT_ARGS_str_dup_remove_quotes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(old)
#define ASSERT_ARGS_string_set_data_directory __attribute__unused__ int _ASSERT_ARGS_CHECK = \
Modified: branches/pluggable_runcore/include/parrot/sub.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/sub.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/include/parrot/sub.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -214,7 +214,6 @@
PackFile_ByteCode *caller_seg; /* bytecode segment */
opcode_t *address; /* next address to run - toggled each time */
- struct Stack_Chunk *dynamic_state; /* next dynamic state */
} Parrot_coro;
typedef struct Parrot_cont {
@@ -222,7 +221,6 @@
PackFile_ByteCode *seg; /* bytecode segment */
opcode_t *address; /* start of bytecode, addr to continue */
struct Parrot_Context *to_ctx; /* pointer to dest context */
- struct Stack_Chunk *dynamic_state; /* dest dynamic state */
/* a Continuation keeps the from_ctx alive */
struct Parrot_Context *from_ctx; /* sub, this cont is returning from */
opcode_t *current_results; /* ptr into code with get_results opcode
@@ -303,11 +301,6 @@
void mark_context_start(void);
PARROT_MALLOC
PARROT_CANNOT_RETURN_NULL
-Parrot_sub * new_closure(PARROT_INTERP)
- __attribute__nonnull__(1);
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
Parrot_cont * new_continuation(PARROT_INTERP,
ARGIN_NULLOK(const Parrot_cont *to))
__attribute__nonnull__(1);
@@ -379,8 +372,6 @@
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(ctx)
#define ASSERT_ARGS_mark_context_start __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_new_closure __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_new_continuation __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_new_coroutine __attribute__unused__ int _ASSERT_ARGS_CHECK = \
Modified: branches/pluggable_runcore/lib/Parrot/Configure/Options/Conf.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Configure/Options/Conf.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Configure/Options/Conf.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -94,8 +94,6 @@
--cgoto=0 Don't build cgoto core - recommended when short of mem
--jitcapable Use JIT
--execcapable Use JIT to emit a native executable
- --gc=(type) Determine the type of garbage collection
- type=(gc|libc|malloc|malloc-trace) default is gc
--without-threads Build parrot without thread support
External Library Options:
Modified: branches/pluggable_runcore/lib/Parrot/Configure/Options/Conf/Shared.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Configure/Options/Conf/Shared.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Configure/Options/Conf/Shared.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -18,6 +18,8 @@
cgoto
configure_trace
cxx
+ darwin_no_fink
+ darwin_no_macports
datadir
debugging
define
@@ -27,7 +29,6 @@
fatal
fatal-step
floatval
- gc
help
icu-config
icuheaders
Modified: branches/pluggable_runcore/lib/Parrot/Configure/Step/List.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Configure/Step/List.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Configure/Step/List.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -20,8 +20,6 @@
auto::gcc
auto::glibc
auto::backtrace
- auto::fink
- auto::macports
auto::msvc
auto::attributes
auto::warnings
Modified: branches/pluggable_runcore/lib/Parrot/Configure/Step/Methods.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Configure/Step/Methods.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Configure/Step/Methods.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -27,72 +27,6 @@
=head1 METHODS
-=head2 C<_handle_darwin_for_fink()>
-
- $self->_handle_darwin_for_fink($conf, $libs, $osname, $file);
-
-Currently used in configuration step classes auto::gmp, auto::readline and
-auto::gdbm.
-
-Modifies settings for C<linkflags>, C<ldflags> and C<ccflags> in the
-Parrot::Configure object's data structure.
-
-=cut
-
-sub _handle_darwin_for_fink {
- my ($self, $conf, $osname, $file) = @_;
- if ( $osname =~ /darwin/ ) {
- my $fink_lib_dir = $conf->data->get('fink_lib_dir');
- my $fink_include_dir = $conf->data->get('fink_include_dir');
- if ( (defined $fink_lib_dir) && (defined $fink_include_dir) ) {
- if ( -f "$fink_include_dir/$file" ) {
- my %intended = (
- linkflags => "-L$fink_lib_dir",
- ldflags => "-L$fink_lib_dir",
- ccflags => "-I$fink_include_dir",
- );
- _add_flags_not_yet_seen($conf, \%intended);
- }
- }
- }
- return 1;
-}
-
-=head2 C<_handle_darwin_for_macports()>
-
- $self->_handle_darwin_for_macports($conf, $libs, $osname, $file);
-
-Currently used in configuration step classes auto::gmp, auto::readline and
-auto::opengl.
-
-Modifies settings for C<linkflags>, C<ldflags> and C<ccflags> in the
-Parrot::Configure object's data structure.
-
-Potentially expandable to cover all BSD-ports systems -- but as yet there has
-been no demand.
-
-=cut
-
-sub _handle_darwin_for_macports {
- my ($self, $conf, $osname, $file) = @_;
- if ( $osname =~ /darwin/ ) {
-# my $ports_root = $conf->data->get( 'ports_base_dir' );
- my $ports_lib_dir = $conf->data->get( 'ports_lib_dir' );
- my $ports_include_dir = $conf->data->get( 'ports_include_dir' );
- if ( defined $ports_lib_dir && defined $ports_include_dir ) {
- if ( -f qq{$ports_include_dir/$file} ) {
- my %intended = (
- linkflags => "-L$ports_lib_dir",
- ldflags => "-L$ports_lib_dir",
- ccflags => "-I$ports_include_dir",
- );
- _add_flags_not_yet_seen($conf, \%intended);
- }
- }
- }
- return 1;
-}
-
=head2 C<_select_lib()>
$self->_select_lib( {
@@ -201,18 +135,6 @@
return $libs;
}
-sub _add_flags_not_yet_seen {
- my ($conf, $intended) = @_;
- foreach my $flag (keys %{ $intended }) {
- my $flagstr = $conf->data->get($flag);
- my @elements = split /\s+/, $flagstr;
- my %seen = map {$_, 1} @elements;
- $conf->data->add( ' ', $flag => $intended->{$flag} )
- unless $seen{$intended->{$flag}};
- }
-}
-
-
=head1 SEE ALSO
Parrot::Configure::Step.
Modified: branches/pluggable_runcore/lib/Parrot/Docs/Section/Parrot.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Docs/Section/Parrot.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Docs/Section/Parrot.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -60,7 +60,7 @@
'Introduction',
'',
$self->new_item( 'Introduction to Parrot', 'docs/intro.pod'),
- $self->new_item( 'Getting Started', 'docs/book/draft/ch02_getting_started.pod'),
+ $self->new_item( 'Getting Started', 'docs/book/pct/ch02_getting_started.pod'),
$self->new_item( 'Navigating the Docs', 'docs/parrot.pod'),
$self->new_item( 'Roles & Responsibilities', 'docs/project/roles_responsibilities.pod'),
$self->new_item( 'Release History', 'docs/parrothist.pod'),
@@ -80,9 +80,9 @@
$self->new_group(
'Implementing Languages on Parrot',
'',
- $self->new_item( 'Parrot Compiler Tools', 'docs/book/draft/ch04_compiler_tools.pod'),
- $self->new_item( 'Parrot Grammar Engine', 'docs/book/draft/ch05_pge.pod'),
- $self->new_item( 'Not Quite Perl', 'docs/book/draft/ch06_nqp.pod'),
+ $self->new_item( 'Parrot Compiler Tools', 'docs/book/pct/ch03_compiler_tools.pod'),
+ $self->new_item( 'Parrot Grammar Engine', 'docs/book/pct/ch04_pge.pod'),
+ $self->new_item( 'Not Quite Perl', 'docs/book/pct/ch05_nqp.pod'),
$self->new_item( 'Compiler FAQ', 'docs/compiler_faq.pod'),
),
$self->new_group(
@@ -96,29 +96,9 @@
Parrot::Docs::Section::Tools->new,
$self->new_item( 'Syntax Highlighting for Vim & Emacs', 'editor/README.pod'),
),
- $self->new_group(
- 'Book draft',
- '',
- $self->new_item( 'Chapter 1 Introduction', 'docs/book/draft/ch01_introduction.pod'),
- $self->new_item( 'Chapter 2 Getting Started', 'docs/book/draft/ch02_getting_started.pod'),
- $self->new_item( 'Chapter 3 Parrot Intermediate Representation', 'docs/book/draft/ch03_pir.pod'),
- $self->new_item( 'Chapter 4 Parrot Compiler Tools', 'docs/book/draft/ch04_compiler_tools.pod'),
- $self->new_item( 'Chapter 5 Parrot Grammar Engine', 'docs/book/draft/ch05_pge.pod'),
- $self->new_item( 'Chapter 6 Not Quite Perl', 'docs/book/draft/ch06_nqp.pod'),
- $self->new_item( 'Chapter 7 Dynamic C-level Objects', 'docs/book/draft/ch07_dynpmcs.pod'),
- $self->new_item( 'Chapter 8 Dynamic Opcodes', 'docs/book/draft/ch08_dynops.pod'),
- $self->new_item( 'Chapter 10 Instruction Reference', 'docs/book/draft/ch10_opcode_reference.pod'),
- $self->new_item( 'Chapter 11 Directive Reference', 'docs/book/draft/ch11_directive_reference.pod'),
- $self->new_item( 'Chapter 12 PIR Operator Reference', 'docs/book/draft/ch12_operator_reference.pod'),
- $self->new_item( 'Appendix A Glossary', 'docs/book/draft/appa_glossary.pod'),
- $self->new_item( 'Appendix B Patch Submission', 'docs/book/draft/appb_patch_submission.pod'),
- $self->new_item( 'Appendix C ', 'docs/book/draft/appc_command_line_options.pod'),
- $self->new_item( 'Appendix D ', 'docs/book/draft/appd_build_options.pod'),
- $self->new_item( 'Appendix E ', 'docs/book/draft/appe_source_code.pod'),
- ),
$self->new_group(
- 'Book PIR',
+ 'PIR Book',
'',
$self->new_item( 'Chapter 1 Introduction', 'docs/book/pir/ch01_introduction.pod'),
$self->new_item( 'Chapter 2 Getting Started', 'docs/book/pir/ch02_getting_started.pod'),
@@ -131,6 +111,16 @@
$self->new_item( 'Chapter 9 Exceptions', 'docs/book/pir/ch09_exceptions.pod'),
),
+ $self->new_group(
+ 'PCT Book',
+ '',
+ $self->new_item( 'Chapter 1 Introduction', 'docs/book/pct/ch01_introduction.pod'),
+ $self->new_item( 'Chapter 2 Getting Started', 'docs/book/pct/ch02_getting_started.pod'),
+ $self->new_item( 'Chapter 3 Compiler Tools', 'docs/book/pct/ch03_compiler_tools.pod'),
+ $self->new_item( 'Chapter 4 Grammar Engine', 'docs/book/pct/ch04_pge.pod'),
+ $self->new_item( 'Chapter 5 Grammar Actions', 'docs/book/pct/ch05_nqp.pod'),
+ ),
+
# Parrot::Docs::Section::C->new,
# Parrot::Docs::Section::IMCC->new,
# Parrot::Docs::Section::Perl->new,
Modified: branches/pluggable_runcore/lib/Parrot/Harness/DefaultTests.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Harness/DefaultTests.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Harness/DefaultTests.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -10,10 +10,11 @@
This file exports by default a single subroutine, C<get_default_tests()>,
which is the list of tests run by F<t/harness> by default.
-Upon request, this package exports five arrays holding various sets of tests:
+Upon request, this package exports six arrays holding various sets of tests:
@runcore_tests
@core_tests
+ @library_tests
@configure_tests
@standard_tests
@developing_tests
@@ -31,6 +32,7 @@
our (
@runcore_tests,
@core_tests,
+ @library_tests,
@configure_tests,
@standard_tests,
@developing_tests
@@ -40,6 +42,7 @@
our @EXPORT_OK = qw(
@runcore_tests
@core_tests
+ @library_tests
@configure_tests
@standard_tests
@developing_tests
@@ -54,12 +57,6 @@
t/native_pbc/*.t
t/dynpmc/*.t
t/dynoplibs/*.t
- t/compilers/pct/*.t
- t/compilers/pge/*.t
- t/compilers/pge/p5regex/*.t
- t/compilers/pge/perl6regex/*.t
- t/compilers/tge/*.t
- t/library/*.t
);
# core tests are run unless --runcore-tests is present. Typically
@@ -67,9 +64,18 @@
@core_tests = qw(
t/run/*.t
t/src/*.t
- t/tools/*.t
t/perl/*.t
- t/stm/*.t
+);
+
+# library tests are run unless --runcore-tests or --core-tests is present.
+ at library_tests = qw(
+ t/compilers/pct/*.t
+ t/compilers/pge/*.t
+ t/compilers/pge/p5regex/*.t
+ t/compilers/pge/perl6regex/*.t
+ t/compilers/tge/*.t
+ t/library/*.t
+ t/tools/*.t
);
# configure tests are tests to be run at the beginning of 'make test';
@@ -107,6 +113,7 @@
unless ($runcore_tests_only) {
push @default_tests, @core_tests;
unless ($core_tests_only) {
+ push @default_tests, @library_tests;
unshift @default_tests, @configure_tests;
}
}
Modified: branches/pluggable_runcore/lib/Parrot/Harness/Smoke.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Harness/Smoke.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Harness/Smoke.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -169,7 +169,7 @@
$devel .= (" ". at mods." mods");
}
my $info = `svn info .`;
- ($branch) = $info =~ m{URL: .+/parrot/(\w+)$}m;
+ ($branch) = $info =~ m{URL: .+/parrot/(?:branches/)?(\w+)$}m;
}
my $me = $^O eq 'MSWin32' ? $ENV{'USERNAME'}
: $ENV{'LOGNAME'} || eval { getpwuid($<) };
Modified: branches/pluggable_runcore/lib/Parrot/Op.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Op.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Op.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -329,8 +329,6 @@
s/{{=0,\+=([^{]*?)}}/ $trans->restart_offset($1) . "; {{=0}}"; /me;
s/{{=0,-=([^{]*?)}}/ $trans->restart_offset(-$1) . "; {{=0}}"; /me;
- s/{{=\*}}/ $trans->goto_pop(); /me;
-
s/{{\+=([^{]*?)}}/ $trans->goto_offset($1); /me;
s/{{-=([^{]*?)}}/ $trans->goto_offset(-$1); /me;
s/{{=([^*][^{]*?)}}/ $trans->goto_address($1); /me;
Modified: branches/pluggable_runcore/lib/Parrot/OpTrans.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/OpTrans.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/OpTrans.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -220,19 +220,6 @@
return $self->gen_goto( $self->expr_offset(@_) );
}
-=item C<goto_pop()>
-
-Transforms the C<goto POP($address)> macro in an ops file into the
-relevant C code.
-
-=cut
-
-sub goto_pop {
- my ($self) = @_;
-
- return $self->gen_goto( $self->expr_pop(@_) );
-}
-
=item C<expr_offset($offset)>
Implemented in subclasses to return the C code for C<OFFSET($offset)>.
Modified: branches/pluggable_runcore/lib/Parrot/OpTrans/C.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/OpTrans/C.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/OpTrans/C.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -100,18 +100,6 @@
return "cur_opcode + $offset";
}
-=item C<expr_pop()>
-
-Returns the C code for C<POP()>. Called by C<goto_offset()>.
-
-=cut
-
-sub expr_pop {
- my ($self) = @_;
-
- return "pop_dest(interp)";
-}
-
our %arg_maps = (
'op' => "cur_opcode[%ld]",
Modified: branches/pluggable_runcore/lib/Parrot/OpTrans/CGP.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/OpTrans/CGP.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/OpTrans/CGP.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -111,20 +111,6 @@
. "goto **(void **)(cur_opcode += $offset);\n} while (1)";
}
-=item C<goto_pop()>
-
-Transforms the C<goto POP()> macro in an ops file into the relevant C
-code.
-
-=cut
-
-sub goto_pop {
- my ($self) = @_;
-
- return "goto **(void **)(cur_opcode = opcode_to_prederef(interp,
- (opcode_t*)pop_dest(interp)))";
-}
-
sub run_core_func_start {
my $type = __PACKAGE__;
return <<END_C;
Modified: branches/pluggable_runcore/lib/Parrot/OpTrans/CGoto.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/OpTrans/CGoto.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/OpTrans/CGoto.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -174,20 +174,6 @@
return "goto *ops_addr[*(cur_opcode += $offset)]";
}
-=item C<goto_pop()>
-
-Transforms the C<goto POP()> macro in an ops file into the relevant C
-code.
-
-=cut
-
-sub goto_pop {
- my ($self) = @_;
-
- return
-"opcode_t* pop_addr = (opcode_t*)pop_dest(interp);\ncur_opcode = pop_addr;goto *ops_addr[*(pop_addr)]";
-}
-
my %arg_maps = (
'op' => "cur_opcode[%ld]",
Modified: branches/pluggable_runcore/lib/Parrot/OpTrans/CSwitch.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/OpTrans/CSwitch.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/OpTrans/CSwitch.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -117,20 +117,6 @@
return "{ cur_opcode += $offset; goto SWITCH_AGAIN; }";
}
-=item C<goto_pop()>
-
-Transforms the C<goto POP()> macro in an ops file into the relevant C
-code.
-
-=cut
-
-sub goto_pop {
- my ($self) = @_;
- return "{ opcode_t *dest = (opcode_t*)pop_dest(interp);
- cur_opcode = opcode_to_prederef(interp, dest);
- goto SWITCH_AGAIN; }";
-}
-
=item C<init_func_init1($base)>
Returns the C code for the init function.
Modified: branches/pluggable_runcore/lib/Parrot/OpsFile.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/OpsFile.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/OpsFile.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -114,10 +114,6 @@
Transforms to C<PC' = X>. This is used for absolute jumps.
-=item C<goto POP()>
-
-Transforms to C<< PC' = <pop> >>. Pops the address off control stack.
-
=item C<expr OFFSET(X)>
Transforms to C<PC + X>. This is used to give a relative address.
@@ -239,6 +235,8 @@
open my $OPS, '<', $file or die "Can't open $file, $!/$^E";
+ $self->version( $PConfig{VERSION} );
+
if ( !( $file =~ s/\.ops$/.c/ ) ) {
$file .= ".c";
}
@@ -257,37 +255,25 @@
my @argdirs;
my $seen_pod;
my $seen_op;
+ my $in_preamble;
my $line;
my $flags;
my @labels;
while (<$OPS>) {
- $seen_pod = 1 if m|^=|;
+ $seen_pod = 1 if m|^=|;
+ $in_preamble = 1 if s|^BEGIN_OPS_PREAMBLE||;
unless ( $seen_op or m|^(inline\s+)?op\s+| ) {
- if (m/^\s*VERSION\s*=\s*"(\d+\.\d+\.\d+)"\s*;\s*$/)
- {
- if ( exists $self->{VERSION} ) {
- #die "VERSION MULTIPLY DEFINED!";
- }
-
- $self->version($1);
+ if (m|^END_OPS_PREAMBLE|) {
$_ = '';
+ $in_preamble = 0;
}
- elsif (m/^\s*VERSION\s*=\s*PARROT_VERSION\s*;\s*$/) {
- if ( exists $self->{VERSION} ) {
-
- #die "VERSION MULTIPLY DEFINED!";
- }
-
- $self->version( $PConfig{VERSION} );
- $_ = '';
+ elsif ($in_preamble) {
+ $self->{PREAMBLE} .= $_;
}
- $self->{PREAMBLE} .= $_
- unless $seen_pod or $count; # Lines up to first op def.
-
next;
}
@@ -510,7 +496,6 @@
# goto OFFSET(X) {{+=X}} PC' = PC + X Used for branches
# goto NEXT() {{+=S}} PC' = PC + S Where S is op size
# goto ADDRESS(X) {{=X}} PC' = X Used for absolute jumps
- # goto POP() {{=*}} PC' = <pop> Pop address off control stack
# expr OFFSET(X) {{^+X}} PC + X Relative address
# expr NEXT() {{^+S}} PC + S Where S is op size
# expr ADDRESS(X) {{^X}} X Absolute address
@@ -546,9 +531,6 @@
$branch ||= $body =~ s/\bgoto\s+OFFSET\((.*?)\)/{{+=$1}}/mg;
$body =~ s/\bexpr\s+OFFSET\((.*?)\)/{{^+$1}}/mg;
- $pop ||= $body =~ s/\bgoto\s+POP\(\)/{{=*}}/mg;
- $body =~ s/\bexpr\s+POP\(\)/{{^*}}/mg;
-
$next ||= $short_name =~ /runinterp/;
$next ||= $body =~ s/\bexpr\s+NEXT\(\)/{{^+$op_size}}/mg;
$body =~ s/\bgoto\s+NEXT\(\)/{{+=$op_size}}/mg;
@@ -564,9 +546,6 @@
$restart = 1;
$next = 1;
}
- elsif ( $short_name eq 'branch_cs' || $short_name eq 'returncc' ) {
- $restart = 1; # dest may be NULL to leave run-loop
- }
elsif ( $body =~ s/\brestart\s+ADDRESS\((.*?)\)/{{=$1}}/mg ) {
$next = 0;
$restart = 1;
@@ -589,7 +568,6 @@
# Constants here are defined in include/parrot/op.h
or_flag( \$jumps, "PARROT_JUMP_ADDRESS" ) if $absolute;
or_flag( \$jumps, "PARROT_JUMP_RELATIVE" ) if $branch;
- or_flag( \$jumps, "PARROT_JUMP_POP" ) if $pop;
or_flag( \$jumps, "PARROT_JUMP_ENEXT" ) if $next;
or_flag( \$jumps, "PARROT_JUMP_RESTART" ) if $restart;
@@ -685,7 +663,6 @@
#s/goto\s+NEXT\(\)/{{+=$op_size}}/mg; #not supported--dependent on op size
s/goto\s+ADDRESS\((.*)\)/{{=$1}}/mg;
- s/goto\s+POP\(\)/{{=*}}/mg;
s/HALT\(\)/{{=0}}/mg;
# RT#43721: This ought to throw errors when attempting to rewrite $n
Modified: branches/pluggable_runcore/lib/Parrot/Pmc2c/Method.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Pmc2c/Method.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Pmc2c/Method.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -104,8 +104,8 @@
return $1 if $char =~ /([ISP])/;
return 'N' if $char eq 'F';
- return 'v' if $type eq 'void';
return 'V' if $type =~ /void\s*\*/;
+ return 'v' if $type =~ /void\s*$/;
return 'P' if $type =~ /opcode_t\*/;
return 'I' if $type =~ /int(val)?/i;
return '?';
Modified: branches/pluggable_runcore/lib/Parrot/Pmc2c/MethodEmitter.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Pmc2c/MethodEmitter.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Pmc2c/MethodEmitter.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -189,7 +189,7 @@
# Rewrite SELF.other_method(args...)
$body->subst(
qr{
- \bSELF\b # Macro: SELF
+ \bSELF\b # Macro: SELF
\.(\w+) # other_method
\(\s*(.*?)\) # capture argument list
}x,
@@ -199,7 +199,7 @@
# Rewrite STATICSELF.other_method(args...)
$body->subst(
qr{
- \bSTATICSELF\b # Macro STATICSELF
+ \bSTATICSELF\b # Macro STATICSELF
\.(\w+) # other_method
\(\s*(.*?)\) # capture argument list
}x,
@@ -242,15 +242,6 @@
die "$pmcname defines unknown vtable method '$name'\n" unless defined $super_table->{$name};
my $supermethod = "Parrot_" . $super_table->{$name} . "_$name";
- # Rewrite DYNSUPER(args)
- $body->subst(
- qr{
- \bDYNSUPER\b # Macro: DYNSUPER
- \(\s*(.*?)\) # capture argument list
- }x,
- sub { "interp->vtables[$supertype]->$name(" . full_arguments($1) . ')' }
- );
-
# Rewrite OtherClass.SUPER(args...)
$body->subst(
qr{
@@ -267,7 +258,16 @@
\bSUPER\b # Macro: SUPER
\(\s*(.*?)\) # capture argument list
}x,
- sub { "interp->vtables[$supertype]->$name(" . full_arguments($1) . ')' }
+ sub {
+ if ($pmc->is_dynamic($super)) {
+ return "Parrot_" . $super .
+ "_get_vtable(interp)->$name(" . full_arguments($1) .
+ ')';
+ }
+ else {
+ return "interp->vtables[$supertype]->$name(" . full_arguments($1) . ')';
+ }
+ }
);
}
Modified: branches/pluggable_runcore/lib/Parrot/Pmc2c/PCCMETHOD.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Pmc2c/PCCMETHOD.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Pmc2c/PCCMETHOD.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -188,12 +188,12 @@
my $regs_used = [];
my $qty_returns = 0;
- my $signature_re = qr{
+ my $signature_re = qr/
(RETURN #method name
\s* #optional whitespace
\( ([^\(]*) \) #returns ( stuff ... )
;?) #optional semicolon
- }sx;
+ /sx;
croak "return not allowed in pccmethods, use RETURN instead $body"
if $body and $body =~ m/\breturn\b.*?;\z/s;
Modified: branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/Null.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/Null.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/Null.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -47,10 +47,10 @@
$param =~ s/.*\b(\w+)/$1/;
$body .= " UNUSED($param)\n";
}
+ my $vtname = uc $vt_method_name;
$body .= <<"EOC";
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NULL_REG_ACCESS,
- "Null PMC access in $vt_method_name()");
+ null_pmc_access(interp, PARROT_VTABLE_SLOT_$vtname);
EOC
$new_default_method->body( Parrot::Pmc2c::Emitter->text($body) );
Modified: branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/ParrotClass.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/ParrotClass.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/ParrotClass.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -43,7 +43,6 @@
getprops
is_same
morph
- nextkey_keyed_int
set_integer_keyed_int
set_number_keyed_int
set_pmc_keyed_int
Modified: branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/RO.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/RO.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/RO.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2008, Parrot Foundation.
+# Copyright (C) 2004-2009, Parrot Foundation.
# $Id$
@@ -43,11 +43,16 @@
my $self = bless Parrot::Pmc2c::PMC->new(
{
- parents => [ $parent->name, @{ $parent->parents } ], # prepend self to parrent
- flags => { ( %{ $parent->get_flags } ), 'is_ro' => 1 }, # copy flags, set is_ro
- name => $parent->name . "_ro", # set pmcname
- vtable => $parent->vtable, # and alias vtable
- parentname => $parent->name, # set parentname
+ # prepend self to parent
+ parents => [ $parent->name, @{ $parent->parents } ],
+ # copy flags, set is_ro
+ flags => { ( %{ $parent->get_flags } ), 'is_ro' => 1 },
+ # set pmcname
+ name => $parent->name . "_ro",
+ # and alias vtable
+ vtable => $parent->vtable,
+ # set parentname
+ parentname => $parent->name,
}
), $classname;
@@ -56,7 +61,8 @@
{
# autogenerate for nonstandard types
- # (RT#44433 is this appropriate or do we want them to each be explicitly cleared to have RO ?)
+ # (RT #44433: is this appropriate or do we want them to each be
+ # explicitly cleared to have RO ?)
no strict 'refs';
if ( !@{ ref($self) . '::ISA' } ) {
@{ ref($self) . '::ISA' } = "Parrot::Pmc2c::PMC::RO";
@@ -66,15 +72,16 @@
foreach my $vt_method ( @{ $self->vtable->methods } ) {
my $name = $vt_method->name;
- # Generate ro variant only iff we override method constantness with ":write"
+ # Generate RO variant only if we override method constantness
+ # with ":write"
next unless $parent->{has_method}{$name}
&& $parent->vtable_method_does_write($name)
&& !$parent->vtable->attrs($name)->{write};
# 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 @parameters = map { "SHIM($_)" }
+ split( /\s*,\s*/, $vt_method->parameters );
my $ro_method = Parrot::Pmc2c::Method->new(
{
Modified: branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/default.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/default.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Pmc2c/PMC/default.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -79,8 +79,8 @@
$param =~ s/.*\b(\w+)/$1/;
$body .= " UNUSED($param)\n";
}
- my $vt_method_name = $method->name;
- $body .= qq{ $stub_func(interp, pmc, "$vt_method_name");\n};
+ my $vt_method_name = uc $method->name;
+ $body .= qq{ $stub_func(interp, pmc, PARROT_VTABLE_SLOT_$vt_method_name);\n};
$clone->body( Parrot::Pmc2c::Emitter->text($body));
Modified: branches/pluggable_runcore/lib/Parrot/Pmc2c/PMCEmitter.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Pmc2c/PMCEmitter.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Pmc2c/PMCEmitter.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -666,12 +666,12 @@
{
/* Register this PMC as a HLL mapping */
- const INTVAL pmc_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "$hll"));
- if (pmc_id > 0) {
+ const INTVAL hll_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "$hll"));
+ if (hll_id > 0) {
EOC
foreach my $maps ( sort keys %{ $self->{flags}{maps} } ) {
$cout .= <<"EOC";
- Parrot_register_HLL_type( interp, pmc_id, enum_class_$maps, entry);
+ Parrot_register_HLL_type( interp, hll_id, enum_class_$maps, entry);
EOC
}
$cout .= <<"EOC";
@@ -1002,12 +1002,15 @@
my $multis = $multi_methods{$vt_method_name};
+ # Get parameters. strip type from param
+ my @parameters = map { s/(\s*\S+\s*\*?\s*)//; $_ } split (/,/, $method->parameters);
+
# Gather "case :"
- my @cases = map { $self->generate_single_case($vt_method_name, $_) } @$multis;
+ my @cases = map { $self->generate_single_case($vt_method_name, $_, @parameters) } @$multis;
my $cases = join "\n", @cases;
my $body = <<"BODY";
- INTVAL type = VTABLE_type(INTERP, value);
+ INTVAL type = VTABLE_type(INTERP, $parameters[0]);
/* For dynpmc fallback to MMD */
if ((type >= enum_class_core_max) || (SELF.type() >= enum_class_core_max))
type = enum_class_core_max;
@@ -1027,13 +1030,12 @@
# Generate single case for switch VTABLE
sub generate_single_case {
- my ($self, $vt_method_name, $multi) = @_;
+ my ($self, $vt_method_name, $multi, @parameters) = @_;
my ($type, $ssig, $fsig, $ns, $func, $impl) = @$multi;
my $case;
# Gather parameters names
- my @parameters = map { s/\s*PMC\s*\*\s*//; $_ } split (/,/, $impl->parameters);
my $parameters = join ', ', @parameters;
# ISO C forbids return with expression from void functions.
my $return = $impl->return_type =~ /^void\s*$/
@@ -1082,12 +1084,20 @@
'return retval;',
);
}
+ elsif ($letter eq 'S') {
+ return (
+ "PP->" . $letter,
+ "STRING *retval;",
+ ', &retval',
+ 'return retval;',
+ );
+ }
elsif ($letter eq 'P') {
return (
'PPP->P',
- '',
- ", &$parameters[1]",
- "return $parameters[1];",
+ 'PMC *retval;',
+ ", &retval",
+ "return retval;",
);
}
elsif ($letter eq 'v') {
Modified: branches/pluggable_runcore/lib/Parrot/Revision.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Revision.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Revision.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -83,9 +83,11 @@
my $revision = 0;
# code taken from pugs/util/version_h.pl rev 14410
# modified because in xml output commit and entry revision
- # are difficult to distinguih in a simplified parsing
+ # are difficult to distinguish in a simplified parsing
my $nul = File::Spec->devnull;
- local $ENV{LANG} = 'C';
+ # Avoid locale troubles with svn messages
+ local $ENV{LANG} = 'C';
+ local $ENV{LC_ALL} = 'C';
if ( my @svn_info = qx/svn info 2>$nul/ and $? == 0 ) {
if ( my ($line) = grep /^Revision:/, @svn_info ) {
($revision) = $line =~ /(\d+)/;
Modified: branches/pluggable_runcore/lib/Parrot/Test/Pod.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Test/Pod.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Test/Pod.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -45,13 +45,13 @@
if ($full_file =~ m{
t/tools/dev/searchops/samples\.pm
| languages/pod/test\.pod
- | xconf/samples/yourfoobar
+ | examples/config/file/configcompiler
| t/configure/testlib/verbosefoobar
| t/configure/testlib/ddefectivefoobar
| t/configure/testlib/adefectivefoobar
| t/configure/testlib/cdefectivefoobar
| t/configure/testlib/bdefectivefoobar
- | xconf/samples/testfoobar
+ | examples/config/file/configwithfatalstep
}x
) {
delete $files_needing_analysis->{ $file };
Modified: branches/pluggable_runcore/lib/Parrot/Vtable.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Vtable.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/lib/Parrot/Vtable.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -238,6 +238,16 @@
EOM
+ # Slot numbers
+ my $vtable_slot_num = 9;
+ for my $entry ( @{$vtable} ) {
+ my $uc_meth = uc $entry->[1];
+ $macros .= <<"EOM";
+#define PARROT_VTABLE_SLOT_${uc_meth} ${vtable_slot_num}
+EOM
+ ++$vtable_slot_num;
+ }
+
# finally the name mapping
$macros .= <<'EOM';
/*
@@ -275,48 +285,6 @@
#define NUM_VTABLE_FUNCTIONS $num_vtable_funcs
#endif /* PARROT_IN_OBJECTS_C */
-
-/* Need this for add, subtract, multiply, divide, mod, cmod, bitwise
- (and, or, xor, lshift, rshift), concat, logical (and, or, xor),
- repeat, eq, cmp */
-
-/* &gen_from_enum(mmd.pasm) */
-
-typedef enum {
-EOM
- for my $entry ( @{$vtable} ) {
- next unless ( $entry->[4] =~ /MMD_/ );
- next if ( $entry->[4] =~ /_INT$/ );
- next if ( $entry->[4] =~ /_STR$/ );
- next if ( $entry->[4] =~ /_FLOAT$/ );
- $macros .= <<"EOM";
- $entry->[4],
-EOM
- }
- $macros .= <<'EOM';
- MMD_USER_FIRST
-} parrot_mmd_func_enum;
-
-/* &end_gen */
-
-#ifdef PARROT_IN_OBJECTS_C
-static PARROT_OBSERVER const char * const Parrot_mmd_func_names[] = {
-EOM
-
- for my $entry ( @{$vtable} ) {
- next unless ( $entry->[4] =~ /MMD_/ );
- next if ( $entry->[4] =~ /_INT$/ );
- next if ( $entry->[4] =~ /_STR$/ );
- next if ( $entry->[4] =~ /_FLOAT$/ );
- $macros .= <<"EOM";
- \"$entry->[1]\",
-EOM
- }
- $macros .= <<"EOM";
- NULL
-};
-
-#endif /* PARROT_IN_OBJECTS_C */
EOM
$macros;
Modified: branches/pluggable_runcore/ports/cygwin/README
==============================================================================
--- branches/pluggable_runcore/ports/cygwin/README Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ports/cygwin/README Fri Aug 14 01:24:23 2009 (r40541)
@@ -732,7 +732,6 @@
/usr/lib/parrot/1.0.0/include/iotypes.pasm
/usr/lib/parrot/1.0.0/include/iterator.pasm
/usr/lib/parrot/1.0.0/include/longopt.pasm
- /usr/lib/parrot/1.0.0/include/mmd.pasm
/usr/lib/parrot/1.0.0/include/opengl_defines.pasm
/usr/lib/parrot/1.0.0/include/parrotlib.pbc
/usr/lib/parrot/1.0.0/include/pmctypes.pasm
Modified: branches/pluggable_runcore/ports/debian/changelog
==============================================================================
--- branches/pluggable_runcore/ports/debian/changelog Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ports/debian/changelog Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,3 +1,13 @@
+parrot (1.4.0-1) unstable; urgency=low
+ * New upstream release
+ * debian/rules:
+ - New upstream configuration option --disable-rpath allows packages to
+ be built without rpath.
+ * parrot-devel.install.in
+ - Install pbc_to_exe binary and supporting library.
+
+ -- Allison Randal <allison at parrot.org> Fri, 24 Jul 2009 23:54:07 -0700
+
parrot (1.0.0-1) unstable; urgency=low
* New upstream release
* debian/control.in:
Modified: branches/pluggable_runcore/ports/debian/parrot-devel.install.in
==============================================================================
--- branches/pluggable_runcore/ports/debian/parrot-devel.install.in Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ports/debian/parrot-devel.install.in Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,8 +1,8 @@
usr/bin/parrot_debugger
usr/bin/pbc_disassemble
usr/bin/pbc_dump
-usr/bin/pbc_info
usr/bin/pbc_merge
+usr/bin/pbc_to_exe
usr/bin/parrot_config
usr/lib/parrot/@VERSION@/tools/*
usr/lib/parrot/@VERSION@/languages/nqp/*
@@ -20,5 +20,6 @@
usr/lib/parrot/@VERSION@/languages/tge/*
usr/lib/parrot/@VERSION@/library/TGE.pbc
usr/lib/parrot/@VERSION@/VERSION
+usr/lib/parrot/@VERSION@/parrot_config.o
usr/include/parrot/@VERSION@/pmc/*
usr/src/parrot/@VERSION@/*
Modified: branches/pluggable_runcore/ports/debian/rules
==============================================================================
--- branches/pluggable_runcore/ports/debian/rules Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ports/debian/rules Fri Aug 14 01:24:23 2009 (r40541)
@@ -31,27 +31,27 @@
configure: configure-stamp
configure-stamp: debian-control-stamp
dh_testdir
- perl Configure.pl --prefix=/usr
+ perl Configure.pl --prefix=/usr --disable-rpath
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
- $(MAKE) installable
+ $(MAKE) installable LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}`pwd`/blib/lib
pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" docs/running.pod debian/parrot.1
pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" tools/util/parrot-config.pir debian/parrot_config.1
pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_dump.c debian/pbc_dump.1
pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_disassemble.c debian/pbc_disassemble.1
pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/parrot_debugger.c debian/parrot_debugger.1
- pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_info.c debian/pbc_info.1
pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_merge.c debian/pbc_merge.1
+ pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" tools/dev/pbc_to_exe.pir debian/pbc_to_exe.1
touch build-stamp
clean: debian-control-stamp
dh_testdir
dh_testroot
- rm -f build-stamp configure-stamp debian-control-stamp debian/parrot.1 debian/parrot_config.1 debian/pbc_dump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_info.1 debian/pbc_merge.1 debian/libparrot$(SOVERSION).install src/main.o installable_pbc_to_exe ext/Parrot-Embed/Makefile.PL test.c test.ldo
+ rm -f build-stamp configure-stamp debian-control-stamp debian/parrot.1 debian/parrot_config.1 debian/pbc_dump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_merge.1 debian/libparrot$(SOVERSION).install src/main.o installable_pbc_to_exe ext/Parrot-Embed/Makefile.PL test.c test.ldo
[ ! -f Makefile ] || $(MAKE) distclean
dh_clean
@@ -89,7 +89,7 @@
dh_testroot -a
dh_installchangelogs -a ChangeLog
dh_installman -pparrot-minimal debian/parrot.1
- dh_installman -pparrot-devel debian/parrot_debugger.1 debian/pbc_disassemble.1 debian/pbc_dump.1 debian/pbc_info.1 debian/pbc_merge.1 debian/parrot_config.1
+ dh_installman -pparrot-devel debian/parrot_debugger.1 debian/pbc_disassemble.1 debian/pbc_dump.1 debian/pbc_merge.1 debian/parrot_config.1 debian/pbc_to_exe.1
dh_installdocs -a
dh_strip -a
dh_compress -a
Copied: branches/pluggable_runcore/ports/fedora/parrot-1.x.0.patch (from r40540, trunk/ports/fedora/parrot-1.x.0.patch)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/ports/fedora/parrot-1.x.0.patch Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/ports/fedora/parrot-1.x.0.patch)
@@ -0,0 +1,38 @@
+--- tools/dev/install_files.pl 2009-07-13 10:26:40.000000000 +0200
++++ tools/dev/install_files.pl 2009-07-13 13:37:49.000000000 +0200
+@@ -163,7 +163,7 @@
+ # libdir as it is typically done with automake installed packages.
+ # If there is a use case to make this configurable we'll add a
+ # seperate --pkgconfigdir option.
+- $filehash->{DestDirs} = ['pkgconfig', $parrotdir];
++ $filehash->{DestDirs} = ['pkgconfig'];
+ return($filehash);
+ },
+ },
+--- config/gen/makefiles/parrot_pc.in 2009-06-06 16:33:32.000000000 +0200
++++ config/gen/makefiles/parrot_pc.in.new 2009-07-13 23:09:45.000000000 +0200
+@@ -7,4 +7,4 @@
+ Description: virtual machine to execute bytecode for interpreted languages
+ Version: @VERSION@
+ Libs: -L${libdir} -lparrot @icu_shared@ @libs@
+-Cflags: -I${includedir}
++Cflags: -I${includedir}@versiondir@
+--- lib/Parrot/Install.pm 2009-06-01 09:29:57.000000000 +0200
++++ lib/Parrot/Install.pm 2009-06-03 08:41:22.000000000 +0200
+@@ -220,6 +220,16 @@
+ else {
+ next unless -e $src;
+ next if $^O eq 'cygwin' and -e "$src.exe"; # stat works, copy not
++ if (-l $src) {
++ # check if the system supports symbolic linking
++ use Config;
++ if ($Config{d_symlink} && $Config{d_readlink}) {
++ # copy as symbolic link
++ symlink(readlink($src), $dest);
++ print "$dest\n";
++ next;
++ }
++ }
+ copy( $src, $dest ) or die "Error: couldn't copy $src to $dest: $!\n";
+ print "$dest\n";
+ }
Modified: branches/pluggable_runcore/ports/fedora/parrot.spec.fedora
==============================================================================
--- branches/pluggable_runcore/ports/fedora/parrot.spec.fedora Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ports/fedora/parrot.spec.fedora Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,19 +1,25 @@
Name: parrot
-Version: 1.0.0
-Release: 6%{?dist}
+Version: 1.4.0
+Release: 9%{?dist}
Summary: Parrot is a virtual machine
License: Artistic 2.0
Group: Development/Libraries
URL: http://www.parrot.org/
Source0: ftp://ftp.parrot.org/pub/parrot/releases/stable/%{version}/parrot-%{version}.tar.gz
-# Without Patch0 %{_libdir}/libparrot.so would not be a symbolic link to
+
+Patch0: parrot-1.x.0.patch
+# patches file: tools/dev/install_files.pl
+# It is responsible to have no subdirectory under pkgconfig.
+#
+# patches file: config/gen/makefiles/parrot_pc.in
+# So "pkg-config parrot --cflags" works correct
+#
+# see for upstream: https://trac.parrot.org/parrot/ticket/509
+# patched file: lib/Parrot/Install.pm
+# is to have the symlink: libparrot.so -> libparrot.so.%{version}
+# Without this %{_libdir}/libparrot.so would not be a symbolic link to
# %{_libdir}/libparrot.so.%{version}
-# Symlink: libparrot.so -> libparrot.so.%{version}
-# See for upstream: https://trac.parrot.org/parrot/ticket/509
-# Extended for the package to have no subdirectory under pkgconfig
-Patch0: parrot-install_files.patch
-Patch1: parrot-1.0.0-rpath-removal.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: readline-devel
@@ -25,6 +31,7 @@
BuildRequires: perl(Test::Simple)
BuildRequires: ctags
BuildRequires: openssl-devel
+BuildRequires: flex
%package docs
@@ -32,6 +39,9 @@
Group: Documentation
Requires: perl(strict)
Requires: perl(warnings)
+BuildArch: noarch
+
+#--
%package devel
Summary: Parrot Virtual Machine development headers and libraries
@@ -39,47 +49,56 @@
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
+#--
+
%package tools
Summary: Parrot Virtual Machine development for languages
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: perl(Pod::Simple)
-Requires: perl(File::Which) = 0.05
+Requires: perl(File::Which) >= 0.05
+Requires: perl(Parrot::OpLib::core)
# It is necessary to have installed the package "perl-Perl-Critic" to install
# the parrot-tools
Provides: perl(Parrot::Pmc2c::MethodEmitter) = %{version}
Provides: perl(Parrot::Pmc2c::PCCMETHOD_BITS) = %{version}
Provides: perl(Parrot::Pmc2c::PMCEmitter) = %{version}
+Provides: perl(Parrot::OpLib::core) = %{version}
+
%description
Parrot is a virtual machine designed to efficiently compile and execute
bytecode for dynamic languages. Parrot is the target for Rakudo Perl 6,
as well as variety of other languages.
+#--
+
%description docs
Documentation in text-, POD- and HTML-format (docs/html-subdirectory) and also
examples about the Parrot Virtual Machine.
+#--
+
%description devel
Parrot Virtual Machine development headers and libraries.
+#--
+
%description tools
Parrot Virtual Machine development files for building languages.
+
%prep
%setup -q
%patch0 -p0
-%patch1 -b .rpatch
-%{__perl} -pi -e 's,"lib/,"%{_lib}/, if (/CONST_STRING\(interp,/)' \
- src/library.c
-%{__perl} -pi -e "s,'/usr/lib','%{_libdir}',;s,runtime/lib/,runtime/%{_lib}/," \
- tools/dev/install_files.pl
+%{__perl} -pi -e "s,'/usr/lib','%{_libdir}'," tools/dev/install_files.pl
cat << \EOF > %{name}-prov
#!/bin/sh
-%{__perl_provides} $* | %{__sed} -e '/perl(A)/d' -e '/perl(B)/d' -e '/perl(DB)/d'
+%{__perl_provides} $* | %{__sed} -e '/perl(A)/d' -e '/perl(B)/d' \
+ -e '/perl(DB)/d' -e '/perl(Parrot::OpLib::core)/d'
EOF
%global __perl_provides %{_builddir}/%{name}-%{version}/%{name}-prov
@@ -88,6 +107,13 @@
%build
%ifarch %{ix86} x86_64
+ RPM_OPT_FLAGS="$RPM_OPT_FLAGS -maccumulate-outgoing-args"
+%else
+# The PowerPC-architecture do not build with the '-maccumulate-outgoing-args'
+# option.
+ RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
+%endif
+
%{__perl} Configure.pl \
--prefix=%{_usr} \
--libdir=%{_libdir} \
@@ -96,18 +122,12 @@
--mandir=%{_mandir} \
--cc="%{__cc}" \
--cxx=%{__cxx} \
- --optimize="$RPM_OPT_FLAGS -maccumulate-outgoing-args" \
+ --optimize="$RPM_OPT_FLAGS" \
--parrot_is_shared \
+ --disable-rpath \
--lex=%{_bindir}/flex \
--yacc=%{_bindir}/yacc \
--libs='-lcurses -lm'
-%else
-# PowerPC, not all options work with the PowerPC-architecture, I do not test
-# which is not working (Gerd)
-%{__perl} Configure.pl \
- --prefix=%{_usr} \
- --libdir=%{_libdir}
-%endif
# The LDD_LIBRARY_PATH hack is needed for "miniparrot"
# to find his parrot-library in "blib/lib"
@@ -157,14 +177,13 @@
find %{RPM_PAR_LIB_DIR}tools/dev -type f -name "pbc_to_exe.pir" \
-exec %{__sed} -i -e '1 s&#! parrot&#!/usr/bin/parrot&' {} \; \
-exec chmod 755 {} \;
-# This module is only needed for building and should not be installed (I think)
-# module "Parrot::OpLib::core"
-rm -rf %{RPM_PAR_LIB_DIR}tools/lib/Parrot/OpLib
# Remove doc-files with zero-length
find docs/html -type f -size 0 -exec rm -f {} \;
# Set path for installed programs in docs package
+find examples/json -type f -name "*.pir" \
+ -exec %{__sed} -i -e '1 s&#!../../parrot&#!/usr/bin/parrot&' {} \;
find examples -type f -name "*.pl" \
-exec %{__sed} -i -e '1 s&#! perl&#!/usr/bin/perl&' {} \;
find examples -wholename 'examples/pir/befunge/t/basic.t' \
@@ -189,22 +208,21 @@
find examples/languages -type f -name harness \
-exec %{__sed} -i -e '1 s&#! perl&#!/usr/bin/perl&' {} \;
-for file in docs/book/ch09_pct.pod docs/memory_internals.pod; do
+for file in docs/book/draft/ch05_pge.pod docs/memory_internals.pod; do
%{__mv} $file timestamp
iconv -f ISO-8859-1 -t UTF-8 -o $file timestamp
touch -r timestamp $file
done
%{__rm} -f timestamp
-# These files *probably* aren't needed.
-rm -rf $RPM_BUILD_ROOT%{_usr}/config \
- $RPM_BUILD_ROOT%{_includedir}/src \
- $RPM_BUILD_ROOT%{_usr}/src
%check
+# 'make fulltest' is done by default; it take a lot of time
export LD_LIBRARY_PATH=$( pwd )/blib/lib
-make test
-%{?_with_fulltest: make fulltest}
+FULL='full'
+%{?_without_fulltest: FULL=''}
+%{?!_without_tests: make ${FULL}test}
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -217,10 +235,7 @@
%defattr(-,root,root,-)
%doc ChangeLog CREDITS NEWS PBC_COMPAT PLATFORMS README
%doc RESPONSIBLE_PARTIES TODO LICENSE
-%exclude %{_bindir}/parrot_config
-%exclude %{_bindir}/parrot_debugger
-%exclude %{_bindir}/pbc_*
-%{_bindir}/*
+%{_bindir}/parrot
%{_libdir}/parrot/
%exclude %{_libdir}/parrot/%{version}/tools
%exclude %{_libdir}/parrot/%{version}/VERSION
@@ -241,7 +256,7 @@
%{_bindir}/pbc_dump
%{_includedir}/parrot
%{_libdir}/libparrot.so
-%{_libdir}/libparrot.a
+%exclude %{_libdir}/libparrot.a
%{_libdir}/pkgconfig/*
%files tools
@@ -249,18 +264,27 @@
# Files for building languages
%{_libdir}/parrot/%{version}/tools/*
%{_libdir}/parrot/%{version}/VERSION
-
+%{_usr}/src/parrot/*
%changelog
-* Thu Apr 23 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 1.0.0-6
+* Sat Aug 1 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 1.4.0-9
+- ppc test included again
+- include the necessary module Parrot::Oplib::core
+- change the place of header files to /usr/include/parrrot/<version>
+- install the files /usr/src/parrot/*
+
+* Sat Jul 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4.0-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Tue Jul 21 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 1.4.0-1
+- add the new disable-rpath configure option
+
+* Wed Mar 25 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 1.0.0-6
- add a list of changes from Lubomir Rintel
-- add patch to remove rpath
- add filtering Provides
- change requires for docs-subpackage
- enable test suite
-
-* Wed Mar 25 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 1.0.0-5
- change the group of the subpackage "-docs" to Documentation
- put the main-documentation from the docs-package to the main package
- LICENSE file added
@@ -271,6 +295,7 @@
- define RPM_PAR_LIB_DIR added
- add subpackage "tools"
- exclude tools directory from main-package
+- added make html
* Sun Mar 22 2009 Fabien Georget <fabien.georget at gmail.com> 1.0.0-4
- add tools
@@ -279,10 +304,6 @@
- Removed wrong prefix from pkgconfig per Christoph Wickert
- Changed i386 to ix86 per Christoph Wickert
-* Sun Mar 22 2009 David Fetter <david at fetter.org> 1.0.0-2
-- Changed hard-coded path requirement to perl.
-
-
* Tue Mar 17 2009 Allison Randal <allison at parrot.org> 1.0.0
- updated to 1.0.0
@@ -291,91 +312,31 @@
- added parrot_utils to devel
- fixed Source0 url
-* Tue Jan 23 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 0.9.0
-- added make html
-- make reallyinstall => make install
-
-* Tue Jan 20 2009 chromatic <chromatic at wgz.org> 0.9.0
-- updated to 0.9.0
-
* Tue Dec 16 2008 Whiteknight <wknight8111 at gmail.com> 0.8.2
- updated to 0.8.2
-* Tue Nov 18 2008 chromatic <chromatic at parrot.org> 0.8.1
-- updated to 0.8.1
-
-* Tue Oct 21 2008 particle <particle at parrot.org> 0.8.0
-- updated to 0.8.0
-
-* Tue Sep 16 2008 pmichaud <pmichaud at pobox.com> 0.7.1
-- updated to 0.7.1
-
-* Wed Sep 3 2008 chromatic <chromatic at wgz.org> 0.7.0
-- install parrot_config (not parrot-config)
-
-* Tue Jun 17 2008 Nuno Carvalho <smash at cpan.org> 0.6.3
-- updated to 0.6.3
-
-* Tue May 20 2008 chromatic <chromatic at wgz.org>> 0.6.2
-- updated to 0.6.2
-
-* Mon Apr 28 2008 chromatic <chromatic at wgz.org> 0.6.1
-- minor fixes; tested with Fedora 7, 8, and 9-beta
-
* Tue Mar 18 2008 Bernhard Schmalhofer <Bernhard.Schmalhofer at gmx.de> 0.6.0
- Update to 0.5.3.
* Wed Feb 20 2008 Patrick Michaud <pmichaud at pobox.com> 0.5.3
- Update to 0.5.3.
-* Tue Jan 15 2008 Bob Rogers <rogers at rgrjr.dyndns.org> 0.5.2
-- Update to 0.5.2.
-
-* Tue Dec 18 2007 Jonathan Worthington <jnthn at jnthn.net> 0.5.1
-- Update to 0.5.1.
-
-* Tue Nov 20 2007 chromatic <chromatic at wgz.org> 0.5.0
-- Update to 0.5.0.
-
-* Fri May 25 2007 David Fetter <david at fetter.org> 0.4.12-1
-- Update to 0.4.12.
-
-* Wed Apr 18 2007 Steven Pritchard <steve at kspei.com> 0.4.11-1
-- Update to 0.4.11.
-
-* Wed Mar 21 2007 Steven Pritchard <steve at kspei.com> 0.4.10-1
-- Update to 0.4.10.
-
* Sat Mar 10 2007 Steven Pritchard <steve at kspei.com> 0.4.9-1
- Update to 0.4.9.
-- BR ncurses-devel.
+- BuildRequires ncurses-devel.
- For some reason now I need to force -lm too.
- Remove some files/directories that shouldn't be included.
-
-* Wed Jan 17 2007 Steven Pritchard <steve at kspei.com> 0.4.8-1
-- Attempt update to 0.4.8.
-
-* Fri Jun 30 2006 Steven Pritchard <steve at kspei.com> 0.4.5-5
- Override lib_dir and make various substitutions to try to fix multilib.
- Remove rpath use from Makefile.
- Fix a pod error in src/ops/experimental.ops.
- Enable "make test" since t/doc/pod.t won't fail now.
-
-* Wed Jun 28 2006 Steven Pritchard <steve at kspei.com> 0.4.5-4
- Force permissions on shared libraries so rpmbuild strips them.
-
-* Wed Jun 28 2006 Steven Pritchard <steve at kspei.com> 0.4.5-3
- Fix URL, description, summary, etc.
- Add post/postun.
- Move parrot-config to the devel sub-package.
- Force permissions on the doc directories.
-
-* Tue Jun 27 2006 Steven Pritchard <steve at kspei.com> 0.4.5-2
- Add -lcurses to get readline detection to work.
-- BR libicu-devel.
-
-* Tue Jun 27 2006 Steven Pritchard <steve at kspei.com> 0.4.5-1
-- Initial packaging attempt.
+- Add BuildRequires libicu-devel.
* Tue Mar 18 2003 Steve Fink <sfink at foxglove.localdomain> 0.0.11
- first .spec file created
Modified: branches/pluggable_runcore/ports/macports/Portfile
==============================================================================
--- branches/pluggable_runcore/ports/macports/Portfile Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ports/macports/Portfile Fri Aug 14 01:24:23 2009 (r40541)
@@ -55,7 +55,7 @@
set executables {
parrot parrot_config parrot_debugger
- pbc_disassemble pbc_info pbc_merge pbc_to_exe pbc_dump
+ pbc_disassemble pbc_merge pbc_to_exe pbc_dump
}
foreach exe $executables {
Modified: branches/pluggable_runcore/ports/mandriva/parrot.spec.mandriva
==============================================================================
--- branches/pluggable_runcore/ports/mandriva/parrot.spec.mandriva Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ports/mandriva/parrot.spec.mandriva Fri Aug 14 01:24:23 2009 (r40541)
@@ -158,7 +158,6 @@
%{_bindir}/parrot_config
%{_bindir}/parrot_debugger
%{_bindir}/pbc_disassemble
-%{_bindir}/pbc_info
%{_bindir}/pbc_merge
%{_bindir}/pbc_to_exe
%{_bindir}/pbc_dump
Modified: branches/pluggable_runcore/ports/suse/parrot.spec.suse
==============================================================================
--- branches/pluggable_runcore/ports/suse/parrot.spec.suse Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ports/suse/parrot.spec.suse Fri Aug 14 01:24:23 2009 (r40541)
@@ -134,7 +134,6 @@
%{_bindir}/parrot_config
%{_bindir}/parrot_debugger
%{_bindir}/pbc_disassemble
-%{_bindir}/pbc_info
%{_bindir}/pbc_merge
%{_bindir}/pbc_to_exe
%{_bindir}/pbc_dump
Modified: branches/pluggable_runcore/ports/ubuntu/changelog
==============================================================================
--- branches/pluggable_runcore/ports/ubuntu/changelog Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ports/ubuntu/changelog Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,9 +1,32 @@
+parrot (1.4.0-1ubuntu1) karmic; urgency=low
+ * Synchronize with Debian unstable.
+ * Removes lpia patch, upstream fix included in new release.
+
+ -- Allison Randal <allison at parrot.org> Sat, 25 Jul 2009 08:37:52 -0700
+
+parrot (1.4.0-1) unstable; urgency=low
+ * New upstream release
+ * debian/rules:
+ - New upstream configuration option --disable-rpath allows packages to
+ be built without rpath.
+ * parrot-devel.install.in
+ - Install pbc_to_exe binary and supporting library.
+
+ -- Allison Randal <allison at parrot.org> Fri, 24 Jul 2009 23:54:07 -0700
+
parrot (1.0.0-1ubuntu1) karmic; urgency=low
- * Resynchronize with Debian unstable.
- * Add a patch to detect the lpia architecture, to correctly configure for
- unaligned function pointers.
- -- Allison Randal <allison at parrot.org> Thu, 28 May 2009 13:13:12 -0700
+ [ Allison Randal ]
+ * Merge from Debian unstable.
+ * Ubuntu remaining changes:
+ - Add 01-lpia-FTBFS.path : from upstream, fix FTBFS for lpia.
+
+ [ Julien Lavergne ]
+ - Add quilt support for the patch :
+ + debian/control.in : Add quilt as build-depends.
+ + debian/rules : Add quilt support.
+
+ -- Julien Lavergne <julien.lavergne at gmail.com> Fri, 29 May 2009 01:34:42 +0200
parrot (1.0.0-1) unstable; urgency=low
* New upstream release
@@ -38,12 +61,6 @@
-- Allison Randal <allison at parrot.org> Wed, 25 Mar 2009 00:45:40 -0500
-parrot (0.9.0-1ubuntu1) intrepid; urgency=low
-
- * New upstream release.
-
- -- Allison Randal <allison at parrot.org> Tue, 03 Feb 2009 23:21:12 +0000
-
parrot (0.9.0-1) unstable; urgency=low
* New upstream release
@@ -64,12 +81,6 @@
-- Allison Randal <allison at parrot.org> Fri, 23 Jan 2009 15:16:25 -0800
-parrot (0.8.1-0ubuntu1) intrepid; urgency=low
-
- * New upstream release
-
- -- Allison Randal <allison at parrot.org> Fri, 12 Dec 2008 16:40:43 +0800
-
parrot (0.7.0-1) unstable; urgency=low
* New upstream release
@@ -114,6 +125,12 @@
-- Allison Randal <allison at perl.org> Sun, 30 Dec 2007 17:21:45 +0000
+parrot (0.4.13-1ubuntu4) karmic; urgency=low
+
+ * No-change rebuild for libicu38 -> libicu40 transition.
+
+ -- Steve Kowalik <stevenk at ubuntu.com> Thu, 04 Jun 2009 08:01:54 +1000
+
parrot (0.4.13-1ubuntu3) hardy; urgency=low
* Replace libicu36-dev with libicu-dev.
Modified: branches/pluggable_runcore/ports/ubuntu/control.in
==============================================================================
--- branches/pluggable_runcore/ports/ubuntu/control.in Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/ports/ubuntu/control.in Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,8 +1,9 @@
Source: parrot
Section: interpreters
Priority: optional
-Maintainer: Ubuntu MOTU Developers <ubuntu-motu at lists.ubuntu.com>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>
XSBC-Original-Maintainer: Debian Parrot Maintainers <pkg-parrot-devel at lists.alioth.debian.org>
+Uploaders: Allison Randal <allison at parrot.org>, Nuno Carvalho <mestre.smash at gmail.com>, Patrick Michaud <pmichaud at pobox.com>
Build-Depends: debhelper (>= 5.0.0), perl, perl-doc, libgdbm-dev, libreadline-dev
Standards-Version: 3.8.1
Deleted: branches/pluggable_runcore/ports/ubuntu/lpia_no_aligned_funcptr.patch
==============================================================================
--- branches/pluggable_runcore/ports/ubuntu/lpia_no_aligned_funcptr.patch Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,12 +0,0 @@
-Index: /trunk/config/auto/gcc.pm
-===================================================================
---- /trunk/config/auto/gcc.pm (revision 37201)
-+++ /trunk/config/auto/gcc.pm (revision 39212)
-@@ -97,5 +97,6 @@
- );
- $conf->data->set( HAS_aligned_funcptr => 0 )
-- if $conf->data->get_p5('OSNAME') eq 'hpux';
-+ if ( $conf->data->get_p5('OSNAME') eq 'hpux'
-+ || $conf->data->get('archname') =~ /gnulp/); # lpia arch
- return 1;
- }
Modified: branches/pluggable_runcore/runtime/parrot/include/fp_equality.pasm
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/include/fp_equality.pasm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/include/fp_equality.pasm Fri Aug 14 01:24:23 2009 (r40541)
@@ -7,7 +7,7 @@
=head1 DESCRIPTION
-This file provides two PIR macros to determine if a pair of floating point numbers are equivalent.
+This file provides PIR macros to determine if a pair of floating point numbers are equivalent.
The same macros are also provided for PASM.
=cut
@@ -23,6 +23,18 @@
.label $FPEQNOK:
.endm
+.macro fp_eq_ok ( J, K, L )
+ set $N10, .J
+ set $N11, .K
+ sub $N12, $N11, $N10
+ abs $N12, $N12
+
+ set $I0, 0
+ gt $N12, 0.000001, .$FPEQNOK
+ set $I0, 1
+.label $FPEQNOK:
+ ok( $I0, .L )
+.endm
.macro fp_ne ( J, K, L )
set $N10, .J
Modified: branches/pluggable_runcore/runtime/parrot/library/Crow.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/Crow.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/Crow.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -110,16 +110,16 @@
.param string template
.param pmc data
- .local pmc iter
- iter = new 'Iterator', data
+ .local pmc it
+ it = iter data
.local string symbol, value
it_loop:
- unless iter goto it_done
- $P0 = shift iter
+ unless it goto it_done
+ $P0 = shift it
symbol = 'get_symbol'($P0)
- value = iter[$P0]
+ value = it[$P0]
repl_loop:
$I0 = index template, symbol
if -1 == $I0 goto repl_done
Modified: branches/pluggable_runcore/runtime/parrot/library/Curses.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/Curses.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/Curses.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,6 +1,12 @@
# Copyright (C) 2004-2009, Parrot Foundation.
# $Id$
+.macro export_dl_func(lib, name, sig)
+ .local pmc edlftmp
+ dlfunc edlftmp, .lib, .name, .sig
+ set_global .name, edlftmp
+.endm
+
.namespace ['Curses']
.sub __ncurses_init :load
@@ -125,6 +131,29 @@
dlfunc $P2, $P1, 'data_behind', 'lp'
set_global 'data_behind', $P2
+loadlib $P1, 'libpanel'
+if $P1 goto has_panel_lib
+loadlib $P1, 'cygpanel-8'
+if $P1 goto has_panel_lib
+goto no_panel_lib
+has_panel_lib:
+.export_dl_func($P1, 'new_panel', 'pp')
+.export_dl_func($P1, 'bottom_panel', 'ip')
+.export_dl_func($P1, 'top_panel', 'ip')
+.export_dl_func($P1, 'show_panel', 'ip')
+.export_dl_func($P1, 'update_panels', 'v')
+.export_dl_func($P1, 'hide_panel', 'ip')
+.export_dl_func($P1, 'panel_window', 'pp')
+.export_dl_func($P1, 'replace_panel', 'ipp')
+.export_dl_func($P1, 'move_panel', 'ipii')
+.export_dl_func($P1, 'panel_hidden', 'ip')
+.export_dl_func($P1, 'panel_above', 'pp')
+.export_dl_func($P1, 'panel_below', 'pp')
+.export_dl_func($P1, 'set_panel_userptr', 'ipp')
+.export_dl_func($P1, 'panel_userptr', 'vp')
+.export_dl_func($P1, 'del_panel', 'ip')
+no_panel_lib:
+
loadlib $P1, 'libncurses'
if $P1 goto has_lib1
loadlib $P1, 'cygncurses-8'
@@ -658,6 +687,8 @@
set_global 'mcprint', $P2
dlfunc $P2, $P1, 'has_key', 'ii'
set_global 'has_key', $P2
+.export_dl_func($P1, 'getmaxx', 'ip')
+.export_dl_func($P1, 'getmaxy', 'ip')
.begin_return
.end_return
Modified: branches/pluggable_runcore/runtime/parrot/library/Data/Dumper/Default.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/Data/Dumper/Default.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/Data/Dumper/Default.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -110,7 +110,7 @@
.param pmc hash
.local string indent
.local string subindent
- .local pmc iter
+ .local pmc it
.local string key
.local pmc val
.local pmc keys
@@ -124,13 +124,12 @@
print " {"
new keys, "ResizablePMCArray"
- new iter, "Iterator", hash
- set iter, 0
+ it = iter hash
iter_loop:
- unless iter, iter_end
+ unless it, iter_end
- shift key, iter
+ shift key, it
push keys, key
branch iter_loop
@@ -422,11 +421,11 @@
.local string subindent, indent
(subindent, indent) = dumper.'newIndent'()
- .local pmc hash, iter
+ .local pmc hash, it
hash = self.'hash'()
- iter = new 'Iterator', hash
+ it = iter hash
dump_hash_loop:
- unless iter goto dump_hash_end
+ unless it goto dump_hash_end
if hasstuff goto dump_hash_1
print " {"
hasstuff = 1
@@ -435,7 +434,7 @@
print subindent
.local string key
.local pmc val
- key = shift iter
+ key = shift it
val = hash[key]
print "<"
print key
Deleted: branches/pluggable_runcore/runtime/parrot/library/Data/Replace.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/Data/Replace.pir Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,234 +0,0 @@
-# $Id$
-
-=head1 TITLE
-
-Data::Replace - data replacing implemented in PIR
-
-=head1 SYNOPSIS
-
- ...
-
- load_bytecode "Data/Replace.pbc"
-
- .local pmc replace
-
- replace = get_hll_global ['Data::Replace'], 'replace'
-
- replace( array, old, new )
-
- ...
-
-
-=head1 DESCRIPTION
-
-Replaces every occurrence of a specified PMC with another PMC
-in a nested, possible self-referential data structure.
-
-=head1 FUNCTIONS
-
-This library provides the following function:
-
-=over 4
-
-=cut
-
-.namespace ["Data::Replace"]
-
-=item replace( where, old, new )
-
-Replaces every "old" with "new" inside the aggregate "where".
-
-=cut
-
-.sub replace
- .param pmc where
- .param pmc oldVal
- .param pmc newVal
- .local pmc cache
-
- new cache, 'ResizablePMCArray'
- __do_replace( where, oldVal, newVal, cache )
-.end
-
-
-.sub __in_cache
- .param pmc val
- .param pmc cache
- .local int i
- .local pmc temp
-
- set i, cache
-LOOP:
- dec i
- if i < 0 goto END
- temp = cache[i]
- eq_addr val, temp, IS
- branch LOOP
-END:
- .begin_return
- .set_return 0
- .end_return
-IS:
- .begin_return
- .set_return 1
- .end_return
-.end
-
-.sub __do_replace
- .param pmc where
- .param pmc oldVal
- .param pmc newVal
- .param pmc cache
- .local pmc temp
- .local string name
-
- if_null where, END
-
- # call __replace if the PMC supports it
- can $I0, where, "__replace"
- unless $I0 goto CANT_REPLACE
- where."__replace"( oldVal, newVal, cache )
- branch REPLACE_PROPS
-CANT_REPLACE:
-
- # find a Data::Replace method with the name of the type to replace
- typeof name, where
- .include 'errors.pasm'
- errorsoff .PARROT_ERRORS_GLOBALS_FLAG
- temp = get_hll_global ['"Data::Replace'], name
- errorson .PARROT_ERRORS_GLOBALS_FLAG
- # invoke it if found
- $I0 = defined temp
- unless $I0 goto REPLACE_PROPS
- temp( where, oldVal, newVal, cache )
-
-REPLACE_PROPS:
- prophash temp, where
- set $I0, temp
- if $I0 == 0 goto END
- __do_replace( temp, oldVal, newVal, cache )
-END:
-.end
-
-.sub __onload :load
- $P0 = get_hll_global ['Data::Replace'], 'ResizablePMCArray'
- set_hll_global ['Data::Replace'], 'PMCArray', $P0
- set_hll_global ['Data::Replace'], 'StringArray', $P0
-.end
-
-.sub ResizablePMCArray
- .param pmc where
- .param pmc oldVal
- .param pmc newVal
- .param pmc cache
- .local int i
- .local pmc val
-
- set i, where
-LOOP:
- dec i
- if i < 0 goto END
-
- val = where[i]
-
- ne_addr val, oldVal, SKIP
- where[i] = newVal
-SKIP:
- $I0 = __in_cache( val, cache )
- if $I0 goto LOOP
-
- push cache, val
- __do_replace( val, oldVal, newVal, cache )
- branch LOOP
-END:
- .begin_return
- .end_return
-.end
-
-.sub Hash :method
- .param pmc where
- .param pmc oldVal
- .param pmc newVal
- .param pmc cache
- .local pmc iter
- .local string key
- .local pmc val
-
- new iter, 'Iterator', where
- set iter, 0
-
-LOOP:
- unless iter, END
-
- shift key, iter
-
- val = where[key]
-
- ne_addr val, oldVal, SKIP
- where[key] = newVal
-SKIP:
- $I0 = __in_cache( val, cache )
- if $I0 goto LOOP
-
- push cache, val
- __do_replace( val, oldVal, newVal, cache )
- branch LOOP
-
-END:
- .begin_return
- .end_return
-.end
-
-.sub Hash :method
- .param pmc where
- .param pmc oldVal
- .param pmc newVal
- .param pmc cache
- .local pmc iter
- .local string key
- .local pmc val
-
- new iter, 'Iterator', where
- set iter, 0
-
-LOOP:
- unless iter, END
-
- shift key, iter
-
- val = where[key]
-
- ne_addr val, oldVal, SKIP
- where[key] = newVal
-SKIP:
- $I0 = __in_cache( val, cache )
- if $I0 goto LOOP
-
- push cache, val
- __do_replace( val, oldVal, newVal, cache )
- branch LOOP
-
-END:
- .begin_return
- .end_return
-.end
-
-=back
-
-=head1 AUTHOR
-
-Jens Rieks E<lt>parrot at jensbeimsurfen dot deE<gt> is the author
-and maintainer.
-Please send patches and suggestions to the Perl 6 Internals mailing list.
-
-=head1 COPYRIGHT
-
-Copyright (C) 2004-2008, Parrot Foundation.
-
-=cut
-
-# Local Variables:
-# mode: pir
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/runtime/parrot/library/JSON.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/JSON.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/JSON.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -262,14 +262,13 @@
.local pmc keys
keys = new 'ResizablePMCArray'
- .local pmc iter
- iter = new 'Iterator', thing
- iter = 0
+ .local pmc it
+ it = iter thing
.local string key
iter_loop:
- unless iter, done_iter
- shift key, iter
+ unless it, done_iter
+ shift key, it
push keys, key
goto iter_loop
Deleted: branches/pluggable_runcore/runtime/parrot/library/NCI/call_toolkit_init.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/NCI/call_toolkit_init.pir Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,124 +0,0 @@
-# Copyright (C) 2008-2009, Parrot Foundation.
-# $Id$
-
-=head1 TITLE
-
-call_toolkit_init.pir - PIR code to call toolkits that alter argv
-
-=head1 SYNOPSIS
-
- .sub main :main
- .param pmc argv
-
- # Load this library and the NCI wrapper for the toolkit
- load_bytecode 'NCI/call_toolkit_init.pbc'
- load_bytecode 'FooTK.pbc'
-
- # Find Subs for toolkit's init function, and this helper routine
- .local pmc fooInit, call_toolkit_init
- fooInit = get_global ['FooTK'], 'fooInit'
- call_toolkit_init = get_global ['NCI'], 'call_toolkit_init'
-
- # Call toolkit's init function, overwriting argv with mangled copy
- argv = call_toolkit_init(fooInit, argv)
-
- # Alternately, you can save both the original argv and mangled copy
- .local pmc mangled_argv
- mangled_argv = call_toolkit_init(fooInit, argv)
-
- # ...
- .end
-
-=head1 DESCRIPTION
-
-Calling an NCI toolkit init function that expects to parse and mangle
-argv is a relatively grotty bit of code that no one should have to write
-twice. Hence this library, which provides just one routine:
-
-=over 4
-
-=item new_argv = call_toolkit_init(pmc init_func, pmc orig_argv)
-
-Call an NCI void function with params C<(&argc, argv)> (and thus having
-Parrot signature C<'v3p'>). This is a very common signature for toolkit
-(AKA framework) init functions that want to filter out command line
-options that the toolkit itself should process. Since it is expected
-that the init call will remove some arguments, C<call_toolkit_init>
-returns an updated argv. C<orig_argv> is never changed; the NCI call is
-performed using a copy.
-
-=back
-
-=cut
-
-
-.namespace ['NCI']
-
-.include 'datatypes.pasm'
-
-
-.sub call_toolkit_init
- .param pmc init_func
- .param pmc orig_argv
-
- # Calculate argc
- .local int count
- .local pmc argc
- count = orig_argv
- argc = new 'Integer'
- argc = count
-
- # Declare structure of a raw C string array with proper element count
- .local pmc argv_decl
- argv_decl = new 'ResizablePMCArray'
- push argv_decl, .DATATYPE_CSTR
- push argv_decl, count
- push argv_decl, 0
- # XXX: This is unportably wrong; it assumes sizeof(INT) = sizeof(PTR)
- push argv_decl, .DATATYPE_INT
- push argv_decl, 0
- push argv_decl, 0
-
- # Create C string array from struct declaration and Parrot string array
- .local pmc argv
- .local int i
- argv = new 'ManagedStruct', argv_decl
- i = 0
- argv_loop:
- unless i < count goto add_null
- # It seems like this should be possible in one op
- $S0 = orig_argv[i]
- argv[0;i] = $S0
- inc i
- goto argv_loop
- add_null:
- # XXX: This is unportably wrong; it assumes sizeof(INT) = sizeof(PTR)
- argv[1] = 0
-
- # Call the NCI framework init function
- init_func(argc, argv)
-
- # Build a new_argv array to match the init function's return
- .local int new_count
- .local pmc new_argv
- new_count = argc
- new_argv = new 'ResizableStringArray'
- i = 0
- new_argv_loop:
- unless i < new_count goto done
- $S0 = argv[0;i]
- push new_argv, $S0
- inc i
- goto new_argv_loop
-
- # Finally, return the new (and adjusted) argv
- done:
- .return (new_argv)
-.end
-
-
-# Local Variables:
-# mode: pir
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/runtime/parrot/library/OpenGL.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/OpenGL.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/OpenGL.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -19,7 +19,7 @@
# Load OpenGL libary and a helper library for calling glutInit
load_bytecode 'OpenGL.pbc'
- load_bytecode 'NCI/call_toolkit_init.pbc'
+ load_bytecode 'NCI/Utils.pbc'
# Import all OpenGL/GLU/GLUT functions
.local pmc import_gl
@@ -28,7 +28,7 @@
# Initialize GLUT
.local pmc call_toolkit_init
- call_toolkit_init = get_global ['NCI'], 'call_toolkit_init'
+ call_toolkit_init = get_global ['NCI';'Utils'], 'call_toolkit_init'
.const 'Sub' glutInit = 'glutInit'
argv = call_toolkit_init(glutInit, argv)
Modified: branches/pluggable_runcore/runtime/parrot/library/P6object.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/P6object.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/P6object.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -227,12 +227,12 @@
.local pmc parrotclassns, mroiter, methods, methoditer
parrotclassns = parrotclass.'get_namespace'()
$P0 = parentclass.'inspect'('all_parents')
- mroiter = new 'Iterator', $P0
+ mroiter = iter $P0
mro_loop:
unless mroiter goto mro_end
$P0 = shift mroiter
methods = $P0.'methods'()
- methoditer = new 'Iterator', methods
+ methoditer = iter methods
method_loop:
unless methoditer goto mro_loop
$S0 = shift methoditer
@@ -346,7 +346,8 @@
.end
-=item register(parrotclass [, 'name'=>name] [, 'protoobject'=>proto] [, 'parent'=>parentclass] [, 'hll'=>hll])
+=item register(parrotclass [, 'name'=>name] [, 'protoobject'=>proto]
+ [, 'parent'=>parentclass] [, 'hll'=>hll] [, 'how'=>how)
Sets objects of type C<parrotclass> to use C<protoobject>,
and verifies that C<parrotclass> has P6object methods defined
@@ -359,6 +360,9 @@
to map to a class name that already exists in Parrot (e.g., 'Hash'
or 'Object').
+The C<how> parameter allows you to specify an already-existing metaclass
+instance to be used for this class rather than creating a new one.
+
=cut
.sub 'register' :method
@@ -400,11 +404,11 @@
$S0 = parentclass
parentclass = split ' ', $S0
parent_array:
- .local pmc iter, item
- iter = new 'Iterator', parentclass
+ .local pmc it, item
+ it = iter parentclass
parent_loop:
- unless iter goto parent_done
- item = shift iter
+ unless it goto parent_done
+ item = shift it
$S0 = item
$P0 = split ';', $S0
$I0 = elements $P0
@@ -423,7 +427,10 @@
self.'add_parent'(item, 'to'=>parrotclass)
goto parent_loop
parent_done:
+ $I0 = isa parrotclass, 'P6object'
+ if $I0 goto isa_p6object_already
self.'add_parent'('P6object', 'to'=>parrotclass)
+ isa_p6object_already:
## determine parrotclass' canonical p6-name
.local string name
@@ -441,16 +448,20 @@
ns = split '::', name
have_ns:
- ## get the metaclass (how) from :protoobject, or create one
+ ## get the metaclass (how) from :how, or :protoobject, or create one
.local pmc how
+ how = options['how']
+ unless null how goto have_how
$P0 = options['protoobject']
if null $P0 goto make_how
how = $P0.'HOW'()
- goto have_how
+ goto how_setup
make_how:
## create a metaclass for parrotclass
- how = new 'P6metaclass'
+ $P0 = typeof self
+ how = new $P0
setattribute how, 'parrotclass', parrotclass
+ have_how:
## create an anonymous class for the protoobject
.local pmc protoclass, protoobject
@@ -469,10 +480,10 @@
methodname = shift protooverrides
unless methodname goto override_loop
$P0 = parrotclass.'inspect'('all_parents')
- iter = new 'Iterator', $P0
+ it = iter $P0
method_loop:
- unless iter goto method_end
- $P0 = shift iter
+ unless it goto method_end
+ $P0 = shift it
$P0 = $P0.'methods'()
$P0 = $P0[methodname]
if null $P0 goto method_loop
@@ -506,7 +517,7 @@
push ns, 'EXPORT'
push ns, 'ALL'
set_root_global ns, $S0, protoobject
- goto have_how
+ goto how_setup
## anonymous classes have empty strings for shortname and longname
anonymous_class:
@@ -515,7 +526,7 @@
setattribute how, 'longname', longname
setattribute how, 'shortname', shortname
- have_how:
+ how_setup:
## attach the metaclass object to the parrotclass
setprop parrotclass, 'metaclass', how
@@ -576,7 +587,7 @@
goto have_parrotclass
have_parrotclass:
- .local pmc attrlist, iter
+ .local pmc attrlist, it
attrlist = options['attr']
if null attrlist goto attr_done
$I0 = does attrlist, 'array'
@@ -584,10 +595,10 @@
$S0 = attrlist
attrlist = split ' ', $S0
have_attrlist:
- iter = new 'Iterator', attrlist
+ it = iter attrlist
iter_loop:
- unless iter goto iter_end
- $S0 = shift iter
+ unless it goto iter_end
+ $S0 = shift it
unless $S0 goto iter_loop
addattribute parrotclass, $S0
goto iter_loop
@@ -751,21 +762,25 @@
$P0 = self.'HOW'()
parrotclass = $P0.'get_parrotclass'(self)
+ # Perl6Object accepts anything.
$S0 = parrotclass
if $S0 == 'Perl6Object' goto accept_anyway
- $I0 = isa topic, 'Junction'
- if $I0 goto normal_check
-
- if $S0 == 'Any' goto accept_anyway
-
- normal_check:
+ # Otherwise, just try a normal check.
$I0 = can topic, 'HOW'
unless $I0 goto end
topicwhat = topic.'WHAT'()
$I0 = isa topicwhat, parrotclass
if $I0 goto end
$I0 = does topic, parrotclass
+ if $I0 goto end
+
+ # If this fails, and we want Any, and it's something form outside
+ # of the Perl 6 world, we'd best just accept it.
+ unless $S0 == 'Any' goto end
+ $I0 = isa topicwhat, 'Perl6Object'
+ unless $I0 goto accept_anyway
+ $I0 = 0
goto end
accept_anyway:
@@ -795,4 +810,3 @@
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
-
Modified: branches/pluggable_runcore/runtime/parrot/library/PGE/Dumper.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/PGE/Dumper.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/PGE/Dumper.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -26,7 +26,7 @@
.param pmc dumper
.param string label
.local string indent, subindent
- .local pmc iter, val
+ .local pmc it, val
.local string key
.local pmc hash, array
.local int hascapts
@@ -41,16 +41,16 @@
hascapts = 0
hash = self.'hash'()
if_null hash, dump_array
- iter = new 'Iterator', hash
+ it = iter hash
dump_hash_1:
- unless iter goto dump_array
+ unless it goto dump_array
if hascapts goto dump_hash_2
print " {"
hascapts = 1
dump_hash_2:
print "\n"
print subindent
- key = shift iter
+ key = shift it
val = hash[key]
print "<"
print key
@@ -102,8 +102,10 @@
.local pmc capt
.local int spi, spc
- .local pmc iter
+ .local pmc it
.local string prefix1, prefix2
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
if has_b2 goto start
b2 = "]"
@@ -139,7 +141,7 @@
$I0 = defined capt[spi]
unless $I0 goto subpats_2
$P0 = capt[spi]
- bsr dumper
+ local_branch jmpstack, dumper
subpats_2:
inc spi
goto subpats_1
@@ -147,17 +149,17 @@
subrules:
capt = self.'hash'()
if_null capt, end
- iter = new 'Iterator', capt
+ it = iter capt
subrules_1:
- unless iter goto end
- $S0 = shift iter
+ unless it goto end
+ $S0 = shift it
prefix1 = concat prefix, '<'
concat prefix1, $S0
concat prefix1, ">"
$I0 = defined capt[$S0]
unless $I0 goto subrules_1
$P0 = capt[$S0]
- bsr dumper
+ local_branch jmpstack, dumper
goto subrules_1
dumper:
@@ -165,7 +167,7 @@
unless $I0 goto dumper_0
$S0 = $P0.'dump_str'(prefix1, b1, b2)
out .= $S0
- ret
+ local_return jmpstack
dumper_0:
$I0 = does $P0, 'array'
unless $I0 goto dumper_3
@@ -183,14 +185,14 @@
inc $I0
goto dumper_1
dumper_2:
- ret
+ local_return jmpstack
dumper_3:
out .= prefix1
out .= ': '
$S0 = $P0
out .= $S0
out .= "\n"
- ret
+ local_return jmpstack
end:
.return (out)
@@ -462,7 +464,7 @@
.param pmc dumper
.param string label
.local string indent, subindent
- .local pmc iter, val
+ .local pmc it, val
.local string key
.local pmc hash, array
@@ -470,12 +472,12 @@
print " {"
hash = self
if_null hash, dump_rest
- iter = new 'Iterator', hash
+ it = iter hash
dump_hash:
- unless iter goto dump_rest
+ unless it goto dump_rest
print "\n"
print subindent
- key = shift iter
+ key = shift it
val = hash[key]
print "<"
print key
Modified: branches/pluggable_runcore/runtime/parrot/library/PGE/Hs.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/PGE/Hs.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/PGE/Hs.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -164,7 +164,9 @@
.local int ari, arc
.local int tmpi, cond
.local string tmps, key
- .local pmc capt, iter, subelm, elm
+ .local pmc capt, it, subelm, elm
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
out = ""
@@ -192,7 +194,7 @@
cond = defined capt[spi]
unless cond goto subpats_fail
elm = capt[spi]
- bsr dumper
+ local_branch jmpstack, dumper
inc spi
goto subpats_loop
subpats_fail:
@@ -204,11 +206,10 @@
out .= "] ["
capt = self.'hash'()
if_null capt, end
- iter = new 'Iterator', capt
- iter = 0
- unless iter goto end
+ it = iter capt
+ unless it goto end
subrules_body:
- key = shift iter
+ key = shift it
cond = defined capt[key]
unless cond goto subrules_fail
elm = capt[key]
@@ -216,15 +217,15 @@
tmps = escape key
out .= tmps
out .= '", '
- bsr dumper
+ local_branch jmpstack, dumper
out .= ")"
- unless iter goto end
+ unless it goto end
out .= ", "
goto subrules_body
subrules_fail:
out .= PGE_FAIL
- key = shift iter
- unless iter goto end
+ key = shift it
+ unless it goto end
goto subrules_body
dumper:
@@ -234,20 +235,20 @@
unless $I0 goto dumper_string
tmps = elm."dump_hs"()
out .= tmps
- ret
+ local_return jmpstack
dumper_string:
$S0 = elm
tmps = escape $S0
out .= 'PGE_String "'
out .= tmps
out .= '"'
- ret
+ local_return jmpstack
dumper_fail:
out .= PGE_FAIL
- ret
+ local_return jmpstack
dumper_done:
out .= "]"
- ret
+ local_return jmpstack
dumper_array:
ari = 0
arc = elements elm
Modified: branches/pluggable_runcore/runtime/parrot/library/PGE/Perl6Grammar.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/PGE/Perl6Grammar.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/PGE/Perl6Grammar.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -169,15 +169,15 @@
goto stmt_loop
stmt_end:
- .local pmc initpir, rulepir, iter, ns
+ .local pmc initpir, rulepir, it, ns
.local string namespace
initpir = new 'CodeString'
rulepir = new 'CodeString'
- iter = new 'Iterator', nstable
+ it = iter nstable
iter_loop:
- unless iter goto iter_end
- namespace = shift iter
- ns = iter[namespace]
+ unless it goto iter_end
+ namespace = shift it
+ ns = it[namespace]
$P0 = ns['rule']
rulepir .= $P0
if namespace == 'PGE::Grammar' goto ns_optable
@@ -353,15 +353,15 @@
optable = $P0['optable']
## build the list of traits
- .local pmc iter
+ .local pmc it
.local string traitlist
$P0 = stmt[0]
- iter = new 'Iterator', $P0
+ it = iter $P0
traitlist = ''
trait_loop:
- unless iter goto trait_end
+ unless it goto trait_end
.local pmc t
- t = shift iter
+ t = shift it
.local string trait, arg
trait = t['trait']
$P0 = t['arg']
Modified: branches/pluggable_runcore/runtime/parrot/library/PGE/Util.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/PGE/Util.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/PGE/Util.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -39,13 +39,13 @@
.param pmc mob # match object
.param pmc list :slurpy # message arguments
- .local pmc iter
+ .local pmc it
.local string message
message = ''
- iter = new 'Iterator', list
+ it = iter list
iter_loop:
- unless iter goto iter_end
- $S0 = shift iter
+ unless it goto iter_end
+ $S0 = shift it
message .= $S0
goto iter_loop
iter_end:
@@ -100,13 +100,13 @@
.param pmc mob # match object
.param pmc list :slurpy # message arguments
- .local pmc iter
+ .local pmc it
.local string message
message = ''
- iter = new 'Iterator', list
+ it = iter list
iter_loop:
- unless iter goto iter_end
- $S0 = shift iter
+ unless it goto iter_end
+ $S0 = shift it
message .= $S0
goto iter_loop
iter_end:
Modified: branches/pluggable_runcore/runtime/parrot/library/Protoobject.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/Protoobject.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/Protoobject.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -120,11 +120,11 @@
subc = subclass baseclass, name
unless attrs goto done_attrs
- .local pmc iter
- iter = new 'Iterator', attrs
+ .local pmc it
+ it = iter attrs
iter_loop:
- unless iter goto done_attrs
- $S0 = shift iter
+ unless it goto done_attrs
+ $S0 = shift it
addattribute subc, $S0
goto iter_loop
done_attrs:
Modified: branches/pluggable_runcore/runtime/parrot/library/SDL.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/SDL.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/SDL.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -219,6 +219,7 @@
loadlib ttf_lib, 'libSDL_ttf'
if ttf_lib goto initialize
loadlib ttf_lib, 'cygSDL_ttf-2-0-0'
+# RNH this is not trapping a non-existent libSDL_ttf library
unless ttf_lib goto error
initialize:
@@ -243,15 +244,21 @@
success:
dlfunc nci_sub, ttf_lib, 'TTF_OpenFont', 'pti'
set_hll_global ['SDL::NCI::TTF'], 'OpenFont', nci_sub
-
- dlfunc nci_sub, ttf_lib, 'TTF_RenderText_Solid', 'pptp'
+#RNH changes: all text routines expect an integer, not a pmc, for color parameter
+ dlfunc nci_sub, ttf_lib, 'TTF_RenderText_Solid', 'ppti'
set_hll_global ['SDL::NCI::TTF'], 'RenderText_Solid', nci_sub
- dlfunc nci_sub, ttf_lib, 'TTF_RenderUTF8_Solid', 'pptp'
+ dlfunc nci_sub, ttf_lib, 'TTF_RenderUTF8_Solid', 'ppti'
set_hll_global ['SDL::NCI::TTF'], 'RenderUTF8_Solid', nci_sub
# this one could be wrong
- dlfunc nci_sub, ttf_lib, 'TTF_RenderUNICODE_Solid', 'pptp'
+ dlfunc nci_sub, ttf_lib, 'TTF_RenderUNICODE_Solid', 'ppti'
set_hll_global ['SDL::NCI::TTF'], 'RenderUNICODE_Solid', nci_sub
+# RNH Additions. Add UTF8_Shaded and FontLine skip
+ dlfunc nci_sub, ttf_lib, 'TTF_RenderUTF8_Shaded', 'pptii'
+ set_hll_global ['SDL::NCI::TTF'], 'RenderUTF8_Shaded', nci_sub
+ dlfunc nci_sub, ttf_lib, 'TTF_FontLineSkip', 'ip'
+ set_hll_global ['SDL::NCI::TTF'], 'FontLineSkip', nci_sub
+#end additions
dlfunc nci_sub, ttf_lib, 'TTF_SizeText', 'ipt33'
set_hll_global ['SDL::NCI::TTF'], 'SizeText', nci_sub
Modified: branches/pluggable_runcore/runtime/parrot/library/SDL/Font.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/SDL/Font.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/SDL/Font.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -136,14 +136,29 @@
font_surface = new 'SDL::Surface'
font_surface.'init'( 'height' => 0, 'width' => 0 )
- .local pmc RenderText_Solid
- get_hll_global RenderText_Solid, ['SDL::NCI::TTF'], 'RenderText_Solid'
+# RNH use RenderUTF8 in preference to RenderText by default
+ .local pmc RenderUTF8_Solid
+ get_hll_global RenderUTF8_Solid, ['SDL::NCI::TTF'], 'RenderUTF8_Solid'
+
+ .local int color
+# RNH font routine takes color in the order rgb rather than bgr used by surface.pir hence cannot rely on color.get_integer
+ .local int component
+ .local pmc colors
+ colors = color_pmc.'color'()
+
+ component = colors['b']
+ component <<= 16
+ color = component
+
+ component = colors['g']
+ component <<= 8
+ color += component
- .local pmc color
- color = color_pmc.'color'()
+ component = colors['r']
+ color += component
.local pmc font_surface_struct
- font_surface_struct = RenderText_Solid( font, text, color )
+ font_surface_struct = RenderUTF8_Solid( font, text, color )
font_surface.'wrap_surface'( font_surface_struct )
.return( font_surface )
Modified: branches/pluggable_runcore/runtime/parrot/library/SDL/StopWatch.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/SDL/StopWatch.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/SDL/StopWatch.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -282,8 +282,7 @@
$I0 = array
if $I0 == 0 goto DISABLE
- array = new 'Iterator', array
- array = .ITERATE_FROM_START
+ array = iter array
LOOP:
unless array goto END
$P0 = shift array
Modified: branches/pluggable_runcore/runtime/parrot/library/Stream/Combiner.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/Stream/Combiner.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/Stream/Combiner.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -118,8 +118,7 @@
if i == 0 goto NOT_CONNECTED
# create an iterator for the sources
- new sources, 'Iterator', sources
- set sources, .ITERATE_FROM_START
+ sources = iter sources
LOOP:
# stream is connected if no sources are left
@@ -162,8 +161,7 @@
if i == 0 goto END_OF_STREAM
# create an iterator for the sources
- new sources, 'Iterator', sources
- set sources, .ITERATE_FROM_START
+ sources = iter sources
# create the string array
new args, 'ResizableStringArray'
Modified: branches/pluggable_runcore/runtime/parrot/library/Test/Class.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/Test/Class.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/Test/Class.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -258,13 +258,13 @@
.local pmc attribute
attribute = getattribute self, name
- .local pmc iter
- iter = new 'Iterator', attribute
+ .local pmc it
+ it = iter attribute
.local string meth_name
iter_loop:
- unless iter goto loop_end
- meth_name = shift iter
+ unless it goto loop_end
+ meth_name = shift it
self.meth_name()
goto iter_loop
loop_end:
@@ -276,14 +276,14 @@
.local pmc tests
tests = getattribute self, 'tests'
- .local pmc iter
- iter = new 'Iterator', tests
+ .local pmc it
+ it = iter tests
.local string meth_name
iter_loop:
- unless iter goto loop_end
+ unless it goto loop_end
self.'loop_over_methods'( 'setup' )
- meth_name = shift iter
+ meth_name = shift it
self.meth_name()
self.'loop_over_methods'( 'teardown' )
goto iter_loop
Modified: branches/pluggable_runcore/runtime/parrot/library/Test/More.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/Test/More.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/Test/More.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -577,8 +577,8 @@
.local pmc r_iter
.local int count
- l_iter = new 'Iterator', l_array
- r_iter = new 'Iterator', r_array
+ l_iter = iter l_array
+ r_iter = iter r_array
l_iter = 0
r_iter = 0
count = 0
@@ -641,7 +641,7 @@
.local pmc l_iter
.local int count
- l_iter = new 'Iterator', l_hash
+ l_iter = iter l_hash
l_iter = 0
count = 0
Modified: branches/pluggable_runcore/runtime/parrot/library/YAML/Dumper/Default.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/YAML/Dumper/Default.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/YAML/Dumper/Default.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -120,7 +120,7 @@
.sub genericHash :method
.param string name
.param pmc hash
- .local pmc iter
+ .local pmc it
.local string key
.local pmc val
.local pmc keys
@@ -133,13 +133,12 @@
print " {"
new keys, "ResizablePMCArray"
- new iter, "Iterator", hash
- set iter, 0
+ it = iter hash
iter_loop:
- unless iter, iter_end
+ unless it, iter_end
- shift key, iter
+ shift key, it
push keys, key
branch iter_loop
Modified: branches/pluggable_runcore/runtime/parrot/library/parrotlib.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/parrotlib.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/parrotlib.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -165,16 +165,15 @@
.param string name
.param pmc array
.local string ret
- .local pmc iter
+ .local pmc it
- iter = new 'Iterator', array
- iter = 0 #ITERATE_FROM_START
+ it = iter array
NEXT:
null ret
- unless iter goto END
+ unless it goto END
- $P0 = shift iter
+ $P0 = shift it
ret = $P0( name )
if_null ret, NEXT
END:
Modified: branches/pluggable_runcore/runtime/parrot/library/pcre.pir
==============================================================================
--- branches/pluggable_runcore/runtime/parrot/library/pcre.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/runtime/parrot/library/pcre.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -59,9 +59,19 @@
if 'cygwin' == osname goto LIB_CYGWIN
LIB_DEFAULT:
+# Plain name
loadlib libpcre, 'libpcre'
loaded = defined libpcre
if loaded goto LIB_LOADED
+# Shared object name
+ loadlib libpcre, 'libpcre.so'
+ loaded = defined libpcre
+ if loaded goto LIB_LOADED
+# soname of recent version
+ loadlib libpcre, 'libpcre.so.3'
+ loaded = defined libpcre
+ if loaded goto LIB_LOADED
+
branch LIB_FAILED
LIB_WIN32:
Modified: branches/pluggable_runcore/src/call/ops.c
==============================================================================
--- branches/pluggable_runcore/src/call/ops.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/call/ops.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -571,10 +571,9 @@
ARGIN(const char *sig), va_list args)
{
ASSERT_ARGS(Parrot_runops_fromc_arglist)
- void* retval;
Parrot_Context * const ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
+ void * const retval = set_retval(interp, *sig, ctx);
- retval = set_retval(interp, *sig, ctx);
Parrot_free_context(interp, ctx, 1);
return retval;
}
@@ -599,10 +598,9 @@
ARGIN(const char *sig), va_list args)
{
ASSERT_ARGS(Parrot_runops_fromc_arglist_reti)
- INTVAL retval;
Parrot_Context * const ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
+ const INTVAL retval = set_retval_i(interp, *sig, ctx);
- retval = set_retval_i(interp, *sig, ctx);
Parrot_free_context(interp, ctx, 1);
return retval;
}
@@ -627,10 +625,9 @@
ARGIN(const char *sig), va_list args)
{
ASSERT_ARGS(Parrot_runops_fromc_arglist_retf)
- FLOATVAL retval;
Parrot_Context * const ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
+ const FLOATVAL retval = set_retval_f(interp, *sig, ctx);
- retval = set_retval_f(interp, *sig, ctx);
Parrot_free_context(interp, ctx, 1);
return retval;
}
@@ -656,11 +653,9 @@
ARGIN(STRING *meth), ARGIN(const char *sig), va_list args)
{
ASSERT_ARGS(Parrot_run_meth_fromc_arglist)
- Parrot_Context *ctx;
- void* retval;
+ Parrot_Context * const ctx = runops_args(interp, sub, obj, meth, sig, args);
+ void * const retval = set_retval(interp, *sig, ctx);
- ctx = runops_args(interp, sub, obj, meth, sig, args);
- retval = set_retval(interp, *sig, ctx);
Parrot_free_context(interp, ctx, 1);
return retval;
}
@@ -687,10 +682,9 @@
ARGIN(STRING *meth), ARGIN(const char *sig), va_list args)
{
ASSERT_ARGS(Parrot_run_meth_fromc_arglist_reti)
- INTVAL retval;
Parrot_Context * const ctx = runops_args(interp, sub, obj, meth, sig, args);
+ const INTVAL retval = set_retval_i(interp, *sig, ctx);
- retval = set_retval_i(interp, *sig, ctx);
Parrot_free_context(interp, ctx, 1);
return retval;
}
@@ -716,10 +710,9 @@
ARGIN(STRING *meth), ARGIN(const char *sig), va_list args)
{
ASSERT_ARGS(Parrot_run_meth_fromc_arglist_retf)
- FLOATVAL retval;
Parrot_Context * const ctx = runops_args(interp, sub, obj, meth, sig, args);
+ const FLOATVAL retval = set_retval_f(interp, *sig, ctx);
- retval = set_retval_f(interp, *sig, ctx);
Parrot_free_context(interp, ctx, 1);
return retval;
}
Modified: branches/pluggable_runcore/src/debug.c
==============================================================================
--- branches/pluggable_runcore/src/debug.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/debug.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -48,6 +48,11 @@
/* Length of command line buffers */
#define DEBUG_CMD_BUFFER_LENGTH 255
+/* Easier register access */
+#define IREG(i) REG_INT(interp, (i))
+#define NREG(i) REG_NUM(interp, (i))
+#define SREG(i) REG_STR(interp, (i))
+#define PREG(i) REG_PMC(interp, (i))
typedef struct DebuggerCmd DebuggerCmd;
typedef struct DebuggerCmdList DebuggerCmdList;
@@ -207,6 +212,13 @@
}
}
+static void dbg_assign(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
+{
+ TRACEDEB_MSG("dbg_assign");
+
+ PDB_assign(pdb->debugee, cmd);
+}
+
static void dbg_break(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
{
TRACEDEB_MSG("dbg_break");
@@ -395,6 +407,14 @@
};
static const DebuggerCmd
+ cmd_assign = {
+ & dbg_assign,
+ "assign to a register",
+"Assign a value to a register. For example:\n\
+ a I0 42\n\
+ a N1 3.14\n\
+The first command sets I0 to 42 and the second sets N1 to 3.14."
+ },
cmd_break = {
& dbg_break,
"add a breakpoint",
@@ -549,6 +569,7 @@
};
DebuggerCmdList DebCmdList [] = {
+ { "assign", 'a', &cmd_assign },
{ "break", '\0', &cmd_break },
{ "continue", '\0', &cmd_continue },
{ "delete", 'd', &cmd_delete },
@@ -709,8 +730,8 @@
chop_newline(ARGMOD(char * buf))
{
ASSERT_ARGS(chop_newline)
- size_t l;
- l = strlen(buf);
+ const size_t l = strlen(buf);
+
if (l > 0 && buf [l - 1] == '\n')
buf [l - 1] = '\0';
}
@@ -1354,9 +1375,6 @@
if (pdb->script_file)
Parrot_io_eprintf(pdb->debugger, " in line %lu", pdb->script_line);
Parrot_io_eprintf(pdb->debugger, ". Try \"help\".");
-#if TRACE_DEBUGGER
- fprintf(stderr, " (parse_command result: %li)", c);
-#endif
close_script_file(interp);
return 1;
}
@@ -1712,8 +1730,8 @@
/* Add it to the head of the list */
if (pdb->watchpoint)
condition->next = pdb->watchpoint;
-
pdb->watchpoint = condition;
+ fprintf(stderr, "Adding watchpoint\n");
}
/*
@@ -1741,10 +1759,18 @@
TRACEDEB_MSG("PDB_set_break");
-
/* If there is a source file use line number, else opcode position */
+
if (pdb->file) {
+ TRACEDEB_MSG("PDB_set_break file");
+
+ if (!pdb->file->size) {
+ Parrot_io_eprintf(pdb->debugger,
+ "Can't set a breakpoint in empty file\n");
+ return;
+ }
+
/* If no line number was specified, set it at the current line */
if (ln != 0) {
unsigned long i;
@@ -1766,6 +1792,7 @@
/* Get the line to set it */
line = pdb->file->line;
+ TRACEDEB_MSG("PDB_set_break reading ops");
while (line->opcode != pdb->cur_opcode) {
line = line->next;
if (!line) {
@@ -1788,9 +1815,11 @@
breakpos = line->opcode;
}
else {
+ TRACEDEB_MSG("PDB_set_break no file");
breakpos = interp->code->base.data + ln;
}
+ TRACEDEB_MSG("PDB_set_break allocate breakpoint");
/* Allocate the new break point */
newbreak = mem_allocate_zeroed_typed(PDB_breakpoint_t);
@@ -2049,10 +2078,14 @@
{
ASSERT_ARGS(PDB_delete_breakpoint)
PDB_breakpoint_t * const breakpoint = PDB_find_breakpoint(interp, command);
+ const PDB_line_t *line;
+ long bp_id;
if (breakpoint) {
- const PDB_line_t *line = interp->pdb->file->line;
+ if (!interp->pdb->file)
+ Parrot_ex_throw_from_c_args(interp, NULL, 0, "No file loaded");
+ line = interp->pdb->file->line;
while (line->opcode != breakpoint->pc)
line = line->next;
@@ -2077,9 +2110,11 @@
else {
interp->pdb->breakpoint = NULL;
}
-
+ bp_id = breakpoint->id;
/* Kill the breakpoint */
mem_sys_free(breakpoint);
+
+ Parrot_io_eprintf(interp->pdb->debugger, "Breakpoint %li deleted\n", bp_id);
}
}
@@ -2580,17 +2615,6 @@
size += sprintf(&dest[size], INTVAL_FMT, i);
- /* If this is a constant dispatch arg to an "infix" op, then show
- the corresponding symbolic op name. */
- if (j == 1 && info->types[j - 1] == PARROT_ARG_IC
- && (STREQ(info->name, "infix") || STREQ(info->name, "n_infix"))) {
- PARROT_ASSERT(size + 20 < space);
-
- size += sprintf(&dest[size], " [%s]",
- /* [kludge: the "2+" skips the leading underscores. --
- rgr, 6-May-07.] */
- 2 + Parrot_MMD_method_name(interp, op[j]));
- }
break;
case PARROT_ARG_NC:
{
@@ -3092,7 +3116,7 @@
/* don't walk off the end of the program into neverland */
if (pc >= interp->code->base.data + interp->code->base.size)
- return;
+ break;
}
newline->number = pline->number + 1;
@@ -3161,6 +3185,59 @@
/*
+=item C<void PDB_assign(PARROT_INTERP, const char *command)>
+
+Assign to registers.
+
+=cut
+
+*/
+
+void
+PDB_assign(PARROT_INTERP, ARGIN(const char *command))
+{
+ ASSERT_ARGS(PDB_assign)
+ unsigned long register_num;
+ char reg_type;
+ char *string;
+ int t;
+
+ /* smallest valid commad length is 4, i.e. "I0 1" */
+ if (strlen(command) < 4) {
+ fprintf(stderr, "Must give a register number and value to assign\n");
+ return;
+ }
+ reg_type = (char) command[0];
+ command++;
+ register_num = get_ulong(&command, 0);
+
+ switch (reg_type) {
+ case 'I':
+ t = REGNO_INT;
+ IREG(register_num) = get_ulong(&command, 0);
+ break;
+ case 'N':
+ t = REGNO_NUM;
+ NREG(register_num) = atof(command);
+ break;
+ case 'S':
+ t = REGNO_STR;
+ SREG(register_num) = Parrot_str_new(interp, command, strlen(command));
+ break;
+ case 'P':
+ t = REGNO_PMC;
+ fprintf(stderr, "Assigning to PMCs is not currently supported\n");
+ return;
+ default:
+ fprintf(stderr, "Invalid register type %c\n", reg_type);
+ return;
+ }
+ Parrot_io_eprintf(interp, "\n %c%u = ", reg_type, register_num);
+ Parrot_io_eprintf(interp, "%s\n", GDB_print_reg(interp, t, register_num));
+}
+
+/*
+
=item C<void PDB_list(PARROT_INTERP, const char *command)>
Show lines from the source code file.
@@ -3242,11 +3319,13 @@
PDB_eval(PARROT_INTERP, ARGIN(const char *command))
{
ASSERT_ARGS(PDB_eval)
- /* This code is almost certainly wrong. The Parrot debugger needs love. */
- opcode_t *run = PDB_compile(interp, command);
- if (run)
- DO_OP(run, interp);
+ PDB_t *pdb = interp->pdb;
+ Interp *warninterp = (interp->pdb && interp->pdb->debugger) ?
+ interp->pdb->debugger : interp;
+ TRACEDEB_MSG("PDB_eval");
+ UNUSED(command);
+ Parrot_eprintf(warninterp, "The eval command is currently unimplemeneted\n");
}
/*
@@ -3269,21 +3348,11 @@
PDB_compile(PARROT_INTERP, ARGIN(const char *command))
{
ASSERT_ARGS(PDB_compile)
- STRING *buf;
- const char *end = "\nend\n";
- STRING *key = CONST_STRING(interp, "PASM");
- PMC *compreg_hash = VTABLE_get_pmc_keyed_int(interp,
- interp->iglobals, IGLOBALS_COMPREG_HASH);
- PMC *compiler = VTABLE_get_pmc_keyed_str(interp, compreg_hash, key);
-
- if (!VTABLE_defined(interp, compiler)) {
- fprintf(stderr, "Couldn't find PASM compiler");
- return NULL;
- }
- buf = Parrot_sprintf_c(interp, "%s%s", command, end);
-
- return VTABLE_invoke(interp, compiler, buf);
+ UNUSED(command);
+ Parrot_ex_throw_from_c_args(interp, NULL,
+ EXCEPTION_UNIMPLEMENTED,
+ "PDB_compile ('PASM1' compiler) has been deprecated");
}
/*
@@ -3328,6 +3397,8 @@
{
ASSERT_ARGS(PDB_print)
const char * const s = GDB_P(interp->pdb->debugee, command);
+
+ TRACEDEB_MSG("PDB_print");
Parrot_io_eprintf(interp, "%s\n", s);
}
@@ -3561,24 +3632,32 @@
GDB_print_reg(PARROT_INTERP, int t, int n)
{
ASSERT_ARGS(GDB_print_reg)
+ char * string;
if (n >= 0 && n < CONTEXT(interp)->n_regs_used[t]) {
switch (t) {
case REGNO_INT:
- return Parrot_str_from_int(interp, REG_INT(interp, n))->strstart;
+ return Parrot_str_from_int(interp, IREG(n))->strstart;
case REGNO_NUM:
- return Parrot_str_from_num(interp, REG_NUM(interp, n))->strstart;
+ return Parrot_str_from_num(interp, NREG(n))->strstart;
case REGNO_STR:
- return REG_STR(interp, n)->strstart;
+ /* This hack is needed because we occasionally are told
+ that we have string registers when we actually don't */
+ string = (char *) SREG(n);
+
+ if (string == '\0')
+ return "";
+ else
+ return SREG(n)->strstart;
case REGNO_PMC:
/* prints directly */
- trace_pmc_dump(interp, REG_PMC(interp, n));
+ trace_pmc_dump(interp, PREG(n));
return "";
default:
break;
}
}
- return "no such reg";
+ return "no such register";
}
/*
@@ -3604,11 +3683,13 @@
int t;
char reg_type;
+ TRACEDEB_MSG("GDB_P");
/* Skip leading whitespace. */
while (isspace((unsigned char)*s))
s++;
reg_type = (unsigned char) toupper((unsigned char)*s);
+
switch (reg_type) {
case 'I': t = REGNO_INT; break;
case 'N': t = REGNO_NUM; break;
@@ -3633,7 +3714,7 @@
return GDB_print_reg(interp, t, n);
}
else
- return "no such reg";
+ return "no such register";
}
@@ -3643,7 +3724,7 @@
=head1 SEE ALSO
-F<include/parrot/debugger.h>, F<src/pdb.c> and F<ops/debug.ops>.
+F<include/parrot/debugger.h>, F<src/parrot_debugger.c> and F<ops/debug.ops>.
=head1 HISTORY
Copied: branches/pluggable_runcore/src/dynoplibs/math.ops (from r40540, trunk/src/dynoplibs/math.ops)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/src/dynoplibs/math.ops Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/src/dynoplibs/math.ops)
@@ -0,0 +1,79 @@
+/*
+ * $Id$
+** math.ops
+*/
+
+BEGIN_OPS_PREAMBLE
+
+#include <math.h>
+
+END_OPS_PREAMBLE
+
+=head1 NAME
+
+math.ops - Mathematical Opcodes
+
+=cut
+
+=head1 DESCRIPTION
+
+Parrot's library of mathematical ops.
+
+To use this library of ops, add this directive to your PIR:
+
+ .loadlib 'math_ops'
+
+=cut
+
+=over
+
+=item B<rand>(out NUM)
+
+Set $1 to a random floating point number between 0 and 1, inclusive.
+
+=cut
+
+inline op rand(out NUM) {
+ $1 = Parrot_float_rand(0);
+}
+
+=item B<rand>(out NUM, in NUM)
+
+Set $1 to a random floating point number between 0 and and $2, inclusive.
+
+=cut
+
+inline op rand(out NUM, in NUM) {
+ $1 = $2 * Parrot_float_rand(0);
+}
+
+=item B<rand>(out NUM, in NUM, in NUM)
+
+Set $1 to a random floating point number between $2 and and $3, inclusive.
+
+=cut
+
+inline op rand(out NUM, in NUM, in NUM) {
+ $1 = $2 + ($3 - $2) * Parrot_float_rand(0);
+}
+
+=back
+
+=head1 COPYRIGHT
+
+Copyright (C) 2001-2009, Parrot Foundation.
+
+=head1 LICENSE
+
+This program is free software. It is subject to the same license
+as the Parrot interpreter itself.
+
+=cut
+
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Modified: branches/pluggable_runcore/src/dynoplibs/obscure.ops
==============================================================================
--- branches/pluggable_runcore/src/dynoplibs/obscure.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/dynoplibs/obscure.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,19 +3,22 @@
** obscure.ops
*/
+BEGIN_OPS_PREAMBLE
+
#include <math.h>
-VERSION = PARROT_VERSION;
+END_OPS_PREAMBLE
=head1 NAME
-obscure.ops - Obscure Mathmatical Opcodes
+obscure.ops - Obscure Mathematical Opcodes
=cut
=head1 DESCRIPTION
-Parrot's library of obscure ops.
+Parrot's library of obscure mathematical ops. These turn common
+trig expressions into a single op.
To use this library of ops, add this directive to your PIR:
@@ -101,7 +104,7 @@
=head1 COPYRIGHT
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2009, Parrot Foundation.
=head1 LICENSE
Modified: branches/pluggable_runcore/src/dynpmc/dynlexpad.pmc
==============================================================================
--- branches/pluggable_runcore/src/dynpmc/dynlexpad.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/dynpmc/dynlexpad.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -189,6 +189,7 @@
PARROT_DYNLEXPAD(SELF)->hash = NULL;
}
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/dynpmc/foo.pmc
==============================================================================
--- branches/pluggable_runcore/src/dynpmc/foo.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/dynpmc/foo.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -8,7 +8,7 @@
* proper inheritance - for testing only
*/
-pmclass Foo dynpmc provides scalar extends Integer {
+pmclass Foo dynpmc group foo_group provides scalar extends Integer {
VTABLE INTVAL get_integer() {
return 42;
Copied: branches/pluggable_runcore/src/dynpmc/foo2.pmc (from r40540, trunk/src/dynpmc/foo2.pmc)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/src/dynpmc/foo2.pmc Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/src/dynpmc/foo2.pmc)
@@ -0,0 +1,25 @@
+/*
+ * $Id$
+ * Copyright (C) 2009, Parrot Foundation.
+ */
+
+/*
+ * Sample Foo2 class used to verify dynamic loading and
+ * proper inheritance - for testing only
+ */
+
+pmclass Foo2 dynpmc group foo_group provides scalar extends Foo {
+
+ VTABLE INTVAL get_integer() {
+ INTVAL i = SUPER();
+ return i + 1;
+ }
+}
+
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Modified: branches/pluggable_runcore/src/dynpmc/gdbmhash.pmc
==============================================================================
--- branches/pluggable_runcore/src/dynpmc/gdbmhash.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/dynpmc/gdbmhash.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -114,6 +114,7 @@
mem_sys_free(
((Parrot_GDBMHash_attributes *)PMC_data(SELF))->db_handle);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
VTABLE void* get_pointer() {
Deleted: branches/pluggable_runcore/src/dynpmc/pair.pmc
==============================================================================
--- branches/pluggable_runcore/src/dynpmc/pair.pmc Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,355 +0,0 @@
-/*
-Copyright (C) 2005-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/pmc/pair.pmc - Pair PMC
-
-=head1 DESCRIPTION
-
-A Pair PMC represents one key => value mapping like a one element hash.
-
-'EclectusPair' subclasses this.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "pmc_pair.h"
-
-pmclass Pair dynpmc need_ext {
- ATTR PMC *key;
- ATTR PMC *value;
-
-/*
-
-=item C<void init()>
-
-Initializes the instance.
-
-=item C<PMC *instantiate(PMC *sig)>
-
-Class method to construct an Integer according to passed arguments.
-
-=cut
-
-*/
-
- VTABLE void init() {
- PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_Pair_attributes);
- PObj_custom_mark_SET(SELF);
- }
-
- VTABLE PMC *instantiate(PMC *sig) {
- return PMCNULL;
-
- /* TODO -- really create this thing */
-#if 0
- PMC * const _class = REG_PMC(interp, 2);
- Parrot_Pair_attributes *pair = PARROT_PAIR(SELF);
- const int argcP = REG_INT(interp, 3);
- const int argcS = REG_INT(interp, 2);
-
- SELF = pmc_new(INTERP, _class->vtable->base_type);
- if (argcS == 1 && argcP == 1) {
- PObj_key_is_string_SET(SELF);
- pair->key = REG_STR(interp, 5);
- pair->value = REG_PMC(interp, 5);
- }
- else if (argcP == 2) {
- pair->key = REG_PMC(interp, 5);
- pair->value = REG_PMC(interp, 6);
- }
- else
- Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
- "wrong argument count for Pair creation");
-
- return SELF;
-#endif
- }
-/*
-
-=item C<void mark()>
-
-Marks the hash as live.
-
-=cut
-
-*/
-
- VTABLE void mark() {
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
-
- if (pair->key)
- Parrot_gc_mark_PObj_alive(INTERP, (PObj *)pair->key);
-
- if (pair->value)
- Parrot_gc_mark_PObj_alive(INTERP, (PObj *)pair->value);
- }
-
-/*
-
-=item C<PMC *get_pmc_keyed_str(STRING *key)>
-
-=item C<PMC *get_pmc_keyed(PMC *key)>
-
-=cut
-
-*/
-
- VTABLE PMC *get_pmc_keyed_str(STRING *key) {
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
- /* check key ? */
- return pair->value;
- }
-
- VTABLE PMC *get_pmc_keyed(PMC *key) {
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
- /* check key ? */
- return pair->value;
- }
-
-/*
-
-=item C<void set_pmc_keyed(PMC *key, PMC *value)>
-
-=item C<void set_pmc_keyed_str(STRING *key, PMC *value)>
-
-Set key and value. The key can only set once.
-
-=item C<void assign_pmc(PMC *value)>
-
-Set the value of the Pair.
-
-=cut
-
-*/
-
- VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
-
- if (pair->key)
- Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
- "attempt to set existing Pair key");
-
-
- pair->key = key;
- pair->value = value;
- }
-
-
- VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) {
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
- PMC *key_pmc;
-
- if (pair->key)
- Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
- "attempt to set existing Pair key");
-
-
- key_pmc = pmc_new(interp, enum_class_String);
- VTABLE_set_string_native(interp, key_pmc, key);
-
- pair->key = key_pmc;
- pair->value = value;
- }
-
- VTABLE void assign_pmc(PMC *value) {
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
- pair->value = value;
- }
-
-/*
-
-=item C<void set_pmc(PMC *pair)>
-
-Sets this pair to hold the value of another.
-
-=cut
-
-*/
-
- VTABLE void set_pmc(PMC *pair) {
- if (pair->vtable->base_type == SELF->vtable->base_type) {
- Parrot_Pair_attributes * const from = PARROT_PAIR(SELF);
- Parrot_Pair_attributes * const to = PARROT_PAIR(SELF);
-
- to->key = from->key;
- to->value = from->value;
- }
- else
- Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
- "Can only set a pair to another pair.");
- }
-
-/*
-
-=item C<INTVAL is_equal(PMC *value)>
-
-The C<==> operation.
-
-Check if two Pairs hold the same keys and values.
-
-=cut
-
-*/
-
- VTABLE INTVAL is_equal(PMC *value) {
- Parrot_Pair_attributes * const from = PARROT_PAIR(SELF);
- Parrot_Pair_attributes * const to = PARROT_PAIR(SELF);
- PMC *p1, *p2;
- PMC *k1, *k2;
- INTVAL result;
-
- if (value->vtable->base_type != SELF->vtable->base_type)
- return 0;
-
- k1 = from->key;
- k2 = to->key;
-
- Parrot_mmd_multi_dispatch_from_c_args(INTERP, "is_equal",
- "PP->I", k1, k2, &result);
- if (!result)
- return 0;
-
- p1 = from->value;
- p2 = to->value;
-
- if (!p1 && !p2)
- return 1;
- else
- return 0;
- }
-
-/*
-
-=item C<void visit(visit_info *info)>
-
-Used during archiving to visit the elements in the pair.
-
-=item C<void freeze(visit_info *info)>
-
-Used to archive the Pair.
-
-=item C<void thaw(visit_info *info)>
-
-Used to unarchive the Pair.
-
-=cut
-
-*/
-
- VTABLE void visit(visit_info *info) {
- PMC **pos;
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
- DPOINTER ** const temp_pos = (DPOINTER **)pair->key;
- info->thaw_ptr = (PMC **)temp_pos;
- (info->visit_pmc_now)(INTERP, (PMC *)temp_pos, info);
-
- pos = &pair->value;
- info->thaw_ptr = pos;
-
- (info->visit_pmc_now)(INTERP, *pos, info);
-
- SUPER(info);
- }
-
- VTABLE void freeze(visit_info *info) {
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
- IMAGE_IO * const io = info->image_io;
- SUPER(info);
- VTABLE_push_pmc(INTERP, io, pair->key);
- VTABLE_push_pmc(INTERP, io, pair->value);
- }
-
- VTABLE void thaw(visit_info *info) {
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
- IMAGE_IO * const io = info->image_io;
-
- SUPER(info);
-
- pair->key = VTABLE_shift_pmc(interp, io);
- pair->value = VTABLE_shift_pmc(interp, io);
- }
-/*
-
-=back
-
-=head2 Methods
-
-=over 4
-
-=item C<METHOD key()>
-
-Return the key of the pair.
-
-=cut
-
-*/
-
- METHOD key() {
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
- PMC *key = pair->key;
-
- RETURN(PMC *key);
- }
-
-/*
-
-=item C<METHOD value()>
-
-Return the value of the pair.
-
-=cut
-
-*/
-
- METHOD value() {
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
- PMC * const value = pair->value;
- RETURN(PMC *value);
- }
-
-/*
-
-=item C<METHOD kv()>
-
-Return a tuple of (key, value) for the pair.
-
-=cut
-
-*/
-
- METHOD kv() {
- Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
- PMC * const t = pmc_new(INTERP,
- Parrot_get_ctx_HLL_type(INTERP, enum_class_FixedPMCArray));
-
- VTABLE_set_integer_native(INTERP, t, 2);
- VTABLE_set_pmc_keyed_int(INTERP, t, 0, pair->key);
-
- VTABLE_set_pmc_keyed_int(INTERP, t, 1, pair->value);
- RETURN(PMC *t);
- }
-}
-
-/*
-
-=back
-
-=cut
-
-*/
-
-/*
- * Local variables:
- * c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
Modified: branches/pluggable_runcore/src/dynpmc/rational.pmc
==============================================================================
--- branches/pluggable_runcore/src/dynpmc/rational.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/dynpmc/rational.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -66,28 +66,19 @@
/*
-=item * static void rat_add_integer(PARROT_INTERP, PMC *self, int value, PMC *dest)
+=item * static void rat_add_integer(PARROT_INTERP, PMC *self, int value)
-Adds an integer "value" to a Rational-PMC and stores the result in (another) Rational-PMC.
+Adds an integer "value" to a Rational-PMC inplace.
=cut
*/
-static void rat_add_integer(PARROT_INTERP, PMC *self, int value, PMC *dest) {
+static void rat_add_integer(PARROT_INTERP, PMC *self, int value) {
#ifdef PARROT_HAS_GMP
mpq_t t;
-
- if (dest) {
- if (self != dest)
- pmc_reuse(interp, dest, self->vtable->base_type, 0);
- }
- else {
- dest = pmc_new(interp, self->vtable->base_type);
- }
-
mpq_init(t);
mpq_set_si(t, (int) value, 1);
- mpq_add(RT(dest), RT(self), t);
+ mpq_add(RT(self), RT(self), t);
mpq_clear(t);
#else
RAISE_EXCEPTION
@@ -96,26 +87,21 @@
/*
-=item * static void rat_add_float(PARROT_INTERP, PMC *self, double value, PMC *dest)
+=item * static void rat_add_float(PARROT_INTERP, PMC *self, double value)
-Adds a float "value" to a Rational-PMC and stores the result in (another) Rational-PMC. "value" is
-first conveted to a rational using GMPs mpq_set_d-function. This is meant to be exact.
+Adds a float "value" to a Rational-PMC in-place. "value" is first conveted to a
+rational using GMPs mpq_set_d-function. This is meant to be exact.
=cut
*/
-static void rat_add_float(PARROT_INTERP, PMC *self, double value, PMC *dest) {
+static void rat_add_float(PARROT_INTERP, PMC *self, double value) {
#ifdef PARROT_HAS_GMP
mpq_t t;
- if (dest)
- pmc_reuse(interp, dest, self->vtable->base_type, 0);
- else
- dest = pmc_new(interp, self->vtable->base_type);
-
mpq_init(t);
mpq_set_d(t, (double) value);
- mpq_add(RT(dest), RT(self), t);
+ mpq_add(RT(self), RT(self), t);
mpq_clear(t);
#else
RAISE_EXCEPTION
@@ -124,22 +110,16 @@
/*
-=item * static void rat_multiply_integer(PARROT_INTERP, PMC *self, int value, PMC *dest)
+=item * static void rat_multiply_integer(PARROT_INTERP, PMC *self, int value)
-Multiplys a Rational-PMC with an integer "value" and stores the result in (another) Rational-PMC.
+Multiplys a Rational-PMC with an integer "value" in-place.
=cut
*/
-static void rat_multiply_integer(PARROT_INTERP, PMC *self, int value, PMC *dest) {
+static void rat_multiply_integer(PARROT_INTERP, PMC *self, int value) {
#ifdef PARROT_HAS_GMP
- if (dest)
- pmc_reuse(interp, dest, self->vtable->base_type, 0);
- else
- dest = pmc_new(interp, self->vtable->base_type);
-
- mpz_mul_ui(mpq_numref(RT(dest)), mpq_numref(RT(self)), (unsigned int) value);
- mpq_set_den(RT(dest), mpq_denref(RT(self)));
+ mpz_mul_ui(mpq_numref(RT(self)), mpq_numref(RT(self)), (unsigned int) value);
#else
RAISE_EXCEPTION
#endif
@@ -147,25 +127,20 @@
/*
-=item * static void rat_multiply_float(PARROT_INTERP, PMC *self, double value, PMC *dest)
+=item * static void rat_multiply_float(PARROT_INTERP, PMC *self, double value)
-Multiplies a Rational-PMC with a float "value" and stores the result in (another) Rational-PMC.
+Multiplies a Rational-PMC with a float "value" in-place.
=cut
*/
-static void rat_multiply_float(PARROT_INTERP, PMC *self, double value, PMC *dest) {
+static void rat_multiply_float(PARROT_INTERP, PMC *self, double value) {
#ifdef PARROT_HAS_GMP
mpq_t t;
- if (dest)
- pmc_reuse(interp, dest, self->vtable->base_type, 0);
- else
- dest = pmc_new(interp, self->vtable->base_type);
-
mpq_init(t);
mpq_set_d(t, (double) value);
- mpq_mul(RT(dest), RT(self), t);
+ mpq_mul(RT(self), RT(self), t);
mpq_clear(t);
#else
RAISE_EXCEPTION
@@ -174,25 +149,20 @@
/*
-=item * static void rat_divide_integer(PARROT_INTERP, PMC *self, int value, PMC *dest)
+=item * static void rat_divide_integer(PARROT_INTERP, PMC *self, int value)
-Divides a Rational-PMC through an integer "value" and stores the result in (another) Rational-PMC.
+Divides a Rational-PMC through an integer "value" in-place.
=cut
*/
-static void rat_divide_integer(PARROT_INTERP, PMC *self, int value, PMC *dest) {
+static void rat_divide_integer(PARROT_INTERP, PMC *self, int value) {
#ifdef PARROT_HAS_GMP
mpq_t t;
- if (dest)
- pmc_reuse(interp, dest, self->vtable->base_type, 0);
- else
- dest = pmc_new(interp, self->vtable->base_type);
-
mpq_init(t);
mpq_set_si(t, (int) value, 1);
- mpq_div(RT(dest), RT(self), t);
+ mpq_div(RT(self), RT(self), t);
mpq_clear(t);
#else
RAISE_EXCEPTION
@@ -201,25 +171,20 @@
/*
-=item * static void rat_divide_float(PARROT_INTERP, PMC *self, double value, PMC *dest)
+=item * static void rat_divide_float(PARROT_INTERP, PMC *self, double value)
-Divides a Rational-PMC through a float "value" and stores the result in (another) Rational-PMC.
+Divides a Rational-PMC through a float "value" in-place.
=cut
*/
-static void rat_divide_float(PARROT_INTERP, PMC *self, double value, PMC *dest) {
+static void rat_divide_float(PARROT_INTERP, PMC *self, double value) {
#ifdef PARROT_HAS_GMP
mpq_t t;
- if (dest)
- pmc_reuse(interp, dest, self->vtable->base_type, 0);
- else
- dest = pmc_new(interp, self->vtable->base_type);
-
mpq_init(t);
mpq_set_d(t, (double) value);
- mpq_div(RT(dest), RT(self), t);
+ mpq_div(RT(self), RT(self), t);
mpq_clear(t);
#else
RAISE_EXCEPTION
@@ -228,32 +193,27 @@
/*
-=item * static void rat_power_int(PARROT_INTERP, PMC *self, int value, PMC *dest)
+=item * static void rat_power_int(PARROT_INTERP, PMC *self, int value)
-Calculates the power of a Rational-PMC to an exponent value and stores the result in (another)
-Rational-PMC.
+Calculates the power of a Rational-PMC to an exponent value in-place.
=cut
*/
-static void rat_power_int(PARROT_INTERP, PMC *self, int value, PMC *dest) {
+static void rat_power_int(PARROT_INTERP, PMC *self, int value) {
#ifdef PARROT_HAS_GMP
- mpz_t t;
+ mpz_t num, den;
+
+ mpq_get_num(num, RT(self));
+ mpq_get_den(den, RT(self));
- if (dest)
- pmc_reuse(interp, dest, self->vtable->base_type, 0);
- else
- dest = pmc_new(interp, self->vtable->base_type);
-
- mpq_get_num(t, RT(self));
- mpz_pow_ui(t, t, (unsigned int) value);
- mpq_set_num(RT(dest), t);
- mpz_clear(t);
-
- mpq_get_den(t, RT(self));
- mpz_pow_ui(t, t, (unsigned int) value);
- mpq_set_den(RT(dest), t);
- mpz_clear(t);
+ mpz_pow_ui(num, num, (unsigned int) value);
+ mpq_set_num(RT(self), num);
+ mpz_clear(num);
+
+ mpz_pow_ui(den, den, (unsigned int) value);
+ mpq_set_den(RT(self), den);
+ mpz_clear(den);
#else
RAISE_EXCEPTION
#endif
@@ -322,14 +282,8 @@
*/
VTABLE PMC *clone() {
#ifdef PARROT_HAS_GMP
- mpz_t num, den;
PMC * const ret = pmc_new(INTERP, SELF->vtable->base_type);
- mpq_get_num(num, RT(SELF));
- mpq_get_den(den, RT(SELF));
- mpq_set_num(RT(ret), num);
- mpq_set_den(RT(ret), den);
- mpz_clear(num);
- mpz_clear(den);
+ mpq_set(RT(ret), RT(SELF));
return ret;
#else
RAISE_EXCEPTION
@@ -348,6 +302,7 @@
mpq_clear(RT(SELF));
mem_sys_free(RT(SELF));
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
#else
RAISE_EXCEPTION
#endif
@@ -554,21 +509,20 @@
*/
MULTI PMC *add(Integer value, PMC* dest) {
- rat_add_integer(INTERP, SELF, VTABLE_get_integer(INTERP, value), dest);
+ dest = STATICSELF.clone();
+ rat_add_integer(INTERP, dest, VTABLE_get_integer(INTERP, value));
return dest;
}
MULTI PMC *add(Float value, PMC* dest) {
- rat_add_float(INTERP, SELF, VTABLE_get_number(INTERP, value), dest);
+ dest = STATICSELF.clone();
+ rat_add_float(INTERP, dest, VTABLE_get_number(INTERP, value));
return dest;
}
MULTI PMC *add(Rational value, PMC* dest) {
#ifdef PARROT_HAS_GMP
- if (dest)
- pmc_reuse(interp, dest, SELF->vtable->base_type, 0);
- else
- dest = pmc_new(INTERP, SELF->vtable->base_type);
+ dest = pmc_new(INTERP, SELF->vtable->base_type);
mpq_add(RT(dest), RT(SELF), RT(value));
return dest;
@@ -590,11 +544,11 @@
*/
MULTI void i_add(Integer value) {
- rat_add_integer(INTERP, SELF, (int) VTABLE_get_integer(INTERP, value), SELF);
+ rat_add_integer(INTERP, SELF, (int) VTABLE_get_integer(INTERP, value));
}
MULTI void i_add(Float value) {
- rat_add_float(INTERP, SELF, (double) VTABLE_get_number(INTERP, value), SELF);
+ rat_add_float(INTERP, SELF, (double) VTABLE_get_number(INTERP, value));
}
MULTI void i_add(Rational value) {
@@ -618,7 +572,8 @@
*/
VTABLE PMC *add_int(INTVAL value, PMC* dest) {
- rat_add_integer(INTERP, SELF, (int) value, dest);
+ dest = STATICSELF.clone();;
+ rat_add_integer(INTERP, dest, (int) value);
return dest;
}
@@ -630,7 +585,7 @@
*/
VTABLE void i_add_int(INTVAL value) {
- rat_add_integer(INTERP, SELF, (int) value, SELF);
+ rat_add_integer(INTERP, SELF, (int) value);
}
/*
@@ -641,7 +596,8 @@
*/
VTABLE PMC *add_float(FLOATVAL value, PMC* dest) {
- rat_add_float(INTERP, SELF, (double) value, dest);
+ dest = STATICSELF.clone();
+ rat_add_float(INTERP, dest, (double) value);
return dest;
}
@@ -653,7 +609,7 @@
*/
VTABLE void i_add_float(FLOATVAL value) {
- rat_add_float(INTERP, SELF, (double) value, SELF);
+ rat_add_float(INTERP, SELF, (double) value);
}
/*
@@ -664,22 +620,20 @@
*/
MULTI PMC *subtract(Integer value, PMC* dest) {
- rat_add_integer(INTERP, SELF, -((int) VTABLE_get_integer(INTERP, value)), dest);
+ dest = STATICSELF.clone();
+ rat_add_integer(INTERP, dest, -((int) VTABLE_get_integer(INTERP, value)));
return dest;
}
MULTI PMC *subtract(Float value, PMC* dest) {
- rat_add_float(INTERP, SELF, - ((double) VTABLE_get_number(INTERP, value)), dest);
+ dest = STATICSELF.clone();
+ rat_add_float(INTERP, dest, - ((double) VTABLE_get_number(INTERP, value)));
return dest;
}
MULTI PMC *subtract(Rational value, PMC* dest) {
#ifdef PARROT_HAS_GMP
- if (dest)
- pmc_reuse(interp, dest, SELF->vtable->base_type, 0);
- else
- dest = pmc_new(INTERP, SELF->vtable->base_type);
-
+ dest = pmc_new(INTERP, SELF->vtable->base_type);
mpq_sub(RT(dest), RT(SELF), RT(value));
return dest;
#else
@@ -700,11 +654,11 @@
*/
MULTI void i_subtract(Integer value) {
- rat_add_integer(INTERP, SELF, -((int) VTABLE_get_integer(INTERP, value)), SELF);
+ rat_add_integer(INTERP, SELF, -((int) VTABLE_get_integer(INTERP, value)));
}
MULTI void i_subtract(Float value) {
- rat_add_float(INTERP, SELF, - ((double) VTABLE_get_number(INTERP, value)), SELF);
+ rat_add_float(INTERP, SELF, - ((double) VTABLE_get_number(INTERP, value)));
}
MULTI void i_subtract(Rational value) {
@@ -728,7 +682,8 @@
*/
VTABLE PMC *subtract_int(INTVAL value, PMC* dest) {
- rat_add_integer(INTERP, SELF, -((int) value), dest);
+ dest = STATICSELF.clone();
+ rat_add_integer(INTERP, dest, -((int) value));
return dest;
}
@@ -740,7 +695,7 @@
*/
VTABLE void i_subtract_int(INTVAL value) {
- rat_add_integer(INTERP, SELF, -((int) value), SELF);
+ rat_add_integer(INTERP, SELF, -((int) value));
}
/*
@@ -751,7 +706,8 @@
*/
VTABLE PMC *subtract_float(FLOATVAL value, PMC* dest) {
- rat_add_float(INTERP, SELF, -((double) value), dest);
+ dest = STATICSELF.clone();
+ rat_add_float(INTERP, dest, -((double) value));
return dest;
}
@@ -763,7 +719,7 @@
*/
VTABLE void i_subtract_float(FLOATVAL value) {
- rat_add_float(INTERP, SELF, -((double) value), SELF);
+ rat_add_float(INTERP, SELF, -((double) value));
}
/*
@@ -774,22 +730,20 @@
*/
MULTI PMC *multiply(Integer value, PMC* dest) {
- rat_multiply_integer(INTERP, SELF, (int) VTABLE_get_integer(INTERP, value), dest);
+ dest = STATICSELF.clone();
+ rat_multiply_integer(INTERP, dest, (int) VTABLE_get_integer(INTERP, value));
return dest;
}
MULTI PMC *multiply(Float value, PMC* dest) {
- rat_multiply_float(INTERP, SELF, (double) VTABLE_get_number(INTERP, value), dest);
+ dest = STATICSELF.clone();
+ rat_multiply_float(INTERP, dest, (double) VTABLE_get_number(INTERP, value));
return dest;
}
MULTI PMC *multiply(Rational value, PMC* dest) {
#ifdef PARROT_HAS_GMP
- if (dest)
- pmc_reuse(interp, dest, SELF->vtable->base_type, 0);
- else
- dest = pmc_new(INTERP, SELF->vtable->base_type);
-
+ dest = pmc_new(INTERP, SELF->vtable->base_type);
mpq_mul(RT(dest), RT(SELF), RT(value));
return dest;
#else
@@ -810,11 +764,11 @@
*/
MULTI void i_multiply(Integer value) {
- rat_multiply_integer(INTERP, SELF, (int) VTABLE_get_integer(INTERP, value), SELF);
+ rat_multiply_integer(INTERP, SELF, (int) VTABLE_get_integer(INTERP, value));
}
MULTI void i_multiply(Float value) {
- rat_multiply_float(INTERP, SELF, (double) VTABLE_get_number(INTERP, value), SELF);
+ rat_multiply_float(INTERP, SELF, (double) VTABLE_get_number(INTERP, value));
}
MULTI void i_multiply(Rational value) {
@@ -838,7 +792,8 @@
*/
VTABLE PMC *multiply_int(INTVAL value, PMC* dest) {
- rat_multiply_integer(INTERP, SELF, (int) value, dest);
+ dest = STATICSELF.clone();
+ rat_multiply_integer(INTERP, dest, (int) value);
return dest;
}
@@ -850,7 +805,7 @@
*/
VTABLE void i_multiply_int(INTVAL value) {
- rat_multiply_integer(INTERP, SELF, (int) value, SELF);
+ rat_multiply_integer(INTERP, SELF, (int) value);
}
/*
@@ -861,7 +816,8 @@
*/
VTABLE PMC *multiply_float(FLOATVAL value, PMC* dest) {
- rat_multiply_float(INTERP, SELF, (double) value, dest);
+ dest = STATICSELF.clone();
+ rat_multiply_float(INTERP, dest, (double) value);
return dest;
}
@@ -873,7 +829,7 @@
*/
VTABLE void i_multiply_float(FLOATVAL value) {
- rat_multiply_float(INTERP, SELF, (double) value, SELF);
+ rat_multiply_float(INTERP, SELF, (double) value);
}
/*
@@ -884,22 +840,20 @@
*/
MULTI PMC *divide(Integer value, PMC* dest) {
- rat_divide_integer(INTERP, SELF, (int) VTABLE_get_integer(INTERP, value), dest);
+ dest = STATICSELF.clone();
+ rat_divide_integer(INTERP, dest, (int) VTABLE_get_integer(INTERP, value));
return dest;
}
MULTI PMC *divide(Float value, PMC* dest) {
- rat_divide_float(INTERP, SELF, (double) VTABLE_get_number(INTERP, value), dest);
+ dest = STATICSELF.clone();
+ rat_divide_float(INTERP, dest, (double) VTABLE_get_number(INTERP, value));
return dest;
}
MULTI PMC *divide(Rational value, PMC* dest) {
#ifdef PARROT_HAS_GMP
- if (dest)
- pmc_reuse(interp, dest, SELF->vtable->base_type, 0);
- else
- dest = pmc_new(INTERP, SELF->vtable->base_type);
-
+ dest = pmc_new(INTERP, SELF->vtable->base_type);
mpq_div(RT(dest), RT(SELF), RT(value));
return dest;
#else
@@ -920,11 +874,11 @@
*/
MULTI void i_divide(Integer value) {
- rat_divide_integer(INTERP, SELF, (int) VTABLE_get_integer(INTERP, value), SELF);
+ rat_divide_integer(INTERP, SELF, (int) VTABLE_get_integer(INTERP, value));
}
MULTI void i_divide(Float value) {
- rat_divide_float(INTERP, SELF, (double) VTABLE_get_number(INTERP, value), SELF);
+ rat_divide_float(INTERP, SELF, (double) VTABLE_get_number(INTERP, value));
}
MULTI void i_divide(Rational value) {
@@ -948,7 +902,8 @@
*/
VTABLE PMC *divide_int(INTVAL value, PMC* dest) {
- rat_divide_integer(INTERP, SELF, (int) value, dest);
+ dest = STATICSELF.clone();
+ rat_divide_integer(INTERP, dest, (int) value);
return dest;
}
@@ -960,7 +915,7 @@
*/
VTABLE void i_divide_int(INTVAL value) {
- rat_divide_integer(INTERP, SELF, (int) value, SELF);
+ rat_divide_integer(INTERP, SELF, (int) value);
}
/*
@@ -971,7 +926,8 @@
*/
VTABLE PMC *divide_float(FLOATVAL value, PMC* dest) {
- rat_divide_float(INTERP, SELF, (double) value, dest);
+ dest = STATICSELF.clone();
+ rat_divide_float(INTERP, dest, (double) value);
return dest;
}
@@ -983,7 +939,7 @@
*/
VTABLE void i_divide_float(FLOATVAL value) {
- rat_divide_float(INTERP, SELF, (double) value, SELF);
+ rat_divide_float(INTERP, SELF, (double) value);
}
/*
@@ -995,10 +951,7 @@
*/
VTABLE PMC *neg(PMC* dest) {
#ifdef PARROT_HAS_GMP
- if (dest)
- pmc_reuse(interp, dest, SELF->vtable->base_type, 0);
- else
- dest = pmc_new(INTERP, SELF->vtable->base_type);
+ dest = pmc_new(INTERP, SELF->vtable->base_type);
mpq_neg(RT(dest), RT(SELF));
return dest;
@@ -1031,10 +984,7 @@
*/
VTABLE PMC *absolute(PMC* dest) {
#ifdef PARROT_HAS_GMP
- if (dest)
- pmc_reuse(interp, dest, SELF->vtable->base_type, 0);
- else
- dest = pmc_new(INTERP, SELF->vtable->base_type);
+ dest = pmc_new(INTERP, SELF->vtable->base_type);
mpq_abs(RT(dest), RT(SELF));
return dest;
Modified: branches/pluggable_runcore/src/embed.c
==============================================================================
--- branches/pluggable_runcore/src/embed.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/embed.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -513,6 +513,7 @@
Parrot_io_eprintf(interp,
"Parrot VM: Problem reading packfile from PIO: code %d.\n",
ferror(io));
+ fclose(io);
mem_sys_free(program_code);
return NULL;
}
@@ -856,10 +857,6 @@
{
PMC *userargv, *main_sub;
- if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG))
- Parrot_io_eprintf(interp,
- "*** Parrot VM: Setting stack top. ***\n");
-
/* Debugging mode nonsense. */
if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) {
if (Interp_flags_TEST(interp, PARROT_BOUNDS_FLAG)) {
Modified: branches/pluggable_runcore/src/exceptions.c
==============================================================================
--- branches/pluggable_runcore/src/exceptions.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/exceptions.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -107,9 +107,16 @@
INTVAL exit_status = 1;
const INTVAL severity = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "severity"));
+ /* In some cases we have a fatal exception before the IO system
+ * is completely initialized. Do some attempt to output the
+ * message to stderr, to help diagnosing. */
+ int use_perr = !PMC_IS_NULL(Parrot_io_STDERR(interp));
+
/* flush interpreter output to get things printed in order */
- Parrot_io_flush(interp, Parrot_io_STDOUT(interp));
- Parrot_io_flush(interp, Parrot_io_STDERR(interp));
+ if (!PMC_IS_NULL(Parrot_io_STDOUT(interp)))
+ Parrot_io_flush(interp, Parrot_io_STDOUT(interp));
+ if (use_perr)
+ Parrot_io_flush(interp, Parrot_io_STDERR(interp));
if (interp->pdb) {
Interp * interpdeb = interp->pdb->debugger;
@@ -120,7 +127,14 @@
}
if (Parrot_str_not_equal(interp, message, CONST_STRING(interp, ""))) {
- Parrot_io_eprintf(interp, "%S\n", message);
+ if (use_perr)
+ Parrot_io_eprintf(interp, "%S\n", message);
+ else {
+ char * const msg = Parrot_str_to_cstring(interp, message);
+ fflush(stderr);
+ fprintf(stderr, "\n%s\n", msg);
+ Parrot_str_free_cstring(msg);
+ }
/* caution against output swap (with PDB_backtrace) */
fflush(stderr);
Modified: branches/pluggable_runcore/src/gc/alloc_memory.c
==============================================================================
--- branches/pluggable_runcore/src/gc/alloc_memory.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/gc/alloc_memory.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -24,6 +24,15 @@
#include "parrot/parrot.h"
#include "parrot/memory.h"
+PARROT_DOES_NOT_RETURN
+static void failed_allocation(unsigned int line, unsigned long size) /* HEADERIZER SKIP */
+{
+ fprintf(stderr, "Failed allocation of %lu bytes\n", size);
+ do_panic(NULL, "Out of mem", __FILE__, line);
+}
+
+#define PANIC_OUT_OF_MEM(size) failed_allocation(__LINE__, (size))
+
/* HEADERIZER HFILE: include/parrot/memory.h */
/*
@@ -49,7 +58,7 @@
fprintf(stderr, "Allocated %i at %p\n", size, ptr);
#endif
if (!ptr)
- PANIC(NULL, "Out of mem");
+ PANIC_OUT_OF_MEM(size);
return ptr;
}
@@ -80,7 +89,7 @@
UNUSED(line);
#endif
if (!ptr)
- PANIC(NULL, "Out of mem");
+ PANIC_OUT_OF_MEM(size);
return ptr;
}
@@ -107,7 +116,7 @@
fprintf(stderr, "Allocated %i at %p\n", size, ptr);
#endif
if (!ptr)
- PANIC(NULL, "Out of mem");
+ PANIC_OUT_OF_MEM(size);
return ptr;
}
@@ -139,7 +148,7 @@
UNUSED(line);
#endif
if (!ptr)
- PANIC(NULL, "Out of mem");
+ PANIC_OUT_OF_MEM(size);
return ptr;
}
@@ -174,7 +183,7 @@
fprintf(stderr, "Allocated %i at %p\n", size, ptr);
#endif
if (!ptr)
- PANIC(NULL, "Out of mem");
+ PANIC_OUT_OF_MEM(size);
return ptr;
}
@@ -207,7 +216,7 @@
fprintf(stderr, "Allocated %i at %p\n", size, ptr);
#endif
if (!ptr)
- PANIC(NULL, "Out of mem");
+ PANIC_OUT_OF_MEM(size);
if (size > old_size)
memset((char*)ptr + old_size, 0, size - old_size);
@@ -247,7 +256,7 @@
UNUSED(line);
#endif
if (!ptr)
- PANIC(NULL, "Out of mem");
+ PANIC_OUT_OF_MEM(size);
return ptr;
}
@@ -285,7 +294,7 @@
UNUSED(line);
# endif
if (!ptr)
- PANIC(NULL, "Out of mem");
+ PANIC_OUT_OF_MEM(size);
if (size > old_size)
memset((char*)ptr + old_size, 0, size - old_size);
@@ -360,8 +369,8 @@
{
ASSERT_ARGS(mem_sys_strdup)
- size_t l = strlen(src);
- char *result = (char *)mem_sys_allocate(l + 1);
+ const size_t l = strlen(src);
+ char * const result = (char *)mem_sys_allocate(l + 1);
memcpy(result, src, l);
result[l] = '\0';
return result;
Modified: branches/pluggable_runcore/src/gc/alloc_register.c
==============================================================================
--- branches/pluggable_runcore/src/gc/alloc_register.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/gc/alloc_register.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -668,11 +668,12 @@
ASSERT_ARGS(Parrot_context_ref_trace)
if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG)) {
const char *name = "unknown";
- Parrot_sub *sub;
- PMC_get_sub(interp, ctx->current_sub, sub);
- if (ctx->current_sub)
+ if (ctx->current_sub) {
+ Parrot_sub *sub;
+ PMC_get_sub(interp, ctx->current_sub, sub);
name = (char *)(sub->name->strstart);
+ }
fprintf(stderr, "[reference to context %p ('%s') taken at %s:%d]\n",
(void *)ctx, name, file, line);
Modified: branches/pluggable_runcore/src/gc/api.c
==============================================================================
--- branches/pluggable_runcore/src/gc/api.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/gc/api.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -264,6 +264,9 @@
ASSERT_ARGS(Parrot_gc_initialize)
interp->arena_base = mem_allocate_zeroed_typed(Arenas);
interp->arena_base->sized_header_pools = NULL;
+ interp->arena_base->num_sized = 0;
+ interp->arena_base->attrib_pools = NULL;
+ interp->arena_base->num_attribs = 0;
interp->lo_var_ptr = stacktop;
@@ -538,8 +541,7 @@
Returns a new buffer-like header from the appropriate sized pool.
A "bufferlike object" is an object that is considered to be isomorphic to the
PObj, so it will participate in normal GC. At the moment these are only used
-to create ListChunk objects in src/list.c and Stack_Chunk objects in
-src/stacks.c.
+to create ListChunk objects in src/list.c.
=cut
@@ -1072,6 +1074,9 @@
interp->arena_base->pmc_ext_pool = NULL;
mem_internal_free(interp->arena_base->sized_header_pools);
+ if (interp->arena_base->attrib_pools)
+ mem_internal_free(interp->arena_base->attrib_pools);
+ interp->arena_base->attrib_pools = NULL;
interp->arena_base->sized_header_pools = NULL;
}
@@ -1656,6 +1661,97 @@
/*
+=item C<void * Parrot_gc_allocate_pmc_attributes(PARROT_INTERP, PMC *pmc, size_t
+size)>
+
+EXPERIMENTAL!!!
+
+Allocation and deallocation function for PMC Attribute structures.
+
+These functions are not currently used. They are waiting for changes to
+the PMC allocation/deallocation mechanisms. See TT #895 for details.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+void *
+Parrot_gc_allocate_pmc_attributes(PARROT_INTERP, ARGMOD(PMC *pmc), size_t size)
+{
+ ASSERT_ARGS(Parrot_gc_allocate_pmc_attributes)
+ /* const size_t attr_size = pmc->vtable->attr_size; */
+ const size_t attr_size = size;
+ PMC_Attribute_Pool * const pool = Parrot_gc_get_attribute_pool(interp,
+ attr_size);
+ void * const attrs = Parrot_gc_get_attributes_from_pool(interp, pool);
+ memset(attrs, 0, size);
+ PMC_data(pmc) = attrs;
+ return attrs;
+}
+
+/*
+
+=item C<void Parrot_gc_free_pmc_attributes(PARROT_INTERP, PMC *pmc, size_t
+item_size)>
+
+EXPERIMENTAL!!! See above.
+
+*/
+
+void
+Parrot_gc_free_pmc_attributes(PARROT_INTERP, ARGMOD(PMC *pmc), size_t item_size)
+{
+ ASSERT_ARGS(Parrot_gc_free_pmc_attributes)
+ void * const data = PMC_data(pmc);
+ /* const size_t size = pmc->vtable->attr_size; */
+ const size_t size = item_size;
+ if (data != NULL) {
+ PMC_Attribute_Pool * const pool = Parrot_gc_get_attribute_pool(interp, size);
+ Parrot_gc_free_attributes_from_pool(interp, pool, data);
+ PMC_data(pmc) = NULL;
+ }
+}
+
+/*
+
+=item C<void * Parrot_gc_allocate_fixed_size_storage(PARROT_INTERP, size_t
+size)>
+
+EXPERIMENTAL!!! See above.
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+void *
+Parrot_gc_allocate_fixed_size_storage(PARROT_INTERP, size_t size)
+{
+ ASSERT_ARGS(Parrot_gc_allocate_fixed_size_storage)
+ PMC_Attribute_Pool * const pool = Parrot_gc_get_attribute_pool(interp,
+ size);
+ return Parrot_gc_get_attributes_from_pool(interp, pool);
+}
+
+/*
+
+=item C<void Parrot_gc_free_fixed_size_storage(PARROT_INTERP, size_t size, void
+* data)>
+
+EXPERIMENTAL!!! See above.
+
+*/
+
+void
+Parrot_gc_free_fixed_size_storage(PARROT_INTERP, size_t size, ARGMOD(void * data))
+{
+ ASSERT_ARGS(Parrot_gc_free_fixed_size_storage)
+ PMC_Attribute_Pool * const pool = Parrot_gc_get_attribute_pool(interp,
+ size);
+ Parrot_gc_free_attributes_from_pool(interp, pool, data);
+}
+
+/*
+
=back
=head1 SEE ALSO
Modified: branches/pluggable_runcore/src/gc/gc_private.h
==============================================================================
--- branches/pluggable_runcore/src/gc/gc_private.h Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/gc/gc_private.h Fri Aug 14 01:24:23 2009 (r40541)
@@ -36,6 +36,10 @@
#endif /* __ia64__ */
+/* these values are used for the attribute allocator */
+#define GC_ATTRIB_POOLS_HEADROOM 8
+#define GC_FIXED_SIZE_POOL_SIZE 4096
+
/* We're using this here to add an additional pointer to a PObj without
having to actually add an entire pointer to every PObj-alike structure
in Parrot. Astute observers may notice that if the PObj is comprised of
@@ -56,6 +60,15 @@
void *start_objects;
} Small_Object_Arena;
+typedef struct PMC_Attribute_Free_List {
+ struct PMC_Attribute_Free_List * next;
+} PMC_Attribute_Free_List;
+
+typedef struct PMC_Attribute_Arena {
+ struct PMC_Attribute_Arena * next;
+ struct PMC_Attribute_Arena * prev;
+} PMC_Attribute_Arena;
+
#if PARROT_GC_GMS
/*
* all objects have this header in front of the actual
@@ -111,6 +124,21 @@
#endif /* PARROT_GC_GMS */
+#define GC_USE_LAZY_ALLOCATOR 1
+
+typedef struct PMC_Attribute_Pool {
+ size_t attr_size;
+ size_t total_objects;
+ size_t objects_per_alloc;
+ size_t num_free_objects;
+ PMC_Attribute_Free_List * free_list;
+ PMC_Attribute_Arena * top_arena;
+#if GC_USE_LAZY_ALLOCATOR
+ PMC_Attribute_Free_List * newfree;
+ PMC_Attribute_Free_List * newlast;
+#endif
+} PMC_Attribute_Pool;
+
/* Tracked resource pool */
typedef struct Small_Object_Pool {
Small_Object_Arena *last_Arena;
@@ -162,6 +190,10 @@
struct Small_Object_Pool *constant_string_header_pool;
struct Small_Object_Pool **sized_header_pools;
size_t num_sized;
+
+ PMC_Attribute_Pool **attrib_pools;
+ size_t num_attribs;
+
/*
* function slots that each subsystem must provide
*/
@@ -358,6 +390,27 @@
__attribute__nonnull__(1)
__attribute__nonnull__(2);
+void Parrot_gc_free_attributes_from_pool(PARROT_INTERP,
+ ARGMOD(PMC_Attribute_Pool * pool),
+ ARGMOD(void *data))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3)
+ FUNC_MODIFIES(* pool)
+ FUNC_MODIFIES(*data);
+
+PARROT_CANNOT_RETURN_NULL
+PMC_Attribute_Pool * Parrot_gc_get_attribute_pool(PARROT_INTERP,
+ size_t attrib_size)
+ __attribute__nonnull__(1);
+
+PARROT_CANNOT_RETURN_NULL
+void * Parrot_gc_get_attributes_from_pool(PARROT_INTERP,
+ ARGMOD(PMC_Attribute_Pool * pool))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ FUNC_MODIFIES(* pool);
+
void Parrot_gc_profile_end(PARROT_INTERP, int what)
__attribute__nonnull__(1);
@@ -402,6 +455,17 @@
#define ASSERT_ARGS_Parrot_gc_clear_live_bits __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_Parrot_gc_free_attributes_from_pool \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(pool) \
+ || PARROT_ASSERT_ARG(data)
+#define ASSERT_ARGS_Parrot_gc_get_attribute_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_get_attributes_from_pool \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(pool)
#define ASSERT_ARGS_Parrot_gc_profile_end __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_profile_start __attribute__unused__ int _ASSERT_ARGS_CHECK = \
Modified: branches/pluggable_runcore/src/gc/mark_sweep.c
==============================================================================
--- branches/pluggable_runcore/src/gc/mark_sweep.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/gc/mark_sweep.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -79,6 +79,17 @@
static Small_Object_Pool * new_string_pool(PARROT_INTERP, INTVAL constant)
__attribute__nonnull__(1);
+static void Parrot_gc_allocate_new_attributes_arena(PARROT_INTERP,
+ ARGMOD(PMC_Attribute_Pool *pool))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ FUNC_MODIFIES(*pool);
+
+PARROT_CANNOT_RETURN_NULL
+static PMC_Attribute_Pool * Parrot_gc_create_attrib_pool(PARROT_INTERP,
+ size_t attrib_size)
+ __attribute__nonnull__(1);
+
#define ASSERT_ARGS_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(pool) \
|| PARROT_ASSERT_ARG(b)
@@ -96,6 +107,12 @@
#define ASSERT_ARGS_new_small_object_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
#define ASSERT_ARGS_new_string_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_allocate_new_attributes_arena \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_Parrot_gc_create_attrib_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
@@ -195,7 +212,7 @@
mark_context(interp, ctx);
/* mark the dynamic environment. */
- mark_stack(interp, interp->dynamic_env);
+ Parrot_gc_mark_PObj_alive(interp, (PObj*)interp->dynamic_env);
/* mark the vtables: the data, Class PMCs, etc. */
mark_vtables(interp);
@@ -1184,6 +1201,174 @@
return 0;
}
+/*
+
+=over 4
+
+=item C<void * Parrot_gc_get_attributes_from_pool(PARROT_INTERP,
+PMC_Attribute_Pool * pool)>
+
+Get a new fixed-size storage space from the given pool. The pool contains
+information on the size of the item to allocate already.
+
+=item C<static void Parrot_gc_allocate_new_attributes_arena(PARROT_INTERP,
+PMC_Attribute_Pool *pool)>
+
+Allocate a new arena of fixed-sized data structures for the given pool.
+
+=item C<void Parrot_gc_free_attributes_from_pool(PARROT_INTERP,
+PMC_Attribute_Pool * pool, void *data)>
+
+Frees a fixed-size data item back to the pool for later reallocation
+
+=item C<PMC_Attribute_Pool * Parrot_gc_get_attribute_pool(PARROT_INTERP, size_t
+attrib_size)>
+
+Find a fixed-sized data structure pool given the size of the object to
+allocate. If the pool does not exist, create it.
+
+=item C<static PMC_Attribute_Pool * Parrot_gc_create_attrib_pool(PARROT_INTERP,
+size_t attrib_size)>
+
+Create a new pool for fixed-sized data items with the given C<attrib_size>.
+
+=back
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+void *
+Parrot_gc_get_attributes_from_pool(PARROT_INTERP, ARGMOD(PMC_Attribute_Pool * pool))
+{
+ ASSERT_ARGS(Parrot_gc_get_attributes_from_pool)
+ PMC_Attribute_Free_List *item;
+
+ if (pool->top_arena == NULL
+#if GC_USE_LAZY_ALLOCATOR
+ || (pool->newfree == NULL && pool->free_list == NULL))
+#else
+ || pool->free_list == NULL)
+#endif
+ Parrot_gc_allocate_new_attributes_arena(interp, pool);
+
+#if GC_USE_LAZY_ALLOCATOR
+ if (pool->newfree) {
+ item = pool->newfree;
+ pool->newfree = (PMC_Attribute_Free_List *)
+ ((char *)(pool->newfree) + pool->attr_size);
+ if (pool->newfree >= pool->newlast)
+ pool->newfree = NULL;
+ }
+ else {
+ item = pool->free_list;
+ pool->free_list = item->next;
+ }
+#else
+ item = pool->free_list;
+ pool->free_list = item->next;
+#endif
+
+ pool->num_free_objects--;
+ return (void *)item;
+}
+
+void
+Parrot_gc_free_attributes_from_pool(PARROT_INTERP, ARGMOD(PMC_Attribute_Pool * pool),
+ ARGMOD(void *data))
+{
+ ASSERT_ARGS(Parrot_gc_free_attributes_from_pool)
+ PMC_Attribute_Free_List * const item = (PMC_Attribute_Free_List *)data;
+ item->next = pool->free_list;
+ pool->free_list = item;
+ pool->num_free_objects++;
+}
+
+static void
+Parrot_gc_allocate_new_attributes_arena(PARROT_INTERP, ARGMOD(PMC_Attribute_Pool *pool))
+{
+ ASSERT_ARGS(Parrot_gc_allocate_new_attributes_arena)
+ const size_t num_items = pool->objects_per_alloc;
+ const size_t item_size = pool->attr_size;
+ const size_t total_size = sizeof (PMC_Attribute_Arena) + (pool->attr_size * num_items);
+ size_t i;
+ PMC_Attribute_Free_List *list, *next, *first;
+ PMC_Attribute_Arena * const new_arena = (PMC_Attribute_Arena *)mem_internal_allocate(
+ total_size);
+ new_arena->prev = NULL;
+ new_arena->next = pool->top_arena;
+ pool->top_arena = new_arena;
+ first = next = (PMC_Attribute_Free_List *)(new_arena + 1);
+#if GC_USE_LAZY_ALLOCATOR
+ pool->newfree = first;
+ pool->newlast = (PMC_Attribute_Free_List*)((char*)first + (item_size * num_items));
+#else
+ for (i = 0; i < num_items; i++) {
+ list = next;
+ list->next = (PMC_Attribute_Free_List *)((char *)list + item_size);
+ next = list->next;
+ }
+ list->next = pool->free_list;
+ pool->free_list = first;
+#endif
+ pool->total_objects += num_items;
+}
+
+PARROT_CANNOT_RETURN_NULL
+PMC_Attribute_Pool *
+Parrot_gc_get_attribute_pool(PARROT_INTERP, size_t attrib_size)
+{
+ ASSERT_ARGS(Parrot_gc_get_attribute_pool)
+ Arenas * const arenas = interp->arena_base;
+ PMC_Attribute_Pool ** pools = arenas->attrib_pools;
+ const size_t size = (attrib_size < sizeof (void *))?(sizeof (void *)):(attrib_size);
+ const size_t idx = size - sizeof (void *);
+
+ if (pools == NULL) {
+ const size_t total_size = idx + GC_ATTRIB_POOLS_HEADROOM;
+ /* Allocate more then we strictly need, hoping that we can reduce the
+ number of resizes. 8 is just an arbitrary number */
+ pools = (PMC_Attribute_Pool **)mem_internal_allocate(total_size
+ * sizeof (PMC_Attribute_Pool *));
+ memset(pools, 0, total_size * sizeof (void*));
+ arenas->attrib_pools = pools;
+ arenas->num_attribs = total_size;
+ }
+ if (arenas->num_attribs < idx) {
+ const size_t total_size = idx + GC_ATTRIB_POOLS_HEADROOM;
+ const size_t current_size = arenas->num_attribs;
+ const size_t diff = total_size - current_size;
+
+ pools = (PMC_Attribute_Pool **)mem_internal_realloc(pools, total_size
+ * sizeof (PMC_Attribute_Pool *));
+ memset(pools + current_size, 0, diff * sizeof (void *));
+ arenas->attrib_pools = pools;
+ arenas->num_attribs = total_size;
+ }
+ if (pools[idx] == NULL)
+ pools[idx] = Parrot_gc_create_attrib_pool(interp, attrib_size);
+ return pools[idx];
+}
+
+PARROT_CANNOT_RETURN_NULL
+static PMC_Attribute_Pool *
+Parrot_gc_create_attrib_pool(PARROT_INTERP, size_t attrib_size)
+{
+ ASSERT_ARGS(Parrot_gc_create_attrib_pool)
+ const size_t num_objs_raw =
+ (GC_FIXED_SIZE_POOL_SIZE - sizeof (PMC_Attribute_Arena)) / attrib_size;
+ const size_t num_objs = (num_objs_raw == 0)?(1):(num_objs_raw);
+ PMC_Attribute_Pool * const newpool = mem_internal_allocate_typed(PMC_Attribute_Pool);
+ newpool->attr_size = attrib_size;
+ newpool->total_objects = 0;
+ newpool->objects_per_alloc = num_objs;
+ newpool->num_free_objects = 0;
+ newpool->free_list = NULL;
+ newpool->top_arena = NULL;
+ return newpool;
+}
+
/*
Modified: branches/pluggable_runcore/src/global.c
==============================================================================
--- branches/pluggable_runcore/src/global.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/global.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -205,20 +205,15 @@
PMC *ns = base_ns;
for (i = 0; i < n; ++i) {
- if (!pmc_key)
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
- "Passed a NULL pmc_key into VTABLE_get_string_keyed_int");
- else {
- STRING * const part = VTABLE_get_string_keyed_int(interp, pmc_key, i);
- PMC *sub_ns = VTABLE_get_pmc_keyed_str(interp, ns, part);
-
- if (PMC_IS_NULL(sub_ns) || !VTABLE_isa(interp, sub_ns, isans)) {
- sub_ns = internal_ns_maybe_create(interp, ns, part, flags);
- if (PMC_IS_NULL(sub_ns))
- return PMCNULL;
- }
- ns = sub_ns;
+ STRING * const part = VTABLE_get_string_keyed_int(interp, pmc_key, i);
+ PMC *sub_ns = VTABLE_get_pmc_keyed_str(interp, ns, part);
+
+ if (PMC_IS_NULL(sub_ns) || !VTABLE_isa(interp, sub_ns, isans)) {
+ sub_ns = internal_ns_maybe_create(interp, ns, part, flags);
+ if (PMC_IS_NULL(sub_ns))
+ return PMCNULL;
}
+ ns = sub_ns;
}
return ns;
}
@@ -280,7 +275,7 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
PMC *
-Parrot_get_namespace_keyed(PARROT_INTERP, ARGIN(PMC *base_ns), ARGIN_NULLOK(PMC *pmc_key))
+Parrot_get_namespace_keyed(PARROT_INTERP, ARGIN(PMC *base_ns), ARGIN(PMC *pmc_key))
{
ASSERT_ARGS(Parrot_get_namespace_keyed)
return internal_ns_keyed(interp, base_ns, pmc_key, 0);
@@ -327,7 +322,7 @@
PARROT_CAN_RETURN_NULL
PMC *
Parrot_make_namespace_keyed(PARROT_INTERP, ARGIN(PMC *base_ns),
- ARGIN_NULLOK(PMC *pmc_key))
+ ARGIN(PMC *pmc_key))
{
ASSERT_ARGS(Parrot_make_namespace_keyed)
return internal_ns_keyed(interp, base_ns, pmc_key, INTERN_NS_CREAT);
@@ -389,35 +384,6 @@
/*
-=item C<PMC * Parrot_get_namespace_autobase(PARROT_INTERP, PMC *key)>
-
-Find a namespace with the key C<key>, which may be a String, a Key, or an
-array of strings. If it is a String, then the lookup is relative to the
-current namespace. Otherwise, it is relative to the current HLL root
-namespace. Return the namespace, or NULL if not found.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-PMC *
-Parrot_get_namespace_autobase(PARROT_INTERP, ARGIN_NULLOK(PMC *key))
-{
- ASSERT_ARGS(Parrot_get_namespace_autobase)
- PMC *base_ns;
- if (VTABLE_isa(interp, key, CONST_STRING(interp, "String")))
- base_ns = CONTEXT(interp)->current_namespace;
- else
- base_ns = VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace,
- CONTEXT(interp)->current_HLL);
- return Parrot_get_namespace_keyed(interp, base_ns, key);
-}
-
-/*
-
=item C<PMC * Parrot_ns_get_name(PARROT_INTERP, PMC *_namespace)>
Retrieve an array of names from a namespace object.
@@ -571,36 +537,6 @@
/*
-=item C<PMC * Parrot_find_global_k(PARROT_INTERP, PMC *pmc_key, STRING
-*globalname)>
-
-Search the namespace designated by C<pmc_key>, which may be a key PMC,
-an array of namespace name strings, or a string PMC, for an object
-with name C<globalname>. Return the object, or NULL if not found.
-
-RT #46161 - For now this function prefers non-namespaces, it will eventually
-entirely use the untyped interface.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-PMC *
-Parrot_find_global_k(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc_key), ARGIN(STRING *globalname))
-{
- ASSERT_ARGS(Parrot_find_global_k)
- PMC * const ns =
- Parrot_get_namespace_keyed(interp,
- Parrot_get_ctx_HLL_namespace(interp),
- pmc_key);
- return Parrot_find_global_n(interp, ns, globalname);
-}
-
-/*
-
=item C<PMC * Parrot_find_global_s(PARROT_INTERP, STRING *str_key, STRING
*globalname)>
Modified: branches/pluggable_runcore/src/hash.c
==============================================================================
--- branches/pluggable_runcore/src/hash.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/hash.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -322,13 +322,12 @@
PARROT_WARN_UNUSED_RESULT
PARROT_PURE_FUNCTION
size_t
-key_hash_int(SHIM_INTERP, ARGIN(const void *value), size_t seed)
+key_hash_int(SHIM_INTERP, ARGIN_NULLOK(const void *value), size_t seed)
{
ASSERT_ARGS(key_hash_int)
return (size_t)value ^ seed;
}
-
/*
=item C<int int_compare(PARROT_INTERP, const void *a, const void *b)>
@@ -350,7 +349,6 @@
return a != b;
}
-
/*
=item C<void parrot_dump_hash(PARROT_INTERP, const Hash *hash)>
@@ -771,7 +769,7 @@
hash->mask = new_size - 1;
/* clear freshly allocated bucket index */
- memset(new_bi + old_size, 0, sizeof (HashBucket *) * (new_size - old_size));
+ memset(new_bi + old_size, 0, sizeof (HashBucket *) * old_size);
/*
* reloc pointers - this part would be also needed, if we
@@ -823,7 +821,7 @@
=item C<Hash* parrot_new_hash(PARROT_INTERP)>
-Creates a new Parrot STRING hash in C<hptr>.
+Creates a new Parrot STRING hash.
=cut
@@ -845,26 +843,6 @@
/*
-=item C<void parrot_new_pmc_hash(PARROT_INTERP, PMC *container)>
-
-Creates a new Parrot STRING hash in C<container>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-parrot_new_pmc_hash(PARROT_INTERP, ARGOUT(PMC *container))
-{
- ASSERT_ARGS(parrot_new_pmc_hash)
- Hash * const hash = parrot_new_hash(interp);
- VTABLE_set_pointer(interp, container, hash);
-}
-
-
-/*
-
=item C<Hash* parrot_new_cstring_hash(PARROT_INTERP)>
Creates a new C string hash in C<hptr>.
@@ -1198,7 +1176,7 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
HashBucket *
-parrot_hash_get_bucket(PARROT_INTERP, ARGIN(const Hash *hash), ARGIN(const void *key))
+parrot_hash_get_bucket(PARROT_INTERP, ARGIN(const Hash *hash), ARGIN_NULLOK(const void *key))
{
ASSERT_ARGS(parrot_hash_get_bucket)
@@ -1214,7 +1192,7 @@
HashBucket *bucket = hash->bs + i;
/* the hash->compare cost is too high for this fast path */
- if (bucket->key && bucket->key == key)
+ if (bucket->key == key)
return bucket;
}
}
@@ -1297,12 +1275,26 @@
PARROT_IGNORABLE_RESULT
PARROT_CANNOT_RETURN_NULL
HashBucket*
-parrot_hash_put(PARROT_INTERP, ARGMOD(Hash *hash), ARGIN(void *key), ARGIN_NULLOK(void *value))
+parrot_hash_put(PARROT_INTERP, ARGMOD(Hash *hash),
+ ARGIN_NULLOK(void *key), ARGIN_NULLOK(void *value))
{
ASSERT_ARGS(parrot_hash_put)
const UINTVAL hashval = (hash->hash_val)(interp, key, hash->seed);
HashBucket *bucket = hash->bi[hashval & hash->mask];
+ /* Very complex assert that we'll not put non-constant stuff into constant hash */
+ PARROT_ASSERT(
+ PMC_IS_NULL(hash->container)
+ || !(PObj_constant_TEST(hash->container))
+ || (
+ (
+ !(hash->key_type == Hash_key_type_STRING)
+ || PObj_constant_TEST((PObj *)key))
+ && (
+ !((hash->entry_type == enum_type_PMC) || (hash->entry_type == enum_type_STRING))
+ || PObj_constant_TEST((PObj *)value)))
+ || !"Use non-constant key or value in constant hash");
+
while (bucket) {
/* store hash_val or not */
if ((hash->compare)(interp, key, bucket->key) == 0)
Modified: branches/pluggable_runcore/src/hll.c
==============================================================================
--- branches/pluggable_runcore/src/hll.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/hll.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -87,11 +87,6 @@
PMC *entry_id;
- /*
- * ATT: all items that are owned by the HLL_info structure
- * have to be created as constant objects, because
- * this structure isn't marked by GC
- */
PMC * const entry = constant_pmc_new(interp, enum_class_FixedPMCArray);
if (entry_name && !STRING_IS_EMPTY(entry_name)) {
@@ -133,7 +128,7 @@
{
ASSERT_ARGS(Parrot_init_HLL)
interp->HLL_info =
- constant_pmc_new(interp, enum_class_OrderedHash);
+ pmc_new(interp, enum_class_OrderedHash);
interp->HLL_namespace =
constant_pmc_new(interp, enum_class_ResizablePMCArray);
Modified: branches/pluggable_runcore/src/interp/inter_create.c
==============================================================================
--- branches/pluggable_runcore/src/interp/inter_create.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/interp/inter_create.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -144,6 +144,14 @@
MUTEX_INIT(interpreter_array_mutex);
}
+ /* Must initialize flags before Parrot_gc_initialize() is called
+ * so the GC_DEBUG stuff is available. */
+ interp->flags = flags;
+ /* Set up the memory allocation system */
+ Parrot_gc_initialize(interp, (void*)&stacktop);
+ Parrot_block_GC_mark(interp);
+ Parrot_block_GC_sweep(interp);
+
create_initial_context(interp);
interp->resume_flag = RESUME_INITIAL;
@@ -151,10 +159,6 @@
CONTEXT(interp)->recursion_depth = (UINTVAL)-1;
interp->recursion_limit = RECURSION_LIMIT;
- /* Must initialize flags here so the GC_DEBUG stuff is available before
- * Parrot_gc_initialize() is called. */
- interp->flags = flags;
-
/* PANIC will fail until this is done */
interp->piodata = NULL;
Parrot_io_init(interp);
@@ -168,11 +172,6 @@
#endif
}
- /* Set up the memory allocation system */
- Parrot_gc_initialize(interp, (void*)&stacktop);
- Parrot_block_GC_mark(interp);
- Parrot_block_GC_sweep(interp);
-
/*
* Set up the string subsystem
* This also generates the constant string tables
@@ -210,12 +209,6 @@
PARROT_ERRORS_on(interp, PARROT_ERRORS_RESULT_COUNT_FLAG);
#endif
- /* allocate stack chunk cache */
- stack_system_init(interp);
-
- /* And a dynamic environment stack */
- interp->dynamic_env = new_stack(interp, "DynamicEnv");
-
/* clear context introspection vars */
CONTEXT(interp)->current_sub = NULL;
CONTEXT(interp)->current_cont = NULL;
@@ -238,6 +231,10 @@
/* create the root set registry */
interp->gc_registry = pmc_new(interp, enum_class_AddrRegistry);
+ /* And a dynamic environment stack */
+ /* TODO: We should really consider removing this (TT #876) */
+ interp->dynamic_env = pmc_new(interp, enum_class_ResizablePMCArray);
+
/* create exceptions list */
interp->current_runloop_id = 0;
interp->current_runloop_level = 0;
Modified: branches/pluggable_runcore/src/io/api.c
==============================================================================
--- branches/pluggable_runcore/src/io/api.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/io/api.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -592,7 +592,7 @@
=item C<INTVAL Parrot_io_puts(PARROT_INTERP, PMC *pmc, const char *s)>
-Writes C<*s> tp C<*pmc>. C string version.
+Writes C<*s> to C<*pmc>. C string version.
=cut
Modified: branches/pluggable_runcore/src/io/buffer.c
==============================================================================
--- branches/pluggable_runcore/src/io/buffer.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/io/buffer.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -471,7 +471,7 @@
size_t l;
unsigned char *out_buf;
unsigned char *buf_start;
- INTVAL buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
+ const INTVAL buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
unsigned char *buffer_next;
unsigned char *buffer_end;
size_t len;
Modified: branches/pluggable_runcore/src/io/filehandle.c
==============================================================================
--- branches/pluggable_runcore/src/io/filehandle.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/io/filehandle.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -555,7 +555,7 @@
Parrot_io_clear_buffer(SHIM_INTERP, ARGIN(PMC *filehandle))
{
ASSERT_ARGS(Parrot_io_clear_buffer)
- Parrot_FileHandle_attributes *io = PARROT_FILEHANDLE(filehandle);
+ Parrot_FileHandle_attributes * const io = PARROT_FILEHANDLE(filehandle);
if (io->buffer_start && (io->flags & PIO_BF_MALLOC)) {
mem_sys_free(io->buffer_start);
io->buffer_start = NULL;
@@ -634,7 +634,7 @@
Parrot_io_set_file_position(SHIM_INTERP, ARGIN(PMC *filehandle), PIOOFF_T file_pos)
{
ASSERT_ARGS(Parrot_io_set_file_position)
- Parrot_FileHandle_attributes *handle_struct = PARROT_FILEHANDLE(filehandle);
+ Parrot_FileHandle_attributes * const handle_struct = PARROT_FILEHANDLE(filehandle);
handle_struct->last_pos = handle_struct->file_pos;
handle_struct->file_pos = file_pos;
}
@@ -662,7 +662,7 @@
Parrot_io_is_encoding(PARROT_INTERP, ARGIN(PMC *filehandle), ARGIN(STRING *value))
{
ASSERT_ARGS(Parrot_io_is_encoding)
- Parrot_FileHandle_attributes *handle_struct = PARROT_FILEHANDLE(filehandle);
+ Parrot_FileHandle_attributes * const handle_struct = PARROT_FILEHANDLE(filehandle);
if (STRING_IS_NULL(handle_struct->encoding))
return 0;
Modified: branches/pluggable_runcore/src/io/unix.c
==============================================================================
--- branches/pluggable_runcore/src/io/unix.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/io/unix.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -233,7 +233,7 @@
flags |= PIO_F_CONSOLE;
if (PMC_IS_NULL(filehandle)) {
- PMC *io = Parrot_io_new_pmc(interp, flags);
+ PMC * const io = Parrot_io_new_pmc(interp, flags);
Parrot_io_set_os_handle(interp, io, fd);
return io;
}
@@ -268,8 +268,8 @@
Parrot_io_async_unix(PARROT_INTERP, ARGMOD(PMC *filehandle), INTVAL b)
{
ASSERT_ARGS(Parrot_io_async_unix)
- int rflags;
# if defined(linux)
+ int rflags;
PIOHANDLE file_descriptor = Parrot_io_get_os_handle(interp, filehandle);
if ((rflags = fcntl(file_descriptor, F_GETFL, 0)) >= 0) {
@@ -498,7 +498,7 @@
{
ASSERT_ARGS(Parrot_io_read_unix)
const PIOHANDLE file_descriptor = Parrot_io_get_os_handle(interp, filehandle);
- INTVAL file_flags = Parrot_io_get_flags(interp, filehandle);
+ const INTVAL file_flags = Parrot_io_get_flags(interp, filehandle);
STRING * const s = Parrot_io_make_string(interp, buf, 2048);
const size_t len = s->bufused;
Modified: branches/pluggable_runcore/src/jit/i386/jit_defs.c
==============================================================================
--- branches/pluggable_runcore/src/jit/i386/jit_defs.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/jit/i386/jit_defs.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -2265,15 +2265,6 @@
break;
case 'v':
break;
- case 'V':
- emitm_call_cfunc(pc, get_nci_P);
- emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
- /* Call the get_pointer VTABLE on the Pointer PMC to get the returned pointer */
- emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(PMC, vtable));
- emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(VTABLE, get_pointer));
- emitm_callr(pc, emit_EAX);
- emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
- break;
case 'b': /* buffer (void*) pass PObj_bufstart(SReg) */
emitm_call_cfunc(pc, get_nci_S);
emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1,
@@ -2296,6 +2287,7 @@
case '2':
case '3':
case '4':
+ case 'V':
mem_free_executable(jit_info.native_ptr, JIT_ALLOC_SIZE);
return NULL;
break;
Modified: branches/pluggable_runcore/src/key.c
==============================================================================
--- branches/pluggable_runcore/src/key.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/key.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -332,8 +332,6 @@
FLOATVAL num_key;
switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
- case KEY_hash_iterator_FLAGS:
-
case KEY_integer_FLAG:
GETATTR_Key_int_key(interp, key, int_key);
return int_key;
@@ -367,14 +365,6 @@
return Parrot_str_to_int(interp, s_reg);
}
- case KEY_string_FLAG | KEY_start_slice_FLAG:
- case KEY_string_FLAG | KEY_inf_slice_FLAG:
- {
- STRING * const s_key = VTABLE_get_string(interp, key);
- return Parrot_str_to_int(interp, s_key);
- }
- case KEY_start_slice_FLAG:
- case KEY_inf_slice_FLAG:
default:
break;
}
@@ -616,6 +606,7 @@
key_mark(PARROT_INTERP, ARGIN(PMC *key))
{
ASSERT_ARGS(key_mark)
+ PMC *next_key;
const UINTVAL flags = PObj_get_FLAGS(key) & KEY_type_FLAGS;
if (flags == KEY_string_FLAG) {
@@ -627,16 +618,10 @@
Parrot_gc_mark_PObj_alive(interp, (PObj *)str_key);
}
- /*
- * KEY_hash_iterator_FLAGS denote a hash key iteration, PMC_data() is
- * the bucket_index and not the next key component
- * Note to self: shoot whoever thought this was a good idea.
- */
- if (flags != KEY_hash_iterator_FLAGS) {
- PMC *next_key;
- /* if iteration hasn't started, above flag isn't set yet */
+ /* Mark next key */
+ if ((flags == KEY_string_FLAG) || (flags == KEY_pmc_FLAG)) {
GETATTR_Key_next_key(interp, key, next_key);
- if (next_key && (void *)next_key != (void *)INITBucketIndex)
+ if (next_key)
Parrot_gc_mark_PObj_alive(interp, (PObj *)next_key);
}
Modified: branches/pluggable_runcore/src/library.c
==============================================================================
--- branches/pluggable_runcore/src/library.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/library.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -180,8 +180,6 @@
PARROT_LIB_PATH_INCLUDE, paths);
entry = CONST_STRING(interp, "runtime/parrot/include/");
VTABLE_push_string(interp, paths, entry);
- entry = CONST_STRING(interp, "runtime/parrot/");
- VTABLE_push_string(interp, paths, entry);
entry = CONST_STRING(interp, "./");
VTABLE_push_string(interp, paths, entry);
if (VTABLE_elements(interp, config_hash)) {
@@ -201,8 +199,6 @@
PARROT_LIB_PATH_LIBRARY, paths);
entry = CONST_STRING(interp, "runtime/parrot/library/");
VTABLE_push_string(interp, paths, entry);
- entry = CONST_STRING(interp, "runtime/parrot/");
- VTABLE_push_string(interp, paths, entry);
entry = CONST_STRING(interp, "./");
VTABLE_push_string(interp, paths, entry);
if (!STRING_IS_NULL(versionlib)) {
Modified: branches/pluggable_runcore/src/oo.c
==============================================================================
--- branches/pluggable_runcore/src/oo.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/oo.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -300,9 +300,10 @@
PObj_is_object_SET(cloned);
/* Now create the underlying structure, and clone attributes list.class. */
- cloned_guts = mem_allocate_zeroed_typed(Parrot_Object_attributes);
+ cloned_guts = mem_allocate_typed(Parrot_Object_attributes);
PMC_data(cloned) = cloned_guts;
cloned_guts->_class = obj->_class;
+ cloned_guts->attrib_store = NULL;
cloned_guts->attrib_store = VTABLE_clone(interp, obj->attrib_store);
num_attrs = VTABLE_elements(interp, cloned_guts->attrib_store);
for (i = 0; i < num_attrs; i++) {
@@ -329,6 +330,10 @@
}
}
+ /* free object attributes if created directly */
+ if (!PMC_IS_NULL(dest))
+ mem_sys_free(obj);
+
/* And we have ourselves a clone. */
return cloned;
}
@@ -337,10 +342,9 @@
=item C<void * Parrot_oo_new_object_attrs(PARROT_INTERP, PMC * class_)>
-Create a new C<Parrot_Object_attributes> structure, which is the thing that
-holds data for an Object PMC. We need this for places where a new Object
-is being created without being instantiated by it's associated class, such
-as in C<Parrot_oo_clone_object>.
+Create a new C<Parrot_Object_attributes> structure to hold data for an Object
+PMC. We need this for places which create a new Object without instantiating it
+through its associated class, such as in C<Parrot_oo_clone_object>.
=cut
@@ -477,6 +481,7 @@
*/
+PARROT_EXPORT
PARROT_CAN_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
PMC *
@@ -504,6 +509,7 @@
*/
+PARROT_EXPORT
PARROT_CAN_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
PMC *
@@ -515,8 +521,9 @@
PMC *result =
VTABLE_get_pmc_keyed_str(interp, _class->parent_overrides, name);
- if (!PMC_IS_NULL(result))
+ if (!PMC_IS_NULL(result)) {
return result;
+ }
else if (VTABLE_exists_keyed_str(interp, _class->parent_overrides, name))
return PMCNULL;
else {
@@ -620,33 +627,6 @@
/*
-=item C<const char* Parrot_MMD_method_name(PARROT_INTERP, INTVAL idx)>
-
-Return the method name for the given MMD enum.
-
-{{**DEPRECATE**}}
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_PURE_FUNCTION
-PARROT_CAN_RETURN_NULL
-const char*
-Parrot_MMD_method_name(SHIM_INTERP, INTVAL idx)
-{
- ASSERT_ARGS(Parrot_MMD_method_name)
- PARROT_ASSERT(idx >= 0);
-
- if (idx >= MMD_USER_FIRST)
- return NULL;
-
- return Parrot_mmd_func_names[idx];
-}
-
-/*
-
=item C<static INTVAL fail_if_type_exists(PARROT_INTERP, PMC *name)>
This function throws an exception if a PMC or class with the same name *
@@ -1250,7 +1230,12 @@
=item C<PMC* Parrot_ComputeMRO_C3(PARROT_INTERP, PMC *_class)>
-Computes the C3 linearization for the given class.
+Computes the C3 linearization for the given class. C3 is an algorithm to
+compute the method resolution order (MRO) of a class that is inheriting
+from multiple parent classes (multiple inheritance). C3 was first described
+by Barrett et al at:
+
+F<http://192.220.96.201/dylan/linearization-oopsla96.html>
=cut
Modified: branches/pluggable_runcore/src/ops/bit.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/bit.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/bit.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,6 +3,7 @@
** bit.ops
*/
+BEGIN_OPS_PREAMBLE
/* Signed shift operator that is compatible with PMC shifts. This is
* guaranteed to produce the same result as bitwise_left_shift_internal modulo
* word size, ignoring the fact that Parrot integers are always signed. This
@@ -18,7 +19,7 @@
: (bits) > -8*INTVAL_SIZE ? (number) >> -(bits) \
: 0)
-VERSION = PARROT_VERSION;
+END_OPS_PREAMBLE
=head1 NAME
Modified: branches/pluggable_runcore/src/ops/cmp.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/cmp.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/cmp.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,8 +3,6 @@
** cmp.ops
*/
-VERSION = PARROT_VERSION;
-
=head1 NAME
cmp.ops - Comparison Opcodes
Modified: branches/pluggable_runcore/src/ops/core.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/core.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/core.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,13 +3,15 @@
** core.ops
*/
+BEGIN_OPS_PREAMBLE
+
#include "parrot/dynext.h"
#include "parrot/embed.h"
#include "parrot/runcore_api.h"
#include "../pmc/pmc_continuation.h"
#include "../pmc/pmc_parrotlibrary.h"
-VERSION = PARROT_VERSION;
+END_OPS_PREAMBLE
=head1 NAME
@@ -203,60 +205,6 @@
}
-=item B<branch_cs>(in STR)
-
-Intersegment branch to location in fixup table named $1.
-
-=cut
-
-inline op branch_cs(in STR) :base_loop :check_event :flow {
- PackFile_FixupEntry * fe;
- {
- char * const label = Parrot_str_to_cstring(interp, $1);
- fe = PackFile_find_fixup_entry(interp, enum_fixup_label, label);
- Parrot_str_free_cstring(label);
- }
-
- if (!fe) {
- opcode_t * handler= Parrot_ex_throw_from_op_args(interp, NULL,
- EXCEPTION_INVALID_OPERATION,
- "branch_cs: fixup for '%Ss' not found", $1);
- goto ADDRESS(handler);
- }
- else {
- interp->resume_offset = fe->offset;
- Parrot_switch_to_cs(interp, fe->seg, 1);
- mem_sys_free(fe);
- }
- interp->resume_flag = 2;
- goto ADDRESS(0);
-}
-
-########################################
-
-=item B<bsr>(in LABEL)
-
-Branch to the location specified by $1. Push the current location onto the call
-stack for later returning.
-
-=cut
-
-inline op bsr(in LABEL) :base_core :check_event :flow {
- stack_push(interp, &interp->dynamic_env,
- expr NEXT(), STACK_ENTRY_DESTINATION, STACK_CLEANUP_NULL);
- goto OFFSET($1);
-}
-
-=item B<ret>()
-
-Pop the location off the top of the call stack and go there.
-
-=cut
-
-inline op ret() :flow {
- goto POP();
-}
-
########################################
=item B<local_branch>(invar PMC, in LABEL)
@@ -316,25 +264,6 @@
goto ADDRESS(next);
}
-
-
-########################################
-
-=item B<jsr>(in LABEL)
-
-Jump to the location specified by register $1. Push the current
-location onto the call stack for later returning.
-
-=cut
-
-inline op jsr(in LABEL) :base_core :check_event :flow {
- opcode_t * loc;
- stack_push(interp, &interp->dynamic_env,
- expr NEXT(), STACK_ENTRY_DESTINATION, STACK_CLEANUP_NULL);
- loc = INTVAL2PTR(opcode_t *, $1);
- goto ADDRESS(loc);
-}
-
########################################
=item B<jump>(in LABEL)
@@ -871,7 +800,9 @@
opcode_t *const ret = expr NEXT();
PMC *resume = new_ret_continuation_pmc(interp, ret);
if (PMC_IS_NULL(except) || except->vtable->base_type != enum_class_Exception)
- except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
+ except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+ EXCEPTION_UNIMPLEMENTED,
+ Parrot_str_new_constant(interp, "Not a throwable object"));
/*
* We might return here after handling the exception, so mark the
* current context appropriately.
@@ -886,7 +817,9 @@
opcode_t * dest;
PMC * except = $1;
if (PMC_IS_NULL(except) || except->vtable->base_type != enum_class_Exception)
- except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
+ except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+ EXCEPTION_UNIMPLEMENTED,
+ Parrot_str_new_constant(interp, "Not a throwable object"));
dest = Parrot_ex_throw_from_op(interp, $1,
VTABLE_get_pointer(interp, $2));
goto ADDRESS(dest);
@@ -896,7 +829,9 @@
opcode_t * dest;
if (PMC_IS_NULL($1) || $1->vtable->base_type != enum_class_Exception) {
opcode_t * const ret = expr NEXT();
- PMC * except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
+ PMC * except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+ EXCEPTION_UNIMPLEMENTED,
+ Parrot_str_new_constant(interp, "Not a throwable object"));
dest = Parrot_ex_throw_from_op(interp, except, ret);
goto ADDRESS(dest);
}
@@ -958,20 +893,40 @@
$1, NULL);
VTABLE_set_attr_str(interp, exception,
Parrot_str_new_constant(interp, "resume"), resume);
+ VTABLE_set_integer_keyed_str(interp, exception,
+ Parrot_str_new_constant(interp, "exit_code"), $1);
dest = Parrot_ex_throw_from_op(interp, exception, ret);
goto ADDRESS(dest);
}
inline op pushmark(in INT) {
- Parrot_push_mark(interp, $1);
+ PMC * const newint = pmc_new(interp, enum_class_Integer);
+ VTABLE_set_integer_native(interp, newint, $1);
+ VTABLE_push_pmc(interp, interp->dynamic_env, newint);
}
inline op popmark(in INT) {
- Parrot_pop_mark(interp, $1);
+ opcode_t * dest;
+ opcode_t * const ret = expr NEXT();
+ int found = 0;
+ while (VTABLE_elements(interp, interp->dynamic_env)) {
+ PMC * const item = VTABLE_pop_pmc(interp, interp->dynamic_env);
+ if (item->vtable->base_type == enum_class_Integer
+ && VTABLE_get_integer(interp, item) == $1) {
+ found = 1;
+ break;
+ }
+
+ else if (item->vtable->base_type == enum_class_Sub
+ || item->vtable->base_type == enum_class_NCI)
+ Parrot_pcc_invoke_sub_from_c_args(interp, item, "I->", 0);
+ }
+ if (!found)
+ dest = Parrot_ex_throw_from_op_args(interp, ret, 1, "Mark %d not found", $1);
}
inline op pushaction(invar PMC) {
- Parrot_push_action(interp, $1);
+ VTABLE_push_pmc(interp, interp->dynamic_env, $1);
}
=back
Modified: branches/pluggable_runcore/src/ops/debug.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/debug.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/debug.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -7,8 +7,6 @@
** debug.ops
*/
-VERSION = PARROT_VERSION;
-
=head1 NAME
debug.ops - Debugging Opcodes
Modified: branches/pluggable_runcore/src/ops/experimental.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/experimental.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/experimental.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,8 +3,6 @@
** experimental.ops
*/
-VERSION = PARROT_VERSION;
-
=head1 NAME
experimental.ops - Experimental Opcodes
@@ -53,6 +51,31 @@
#endif
}
+=over 4
+
+=item B<set_label>(invar PMC, inconst LABEL)
+
+Sets the opcode_t* label value for the given PMC. This is basically only
+useful for PMCs such as Sub, Continuation, ExceptionHandler and derivatives
+
+=item B<get_label>(out INT, invar PMC)
+
+Gets the opcode_t* label value from the given PMC. This is basically only
+useful for PMCs such as Sub, Continuation, ExceptionHandler and derivatives
+
+=back
+
+=cut
+
+inline op set_label(invar PMC, inconst LABEL) {
+ VTABLE_set_pointer(interp, $1, (CUR_OPCODE + $2));
+}
+
+inline op get_label(out INT, invar PMC) {
+ void * const ptr = VTABLE_get_pointer(interp, $2);
+ $1 = PTR2INTVAL(ptr);
+}
+
=head1 COPYRIGHT
Copyright (C) 2001-2009, Parrot Foundation.
Modified: branches/pluggable_runcore/src/ops/io.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/io.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/io.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -4,8 +4,9 @@
** io.ops
*/
-VERSION = PARROT_VERSION;
+BEGIN_OPS_PREAMBLE
#include "../io/io_private.h"
+END_OPS_PREAMBLE
=head1 NAME
Modified: branches/pluggable_runcore/src/ops/math.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/math.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/math.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,8 +3,6 @@
** math.ops
*/
-VERSION = PARROT_VERSION;
-
=head1 NAME
math.ops - Mathematical Opcodes
Modified: branches/pluggable_runcore/src/ops/object.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/object.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/object.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -6,9 +6,6 @@
*/
-
-VERSION = PARROT_VERSION;
-
=head1 NAME
object.ops - Class and Object Opcodes
Modified: branches/pluggable_runcore/src/ops/ops.num
==============================================================================
--- branches/pluggable_runcore/src/ops/ops.num Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/ops.num Fri Aug 14 01:24:23 2009 (r40541)
@@ -35,1248 +35,1243 @@
load_language_sc 11
branch_i 12
branch_ic 13
-branch_cs_s 14
-branch_cs_sc 15
-bsr_i 16
-bsr_ic 17
-ret 18
-local_branch_p_i 19
-local_branch_p_ic 20
-local_return_p 21
-jsr_i 22
-jsr_ic 23
-jump_i 24
-jump_ic 25
-enternative 26
-if_i_ic 27
-if_n_ic 28
-if_s_ic 29
-if_p_ic 30
-unless_i_ic 31
-unless_n_ic 32
-unless_s_ic 33
-unless_p_ic 34
-invokecc_p 35
-invoke_p_p 36
-yield 37
-tailcall_p 38
-returncc 39
-capture_lex_p 40
-newclosure_p_p 41
-set_args_pc 42
-get_results_pc 43
-get_params_pc 44
-set_returns_pc 45
-result_info_p 46
-set_addr_i_ic 47
-set_addr_p_ic 48
-set_addr_p_i 49
-get_addr_i_p 50
-schedule_p 51
-addhandler_p 52
-push_eh_ic 53
-push_eh_p 54
-pop_eh 55
-throw_p 56
-throw_p_p 57
-rethrow_p 58
-count_eh_i 59
-die_s 60
-die_sc 61
-die_p 62
-die_pc 63
-die_i_i 64
-die_ic_i 65
-die_i_ic 66
-die_ic_ic 67
-exit_i 68
-exit_ic 69
-pushmark_i 70
-pushmark_ic 71
-popmark_i 72
-popmark_ic 73
-pushaction_p 74
-debug_i 75
-debug_ic 76
-bounds_i 77
-bounds_ic 78
-profile_i 79
-profile_ic 80
-trace_i 81
-trace_ic 82
-gc_debug_i 83
-gc_debug_ic 84
-interpinfo_i_i 85
-interpinfo_i_ic 86
-interpinfo_p_i 87
-interpinfo_p_ic 88
-interpinfo_s_i 89
-interpinfo_s_ic 90
-warningson_i 91
-warningson_ic 92
-warningsoff_i 93
-warningsoff_ic 94
-errorson_i 95
-errorson_ic 96
-errorsoff_i 97
-errorsoff_ic 98
-runinterp_p_i 99
-runinterp_p_ic 100
-getinterp_p 101
-sweep_ic 102
-collect 103
-sweepoff 104
-sweepon 105
-collectoff 106
-collecton 107
-needs_destroy_p 108
-loadlib_p_s 109
-loadlib_p_sc 110
-dlfunc_p_p_s_s 111
-dlfunc_p_p_sc_s 112
-dlfunc_p_p_s_sc 113
-dlfunc_p_p_sc_sc 114
-dlvar_p_p_s 115
-dlvar_p_p_sc 116
-compreg_s_p 117
-compreg_sc_p 118
-compreg_p_s 119
-compreg_p_sc 120
-new_callback_p_p_p_s 121
-new_callback_p_p_p_sc 122
-annotations_p 123
-annotations_p_s 124
-annotations_p_sc 125
-band_i_i 126
-band_i_ic 127
-band_p_i 128
-band_p_ic 129
-band_p_p 130
-band_i_i_i 131
-band_i_ic_i 132
-band_i_i_ic 133
-band_p_p_i 134
-band_p_p_ic 135
-band_p_p_p 136
-bands_s_s 137
-bands_s_sc 138
-bands_p_s 139
-bands_p_sc 140
-bands_p_p 141
-bands_s_s_s 142
-bands_s_sc_s 143
-bands_s_s_sc 144
-bands_p_p_s 145
-bands_p_p_sc 146
-bands_p_p_p 147
-bnot_i 148
-bnot_i_i 149
-bnot_p 150
-bnot_p_p 151
-bnots_s 152
-bnots_s_s 153
-bnots_s_sc 154
-bnots_p 155
-bnots_p_p 156
-bor_i_i 157
-bor_i_ic 158
-bor_p_i 159
-bor_p_ic 160
-bor_p_p 161
-bor_i_i_i 162
-bor_i_ic_i 163
-bor_i_i_ic 164
-bor_p_p_i 165
-bor_p_p_ic 166
-bor_p_p_p 167
-bors_s_s 168
-bors_s_sc 169
-bors_p_s 170
-bors_p_sc 171
-bors_p_p 172
-bors_s_s_s 173
-bors_s_sc_s 174
-bors_s_s_sc 175
-bors_p_p_s 176
-bors_p_p_sc 177
-bors_p_p_p 178
-shl_i_i 179
-shl_i_ic 180
-shl_p_i 181
-shl_p_ic 182
-shl_p_p 183
-shl_i_i_i 184
-shl_i_ic_i 185
-shl_i_i_ic 186
-shl_p_p_i 187
-shl_p_p_ic 188
-shl_p_p_p 189
-shr_i_i 190
-shr_i_ic 191
-shr_p_i 192
-shr_p_ic 193
-shr_p_p 194
-shr_i_i_i 195
-shr_i_ic_i 196
-shr_i_i_ic 197
-shr_p_p_i 198
-shr_p_p_ic 199
-shr_p_p_p 200
-lsr_i_i 201
-lsr_i_ic 202
-lsr_p_i 203
-lsr_p_ic 204
-lsr_p_p 205
-lsr_i_i_i 206
-lsr_i_ic_i 207
-lsr_i_i_ic 208
-lsr_p_p_i 209
-lsr_p_p_ic 210
-lsr_p_p_p 211
-rot_i_i_i_ic 212
-rot_i_ic_i_ic 213
-rot_i_i_ic_ic 214
-bxor_i_i 215
-bxor_i_ic 216
-bxor_p_i 217
-bxor_p_ic 218
-bxor_p_p 219
-bxor_i_i_i 220
-bxor_i_ic_i 221
-bxor_i_i_ic 222
-bxor_p_p_i 223
-bxor_p_p_ic 224
-bxor_p_p_p 225
-bxors_s_s 226
-bxors_s_sc 227
-bxors_p_s 228
-bxors_p_sc 229
-bxors_p_p 230
-bxors_s_s_s 231
-bxors_s_sc_s 232
-bxors_s_s_sc 233
-bxors_p_p_s 234
-bxors_p_p_sc 235
-bxors_p_p_p 236
-eq_i_i_ic 237
-eq_ic_i_ic 238
-eq_i_ic_ic 239
-eq_n_n_ic 240
-eq_nc_n_ic 241
-eq_n_nc_ic 242
-eq_s_s_ic 243
-eq_sc_s_ic 244
-eq_s_sc_ic 245
-eq_p_p_ic 246
-eq_p_i_ic 247
-eq_p_ic_ic 248
-eq_p_n_ic 249
-eq_p_nc_ic 250
-eq_p_s_ic 251
-eq_p_sc_ic 252
-eq_str_p_p_ic 253
-eq_num_p_p_ic 254
-eq_addr_s_s_ic 255
-eq_addr_sc_s_ic 256
-eq_addr_s_sc_ic 257
-eq_addr_sc_sc_ic 258
-eq_addr_p_p_ic 259
-ne_i_i_ic 260
-ne_ic_i_ic 261
-ne_i_ic_ic 262
-ne_n_n_ic 263
-ne_nc_n_ic 264
-ne_n_nc_ic 265
-ne_s_s_ic 266
-ne_sc_s_ic 267
-ne_s_sc_ic 268
-ne_p_p_ic 269
-ne_p_i_ic 270
-ne_p_ic_ic 271
-ne_p_n_ic 272
-ne_p_nc_ic 273
-ne_p_s_ic 274
-ne_p_sc_ic 275
-ne_str_p_p_ic 276
-ne_num_p_p_ic 277
-ne_addr_s_s_ic 278
-ne_addr_sc_s_ic 279
-ne_addr_s_sc_ic 280
-ne_addr_sc_sc_ic 281
-ne_addr_p_p_ic 282
-lt_i_i_ic 283
-lt_ic_i_ic 284
-lt_i_ic_ic 285
-lt_n_n_ic 286
-lt_nc_n_ic 287
-lt_n_nc_ic 288
-lt_s_s_ic 289
-lt_sc_s_ic 290
-lt_s_sc_ic 291
-lt_p_p_ic 292
-lt_p_i_ic 293
-lt_p_ic_ic 294
-lt_p_n_ic 295
-lt_p_nc_ic 296
-lt_p_s_ic 297
-lt_p_sc_ic 298
-lt_str_p_p_ic 299
-lt_num_p_p_ic 300
-le_i_i_ic 301
-le_ic_i_ic 302
-le_i_ic_ic 303
-le_n_n_ic 304
-le_nc_n_ic 305
-le_n_nc_ic 306
-le_s_s_ic 307
-le_sc_s_ic 308
-le_s_sc_ic 309
-le_p_p_ic 310
-le_p_i_ic 311
-le_p_ic_ic 312
-le_p_n_ic 313
-le_p_nc_ic 314
-le_p_s_ic 315
-le_p_sc_ic 316
-le_str_p_p_ic 317
-le_num_p_p_ic 318
-gt_p_p_ic 319
-gt_p_i_ic 320
-gt_p_ic_ic 321
-gt_p_n_ic 322
-gt_p_nc_ic 323
-gt_p_s_ic 324
-gt_p_sc_ic 325
-gt_str_p_p_ic 326
-gt_num_p_p_ic 327
-ge_p_p_ic 328
-ge_p_i_ic 329
-ge_p_ic_ic 330
-ge_p_n_ic 331
-ge_p_nc_ic 332
-ge_p_s_ic 333
-ge_p_sc_ic 334
-ge_str_p_p_ic 335
-ge_num_p_p_ic 336
-if_null_p_ic 337
-if_null_s_ic 338
-unless_null_p_ic 339
-unless_null_s_ic 340
-cmp_i_i_i 341
-cmp_i_ic_i 342
-cmp_i_i_ic 343
-cmp_i_n_n 344
-cmp_i_nc_n 345
-cmp_i_n_nc 346
-cmp_i_s_s 347
-cmp_i_sc_s 348
-cmp_i_s_sc 349
-cmp_i_p_p 350
-cmp_i_p_i 351
-cmp_i_p_ic 352
-cmp_i_p_n 353
-cmp_i_p_nc 354
-cmp_i_p_s 355
-cmp_i_p_sc 356
-cmp_str_i_p_p 357
-cmp_num_i_p_p 358
-cmp_pmc_p_p_p 359
-issame_i_p_p 360
-issame_i_s_s 361
-issame_i_sc_s 362
-issame_i_s_sc 363
-issame_i_sc_sc 364
-isntsame_i_p_p 365
-isntsame_i_s_s 366
-isntsame_i_sc_s 367
-isntsame_i_s_sc 368
-isntsame_i_sc_sc 369
-istrue_i_p 370
-isfalse_i_p 371
-isnull_i_p 372
-isnull_i_pc 373
-isgt_i_p_p 374
-isge_i_p_p 375
-isle_i_i_i 376
-isle_i_ic_i 377
-isle_i_i_ic 378
-isle_i_n_n 379
-isle_i_nc_n 380
-isle_i_n_nc 381
-isle_i_s_s 382
-isle_i_sc_s 383
-isle_i_s_sc 384
-isle_i_p_p 385
-islt_i_i_i 386
-islt_i_ic_i 387
-islt_i_i_ic 388
-islt_i_n_n 389
-islt_i_nc_n 390
-islt_i_n_nc 391
-islt_i_s_s 392
-islt_i_sc_s 393
-islt_i_s_sc 394
-islt_i_p_p 395
-iseq_i_i_i 396
-iseq_i_ic_i 397
-iseq_i_i_ic 398
-iseq_i_n_n 399
-iseq_i_nc_n 400
-iseq_i_n_nc 401
-iseq_i_s_s 402
-iseq_i_sc_s 403
-iseq_i_s_sc 404
-iseq_i_p_p 405
-isne_i_i_i 406
-isne_i_ic_i 407
-isne_i_i_ic 408
-isne_i_n_n 409
-isne_i_nc_n 410
-isne_i_n_nc 411
-isne_i_s_s 412
-isne_i_sc_s 413
-isne_i_s_sc 414
-isne_i_p_p 415
-and_i_i_i 416
-and_i_ic_i 417
-and_i_i_ic 418
-and_p_p_p 419
-not_i 420
-not_i_i 421
-not_p 422
-not_p_p 423
-or_i_i_i 424
-or_i_ic_i 425
-or_i_i_ic 426
-or_p_p_p 427
-xor_i_i_i 428
-xor_i_ic_i 429
-xor_i_i_ic 430
-xor_p_p_p 431
-debug_init 432
-debug_load_sc 433
-debug_break 434
-debug_print 435
-backtrace 436
-getline_i 437
-getfile_s 438
-close_p 439
-fdopen_p_i_s 440
-fdopen_p_ic_s 441
-fdopen_p_i_sc 442
-fdopen_p_ic_sc 443
-getstdin_p 444
-getstdout_p 445
-getstderr_p 446
-setstdin_p 447
-setstdout_p 448
-setstderr_p 449
-open_p_s_s 450
-open_p_sc_s 451
-open_p_s_sc 452
-open_p_sc_sc 453
-open_p_s 454
-open_p_sc 455
-print_i 456
-print_ic 457
-print_n 458
-print_nc 459
-print_s 460
-print_sc 461
-print_p 462
-say_i 463
-say_ic 464
-say_n 465
-say_nc 466
-say_s 467
-say_sc 468
-say_p 469
-printerr_i 470
-printerr_ic 471
-printerr_n 472
-printerr_nc 473
-printerr_s 474
-printerr_sc 475
-printerr_p 476
-print_p_i 477
-print_p_ic 478
-print_p_n 479
-print_p_nc 480
-print_p_s 481
-print_p_sc 482
-print_p_p 483
-read_s_i 484
-read_s_ic 485
-read_s_p_i 486
-read_s_p_ic 487
-readline_s_p 488
-peek_s 489
-peek_s_p 490
-stat_i_s_i 491
-stat_i_sc_i 492
-stat_i_s_ic 493
-stat_i_sc_ic 494
-stat_i_i_i 495
-stat_i_ic_i 496
-stat_i_i_ic 497
-stat_i_ic_ic 498
-seek_p_i_i 499
-seek_p_ic_i 500
-seek_p_i_ic 501
-seek_p_ic_ic 502
-seek_p_i_i_i 503
-seek_p_ic_i_i 504
-seek_p_i_ic_i 505
-seek_p_ic_ic_i 506
-seek_p_i_i_ic 507
-seek_p_ic_i_ic 508
-seek_p_i_ic_ic 509
-seek_p_ic_ic_ic 510
-tell_i_p 511
-tell_i_i_p 512
-abs_i 513
-abs_n 514
-abs_i_i 515
-abs_n_n 516
-abs_p 517
-abs_p_p 518
-add_i_i 519
-add_i_ic 520
-add_n_n 521
-add_n_nc 522
-add_p_p 523
-add_p_i 524
-add_p_ic 525
-add_p_n 526
-add_p_nc 527
-add_i_i_i 528
-add_i_ic_i 529
-add_i_i_ic 530
-add_n_n_n 531
-add_n_nc_n 532
-add_n_n_nc 533
-add_p_p_p 534
-add_p_p_i 535
-add_p_p_ic 536
-add_p_p_n 537
-add_p_p_nc 538
-cmod_i_i_i 539
-cmod_i_ic_i 540
-cmod_i_i_ic 541
-cmod_p_p_i 542
-cmod_p_p_ic 543
-cmod_p_p_p 544
-cmod_n_n_n 545
-cmod_n_nc_n 546
-cmod_n_n_nc 547
-cmod_p_p_n 548
-cmod_p_p_nc 549
-dec_i 550
-dec_n 551
-dec_p 552
-div_i_i 553
-div_i_ic 554
-div_n_n 555
-div_n_nc 556
-div_p_p 557
-div_p_i 558
-div_p_ic 559
-div_p_n 560
-div_p_nc 561
-div_i_i_i 562
-div_i_ic_i 563
-div_i_i_ic 564
-div_i_ic_ic 565
-div_n_n_n 566
-div_n_nc_n 567
-div_n_n_nc 568
-div_n_nc_nc 569
-div_p_p_p 570
-div_p_p_i 571
-div_p_p_ic 572
-div_p_p_n 573
-div_p_p_nc 574
-fdiv_i_i 575
-fdiv_i_ic 576
-fdiv_n_n 577
-fdiv_n_nc 578
-fdiv_p_p 579
-fdiv_p_i 580
-fdiv_p_ic 581
-fdiv_p_n 582
-fdiv_p_nc 583
-fdiv_i_i_i 584
-fdiv_i_ic_i 585
-fdiv_i_i_ic 586
-fdiv_n_n_n 587
-fdiv_n_nc_n 588
-fdiv_n_n_nc 589
-fdiv_p_p_p 590
-fdiv_p_p_i 591
-fdiv_p_p_ic 592
-fdiv_p_p_n 593
-fdiv_p_p_nc 594
-ceil_n 595
-ceil_i_n 596
-ceil_n_n 597
-floor_n 598
-floor_i_n 599
-floor_n_n 600
-inc_i 601
-inc_n 602
-inc_p 603
-mod_i_i 604
-mod_i_ic 605
-mod_n_n 606
-mod_n_nc 607
-mod_p_p 608
-mod_p_i 609
-mod_p_ic 610
-mod_p_n 611
-mod_p_nc 612
-mod_i_i_i 613
-mod_i_ic_i 614
-mod_i_i_ic 615
-mod_n_n_n 616
-mod_n_nc_n 617
-mod_n_n_nc 618
-mod_p_p_p 619
-mod_p_p_i 620
-mod_p_p_ic 621
-mod_p_p_n 622
-mod_p_p_nc 623
-mul_i_i 624
-mul_i_ic 625
-mul_n_n 626
-mul_n_nc 627
-mul_p_p 628
-mul_p_i 629
-mul_p_ic 630
-mul_p_n 631
-mul_p_nc 632
-mul_i_i_i 633
-mul_i_ic_i 634
-mul_i_i_ic 635
-mul_n_n_n 636
-mul_n_nc_n 637
-mul_n_n_nc 638
-mul_p_p_p 639
-mul_p_p_i 640
-mul_p_p_ic 641
-mul_p_p_n 642
-mul_p_p_nc 643
-neg_i 644
-neg_n 645
-neg_p 646
-neg_i_i 647
-neg_n_n 648
-neg_p_p 649
-pow_n_n_n 650
-pow_n_nc_n 651
-pow_n_n_nc 652
-pow_p_p_p 653
-pow_p_p_i 654
-pow_p_p_ic 655
-pow_p_p_n 656
-pow_p_p_nc 657
-pow_n_n_i 658
-pow_n_nc_i 659
-pow_n_n_ic 660
-pow_n_nc_ic 661
-sub_i_i 662
-sub_i_ic 663
-sub_n_n 664
-sub_n_nc 665
-sub_p_p 666
-sub_p_i 667
-sub_p_ic 668
-sub_p_n 669
-sub_p_nc 670
-sub_i_i_i 671
-sub_i_ic_i 672
-sub_i_i_ic 673
-sub_n_n_n 674
-sub_n_nc_n 675
-sub_n_n_nc 676
-sub_p_p_p 677
-sub_p_p_i 678
-sub_p_p_ic 679
-sub_p_p_n 680
-sub_p_p_nc 681
-sqrt_n_n 682
-acos_n_n 683
-asec_n_n 684
-asin_n_n 685
-atan_n_n 686
-atan_n_n_n 687
-atan_n_nc_n 688
-atan_n_n_nc 689
-cos_n_n 690
-cosh_n_n 691
-exp_n_n 692
-ln_n_n 693
-log10_n_n 694
-log2_n_n 695
-sec_n_n 696
-sech_n_n 697
-sin_n_n 698
-sinh_n_n 699
-tan_n_n 700
-tanh_n_n 701
-gcd_i_i_i 702
-gcd_i_ic_i 703
-gcd_i_i_ic 704
-lcm_i_i_i 705
-lcm_i_ic_i 706
-lcm_i_i_ic 707
-fact_i_i 708
-fact_n_i 709
-callmethodcc_p_s 710
-callmethodcc_p_sc 711
-callmethodcc_p_p 712
-callmethod_p_s_p 713
-callmethod_p_sc_p 714
-callmethod_p_p_p 715
-tailcallmethod_p_s 716
-tailcallmethod_p_sc 717
-tailcallmethod_p_p 718
-addmethod_p_s_p 719
-addmethod_p_sc_p 720
-can_i_p_s 721
-can_i_p_sc 722
-does_i_p_s 723
-does_i_p_sc 724
-does_i_p_p 725
-does_i_p_pc 726
-isa_i_p_s 727
-isa_i_p_sc 728
-isa_i_p_p 729
-isa_i_p_pc 730
-newclass_p_s 731
-newclass_p_sc 732
-newclass_p_p 733
-newclass_p_pc 734
-subclass_p_p 735
-subclass_p_pc 736
-subclass_p_p_s 737
-subclass_p_pc_s 738
-subclass_p_p_sc 739
-subclass_p_pc_sc 740
-subclass_p_p_p 741
-subclass_p_pc_p 742
-subclass_p_p_pc 743
-subclass_p_pc_pc 744
-subclass_p_s 745
-subclass_p_sc 746
-subclass_p_s_s 747
-subclass_p_sc_s 748
-subclass_p_s_sc 749
-subclass_p_sc_sc 750
-subclass_p_s_p 751
-subclass_p_sc_p 752
-subclass_p_s_pc 753
-subclass_p_sc_pc 754
-get_class_p_s 755
-get_class_p_sc 756
-get_class_p_p 757
-get_class_p_pc 758
-class_p_p 759
-addparent_p_p 760
-removeparent_p_p 761
-addrole_p_p 762
-addattribute_p_s 763
-addattribute_p_sc 764
-removeattribute_p_s 765
-removeattribute_p_sc 766
-getattribute_p_p_s 767
-getattribute_p_p_sc 768
-getattribute_p_p_p_s 769
-getattribute_p_p_pc_s 770
-getattribute_p_p_p_sc 771
-getattribute_p_p_pc_sc 772
-setattribute_p_s_p 773
-setattribute_p_sc_p 774
-setattribute_p_p_s_p 775
-setattribute_p_pc_s_p 776
-setattribute_p_p_sc_p 777
-setattribute_p_pc_sc_p 778
-inspect_p_p 779
-inspect_p_pc 780
-inspect_p_p_s 781
-inspect_p_pc_s 782
-inspect_p_p_sc 783
-inspect_p_pc_sc 784
-pic_infix___ic_p_p 785
-pic_inline_sub___ic_p_p 786
-pic_get_params___pc 787
-pic_set_returns___pc 788
-pic_callr___pc 789
-new_p_s 790
-new_p_sc 791
-new_p_s_p 792
-new_p_sc_p 793
-new_p_s_pc 794
-new_p_sc_pc 795
-new_p_p 796
-new_p_pc 797
-new_p_p_p 798
-new_p_pc_p 799
-new_p_p_pc 800
-new_p_pc_pc 801
-root_new_p_p 802
-root_new_p_pc 803
-root_new_p_p_p 804
-root_new_p_pc_p 805
-root_new_p_p_pc 806
-root_new_p_pc_pc 807
-typeof_s_p 808
-typeof_p_p 809
-get_repr_s_p 810
-find_method_p_p_s 811
-find_method_p_p_sc 812
-defined_i_p 813
-defined_i_p_ki 814
-defined_i_p_kic 815
-defined_i_p_k 816
-defined_i_p_kc 817
-exists_i_p_ki 818
-exists_i_p_kic 819
-exists_i_p_k 820
-exists_i_p_kc 821
-delete_p_k 822
-delete_p_kc 823
-delete_p_ki 824
-delete_p_kic 825
-elements_i_p 826
-push_p_i 827
-push_p_ic 828
-push_p_n 829
-push_p_nc 830
-push_p_s 831
-push_p_sc 832
-push_p_p 833
-pop_i_p 834
-pop_n_p 835
-pop_s_p 836
-pop_p_p 837
-unshift_p_i 838
-unshift_p_ic 839
-unshift_p_n 840
-unshift_p_nc 841
-unshift_p_s 842
-unshift_p_sc 843
-unshift_p_p 844
-shift_i_p 845
-shift_n_p 846
-shift_s_p 847
-shift_p_p 848
-splice_p_p_i_i 849
-splice_p_p_ic_i 850
-splice_p_p_i_ic 851
-splice_p_p_ic_ic 852
-setprop_p_s_p 853
-setprop_p_sc_p 854
-getprop_p_s_p 855
-getprop_p_sc_p 856
-delprop_p_s 857
-delprop_p_sc 858
-prophash_p_p 859
-freeze_s_p 860
-thaw_p_s 861
-thaw_p_sc 862
-add_multi_s_s_p 863
-add_multi_sc_s_p 864
-add_multi_s_sc_p 865
-add_multi_sc_sc_p 866
-find_multi_p_s_s 867
-find_multi_p_sc_s 868
-find_multi_p_s_sc 869
-find_multi_p_sc_sc 870
-register_p 871
-unregister_p 872
-box_p_i 873
-box_p_ic 874
-box_p_n 875
-box_p_nc 876
-box_p_s 877
-box_p_sc 878
-iter_p_p 879
-morph_p_p 880
-morph_p_pc 881
-clone_s_s 882
-clone_s_sc 883
-exchange_i_i 884
-exchange_p_p 885
-exchange_n_n 886
-exchange_s_s 887
-set_i_i 888
-set_i_ic 889
-set_i_n 890
-set_i_nc 891
-set_i_s 892
-set_i_sc 893
-set_n_n 894
-set_n_nc 895
-set_n_i 896
-set_n_ic 897
-set_n_s 898
-set_n_sc 899
-set_n_p 900
-set_s_p 901
-set_s_s 902
-set_s_sc 903
-set_s_i 904
-set_s_ic 905
-set_s_n 906
-set_s_nc 907
-set_p_pc 908
-set_p_p 909
-set_p_i 910
-set_p_ic 911
-set_p_n 912
-set_p_nc 913
-set_p_s 914
-set_p_sc 915
-set_i_p 916
-assign_p_p 917
-assign_p_i 918
-assign_p_ic 919
-assign_p_n 920
-assign_p_nc 921
-assign_p_s 922
-assign_p_sc 923
-assign_s_s 924
-assign_s_sc 925
-setref_p_p 926
-deref_p_p 927
-setp_ind_i_p 928
-setp_ind_ic_p 929
-setn_ind_i_n 930
-setn_ind_ic_n 931
-setn_ind_i_nc 932
-setn_ind_ic_nc 933
-sets_ind_i_s 934
-sets_ind_ic_s 935
-sets_ind_i_sc 936
-sets_ind_ic_sc 937
-seti_ind_i_i 938
-seti_ind_ic_i 939
-seti_ind_i_ic 940
-seti_ind_ic_ic 941
-set_p_ki_i 942
-set_p_kic_i 943
-set_p_ki_ic 944
-set_p_kic_ic 945
-set_p_ki_n 946
-set_p_kic_n 947
-set_p_ki_nc 948
-set_p_kic_nc 949
-set_p_ki_s 950
-set_p_kic_s 951
-set_p_ki_sc 952
-set_p_kic_sc 953
-set_p_ki_p 954
-set_p_kic_p 955
-set_i_p_ki 956
-set_i_p_kic 957
-set_n_p_ki 958
-set_n_p_kic 959
-set_s_p_ki 960
-set_s_p_kic 961
-set_p_p_ki 962
-set_p_p_kic 963
-set_p_k_i 964
-set_p_kc_i 965
-set_p_k_ic 966
-set_p_kc_ic 967
-set_p_k_n 968
-set_p_kc_n 969
-set_p_k_nc 970
-set_p_kc_nc 971
-set_p_k_s 972
-set_p_kc_s 973
-set_p_k_sc 974
-set_p_kc_sc 975
-set_p_k_p 976
-set_p_kc_p 977
-set_i_p_k 978
-set_i_p_kc 979
-set_n_p_k 980
-set_n_p_kc 981
-set_s_p_k 982
-set_s_p_kc 983
-set_p_p_k 984
-set_p_p_kc 985
-clone_p_p 986
-clone_p_p_p 987
-clone_p_p_pc 988
-copy_p_p 989
-null_s 990
-null_i 991
-null_p 992
-null_n 993
-cleari 994
-clearn 995
-clears 996
-clearp 997
-ord_i_s 998
-ord_i_sc 999
-ord_i_s_i 1000
-ord_i_sc_i 1001
-ord_i_s_ic 1002
-ord_i_sc_ic 1003
-chr_s_i 1004
-chr_s_ic 1005
-chopn_s_i 1006
-chopn_s_ic 1007
-chopn_s_s_i 1008
-chopn_s_sc_i 1009
-chopn_s_s_ic 1010
-chopn_s_sc_ic 1011
-concat_s_s 1012
-concat_s_sc 1013
-concat_p_p 1014
-concat_p_s 1015
-concat_p_sc 1016
-concat_s_s_s 1017
-concat_s_sc_s 1018
-concat_s_s_sc 1019
-concat_p_p_s 1020
-concat_p_p_sc 1021
-concat_p_p_p 1022
-repeat_s_s_i 1023
-repeat_s_sc_i 1024
-repeat_s_s_ic 1025
-repeat_s_sc_ic 1026
-repeat_p_p_i 1027
-repeat_p_p_ic 1028
-repeat_p_p_p 1029
-repeat_p_i 1030
-repeat_p_ic 1031
-repeat_p_p 1032
-length_i_s 1033
-length_i_sc 1034
-bytelength_i_s 1035
-bytelength_i_sc 1036
-pin_s 1037
-unpin_s 1038
-substr_s_s_i 1039
-substr_s_sc_i 1040
-substr_s_s_ic 1041
-substr_s_sc_ic 1042
-substr_s_s_i_i 1043
-substr_s_sc_i_i 1044
-substr_s_s_ic_i 1045
-substr_s_sc_ic_i 1046
-substr_s_s_i_ic 1047
-substr_s_sc_i_ic 1048
-substr_s_s_ic_ic 1049
-substr_s_sc_ic_ic 1050
-substr_s_s_i_i_s 1051
-substr_s_s_ic_i_s 1052
-substr_s_s_i_ic_s 1053
-substr_s_s_ic_ic_s 1054
-substr_s_s_i_i_sc 1055
-substr_s_s_ic_i_sc 1056
-substr_s_s_i_ic_sc 1057
-substr_s_s_ic_ic_sc 1058
-substr_s_i_i_s 1059
-substr_s_ic_i_s 1060
-substr_s_i_ic_s 1061
-substr_s_ic_ic_s 1062
-substr_s_i_i_sc 1063
-substr_s_ic_i_sc 1064
-substr_s_i_ic_sc 1065
-substr_s_ic_ic_sc 1066
-substr_s_p_i_i 1067
-substr_s_p_ic_i 1068
-substr_s_p_i_ic 1069
-substr_s_p_ic_ic 1070
-index_i_s_s 1071
-index_i_sc_s 1072
-index_i_s_sc 1073
-index_i_sc_sc 1074
-index_i_s_s_i 1075
-index_i_sc_s_i 1076
-index_i_s_sc_i 1077
-index_i_sc_sc_i 1078
-index_i_s_s_ic 1079
-index_i_sc_s_ic 1080
-index_i_s_sc_ic 1081
-index_i_sc_sc_ic 1082
-sprintf_s_s_p 1083
-sprintf_s_sc_p 1084
-sprintf_p_p_p 1085
-new_s 1086
-new_s_i 1087
-new_s_ic 1088
-stringinfo_i_s_i 1089
-stringinfo_i_sc_i 1090
-stringinfo_i_s_ic 1091
-stringinfo_i_sc_ic 1092
-upcase_s_s 1093
-upcase_s_sc 1094
-upcase_s 1095
-downcase_s_s 1096
-downcase_s_sc 1097
-downcase_s 1098
-titlecase_s_s 1099
-titlecase_s_sc 1100
-titlecase_s 1101
-join_s_s_p 1102
-join_s_sc_p 1103
-split_p_s_s 1104
-split_p_sc_s 1105
-split_p_s_sc 1106
-split_p_sc_sc 1107
-charset_i_s 1108
-charset_i_sc 1109
-charsetname_s_i 1110
-charsetname_s_ic 1111
-find_charset_i_s 1112
-find_charset_i_sc 1113
-trans_charset_s_i 1114
-trans_charset_s_ic 1115
-trans_charset_s_s_i 1116
-trans_charset_s_sc_i 1117
-trans_charset_s_s_ic 1118
-trans_charset_s_sc_ic 1119
-encoding_i_s 1120
-encoding_i_sc 1121
-encodingname_s_i 1122
-encodingname_s_ic 1123
-find_encoding_i_s 1124
-find_encoding_i_sc 1125
-trans_encoding_s_i 1126
-trans_encoding_s_ic 1127
-trans_encoding_s_s_i 1128
-trans_encoding_s_sc_i 1129
-trans_encoding_s_s_ic 1130
-trans_encoding_s_sc_ic 1131
-is_cclass_i_i_s_i 1132
-is_cclass_i_ic_s_i 1133
-is_cclass_i_i_sc_i 1134
-is_cclass_i_ic_sc_i 1135
-is_cclass_i_i_s_ic 1136
-is_cclass_i_ic_s_ic 1137
-is_cclass_i_i_sc_ic 1138
-is_cclass_i_ic_sc_ic 1139
-find_cclass_i_i_s_i_i 1140
-find_cclass_i_ic_s_i_i 1141
-find_cclass_i_i_sc_i_i 1142
-find_cclass_i_ic_sc_i_i 1143
-find_cclass_i_i_s_ic_i 1144
-find_cclass_i_ic_s_ic_i 1145
-find_cclass_i_i_sc_ic_i 1146
-find_cclass_i_ic_sc_ic_i 1147
-find_cclass_i_i_s_i_ic 1148
-find_cclass_i_ic_s_i_ic 1149
-find_cclass_i_i_sc_i_ic 1150
-find_cclass_i_ic_sc_i_ic 1151
-find_cclass_i_i_s_ic_ic 1152
-find_cclass_i_ic_s_ic_ic 1153
-find_cclass_i_i_sc_ic_ic 1154
-find_cclass_i_ic_sc_ic_ic 1155
-find_not_cclass_i_i_s_i_i 1156
-find_not_cclass_i_ic_s_i_i 1157
-find_not_cclass_i_i_sc_i_i 1158
-find_not_cclass_i_ic_sc_i_i 1159
-find_not_cclass_i_i_s_ic_i 1160
-find_not_cclass_i_ic_s_ic_i 1161
-find_not_cclass_i_i_sc_ic_i 1162
-find_not_cclass_i_ic_sc_ic_i 1163
-find_not_cclass_i_i_s_i_ic 1164
-find_not_cclass_i_ic_s_i_ic 1165
-find_not_cclass_i_i_sc_i_ic 1166
-find_not_cclass_i_ic_sc_i_ic 1167
-find_not_cclass_i_i_s_ic_ic 1168
-find_not_cclass_i_ic_s_ic_ic 1169
-find_not_cclass_i_i_sc_ic_ic 1170
-find_not_cclass_i_ic_sc_ic_ic 1171
-escape_s_s 1172
-compose_s_s 1173
-compose_s_sc 1174
-spawnw_i_s 1175
-spawnw_i_sc 1176
-spawnw_i_p 1177
-err_i 1178
-err_s 1179
-err_s_i 1180
-err_s_ic 1181
-time_i 1182
-time_n 1183
-gmtime_s_i 1184
-gmtime_s_ic 1185
-localtime_s_i 1186
-localtime_s_ic 1187
-decodetime_p_i 1188
-decodetime_p_ic 1189
-decodelocaltime_p_i 1190
-decodelocaltime_p_ic 1191
-sysinfo_s_i 1192
-sysinfo_s_ic 1193
-sysinfo_i_i 1194
-sysinfo_i_ic 1195
-sleep_i 1196
-sleep_ic 1197
-sleep_n 1198
-sleep_nc 1199
-sizeof_i_i 1200
-sizeof_i_ic 1201
-store_lex_s_p 1202
-store_lex_sc_p 1203
-find_lex_p_s 1204
-find_lex_p_sc 1205
-find_caller_lex_p_s 1206
-find_caller_lex_p_sc 1207
-get_namespace_p 1208
-get_namespace_p_p 1209
-get_namespace_p_pc 1210
-get_hll_namespace_p 1211
-get_hll_namespace_p_p 1212
-get_hll_namespace_p_pc 1213
-get_root_namespace_p 1214
-get_root_namespace_p_p 1215
-get_root_namespace_p_pc 1216
-get_global_p_s 1217
-get_global_p_sc 1218
-get_global_p_p_s 1219
-get_global_p_pc_s 1220
-get_global_p_p_sc 1221
-get_global_p_pc_sc 1222
-get_hll_global_p_s 1223
-get_hll_global_p_sc 1224
-get_hll_global_p_p_s 1225
-get_hll_global_p_pc_s 1226
-get_hll_global_p_p_sc 1227
-get_hll_global_p_pc_sc 1228
-get_root_global_p_s 1229
-get_root_global_p_sc 1230
-get_root_global_p_p_s 1231
-get_root_global_p_pc_s 1232
-get_root_global_p_p_sc 1233
-get_root_global_p_pc_sc 1234
-set_global_s_p 1235
-set_global_sc_p 1236
-set_global_p_s_p 1237
-set_global_pc_s_p 1238
-set_global_p_sc_p 1239
-set_global_pc_sc_p 1240
-set_hll_global_s_p 1241
-set_hll_global_sc_p 1242
-set_hll_global_p_s_p 1243
-set_hll_global_pc_s_p 1244
-set_hll_global_p_sc_p 1245
-set_hll_global_pc_sc_p 1246
-set_root_global_s_p 1247
-set_root_global_sc_p 1248
-set_root_global_p_s_p 1249
-set_root_global_pc_s_p 1250
-set_root_global_p_sc_p 1251
-set_root_global_pc_sc_p 1252
-find_name_p_s 1253
-find_name_p_sc 1254
-find_sub_not_null_p_s 1255
-find_sub_not_null_p_sc 1256
-isnull_i_s 1257
-isnull_i_sc 1258
+local_branch_p_i 14
+local_branch_p_ic 15
+local_return_p 16
+jump_i 17
+jump_ic 18
+enternative 19
+if_i_ic 20
+if_n_ic 21
+if_s_ic 22
+if_p_ic 23
+unless_i_ic 24
+unless_n_ic 25
+unless_s_ic 26
+unless_p_ic 27
+invokecc_p 28
+invoke_p_p 29
+yield 30
+tailcall_p 31
+returncc 32
+capture_lex_p 33
+newclosure_p_p 34
+set_args_pc 35
+get_results_pc 36
+get_params_pc 37
+set_returns_pc 38
+result_info_p 39
+set_addr_i_ic 40
+set_addr_p_ic 41
+set_addr_p_i 42
+get_addr_i_p 43
+schedule_p 44
+addhandler_p 45
+push_eh_ic 46
+push_eh_p 47
+pop_eh 48
+throw_p 49
+throw_p_p 50
+rethrow_p 51
+count_eh_i 52
+die_s 53
+die_sc 54
+die_p 55
+die_pc 56
+die_i_i 57
+die_ic_i 58
+die_i_ic 59
+die_ic_ic 60
+exit_i 61
+exit_ic 62
+pushmark_i 63
+pushmark_ic 64
+popmark_i 65
+popmark_ic 66
+pushaction_p 67
+debug_i 68
+debug_ic 69
+bounds_i 70
+bounds_ic 71
+profile_i 72
+profile_ic 73
+trace_i 74
+trace_ic 75
+gc_debug_i 76
+gc_debug_ic 77
+interpinfo_i_i 78
+interpinfo_i_ic 79
+interpinfo_p_i 80
+interpinfo_p_ic 81
+interpinfo_s_i 82
+interpinfo_s_ic 83
+warningson_i 84
+warningson_ic 85
+warningsoff_i 86
+warningsoff_ic 87
+errorson_i 88
+errorson_ic 89
+errorsoff_i 90
+errorsoff_ic 91
+runinterp_p_i 92
+runinterp_p_ic 93
+getinterp_p 94
+sweep_ic 95
+collect 96
+sweepoff 97
+sweepon 98
+collectoff 99
+collecton 100
+needs_destroy_p 101
+loadlib_p_s 102
+loadlib_p_sc 103
+dlfunc_p_p_s_s 104
+dlfunc_p_p_sc_s 105
+dlfunc_p_p_s_sc 106
+dlfunc_p_p_sc_sc 107
+dlvar_p_p_s 108
+dlvar_p_p_sc 109
+compreg_s_p 110
+compreg_sc_p 111
+compreg_p_s 112
+compreg_p_sc 113
+new_callback_p_p_p_s 114
+new_callback_p_p_p_sc 115
+annotations_p 116
+annotations_p_s 117
+annotations_p_sc 118
+band_i_i 119
+band_i_ic 120
+band_p_i 121
+band_p_ic 122
+band_p_p 123
+band_i_i_i 124
+band_i_ic_i 125
+band_i_i_ic 126
+band_p_p_i 127
+band_p_p_ic 128
+band_p_p_p 129
+bands_s_s 130
+bands_s_sc 131
+bands_p_s 132
+bands_p_sc 133
+bands_p_p 134
+bands_s_s_s 135
+bands_s_sc_s 136
+bands_s_s_sc 137
+bands_p_p_s 138
+bands_p_p_sc 139
+bands_p_p_p 140
+bnot_i 141
+bnot_i_i 142
+bnot_p 143
+bnot_p_p 144
+bnots_s 145
+bnots_s_s 146
+bnots_s_sc 147
+bnots_p 148
+bnots_p_p 149
+bor_i_i 150
+bor_i_ic 151
+bor_p_i 152
+bor_p_ic 153
+bor_p_p 154
+bor_i_i_i 155
+bor_i_ic_i 156
+bor_i_i_ic 157
+bor_p_p_i 158
+bor_p_p_ic 159
+bor_p_p_p 160
+bors_s_s 161
+bors_s_sc 162
+bors_p_s 163
+bors_p_sc 164
+bors_p_p 165
+bors_s_s_s 166
+bors_s_sc_s 167
+bors_s_s_sc 168
+bors_p_p_s 169
+bors_p_p_sc 170
+bors_p_p_p 171
+shl_i_i 172
+shl_i_ic 173
+shl_p_i 174
+shl_p_ic 175
+shl_p_p 176
+shl_i_i_i 177
+shl_i_ic_i 178
+shl_i_i_ic 179
+shl_p_p_i 180
+shl_p_p_ic 181
+shl_p_p_p 182
+shr_i_i 183
+shr_i_ic 184
+shr_p_i 185
+shr_p_ic 186
+shr_p_p 187
+shr_i_i_i 188
+shr_i_ic_i 189
+shr_i_i_ic 190
+shr_p_p_i 191
+shr_p_p_ic 192
+shr_p_p_p 193
+lsr_i_i 194
+lsr_i_ic 195
+lsr_p_i 196
+lsr_p_ic 197
+lsr_p_p 198
+lsr_i_i_i 199
+lsr_i_ic_i 200
+lsr_i_i_ic 201
+lsr_p_p_i 202
+lsr_p_p_ic 203
+lsr_p_p_p 204
+rot_i_i_i_ic 205
+rot_i_ic_i_ic 206
+rot_i_i_ic_ic 207
+bxor_i_i 208
+bxor_i_ic 209
+bxor_p_i 210
+bxor_p_ic 211
+bxor_p_p 212
+bxor_i_i_i 213
+bxor_i_ic_i 214
+bxor_i_i_ic 215
+bxor_p_p_i 216
+bxor_p_p_ic 217
+bxor_p_p_p 218
+bxors_s_s 219
+bxors_s_sc 220
+bxors_p_s 221
+bxors_p_sc 222
+bxors_p_p 223
+bxors_s_s_s 224
+bxors_s_sc_s 225
+bxors_s_s_sc 226
+bxors_p_p_s 227
+bxors_p_p_sc 228
+bxors_p_p_p 229
+eq_i_i_ic 230
+eq_ic_i_ic 231
+eq_i_ic_ic 232
+eq_n_n_ic 233
+eq_nc_n_ic 234
+eq_n_nc_ic 235
+eq_s_s_ic 236
+eq_sc_s_ic 237
+eq_s_sc_ic 238
+eq_p_p_ic 239
+eq_p_i_ic 240
+eq_p_ic_ic 241
+eq_p_n_ic 242
+eq_p_nc_ic 243
+eq_p_s_ic 244
+eq_p_sc_ic 245
+eq_str_p_p_ic 246
+eq_num_p_p_ic 247
+eq_addr_s_s_ic 248
+eq_addr_sc_s_ic 249
+eq_addr_s_sc_ic 250
+eq_addr_sc_sc_ic 251
+eq_addr_p_p_ic 252
+ne_i_i_ic 253
+ne_ic_i_ic 254
+ne_i_ic_ic 255
+ne_n_n_ic 256
+ne_nc_n_ic 257
+ne_n_nc_ic 258
+ne_s_s_ic 259
+ne_sc_s_ic 260
+ne_s_sc_ic 261
+ne_p_p_ic 262
+ne_p_i_ic 263
+ne_p_ic_ic 264
+ne_p_n_ic 265
+ne_p_nc_ic 266
+ne_p_s_ic 267
+ne_p_sc_ic 268
+ne_str_p_p_ic 269
+ne_num_p_p_ic 270
+ne_addr_s_s_ic 271
+ne_addr_sc_s_ic 272
+ne_addr_s_sc_ic 273
+ne_addr_sc_sc_ic 274
+ne_addr_p_p_ic 275
+lt_i_i_ic 276
+lt_ic_i_ic 277
+lt_i_ic_ic 278
+lt_n_n_ic 279
+lt_nc_n_ic 280
+lt_n_nc_ic 281
+lt_s_s_ic 282
+lt_sc_s_ic 283
+lt_s_sc_ic 284
+lt_p_p_ic 285
+lt_p_i_ic 286
+lt_p_ic_ic 287
+lt_p_n_ic 288
+lt_p_nc_ic 289
+lt_p_s_ic 290
+lt_p_sc_ic 291
+lt_str_p_p_ic 292
+lt_num_p_p_ic 293
+le_i_i_ic 294
+le_ic_i_ic 295
+le_i_ic_ic 296
+le_n_n_ic 297
+le_nc_n_ic 298
+le_n_nc_ic 299
+le_s_s_ic 300
+le_sc_s_ic 301
+le_s_sc_ic 302
+le_p_p_ic 303
+le_p_i_ic 304
+le_p_ic_ic 305
+le_p_n_ic 306
+le_p_nc_ic 307
+le_p_s_ic 308
+le_p_sc_ic 309
+le_str_p_p_ic 310
+le_num_p_p_ic 311
+gt_p_p_ic 312
+gt_p_i_ic 313
+gt_p_ic_ic 314
+gt_p_n_ic 315
+gt_p_nc_ic 316
+gt_p_s_ic 317
+gt_p_sc_ic 318
+gt_str_p_p_ic 319
+gt_num_p_p_ic 320
+ge_p_p_ic 321
+ge_p_i_ic 322
+ge_p_ic_ic 323
+ge_p_n_ic 324
+ge_p_nc_ic 325
+ge_p_s_ic 326
+ge_p_sc_ic 327
+ge_str_p_p_ic 328
+ge_num_p_p_ic 329
+if_null_p_ic 330
+if_null_s_ic 331
+unless_null_p_ic 332
+unless_null_s_ic 333
+cmp_i_i_i 334
+cmp_i_ic_i 335
+cmp_i_i_ic 336
+cmp_i_n_n 337
+cmp_i_nc_n 338
+cmp_i_n_nc 339
+cmp_i_s_s 340
+cmp_i_sc_s 341
+cmp_i_s_sc 342
+cmp_i_p_p 343
+cmp_i_p_i 344
+cmp_i_p_ic 345
+cmp_i_p_n 346
+cmp_i_p_nc 347
+cmp_i_p_s 348
+cmp_i_p_sc 349
+cmp_str_i_p_p 350
+cmp_num_i_p_p 351
+cmp_pmc_p_p_p 352
+issame_i_p_p 353
+issame_i_s_s 354
+issame_i_sc_s 355
+issame_i_s_sc 356
+issame_i_sc_sc 357
+isntsame_i_p_p 358
+isntsame_i_s_s 359
+isntsame_i_sc_s 360
+isntsame_i_s_sc 361
+isntsame_i_sc_sc 362
+istrue_i_p 363
+isfalse_i_p 364
+isnull_i_p 365
+isnull_i_pc 366
+isnull_i_s 367
+isnull_i_sc 368
+isgt_i_p_p 369
+isge_i_p_p 370
+isle_i_i_i 371
+isle_i_ic_i 372
+isle_i_i_ic 373
+isle_i_n_n 374
+isle_i_nc_n 375
+isle_i_n_nc 376
+isle_i_s_s 377
+isle_i_sc_s 378
+isle_i_s_sc 379
+isle_i_p_p 380
+islt_i_i_i 381
+islt_i_ic_i 382
+islt_i_i_ic 383
+islt_i_n_n 384
+islt_i_nc_n 385
+islt_i_n_nc 386
+islt_i_s_s 387
+islt_i_sc_s 388
+islt_i_s_sc 389
+islt_i_p_p 390
+iseq_i_i_i 391
+iseq_i_ic_i 392
+iseq_i_i_ic 393
+iseq_i_n_n 394
+iseq_i_nc_n 395
+iseq_i_n_nc 396
+iseq_i_s_s 397
+iseq_i_sc_s 398
+iseq_i_s_sc 399
+iseq_i_p_p 400
+isne_i_i_i 401
+isne_i_ic_i 402
+isne_i_i_ic 403
+isne_i_n_n 404
+isne_i_nc_n 405
+isne_i_n_nc 406
+isne_i_s_s 407
+isne_i_sc_s 408
+isne_i_s_sc 409
+isne_i_p_p 410
+and_i_i_i 411
+and_i_ic_i 412
+and_i_i_ic 413
+and_p_p_p 414
+not_i 415
+not_i_i 416
+not_p 417
+not_p_p 418
+or_i_i_i 419
+or_i_ic_i 420
+or_i_i_ic 421
+or_p_p_p 422
+xor_i_i_i 423
+xor_i_ic_i 424
+xor_i_i_ic 425
+xor_p_p_p 426
+debug_init 427
+debug_load_sc 428
+debug_break 429
+debug_print 430
+backtrace 431
+getline_i 432
+getfile_s 433
+set_label_p_ic 434
+get_label_i_p 435
+close_p 436
+fdopen_p_i_s 437
+fdopen_p_ic_s 438
+fdopen_p_i_sc 439
+fdopen_p_ic_sc 440
+getstdin_p 441
+getstdout_p 442
+getstderr_p 443
+setstdin_p 444
+setstdout_p 445
+setstderr_p 446
+open_p_s_s 447
+open_p_sc_s 448
+open_p_s_sc 449
+open_p_sc_sc 450
+open_p_s 451
+open_p_sc 452
+print_i 453
+print_ic 454
+print_n 455
+print_nc 456
+print_s 457
+print_sc 458
+print_p 459
+say_i 460
+say_ic 461
+say_n 462
+say_nc 463
+say_s 464
+say_sc 465
+say_p 466
+printerr_i 467
+printerr_ic 468
+printerr_n 469
+printerr_nc 470
+printerr_s 471
+printerr_sc 472
+printerr_p 473
+print_p_i 474
+print_p_ic 475
+print_p_n 476
+print_p_nc 477
+print_p_s 478
+print_p_sc 479
+print_p_p 480
+read_s_i 481
+read_s_ic 482
+read_s_p_i 483
+read_s_p_ic 484
+readline_s_p 485
+peek_s 486
+peek_s_p 487
+stat_i_s_i 488
+stat_i_sc_i 489
+stat_i_s_ic 490
+stat_i_sc_ic 491
+stat_i_i_i 492
+stat_i_ic_i 493
+stat_i_i_ic 494
+stat_i_ic_ic 495
+seek_p_i_i 496
+seek_p_ic_i 497
+seek_p_i_ic 498
+seek_p_ic_ic 499
+seek_p_i_i_i 500
+seek_p_ic_i_i 501
+seek_p_i_ic_i 502
+seek_p_ic_ic_i 503
+seek_p_i_i_ic 504
+seek_p_ic_i_ic 505
+seek_p_i_ic_ic 506
+seek_p_ic_ic_ic 507
+tell_i_p 508
+tell_i_i_p 509
+abs_i 510
+abs_n 511
+abs_i_i 512
+abs_n_n 513
+abs_p 514
+abs_p_p 515
+add_i_i 516
+add_i_ic 517
+add_n_n 518
+add_n_nc 519
+add_p_p 520
+add_p_i 521
+add_p_ic 522
+add_p_n 523
+add_p_nc 524
+add_i_i_i 525
+add_i_ic_i 526
+add_i_i_ic 527
+add_n_n_n 528
+add_n_nc_n 529
+add_n_n_nc 530
+add_p_p_p 531
+add_p_p_i 532
+add_p_p_ic 533
+add_p_p_n 534
+add_p_p_nc 535
+cmod_i_i_i 536
+cmod_i_ic_i 537
+cmod_i_i_ic 538
+cmod_p_p_i 539
+cmod_p_p_ic 540
+cmod_p_p_p 541
+cmod_n_n_n 542
+cmod_n_nc_n 543
+cmod_n_n_nc 544
+cmod_p_p_n 545
+cmod_p_p_nc 546
+dec_i 547
+dec_n 548
+dec_p 549
+div_i_i 550
+div_i_ic 551
+div_n_n 552
+div_n_nc 553
+div_p_p 554
+div_p_i 555
+div_p_ic 556
+div_p_n 557
+div_p_nc 558
+div_i_i_i 559
+div_i_ic_i 560
+div_i_i_ic 561
+div_i_ic_ic 562
+div_n_n_n 563
+div_n_nc_n 564
+div_n_n_nc 565
+div_n_nc_nc 566
+div_p_p_p 567
+div_p_p_i 568
+div_p_p_ic 569
+div_p_p_n 570
+div_p_p_nc 571
+fdiv_i_i 572
+fdiv_i_ic 573
+fdiv_n_n 574
+fdiv_n_nc 575
+fdiv_p_p 576
+fdiv_p_i 577
+fdiv_p_ic 578
+fdiv_p_n 579
+fdiv_p_nc 580
+fdiv_i_i_i 581
+fdiv_i_ic_i 582
+fdiv_i_i_ic 583
+fdiv_n_n_n 584
+fdiv_n_nc_n 585
+fdiv_n_n_nc 586
+fdiv_p_p_p 587
+fdiv_p_p_i 588
+fdiv_p_p_ic 589
+fdiv_p_p_n 590
+fdiv_p_p_nc 591
+ceil_n 592
+ceil_i_n 593
+ceil_n_n 594
+floor_n 595
+floor_i_n 596
+floor_n_n 597
+inc_i 598
+inc_n 599
+inc_p 600
+mod_i_i 601
+mod_i_ic 602
+mod_n_n 603
+mod_n_nc 604
+mod_p_p 605
+mod_p_i 606
+mod_p_ic 607
+mod_p_n 608
+mod_p_nc 609
+mod_i_i_i 610
+mod_i_ic_i 611
+mod_i_i_ic 612
+mod_n_n_n 613
+mod_n_nc_n 614
+mod_n_n_nc 615
+mod_p_p_p 616
+mod_p_p_i 617
+mod_p_p_ic 618
+mod_p_p_n 619
+mod_p_p_nc 620
+mul_i_i 621
+mul_i_ic 622
+mul_n_n 623
+mul_n_nc 624
+mul_p_p 625
+mul_p_i 626
+mul_p_ic 627
+mul_p_n 628
+mul_p_nc 629
+mul_i_i_i 630
+mul_i_ic_i 631
+mul_i_i_ic 632
+mul_n_n_n 633
+mul_n_nc_n 634
+mul_n_n_nc 635
+mul_p_p_p 636
+mul_p_p_i 637
+mul_p_p_ic 638
+mul_p_p_n 639
+mul_p_p_nc 640
+neg_i 641
+neg_n 642
+neg_p 643
+neg_i_i 644
+neg_n_n 645
+neg_p_p 646
+pow_n_n_n 647
+pow_n_nc_n 648
+pow_n_n_nc 649
+pow_p_p_p 650
+pow_p_p_i 651
+pow_p_p_ic 652
+pow_p_p_n 653
+pow_p_p_nc 654
+pow_n_n_i 655
+pow_n_nc_i 656
+pow_n_n_ic 657
+pow_n_nc_ic 658
+sub_i_i 659
+sub_i_ic 660
+sub_n_n 661
+sub_n_nc 662
+sub_p_p 663
+sub_p_i 664
+sub_p_ic 665
+sub_p_n 666
+sub_p_nc 667
+sub_i_i_i 668
+sub_i_ic_i 669
+sub_i_i_ic 670
+sub_n_n_n 671
+sub_n_nc_n 672
+sub_n_n_nc 673
+sub_p_p_p 674
+sub_p_p_i 675
+sub_p_p_ic 676
+sub_p_p_n 677
+sub_p_p_nc 678
+sqrt_n_n 679
+acos_n_n 680
+asec_n_n 681
+asin_n_n 682
+atan_n_n 683
+atan_n_n_n 684
+atan_n_nc_n 685
+atan_n_n_nc 686
+cos_n_n 687
+cosh_n_n 688
+exp_n_n 689
+ln_n_n 690
+log10_n_n 691
+log2_n_n 692
+sec_n_n 693
+sech_n_n 694
+sin_n_n 695
+sinh_n_n 696
+tan_n_n 697
+tanh_n_n 698
+gcd_i_i_i 699
+gcd_i_ic_i 700
+gcd_i_i_ic 701
+lcm_i_i_i 702
+lcm_i_ic_i 703
+lcm_i_i_ic 704
+fact_i_i 705
+fact_n_i 706
+callmethodcc_p_s 707
+callmethodcc_p_sc 708
+callmethodcc_p_p 709
+callmethod_p_s_p 710
+callmethod_p_sc_p 711
+callmethod_p_p_p 712
+tailcallmethod_p_s 713
+tailcallmethod_p_sc 714
+tailcallmethod_p_p 715
+addmethod_p_s_p 716
+addmethod_p_sc_p 717
+can_i_p_s 718
+can_i_p_sc 719
+does_i_p_s 720
+does_i_p_sc 721
+does_i_p_p 722
+does_i_p_pc 723
+isa_i_p_s 724
+isa_i_p_sc 725
+isa_i_p_p 726
+isa_i_p_pc 727
+newclass_p_s 728
+newclass_p_sc 729
+newclass_p_p 730
+newclass_p_pc 731
+subclass_p_p 732
+subclass_p_pc 733
+subclass_p_p_s 734
+subclass_p_pc_s 735
+subclass_p_p_sc 736
+subclass_p_pc_sc 737
+subclass_p_p_p 738
+subclass_p_pc_p 739
+subclass_p_p_pc 740
+subclass_p_pc_pc 741
+subclass_p_s 742
+subclass_p_sc 743
+subclass_p_s_s 744
+subclass_p_sc_s 745
+subclass_p_s_sc 746
+subclass_p_sc_sc 747
+subclass_p_s_p 748
+subclass_p_sc_p 749
+subclass_p_s_pc 750
+subclass_p_sc_pc 751
+get_class_p_s 752
+get_class_p_sc 753
+get_class_p_p 754
+get_class_p_pc 755
+class_p_p 756
+addparent_p_p 757
+removeparent_p_p 758
+addrole_p_p 759
+addattribute_p_s 760
+addattribute_p_sc 761
+removeattribute_p_s 762
+removeattribute_p_sc 763
+getattribute_p_p_s 764
+getattribute_p_p_sc 765
+getattribute_p_p_p_s 766
+getattribute_p_p_pc_s 767
+getattribute_p_p_p_sc 768
+getattribute_p_p_pc_sc 769
+setattribute_p_s_p 770
+setattribute_p_sc_p 771
+setattribute_p_p_s_p 772
+setattribute_p_pc_s_p 773
+setattribute_p_p_sc_p 774
+setattribute_p_pc_sc_p 775
+inspect_p_p 776
+inspect_p_pc 777
+inspect_p_p_s 778
+inspect_p_pc_s 779
+inspect_p_p_sc 780
+inspect_p_pc_sc 781
+pic_infix___ic_p_p 782
+pic_inline_sub___ic_p_p 783
+pic_get_params___pc 784
+pic_set_returns___pc 785
+pic_callr___pc 786
+new_p_s 787
+new_p_sc 788
+new_p_s_p 789
+new_p_sc_p 790
+new_p_s_pc 791
+new_p_sc_pc 792
+new_p_p 793
+new_p_pc 794
+new_p_p_p 795
+new_p_pc_p 796
+new_p_p_pc 797
+new_p_pc_pc 798
+root_new_p_p 799
+root_new_p_pc 800
+root_new_p_p_p 801
+root_new_p_pc_p 802
+root_new_p_p_pc 803
+root_new_p_pc_pc 804
+typeof_s_p 805
+typeof_p_p 806
+get_repr_s_p 807
+find_method_p_p_s 808
+find_method_p_p_sc 809
+defined_i_p 810
+defined_i_p_ki 811
+defined_i_p_kic 812
+defined_i_p_k 813
+defined_i_p_kc 814
+exists_i_p_ki 815
+exists_i_p_kic 816
+exists_i_p_k 817
+exists_i_p_kc 818
+delete_p_k 819
+delete_p_kc 820
+delete_p_ki 821
+delete_p_kic 822
+elements_i_p 823
+push_p_i 824
+push_p_ic 825
+push_p_n 826
+push_p_nc 827
+push_p_s 828
+push_p_sc 829
+push_p_p 830
+pop_i_p 831
+pop_n_p 832
+pop_s_p 833
+pop_p_p 834
+unshift_p_i 835
+unshift_p_ic 836
+unshift_p_n 837
+unshift_p_nc 838
+unshift_p_s 839
+unshift_p_sc 840
+unshift_p_p 841
+shift_i_p 842
+shift_n_p 843
+shift_s_p 844
+shift_p_p 845
+splice_p_p_i_i 846
+splice_p_p_ic_i 847
+splice_p_p_i_ic 848
+splice_p_p_ic_ic 849
+setprop_p_s_p 850
+setprop_p_sc_p 851
+getprop_p_s_p 852
+getprop_p_sc_p 853
+delprop_p_s 854
+delprop_p_sc 855
+prophash_p_p 856
+freeze_s_p 857
+thaw_p_s 858
+thaw_p_sc 859
+add_multi_s_s_p 860
+add_multi_sc_s_p 861
+add_multi_s_sc_p 862
+add_multi_sc_sc_p 863
+find_multi_p_s_s 864
+find_multi_p_sc_s 865
+find_multi_p_s_sc 866
+find_multi_p_sc_sc 867
+register_p 868
+unregister_p 869
+box_p_i 870
+box_p_ic 871
+box_p_n 872
+box_p_nc 873
+box_p_s 874
+box_p_sc 875
+iter_p_p 876
+morph_p_p 877
+morph_p_pc 878
+clone_s_s 879
+clone_s_sc 880
+exchange_i_i 881
+exchange_p_p 882
+exchange_n_n 883
+exchange_s_s 884
+set_i_i 885
+set_i_ic 886
+set_i_n 887
+set_i_nc 888
+set_i_s 889
+set_i_sc 890
+set_n_n 891
+set_n_nc 892
+set_n_i 893
+set_n_ic 894
+set_n_s 895
+set_n_sc 896
+set_n_p 897
+set_s_p 898
+set_s_s 899
+set_s_sc 900
+set_s_i 901
+set_s_ic 902
+set_s_n 903
+set_s_nc 904
+set_p_pc 905
+set_p_p 906
+set_p_i 907
+set_p_ic 908
+set_p_n 909
+set_p_nc 910
+set_p_s 911
+set_p_sc 912
+set_i_p 913
+assign_p_p 914
+assign_p_i 915
+assign_p_ic 916
+assign_p_n 917
+assign_p_nc 918
+assign_p_s 919
+assign_p_sc 920
+assign_s_s 921
+assign_s_sc 922
+setref_p_p 923
+deref_p_p 924
+setp_ind_i_p 925
+setp_ind_ic_p 926
+setn_ind_i_n 927
+setn_ind_ic_n 928
+setn_ind_i_nc 929
+setn_ind_ic_nc 930
+sets_ind_i_s 931
+sets_ind_ic_s 932
+sets_ind_i_sc 933
+sets_ind_ic_sc 934
+seti_ind_i_i 935
+seti_ind_ic_i 936
+seti_ind_i_ic 937
+seti_ind_ic_ic 938
+set_p_ki_i 939
+set_p_kic_i 940
+set_p_ki_ic 941
+set_p_kic_ic 942
+set_p_ki_n 943
+set_p_kic_n 944
+set_p_ki_nc 945
+set_p_kic_nc 946
+set_p_ki_s 947
+set_p_kic_s 948
+set_p_ki_sc 949
+set_p_kic_sc 950
+set_p_ki_p 951
+set_p_kic_p 952
+set_i_p_ki 953
+set_i_p_kic 954
+set_n_p_ki 955
+set_n_p_kic 956
+set_s_p_ki 957
+set_s_p_kic 958
+set_p_p_ki 959
+set_p_p_kic 960
+set_p_k_i 961
+set_p_kc_i 962
+set_p_k_ic 963
+set_p_kc_ic 964
+set_p_k_n 965
+set_p_kc_n 966
+set_p_k_nc 967
+set_p_kc_nc 968
+set_p_k_s 969
+set_p_kc_s 970
+set_p_k_sc 971
+set_p_kc_sc 972
+set_p_k_p 973
+set_p_kc_p 974
+set_i_p_k 975
+set_i_p_kc 976
+set_n_p_k 977
+set_n_p_kc 978
+set_s_p_k 979
+set_s_p_kc 980
+set_p_p_k 981
+set_p_p_kc 982
+clone_p_p 983
+clone_p_p_p 984
+clone_p_p_pc 985
+copy_p_p 986
+null_s 987
+null_i 988
+null_p 989
+null_n 990
+cleari 991
+clearn 992
+clears 993
+clearp 994
+ord_i_s 995
+ord_i_sc 996
+ord_i_s_i 997
+ord_i_sc_i 998
+ord_i_s_ic 999
+ord_i_sc_ic 1000
+chr_s_i 1001
+chr_s_ic 1002
+chopn_s_i 1003
+chopn_s_ic 1004
+chopn_s_s_i 1005
+chopn_s_sc_i 1006
+chopn_s_s_ic 1007
+chopn_s_sc_ic 1008
+concat_s_s 1009
+concat_s_sc 1010
+concat_p_p 1011
+concat_p_s 1012
+concat_p_sc 1013
+concat_s_s_s 1014
+concat_s_sc_s 1015
+concat_s_s_sc 1016
+concat_p_p_s 1017
+concat_p_p_sc 1018
+concat_p_p_p 1019
+repeat_s_s_i 1020
+repeat_s_sc_i 1021
+repeat_s_s_ic 1022
+repeat_s_sc_ic 1023
+repeat_p_p_i 1024
+repeat_p_p_ic 1025
+repeat_p_p_p 1026
+repeat_p_i 1027
+repeat_p_ic 1028
+repeat_p_p 1029
+length_i_s 1030
+length_i_sc 1031
+bytelength_i_s 1032
+bytelength_i_sc 1033
+pin_s 1034
+unpin_s 1035
+substr_s_s_i 1036
+substr_s_sc_i 1037
+substr_s_s_ic 1038
+substr_s_sc_ic 1039
+substr_s_s_i_i 1040
+substr_s_sc_i_i 1041
+substr_s_s_ic_i 1042
+substr_s_sc_ic_i 1043
+substr_s_s_i_ic 1044
+substr_s_sc_i_ic 1045
+substr_s_s_ic_ic 1046
+substr_s_sc_ic_ic 1047
+substr_s_s_i_i_s 1048
+substr_s_s_ic_i_s 1049
+substr_s_s_i_ic_s 1050
+substr_s_s_ic_ic_s 1051
+substr_s_s_i_i_sc 1052
+substr_s_s_ic_i_sc 1053
+substr_s_s_i_ic_sc 1054
+substr_s_s_ic_ic_sc 1055
+substr_s_i_i_s 1056
+substr_s_ic_i_s 1057
+substr_s_i_ic_s 1058
+substr_s_ic_ic_s 1059
+substr_s_i_i_sc 1060
+substr_s_ic_i_sc 1061
+substr_s_i_ic_sc 1062
+substr_s_ic_ic_sc 1063
+substr_s_p_i_i 1064
+substr_s_p_ic_i 1065
+substr_s_p_i_ic 1066
+substr_s_p_ic_ic 1067
+index_i_s_s 1068
+index_i_sc_s 1069
+index_i_s_sc 1070
+index_i_sc_sc 1071
+index_i_s_s_i 1072
+index_i_sc_s_i 1073
+index_i_s_sc_i 1074
+index_i_sc_sc_i 1075
+index_i_s_s_ic 1076
+index_i_sc_s_ic 1077
+index_i_s_sc_ic 1078
+index_i_sc_sc_ic 1079
+sprintf_s_s_p 1080
+sprintf_s_sc_p 1081
+sprintf_p_p_p 1082
+new_s 1083
+new_s_i 1084
+new_s_ic 1085
+stringinfo_i_s_i 1086
+stringinfo_i_sc_i 1087
+stringinfo_i_s_ic 1088
+stringinfo_i_sc_ic 1089
+upcase_s_s 1090
+upcase_s_sc 1091
+upcase_s 1092
+downcase_s_s 1093
+downcase_s_sc 1094
+downcase_s 1095
+titlecase_s_s 1096
+titlecase_s_sc 1097
+titlecase_s 1098
+join_s_s_p 1099
+join_s_sc_p 1100
+split_p_s_s 1101
+split_p_sc_s 1102
+split_p_s_sc 1103
+split_p_sc_sc 1104
+charset_i_s 1105
+charset_i_sc 1106
+charsetname_s_i 1107
+charsetname_s_ic 1108
+find_charset_i_s 1109
+find_charset_i_sc 1110
+trans_charset_s_i 1111
+trans_charset_s_ic 1112
+trans_charset_s_s_i 1113
+trans_charset_s_sc_i 1114
+trans_charset_s_s_ic 1115
+trans_charset_s_sc_ic 1116
+encoding_i_s 1117
+encoding_i_sc 1118
+encodingname_s_i 1119
+encodingname_s_ic 1120
+find_encoding_i_s 1121
+find_encoding_i_sc 1122
+trans_encoding_s_i 1123
+trans_encoding_s_ic 1124
+trans_encoding_s_s_i 1125
+trans_encoding_s_sc_i 1126
+trans_encoding_s_s_ic 1127
+trans_encoding_s_sc_ic 1128
+is_cclass_i_i_s_i 1129
+is_cclass_i_ic_s_i 1130
+is_cclass_i_i_sc_i 1131
+is_cclass_i_ic_sc_i 1132
+is_cclass_i_i_s_ic 1133
+is_cclass_i_ic_s_ic 1134
+is_cclass_i_i_sc_ic 1135
+is_cclass_i_ic_sc_ic 1136
+find_cclass_i_i_s_i_i 1137
+find_cclass_i_ic_s_i_i 1138
+find_cclass_i_i_sc_i_i 1139
+find_cclass_i_ic_sc_i_i 1140
+find_cclass_i_i_s_ic_i 1141
+find_cclass_i_ic_s_ic_i 1142
+find_cclass_i_i_sc_ic_i 1143
+find_cclass_i_ic_sc_ic_i 1144
+find_cclass_i_i_s_i_ic 1145
+find_cclass_i_ic_s_i_ic 1146
+find_cclass_i_i_sc_i_ic 1147
+find_cclass_i_ic_sc_i_ic 1148
+find_cclass_i_i_s_ic_ic 1149
+find_cclass_i_ic_s_ic_ic 1150
+find_cclass_i_i_sc_ic_ic 1151
+find_cclass_i_ic_sc_ic_ic 1152
+find_not_cclass_i_i_s_i_i 1153
+find_not_cclass_i_ic_s_i_i 1154
+find_not_cclass_i_i_sc_i_i 1155
+find_not_cclass_i_ic_sc_i_i 1156
+find_not_cclass_i_i_s_ic_i 1157
+find_not_cclass_i_ic_s_ic_i 1158
+find_not_cclass_i_i_sc_ic_i 1159
+find_not_cclass_i_ic_sc_ic_i 1160
+find_not_cclass_i_i_s_i_ic 1161
+find_not_cclass_i_ic_s_i_ic 1162
+find_not_cclass_i_i_sc_i_ic 1163
+find_not_cclass_i_ic_sc_i_ic 1164
+find_not_cclass_i_i_s_ic_ic 1165
+find_not_cclass_i_ic_s_ic_ic 1166
+find_not_cclass_i_i_sc_ic_ic 1167
+find_not_cclass_i_ic_sc_ic_ic 1168
+escape_s_s 1169
+compose_s_s 1170
+compose_s_sc 1171
+spawnw_i_s 1172
+spawnw_i_sc 1173
+spawnw_i_p 1174
+err_i 1175
+err_s 1176
+err_s_i 1177
+err_s_ic 1178
+time_i 1179
+time_n 1180
+gmtime_s_i 1181
+gmtime_s_ic 1182
+localtime_s_i 1183
+localtime_s_ic 1184
+decodetime_p_i 1185
+decodetime_p_ic 1186
+decodelocaltime_p_i 1187
+decodelocaltime_p_ic 1188
+sysinfo_s_i 1189
+sysinfo_s_ic 1190
+sysinfo_i_i 1191
+sysinfo_i_ic 1192
+sleep_i 1193
+sleep_ic 1194
+sleep_n 1195
+sleep_nc 1196
+sizeof_i_i 1197
+sizeof_i_ic 1198
+store_lex_s_p 1199
+store_lex_sc_p 1200
+find_lex_p_s 1201
+find_lex_p_sc 1202
+find_caller_lex_p_s 1203
+find_caller_lex_p_sc 1204
+get_namespace_p 1205
+get_namespace_p_p 1206
+get_namespace_p_pc 1207
+get_hll_namespace_p 1208
+get_hll_namespace_p_p 1209
+get_hll_namespace_p_pc 1210
+get_root_namespace_p 1211
+get_root_namespace_p_p 1212
+get_root_namespace_p_pc 1213
+get_global_p_s 1214
+get_global_p_sc 1215
+get_global_p_p_s 1216
+get_global_p_pc_s 1217
+get_global_p_p_sc 1218
+get_global_p_pc_sc 1219
+get_hll_global_p_s 1220
+get_hll_global_p_sc 1221
+get_hll_global_p_p_s 1222
+get_hll_global_p_pc_s 1223
+get_hll_global_p_p_sc 1224
+get_hll_global_p_pc_sc 1225
+get_root_global_p_s 1226
+get_root_global_p_sc 1227
+get_root_global_p_p_s 1228
+get_root_global_p_pc_s 1229
+get_root_global_p_p_sc 1230
+get_root_global_p_pc_sc 1231
+set_global_s_p 1232
+set_global_sc_p 1233
+set_global_p_s_p 1234
+set_global_pc_s_p 1235
+set_global_p_sc_p 1236
+set_global_pc_sc_p 1237
+set_hll_global_s_p 1238
+set_hll_global_sc_p 1239
+set_hll_global_p_s_p 1240
+set_hll_global_pc_s_p 1241
+set_hll_global_p_sc_p 1242
+set_hll_global_pc_sc_p 1243
+set_root_global_s_p 1244
+set_root_global_sc_p 1245
+set_root_global_p_s_p 1246
+set_root_global_pc_s_p 1247
+set_root_global_p_sc_p 1248
+set_root_global_pc_sc_p 1249
+find_name_p_s 1250
+find_name_p_sc 1251
+find_sub_not_null_p_s 1252
+find_sub_not_null_p_sc 1253
Modified: branches/pluggable_runcore/src/ops/pic.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/pic.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/pic.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,12 +3,12 @@
** pic.ops
*/
+BEGIN_OPS_PREAMBLE
#include "parrot/oplib/ops.h"
#include "../src/pmc/pmc_fixedintegerarray.h"
typedef opcode_t* (*interface_f)(Interp*, INTVAL*, void **);
-
-VERSION = PARROT_VERSION;
+END_OPS_PREAMBLE
=head1 NAME
Modified: branches/pluggable_runcore/src/ops/pmc.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/pmc.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/pmc.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -6,8 +6,6 @@
*/
-VERSION = PARROT_VERSION;
-
=head1 NAME
pmc.ops - PMC Opcodes
Modified: branches/pluggable_runcore/src/ops/set.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/set.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/set.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,8 +3,6 @@
** set.ops
*/
-VERSION = PARROT_VERSION;
-
=head1 NAME
set.ops - Assignment Opcodes
Modified: branches/pluggable_runcore/src/ops/string.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/string.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/string.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,8 +3,6 @@
** string.ops
*/
-VERSION = PARROT_VERSION;
-
=head1 NAME
string.ops - String Opcodes
Modified: branches/pluggable_runcore/src/ops/sys.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/sys.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/sys.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,8 +3,6 @@
** sys.ops
*/
-VERSION = PARROT_VERSION;
-
=head1 NAME
sys.ops - System Interaction Opcodes
@@ -31,8 +29,12 @@
$2 and wait for it to finish. The return status, which is very
system-dependent, goes in $1.
-RT#36619: spawnw should return something less system-dependent, and more
-object-like. see RT ticket [perl #36619] for more info.
+TT #847: C<spawnw()> should itself handle splitting up command-line arguments,
+rather than depending on the shell to do so in potentially unsafe manner.
+See https://trac.parrot.org/parrot/ticket/847.
+
+TT #848: C<spawnw()> should return something less system-dependent, and more
+object-like. See https://trac.parrot.org/parrot/ticket/848.
=cut
Modified: branches/pluggable_runcore/src/ops/var.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/var.ops Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/ops/var.ops Fri Aug 14 01:24:23 2009 (r40541)
@@ -3,8 +3,6 @@
** var.ops
*/
-VERSION = PARROT_VERSION;
-
=head1 NAME
var.ops - Variable Opcodes
Modified: branches/pluggable_runcore/src/packdump.c
==============================================================================
--- branches/pluggable_runcore/src/packdump.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/packdump.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -194,16 +194,6 @@
opcode_t type = PObj_get_FLAGS(key);
Parrot_io_printf(interp, " {\n");
- if ((type & (KEY_start_slice_FLAG|KEY_inf_slice_FLAG)) ==
- (KEY_start_slice_FLAG|KEY_inf_slice_FLAG))
- Parrot_io_printf(interp, " SLICE_BITS => PF_VT_END_INF\n");
- if ((type & (KEY_end_slice_FLAG|KEY_inf_slice_FLAG)) ==
- (KEY_end_slice_FLAG|KEY_inf_slice_FLAG))
- Parrot_io_printf(interp, " SLICE_BITS => PF_VT_START_ZERO\n");
- if (type & KEY_start_slice_FLAG)
- Parrot_io_printf(interp, " SLICE_BITS => PF_VT_START_SLICE\n");
- if (type & KEY_end_slice_FLAG)
- Parrot_io_printf(interp, " SLICE_BITS => PF_VT_END_SLICE\n");
type &= KEY_type_FLAGS;
pobj_flag_dump(interp, (long)PObj_get_FLAGS(key));
Modified: branches/pluggable_runcore/src/packfile.c
==============================================================================
--- branches/pluggable_runcore/src/packfile.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/packfile.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -2251,6 +2251,26 @@
}
}
}
+
+ /* XXX
+ * Temporary? hack to put ConstantTable in front of other segments.
+ * This is useful for Annotations because we ensure that constants used
+ * for keys already available during unpack.
+ */
+ seg = dir->segments[2];
+
+ if (seg->type != PF_CONST_SEG) {
+ size_t i;
+
+ for (i = 3; i < num_segs; i++) {
+ PackFile_Segment * const s2 = dir->segments[i];
+ if (s2->type == PF_CONST_SEG) {
+ dir->segments[2] = s2;
+ dir->segments[i] = seg;
+ break;
+ }
+ }
+ }
}
@@ -4086,15 +4106,6 @@
default:
return NULL;
}
-
- if (slice_bits) {
- if (slice_bits & PF_VT_START_SLICE)
- PObj_get_FLAGS(tail) |= KEY_start_slice_FLAG;
- if (slice_bits & PF_VT_END_SLICE)
- PObj_get_FLAGS(tail) |= KEY_end_slice_FLAG;
- if (slice_bits & (PF_VT_START_ZERO | PF_VT_END_INF))
- PObj_get_FLAGS(tail) |= KEY_inf_slice_FLAG;
- }
}
self->type = PFC_KEY;
Modified: branches/pluggable_runcore/src/packout.c
==============================================================================
--- branches/pluggable_runcore/src/packout.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/packout.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -270,7 +270,6 @@
ASSERT_ARGS(PackFile_Constant_pack)
PMC *key;
size_t i;
- opcode_t slice_bits;
STRING *image;
*cursor++ = self->type;
@@ -301,48 +300,37 @@
/* and now type / value per component */
for (key = self->u.key; key;) {
const opcode_t type = PObj_get_FLAGS(key);
- slice_bits = 0;
- if ((type & (KEY_start_slice_FLAG|KEY_inf_slice_FLAG)) ==
- (KEY_start_slice_FLAG|KEY_inf_slice_FLAG))
- slice_bits |= PF_VT_END_INF;
- if ((type & (KEY_end_slice_FLAG|KEY_inf_slice_FLAG)) ==
- (KEY_end_slice_FLAG|KEY_inf_slice_FLAG))
- slice_bits |= PF_VT_START_ZERO;
- if (type & KEY_start_slice_FLAG)
- slice_bits |= PF_VT_START_SLICE;
- if (type & KEY_end_slice_FLAG)
- slice_bits |= PF_VT_END_SLICE;
switch (type & KEY_type_FLAGS) {
case KEY_integer_FLAG:
- *cursor++ = PARROT_ARG_IC | slice_bits;
+ *cursor++ = PARROT_ARG_IC;
GETATTR_Key_int_key(interp, key, *cursor++);
break;
case KEY_number_FLAG:
- *cursor++ = PARROT_ARG_NC | slice_bits;
+ *cursor++ = PARROT_ARG_NC;
/* Argh */
*cursor++ = PackFile_find_in_const(interp, const_table, key, PFC_NUMBER);
break;
case KEY_string_FLAG:
- *cursor++ = PARROT_ARG_SC | slice_bits;
+ *cursor++ = PARROT_ARG_SC;
/* Argh */
*cursor++ = PackFile_find_in_const(interp, const_table, key, PFC_STRING);
break;
case KEY_integer_FLAG | KEY_register_FLAG:
- *cursor++ = PARROT_ARG_I | slice_bits;
+ *cursor++ = PARROT_ARG_I;
GETATTR_Key_int_key(interp, key, *cursor++);
break;
case KEY_number_FLAG | KEY_register_FLAG:
- *cursor++ = PARROT_ARG_N | slice_bits;
+ *cursor++ = PARROT_ARG_N;
GETATTR_Key_int_key(interp, key, *cursor++);
break;
case KEY_string_FLAG | KEY_register_FLAG:
- *cursor++ = PARROT_ARG_S | slice_bits;
+ *cursor++ = PARROT_ARG_S;
GETATTR_Key_int_key(interp, key, *cursor++);
break;
case KEY_pmc_FLAG | KEY_register_FLAG:
- *cursor++ = PARROT_ARG_P | slice_bits;
+ *cursor++ = PARROT_ARG_P;
GETATTR_Key_int_key(interp, key, *cursor++);
break;
default:
Modified: branches/pluggable_runcore/src/parrot_debugger.c
==============================================================================
--- branches/pluggable_runcore/src/parrot_debugger.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/parrot_debugger.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -12,6 +12,7 @@
=head1 SYNOPSIS
parrot_debugger programfile
+ parrot_debugger --script scriptfile programfile
=head1 DESCRIPTION
@@ -39,7 +40,13 @@
=item C<break> or C<b>
-Add a breakpoint.
+Add a breakpoint at the line number given or the current line if none is given.
+
+ (pdb) b
+ Breakpoint 1 at pos 0
+
+ (pdb) b 10
+ Breakpoint 1 at pos 10
=item C<watch> or C<w>
@@ -47,7 +54,10 @@
=item C<delete> or C<d>
-Delete a breakpoint.
+Given a number n, deletes the n-th breakpoint. To delete the first breakpoint:
+
+ (pdb) d 1
+ Breakpoint 1 deleted
=item C<disable>
@@ -71,11 +81,26 @@
=item C<trace> or C<t>
-Trace the next instruction.
+Trace the next instruction. This is equivalent to printing the source of the
+next instruction and then executing it.
=item C<print> or C<p>
-Print the interpreter registers.
+Print an interpreter register. If a register I0 has been used, this
+would look like:
+
+ (pdb) p I0
+ 2
+
+If no register number is given then all registers of that type will be printed.
+If the two registers I0 and I1 have been used, then this would look like:
+
+ (pdb) p I
+ I0 = 2
+ I1 = 5
+
+It would be nice if "p" with no arguments printed all registers, but this is
+currently not the case.
=item C<stack> or C<s>
@@ -83,7 +108,13 @@
=item C<info>
-Print interpreter information.
+Print interpreter information relating to memory allocation and garbage
+collection.
+
+=item C<gcdebug>
+
+Toggle garbage collection debugging mode. In gcdebug mode a garbage collection
+cycle is run before each opcocde, which is the same as using the gcdebug core.
=item C<quit> or C<q>
@@ -122,7 +153,7 @@
=item C<int main(int argc, char *argv[])>
-Reads the PASM or PBC file from argv[1], loads it, and then calls
+Reads the PIR, PASM or PBC file from argv[1], loads it, and then calls
Parrot_debug().
=cut
Deleted: branches/pluggable_runcore/src/pbc_info.c
==============================================================================
--- branches/pluggable_runcore/src/pbc_info.c Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,113 +0,0 @@
-/*
-Copyright (C) 2001-2003, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-pbc_info - PackFile demo
-
-=head1 SYNOPSIS
-
- pbc_info file.pbc
-
-=head1 DESCRIPTION
-
-Sample program for dumping PackFile segment names by iterating
-over the main directory.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/embed.h"
-
-/*
-
-=item C<static INTVAL iter(PARROT_INTERP, PackFile_Segment *seg, void
- *user_data)>
-
-This function is passed the callback to PackFile_map_segments() to print out
-the name of each segment in the directory.
-
-=cut
-
-*/
-
-static INTVAL
-iter(PARROT_INTERP, PackFile_Segment *seg, void *user_data)
-{
- long ident = (long)user_data;
- int length = ident;
- printf("%*.0s%s\n", length, "", seg->name);
- if (seg->type == PF_DIR_SEG)
- PackFile_map_segments(interp, (PackFile_Directory*)seg,
- iter, (void*)(ident+2));
- return 0;
-}
-
-/*
-
-=item C<int main(int argc, char *argv[])>
-
-Reads the PBC from argv[1], adds a few extra sections, and then iterates over
-the directory using PackFile_map_segments() and iter().
-
-=cut
-
-*/
-
-int
-main(SHIM(int argc), char *argv[])
-{
- PackFile *pf;
- Interp *interp;
- PackFile_Segment *seg;
-
- interp = Parrot_new(NULL);
-
- pf = Parrot_pbc_read(interp, argv[1], PFOPT_UTILS);
-
- /*
- * add some more segments
- */
- seg = PackFile_Segment_new_seg(interp,
- &pf->directory, PF_DIR_SEG, "dir2", 1);
- seg = PackFile_Segment_new_seg(interp,
- (PackFile_Directory*)seg, PF_BYTEC_SEG, "code", 1);
- seg = PackFile_Segment_new_seg(interp,
- &pf->directory, PF_DIR_SEG, "dir3", 1);
-
- /*
- * show these
- */
- printf("%s\n", pf->directory.base.name);
- PackFile_map_segments(interp, &pf->directory, iter, (void*)2);
-
- Parrot_exit(interp, 0);
-}
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<src/packfile.c>, F<include/parrot/packfile.h>.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- * c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
-
Modified: branches/pluggable_runcore/src/pmc.c
==============================================================================
--- branches/pluggable_runcore/src/pmc.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -50,6 +50,14 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(* pmc);
+PARROT_CANNOT_RETURN_NULL
+static PMC* pmc_reuse_no_init(PARROT_INTERP,
+ ARGIN(PMC *pmc),
+ INTVAL new_type,
+ SHIM(UINTVAL flags))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
#define ASSERT_ARGS_check_pmc_reuse_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_create_class_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -59,6 +67,9 @@
#define ASSERT_ARGS_pmc_reuse_check_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pmc)
+#define ASSERT_ARGS_pmc_reuse_no_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(pmc)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
@@ -145,9 +156,68 @@
PARROT_IGNORABLE_RESULT
PMC *
pmc_reuse(PARROT_INTERP, ARGIN(PMC *pmc), INTVAL new_type,
- SHIM(UINTVAL flags))
+ UINTVAL flags)
{
ASSERT_ARGS(pmc_reuse)
+ pmc = pmc_reuse_no_init(interp, pmc, new_type, flags);
+
+ /* Call the base init for the redone pmc. Warning, this should not
+ be called on Object PMCs. */
+ VTABLE_init(interp, pmc);
+
+ return pmc;
+}
+
+/*
+
+=item C<PMC * pmc_reuse_init(PARROT_INTERP, PMC *pmc, INTVAL new_type, PMC
+*init, UINTVAL flags)>
+
+Reuse an existing PMC, turning it into an PMC of the new type. Any
+required internal structure will be put in place (such as the extension area)
+and the PMC will be inited.
+
+Cannot currently handle converting a non-Object PMC into an Object. Use
+C<pmc_reuse_by_class> for that.
+
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+PARROT_IGNORABLE_RESULT
+PMC *
+pmc_reuse_init(PARROT_INTERP, ARGIN(PMC *pmc), INTVAL new_type, ARGIN(PMC *init),
+ UINTVAL flags)
+{
+ ASSERT_ARGS(pmc_reuse_init)
+ pmc = pmc_reuse_no_init(interp, pmc, new_type, flags);
+
+ /* Call the base init for the redone pmc. Warning, this should not
+ be called on Object PMCs. */
+ VTABLE_init_pmc(interp, pmc, init);
+
+ return pmc;
+}
+
+/*
+
+=item C<static PMC* pmc_reuse_no_init(PARROT_INTERP, PMC *pmc, INTVAL new_type,
+UINTVAL flags)>
+
+Prepare pmc for reuse. Do all scuffolding except initing.
+
+=cut
+
+*/
+PARROT_CANNOT_RETURN_NULL
+static PMC*
+pmc_reuse_no_init(PARROT_INTERP, ARGIN(PMC *pmc), INTVAL new_type,
+ SHIM(UINTVAL flags)) {
+
+ ASSERT_ARGS(pmc_reuse_no_init)
VTABLE *new_vtable;
INTVAL has_ext, new_flags = 0;
@@ -171,10 +241,6 @@
/* Set the right vtable */
pmc->vtable = new_vtable;
- /* Call the base init for the redone pmc. Warning, this should not
- be called on Object PMCs. */
- VTABLE_init(interp, pmc);
-
return pmc;
}
Modified: branches/pluggable_runcore/src/pmc/addrregistry.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/addrregistry.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/addrregistry.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -144,24 +144,6 @@
}
}
-/*
-
-=item C<PMC *get_pmc_keyed(PMC *key)>
-
-If called from iteration, return the key PMC, else PMCNULL is returned.
-
-=cut
-
-*/
-
- VTABLE PMC *get_pmc_keyed(PMC *key) {
- Hash * const hash = (Hash *)SELF.get_pointer();
-
- if (KEY_IS_HASH_ITERATOR(key))
- return (PMC *)parrot_hash_get_idx(INTERP, hash, key);
-
- return PMCNULL;
- }
}
/*
Modified: branches/pluggable_runcore/src/pmc/array.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/array.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/array.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -1184,19 +1184,7 @@
}
VTABLE PMC *get_iter() {
- STRING * const name = CONST_STRING(interp, "set_key");
- PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
- PMC * const key = pmc_new(INTERP, enum_class_Key);
- Parrot_PCCINVOKE(interp, iter, name, "P->", key);
-
- PObj_get_FLAGS(key) |= KEY_integer_FLAG;
-
- if (!((List *)PMC_data(SELF))->length)
- VTABLE_set_integer_native(INTERP, key, -1);
- else
- VTABLE_set_integer_native(INTERP, key, 0);
-
- return iter;
+ return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF);
}
/*
Copied: branches/pluggable_runcore/src/pmc/arrayiterator.pmc (from r40540, trunk/src/pmc/arrayiterator.pmc)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/src/pmc/arrayiterator.pmc Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/src/pmc/arrayiterator.pmc)
@@ -0,0 +1,591 @@
+/*
+Copyright (C) 2001-2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/pmc/arrayiterator.pmc - Implementation of Iterator for Arrays.
+
+=head1 DESCRIPTION
+
+Generic iterator for traversing arrays.
+
+=head1 SYNOPSIS
+
+=head2 default usage
+
+ .local pmc iterator, array, entry
+ iterator = iter array
+ iter_loop:
+ unless iterator, iter_end # while (more values)
+ entry = shift iterator # get an entry
+ ...
+ goto iter_loop
+ iter_end:
+
+
+=head2 iterate from the end, for arrays
+
+ .local pmc iterator, array, entry
+ iterator = iter array
+ iterator = .ITERATE_FROM_END
+ iter_loop:
+ unless iterator, iter_end # while (more values)
+ entry = pop iterator # get an entry
+ ...
+ goto iter_loop
+ iter_end:
+
+=head2 Warning!
+
+NB: for different direction you have to use different ops!
+
+TODO: Discuss idea of having separate get_iter/get_reverse_iter VTABLE methods
+to avoid this caveat.
+
+=head1 Methods
+
+=over 4
+
+=cut
+
+*/
+
+pmclass ArrayIterator extends Iterator no_ro {
+ ATTR PMC *array; /* the array which this Iterator iterates */
+ ATTR INTVAL pos; /* Current position of iterator for forward iterator */
+ /* Previous position of iterator for reverse iterator */
+ ATTR INTVAL length; /* Length of C<array> */
+ ATTR INTVAL reverse; /* Direction of iteration. 1 - for reverse iteration */
+
+/*
+
+=item C<void init()>
+
+Raises an exception. Use C<init_pmc()>.
+
+=cut
+
+*/
+
+ VTABLE void init() {
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ "ArrayIterator init without aggregate");
+ }
+
+/*
+
+=item C<void init_pmc(PMC *initializer)>
+
+Initializes the iterator with an aggregate PMC.
+Defaults iteration mode to iterate from start.
+
+=cut
+
+*/
+
+ VTABLE void init_pmc(PMC *array) {
+ Parrot_ArrayIterator_attributes * const attrs =
+ mem_allocate_zeroed_typed(Parrot_ArrayIterator_attributes);
+
+ attrs->array = array;
+ PMC_data(SELF) = attrs;
+
+ PObj_custom_mark_destroy_SETALL(SELF);
+
+ /* by default, iterate from start */
+ SELF.set_integer_native(ITERATE_FROM_START);
+ }
+
+/*
+
+=item C<void destroy()>
+
+destroys this PMC
+
+=cut
+
+*/
+
+ VTABLE void destroy() {
+ mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
+ }
+
+/*
+
+=item C<void mark()>
+
+Marks the current idx/key and the aggregate as live.
+
+=cut
+
+*/
+
+ VTABLE void mark() {
+ PMC *array;
+ GET_ATTR_array(INTERP, SELF, array);
+ if (array)
+ Parrot_gc_mark_PObj_alive(INTERP, (PObj *)array);
+ }
+
+/*
+
+=item C<PMC *clone()>
+
+=cut
+
+*/
+ VTABLE PMC* clone() {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+ PMC * const clone =
+ pmc_new_init(INTERP, enum_class_ArrayIterator, attrs->array);
+ Parrot_ArrayIterator_attributes * const clone_attrs =
+ PARROT_ARRAYITERATOR(clone);
+
+ clone_attrs->pos = attrs->pos;
+ clone_attrs->reverse = attrs->reverse;
+ return clone;
+ }
+
+/*
+
+=item C<INTVAL get_bool()>
+
+Returns true if there is more elements to iterate over.
+
+=cut
+
+*/
+
+ VTABLE INTVAL get_bool() {
+ return SELF.elements() > 0;
+ }
+
+/*
+
+=item C<INTVAL elements()>
+
+Returns the number of remaining elements in the array.
+
+=cut
+
+*/
+
+ VTABLE INTVAL elements() {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+ if (attrs->reverse)
+ return attrs->pos;
+ else
+ return attrs->length - attrs->pos;
+ }
+
+ VTABLE INTVAL get_integer() {
+ return SELF.elements();
+ }
+
+/*
+
+=item C<void set_integer_native(INTVAL value)>
+
+Reset the Iterator. C<value> must be one of
+
+ ITERATE_FROM_START ... Iterate from start
+ ITERATE_FROM_END ... Iterate from end
+
+=cut
+
+*/
+
+ VTABLE void set_integer_native(INTVAL value) {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+ if (value == ITERATE_FROM_START) {
+ attrs->reverse = 0;
+ attrs->pos = 0;
+ attrs->length = VTABLE_elements(INTERP, attrs->array);
+ }
+ else if (value == ITERATE_FROM_END) {
+ attrs->reverse = 1;
+ attrs->pos = attrs->length
+ = VTABLE_elements(INTERP, attrs->array);
+ }
+ else
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ "Wrong direction for ArrayIterator");
+ }
+
+/*
+
+=item C<PMC *get_pmc()>
+
+Returns this Iterator's array.
+
+=cut
+
+*/
+
+ VTABLE PMC *get_pmc() {
+ PMC *array;
+ GET_ATTR_array(INTERP, SELF, array);
+ return array ? array : PMCNULL;
+ }
+
+/*
+
+=item C<INTVAL shift_integer()>
+
+Returns the element for the current idx and sets the idx to
+the next one.
+
+=cut
+
+*/
+
+ VTABLE INTVAL shift_integer() {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+
+ if (attrs->pos >= attrs->length)
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_integer_keyed_int(INTERP, attrs->array, attrs->pos++);
+ }
+
+/*
+
+=item C<FLOATVAL shift_float()>
+
+=cut
+
+*/
+
+ VTABLE FLOATVAL shift_float() {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+
+ if (!STATICSELF.get_bool())
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_number_keyed_int(INTERP, attrs->array, attrs->pos++);
+ }
+
+
+/*
+
+=item C<STRING *shift_string()>
+
+=cut
+
+*/
+
+ VTABLE STRING *shift_string() {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+
+ if (!STATICSELF.get_bool())
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_string_keyed_int(INTERP, attrs->array, attrs->pos++);
+ }
+
+/*
+
+=item C<PMC *shift_pmc()>
+
+Returns the element for the current idx/key and sets the idx/key to
+the next one.
+
+=cut
+
+*/
+
+ VTABLE PMC *shift_pmc() {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+
+ if (!STATICSELF.get_bool())
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_pmc_keyed_int(INTERP, attrs->array, attrs->pos++);
+ }
+
+
+/*
+
+=item C<INTVAL pop_integer()>
+
+Returns the element for the current idx and sets the idx to
+the next one.
+
+=cut
+
+*/
+
+ VTABLE INTVAL pop_integer() {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+
+ if (!STATICSELF.get_bool())
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_integer_keyed_int(INTERP, attrs->array, --attrs->pos);
+ }
+
+/*
+
+=item C<FLOATVAL pop_float()>
+
+=cut
+
+*/
+
+ VTABLE FLOATVAL pop_float() {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+
+ if (!STATICSELF.get_bool())
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_number_keyed_int(INTERP, attrs->array, --attrs->pos);
+ }
+
+
+/*
+
+=item C<STRING *pop_string()>
+
+=cut
+
+*/
+
+ VTABLE STRING *pop_string() {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+
+ if (!STATICSELF.get_bool())
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_string_keyed_int(INTERP, attrs->array, --attrs->pos);
+ }
+
+/*
+
+=item C<PMC *pop_pmc()>
+
+Returns the element for the current idx/key and sets the idx/key to
+the next one.
+
+=cut
+
+*/
+
+ VTABLE PMC *pop_pmc() {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+
+ if (!STATICSELF.get_bool())
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_pmc_keyed_int(INTERP, attrs->array, --attrs->pos);
+ }
+
+/*
+=item C<PMC *get_pmc_keyed(PMC *key)>
+
+Returns the element for C<*key>.
+
+=cut
+
+*/
+
+ VTABLE PMC *get_pmc_keyed(PMC *key) {
+ return STATICSELF.get_pmc_keyed_int(VTABLE_get_integer(INTERP, key));
+ }
+
+/*
+
+=item C<PMC *get_pmc_keyed_int(INTVAL key)>
+
+Returns the element for C<key>.
+
+=cut
+
+*/
+
+ VTABLE PMC *get_pmc_keyed_int(INTVAL idx) {
+ return VTABLE_get_pmc_keyed_int(INTERP, STATICSELF.get_pmc(),
+ PARROT_ARRAYITERATOR(SELF)->pos + idx);
+ }
+/*
+
+=item C<INTVAL get_integer_keyed(PMC *key)>
+
+=cut
+
+*/
+
+ VTABLE INTVAL get_integer_keyed(PMC *key) {
+ return STATICSELF.get_integer_keyed_int(VTABLE_get_integer(INTERP, key));
+ }
+
+/*
+
+=item C<INTVAL get_integer_keyed_int(INTVAL idx)>
+
+Get integer value of current position plus idx.
+
+=cut
+
+*/
+
+ VTABLE INTVAL get_integer_keyed_int(INTVAL idx) {
+ return VTABLE_get_integer_keyed_int(INTERP, STATICSELF.get_pmc(),
+ PARROT_ARRAYITERATOR(SELF)->pos + idx);
+ }
+
+/*
+
+=item C<FLOATVAL get_number_keyed(PMC *key)>
+
+=cut
+
+*/
+
+ VTABLE FLOATVAL get_number_keyed(PMC *key) {
+ return STATICSELF.get_number_keyed_int(VTABLE_get_integer(INTERP, key));
+ }
+
+/*
+
+=item C<FLOATVAL get_number_keyed_int(INTVAL idx)>
+
+Get number value of current position plus idx.
+
+=cut
+
+*/
+
+ VTABLE FLOATVAL get_number_keyed_int(INTVAL idx) {
+ return VTABLE_get_number_keyed_int(INTERP, STATICSELF.get_pmc(),
+ PARROT_ARRAYITERATOR(SELF)->pos + idx);
+ }
+
+
+
+/*
+
+=item C<STRING *get_string_keyed(PMC *key)>
+
+=cut
+
+*/
+
+ VTABLE STRING *get_string_keyed(PMC *key) {
+ return STATICSELF.get_string_keyed_int(VTABLE_get_integer(INTERP, key));
+ }
+
+/*
+
+=item C<STRING *get_string_keyed_int(INTVAL idx)>
+
+Get string value of current position plus idx.
+
+=cut
+
+*/
+
+ VTABLE STRING *get_string_keyed_int(INTVAL idx) {
+ return VTABLE_get_string_keyed_int(INTERP, STATICSELF.get_pmc(),
+ PARROT_ARRAYITERATOR(SELF)->pos + idx);
+ }
+
+/*
+
+=item C<INTVAL exists_keyed(PMC *key)>
+
+Returns whether an element for C<*key> exists in the array.
+
+=cut
+
+*/
+
+ VTABLE INTVAL exists_keyed(PMC *key) {
+ return STATICSELF.exists_keyed_int(VTABLE_get_integer(INTERP, key));
+ }
+
+/*
+
+=item C<INTVAL exists_keyed_int(INTVAL idx)>
+
+Returns whether an element for C<idx> exists in the aggregate.
+
+=cut
+
+*/
+
+ VTABLE INTVAL exists_keyed_int(INTVAL idx) {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+ /* Cheat! */
+ const INTVAL final_pos = attrs->pos + idx - attrs->reverse;
+
+ return VTABLE_exists_keyed_int(INTERP, attrs->array, final_pos);
+ }
+
+/*
+
+=item C<INTVAL defined_keyed(PMC *key)>
+
+=cut
+
+*/
+
+ VTABLE INTVAL defined_keyed(PMC *key) {
+ return STATICSELF.defined_keyed_int(VTABLE_get_integer(INTERP, key));
+ }
+
+/*
+
+=item C<INTVAL defined_keyed_int(INTVAL key)>
+
+Returns the result of calling C<defined_keyed(key)> on the aggregate.
+
+=cut
+
+*/
+
+ VTABLE INTVAL defined_keyed_int(INTVAL idx) {
+ Parrot_ArrayIterator_attributes * const attrs =
+ PARROT_ARRAYITERATOR(SELF);
+ /* Cheat! */
+ const INTVAL final_pos = attrs->pos + idx - attrs->reverse;
+
+ return VTABLE_defined_keyed_int(INTERP, attrs->array, final_pos);
+ }
+}
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Modified: branches/pluggable_runcore/src/pmc/bigint.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/bigint.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/bigint.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -645,6 +645,7 @@
attrs = (Parrot_BigInt_attributes*)PMC_data(SELF);
mem_sys_free(attrs->bi);
mem_sys_free(attrs);
+ PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/pmc/bignum.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/bignum.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/bignum.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -861,6 +861,7 @@
mem_sys_free(attrs->bn);
#endif
mem_sys_free(attrs);
+ PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/pmc/class.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/class.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/class.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -46,8 +46,8 @@
=item C<all_parents>
-A cached array of ourself and all parent classes, in MRO order.
-A ResizablePMCArray PMC is allocated during initialization,
+A cached array of ourself and all parent classes, in method resolution
+order (MRO). A ResizablePMCArray PMC is allocated during initialization,
and is populated with the current class.
=item C<roles>
@@ -137,7 +137,7 @@
STRING * const attrib_name = VTABLE_get_string_keyed_str(
interp, cur_attrib, name_str);
- STRING *full_key = Parrot_str_append(interp, fq_class, attrib_name);
+ STRING * const full_key = Parrot_str_append(interp, fq_class, attrib_name);
/* Insert into hash, along with index. */
VTABLE_set_integer_keyed_str(interp, attrib_index, full_key, cur_index);
@@ -164,7 +164,6 @@
STRING * const attrs_str = CONST_STRING(interp, "attributes");
PMC *old_ns;
STRING *resolve_method_str;
- INTVAL type_num;
/* Ensure we actually have some initialization info. */
if (PMC_IS_NULL(info))
@@ -179,6 +178,7 @@
PMC *new_namespace;
PMC *name_arg = VTABLE_get_pmc_keyed_str(interp, info, name_str);
VTABLE *new_vtable;
+ INTVAL type_num;
/* If we were passed a namespace PMC, set the namespace attribute
* directly. Otherwise, lookup or create the appropriate namespace. */
@@ -335,7 +335,7 @@
if (!PMC_IS_NULL(meth)) {
/* build an empty signature; it has an invocant but no args/retvals */
- PMC *sig_obj = pmc_new(interp, enum_class_CallSignature);
+ PMC * const sig_obj = pmc_new(interp, enum_class_CallSignature);
VTABLE_set_string_native(interp, sig_obj, CONST_STRING(interp, "Pi->"));
/* add the invocant */
VTABLE_unshift_pmc(interp, sig_obj, object);
@@ -348,7 +348,7 @@
static void
initialize_parents_pmc(PARROT_INTERP, PMC *object, PMC *all_parents, PMC *init)
{
- INTVAL parent_index = VTABLE_elements(interp, all_parents) - 1;
+ INTVAL parent_index = VTABLE_elements(interp, all_parents) - 1;
STRING * const name = CONST_STRING(interp, "init_pmc");
/* Loop through the parents in reverse MRO order. */
@@ -403,8 +403,11 @@
return _class->name;
}
-/* calculates the C3 method resolution order for this class --
- * working hard *not* to recalculate MRO when unnecessary */
+/* calculates the C3 method resolution order for this class. C3 is the
+ * name of an algorithm used to calculate the method resolution order
+ * (MRO) to use in a system with multiple inheritance. For more information
+ * see the documentation associated with C<Parrot_ComputeMRO_C3>.
+ */
static PMC *
calculate_mro(PARROT_INTERP, PMC *SELF, INTVAL num_parents)
{
@@ -415,13 +418,13 @@
return _class->all_parents;
if (num_parents == 1) {
- STRING *ap = CONST_STRING(interp, "all_parents");
- PMC *parent = VTABLE_get_pmc_keyed_int(interp,
- _class->parents, 0);
- PMC *parent_mro = VTABLE_inspect_str(interp, parent, ap);
- PMC *mro = VTABLE_clone(interp, parent_mro);
- VTABLE_unshift_pmc(interp, mro, SELF);
- return mro;
+ STRING * const ap = CONST_STRING(interp, "all_parents");
+ PMC * const parent = VTABLE_get_pmc_keyed_int(interp,
+ _class->parents, 0);
+ PMC * const parent_mro = VTABLE_inspect_str(interp, parent, ap);
+ PMC * const mro = VTABLE_clone(interp, parent_mro);
+ VTABLE_unshift_pmc(interp, mro, SELF);
+ return mro;
}
return Parrot_ComputeMRO_C3(interp, SELF);
@@ -496,7 +499,7 @@
_class->resolve_method = pmc_new(interp, enum_class_ResizablePMCArray);
_class->vtable_overrides = pmc_new(interp, enum_class_Hash);
- _class->parent_overrides = constant_pmc_new(interp, enum_class_Hash);
+ _class->parent_overrides = pmc_new(interp, enum_class_Hash);
/* We put ourself on the all parents list. */
VTABLE_push_pmc(interp, _class->all_parents, SELF);
@@ -566,6 +569,7 @@
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
@@ -725,7 +729,7 @@
/*
-=item C<void remove_method(STRING *name, PMC *sub)>
+=item C<void remove_method(STRING *name)>
Removes the method with the given name.
@@ -927,7 +931,7 @@
*/
VTABLE void add_role(PMC *role) {
- Parrot_Class_attributes * const _class = PARROT_CLASS(SELF);
+ const Parrot_Class_attributes * const _class = PARROT_CLASS(SELF);
/* Do the composition. */
Parrot_ComposeRole(interp, role,
@@ -1033,8 +1037,8 @@
PMC * const hash = pmc_new(interp, enum_class_Hash);
PMC * const iter = VTABLE_get_iter(interp, found);
while (VTABLE_get_bool(interp, iter)) {
- STRING *key = VTABLE_shift_string(interp, iter);
- PMC *value = VTABLE_get_pmc_keyed_str(interp, found, key);
+ STRING * const key = VTABLE_shift_string(interp, iter);
+ PMC * const value = VTABLE_get_pmc_keyed_str(interp, found, key);
VTABLE_set_pmc_keyed_str(interp, hash, key, value);
}
@@ -1293,17 +1297,16 @@
if (VTABLE_is_same(interp, SELF, classobj))
return 1;
else {
- STRING *classname = VTABLE_get_string(interp, classobj);
- INTVAL is_proxy = SELF->vtable->base_type == enum_class_PMCProxy
- ? 1 : 0;
+ STRING * const classname = VTABLE_get_string(interp, classobj);
+ const INTVAL is_proxy = (SELF->vtable->base_type == enum_class_PMCProxy);
/* avoid the expensive string copy, if possible */
- STRING *self_name = is_proxy
+ STRING * const self_name = is_proxy
? VTABLE_get_string(interp, SELF)
: make_class_name(interp, SELF);
/* Check if the passed name is the same as the stored short name. */
- INTVAL name_match = Parrot_str_equal(interp, classname, self_name);
+ const INTVAL name_match = Parrot_str_equal(interp, classname, self_name);
if (name_match)
return 1;
@@ -1413,12 +1416,8 @@
role_count = VTABLE_elements(interp, role_list);
for (i = 0; i < role_count; i++) {
- INTVAL role_does;
PMC * const test_role = VTABLE_get_pmc_keyed_int(interp, role_list, i);
-
- role_does = VTABLE_does_pmc(interp, test_role, role);
-
- if (role_does)
+ if (VTABLE_does_pmc(interp, test_role, role))
return 1;
}
@@ -1512,7 +1511,7 @@
VTABLE void freeze(visit_info *info) {
IMAGE_IO * const io = info->image_io;
Parrot_Class_attributes * const class_data = PARROT_CLASS(SELF);
- STRING *serial_namespace = CONST_STRING(interp, "");
+ STRING *serial_namespace = CONST_STRING(interp, "");
/* 1) freeze class id */
VTABLE_push_integer(INTERP, io, class_data->id);
@@ -1977,7 +1976,7 @@
*/
METHOD does(STRING *role_name) {
- INTVAL does = VTABLE_does(interp, SELF, role_name);
+ const INTVAL does = VTABLE_does(interp, SELF, role_name);
RETURN(INTVAL does);
}
Modified: branches/pluggable_runcore/src/pmc/continuation.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/continuation.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/continuation.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -304,9 +304,13 @@
PMC *caller = cc->to_ctx->current_sub;
Parrot_sub *sub;
- PMC_get_sub(INTERP, caller, sub);
- if (!caller || !sub->seg)
+ if (!caller)
caller = PMCNULL;
+ else {
+ PMC_get_sub(INTERP, caller, sub);
+ if (!sub->seg)
+ caller = PMCNULL;
+ }
RETURN(PMC *caller);
Modified: branches/pluggable_runcore/src/pmc/coroutine.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/coroutine.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/coroutine.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -150,7 +150,6 @@
ctx = Parrot_set_new_context(INTERP, co->n_regs_used);
co->ctx = Parrot_context_ref(interp, ctx);
- co->dynamic_state = interp->dynamic_env;
ctx->caller_ctx = caller_ctx;
PMC_cont(ccont)->from_ctx = ctx;
@@ -179,7 +178,6 @@
/* if calling the Coro we need the segment of the Coro */
else if (!(PObj_get_FLAGS(SELF) & SUB_FLAG_CORO_FF)) {
PMC *ccont;
- Stack_Chunk_t *state;
Parrot_Context *ctx;
PObj_get_FLAGS(SELF) |= SUB_FLAG_CORO_FF;
@@ -195,16 +193,12 @@
= CONTEXT(interp);
/* set context to coro context */
- state = interp->dynamic_env;
- interp->dynamic_env = co->dynamic_state;
- co->dynamic_state = state;
CONTEXT(interp) = ctx;
INTERP->ctx.bp = ctx->bp;
INTERP->ctx.bp_ps = ctx->bp_ps;
}
else {
PMC *ccont;
- Stack_Chunk_t *state;
Parrot_Context *ctx;
PObj_get_FLAGS(SELF) &= ~SUB_FLAG_CORO_FF;
@@ -224,9 +218,6 @@
"Cannot resume dead coroutine.");
}
- state = interp->dynamic_env;
- interp->dynamic_env = co->dynamic_state;
- co->dynamic_state = state;
CONTEXT(interp) = ctx;
INTERP->ctx.bp = ctx->bp;
INTERP->ctx.bp_ps = ctx->bp_ps;
@@ -258,9 +249,6 @@
/* co->ctx marked in SUPER(), so do not mark here */
if (co) {
- if (co->dynamic_state)
- mark_stack(INTERP, co->dynamic_state);
-
SUPER();
}
}
Modified: branches/pluggable_runcore/src/pmc/default.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/default.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/default.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -48,7 +48,7 @@
/*
=item C<static void cant_do_method(PARROT_INTERP, PMC *pmc,
- const char *methname)>
+ int index)>
Throws an exception "$methname() not implemented in class '$class'", used by
all unimplemented messages.
@@ -59,10 +59,11 @@
PARROT_DOES_NOT_RETURN
static void
-cant_do_method(PARROT_INTERP, PMC *pmc /*NULLOK*/, const char *methname)
+cant_do_method(PARROT_INTERP, PMC *pmc /*NULLOK*/, int index)
{
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ILL_INHERIT,
- "%s() not implemented in class '%Ss'", methname,
+ "%s() not implemented in class '%Ss'",
+ Parrot_get_vtable_name(interp, index),
caller(interp, pmc));
}
@@ -70,7 +71,7 @@
/*
=item C<static void cant_do_write_method(PARROT_INTERP, PMC *pmc,
- const char *methname)>
+ int index)>
Throws an exception "$methname() on read-only instance of '$class'", used by
all updating messages on read-only instances.
@@ -81,10 +82,11 @@
PARROT_DOES_NOT_RETURN
static void
-cant_do_write_method(PARROT_INTERP, PMC *pmc /*NULLOK*/, const char *methname)
+cant_do_write_method(PARROT_INTERP, PMC *pmc /*NULLOK*/, int index)
{
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_WRITE_TO_CONSTCLASS,
- "%s() in read-only instance of '%Ss'", methname,
+ "%s() in read-only instance of '%Ss'",
+ Parrot_get_vtable_name(interp, index),
caller(interp, pmc));
}
@@ -829,22 +831,6 @@
/*
-=item C<PMC *nextkey_keyed_int(INTVAL key, INTVAL w)>
-
-Converts C<key> to a PMC key and returns the result of calling
-C<nextkey_keyed()> with it.
-
-=cut
-
-*/
-
- VTABLE PMC *nextkey_keyed_int(INTVAL key, INTVAL w) {
- PMC *const r_key = INT2KEY(INTERP, key);
- return SELF.nextkey_keyed(r_key, w);
- }
-
-/*
-
=item C<INTVAL can(STRING *method)>
Reports whether the PMC "can" perform C<method>.
Modified: branches/pluggable_runcore/src/pmc/env.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/env.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/env.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -10,6 +10,9 @@
C<Env> is a singleton class which provides access to the system environment.
+XXX Think about returning Pair back. Currently there is no way to iterate over
+environment I<keys>.
+
=head2 Methods
=over 4
@@ -71,19 +74,7 @@
*/
VTABLE PMC *get_iter() {
- STRING *name = CONST_STRING(interp, "set_key");
- PMC *iter = pmc_new_init(interp, enum_class_Iterator, SELF);
- PMC *key = pmc_new(interp, enum_class_Key);
-
- Parrot_PCCINVOKE(interp, iter, name, "P->", key);
- PObj_get_FLAGS(key) |= KEY_integer_FLAG;
-
- if (!environ[0])
- VTABLE_set_integer_native(INTERP, key, -1);
- else
- VTABLE_set_integer_native(INTERP, key, 0);
-
- return iter;
+ return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF);
}
/*
@@ -143,40 +134,53 @@
*/
- VTABLE STRING *get_string_keyed(PMC *key) {
- if ((PObj_get_FLAGS(key) & KEY_type_FLAGS) == KEY_integer_FLAG) {
- INTVAL const keynum = VTABLE_get_integer(INTERP, key);
- if (keynum < 0 || keynum >= SELF.elements()) {
- return string_from_literal(interp, "");
- }
- else {
- const char * const envp = environ[keynum];
- const char * const p = strchr(envp, '=');
- return Parrot_str_new(interp, envp, (UINTVAL)(p - envp));
+ VTABLE STRING *get_string_keyed_str(STRING *key) {
+ char * const keyname = Parrot_str_to_cstring(interp, key);
+
+ if (keyname) {
+ int free_it = 0;
+ char * const val = Parrot_getenv(keyname, &free_it);
+ Parrot_str_free_cstring(keyname);
+
+ if (val) {
+ STRING * const retval = Parrot_str_new(interp, val, 0);
+
+ if (free_it)
+ mem_sys_free(val);
+
+ return retval;
+
}
}
- else {
- char * const keyname = Parrot_str_to_cstring(interp,
- VTABLE_get_string(interp, key));
- if (keyname) {
- int free_it = 0;
- char * const val = Parrot_getenv(keyname, &free_it);
- Parrot_str_free_cstring(keyname);
+ return string_from_literal(interp, "");
+ }
- if (val) {
- STRING * const retval = Parrot_str_new(interp, val, 0);
+ VTABLE STRING *get_string_keyed(PMC *key) {
+ return SELF.get_string_keyed_str(VTABLE_get_string(INTERP, key));
+ }
- if (free_it)
- mem_sys_free(val);
+/*
- return retval;
+=item C<STRING *get_string_keyed_int(PMC *key)>
- }
- }
+Returns the Parrot string value for the environment variable at position C<pos>.
+Used during iteration.
+
+=cut
+
+*/
+
+ VTABLE STRING *get_string_keyed_int(INTVAL pos) {
+ if (pos < 0 || pos >= SELF.elements()) {
return string_from_literal(interp, "");
}
+ else {
+ const char * const envp = environ[pos];
+ const char * const p = strchr(envp, '=');
+ return Parrot_str_new(interp, envp, (UINTVAL)(p - envp));
+ }
}
/*
Modified: branches/pluggable_runcore/src/pmc/exception.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/exception.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/exception.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -86,19 +86,20 @@
Parrot_Exception_attributes * const core_struct =
mem_allocate_zeroed_typed(Parrot_Exception_attributes);
+ /* Set up the core struct and default values for the exception object. */
+ PMC_data(SELF) = core_struct;
+
/* Set flags for custom GC mark and destroy. */
PObj_custom_mark_SET(SELF);
PObj_active_destroy_SET(SELF);
- /* Set up the core struct and default values for the exception object. */
- PMC_data(SELF) = core_struct;
- core_struct->severity = EXCEPT_error;
- core_struct->handled = 0;
- core_struct->message = CONST_STRING(interp, "");
- core_struct->payload = PMCNULL;
- core_struct->resume = PMCNULL;
- core_struct->backtrace = PMCNULL;
- core_struct->handler_iter = PMCNULL;
+ SET_ATTR_severity(INTERP, SELF, EXCEPT_error);
+ SET_ATTR_handled(INTERP, SELF, 0);
+ SET_ATTR_message(INTERP, SELF, NULL);
+ SET_ATTR_payload(INTERP, SELF, PMCNULL);
+ SET_ATTR_resume(INTERP, SELF, PMCNULL);
+ SET_ATTR_backtrace(INTERP, SELF, PMCNULL);
+ SET_ATTR_handler_iter(INTERP, SELF, PMCNULL);
}
/*
@@ -112,31 +113,40 @@
*/
VTABLE void init_pmc(PMC *values) {
- STRING * const severity = CONST_STRING(interp, "severity");
- STRING * const message = CONST_STRING(interp, "message");
+ INTVAL severity_val;
+ STRING *message_val;
Parrot_Exception_attributes * const core_struct =
mem_allocate_zeroed_typed(Parrot_Exception_attributes);
INTVAL ishash = VTABLE_isa(interp, values, CONST_STRING(interp, 'Hash'));
+ if (ishash) {
+ STRING * const severity = CONST_STRING(interp, "severity");
+ STRING * const message = CONST_STRING(interp, "message");
+ severity_val = VTABLE_get_integer_keyed_str(interp, values, severity);
+ message_val = VTABLE_get_string_keyed_str(interp, values, message);
+ }
+ else {
+ severity_val = EXCEPT_error;
+ message_val = VTABLE_get_string(interp, values);
+ }
+
+ PMC_data(SELF) = core_struct;
/* Set flags for custom GC mark and destroy. */
PObj_custom_mark_SET(SELF);
PObj_active_destroy_SET(SELF);
/* Set up the core struct and default values for the exception object. */
- PMC_data(SELF) = core_struct;
- core_struct->severity = ishash
- ? VTABLE_get_integer_keyed_str(interp, values, severity)
- : (INTVAL) EXCEPT_error;
- core_struct->handled = 0;
- core_struct->message = ishash
- ? VTABLE_get_string_keyed_str(interp, values, message)
- : VTABLE_get_string(interp, values);
- core_struct->payload = PMCNULL;
- core_struct->resume = PMCNULL;
- core_struct->backtrace = PMCNULL;
- core_struct->handler_iter = PMCNULL;
+
+ SET_ATTR_severity(INTERP, SELF, severity_val);
+ SET_ATTR_handled(INTERP, SELF, 0);
+ SET_ATTR_message(INTERP, SELF, message_val);
+ SET_ATTR_payload(INTERP, SELF, PMCNULL);
+ SET_ATTR_resume(INTERP, SELF, PMCNULL);
+ SET_ATTR_backtrace(INTERP, SELF, PMCNULL);
+ SET_ATTR_handler_iter(INTERP, SELF, PMCNULL);
+
}
/*
@@ -175,10 +185,11 @@
VTABLE void destroy() {
Parrot_Exception_attributes * const core_struct = PARROT_EXCEPTION(SELF);
- if (core_struct->thrower)
- Parrot_free_context(interp, core_struct->thrower, 1);
- if (core_struct)
+ if (core_struct) {
+ if (core_struct->thrower)
+ Parrot_free_context(interp, core_struct->thrower, 1);
mem_sys_free(core_struct);
+ }
}
/*
@@ -208,6 +219,8 @@
VTABLE STRING *get_string() {
STRING *message;
GET_ATTR_message(interp, SELF, message);
+ if (STRING_IS_NULL(message))
+ message = CONST_STRING(interp, "");
return message;
}
@@ -242,7 +255,7 @@
STRING *message;
if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
- GET_ATTR_message(interp, SELF, message);
+ message = SELF.get_string();
}
else {
/* If unknown attribute name, throw an exception. */
@@ -396,7 +409,7 @@
STRING *name = VTABLE_get_string(INTERP, key);
if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
- SET_ATTR_message(interp, SELF, value);
+ SELF.set_string_native(value);
}
else {
/* If unknown attribute name, throw an exception. */
@@ -588,8 +601,7 @@
VTABLE_set_integer_native(interp, value, handled);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
- STRING *message;
- GET_ATTR_message(interp, SELF, message);
+ STRING *message = SELF.get_string();
value = pmc_new(interp, enum_class_String);
VTABLE_set_string_native(interp, value, message);
}
@@ -643,7 +655,7 @@
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
STRING *message = VTABLE_get_string(interp, value);
- SET_ATTR_message(interp, SELF, message);
+ SELF.set_string_native(message);
}
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "payload"))) {
SET_ATTR_payload(interp, SELF, value);
Modified: branches/pluggable_runcore/src/pmc/exporter.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/exporter.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/exporter.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -109,12 +109,12 @@
VTABLE void init() {
Parrot_Exporter_attributes * const exp =
mem_allocate_zeroed_typed(Parrot_Exporter_attributes);
+ PMC_data(SELF) = exp;
/* Set up the object. */
- exp->ns_src = PMCNULL;
- exp->ns_dest = CONTEXT(interp)->current_namespace;
- exp->globals = PMCNULL;
- PMC_data(SELF) = exp;
+ SET_ATTR_ns_src(INTERP, SELF, PMCNULL);
+ SET_ATTR_ns_dest(INTERP, SELF, CONTEXT(interp)->current_namespace);
+ SET_ATTR_globals(INTERP, SELF, PMCNULL);
/* Set flags for custom GC mark and destroy. */
PObj_custom_mark_SET(SELF);
@@ -134,6 +134,7 @@
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
@@ -148,14 +149,19 @@
*/
VTABLE void mark() {
- Parrot_Exporter_attributes * const exp = PARROT_EXPORTER(SELF);
-
- if (exp->ns_src)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)exp->ns_src);
- if (exp->ns_dest)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)exp->ns_dest);
- if (exp->globals)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)exp->globals);
+ PMC *ns_src;
+ PMC *ns_dest;
+ PMC *globals;
+ GET_ATTR_ns_src(INTERP, SELF, ns_src);
+ GET_ATTR_ns_dest(INTERP, SELF, ns_dest);
+ GET_ATTR_globals(INTERP, SELF, globals);
+
+ if (ns_src)
+ Parrot_gc_mark_PObj_alive(interp, (PObj *)ns_src);
+ if (ns_dest)
+ Parrot_gc_mark_PObj_alive(interp, (PObj *)ns_dest);
+ if (globals)
+ Parrot_gc_mark_PObj_alive(interp, (PObj *)globals);
}
Modified: branches/pluggable_runcore/src/pmc/filehandle.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/filehandle.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/filehandle.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2008, Parrot Foundation.
+Copyright (C) 2008-2009, Parrot Foundation.
$Id$
=head1 NAME
@@ -63,7 +63,7 @@
*/
VTABLE void init() {
- Parrot_FileHandle_attributes *data_struct =
+ Parrot_FileHandle_attributes * const data_struct =
mem_allocate_typed(Parrot_FileHandle_attributes);
PMC_data(SELF) = data_struct;
@@ -277,7 +277,7 @@
*/
METHOD isatty() {
- INTVAL isatty = (PARROT_FILEHANDLE(SELF)->flags & PIO_F_CONSOLE) == PIO_F_CONSOLE;
+ const INTVAL isatty = (PARROT_FILEHANDLE(SELF)->flags & PIO_F_CONSOLE) == PIO_F_CONSOLE;
RETURN(INTVAL isatty);
}
@@ -292,8 +292,7 @@
*/
METHOD close() {
- INTVAL status;
- status = Parrot_io_close(INTERP, SELF);
+ const INTVAL status = Parrot_io_close(INTERP, SELF);
RETURN(INTVAL status);
}
@@ -308,8 +307,7 @@
*/
METHOD is_closed() {
- INTVAL status;
- status = Parrot_io_is_closed(interp, SELF);
+ const INTVAL status = Parrot_io_is_closed(interp, SELF);
RETURN(INTVAL status);
}
@@ -324,8 +322,7 @@
*/
METHOD read(INTVAL length) {
- STRING *string_result = NULL;
- string_result = Parrot_io_reads(INTERP, SELF, length);
+ STRING * const string_result = Parrot_io_reads(INTERP, SELF, length);
RETURN(STRING *string_result);
}
@@ -341,8 +338,7 @@
*/
METHOD readline() {
- STRING *string_result;
- string_result = Parrot_io_readline(INTERP, SELF);
+ STRING * const string_result = Parrot_io_readline(INTERP, SELF);
RETURN(STRING *string_result);
}
@@ -510,8 +506,7 @@
*/
METHOD puts(STRING *to_print) {
- INTVAL status;
- status = Parrot_io_putps(INTERP, SELF, to_print);
+ const INTVAL status = Parrot_io_putps(INTERP, SELF, to_print);
RETURN(INTVAL status);
}
@@ -650,8 +645,7 @@
*/
METHOD eof() {
- INTVAL flags;
- flags = Parrot_io_eof(INTERP, SELF);
+ const INTVAL flags = Parrot_io_eof(INTERP, SELF);
RETURN(INTVAL flags);
}
Modified: branches/pluggable_runcore/src/pmc/fixedbooleanarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/fixedbooleanarray.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/fixedbooleanarray.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -68,6 +68,7 @@
if (bit_array)
mem_sys_free(bit_array);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
@@ -504,19 +505,7 @@
*/
VTABLE PMC *get_iter() {
- STRING *name = CONST_STRING(interp, "set_key");
- PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
- PMC * const key = pmc_new(INTERP, enum_class_Key);
-
- Parrot_PCCINVOKE(interp, iter, name, "P->", key);
- PObj_get_FLAGS(key) |= KEY_integer_FLAG;
-
- if (SELF.get_integer() == 0)
- VTABLE_set_integer_native(INTERP, key, -1);
- else
- VTABLE_set_integer_native(INTERP, key, 0);
-
- return iter;
+ return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF);
}
Modified: branches/pluggable_runcore/src/pmc/fixedfloatarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/fixedfloatarray.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/fixedfloatarray.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -62,6 +62,7 @@
mem_sys_free(float_array);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
@@ -107,19 +108,7 @@
*/
VTABLE PMC *get_iter() {
- STRING *name = CONST_STRING(interp, "set_key");
- PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
- PMC * const key = pmc_new(INTERP, enum_class_Key);
-
- Parrot_PCCINVOKE(interp, iter, name, "P->", key);
- PObj_get_FLAGS(key) |= KEY_integer_FLAG;
-
- if (SELF.get_integer() == 0)
- VTABLE_set_integer_native(INTERP, key, -1);
- else
- VTABLE_set_integer_native(INTERP, key, 0);
-
- return iter;
+ return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF);
}
/*
Modified: branches/pluggable_runcore/src/pmc/fixedintegerarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/fixedintegerarray.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/fixedintegerarray.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -155,6 +155,7 @@
if (int_array)
mem_sys_free(int_array);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
@@ -597,22 +598,7 @@
*/
VTABLE PMC *get_iter() {
- STRING *name = CONST_STRING(interp, "set_key");
- PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
- PMC * const key = pmc_new(INTERP, enum_class_Key);
- INTVAL size;
-
- Parrot_PCCINVOKE(interp, iter, name, "P->", key);
- PObj_get_FLAGS(key) |= KEY_integer_FLAG;
-
- GET_ATTR_size(INTERP, SELF, size);
-
- if (size)
- VTABLE_set_integer_native(INTERP, key, 0);
- else
- VTABLE_set_integer_native(INTERP, key, -1);
-
- return iter;
+ return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF);
}
/*
Modified: branches/pluggable_runcore/src/pmc/fixedpmcarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/fixedpmcarray.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/fixedpmcarray.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -87,6 +87,7 @@
mem_sys_free(PMC_array(SELF));
}
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
@@ -646,19 +647,7 @@
}
VTABLE PMC *get_iter() {
- STRING *name = CONST_STRING(interp, "set_key");
- PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
- PMC * const key = pmc_new(INTERP, enum_class_Key);
-
- Parrot_PCCINVOKE(interp, iter, name, "P->", key);
- PObj_get_FLAGS(key) |= KEY_integer_FLAG;
-
- if (PMC_size(SELF) == 0)
- VTABLE_set_integer_native(INTERP, key, -1);
- else
- VTABLE_set_integer_native(INTERP, key, 0);
-
- return iter;
+ return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF);
}
/*
Modified: branches/pluggable_runcore/src/pmc/fixedstringarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/fixedstringarray.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/fixedstringarray.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -69,6 +69,7 @@
mem_sys_free(str_array);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
@@ -159,16 +160,7 @@
*/
VTABLE PMC *get_iter() {
- STRING *name = CONST_STRING(interp, "set_key");
- PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
- PMC * const key = pmc_new(INTERP, enum_class_Key);
-
- Parrot_PCCINVOKE(interp, iter, name, "P->", key);
- PObj_get_FLAGS(key) |= KEY_integer_FLAG;
- VTABLE_set_integer_native(INTERP, key,
- VTABLE_get_bool(INTERP, SELF) ? 0 : -1);
-
- return iter;
+ return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF);
}
/*
Modified: branches/pluggable_runcore/src/pmc/float.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/float.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/float.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -34,8 +34,8 @@
VTABLE void init() {
Parrot_Float_attributes * const fattr = mem_allocate_zeroed_typed(Parrot_Float_attributes);
- fattr->fv = 0.0;
PMC_data(SELF) = fattr;
+ SET_ATTR_fv(INTERP, SELF, 0.0);
PObj_active_destroy_SET(SELF);
}
@@ -51,6 +51,7 @@
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/pmc/hash.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/hash.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/hash.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -8,6 +8,28 @@
=head1 DESCRIPTION
+Hash PMC wraps Parrot's _hash to provide high-level API:
+
+=over 4
+
+=item *
+
+Convert between various types to use as hash keys.
+
+=item *
+
+Convert between various types to use as hash values.
+
+=item *
+
+Handle compound Keys for nested Hash/Array lookups.
+
+=item *
+
+Provide C<HashIterator> to iterate over C<Hash>.
+
+=back
+
These are the vtable functions for the Hash PMC.
=head2 Functions
@@ -20,6 +42,7 @@
#include "pmc_iterator.h"
#include "pmc_key.h"
+#include "pmc_hashiteratorkey.h"
/*
@@ -31,8 +54,7 @@
*/
-static PMC *get_integer_pmc(PARROT_INTERP, INTVAL base_type) {
- UNUSED(base_type)
+static PMC *get_integer_pmc(PARROT_INTERP) {
return pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Integer));
}
@@ -47,8 +69,7 @@
*/
-static PMC *get_number_pmc(PARROT_INTERP, INTVAL base_type) {
- UNUSED(base_type)
+static PMC *get_number_pmc(PARROT_INTERP) {
return pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Float));
}
@@ -62,78 +83,296 @@
*/
-static PMC *get_string_pmc(PARROT_INTERP, INTVAL base_type) {
- UNUSED(base_type)
+static PMC *get_string_pmc(PARROT_INTERP) {
return pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_String));
}
/*
-=item C<static STRING *make_ro_hash_key(PARROT_INTERP, PMC *key)>
-
-Returns a Parrot STRING for C<*key>.
+Poor-man polymorphic functions to convert something to something.
-You I<must not> modify this STRING, nor pass it to anything which may store it.
-It's only safe to use for looking up elements of a hash or deleting them --
-I<never> storing them. (If you have to ask why, don't use this function. It's
-for optimization purposes only.)
+There is bunch of functions to convert from passed value to stored keys type and to/from
+stored values type.
-=cut
+void *hash_key_from_TYPE convert to keys type.
+void *hash_value_from_TYPE convert to values type.
+TYPE hash_value_to_TYPE convert from values type.
*/
-static STRING
-*make_ro_hash_key(PARROT_INTERP, NOTNULL(PMC *key))
+static void*
+hash_key_from_int(PARROT_INTERP, const Hash * const hash, INTVAL key)
{
- STRING *s;
-
- switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
- case KEY_string_FLAG:
- GETATTR_Key_str_key(interp, key, s);
+ void *ret;
+ switch (hash->key_type) {
+ case Hash_key_type_int:
+ ret = (void *)key;
break;
- case KEY_string_FLAG | KEY_register_FLAG:
+ /* Currently PMCs are stringified */
+ case Hash_key_type_PMC:
+ case Hash_key_type_STRING:
+ ret = (void *)Parrot_str_from_int(interp, key);
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported key_type");
+ }
+ return ret;
+}
+
+static void*
+hash_key_from_string(PARROT_INTERP, const Hash * const hash, ARGIN(STRING *key))
+{
+ void *ret;
+ switch (hash->key_type) {
+ case Hash_key_type_int:
{
- INTVAL int_key;
- GETATTR_Key_int_key(interp, key, int_key);
- s = REG_STR(interp, int_key);
+ /* Pacify compiler about casting INVTAL to void */
+ const INTVAL int_key = Parrot_str_to_int(interp, key);
+ ret = INTVAL2PTR(void *, int_key);
break;
}
+ /* Currently PMCs are stringified */
+ case Hash_key_type_PMC:
+ case Hash_key_type_STRING:
+ ret = key;
+ break;
default:
- s = key_string(interp, key);
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported key_type");
}
+ return ret;
+}
- if (STRING_IS_NULL(s))
- Parrot_ex_throw_from_c_args(interp, NULL,
- EXCEPTION_UNEXPECTED_NULL, "Hash: Cannot use NULL STRING key");
-
- return s;
+static void*
+hash_key_from_pmc(PARROT_INTERP, const Hash * const hash, ARGIN(PMC *key))
+{
+ void *ret;
+ switch (hash->key_type) {
+ case Hash_key_type_int:
+ {
+ const INTVAL int_key = VTABLE_get_integer(interp, key);
+ ret = INTVAL2PTR(void *, int_key);
+ break;
+ }
+ /* Currently PMCs are stringified */
+ case Hash_key_type_PMC:
+ case Hash_key_type_STRING:
+ {
+ STRING * const tmp = VTABLE_get_string(interp, key);
+ if (!tmp)
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
+ "hash: can't use null as key");
+ ret = (void *)tmp;
+ }
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported key_type");
+ }
+ return ret;
}
-/*
+/* Second part - convert from stored void* to real type */
+/* TODO: FLOATVALs converted into Float PMC for now */
+static void*
+hash_value_from_int(PARROT_INTERP, const Hash * const hash, INTVAL value)
+{
+ void *ret;
+ switch (hash->entry_type) {
+ case enum_type_INTVAL:
+ ret = INTVAL2PTR(void *, value);
+ break;
+ case enum_type_PMC:
+ {
+ PMC * const tmp = get_integer_pmc(interp);
+ VTABLE_set_integer_native(interp, tmp, value);
+ ret = INTVAL2PTR(void *, tmp);
+ }
+ break;
+ case enum_type_STRING:
+ ret = (void *)Parrot_str_from_int(interp, value);
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported entry_type");
+ }
+ return ret;
+}
-=item C<static STRING *make_hash_key(PARROT_INTERP, PMC *key)>
+static void*
+hash_value_from_string(PARROT_INTERP, const Hash * const hash, STRING *value)
+{
+ void *ret;
+ switch (hash->entry_type) {
+ case enum_type_INTVAL:
+ {
+ const INTVAL int_val = Parrot_str_to_int(interp, value);
+ ret = INTVAL2PTR(void *, int_val);
+ break;
+ }
+ case enum_type_STRING:
+ ret = (void *)value;
+ break;
+ case enum_type_PMC:
+ {
+ PMC * const s = get_string_pmc(interp);
+ VTABLE_set_string_native(interp, s, value);
+ ret = (void *)s;
+ }
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported entry_type");
+ }
+ return ret;
+}
-Returns a Parrot STRING for C<*key>. This STRING is safe to modify or store.
+static void*
+hash_value_from_pmc(PARROT_INTERP, const Hash * const hash, PMC *value)
+{
+ void *ret;
+ switch (hash->entry_type) {
+ case enum_type_INTVAL:
+ {
+ const INTVAL int_val = VTABLE_get_integer(interp, value);
+ ret = INTVAL2PTR(void *, int_val);
+ break;
+ }
+ case enum_type_STRING:
+ ret = (void *)VTABLE_get_string(interp, value);
+ break;
+ case enum_type_PMC:
+ ret = (void *)value;
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported entry_type");
+ }
+ return ret;
+}
-=cut
+static void*
+hash_value_from_number(PARROT_INTERP, const Hash * const hash, FLOATVAL value)
+{
+ void *ret;
+ switch (hash->entry_type) {
+ case enum_type_INTVAL:
+ {
+ const INTVAL tmp = value;
+ ret = (void*)tmp;
+ }
+ break;
+ case enum_type_STRING:
+ ret = (void *)Parrot_str_from_num(interp, value);
+ break;
+ case enum_type_PMC:
+ {
+ PMC * const tmp = get_number_pmc(interp);
+ VTABLE_set_number_native(interp, tmp, value);
+ ret = (void *)tmp;
+ }
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported entry_type");
+ }
+ return ret;
+}
-*/
+static INTVAL
+hash_value_to_int(PARROT_INTERP, const Hash * const hash, void *value)
+{
+ INTVAL ret;
+ switch (hash->entry_type) {
+ case enum_type_INTVAL:
+ ret = (INTVAL)value;
+ break;
+ case enum_type_STRING:
+ ret = Parrot_str_to_int(interp, (STRING*)value);
+ break;
+ case enum_type_PMC:
+ ret = VTABLE_get_integer(interp, (PMC*)value);
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported entry_type");
+ }
+ return ret;
+}
-PARROT_CANNOT_RETURN_NULL
-static STRING
-*make_hash_key(PARROT_INTERP, NOTNULL(PMC *key))
+static STRING*
+hash_value_to_string(PARROT_INTERP, const Hash * const hash, void *value)
{
- STRING * const keystr = key_string(interp, key);
+ STRING *ret;
+ switch (hash->entry_type) {
+ case enum_type_INTVAL:
+ ret = Parrot_str_from_int(interp, (INTVAL)value);
+ break;
+ case enum_type_STRING:
+ ret = (STRING *)value;
+ break;
+ case enum_type_PMC:
+ ret = VTABLE_get_string(interp, (PMC *)value);
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported entry_type");
+ }
+ return ret;
+}
- if (STRING_IS_NULL(keystr))
- Parrot_ex_throw_from_c_args(interp, NULL,
- EXCEPTION_UNEXPECTED_NULL, "Hash: Cannot use NULL STRING key");
+static PMC*
+hash_value_to_pmc(PARROT_INTERP, const Hash * const hash, void *value)
+{
+ PMC *ret;
+ switch (hash->entry_type) {
+ case enum_type_INTVAL:
+ ret = get_integer_pmc(interp);
+ VTABLE_set_integer_native(interp, ret, (INTVAL)value);
+ break;
+ case enum_type_STRING:
+ ret = get_string_pmc(interp);
+ VTABLE_set_string_native(interp, ret, (STRING *)value);
+ break;
+ case enum_type_PMC:
+ ret = (PMC *)value;
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported entry_type");
+ }
+ return ret;
+}
- return keystr;
+static FLOATVAL
+hash_value_to_number(PARROT_INTERP, const Hash * const hash, void *value)
+{
+ FLOATVAL ret;
+ switch (hash->entry_type) {
+ case enum_type_INTVAL:
+ {
+ /* Pacify compiler about casting */
+ const INTVAL tmp = (INTVAL)value;
+ ret = tmp;
+ }
+ break;
+ case enum_type_STRING:
+ ret = Parrot_str_to_num(interp, (STRING*)value);
+ break;
+ case enum_type_PMC:
+ ret = VTABLE_get_number(interp, (PMC*)value);
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported entry_type");
+ }
+ return ret;
}
+
/* Needs ext struct for the next_for_GC pointer
* We would get recursive marking of a deeply nested HoHoH...
*/
@@ -165,11 +404,12 @@
}
VTABLE void destroy() {
- Hash *hash = (Hash *)SELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
if (hash)
parrot_hash_destroy(INTERP, hash);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
@@ -182,7 +422,7 @@
*/
VTABLE void mark() {
- Hash *hash = (Hash *)SELF.get_pointer();
+ Hash * const hash = (Hash *)SELF.get_pointer();
if (hash != NULL)
parrot_mark_hash(INTERP, hash);
}
@@ -217,8 +457,8 @@
*/
VTABLE void set_pointer(void *ptr) {
- Hash *old_hash = (Hash *)SELF.get_pointer();
- Hash *new_hash = (Hash *)ptr;
+ Hash * const old_hash = (Hash *)SELF.get_pointer();
+ Hash * const new_hash = (Hash *)ptr;
PARROT_HASH(SELF)->hash = new_hash;
new_hash->container = SELF;
@@ -228,182 +468,133 @@
}
/*
+=item C<void set_integer(INTVAL type)>
-=item C<void *get_pointer()>
+Reset Hash to use differen keys. See enum C<Hash_key_type> for possible values.
-Get a pointer to this PMC's Hash*.
+NB: this method will destroy all old data!
=cut
-
*/
- VTABLE void *get_pointer() {
- return PARROT_HASH(SELF)->hash;
- }
-
-/*
-
-=item C<INTVAL get_integer()>
+ VTABLE void set_integer_native(INTVAL type) {
+ Hash * const old_hash = (Hash *)SELF.get_pointer();
+ Hash *new_hash;
-Returns the size of the hash.
+ if (type == Hash_key_type_STRING)
+ new_hash = parrot_new_hash(INTERP);
+ else if (type == Hash_key_type_int)
+ /* new_int_hash set BOTH keys and values to INTVAL */
+ new_hash = parrot_create_hash(interp,
+ old_hash ? old_hash->entry_type : enum_type_PMC,
+ Hash_key_type_int,
+ int_compare,
+ key_hash_int);
+ else
+ /*
+ We probably will not implement other types of keys. They are way
+ too dangerous to use from PIR
+ */
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: Unknown key type");
-=cut
-*/
+ PARROT_HASH(SELF)->hash = new_hash;
+ new_hash->container = SELF;
- VTABLE INTVAL get_integer() {
- return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer());
+ if (old_hash)
+ parrot_hash_destroy(INTERP, old_hash);
}
-/*
-
-=item C<INTVAL get_integer_keyed_str(STRING *key)>
-
-=item C<INTVAL get_integer_keyed_int(INTVAL key)>
-
-=cut
-
-*/
-
- VTABLE INTVAL get_integer_keyed_str(STRING *key) {
- HashBucket * const b =
- parrot_hash_get_bucket(INTERP, (Hash *)SELF.get_pointer(), key);
-
- if (!b)
- return 0;
-
- return VTABLE_get_integer(INTERP, (PMC*) b->value);
+ METHOD set_key_type(INTVAL type) {
+ SELF.set_integer_native(type);
}
- VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
- const Hash * const hash = (Hash *)SELF.get_pointer();
- HashBucket *b;
-
- if (hash->key_type == Hash_key_type_STRING)
- return SELF.get_integer_keyed_str(Parrot_str_from_int(INTERP, key));
-
- b = parrot_hash_get_bucket(INTERP, hash, (void *)key);
-
- if (!b)
- return 0;
-
- return (INTVAL)b->value;
+ METHOD get_key_type() {
+ const INTVAL ret = ((Hash *)SELF.get_pointer())->key_type;
+ RETURN(INTVAL ret);
}
+
/*
-=item C<INTVAL get_integer_keyed(PMC *key)>
+=item C<METHOD set_value_type(INTVAL type)>
-Returns the integer value for the element at C<*key>.
+Reset Hash to use different value-type for stored items. If there is no
+previous _hash was set defaults to STRING* keys.
-=cut
+NB: this method will destroy all old data!
+=cut
*/
+ METHOD set_value_type(INTVAL type) {
+ Hash *old_hash = (Hash *)SELF.get_pointer();
+ Hash *new_hash;
- VTABLE INTVAL get_integer_keyed(PMC *key) {
- PMC *valpmc;
- STRING *keystr;
- HashBucket *b;
- PMC *nextkey;
- const Hash * const hash = (Hash *)SELF.get_pointer();
-
- /* called from iterator with an integer idx in key */
- if ((PObj_get_FLAGS(key) & KEY_type_FLAGS) == KEY_hash_iterator_FLAGS) {
-
- /* check if we really have Hash_key_type_int */
- if (hash->key_type == Hash_key_type_int) {
- void *idx = parrot_hash_get_idx(INTERP, hash, key);
- return (INTVAL)idx;
- }
- else {
- const STRING * const s =
- (STRING *)parrot_hash_get_idx(INTERP, hash, key);
- return Parrot_str_to_int(INTERP, s);
- }
+ /*
+ If someone called Hash.set_pointer with NULL pointer...
+ It will create STRING* keys hash. Because we can't use STRING_compare
+ directly - it declared static in F<src/hash.c>
+ */
+ if (!old_hash)
+ old_hash = parrot_new_hash(INTERP);
+
+ switch (type) {
+ case enum_type_INTVAL:
+ case enum_type_STRING:
+ case enum_type_PMC:
+ new_hash = parrot_create_hash(interp,
+ (PARROT_DATA_TYPE)type,
+ old_hash->key_type,
+ old_hash->compare,
+ old_hash->hash_val);
+ break;
+ default:
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Hash: unsupported entry_type");
}
- keystr = make_ro_hash_key(INTERP, key);
- b = parrot_hash_get_bucket(INTERP, hash, keystr);
-
- if (!b)
- return 0;
-
- nextkey = key_next(INTERP, key);
- valpmc = (PMC *)b->value;
-
- if (!nextkey)
- return VTABLE_get_integer(INTERP, valpmc);
+ PARROT_HASH(SELF)->hash = new_hash;
+ new_hash->container = SELF;
- return VTABLE_get_integer_keyed(INTERP, valpmc, nextkey);
+ parrot_hash_destroy(INTERP, old_hash);
}
-/*
-
-=item C<FLOATVAL get_number()>
-
-Returns the size of the hash.
-
-=cut
-
-*/
-
- VTABLE FLOATVAL get_number() {
- /* doing this in two steps avoids dodgy cast warnings with -O */
- const INTVAL size = parrot_hash_size(INTERP, (Hash *)SELF.get_pointer());
- return (FLOATVAL)size;
+ METHOD get_value_type() {
+ INTVAL ret = ((Hash *)SELF.get_pointer())->entry_type;
+ RETURN(INTVAL ret);
}
/*
-=item C<FLOATVAL get_number_keyed_str(STRING *key)>
+=item C<void *get_pointer()>
-=item C<FLOATVAL get_number_keyed_int(INTVAL key)>
+Get a pointer to this PMC's Hash*.
=cut
*/
-
- VTABLE FLOATVAL get_number_keyed_str(STRING *key) {
- HashBucket * const b =
- parrot_hash_get_bucket(INTERP, (Hash *)SELF.get_pointer(), key);
-
- if (!b)
- return 0.0;
-
- return VTABLE_get_number(INTERP, (PMC *)b->value);
+ VTABLE void *get_pointer() {
+ return PARROT_HASH(SELF)->hash;
}
- VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
- STRING * const s = Parrot_str_from_int(INTERP, key);
- return SELF.get_number_keyed_str(s);
- }
/*
-=item C<FLOATVAL get_number_keyed(PMC *key)>
+=item C<INTVAL get_integer()>
-Returns the floating-point value for the element at C<*key>.
+=item C<FLOATVAL get_number()>
+
+Returns the size of the hash.
=cut
*/
- VTABLE FLOATVAL get_number_keyed(PMC *key) {
- PMC *nextkey;
- PMC *valpmc;
- STRING * const keystr = make_ro_hash_key(INTERP, key);
- HashBucket * const b = parrot_hash_get_bucket(INTERP,
- (Hash *)SELF.get_pointer(), keystr);
-
- if (!b)
- return 0.0;
-
- nextkey = key_next(INTERP, key);
- valpmc = (PMC *)b->value;
-
- if (!nextkey)
- return VTABLE_get_number(INTERP, valpmc);
-
- return VTABLE_get_number_keyed(INTERP, valpmc, nextkey);
+ VTABLE INTVAL get_integer() {
+ return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer());
}
+ VTABLE FLOATVAL get_number() {
+ return SELF.get_integer();
+ }
/*
@@ -438,7 +629,7 @@
PMC *val;
for (i = 0; i < (int)key->strlen; ++i) {
- if (!isdigit((unsigned char)((char *)key->strstart)[i])) {
+ if (!isdigit((unsigned char)((const char *)key->strstart)[i])) {
all_digit = 0;
break;
}
@@ -468,374 +659,409 @@
/*
-=item C<STRING *get_string_keyed_str(STRING *key)>
+=item C<INTVAL get_integer_keyed_str(STRING *key)>
-=item C<STRING *get_string_keyed_int(INTVAL key)>
+=item C<INTVAL get_integer_keyed_int(INTVAL key)>
=cut
*/
- VTABLE STRING *get_string_keyed_str(STRING *key) {
- HashBucket * const b =
- parrot_hash_get_bucket(INTERP, (Hash *)SELF.get_pointer(), key);
+ VTABLE INTVAL get_integer_keyed_str(STRING *key) {
+ const Hash * const hash = (Hash*)SELF.get_pointer();
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
+ hash_key_from_string(INTERP, hash, key));
if (!b)
- return Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
+ return 0;
- return VTABLE_get_string(INTERP, (PMC*) b->value);
+ return hash_value_to_int(INTERP, hash, b->value);
}
- VTABLE STRING *get_string_keyed_int(INTVAL key) {
- STRING * const s = Parrot_str_from_int(INTERP, key);
- return SELF.get_string_keyed_str(s);
- }
+ VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
+ const Hash * const hash = (Hash*)SELF.get_pointer();
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
+ hash_key_from_int(INTERP, hash, key));
+ if (!b)
+ return 0;
+
+ return hash_value_to_int(INTERP, hash, b->value);
+ }
/*
-=item C<STRING *get_string_keyed(PMC *key)>
+=item C<INTVAL get_integer_keyed(PMC *key)>
-Returns the string value for the element at C<*key>.
+Returns the integer value for the element at C<*key>.
=cut
*/
- VTABLE STRING *get_string_keyed(PMC *key) {
- PMC *valpmc;
- STRING *keystr;
- HashBucket *b;
- PMC *nextkey;
- Hash * const hash = (Hash *)SELF.get_pointer();
-
- if ((PObj_get_FLAGS(key) & KEY_type_FLAGS) == KEY_hash_iterator_FLAGS) {
- /* called from iterator with an integer idx in key */
- if (hash->key_type == Hash_key_type_int) {
- void *idx = parrot_hash_get_idx(INTERP, hash, key);
- return Parrot_str_from_int(INTERP, (INTVAL)idx);
- }
+ /* Handling Keys */
+ VTABLE INTVAL get_integer_keyed(PMC *key) {
+ const Hash * const hash = (Hash *)SELF.get_pointer();
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
+ hash_key_from_pmc(INTERP, hash, key));
+ PMC *valpmc;
+ PMC *nextkey;
- return (STRING *)parrot_hash_get_idx(INTERP, hash, key);
- }
+ if (!b)
+ return 0;
- keystr = make_ro_hash_key(INTERP, key);
- b = parrot_hash_get_bucket(INTERP, hash, keystr);
-
- if (!b)
- return Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
-
- nextkey = key_next(INTERP, key);
- valpmc = (PMC *)b->value;
+ nextkey = key_next(INTERP, key);
+ valpmc = hash_value_to_pmc(INTERP, hash, b->value);
+ /* Stop recursion. This is last step */
if (!nextkey)
- return VTABLE_get_string(INTERP, valpmc);
+ return VTABLE_get_integer(INTERP, valpmc);
- return VTABLE_get_string_keyed(INTERP, valpmc, nextkey);
+ /* Recusively call to enclosed aggregate */
+ return VTABLE_get_integer_keyed(INTERP, valpmc, nextkey);
}
/*
-=item C<INTVAL get_bool()>
-
-Returns true if the hash size is not zero.
+=item C<void set_integer_keyed(PMC *key, INTVAL value)>
=cut
*/
- VTABLE INTVAL get_bool() {
- return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer()) != 0;
+ VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
+ Hash * const hash = (Hash *)SELF.get_pointer();
+ void * const keystr = hash_key_from_pmc(INTERP, hash, key);
+ PMC * const nextkey = key_next(INTERP, key);
+ PMC *box;
+ HashBucket *b;
+
+ if (!nextkey) {
+ parrot_hash_put(INTERP, hash, keystr,
+ hash_value_from_int(INTERP, hash, value));
+ return;
+ }
+
+ b = parrot_hash_get_bucket(INTERP, hash, keystr);
+ if (b)
+ box = hash_value_to_pmc(INTERP, hash, b->value);
+ else {
+ /* autovivify an Hash */
+ box = pmc_new(INTERP, SELF.type());
+ parrot_hash_put(INTERP, hash, keystr,
+ hash_value_from_pmc(INTERP, hash, box));
+ }
+
+ VTABLE_set_integer_keyed(INTERP, box, nextkey, value);
}
-/*
+ VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
+ Hash * const hash = (Hash *)SELF.get_pointer();
+ parrot_hash_put(INTERP, hash, hash_key_from_int(INTERP, hash, key),
+ hash_value_from_int(INTERP, hash, value));
+ }
-=item C<INTVAL elements()>
+/*
-Returns the number of elements in the hash.
+=item C<void set_integer_keyed_str(STRING *key, INTVAL value)>
=cut
*/
- VTABLE INTVAL elements() {
- return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer());
+ VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) {
+ Hash * const hash = (Hash *)SELF.get_pointer();
+ parrot_hash_put(INTERP, hash, hash_key_from_string(INTERP, hash, key),
+ hash_value_from_int(INTERP, hash, value));
}
+
/*
-=item C<PMC *get_pmc_keyed_str(STRING *key)>
+=item C<FLOATVAL get_number_keyed_str(STRING *key)>
-=item C<PMC *get_pmc_keyed_int(INTVAL key)>
+=item C<FLOATVAL get_number_keyed_int(INTVAL key)>
=cut
*/
- VTABLE PMC *get_pmc_keyed_str(STRING *key) {
- HashBucket * const b =
- parrot_hash_get_bucket(INTERP, (Hash *)SELF.get_pointer(), key);
+ VTABLE FLOATVAL get_number_keyed_str(STRING *key) {
+ const Hash * const hash = (Hash *)SELF.get_pointer();
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
+ hash_key_from_string(INTERP, hash, key));
if (!b)
- return PMCNULL;
-
- return (PMC *)b->value;
- }
+ return 0.0;
- VTABLE PMC *get_pmc_keyed_int(INTVAL key) {
- STRING * const s = Parrot_str_from_int(INTERP, key);
- return SELF.get_pmc_keyed_str(s);
+ return hash_value_to_number(INTERP, hash, b->value);
}
-/*
+ VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
+ const Hash * const hash = (Hash *)SELF.get_pointer();
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
+ hash_key_from_int(INTERP, hash, key));
-=item C<PMC *get_iter()>
+ if (!b)
+ return 0.0;
-Return a new iterator for the slice PMC C<key>
+ return hash_value_to_number(INTERP, hash, b->value);
+ }
+/*
-=item C<PMC *get_pmc_keyed(PMC *key)>
+=item C<FLOATVAL get_number_keyed(PMC *key)>
-Returns the PMC value for the element at C<*key>.
+Returns the floating-point value for the element at C<*key>.
=cut
*/
- VTABLE PMC *get_iter() {
- PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
- PMC * const key = pmc_new(INTERP, enum_class_Key);
+ /* I can't migrate this function right now. Some problem with JITting */
+ VTABLE FLOATVAL get_number_keyed(PMC *key) {
+ PMC *nextkey;
+ PMC *valpmc;
+ const Hash * const hash = (Hash *)VTABLE_get_pointer(interp, pmc);
+ void * const keystr = hash_key_from_pmc(INTERP, hash, key);
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash, keystr);
- SETATTR_Iterator_key(INTERP, iter, key);
- PObj_get_FLAGS(key) |= KEY_hash_iterator_FLAGS;
- SETATTR_Key_next_key(INTERP, key, (PMC *)INITBucketIndex);
+ if (!b)
+ return 0.0;
- /* -1 for an empty hash, 0 for a non-empty hash. */
- SETATTR_Key_int_key(INTERP, key,
- parrot_hash_size(INTERP, (Hash *)SELF.get_pointer()) ? 0 : -1);
+ nextkey = key_next(INTERP, key);
+ valpmc = hash_value_to_pmc(INTERP, hash, b->value);
- return iter;
- }
+ if (!nextkey)
+ return VTABLE_get_number(INTERP, valpmc);
- VTABLE PMC *slice(PMC *key) {
- return PMCNULL;
+ return VTABLE_get_number_keyed(INTERP, valpmc, nextkey);
}
- VTABLE PMC *get_pmc_keyed(PMC *key) {
- const Hash * const hash = (Hash *)SELF.get_pointer();
- STRING *keystr;
- HashBucket *b;
- PMC *nextkey;
-
- /* called from iterator with an integer idx in key */
- if ((PObj_get_FLAGS(key) & KEY_type_FLAGS) == KEY_hash_iterator_FLAGS) {
- PMC *result;
-
- /* check if we really have Hash_key_type_int */
- if (hash->key_type == Hash_key_type_int) {
- void *idx = parrot_hash_get_idx(INTERP, hash, key);
- const INTVAL i = (INTVAL)idx;
- result = pmc_new(INTERP, enum_class_Integer);
- VTABLE_set_integer_native(INTERP, result, i);
- }
- else {
- STRING *s = (STRING *)parrot_hash_get_idx(INTERP, hash, key);
- result = pmc_new(INTERP, enum_class_String);
- VTABLE_set_string_native(INTERP, result, s);
- }
- return result;
- }
+/*
+
+=item C<STRING *get_string_keyed_str(STRING *key)>
- keystr = make_ro_hash_key(INTERP, key);
- b = parrot_hash_get_bucket(INTERP, hash, keystr);
+=item C<STRING *get_string_keyed_int(INTVAL key)>
+
+=cut
+
+*/
+
+ VTABLE STRING *get_string_keyed_str(STRING *key) {
+ const Hash * const hash = (Hash*)SELF.get_pointer();
+ HashBucket * const b =
+ parrot_hash_get_bucket(INTERP, hash, hash_key_from_string(INTERP, hash, key));
if (!b)
- return PMCNULL;
+ return Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
- nextkey = key_next(INTERP, key);
+ return hash_value_to_string(INTERP, hash, b->value);
+ }
- if (!nextkey)
- return (PMC *)b->value;
+ VTABLE STRING *get_string_keyed_int(INTVAL key) {
+ const Hash * const hash = (Hash*)SELF.get_pointer();
+ HashBucket * const b =
+ parrot_hash_get_bucket(INTERP, hash, hash_key_from_int(INTERP, hash, key));
- return VTABLE_get_pmc_keyed(INTERP, (PMC*)b->value, nextkey);
+ if (!b)
+ return Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
+
+ return hash_value_to_string(INTERP, hash, b->value);
}
/*
-=item C<INTVAL is_same(const PMC *other)>
+=item C<STRING *get_string_keyed(PMC *key)>
-Returns whether the hash is the same as C<*other>.
+Returns the string value for the element at C<*key>.
=cut
*/
- VTABLE INTVAL is_same(PMC *other) {
- return (INTVAL)(other->vtable == SELF->vtable &&
- VTABLE_get_pointer(INTERP, other) == SELF.get_pointer());
+ VTABLE STRING *get_string_keyed(PMC *key) {
+ const Hash * const hash = (Hash *)SELF.get_pointer();
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
+ hash_key_from_pmc(INTERP, hash, key));
+ PMC *valpmc;
+ PMC *nextkey;
+
+ if (!b)
+ return Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
+
+ nextkey = key_next(INTERP, key);
+ valpmc = hash_value_to_pmc(INTERP, hash, b->value);
+
+ /* Stop recursion. This is last step */
+ if (!nextkey)
+ return VTABLE_get_string(INTERP, valpmc);
+
+ /* Recusively call to enclosed aggregate */
+ return VTABLE_get_string_keyed(INTERP, valpmc, nextkey);
}
/*
-=item C<void set_integer_keyed(PMC *key, INTVAL value)>
+=item C<void set_string_keyed(PMC *key, STRING *value)>
=cut
*/
- VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
- STRING *keystr;
- PMC *nextkey;
+ VTABLE void set_string_keyed(PMC *key, STRING *value) {
+ Hash * const hash = (Hash *)SELF.get_pointer();
+ void * const keystr = hash_key_from_pmc(INTERP, hash, key);
+ PMC * const nextkey = key_next(INTERP, key);
PMC *box;
-
- if (!key)
- return;
-
- keystr = make_hash_key(INTERP, key);
- nextkey = key_next(INTERP, key);
+ HashBucket *b;
if (!nextkey) {
- PMC *val = get_integer_pmc(INTERP, SELF->vtable->base_type);
-
- VTABLE_set_integer_native(INTERP, val, value);
- parrot_hash_put(INTERP, (Hash *)SELF.get_pointer(), keystr, val);
+ parrot_hash_put(INTERP, hash, keystr,
+ hash_value_from_string(INTERP, hash, value));
return;
}
- box = SELF.get_pmc_keyed_str(keystr);
-
- /* autovivify an Hash */
- if (!box)
- box = pmc_new(INTERP, SELF.type());
-
- VTABLE_set_integer_keyed(INTERP, box, nextkey, value);
- }
-
- VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
- Hash * const hash = (Hash *)SELF.get_pointer();
-
- /* check if we really have Hash_key_type_int */
- if (hash->key_type == Hash_key_type_int) {
- parrot_hash_put(INTERP, hash, (void *)key, (void *)value);
- }
+ b = parrot_hash_get_bucket(INTERP, hash, keystr);
+ if (b)
+ box = hash_value_to_pmc(INTERP, hash, b->value);
else {
- SUPER(key, value);
+ /* autovivify an Hash */
+ box = pmc_new(INTERP, SELF.type());
+ parrot_hash_put(INTERP, hash, keystr,
+ hash_value_from_pmc(INTERP, hash, box));
}
+
+ VTABLE_set_string_keyed(INTERP, box, nextkey, value);
}
/*
-=item C<void set_integer_keyed_str(STRING *key, INTVAL value)>
+=item C<void set_string_keyed_str(STRING *key, STRING *value)>
=cut
*/
- VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) {
- PMC * const val = get_integer_pmc(INTERP, SELF->vtable->base_type);
- VTABLE_set_integer_native(INTERP, val, value);
+ VTABLE void set_string_keyed_str(STRING *key, STRING *value) {
+ Hash * const hash = (Hash *)SELF.get_pointer();
+ parrot_hash_put(INTERP, hash,
+ hash_key_from_string(INTERP, hash, key),
+ hash_value_from_string(INTERP, hash, value));
+ }
- parrot_hash_put(INTERP, (Hash *)SELF.get_pointer(), key, val);
+ VTABLE void set_string_keyed_int(INTVAL key, STRING *value) {
+ Hash * const hash = (Hash *)SELF.get_pointer();
+ parrot_hash_put(INTERP, hash,
+ hash_key_from_int(INTERP, hash, key),
+ hash_value_from_string(INTERP, hash, value));
}
/*
-=item C<void set_number_keyed(PMC *key, FLOATVAL value)>
-
-=cut
+=item C<PMC *get_pmc_keyed(PMC *key)>
-*/
+=item C<PMC *get_pmc_keyed_str(STRING *key)>
- VTABLE void set_number_keyed(PMC *key, FLOATVAL value) {
- STRING *keystr;
- PMC *nextkey;
- PMC *box;
+=item C<PMC *get_pmc_keyed_int(INTVAL key)>
- if (!key)
- return;
+Returns the PMC value for the element at C<*key>.
- keystr = make_hash_key(INTERP, key);
- nextkey = key_next(INTERP, key);
+=cut
- if (!nextkey) {
- PMC *val = get_number_pmc(INTERP, SELF->vtable->base_type);
- VTABLE_set_number_native(INTERP, val, value);
- parrot_hash_put(INTERP, (Hash *)SELF.get_pointer(), keystr, val);
- return;
- }
+*/
- box = SELF.get_pmc_keyed_str(keystr);
+ VTABLE PMC *get_pmc_keyed_str(STRING *key) {
+ const Hash * const hash = (Hash *)SELF.get_pointer();
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
+ hash_key_from_string(INTERP, hash, key));
- /* autovivify an Hash */
- if (!box)
- box = pmc_new(INTERP, SELF.type());
+ if (!b)
+ return PMCNULL;
- VTABLE_set_number_keyed(INTERP, box, nextkey, value);
+ return hash_value_to_pmc(INTERP, hash, b->value);
}
-/*
+ VTABLE PMC *get_pmc_keyed_int(INTVAL key) {
+ const Hash * const hash = (Hash *)SELF.get_pointer();
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
+ hash_key_from_int(INTERP, hash, key));
-=item C<void set_number_keyed_str(STRING *key, FLOATVAL value)>
+ if (!b)
+ return PMCNULL;
-Sets C<value> as the value for C<*key>.
+ return hash_value_to_pmc(INTERP, hash, b->value);
+ }
-=cut
+ /* Compound Key */
+ VTABLE PMC *get_pmc_keyed(PMC *key) {
+ const Hash * const hash = (Hash *)SELF.get_pointer();
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
+ hash_key_from_pmc(INTERP, hash, key));
+ PMC *valpmc;
+ PMC *nextkey;
-*/
+ if (!b)
+ return PMCNULL;
- VTABLE void set_number_keyed_str(STRING *key, FLOATVAL value) {
- PMC * const val = get_number_pmc(INTERP, SELF->vtable->base_type);
- VTABLE_set_number_native(INTERP, val, value);
+ nextkey = key_next(INTERP, key);
+ valpmc = hash_value_to_pmc(INTERP, hash, b->value);
- parrot_hash_put(INTERP, (Hash *)SELF.get_pointer(), key, val);
+ /* Stop recursion. This is last step */
+ if (!nextkey)
+ return valpmc;
+
+ /* Recusively call to enclosed aggregate */
+ return VTABLE_get_pmc_keyed(INTERP, valpmc, nextkey);
}
/*
-=item C<void set_string_keyed(PMC *key, STRING *value)>
+=item C<void set_number_keyed(PMC *key, FLOATVAL value)>
=cut
*/
- VTABLE void set_string_keyed(PMC *key, STRING *value) {
- STRING *keystr;
- PMC *nextkey;
- PMC *box;
-
- if (!key)
- return;
+ VTABLE void set_number_keyed(PMC *key, FLOATVAL value) {
+ Hash * const hash = (Hash *)SELF.get_pointer();
+ void * const keystr = hash_key_from_pmc(INTERP, hash, key);
+ PMC * const nextkey = key_next(INTERP, key);
+ PMC *box = PMCNULL;
+ HashBucket *b;
- keystr = make_hash_key(INTERP, key);
- nextkey = key_next(INTERP, key);
if (!nextkey) {
- PMC * const val = get_string_pmc(INTERP, SELF->vtable->base_type);
- VTABLE_set_string_native(INTERP, val, value);
- parrot_hash_put(INTERP, (Hash *)SELF.get_pointer(), keystr, val);
+ PMC * const val = get_number_pmc(INTERP);
+ VTABLE_set_number_native(INTERP, val, value);
+ parrot_hash_put(INTERP, hash, keystr, hash_value_from_pmc(INTERP, hash, val));
return;
}
- box = SELF.get_pmc_keyed_str(keystr);
+ b = parrot_hash_get_bucket(INTERP, (Hash *)SELF.get_pointer(), keystr);
+ if (b)
+ box = hash_value_to_pmc(INTERP, hash, b->value);
/* autovivify an Hash */
- if (!box)
+ if (PMC_IS_NULL(box))
box = pmc_new(INTERP, SELF.type());
- VTABLE_set_string_keyed(INTERP, box, nextkey, value);
+ VTABLE_set_number_keyed(INTERP, box, nextkey, value);
}
/*
-=item C<void set_string_keyed_str(STRING *key, STRING *value)>
+=item C<void set_number_keyed_str(STRING *key, FLOATVAL value)>
+
+Sets C<value> as the value for C<*key>.
=cut
*/
- VTABLE void set_string_keyed_str(STRING *key, STRING *value) {
- PMC * const val = get_string_pmc(INTERP, SELF->vtable->base_type);
+ VTABLE void set_number_keyed_str(STRING *key, FLOATVAL value) {
+ PMC * const val = get_number_pmc(INTERP);
+ VTABLE_set_number_native(INTERP, val, value);
- VTABLE_set_string_native(INTERP, val, value);
parrot_hash_put(INTERP, (Hash *)SELF.get_pointer(), key, val);
}
@@ -848,26 +1074,27 @@
*/
VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
- STRING *keystr;
- PMC *nextkey;
+ Hash * const hash = (Hash *)SELF.get_pointer();
+ void * const keystr = hash_key_from_pmc(INTERP, hash, key);
+ PMC * const nextkey = key_next(INTERP, key);
PMC *box;
-
- if (!key)
- return;
-
- keystr = make_hash_key(INTERP, key);
- nextkey = key_next(INTERP, key);
+ HashBucket *b;
if (!nextkey) {
- parrot_hash_put(INTERP, (Hash *)SELF.get_pointer(), keystr, value);
+ parrot_hash_put(INTERP, hash, keystr, value);
return;
}
- box = SELF.get_pmc_keyed_str(keystr);
-
- /* autovivify an Hash */
- if (!box)
+ b = parrot_hash_get_bucket(INTERP, hash, keystr);
+ if (b)
+ box = hash_value_to_pmc(INTERP, hash, b->value);
+ else {
+ /* autovivify an Hash */
box = pmc_new(INTERP, SELF.type());
+ parrot_hash_put(INTERP, hash, keystr,
+ hash_value_from_pmc(INTERP, hash, box));
+ }
+
VTABLE_set_pmc_keyed(INTERP, box, nextkey, value);
}
@@ -883,54 +1110,9 @@
*/
VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) {
- parrot_hash_put(INTERP, (Hash *)SELF.get_pointer(), key, value);
- }
-
-/*
-
-=item C<INTVAL is_equal(PMC *value)>
-
-The C<==> operation.
-
-Check if two hashes hold the same keys and values.
-
-=cut
-
-*/
-
- VTABLE INTVAL is_equal(PMC *value) {
- PMC * const iter = VTABLE_get_iter(INTERP, SELF);
- INTVAL j, n;
-
- if (value->vtable->base_type != SELF->vtable->base_type)
- return 0;
-
- n = SELF.elements();
-
- if (VTABLE_elements(INTERP, value) != n)
- return 0;
-
- for (j = 0; j < n; ++j) {
- STRING * const key = VTABLE_shift_string(INTERP, iter);
- PMC *item1, *item2;
- INTVAL result;
-
- if (!VTABLE_exists_keyed_str(INTERP, value, key))
- return 0;
-
- item1 = SELF.get_pmc_keyed_str(key);
- item2 = VTABLE_get_pmc_keyed_str(INTERP, value, key);
-
- if (item1 == item2)
- continue;
-
- Parrot_mmd_multi_dispatch_from_c_args(INTERP, "is_equal",
- "PP->I", item1, item2, &result);
- if (!result)
- return 0;
- }
-
- return 1;
+ Hash * const hash = (Hash *)SELF.get_pointer();
+ parrot_hash_put(INTERP, hash, hash_key_from_string(INTERP, hash, key),
+ hash_value_from_pmc(INTERP, hash, value));
}
/*
@@ -942,8 +1124,9 @@
*/
VTABLE INTVAL exists_keyed_str(STRING *key) {
- HashBucket * const b =
- parrot_hash_get_bucket(INTERP, (Hash *)SELF.get_pointer(), key);
+ Hash * const hash = (Hash *)SELF.get_pointer();
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
+ hash_key_from_string(INTERP, hash, key));
return b != NULL;
}
@@ -958,9 +1141,9 @@
*/
VTABLE INTVAL exists_keyed(PMC *key) {
- Hash * const h = (Hash *)SELF.get_pointer();
- STRING * const sx = make_ro_hash_key(INTERP, key);
- HashBucket *b = parrot_hash_get_bucket(INTERP, h, sx);
+ Hash * const h = (Hash *)SELF.get_pointer();
+ void * const sx = hash_key_from_pmc(INTERP, h, key);
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, h, sx);
/* no such key */
if (!b)
@@ -972,7 +1155,7 @@
if (!key)
return 1;
- return VTABLE_exists_keyed(INTERP, (PMC *)b->value, key);
+ return VTABLE_exists_keyed(INTERP, hash_value_to_pmc(INTERP, h, b->value), key);
}
/*
@@ -984,14 +1167,15 @@
*/
VTABLE INTVAL defined_keyed_str(STRING *key) {
- HashBucket * const b =
- parrot_hash_get_bucket(INTERP, (Hash *)SELF.get_pointer(), key);
+ const Hash * const hash = (Hash *)SELF.get_pointer();
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
+ hash_key_from_string(INTERP, hash, key));
/* no such key */
if (!b)
return 0;
- return VTABLE_defined(INTERP, (PMC*)b->value);
+ return VTABLE_defined(INTERP, hash_value_to_pmc(INTERP, hash, b->value));
}
/*
@@ -1005,9 +1189,9 @@
*/
VTABLE INTVAL defined_keyed(PMC *key) {
- Hash * const h = (Hash *)SELF.get_pointer();
- STRING * const sx = make_ro_hash_key(INTERP, key);
- HashBucket *b = parrot_hash_get_bucket(INTERP, h, sx);
+ Hash * const h = (Hash *)SELF.get_pointer();
+ void * const sx = hash_key_from_pmc(INTERP, h, key);
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, h, sx);
/* no such key */
if (!b)
@@ -1016,9 +1200,10 @@
key = key_next(INTERP, key);
if (!key)
- return VTABLE_defined(INTERP, (PMC *)b->value);
+ return VTABLE_defined(INTERP, hash_value_to_pmc(INTERP, h, b->value));
else
- return VTABLE_defined_keyed(INTERP, (PMC *)b->value, key);
+ return VTABLE_defined_keyed(INTERP,
+ hash_value_to_pmc(INTERP, h, b->value), key);
}
/*
@@ -1030,7 +1215,8 @@
*/
VTABLE void delete_keyed_str(STRING *key) {
- parrot_hash_delete(INTERP, (Hash *)SELF.get_pointer(), key);
+ Hash * const hash = (Hash *)SELF.get_pointer();
+ parrot_hash_delete(INTERP, hash, hash_key_from_string(INTERP, hash, key));
}
/*
@@ -1044,9 +1230,9 @@
*/
VTABLE void delete_keyed(PMC *key) {
- Hash * const h = (Hash *)SELF.get_pointer();
- STRING * const sx = make_ro_hash_key(INTERP, key);
- HashBucket *b = parrot_hash_get_bucket(INTERP, h, sx);
+ Hash * const h = (Hash *)SELF.get_pointer();
+ void * const sx = hash_key_from_pmc(INTERP, h, key);
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, h, sx);
/* no such key */
if (!b)
@@ -1062,6 +1248,110 @@
/*
+=item C<INTVAL get_bool()>
+
+Returns true if the hash size is not zero.
+
+=cut
+
+*/
+
+ VTABLE INTVAL get_bool() {
+ return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer()) != 0;
+ }
+
+/*
+
+=item C<INTVAL elements()>
+
+Returns the number of elements in the hash.
+
+=cut
+
+*/
+
+ VTABLE INTVAL elements() {
+ return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer());
+ }
+
+/*
+
+=item C<PMC *get_iter()>
+
+Return a new iterator for the slice PMC C<key>
+
+=cut
+
+*/
+
+ VTABLE PMC *get_iter() {
+ return pmc_new_init(INTERP, enum_class_HashIterator, SELF);
+ }
+
+/*
+
+=item C<INTVAL is_same(const PMC *other)>
+
+Returns whether the hash is the same as C<*other>.
+
+=cut
+
+*/
+
+ VTABLE INTVAL is_same(PMC *other) {
+ return (INTVAL)(other->vtable == SELF->vtable &&
+ VTABLE_get_pointer(INTERP, other) == SELF.get_pointer());
+ }
+
+/*
+
+=item C<INTVAL is_equal(PMC *value)>
+
+The C<==> operation.
+
+Check if two hashes hold the same keys and values.
+
+=cut
+
+*/
+
+ VTABLE INTVAL is_equal(PMC *value) {
+ PMC * const iter = VTABLE_get_iter(INTERP, SELF);
+ INTVAL j, n;
+
+ if (value->vtable->base_type != SELF->vtable->base_type)
+ return 0;
+
+ n = SELF.elements();
+
+ if (VTABLE_elements(INTERP, value) != n)
+ return 0;
+
+ for (j = 0; j < n; ++j) {
+ STRING * const key = VTABLE_shift_string(INTERP, iter);
+ PMC *item1, *item2;
+ INTVAL result;
+
+ if (!VTABLE_exists_keyed_str(INTERP, value, key))
+ return 0;
+
+ item1 = SELF.get_pmc_keyed_str(key);
+ item2 = VTABLE_get_pmc_keyed_str(INTERP, value, key);
+
+ if (item1 == item2)
+ continue;
+
+ Parrot_mmd_multi_dispatch_from_c_args(INTERP, "is_equal",
+ "PP->I", item1, item2, &result);
+ if (!result)
+ return 0;
+ }
+
+ return 1;
+ }
+
+/*
+
=item C<PMC *slice(PMC *key)>
Return a new iterator for the slice PMC C<key>
@@ -1072,9 +1362,7 @@
VTABLE PMC *slice(PMC *key, INTVAL f) {
if (f == 0) {
- PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
- PARROT_ITERATOR(iter)->key = key;
- return iter;
+ return SELF.get_iter();
}
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
@@ -1110,7 +1398,7 @@
VTABLE void freeze(visit_info *info) {
IMAGE_IO * const io = info->image_io;
- Hash * const hash = (Hash *)SELF.get_pointer();;
+ Hash * const hash = (Hash *)SELF.get_pointer();;
SUPER(info);
VTABLE_push_integer(INTERP, io, VTABLE_elements(INTERP, SELF));
Copied: branches/pluggable_runcore/src/pmc/hashiterator.pmc (from r40540, trunk/src/pmc/hashiterator.pmc)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/src/pmc/hashiterator.pmc Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/src/pmc/hashiterator.pmc)
@@ -0,0 +1,284 @@
+/*
+Copyright (C) 2001-2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/pmc/hashiterator.pmc - Implementation of Iterator for Hashes.
+
+=head1 DESCRIPTION
+
+Generic iterator for traversing Hash.
+
+=head1 SYNOPSIS
+
+=head2 default usage
+
+ .local pmc iterator, hash, key, entry
+ iterator = iter hash
+ iter_loop:
+ unless iterator, iter_end # while (more values)
+ key = shift iterator # get the key. Some key
+ entry = hash[key]
+ ...
+ goto iter_loop
+ iter_end:
+
+=head2 C++-style usage
+
+ .local pmc iterator, hash, iter_key, key, entry
+ iterator = iter hash
+ iter_loop:
+ unless iterator, iter_end # while (more values)
+ iter_key = shift iterator # get the key
+ key = iter_key.'key'() # get an original key used to put value
+ key = iter_key.'value'() # get an entry
+ ...
+ goto iter_loop
+ iter_end:
+
+
+=head1 Methods
+
+=over 4
+
+=cut
+
+*/
+
+#include "pmc_hash.h"
+#include "pmc_hashiteratorkey.h"
+
+/*
+
+Advance to next position. Return found (if any) HashBucket.
+
+*/
+static HashBucket*
+advance_to_next(PARROT_INTERP, PMC *self) {
+ Parrot_HashIterator_attributes * const attrs = PARROT_HASHITERATOR(self);
+ HashBucket *bucket = attrs->bucket;
+
+ /* Try to advance current bucket */
+ if (bucket)
+ bucket = bucket->next;
+
+ while (!bucket) {
+ /* If there is no more buckets */
+ if (attrs->pos == attrs->total_buckets)
+ break;
+
+ bucket = attrs->parrot_hash->bi[attrs->pos++];
+ }
+ attrs->bucket = bucket;
+ attrs->elements--;
+ return bucket;
+}
+
+pmclass HashIterator extends Iterator no_ro {
+ ATTR PMC *pmc_hash; /* the Hash which this Iterator iterates */
+ ATTR Hash *parrot_hash; /* Underlying implementation of hash */
+ ATTR HashBucket *bucket; /* Current bucket */
+ ATTR INTVAL total_buckets; /* Total buckets in index */
+ ATTR INTVAL pos; /* Current position in index */
+ ATTR INTVAL elements; /* How many elements left to iterate over */
+
+/*
+
+=item C<void init_pmc(PMC *initializer)>
+
+Initializes the iterator with an aggregate PMC.
+Defaults iteration mode to iterate from start.
+
+=cut
+
+*/
+
+ VTABLE void init_pmc(PMC *hash) {
+ Parrot_HashIterator_attributes * const attrs =
+ mem_allocate_zeroed_typed(Parrot_HashIterator_attributes);
+
+ attrs->pmc_hash = hash;
+ attrs->parrot_hash = (Hash*)VTABLE_get_pointer(INTERP, hash);
+ attrs->total_buckets = attrs->parrot_hash->mask + 1;
+ attrs->bucket = 0;
+ attrs->pos = 0;
+ /* Will be decreased on initial advance_to_next */
+ /* XXX Do we really need to support this use-case ? */
+ attrs->elements = attrs->parrot_hash->entries + 1;
+ PMC_data(SELF) = attrs;
+
+ PObj_custom_mark_destroy_SETALL(SELF);
+
+ /* Initial state of iterator is "before start" */
+ /* So, advance to first element */
+ advance_to_next(INTERP, SELF);
+ }
+
+/*
+
+=item C<void destroy()>
+
+destroys this PMC
+
+=cut
+
+*/
+
+ VTABLE void destroy() {
+ mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
+ }
+
+/*
+
+=item C<void mark()>
+
+Marks the hash as live.
+
+=cut
+
+*/
+
+ VTABLE void mark() {
+ PMC *hash = PARROT_HASHITERATOR(SELF)->pmc_hash;
+ if (hash)
+ Parrot_gc_mark_PObj_alive(INTERP, (PObj *)hash);
+ /* We don't mark underlying parrot_hash. Hash PMC will mark it */
+ }
+
+/*
+
+=item C<PMC *clone()>
+
+=cut
+
+*/
+ VTABLE PMC* clone() {
+ return PMCNULL;
+ }
+
+/*
+
+=item C<void set_integer_native()>
+
+=cut
+
+*/
+ VTABLE void set_integer_native(INTVAL value) {
+ Parrot_HashIterator_attributes * const attrs =
+ PARROT_HASHITERATOR(SELF);
+
+ if (value == 0) {
+ /* Restart iterator */
+ attrs->bucket = 0;
+ attrs->pos = 0;
+ advance_to_next(INTERP, SELF);
+ return;
+ }
+
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ "HashIterator: unknown iterator type");
+ };
+
+/*
+
+=item C<PMC *get_pmc()>
+
+Returns this Iterator's Hash.
+
+=cut
+*/
+ VTABLE PMC* get_pmc() {
+ return PARROT_HASHITERATOR(SELF)->pmc_hash;
+ }
+
+/*
+
+=item C<INTVAL get_bool()>
+
+Returns true if there is more elements to iterate over.
+
+=cut
+
+*/
+
+ VTABLE INTVAL get_bool() {
+ return PARROT_HASHITERATOR(SELF)->bucket != 0;
+ }
+
+/*
+
+=item C<INTVAL elements()>
+
+Returns the number of remaining elements in the Hash.
+
+=cut
+
+*/
+
+ VTABLE INTVAL elements() {
+ return PARROT_HASHITERATOR(SELF)->elements;
+ }
+
+ VTABLE INTVAL get_integer() {
+ return SELF.elements();
+ }
+
+/*
+
+=item C<PMC *shift_pmc()>
+
+Returns the HashIteratorKey for the current position and advance
+the next one.
+
+=cut
+
+*/
+
+ VTABLE PMC *shift_pmc() {
+ Parrot_HashIterator_attributes * const attrs =
+ PARROT_HASHITERATOR(SELF);
+
+ PMC *ret;
+
+ if (!attrs->bucket)
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ ret = pmc_new(INTERP, enum_class_HashIteratorKey);
+ /* Poke directly into HIK. We don't want to create any kind of public API for this */
+ PARROT_HASHITERATORKEY(ret)->parrot_hash = attrs->parrot_hash;
+ PARROT_HASHITERATORKEY(ret)->bucket = attrs->bucket;
+
+ /* Move to next bucket */
+ advance_to_next(INTERP, SELF);
+
+ return ret;
+ }
+
+/*
+
+*/
+
+ VTABLE STRING* shift_string() {
+ PMC * const key = SELF.shift_pmc();
+ return VTABLE_get_string(INTERP, key);
+ }
+
+}
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Copied: branches/pluggable_runcore/src/pmc/hashiteratorkey.pmc (from r40540, trunk/src/pmc/hashiteratorkey.pmc)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/src/pmc/hashiteratorkey.pmc Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/src/pmc/hashiteratorkey.pmc)
@@ -0,0 +1,119 @@
+/*
+Copyright (C) 2001-2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/pmc/hashiteratorkey.pmc - accessor for single value during hash iteration.
+
+=head1 DESCRIPTION
+
+Single (key,value) pair.
+
+
+=head1 Methods
+
+=over 4
+
+=cut
+
+*/
+
+pmclass HashIteratorKey no_ro {
+ ATTR Hash *parrot_hash; /* Underlying parrot's hash */
+ ATTR HashBucket *bucket; /* Current bucket from HashItertor */
+
+/*
+
+=item C<void init()>
+
+Initializes the PMC.
+
+Not really part of public API.
+
+=cut
+
+*/
+
+ VTABLE void init() {
+ Parrot_HashIteratorKey_attributes *attrs =
+ mem_allocate_zeroed_typed(Parrot_HashIteratorKey_attributes);
+
+ PMC_data(SELF) = attrs;
+
+ PObj_active_destroy_SET(SELF);
+ }
+
+/*
+
+=item C<void destroy()>
+
+Destroys this PMC
+
+=cut
+
+*/
+
+ VTABLE void destroy() {
+ mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
+ }
+
+/*
+
+=item C<get_pmc()>
+
+Get "key".
+
+=cut
+
+*/
+ VTABLE PMC* get_pmc() {
+ return PMCNULL;
+ }
+
+ VTABLE INTVAL get_integer() {
+ return -1;
+ }
+
+ VTABLE STRING* get_string() {
+ Parrot_HashIteratorKey_attributes *attrs =
+ PARROT_HASHITERATORKEY(SELF);
+
+ switch (attrs->parrot_hash->key_type) {
+ case Hash_key_type_int:
+ return Parrot_str_from_int(INTERP, (INTVAL)attrs->bucket->key);
+
+ case Hash_key_type_STRING:
+ return (STRING*)attrs->bucket->key;
+
+ case Hash_key_type_PMC:
+ return VTABLE_get_string(INTERP, (PMC *)attrs->bucket->key);
+
+ default:
+ /* Horribly die? */
+ break;
+ }
+
+ return NULL;
+ }
+
+
+
+}
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+
Modified: branches/pluggable_runcore/src/pmc/iterator.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/iterator.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/iterator.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -17,7 +17,7 @@
=head2 default usage
.local pmc iterator, array, entry
- iterator = new 'Iterator', array
+ iterator = iter array
iter_loop:
unless iterator, iter_end # while (more values)
entry = shift iterator # get an entry
@@ -25,14 +25,10 @@
goto iter_loop
iter_end:
-The C<new> can alternatively be written as:
-
- iterator = iter array
-
=head2 iterate from the end, for arrays
.local pmc iterator, array, entry
- iterator = new 'Iterator', array
+ iterator = iter array
iterator = .ITERATE_FROM_END
iter_loop:
unless iterator, iter_end # while (more values)
@@ -44,7 +40,7 @@
=head2 iterate over a hash
.local pmc iterator, hash, key, entry
- iterator = new 'Iterator', hash
+ iterator = iter hash
iter_loop:
unless iterator, iter_end # while (more values)
key = shift iterator # get the key..
@@ -62,17 +58,6 @@
*/
pmclass Iterator no_ro {
- ATTR PMC *aggregate; /* the aggregate which this Iterator iterates */
- ATTR PMC *key; /* the Key used by this Iterator */
-
- void class_init() {
- if (pass) {
- /* Make the shift_pmc vtable function available as
- * a method named "next" */
- register_nci_method(INTERP, enum_class_Iterator,
- F2DPTR(Parrot_Iterator_shift_pmc), "next", "PJO");
- }
- }
/*
@@ -101,107 +86,10 @@
*/
VTABLE void init_pmc(PMC *aggregate) {
- Parrot_Iterator_attributes *attrs =
- mem_allocate_zeroed_typed(Parrot_Iterator_attributes);
-
- attrs->aggregate = aggregate;
- attrs->key = PMCNULL;
- PMC_data(SELF) = attrs;
-
- PObj_custom_mark_destroy_SETALL(SELF);
-
- /* by default, iterate from start */
- SELF.set_integer_native(ITERATE_FROM_START);
- }
-
-/*
-
-=item C<void destroy()>
-
-destroys this PMC
-
-=cut
-
-*/
-
- VTABLE void destroy() {
- mem_sys_free(PMC_data(SELF));
- }
-
-/*
-
-=item C<void mark()>
-
-Marks the current idx/key and the aggregate as live.
-
-=cut
-
-*/
-
- VTABLE void mark() {
- /* the Key */
- PMC *key;
- GET_ATTR_key(INTERP, SELF, key);
- if (key)
- Parrot_gc_mark_PObj_alive(INTERP, (PObj *)key);
-
- /* the aggregate */
- if (SELF.get_pmc() != PMCNULL)
- Parrot_gc_mark_PObj_alive(INTERP, (PObj *)SELF.get_pmc());
- }
-
-/*
-
-=item C<PMC *clone()>
-
-Make a clone of the iterator.
-
-=cut
-
-*/
-
- VTABLE PMC *clone() {
- PMC *key;
- STRING * const name = CONST_STRING(interp, "set_key");
- PMC * const res = pmc_new_init(INTERP, SELF->vtable->base_type,
- SELF.get_pmc());
-
- GET_ATTR_key(INTERP, SELF, key);
-
- Parrot_PCCINVOKE(interp, res, name, "P->", VTABLE_clone(interp, key));
- return res;
- }
-
-/*
-
-=item C<INTVAL get_integer()>
-
-Get number of remaining elements. Does not work for hashes yet.
-TODO: keep track of current position and direction
-
-=cut
-
-*/
-
- VTABLE INTVAL get_integer() {
- return SELF.elements();
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ "Direct creation of Iterator");
}
-/*
-
-=item C<STRING *get_string()>
-
-Returns a textual representation of the iterator.
-
-=cut
-
-*/
-
- VTABLE STRING *get_string() {
- PMC *key;
- GET_ATTR_key(INTERP, SELF, key);
- return Parrot_str_from_int(INTERP, VTABLE_get_integer(INTERP, key));
- }
/*
@@ -217,25 +105,6 @@
/*
-=item C<INTVAL get_integer_keyed_int(INTVAL idx)>
-
-Get integer value of current position plus idx.
-
-=cut
-
-*/
-
- VTABLE INTVAL get_integer_keyed_int(INTVAL idx) {
- PMC * const agg = SELF.get_pmc();
- PMC *key;
-
- GET_ATTR_key(INTERP, SELF, key);
- return VTABLE_get_integer_keyed_int(INTERP, agg,
- VTABLE_get_integer(INTERP, key) +idx);
- }
-
-/*
-
=item C<FLOATVAL get_number_keyed(PMC *key)>
=cut
@@ -246,26 +115,6 @@
return VTABLE_get_number_keyed(INTERP, SELF.get_pmc(), key);
}
-/*
-
-=item C<FLOATVAL get_number_keyed_int(INTVAL idx)>
-
-Get number value of current position plus idx.
-
-=cut
-
-*/
-
- VTABLE FLOATVAL get_number_keyed_int(INTVAL idx) {
- PMC * const agg = SELF.get_pmc();
- PMC *key;
-
- GET_ATTR_key(INTERP, SELF, key);
- return VTABLE_get_number_keyed_int(INTERP, agg,
- VTABLE_get_integer(INTERP, key) + idx);
- }
-
-
/*
@@ -280,72 +129,6 @@
}
/*
-
-=item C<STRING *get_string_keyed_int(INTVAL idx)>
-
-Get string value of current position plus idx.
-
-=cut
-
-*/
-
- VTABLE STRING *get_string_keyed_int(INTVAL idx) {
- PMC * const agg = SELF.get_pmc();
- PMC *key;
-
- GET_ATTR_key(INTERP, SELF, key);
- return VTABLE_get_string_keyed_int(INTERP, agg,
- VTABLE_get_integer(INTERP, key) + idx);
- }
-
-/*
-
-=item C<INTVAL get_bool()>
-
-Returns true if the idx/key is not C<-1>.
-
-=cut
-
-*/
-
- VTABLE INTVAL get_bool() {
- PMC *key;
- GET_ATTR_key(INTERP, SELF, key);
- return !PMC_is_null(INTERP, key) &&
- VTABLE_get_integer(INTERP, key) != -1;
- }
-
-/*
-
-=item C<INTVAL elements()>
-
-Returns the number of remaining elements in the aggregate. TODO.
-
-=cut
-
-*/
-
- VTABLE INTVAL elements() {
- return VTABLE_elements(INTERP, SELF.get_pmc());
- }
-
-/*
-
-=item C<PMC *get_pmc()>
-
-Returns this Iterator's aggregate.
-
-=cut
-
-*/
-
- VTABLE PMC *get_pmc() {
- PMC *agg;
- GET_ATTR_aggregate(INTERP, SELF, agg);
- return agg ? agg : PMCNULL;
- }
-
-/*
=item C<PMC *get_pmc_keyed(PMC *key)>
Returns the element for C<*key>.
@@ -360,292 +143,6 @@
/*
-=item C<PMC *get_pmc_keyed_int(INTVAL key)>
-
-Returns the element for C<key>.
-
-=cut
-
-*/
-
- VTABLE PMC *get_pmc_keyed_int(INTVAL idx) {
- PMC * const agg = SELF.get_pmc();
- PMC *key;
-
- GET_ATTR_key(INTERP, SELF, key);
- return VTABLE_get_pmc_keyed_int(INTERP, agg,
- VTABLE_get_integer(INTERP, key) + idx);
- }
-
-/*
-
-=item C<void set_integer_native(INTVAL value)>
-
-Reset the Iterator. C<value> must be one of
-
- ITERATE_FROM_START ... Iterate from start
- ITERATE_FROM_START_KEYS ... OrderedHash by keys
- ITERATE_FROM_END ... Arrays only
-
-=cut
-
-*/
-
- VTABLE void set_integer_native(INTVAL value) {
- PMC *agg;
- PMC *key;
- if (value < ITERATE_FROM_START || value > ITERATE_FROM_END)
- Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
- "Illegal set_integer on iterator");
-
- /* reset iterator on aggregate */
- agg = SELF.get_pmc();
-
- GET_ATTR_key(INTERP, SELF, key);
- if (PMC_is_null(INTERP, key))
- key = key_new(INTERP);
-
- SET_ATTR_key(INTERP, SELF,
- VTABLE_nextkey_keyed(INTERP, key, agg, value));
- }
-
-/*
-
-=item C<INTVAL pop_integer()>
-
-=cut
-
-*/
-
- VTABLE INTVAL pop_integer() {
- PMC * const agg = SELF.get_pmc();
- PMC *key;
- INTVAL ret;
-
- GET_ATTR_key(INTERP, SELF, key);
- ret = VTABLE_get_integer_keyed(INTERP, agg, key);
- SET_ATTR_key(INTERP, SELF,
- VTABLE_nextkey_keyed(INTERP, key, agg, ITERATE_GET_PREV));
-
- return ret;
- }
-
-/*
-
-=item C<FLOATVAL pop_float()>
-
-=cut
-
-*/
-
- VTABLE FLOATVAL pop_float() {
- PMC * const agg = SELF.get_pmc();
- PMC *key;
- FLOATVAL ret;
-
- GET_ATTR_key(INTERP, SELF, key);
- ret = VTABLE_get_number_keyed(INTERP, agg, key);
- SET_ATTR_key(INTERP, SELF,
- VTABLE_nextkey_keyed(INTERP, key, agg, ITERATE_GET_PREV));
-
- return ret;
- }
-
-/*
-
-=item C<STRING *pop_string()>
-
-=cut
-
-*/
-
- VTABLE STRING *pop_string() {
- STRING *ret;
- PMC *key;
- PMC * const agg = SELF.get_pmc();
-
- GET_ATTR_key(INTERP, SELF, key);
- ret = VTABLE_get_string_keyed(INTERP, agg, key);
- SET_ATTR_key(INTERP, SELF,
- VTABLE_nextkey_keyed(INTERP, key, agg, ITERATE_GET_PREV));
-
- return ret;
- }
-
-/*
-
-=item C<PMC *pop_pmc()>
-
-Returns the element for the current idx/key and sets the idx/key to
-the previous one.
-
-=cut
-
-*/
-
- VTABLE PMC *pop_pmc() {
- PMC * const agg = SELF.get_pmc();
- PMC *key;
- PMC *ret;
-
- GET_ATTR_key(INTERP, SELF, key);
- ret = VTABLE_get_pmc_keyed(INTERP, agg, key);
- SET_ATTR_key(INTERP, SELF,
- VTABLE_nextkey_keyed(INTERP, key, agg, ITERATE_GET_PREV));
-
- return ret;
- }
-
-/*
-
-=item C<INTVAL shift_integer()>
-
-Returns the element for the current idx/key and sets the idx/key to
-the next one.
-
-=cut
-
-*/
-
- VTABLE INTVAL shift_integer() {
- INTVAL ret;
- PMC *key;
- PMC * const agg = SELF.get_pmc();
-
- GET_ATTR_key(INTERP, SELF, key);
- ret = VTABLE_get_integer_keyed(INTERP, agg, key);
- SET_ATTR_key(INTERP, SELF,
- VTABLE_nextkey_keyed(INTERP, key, agg, ITERATE_GET_NEXT));
-
- return ret;
- }
-
-/*
-
-=item C<opcode_t *invoke(void *next)>
-
-Return the next element of the aggregate. The return type may depend on
-the aggregate. If there are no more items in the aggregate, I1 .. I4 are
-zero.
-
-See F<docs/pdds/pdd03_calling_conventions.pod>.
-
-=cut
-
-*/
- VTABLE opcode_t *invoke(void *next) {
- PMC *agg;
-
- /* iterator constructor */
- if (REG_INT(interp, 3) == 1) {
- PMC * const arg = REG_PMC(interp, 5);
- PMC *iter;
-
- if (PObj_is_object_TEST(arg)) {
- REG_PMC(interp, 5) = VTABLE_get_iter(INTERP, arg);
- return (opcode_t *)next;
- }
-
- REG_PMC(interp, 5) = iter = pmc_new_init(INTERP,
- enum_class_Iterator, arg);
- VTABLE_set_integer_native(INTERP, iter, 0);
- return (opcode_t *)next;
- }
- /* TODO function + sentinel */
- else if (REG_INT(interp, 3) == 2)
- Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
- "Iterator: invoke 2 args");
-
- REG_INT(interp, 1) =
- REG_INT(interp, 2) =
- REG_INT(interp, 3) =
- REG_INT(interp, 4) = 0;
-
- agg = SELF.get_pmc();
-
- {
- PMC * const res = SELF.shift_pmc();
- REG_INT(interp, 3) = 1;
- REG_PMC(interp, 5) = res;
- return (opcode_t *)next;
- }
- }
-
-/*
-
-=item C<FLOATVAL shift_float()>
-
-=cut
-
-*/
-
- VTABLE FLOATVAL shift_float() {
- PMC *key;
- PMC * const agg = SELF.get_pmc();
- FLOATVAL ret;
-
- GET_ATTR_key(INTERP, SELF, key);
- ret = VTABLE_get_number_keyed(INTERP, agg, key);
- SET_ATTR_key(INTERP, SELF,
- VTABLE_nextkey_keyed(INTERP, key, agg, ITERATE_GET_NEXT));
-
- return ret;
- }
-
-
-/*
-
-=item C<STRING *shift_string()>
-
-=cut
-
-*/
-
- VTABLE STRING *shift_string() {
- PMC *key;
- PMC * const agg = SELF.get_pmc();
- STRING *ret;
-
- GET_ATTR_key(INTERP, SELF, key);
- ret = VTABLE_get_string_keyed(INTERP, agg, key);
- SET_ATTR_key(INTERP, SELF,
- VTABLE_nextkey_keyed(INTERP, key, agg, ITERATE_GET_NEXT));
-
- return ret;
- }
-
-/*
-
-=item C<PMC *shift_pmc()>
-
-Returns the element for the current idx/key and sets the idx/key to
-the next one.
-
-=cut
-
-*/
-
- VTABLE PMC *shift_pmc() {
- PMC * const agg = SELF.get_pmc();
- PMC *ret;
- PMC *key;
-
- GET_ATTR_key(INTERP, SELF, key);
-
- if (VTABLE_get_integer(INTERP, key) == -1)
- Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
- "StopIteration");
-
- ret = VTABLE_get_pmc_keyed(INTERP, agg, key);
-
- SET_ATTR_key(INTERP, SELF,
- VTABLE_nextkey_keyed(INTERP, key, agg, ITERATE_GET_NEXT));
-
- return ret;
- }
-
-/*
-
=item C<INTVAL exists_keyed(PMC *key)>
Returns whether an element for C<*key> exists in the aggregate.
@@ -660,24 +157,6 @@
/*
-=item C<INTVAL exists_keyed_int(INTVAL idx)>
-
-Returns whether an element for C<idx> exists in the aggregate.
-
-=cut
-
-*/
-
- VTABLE INTVAL exists_keyed_int(INTVAL idx) {
- PMC * const agg = SELF.get_pmc();
- PMC *key;
- GET_ATTR_key(INTERP, SELF, key);
- return VTABLE_exists_keyed_int(INTERP, agg,
- VTABLE_get_integer(INTERP, key) + idx);
- }
-
-/*
-
=item C<INTVAL defined()>
Returns whether the iterator contains an aggregate.
@@ -702,39 +181,34 @@
return VTABLE_defined_keyed(INTERP, SELF.get_pmc(), key);
}
-/*
-=item C<INTVAL defined_keyed_int(INTVAL key)>
+ VTABLE PMC *get_iter() {
+ return SELF;
+ }
-Returns the result of calling C<defined_keyed(key)> on the aggregate.
+ /* Make the shift_pmc vtable function available as
+ * a method named "next" */
+ METHOD next() {
+ PMC * const next = VTABLE_shift_pmc(INTERP, SELF);
+ RETURN(PMC* next);
+ }
-=cut
-
-*/
+/*
- VTABLE INTVAL defined_keyed_int(INTVAL idx) {
- PMC * const agg = SELF.get_pmc();
- PMC *key;
+=item C<void set_integer_native(INTVAL value)>
- GET_ATTR_key(INTERP, SELF, key);
- return VTABLE_defined_keyed_int(INTERP, agg,
- VTABLE_get_integer(INTERP, key) + idx);
- }
+Restart iterator
- VTABLE PMC *get_iter() {
- return SELF;
- }
+=cut
- METHOD set_key(PMC *key) {
- SET_ATTR_key(INTERP, SELF, key);
- }
+*/
+ VTABLE void set_integer_native(INTVAL value) {
+ PMC *self = SELF;
+ PARROT_ASSERT(!"Iterator: implementation have to override this method");
- METHOD get_key() {
- PMC *key;
- GET_ATTR_key(INTERP, SELF, key);
- RETURN(PMC *key);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_UNIMPLEMENTED,
+ "Iterator: unimplemented method");
}
-
}
/*
Modified: branches/pluggable_runcore/src/pmc/key.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/key.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/key.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -59,6 +59,7 @@
*/
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
@@ -306,95 +307,6 @@
/*
-=item C<PMC *nextkey_keyed(PMC *key, INTVAL what)>
-
-Returns the next key relative to the location specified in C<what>.
-int_key == -1 means end of iteration.
-
-=cut
-
-*/
-
- VTABLE PMC *nextkey_keyed(PMC *agg, INTVAL what) {
- PMC * const ret = SELF;
- const INTVAL n = VTABLE_elements(INTERP, agg);
- INTVAL int_key;
-
- switch (what) {
- case ITERATE_FROM_START_KEYS:
- /*
- * OrderedHash supports two iterators: by key
- * or by ordered values
- */
- PObj_get_FLAGS(ret) &= ~KEY_type_FLAGS;
- PObj_get_FLAGS(ret) |= KEY_integer_FLAG;
-
- if (agg->vtable->base_type == enum_class_OrderedHash)
- PObj_get_FLAGS(ret) |= KEY_number_FLAG;
-
- goto init;
- case ITERATE_FROM_START: /* reset key */
- PObj_get_FLAGS(ret) &= ~KEY_type_FLAGS;
- PObj_get_FLAGS(ret) |= KEY_integer_FLAG;
-
- /*
- * KEY_hash_iterator_FLAGS, which is the same as
- * KEY_integer_FLAG | KEY_number_FLAG
- * indicates a hash iterator operation
- * KEY_integer_FLAG alone is an indexed hash lookup
- * with an Integer KEY
- */
-
- if (VTABLE_isa(INTERP, agg, CONST_STRING(interp, "Hash"))
- && agg->vtable->base_type != enum_class_OrderedHash)
- PObj_get_FLAGS(ret) |= KEY_hash_iterator_FLAGS;
- init:
- if (!n) {
- SET_ATTR_int_key(INTERP, ret, -1);
- }
- else {
- SET_ATTR_int_key(INTERP, ret, 0);
- }
-
- /* iterating over a hash additionally needs the Bucket index */
- if (KEY_IS_HASH_ITERATOR(ret))
- SET_ATTR_next_key(INTERP, ret, (PMC *)INITBucketIndex);
-
- break;
- case ITERATE_GET_NEXT:
- /*
- * src/hash.c:parrot_hash_get_idx() advances to next
- * so, if we are iterating over a hash do nothing
- * */
- if (!KEY_IS_HASH_ITERATOR(ret)) {
- GET_ATTR_int_key(INTERP, ret, int_key);
- if (int_key < n - 1) {
- SET_ATTR_int_key(INTERP, ret, int_key+1);
- }
- else {
- SET_ATTR_int_key(INTERP, ret, -1);
- }
- }
- break;
- case ITERATE_GET_PREV:
- GET_ATTR_int_key(INTERP, ret, int_key);
- if (int_key >= 0)
- SET_ATTR_int_key(INTERP, ret, int_key-1);
- break;
- case ITERATE_FROM_END:
- PObj_get_FLAGS(ret) &= ~KEY_type_FLAGS;
- PObj_get_FLAGS(ret) |= KEY_integer_FLAG;
- SET_ATTR_int_key(INTERP, ret, n-1);
- break;
- default:
- Parrot_ex_throw_from_c_args(interp, NULL,
- EXCEPTION_INVALID_OPERATION,
- "Unknown iterator type in Key.nextkey_keyed: %d", what);
- }
- return ret;
- }
-/*
-
=item C<void visit(visit_info *info)>
This is used by freeze/thaw to visit the contents of the Key.
Modified: branches/pluggable_runcore/src/pmc/lexpad.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/lexpad.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/lexpad.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -89,6 +89,7 @@
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
VTABLE void set_pointer(void *ctx) {
Modified: branches/pluggable_runcore/src/pmc/managedstruct.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/managedstruct.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/managedstruct.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -92,6 +92,7 @@
mem_sys_free(ptr);
}
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/pmc/namespace.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/namespace.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/namespace.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -396,7 +396,8 @@
}
VTABLE PMC *get_pmc_keyed(PMC *key) {
- PMC *ns = SUPER(key);
+ /* PMC *ns = SUPER(key); */
+ PMC *ns = INTERP->vtables[enum_class_Hash]->get_pmc_keyed(INTERP, SELF, key);
if (!PMC_IS_NULL(ns))
return ns;
Modified: branches/pluggable_runcore/src/pmc/null.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/null.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/null.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -19,6 +19,15 @@
*/
+PARROT_DOES_NOT_RETURN
+static void
+null_pmc_access(PARROT_INTERP, int index)
+{
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NULL_REG_ACCESS,
+ "Null PMC access in %s()",
+ Parrot_get_vtable_name(interp, index));
+}
+
pmclass Null singleton {
/*
Modified: branches/pluggable_runcore/src/pmc/object.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/object.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/object.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -153,6 +153,7 @@
*/
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
@@ -646,7 +647,6 @@
Parrot_Object_attributes * const obj = PARROT_OBJECT(pmc);
Parrot_Class_attributes * const _class = PARROT_CLASS(obj->_class);
STRING * const meth_name = CONST_STRING(interp, "clone");
- PMC * cloned;
/* See if we have a custom override of the method first. */
const int num_classes = VTABLE_elements(interp, _class->all_parents);
Modified: branches/pluggable_runcore/src/pmc/orderedhash.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/orderedhash.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/orderedhash.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -77,6 +77,20 @@
/*
+=item C<PMC *get_iter()>
+
+Return a new iterator
+
+=cut
+
+*/
+
+ VTABLE PMC *get_iter() {
+ return pmc_new_init(INTERP, enum_class_OrderedHashIterator, SELF);
+ }
+
+/*
+
=item C<PMC *get_pmc_keyed(PMC *key)>
=item C<PMC *get_pmc_keyed_int(INTVAL key)>
@@ -119,7 +133,7 @@
return VTABLE_get_pmc_keyed(INTERP, item, next);
}
- return SUPER(key);
+ return INTERP->vtables[enum_class_Hash]->get_pmc_keyed(INTERP, SELF, key);
}
/*
@@ -167,7 +181,7 @@
return VTABLE_get_string_keyed(INTERP, item, next);
}
- return SUPER(key);
+ return INTERP->vtables[enum_class_Hash]->get_string_keyed(INTERP, SELF, key);
}
/*
@@ -216,7 +230,7 @@
return VTABLE_get_integer_keyed(INTERP, item, next);
}
- return SUPER(key);
+ return INTERP->vtables[enum_class_Hash]->get_integer_keyed(INTERP, SELF, key);
}
/*
Copied: branches/pluggable_runcore/src/pmc/orderedhashiterator.pmc (from r40540, trunk/src/pmc/orderedhashiterator.pmc)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/src/pmc/orderedhashiterator.pmc Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/src/pmc/orderedhashiterator.pmc)
@@ -0,0 +1,266 @@
+/*
+Copyright (C) 2001-2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/pmc/orderedhashiterator.pmc - Implementation of Iterator for OrderedHash.
+
+=head1 DESCRIPTION
+
+=head1 SYNOPSIS
+
+=head1 Methods
+
+=over 4
+
+=cut
+
+*/
+
+#include "pmc_hash.h"
+#include "pmc_hashiteratorkey.h"
+
+pmclass OrderedHashIterator extends Iterator no_ro {
+ ATTR PMC *pmc_hash; /* the Hash which this Iterator iterates */
+ ATTR Hash *parrot_hash; /* Underlying implementation of hash */
+ ATTR INTVAL pos; /* */
+ ATTR INTVAL elements; /* How many elements left to iterate over */
+ ATTR INTVAL reverse; /* Direction of iteration. 1 - for reverse iteration */
+
+/*
+
+=item C<void init_pmc(PMC *initializer)>
+
+Initializes the iterator with an aggregate PMC.
+Defaults iteration mode to iterate from start.
+
+=cut
+
+*/
+
+ VTABLE void init_pmc(PMC *hash) {
+ Parrot_OrderedHashIterator_attributes * const attrs =
+ mem_allocate_zeroed_typed(Parrot_OrderedHashIterator_attributes);
+
+ attrs->pmc_hash = hash;
+ attrs->parrot_hash = (Hash*)VTABLE_get_pointer(INTERP, hash);
+ attrs->pos = 0;
+ /* Will be decreased on initial advance_to_next */
+ /* XXX Do we really need to support this use-case ? */
+ attrs->elements = attrs->parrot_hash->entries;
+ PMC_data(SELF) = attrs;
+
+ PObj_custom_mark_destroy_SETALL(SELF);
+ }
+
+/*
+
+=item C<void destroy()>
+
+destroys this PMC
+
+=cut
+
+*/
+
+ VTABLE void destroy() {
+ mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
+ }
+
+/*
+
+=item C<void mark()>
+
+Marks the hash as live.
+
+=cut
+
+*/
+
+ VTABLE void mark() {
+ PMC * const hash = PARROT_ORDEREDHASHITERATOR(SELF)->pmc_hash;
+ if (hash)
+ Parrot_gc_mark_PObj_alive(INTERP, (PObj *)hash);
+ }
+
+/*
+
+=item C<PMC *clone()>
+
+=cut
+
+*/
+ VTABLE PMC* clone() {
+ return PMCNULL;
+ }
+
+/*
+
+=item C<void set_integer_native()>
+
+=cut
+
+*/
+ VTABLE void set_integer_native(INTVAL value) {
+ Parrot_OrderedHashIterator_attributes * const attrs =
+ PARROT_ORDEREDHASHITERATOR(SELF);
+
+ /* Restart iterator */
+ attrs->elements = attrs->parrot_hash->entries;
+ if (value == ITERATE_FROM_START || value == ITERATE_FROM_START_KEYS) {
+ attrs->pos = 0;
+ attrs->reverse = 0;
+ return;
+ }
+ else if (value == ITERATE_FROM_END) {
+ attrs->pos = attrs->elements;
+ attrs->reverse = 1;
+ return;
+ }
+
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ "HashIterator: unknown iterator type");
+ };
+
+/*
+
+=item C<PMC *get_pmc()>
+
+Returns this Iterator's Hash.
+
+=cut
+*/
+ VTABLE PMC* get_pmc() {
+ return PARROT_ORDEREDHASHITERATOR(SELF)->pmc_hash;
+ }
+
+/*
+
+=item C<INTVAL get_bool()>
+
+Returns true if there is more elements to iterate over.
+
+=cut
+
+*/
+
+ VTABLE INTVAL get_bool() {
+ return STATICSELF.elements() > 0;
+ }
+
+/*
+
+=item C<INTVAL elements()>
+
+Returns the number of remaining elements in the Hash.
+
+=cut
+
+*/
+
+ VTABLE INTVAL elements() {
+ return PARROT_ORDEREDHASHITERATOR(SELF)->elements;
+ }
+
+ VTABLE INTVAL get_integer() {
+ return SELF.elements();
+ }
+
+/*
+
+=item C<PMC *shift_pmc()>
+
+Returns the HashIteratorKey for the current position and advance
+the next one.
+
+=cut
+
+*/
+
+ VTABLE PMC *shift_pmc() {
+ Parrot_OrderedHashIterator_attributes * const attrs =
+ PARROT_ORDEREDHASHITERATOR(SELF);
+
+ PMC *ret;
+ HashBucket *bucket;
+
+ if (!attrs->elements)
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ /* Get bucket and move to next bucket */
+ do {
+ bucket = attrs->parrot_hash->bs + attrs->pos++;
+ attrs->elements--;
+ } while (attrs->elements && !bucket->key);
+
+ /* Reuse HashIteratorKey */
+ ret = pmc_new(INTERP, enum_class_HashIteratorKey);
+ /* Poke directly into HIK. We don't want to create any kind of public API for this */
+ PARROT_HASHITERATORKEY(ret)->parrot_hash = attrs->parrot_hash;
+ PARROT_HASHITERATORKEY(ret)->bucket = bucket;
+
+ return ret;
+ }
+
+/*
+
+=item C<PMC *pop_pmc()>
+
+Returns the HashIteratorKey for the current position and advance
+the next one for reverse iterator.
+
+=cut
+
+*/
+
+ VTABLE PMC *pop_pmc() {
+ Parrot_OrderedHashIterator_attributes * const attrs =
+ PARROT_ORDEREDHASHITERATOR(SELF);
+
+ PMC *ret;
+ HashBucket *bucket;
+
+ if (!attrs->elements)
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ /* Get bucket and move to next bucket */
+ bucket = attrs->parrot_hash->bs + --attrs->pos;
+ attrs->elements--;
+
+ /* Reuse HashIteratorKey */
+ ret = pmc_new(INTERP, enum_class_HashIteratorKey);
+ /* Poke directly into HIK. We don't want to create any kind of public API for this */
+ PARROT_HASHITERATORKEY(ret)->parrot_hash = attrs->parrot_hash;
+ PARROT_HASHITERATORKEY(ret)->bucket = bucket;
+
+ return ret;
+ }
+
+/*
+
+*/
+
+ VTABLE STRING* shift_string() {
+ PMC * const key = SELF.shift_pmc();
+ return VTABLE_get_string(INTERP, key);
+ }
+}
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Modified: branches/pluggable_runcore/src/pmc/os.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/os.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/os.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -219,6 +219,9 @@
=cut
+TT #849: Provide a mechanism for setting 'mtime' and 'atime':
+https://trac.parrot.org/parrot/ticket/849
+
*/
METHOD stat(STRING *path) {
@@ -509,6 +512,7 @@
thrown.
=cut
+
*/
METHOD rename(STRING *oldpath, STRING *newpath) {
char * const coldpath = Parrot_str_to_cstring(interp, oldpath);
Modified: branches/pluggable_runcore/src/pmc/parrotinterpreter.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/parrotinterpreter.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/parrotinterpreter.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -279,8 +279,10 @@
*/
VTABLE void destroy() {
- if (PMC_data(SELF))
+ if (PMC_data(SELF)) {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
+ }
}
@@ -524,9 +526,7 @@
s = CONST_STRING(interp, "annotations");
if (Parrot_str_equal(interp, item, s)) {
- Parrot_sub *sub;
PMC *sub_pmc = ctx->current_sub;
- PMC_get_sub(interp, sub_pmc, sub);
if (ctx == CONTEXT(interp)) {
/* We can't know the current program counter for the currently
* executing sub, so can't return annotations for that. */
@@ -534,16 +534,21 @@
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Cannot get annotations at depth 0; use annotations op instead.");
}
- if (!PMC_IS_NULL(sub_pmc) && sub_pmc->vtable->base_type == enum_class_Sub &&
- sub->seg->annotations) {
- PackFile_ByteCode *seg = sub->seg;
- opcode_t *pc = ctx->current_pc;
- return PackFile_Annotations_lookup(interp, seg->annotations,
+ if (!PMC_IS_NULL(sub_pmc)
+ && sub_pmc->vtable->base_type == enum_class_Sub) {
+ Parrot_sub *sub;
+ PackFile_ByteCode *seg;
+ opcode_t *pc = ctx->current_pc;
+
+ PMC_get_sub(interp, sub_pmc, sub);
+ seg = sub->seg;
+
+ if (sub->seg->annotations)
+ return PackFile_Annotations_lookup(interp, seg->annotations,
pc - seg->base.data, NULL);
}
- else {
- return pmc_new(interp, enum_class_Hash);
- }
+
+ return pmc_new(interp, enum_class_Hash);
}
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
Modified: branches/pluggable_runcore/src/pmc/parrotlibrary.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/parrotlibrary.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/parrotlibrary.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -67,6 +67,7 @@
if (dl_handle)
Parrot_dlclose(dl_handle);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
Modified: branches/pluggable_runcore/src/pmc/parrotrunningthread.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/parrotrunningthread.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/parrotrunningthread.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -65,6 +65,7 @@
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/pmc/pmcproxy.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/pmcproxy.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/pmcproxy.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -95,7 +95,7 @@
_pmc->roles = pmc_new(interp, enum_class_ResizablePMCArray);
_pmc->methods = pmc_new(interp, enum_class_Hash);
_pmc->vtable_overrides = pmc_new(interp, enum_class_Hash);
- _pmc->parent_overrides = constant_pmc_new(interp, enum_class_Hash);
+ _pmc->parent_overrides = pmc_new(interp, enum_class_Hash);
_pmc->attrib_metadata = pmc_new(interp, enum_class_Hash);
_pmc->attrib_index = PMCNULL;
_pmc->attrib_cache = PMCNULL;
@@ -202,59 +202,6 @@
/*
-=item C<void destroy()>
-
-Free the memory associated with the object's underlying struct.
-
-=cut
-
-*/
-
- VTABLE void destroy() {
- mem_sys_free(PMC_data(SELF));
- }
-
-/*
-
-=item C<void mark()>
-
-Mark any referenced strings and PMCs in the structure as live.
-
-=cut
-
-*/
-
- VTABLE void mark() {
- Parrot_Class_attributes * const _pmc = PARROT_CLASS(SELF);
-
- if (_pmc->name)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->name);
- if (_pmc->_namespace)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->_namespace);
- if (_pmc->parents)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->parents);
- if (_pmc->all_parents)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->all_parents);
- if (_pmc->roles)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->roles);
- if (_pmc->methods)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->methods);
- if (_pmc->vtable_overrides)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->vtable_overrides);
- if (_pmc->parent_overrides)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->parent_overrides);
- if (_pmc->attrib_metadata)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->attrib_metadata);
- if (_pmc->attrib_index)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->attrib_index);
- if (_pmc->attrib_cache)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->attrib_cache);
- if (_pmc->resolve_method)
- Parrot_gc_mark_PObj_alive(interp, (PObj *)_pmc->resolve_method);
- }
-
-/*
-
=item C<INTVAL isa_pmc(PMC *classname)>
Returns whether the class is or inherits from C<*classname>.
Modified: branches/pluggable_runcore/src/pmc/pointer.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/pointer.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/pointer.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -51,6 +51,7 @@
VTABLE void destroy() {
mem_sys_free(PARROT_POINTER(SELF));
+ PMC_data(SELF) = NULL;
}
Modified: branches/pluggable_runcore/src/pmc/retcontinuation.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/retcontinuation.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/retcontinuation.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -57,6 +57,7 @@
mem_sys_free(cc);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/pmc/role.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/role.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/role.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -256,6 +256,7 @@
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/pmc/scheduler.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/scheduler.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/scheduler.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -249,6 +249,7 @@
Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF);
MUTEX_DESTROY(core_struct->msg_lock);
mem_sys_free(core_struct);
+ PMC_data(SELF) = NULL;
}
Modified: branches/pluggable_runcore/src/pmc/schedulermessage.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/schedulermessage.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/schedulermessage.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -198,6 +198,7 @@
*/
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/pmc/socket.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/socket.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/socket.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -119,6 +119,7 @@
Parrot_io_close_piohandle(interp, data_struct->os_handle);
data_struct->os_handle = PIO_INVALID_HANDLE;
}
+ PMC_data(SELF) = NULL;
}
/*
@@ -143,7 +144,7 @@
=over 4
-=item C<socket>
+=item C<socket(INTVAL fam, INTVAL type, INTVAL proto)>
=cut
@@ -158,7 +159,25 @@
/*
-=item C<sockaddr>
+=item C<poll(INTVAL which, INTVAL sec, INTVAL usec)>
+
+Watches the socket for C<sec> seconds and C<usec> milliseconds. C<which>
+is a bitmask representing the states you want to watch for. Or together 1
+for readable, two for writeable, and four for exceptions.
+
+=cut
+
+*/
+
+
+ METHOD poll(INTVAL which, INTVAL sec, INTVAL usec) {
+ INTVAL poll = Parrot_io_poll(INTERP, SELF, which, sec, usec);
+ RETURN(INTVAL poll);
+ }
+
+/*
+
+=item C<sockaddr(STRING * address, INTVAL port)>
C<sockaddr> returns an object representing a socket address, generated
from a port number (integer) and an address (string).
@@ -174,7 +193,7 @@
/*
-=item C<connect>
+=item C<connect(PMC * address)>
Connects a socket object to an address.
@@ -196,7 +215,7 @@
/*
-=item C<close>
+=item C<close()>
Close a socket.
@@ -218,7 +237,7 @@
/*
-=item C<recv>
+=item C<recv()>
Receives a message from a connected socket object. It returns
the message in a string.
@@ -240,7 +259,7 @@
/*
-=item C<send>
+=item C<send(STRING *buf)>
Sends a message string to a connected socket object.
@@ -259,7 +278,7 @@
/*
-=item C<bind>
+=item C<bind(PMC *host)>
C<bind> binds a socket object to the port and address specified by an
address object (the packed result of C<sockaddr>).
@@ -282,7 +301,7 @@
/*
-=item C<listen>
+=item C<listen(INTVAL backlog)>
C<listen> specifies that a socket object is willing to accept incoming
connections. The integer argument gives the maximum size of the queue
@@ -302,7 +321,7 @@
/*
-=item C<accept>
+=item C<accept()>
C<accept> accepts a new connection on a given socket object, and returns
a newly created socket object for the connection.
Modified: branches/pluggable_runcore/src/pmc/string.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/string.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/string.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -36,9 +36,9 @@
VTABLE void init() {
Parrot_String_attributes *attrs =
mem_allocate_typed(Parrot_String_attributes);
-
- attrs->str_val = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
+ STRING *str_val = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
PMC_data(SELF) = attrs;
+ SET_ATTR_str_val(INTERP, SELF, str_val);
PObj_custom_mark_destroy_SETALL(SELF);
}
@@ -55,6 +55,7 @@
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
@@ -647,27 +648,42 @@
*/
VTABLE STRING *get_string_keyed(PMC *key) {
+ return SELF.get_string_keyed_int(VTABLE_get_integer(INTERP, key));
+ }
+
+ VTABLE STRING *get_string_keyed_int(INTVAL pos) {
STRING * const s = SELF.get_string();
- const INTVAL k = VTABLE_get_integer(INTERP, key);
- return Parrot_str_substr(INTERP, s, k, 1, NULL, 0);
+ return Parrot_str_substr(INTERP, s, pos, 1, NULL, 0);
}
VTABLE INTVAL get_integer_keyed(PMC *key) {
+ return SELF.get_integer_keyed_int(VTABLE_get_integer(INTERP, key));
+ }
+
+ VTABLE INTVAL get_integer_keyed_int(INTVAL pos) {
STRING * const s = SELF.get_string();
- return string_ord(INTERP, s, VTABLE_get_integer(INTERP, key));
+ return string_ord(INTERP, s, pos);
}
VTABLE void set_string_keyed(PMC *key, STRING * const value) {
+ SELF.set_string_keyed_int(VTABLE_get_integer(INTERP, key), value);
+ }
+
+ VTABLE void set_string_keyed_int(INTVAL pos, STRING * const value) {
STRING * const s = SELF.get_string();
const INTVAL len = Parrot_str_byte_length(INTERP, value);
- Parrot_str_replace(INTERP, s, VTABLE_get_integer(INTERP, key), len, value, NULL);
+ Parrot_str_replace(INTERP, s, pos, len, value, NULL);
VTABLE_set_string_native(INTERP, SELF, s);
}
VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
+ SELF.set_integer_keyed_int(VTABLE_get_integer(INTERP, key), value);
+ }
+
+ VTABLE void set_integer_keyed_int(INTVAL pos, INTVAL value) {
STRING * const s = SELF.get_string();
STRING * const c = string_chr(INTERP, (UINTVAL) value);
- Parrot_str_replace(INTERP, s, VTABLE_get_integer(INTERP, key), 1, c, NULL);
+ Parrot_str_replace(INTERP, s, pos, 1, c, NULL);
VTABLE_set_string_native(INTERP, SELF, s);
}
/*
@@ -796,19 +812,7 @@
}
VTABLE PMC *get_iter() {
- STRING *name = CONST_STRING(interp, "set_key");
- PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
- PMC * const key = pmc_new(INTERP, enum_class_Key);
-
- Parrot_PCCINVOKE(interp, iter, name, "P->", key);
- PObj_get_FLAGS(key) |= KEY_integer_FLAG;
-
- if (!Parrot_str_byte_length(INTERP, VTABLE_get_string(INTERP, SELF)))
- VTABLE_set_integer_native(INTERP, key, -1);
- else
- VTABLE_set_integer_native(INTERP, key, 0);
-
- return iter;
+ return pmc_new_init(INTERP, enum_class_StringIterator, SELF);
}
/*
Copied: branches/pluggable_runcore/src/pmc/stringiterator.pmc (from r40540, trunk/src/pmc/stringiterator.pmc)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/src/pmc/stringiterator.pmc Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/src/pmc/stringiterator.pmc)
@@ -0,0 +1,363 @@
+/*
+Copyright (C) 2001-2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/pmc/stringiterator.pmc - StringIterator PMC
+
+=head1 DESCRIPTION
+
+Implementation of Iterator for String PMC.
+
+=head1 SYNOPSIS
+
+
+=head1 Methods
+
+=over 4
+
+=cut
+
+*/
+
+
+pmclass StringIterator extends Iterator {
+ ATTR PMC *string; /* String to iterate over */
+ ATTR INTVAL pos; /* Current position of iterator for forward iterator */
+ /* Previous position of iterator for reverse iterator */
+ ATTR INTVAL length; /* Length of C<string> */
+ ATTR INTVAL reverse; /* Direction of iteration. 1 - for reverse iteration */
+
+/*
+
+=item C<void init_pmc()>
+
+Initialize StringIterator.
+
+=cut
+
+*/
+ VTABLE void init_pmc(PMC *string) {
+ Parrot_StringIterator_attributes * const attrs =
+ mem_allocate_zeroed_typed(Parrot_StringIterator_attributes);
+
+ attrs->string = string;
+ PMC_data(SELF) = attrs;
+
+ PObj_custom_mark_destroy_SETALL(SELF);
+
+ /* by default, iterate from start */
+ SELF.set_integer_native(ITERATE_FROM_START);
+ }
+
+/*
+
+=item C<void destroy()>
+
+destroys this PMC
+
+=cut
+
+*/
+
+ VTABLE void destroy() {
+ mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
+ }
+
+/*
+
+=item C<void mark()>
+
+Marks the current idx/key and the aggregate as live.
+
+=cut
+
+*/
+
+ VTABLE void mark() {
+ PMC *string;
+ GET_ATTR_string(INTERP, SELF, string);
+ if (string)
+ Parrot_gc_mark_PObj_alive(INTERP, (PObj *)string);
+ }
+
+/*
+
+=item C<PMC *clone()>
+
+=cut
+
+*/
+ VTABLE PMC* clone() {
+ Parrot_StringIterator_attributes * const attrs =
+ PARROT_STRINGITERATOR(SELF);
+ PMC * const clone =
+ pmc_new_init(INTERP, enum_class_StringIterator, attrs->string);
+ Parrot_StringIterator_attributes * const clone_attrs =
+ PARROT_STRINGITERATOR(clone);
+
+ clone_attrs->pos = attrs->pos;
+ clone_attrs->reverse = attrs->reverse;
+ return clone;
+ }
+
+/*
+
+=item C<INTVAL get_bool()>
+
+Returns true if there is more elements to iterate over.
+
+=cut
+
+*/
+
+ VTABLE INTVAL get_bool() {
+ return SELF.elements() > 0;
+ }
+
+/*
+
+=item C<INTVAL elements()>
+
+Returns the number of remaining elements in the C<string>.
+
+=cut
+
+*/
+
+ VTABLE INTVAL elements() {
+ Parrot_StringIterator_attributes * const attrs =
+ PARROT_STRINGITERATOR(SELF);
+ if (attrs->reverse)
+ return attrs->pos;
+ else
+ return attrs->length - attrs->pos;
+ }
+
+ VTABLE INTVAL get_integer() {
+ return SELF.elements();
+ }
+
+/*
+
+=item C<void set_integer_native(INTVAL value)>
+
+Reset the Iterator. C<value> must be one of
+
+ ITERATE_FROM_START ... Iterate from start
+ ITERATE_FROM_END ... Iterate from end
+
+=cut
+
+*/
+
+ VTABLE void set_integer_native(INTVAL value) {
+ Parrot_StringIterator_attributes * const attrs =
+ PARROT_STRINGITERATOR(SELF);
+ if (value == ITERATE_FROM_START) {
+ attrs->reverse = 0;
+ attrs->pos = 0;
+ attrs->length = VTABLE_elements(INTERP, attrs->string);
+ }
+ else if (value == ITERATE_FROM_END) {
+ attrs->reverse = 1;
+ attrs->pos = attrs->length
+ = VTABLE_elements(INTERP, attrs->string);
+ }
+ else
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ "Wrong direction for StringIterator");
+ }
+
+/*
+
+=item C<PMC *get_pmc()>
+
+Returns this Iterator's string.
+
+=cut
+
+*/
+
+ VTABLE PMC *get_pmc() {
+ PMC *string;
+ GET_ATTR_string(INTERP, SELF, string);
+ return string ? string : PMCNULL;
+ }
+
+/*
+
+=item C<STRING *shift_pmc()>
+
+Shift next character from C<string> as PMC.
+
+=cut
+
+*/
+ VTABLE PMC *shift_pmc() {
+ Parrot_StringIterator_attributes * const attrs =
+ PARROT_STRINGITERATOR(SELF);
+ PMC *ret;
+
+ if (attrs->pos >= attrs->length)
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ ret = pmc_new(INTERP, Parrot_get_ctx_HLL_type(interp, enum_class_String));
+ VTABLE_set_string_native(INTERP, ret,
+ VTABLE_get_string_keyed_int(INTERP, attrs->string, attrs->pos++));
+ return ret;
+ }
+
+/*
+
+=item C<STRING *shift_string()>
+
+Shift next character from C<string>.
+
+=cut
+
+*/
+ VTABLE STRING *shift_string() {
+ Parrot_StringIterator_attributes * const attrs =
+ PARROT_STRINGITERATOR(SELF);
+
+ if (attrs->pos >= attrs->length)
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_string_keyed_int(INTERP, attrs->string, attrs->pos++);
+ }
+
+/*
+
+=item C<INTVAL shift_integer()>
+
+Shift next character code from C<string>.
+
+=cut
+
+*/
+ VTABLE INTVAL shift_integer() {
+ Parrot_StringIterator_attributes * const attrs =
+ PARROT_STRINGITERATOR(SELF);
+
+ if (attrs->pos >= attrs->length)
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_integer_keyed_int(INTERP, attrs->string, attrs->pos++);
+ }
+
+/*
+
+=item C<STRING *pop_pmc()>
+
+Shift "next" character from C<string> for reverse iterator as PMC.
+
+=cut
+
+*/
+ VTABLE PMC *pop_pmc() {
+ Parrot_StringIterator_attributes * const attrs =
+ PARROT_STRINGITERATOR(SELF);
+ PMC *ret;
+
+ if (!STATICSELF.get_bool())
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ ret = pmc_new(INTERP, Parrot_get_ctx_HLL_type(interp, enum_class_String));
+ VTABLE_set_string_native(INTERP, ret,
+ VTABLE_get_string_keyed_int(INTERP, attrs->string, --attrs->pos));
+ return ret;
+ }
+
+/*
+
+=item C<STRING *pop_string()>
+
+Shift "next" character from C<string> for reverse iterator.
+
+=cut
+
+*/
+ VTABLE STRING *pop_string() {
+ Parrot_StringIterator_attributes * const attrs =
+ PARROT_STRINGITERATOR(SELF);
+
+ if (!STATICSELF.get_bool())
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_string_keyed_int(INTERP, attrs->string, --attrs->pos);
+ }
+
+/*
+
+=item C<INTVAL pop_integer()>
+
+Shift "next" character code from C<string> for reverse iterator.
+
+=cut
+
+*/
+ VTABLE INTVAL pop_integer() {
+ Parrot_StringIterator_attributes * const attrs =
+ PARROT_STRINGITERATOR(SELF);
+
+ if (!STATICSELF.get_bool())
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+ "StopIteration");
+
+ return VTABLE_get_integer_keyed_int(INTERP, attrs->string, --attrs->pos);
+ }
+
+/*
+
+=item C<INTVAL get_integer_keyed_int(INTVAL idx)>
+
+Get integer value of current position plus idx.
+
+=cut
+
+*/
+
+ VTABLE INTVAL get_integer_keyed_int(INTVAL idx) {
+ return VTABLE_get_integer_keyed_int(INTERP, STATICSELF.get_pmc(),
+ PARROT_STRINGITERATOR(SELF)->pos + idx);
+ }
+
+/*
+
+=item C<STRING *get_string_keyed_int(INTVAL idx)>
+
+Get string value of current position plus idx.
+
+=cut
+
+*/
+
+ VTABLE STRING *get_string_keyed_int(INTVAL idx) {
+ return VTABLE_get_string_keyed_int(INTERP, STATICSELF.get_pmc(),
+ PARROT_STRINGITERATOR(SELF)->pos + idx);
+ }
+}
+
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Modified: branches/pluggable_runcore/src/pmc/task.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/task.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/task.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -378,6 +378,7 @@
*/
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/pmc/timer.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/timer.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/timer.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -180,6 +180,7 @@
VTABLE void destroy() {
Parrot_cx_delete_task(INTERP, SELF);
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/pmc/unmanagedstruct.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/unmanagedstruct.pmc Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc/unmanagedstruct.pmc Fri Aug 14 01:24:23 2009 (r40541)
@@ -691,6 +691,7 @@
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
Modified: branches/pluggable_runcore/src/pmc_freeze.c
==============================================================================
--- branches/pluggable_runcore/src/pmc_freeze.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/pmc_freeze.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -1661,6 +1661,11 @@
PARROT_ASSERT(current->vtable);
+ /* Workaround for thawing constants. Clear constant flag */
+ /* See src/packfile.c:3999 */
+ if (thawing)
+ PObj_constant_CLEAR(current);
+
VTABLE_visit(interp, current, info);
if (thawing) {
Modified: branches/pluggable_runcore/src/runcore/trace.c
==============================================================================
--- branches/pluggable_runcore/src/runcore/trace.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/runcore/trace.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -288,21 +288,7 @@
s = 1;
len = Parrot_io_eprintf(debugger, "%6vu ", (UINTVAL)(pc - code_start));
- if (STREQ(info->name, "infix")) {
- /* this should rather be MMD_opcode_name, which doesn't
- * exit yet
- */
- len += Parrot_io_eprintf(debugger, "%s",
- Parrot_MMD_method_name(interp, pc[1]) + 2);
- s = 2;
- }
- else if (STREQ(info->name, "n_infix")) {
- len += Parrot_io_eprintf(debugger, "n_%s",
- Parrot_MMD_method_name(interp, pc[1]) + 2);
- s = 2;
- }
- else
- len += Parrot_io_eprintf(debugger, "%s", info->name);
+ len += Parrot_io_eprintf(debugger, "%s", info->name);
n = info->op_count;
var_args = 0;
Deleted: branches/pluggable_runcore/src/stacks.c
==============================================================================
--- branches/pluggable_runcore/src/stacks.c Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,618 +0,0 @@
-/*
-Copyright (C) 2001-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/stacks.c - Stack handling routines for Parrot
-
-=head1 DESCRIPTION
-
-The stack is stored as a linked list of chunks (C<Stack_Chunk>),
-where each chunk has room for one entry.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/stacks.h"
-#include "stacks.str"
-
-/* HEADERIZER HFILE: include/parrot/stacks.h */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-
-static void run_cleanup_action(PARROT_INTERP, ARGIN(Stack_Entry_t *e))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-#define ASSERT_ARGS_run_cleanup_action __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(e)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-/* HEADERIZER END: static */
-
-/*
-
-=item C<void stack_system_init(PARROT_INTERP)>
-
-Called from C<make_interpreter()> to initialize the interpreter's
-register stacks.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-stack_system_init(SHIM_INTERP)
-{
- ASSERT_ARGS(stack_system_init)
-}
-
-/*
-
-=item C<Stack_Chunk_t * cst_new_stack_chunk(PARROT_INTERP, const Stack_Chunk_t
-*chunk)>
-
-Get a new chunk either from the freelist or allocate one.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Chunk_t *
-cst_new_stack_chunk(PARROT_INTERP, ARGIN(const Stack_Chunk_t *chunk))
-{
- ASSERT_ARGS(cst_new_stack_chunk)
- Stack_Chunk_t * const new_chunk =
- (Stack_Chunk_t *)Parrot_gc_new_bufferlike_header(interp, sizeof (Stack_Chunk_t));
-
- PObj_bufstart(new_chunk) = NULL;
- PObj_buflen(new_chunk) = 0;
-
- new_chunk->name = chunk->name;
-
- return new_chunk;
-}
-
-/*
-
-=item C<Stack_Chunk_t * new_stack(PARROT_INTERP, const char *name)>
-
-Create a new stack and name it. C<< stack->name >> is used for
-debugging/error reporting.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Stack_Chunk_t *
-new_stack(PARROT_INTERP, ARGIN(const char *name))
-{
- ASSERT_ARGS(new_stack)
- Stack_Chunk_t * const chunk =
- (Stack_Chunk_t *)Parrot_gc_new_bufferlike_header(interp, sizeof (Stack_Chunk_t));
-
- chunk->prev = chunk; /* mark the top of the stack */
- chunk->name = name;
-
- return chunk;
-}
-
-
-/*
-
-=item C<void mark_stack(PARROT_INTERP, Stack_Chunk_t *chunk)>
-
-Mark entries in a stack structure during GC.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-mark_stack(PARROT_INTERP, ARGMOD(Stack_Chunk_t *chunk))
-{
- ASSERT_ARGS(mark_stack)
- for (; ; chunk = chunk->prev) {
- Stack_Entry_t *entry;
-
- Parrot_gc_mark_PObj_alive(interp, (PObj *)chunk);
-
- if (chunk == chunk->prev)
- break;
-
- entry = STACK_DATAP(chunk);
-
- if (entry->entry_type == STACK_ENTRY_PMC && UVal_pmc(entry->entry))
- Parrot_gc_mark_PObj_alive(interp, (PObj *)UVal_pmc(entry->entry));
- }
-}
-
-/*
-
-=item C<size_t stack_height(PARROT_INTERP, const Stack_Chunk_t *chunk)>
-
-Returns the height of the stack. The maximum "depth" is height - 1.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-size_t
-stack_height(SHIM_INTERP, ARGIN(const Stack_Chunk_t *chunk))
-{
- ASSERT_ARGS(stack_height)
- size_t height = 0;
-
- for (; ; chunk = chunk->prev) {
- if (chunk == chunk->prev)
- break;
- ++height;
- }
-
- return height;
-}
-
-
-/*
-
-=item C<Stack_Entry_t * stack_entry(PARROT_INTERP, Stack_Chunk_t *stack, INTVAL
-depth)>
-
-If C<< depth >= 0 >>, return the entry at that depth from the top of the
-stack, with 0 being the top entry. If C<depth < 0>, then return the
-entry C<|depth|> entries from the bottom of the stack. Returns C<NULL>
-if C<|depth| > number> of entries in stack.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Stack_Entry_t *
-stack_entry(SHIM_INTERP, ARGIN(Stack_Chunk_t *stack), INTVAL depth)
-{
- ASSERT_ARGS(stack_entry)
- Stack_Chunk_t *chunk;
- size_t offset = (size_t)depth;
-
- if (depth < 0)
- return NULL;
-
- /* Start at top */
- chunk = stack;
-
- while (offset) {
- if (chunk == chunk->prev)
- break;
- --offset;
- chunk = chunk->prev;
- }
-
- if (chunk == chunk->prev)
- return NULL;
-
- return STACK_DATAP(chunk);
-}
-
-/*
-
-=item C<Stack_Entry_t* stack_prepare_push(PARROT_INTERP, Stack_Chunk_t
-**stack_p)>
-
-Return a pointer, where new entries go for push.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Entry_t*
-stack_prepare_push(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p))
-{
- ASSERT_ARGS(stack_prepare_push)
- Stack_Chunk_t * const chunk = *stack_p;
- Stack_Chunk_t * const new_chunk = cst_new_stack_chunk(interp, chunk);
-
- new_chunk->prev = chunk;
- *stack_p = new_chunk;
-
- return STACK_DATAP(new_chunk);
-}
-
-/*
-
-=item C<void stack_push(PARROT_INTERP, Stack_Chunk_t **stack_p, void *thing,
-Stack_entry_type type, Stack_cleanup_method cleanup)>
-
-Push something on the generic stack.
-
-Note that the cleanup pointer, if non-C<NULL>, points to a routine
-that'll be called when the entry is removed from the stack. This is
-handy for those cases where you need some sort of activity to take place
-when an entry is removed, such as when you push a lexical lock onto the
-call stack, or localize (or tempify, or whatever we're calling it)
-variable or something.
-
-*/
-
-PARROT_EXPORT
-void
-stack_push(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p),
- ARGIN(void *thing), Stack_entry_type type, NULLOK(Stack_cleanup_method cleanup))
-{
- ASSERT_ARGS(stack_push)
- Stack_Entry_t * const entry = (Stack_Entry_t *)stack_prepare_push(interp, stack_p);
-
- /* Remember the type */
- entry->entry_type = type;
-
- /* Remember the cleanup function */
- entry->cleanup = cleanup;
-
- /* Store our thing */
- switch (type) {
- case STACK_ENTRY_MARK:
- UVal_int(entry->entry) = *(INTVAL *)thing;
- break;
- case STACK_ENTRY_DESTINATION:
- UVal_ptr(entry->entry) = thing;
- break;
- case STACK_ENTRY_ACTION:
- case STACK_ENTRY_PMC:
- UVal_pmc(entry->entry) = (PMC *)thing;
- break;
- default:
- Parrot_ex_throw_from_c_args(interp, NULL, ERROR_BAD_STACK_TYPE,
- "Invalid Stack_Entry_type!");
- }
-}
-
-/*
-
-=item C<Stack_Entry_t* stack_prepare_pop(PARROT_INTERP, Stack_Chunk_t
-**stack_p)>
-
-Return a pointer, where new entries are popped off.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Entry_t*
-stack_prepare_pop(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p))
-{
- ASSERT_ARGS(stack_prepare_pop)
- Stack_Chunk_t * const chunk = *stack_p;
-
- /* the first entry (initial top) refers to itself */
- if (chunk == chunk->prev)
- Parrot_ex_throw_from_c_args(interp, NULL, ERROR_STACK_EMPTY,
- "No entries on %s Stack!", chunk->name);
-
- *stack_p = chunk->prev;
-
- return STACK_DATAP(chunk);
-}
-
-/*
-
-=item C<void * stack_pop(PARROT_INTERP, Stack_Chunk_t **stack_p, void *where,
-Stack_entry_type type)>
-
-Pop off an entry and return a pointer to the contents.
-
-*/
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-void *
-stack_pop(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p),
- ARGOUT_NULLOK(void *where), Stack_entry_type type)
-{
- ASSERT_ARGS(stack_pop)
- Stack_Chunk_t * const cur_chunk = *stack_p;
- Stack_Entry_t * const entry =
- (Stack_Entry_t *)stack_prepare_pop(interp, stack_p);
-
- /* Types of 0 mean we don't care */
- if (type && entry->entry_type != type)
- Parrot_ex_throw_from_c_args(interp, NULL, ERROR_BAD_STACK_TYPE,
- "Wrong type on top of stack!\n");
-
- /* Cleanup routine? */
- if (entry->cleanup != STACK_CLEANUP_NULL)
- (*entry->cleanup) (interp, entry);
-
- /* Sometimes the caller cares what the value was */
- if (where) {
- /* Snag the value */
- switch (type) {
- case STACK_ENTRY_MARK:
- *(INTVAL *)where = UVal_int(entry->entry);
- break;
- case STACK_ENTRY_DESTINATION:
- *(void **)where = UVal_ptr(entry->entry);
- break;
- case STACK_ENTRY_ACTION:
- case STACK_ENTRY_PMC:
- *(PMC **)where = UVal_pmc(entry->entry);
- break;
- default:
- Parrot_ex_throw_from_c_args(interp, NULL, ERROR_BAD_STACK_TYPE,
- "Wrong type on top of stack!\n");
- }
- }
-
- /* recycle this chunk to the free list if it's otherwise unreferenced */
- if (cur_chunk->refcount <= 0)
- Parrot_gc_free_bufferlike_header(interp, (PObj *)cur_chunk, sizeof (Stack_Chunk_t));
-
- return where;
-}
-
-/*
-
-=item C<void * pop_dest(PARROT_INTERP)>
-
-Pop off a destination entry and return a pointer to the contents.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-void *
-pop_dest(PARROT_INTERP)
-{
- ASSERT_ARGS(pop_dest)
- /* We don't mind the extra call, so we do this: (previous comment
- * said we *do* mind, but I say let the compiler decide) */
- void *dest;
- (void)stack_pop(interp, &interp->dynamic_env,
- &dest, STACK_ENTRY_DESTINATION);
- return dest;
-}
-
-/*
-
-=item C<void * stack_peek(PARROT_INTERP, Stack_Chunk_t *stack_base,
-Stack_entry_type *type)>
-
-Peek at stack and return pointer to entry and the type of the entry.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-void *
-stack_peek(PARROT_INTERP, ARGIN(Stack_Chunk_t *stack_base),
- ARGMOD_NULLOK(Stack_entry_type *type))
-{
- ASSERT_ARGS(stack_peek)
- const Stack_Entry_t * const entry = stack_entry(interp, stack_base, 0);
- if (entry == NULL)
- return NULL;
-
- if (type != NULL)
- *type = entry->entry_type;
-
- if (entry->entry_type == STACK_ENTRY_DESTINATION)
- return UVal_ptr(entry->entry);
-
- return (void *) UVal_pmc(entry->entry);
-}
-
-/*
-
-=item C<Stack_entry_type get_entry_type(const Stack_Entry_t *entry)>
-
-Returns the stack entry type of C<entry>.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_PURE_FUNCTION
-Stack_entry_type
-get_entry_type(ARGIN(const Stack_Entry_t *entry))
-{
- ASSERT_ARGS(get_entry_type)
- return entry->entry_type;
-}
-
-/*
-
-=item C<void Parrot_dump_dynamic_environment(PARROT_INTERP, Stack_Chunk_t
-*dynamic_env)>
-
-Print a representation of the dynamic stack to the standard error (using
-C<Parrot_io_eprintf>). This is used only temporarily for debugging.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_dump_dynamic_environment(PARROT_INTERP, ARGIN(Stack_Chunk_t *dynamic_env))
-{
- ASSERT_ARGS(Parrot_dump_dynamic_environment)
- int height = (int) stack_height(interp, dynamic_env);
-
- while (dynamic_env->prev != dynamic_env) {
- const Stack_Entry_t * const e = stack_entry(interp, dynamic_env, 0);
-
- if (! e)
- Parrot_ex_throw_from_c_args(interp, NULL, 1, "Dynamic environment stack damaged");
-
- Parrot_io_eprintf(interp, "[%4d: chunk %p entry %p "
- "type %d cleanup %p]\n",
- height, dynamic_env, e,
- e->entry_type, e->cleanup);
- if (e->entry_type == STACK_ENTRY_PMC
- || e->entry_type == STACK_ENTRY_ACTION) {
- PMC * const thing = UVal_pmc(e->entry);
-
- Parrot_io_eprintf(interp, "[ PMC %p type %d => %Ss]\n",
- thing, thing->vtable->base_type,
- VTABLE_get_string(interp, thing));
- }
- else if (e->entry_type == STACK_ENTRY_MARK) {
- Parrot_io_eprintf(interp, "[ mark %d]\n",
- UVal_int(e->entry));
- }
- dynamic_env = dynamic_env->prev;
- height--;
- }
- Parrot_io_eprintf(interp, "[%4d: chunk %p %s base]\n",
- height, dynamic_env, dynamic_env->name);
-}
-
-
-/*
-
-=item C<static void run_cleanup_action(PARROT_INTERP, Stack_Entry_t *e)>
-
-Runs the sub PMC from the Stack_Entry_t pointer with an INTVAL arg of 0. Used
-in C<Parrot_push_action>.
-
-=cut
-
-*/
-
-static void
-run_cleanup_action(PARROT_INTERP, ARGIN(Stack_Entry_t *e))
-{
- ASSERT_ARGS(run_cleanup_action)
- /*
- * this is called during normal stack_pop of the control
- * stack - run the action subroutine with an INTVAL arg of 0
- */
- PMC * const sub = UVal_pmc(e->entry);
- Parrot_runops_fromc_args(interp, sub, "vI", 0);
-}
-
-/*
-
-=item C<void Parrot_push_action(PARROT_INTERP, PMC *sub)>
-
-Pushes an action handler onto the dynamic environment.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_push_action(PARROT_INTERP, ARGIN(PMC *sub))
-{
- ASSERT_ARGS(Parrot_push_action)
- if (!VTABLE_isa(interp, sub, CONST_STRING(interp, "Sub")))
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
- "Tried to push a non Sub PMC action");
-
- stack_push(interp, &interp->dynamic_env, sub,
- STACK_ENTRY_ACTION, run_cleanup_action);
-}
-
-/*
-
-=item C<void Parrot_push_mark(PARROT_INTERP, INTVAL mark)>
-
-Push a cleanup mark onto the dynamic environment.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_push_mark(PARROT_INTERP, INTVAL mark)
-{
- ASSERT_ARGS(Parrot_push_mark)
- stack_push(interp, &interp->dynamic_env, &mark,
- STACK_ENTRY_MARK, STACK_CLEANUP_NULL);
-}
-
-/*
-
-=item C<void Parrot_pop_mark(PARROT_INTERP, INTVAL mark)>
-
-Pop items off the dynamic environment up to the mark.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_pop_mark(PARROT_INTERP, INTVAL mark)
-{
- ASSERT_ARGS(Parrot_pop_mark)
- do {
- const Stack_Entry_t * const e
- = stack_entry(interp, interp->dynamic_env, 0);
- if (!e)
- Parrot_ex_throw_from_c_args(interp, NULL, 1, "Mark %ld not found.",
- (long)mark);
-
- (void)stack_pop(interp, &interp->dynamic_env,
- NULL, e->entry_type);
- if (e->entry_type == STACK_ENTRY_MARK) {
- if (UVal_int(e->entry) == mark)
- return;
- }
- } while (1);
-}
-
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<include/parrot/stacks.h> and F<include/parrot/enums.h>.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- * c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
Modified: branches/pluggable_runcore/src/string/api.c
==============================================================================
--- branches/pluggable_runcore/src/string/api.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/string/api.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -229,25 +229,6 @@
/*
-=item C<void Parrot_str_free(PARROT_INTERP, STRING *s)>
-
-Frees the given STRING's header, accounting for reference counts for the
-STRING's buffer &c. Use this only if you I<know> that nothing else has stored
-the STRING elsewhere.
-
-=cut
-
-*/
-
-void
-Parrot_str_free(PARROT_INTERP, ARGIN(STRING *s))
-{
- ASSERT_ARGS(Parrot_str_free)
- Parrot_gc_free_string_header(interp, s);
-}
-
-/*
-
=back
=head2 Basic String Functions
Modified: branches/pluggable_runcore/src/string/primitives.c
==============================================================================
--- branches/pluggable_runcore/src/string/primitives.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/string/primitives.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -337,33 +337,6 @@
/*
-=item C<char * str_dup(const char *old)>
-
-Duplicate a C string. Just like strdup(), except it dies if it runs
-out of memory.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-char *
-str_dup(ARGIN(const char *old))
-{
- ASSERT_ARGS(str_dup)
- const size_t bytes = strlen(old) + 1;
- char * const copy = (char *)mem_sys_allocate(bytes);
- memcpy(copy, old, bytes);
-#ifdef MEMDEBUG
- debug(interp, 1, "line %d str_dup %s [%x]\n", line, old, copy);
-#endif
- return copy;
-}
-
-/*
-
=item C<char * str_dup_remove_quotes(const char *old)>
Duplicates a C string (minus the wrapping quotes). Similar to strdup(),
Modified: branches/pluggable_runcore/src/sub.c
==============================================================================
--- branches/pluggable_runcore/src/sub.c Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/sub.c Fri Aug 14 01:24:23 2009 (r40541)
@@ -149,28 +149,6 @@
/*
-=item C<Parrot_sub * new_closure(PARROT_INTERP)>
-
-Returns a new C<Parrot_sub> with its own scratchpad.
-
-XXX: Need to document semantics in detail.
-
-=cut
-
-*/
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-Parrot_sub *
-new_closure(PARROT_INTERP)
-{
- ASSERT_ARGS(new_closure)
- Parrot_sub * const newsub = new_sub(interp);
- return newsub;
-}
-
-/*
-
=item C<Parrot_cont * new_continuation(PARROT_INTERP, const Parrot_cont *to)>
Returns a new C<Parrot_cont> to the context of C<to> with its own copy of the
@@ -192,7 +170,6 @@
cc->to_ctx = to_ctx;
cc->from_ctx = Parrot_context_ref(interp, CONTEXT(interp));
- cc->dynamic_state = NULL;
cc->runloop_id = 0;
if (to) {
cc->seg = to->seg;
@@ -227,7 +204,6 @@
cc->to_ctx = CONTEXT(interp);
cc->from_ctx = CONTEXT(interp); /* filled in during a call */
- cc->dynamic_state = NULL;
cc->runloop_id = 0;
cc->seg = interp->code;
cc->current_results = NULL;
@@ -257,7 +233,6 @@
co->seg = interp->code;
co->ctx = NULL;
- co->dynamic_state = NULL;
return co;
}
@@ -575,7 +550,7 @@
{
ASSERT_ARGS(Parrot_capture_lex)
Parrot_Context * const ctx = CONTEXT(interp);
- Parrot_sub *current_sub, *outer_sub;
+ Parrot_sub *current_sub;
Parrot_sub *sub;
Parrot_Context *old;
Modified: branches/pluggable_runcore/src/vtable.tbl
==============================================================================
--- branches/pluggable_runcore/src/vtable.tbl Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/src/vtable.tbl Fri Aug 14 01:24:23 2009 (r40541)
@@ -316,9 +316,6 @@
void delete_keyed_str(STRING* key)
[MAIN]
-PMC* nextkey_keyed(PMC* key, INTVAL what)
-PMC* nextkey_keyed_int(INTVAL key, INTVAL what)
-PMC* nextkey_keyed_str(STRING* key, INTVAL what)
PMC* get_iter()
opcode_t* invoke(void* next)
Modified: branches/pluggable_runcore/t/codingstd/c_function_docs.t
==============================================================================
--- branches/pluggable_runcore/t/codingstd/c_function_docs.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/codingstd/c_function_docs.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -120,8 +120,8 @@
config/gen/platform/solaris/math.c
config/gen/platform/solaris/time.c
examples/c/nanoparrot.c
+examples/c/pbc_info.c
examples/compilers/japhc.c
-examples/embed/lorito.c
src/atomic/gcc_x86.c
src/debug.c
src/gc/gc_malloc.c
@@ -134,7 +134,6 @@
src/jit/ppc/exec_dep.c
src/nci_test.c
src/pbc_dump.c
-src/pbc_info.c
src/pic.c
src/pic_jit.c
src/string/charset/ascii.c
Modified: branches/pluggable_runcore/t/codingstd/svn_id.t
==============================================================================
--- branches/pluggable_runcore/t/codingstd/svn_id.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/codingstd/svn_id.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -5,7 +5,7 @@
use strict;
use warnings;
use Cwd;
-use File::Spec ();
+use File::Spec::Functions;
use lib qw( . lib ../lib ../../lib );
use Parrot::Distribution;
use Test::More tests => 1;
@@ -35,18 +35,18 @@
=cut
my $DIST = Parrot::Distribution->new;
-my $cwd = cwd();
+my $cwd = getcwd(); # cwd() has some bugs when parent directory is a symbolic link
# Certain files, for various reasons, cannot have an
# SVN Id tag. We exclude them from examination by this test.
my %known_exceptions = map {
$_ => 1,
- ( File::Spec->catdir( $cwd, $_ ) ) => 1,
- } qw(
- examples/pir/quine_ord.pir
- examples/streams/FileLines.pir
- examples/streams/ParrotIO.pir
+ ( catdir( $cwd, $_ ) ) => 1,
+ } (
+ catfile(qw/ examples pir quine_ord.pir/),
+ catfile(qw/ examples streams FileLines.pir/),
+ catfile(qw/ examples streams ParrotIO.pir/),
);
my @files = grep { ! $known_exceptions{$_} }
@@ -59,6 +59,7 @@
$DIST->get_pir_language_files(),
)
);
+
my @no_id_files;
foreach my $file (@files) {
Modified: branches/pluggable_runcore/t/codingstd/test_file_coverage.t
==============================================================================
--- branches/pluggable_runcore/t/codingstd/test_file_coverage.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/codingstd/test_file_coverage.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -63,7 +63,6 @@
# Tests in src/dynoplibs
{
- local $TODO = "obscure.ops needs tests. (TT #819)";
ok( !@$test_dynoplibs_miss, "there are test files in $test_dynoplibs_dir for all OPS files" )
or diag "files in $dynoplibs_dir but not in test dir:\n\t@$test_dynoplibs_miss";
}
Modified: branches/pluggable_runcore/t/compilers/imcc/imcpasm/cfg.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/imcc/imcpasm/cfg.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/compilers/imcc/imcpasm/cfg.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -9,24 +9,17 @@
pir_2_pasm_is( <<'CODE', <<'OUT', "unreachable 1" );
.sub _test
- bsr L
print "ok\n"
end
noop
noop
-L: print "sub\n"
- ret
.end
CODE
# IMCC does produce b0rken PASM files
# see http://guest@rt.perl.org/rt3/Ticket/Display.html?id=32392
_test:
- bsr L
print "ok\n"
end
-L:
- print "sub\n"
- ret
OUT
pir_2_pasm_is( <<'CODE', <<'OUT', "unreachable 2" );
Deleted: branches/pluggable_runcore/t/compilers/imcc/imcpasm/sub.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/imcc/imcpasm/sub.t Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,63 +0,0 @@
-#!perl
-# Copyright (C) 2005, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Parrot::Test tests => 2;
-
-##############################
-pir_2_pasm_like( <<'CODE', <<'OUT', "non-constant dest bsr, invoke" );
-.sub _main
- $P26 = new 'Sub'
- $I15 = set_addr _sub1
- $P26 = $I15
- invokecc $P26
- ret
-_sub1:
- ret
-.end
-CODE
-/^# IMCC does produce b0rken PASM files
-# see http://guest@rt.perl.org/rt3/Ticket/Display.html\?id=32392
-_main:
- new P(\d+), 'Sub'
- set_addr I(\d+), _sub1
- set P\1, I\2
- invokecc P\1
- ret
-_sub1:
- ret/
-OUT
-
-pir_2_pasm_like( <<'CODE', <<'OUT', "nonlocal bsr" );
-.sub _main
- $P26 = new 'Sub'
- $I15 = set_addr _f
- $P26 = $I15
- invokecc $P26
- ret
-.end
-.sub _f
- ret
-.end
-CODE
-/^# IMCC does produce b0rken PASM files
-# see http://guest@rt.perl.org/rt3/Ticket/Display.html\?id=32392
-_main:
- new P(\d+), 'Sub'
- set_addr I(\d+), _f
- set P\1, I\2
- invokecc P\1
- ret
-_f:
- ret/
-OUT
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
Deleted: branches/pluggable_runcore/t/compilers/imcc/syn/bsr.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/imcc/syn/bsr.t Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,163 +0,0 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Config;
-use Parrot::Test tests => 7;
-
-pir_output_is( <<'CODE', <<'OUT', "bsr 1" );
-# this tests register allocation/preserving of local bsr calls
-.sub test :main
- $I0 = 2
- $I1 = 3
- bsr L
- print $I0
- print $I1
- print "\n"
- end
- noop
-L: $I2 = 4
- $I3 = 5
- ret
-.end
-CODE
-23
-OUT
-
-##############################
-# bsr recursion - caller saves
-pir_output_is( <<'CODE', <<'OUT', "recursive bsr" );
-.sub test :main
- $P0 = new 'ResizableIntegerArray'
- $I0 = 5 # count
- $I1 = 1 # product
- bsr _fact
- print $I1
- print "\n"
- end
-_fact:
- if $I0 <= 1 goto fin
- push $P0, $I0
- $I1 = $I1 * $I0
- dec $I0
- bsr _fact
- pop $I0, $P0
-fin:
- ret
-.end
-
-CODE
-120
-OUT
-
-##############################
-# bsr recursion - parrot calling convention
-pir_output_is( <<'CODE', <<'OUT', "tail recursive callcc" );
-.sub test :main
- $I0 = _fact(1, 5)
- print $I0
- print "\n"
- end
-.end
-
-.sub _fact
- .param int f
- .param int n
- if n <= 1 goto fin
- f = f * n
- dec n
- .tailcall _fact(f, n)
-fin:
- .return(f)
-.end
-
-CODE
-120
-OUT
-
-##############################
-# coroutine
-pir_output_is( <<'CODE', <<'OUT', "coroutine" );
-.sub test :main
- print "Hello"
- _routine()
- print "perl6"
- _routine()
- print "\n"
- end
-.end
-.sub _routine
- .local pmc co
- print " "
- .yield()
- print "."
- .yield()
-
-.end
-CODE
-Hello perl6.
-OUT
-
-# This is a workaround to suppress errors from POD::Checker.
-my $head1 = '=head1';
-my $cut = '=cut';
-
-pir_output_is( <<"CODE", <<'OUT', "pod before" );
-$head1 BLA
-
- fasel
-
-$cut
-.sub test :main
- print "ok 1\\n"
- end
-.end
-CODE
-ok 1
-OUT
-
-pir_output_is( <<"CODE", <<'OUT', "pod before, after" );
-$head1 FOO
-
- fasel
-
-$cut
-.sub test :main
- print "ok 1\\n"
- end
-.end
-$head1 BAR
-
- junk
-
-CODE
-ok 1
-OUT
-
-pir_output_is( <<'CODE', <<'OUT', "bug #25948" );
-.sub main :main
- goto L1
-test:
- $I1 = 1
- ret
-L1:
- $I2 = 2
- bsr test
- print $I2 # printed 1, not 2
- print "\n"
- end
-.end
-CODE
-2
-OUT
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
Modified: branches/pluggable_runcore/t/compilers/imcc/syn/errors.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/imcc/syn/errors.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/compilers/imcc/syn/errors.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -78,9 +78,6 @@
/^error:imcc:syntax error, unexpected IDENTIFIER, expecting/
END_EXPECTED
-TODO: {
- local $TODO = 'TT #767';
-
pir_error_output_like( <<'END_PIR', <<'END_EXPECTED', 'no multiple .local, TT #767' );
.sub main :main
.local pmc p
@@ -90,8 +87,6 @@
/^error:imcc:syntax error, duplicated IDENTIFIER/
END_EXPECTED
-}
-
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Modified: branches/pluggable_runcore/t/compilers/imcc/syn/file.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/imcc/syn/file.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/compilers/imcc/syn/file.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -463,6 +463,7 @@
pir_output_is( <<"CODE", <<'OUT', 'load PIR from added paths, minding slash' );
.include 'iglobals.pasm'
+ .include 'libpaths.pasm'
.sub main :main
.local pmc interp
@@ -471,9 +472,8 @@
.local pmc lib_paths
lib_paths = interp[.IGLOBALS_LIB_PATHS]
- # XXX - hard-coded magic constant (should be PARROT_LIB_PATH_LIBRARY)
.local pmc include_paths
- include_paths = lib_paths[1]
+ include_paths = lib_paths[.PARROT_LIB_PATH_LIBRARY]
unshift include_paths, '$temp_dir'
load_bytecode 'with_slash.pir'
Modified: branches/pluggable_runcore/t/compilers/imcc/syn/labels.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/imcc/syn/labels.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/compilers/imcc/syn/labels.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -42,15 +42,13 @@
##############################
pir_error_output_like( <<'CODE', <<'OUT', "illegal label" );
.sub bogus
- bsr _function
- print "never\n"
- end
+ goto _function
+ print "never\n"
+ end
.end
.sub _function
- bsr FOO
- ret
-FOO: print "in function\n"
- ret
+ print "in function\n"
+ .return()
.end
CODE
/no label offset defined/
Modified: branches/pluggable_runcore/t/compilers/pct/past.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/pct/past.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/compilers/pct/past.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -48,6 +48,11 @@
}
+# Next tests marked as "skip" instead of "todo" to prevent false-positives in case
+# when Hash keys order occationally can be same as in test.
+SKIP: {
+skip('Hash keys order dependency', 4);
+
pir_output_is( <<'CODE', <<'OUT', 'dump PAST::Val node in visual format' );
.sub _main :main
load_bytecode 'PCT.pbc'
@@ -133,6 +138,8 @@
}
OUT
+}
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Modified: branches/pluggable_runcore/t/compilers/pct/post.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/pct/post.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/compilers/pct/post.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -47,6 +47,11 @@
}
+SKIP: {
+ skip('Hash keys order dependency', 1);
+
+# Next tests marked as "skip" instead of "todo" to prevent false-positives in case
+# when Hash keys order occationally can be same as in test.
pir_output_is( <<'CODE', <<'OUT', 'dump POST::Op node in visual format' );
.sub _main
load_bytecode 'PCT.pbc'
@@ -67,6 +72,8 @@
}
OUT
+}
+
pir_output_is( <<'CODE', <<'OUT', 'dump POST::Label node in visual format' );
.sub _main
load_bytecode 'PCT.pbc'
Modified: branches/pluggable_runcore/t/compilers/pge/03-optable.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/pge/03-optable.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/compilers/pge/03-optable.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -159,17 +159,16 @@
if type == 'term:' goto print_term
if type == 'term:->' goto print_term_arrow
print '('
- .local pmc iter
+ .local pmc it
$P0 = match.'list'()
if null $P0 goto iter_end
unless $P0 goto iter_end
- iter = new 'Iterator', $P0
- iter = 0
- unless iter goto iter_end
+ it = iter $P0
+ unless it goto iter_end
iter_loop:
- $P0 = shift iter
+ $P0 = shift it
tree($P0)
- unless iter goto iter_end
+ unless it goto iter_end
print ', '
goto iter_loop
iter_end:
Modified: branches/pluggable_runcore/t/compilers/pge/p5regex/p5rx.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/pge/p5regex/p5rx.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/compilers/pge/p5regex/p5rx.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -81,7 +81,7 @@
push test_files, 're_tests'
.local pmc file_iterator # iterate over list of files..
- file_iterator = new 'Iterator', test_files
+ file_iterator = iter test_files
.local int test_number # the number of the test we're running
test_number = 0
@@ -291,7 +291,9 @@
.local string test_file
test_file = 're_tests'
- bsr reset_todo_info
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
+ local_branch jmpstack, reset_todo_info
$S0 = 'character class in enumeration'
todo_info[116] = $S0
@@ -497,7 +499,7 @@
reset_todo_info:
todo_info = new 'Hash'
- ret
+ local_return jmpstack
set_todo_loop: # for developer testing. not used normally
if $I0 > $I1 goto end_loop
@@ -505,7 +507,7 @@
$I0 += 1
goto set_todo_loop
end_loop:
- ret
+ local_return jmpstack
.end
@@ -520,51 +522,53 @@
.local string test_file
test_file = 're_tests'
- bsr reset_skip_info
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
+ local_branch jmpstack, reset_skip_info
$S0 = 'trailing modifiers'
$I0 = 264
$I1 = 395
- bsr set_range
+ local_branch jmpstack, set_range
$I0 = 458
$I1 = 480
- bsr set_range
+ local_branch jmpstack, set_range
skip_info[483] = $S0
skip_info[484] = $S0
skip_info[496] = $S0
$I0 = 609
$I1 = 617
- bsr set_range
+ local_branch jmpstack, set_range
$I0 = 627
$I1 = 635
- bsr set_range
+ local_branch jmpstack, set_range
$I0 = 645
$I1 = 653
- bsr set_range
+ local_branch jmpstack, set_range
$I0 = 663
$I1 = 671
- bsr set_range
+ local_branch jmpstack, set_range
$I0 = 681
$I1 = 689
- bsr set_range
+ local_branch jmpstack, set_range
$I0 = 699
$I1 = 707
- bsr set_range
+ local_branch jmpstack, set_range
$I0 = 717
$I1 = 725
- bsr set_range
+ local_branch jmpstack, set_range
$I0 = 735
$I1 = 743
- bsr set_range
+ local_branch jmpstack, set_range
$I0 = 753
$I1 = 761
- bsr set_range
+ local_branch jmpstack, set_range
$I0 = 771
$I1 = 779
- bsr set_range
+ local_branch jmpstack, set_range
$I0 = 789
$I1 = 797
- bsr set_range
+ local_branch jmpstack, set_range
skip_info[802] = $S0
skip_info[803] = $S0
skip_info[805] = $S0
@@ -626,7 +630,7 @@
skip_info[557] = $S0
$I0 = 568
$I1 = 592
- bsr set_range
+ local_branch jmpstack, set_range
skip_info[800] = $S0
skip_info[828] = $S0
skip_info[829] = $S0
@@ -637,7 +641,7 @@
$S0 = 'hangs a parrot'
$I0 = 806
$I1 = 823
- bsr set_range
+ local_branch jmpstack, set_range
skip_info[924] = $S0
$S0 = 'unknown reason'
@@ -661,7 +665,7 @@
reset_skip_info:
skip_info = new 'Hash'
- ret
+ local_return jmpstack
set_range: # for setting a range of tests
if $I0 > $I1 goto end_loop # put range min in $I0, max in $I1
@@ -673,7 +677,7 @@
goto set_range
end_loop:
$S0 = ''
- ret
+ local_return jmpstack
.end
Modified: branches/pluggable_runcore/t/compilers/pge/perl6regex/01-regex.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/pge/perl6regex/01-regex.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/compilers/pge/perl6regex/01-regex.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -93,7 +93,7 @@
has_icu = config['has_icu']
.local pmc file_iterator # iterate over list of files..
- file_iterator = new 'Iterator', test_files
+ file_iterator = iter test_files
.local int test_number # the number of the test we're running
test_number = 0
Modified: branches/pluggable_runcore/t/compilers/pge/pge_text.t
==============================================================================
--- branches/pluggable_runcore/t/compilers/pge/pge_text.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/compilers/pge/pge_text.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -33,43 +33,44 @@
load_bytecode 'PGE/Text.pbc'
bracketed = get_global ['PGE';'Text'], "bracketed"
-
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
$S0 = "{ nested { and } okay, () and <>, escaped \\}'s } okay"
$P0 = bracketed($S0)
- bsr result
+ local_branch jmpstack, result
$S0 = "{ nested \n{ and } okay, \n() and <>, escaped \\}'s } okay"
$P0 = bracketed($S0)
- bsr result
+ local_branch jmpstack, result
$S0 = "{ nested { and } okay, unbalanced ( and < , escaped \\}'s } okay"
$P0 = bracketed($S0, "{}")
- bsr result
+ local_branch jmpstack, result
$S0 = "{ unmatched nested { not okay, nor ( and < } not okay"
$P0 = bracketed($S0, "{}")
- bsr result
+ local_branch jmpstack, result
$S0 = "{ unbalanced nested [ even with } and ] to match not okay"
$P0 = bracketed($S0, "{}[]")
- bsr result
+ local_branch jmpstack, result
$S0 = "<a quoted \">\" unbalanced right bracket> okay"
$P0 = bracketed($S0, "<\">")
- bsr result
+ local_branch jmpstack, result
$S0 = "<quoted \">\" unbalanced of two quotes (`>>>\"\"\">>>>`)> okay"
$P0 = bracketed($S0, "<\"`>")
- bsr result
+ local_branch jmpstack, result
$S0 = "<a misquoted '>' bracket ends string>"
$P0 = bracketed($S0, "<\"`>")
- bsr result
+ local_branch jmpstack, result
.return ()
result:
if $P0 goto succeed
print "failed\n"
- ret
+ local_return jmpstack
succeed:
$I0 = $P0."to"()
$S1 = substr $S0, $I0
print $S1
print "\n"
- ret
+ local_return jmpstack
.end
CODE
okay
Copied: branches/pluggable_runcore/t/compilers/pge/regression.t (from r40540, trunk/t/compilers/pge/regression.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/compilers/pge/regression.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/compilers/pge/regression.t)
@@ -0,0 +1,60 @@
+#! perl
+# Copyright (C) 2001-2009, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( t . lib ../lib ../../lib );
+use Test::More;
+use Parrot::Test tests => 2;
+
+=head1 NAME
+
+t/compilers/pge/regression.t - PGE regression tests
+
+=head1 SYNOPSIS
+
+ % prove t/compilers/pge/regression.t
+
+=cut
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'load_bytecode with .pir (RT #39807)' );
+.sub main :main
+ load_bytecode 'PGE.pbc'
+ load_bytecode 'dumper.pir'
+ load_bytecode 'PGE/Dumper.pir'
+
+ $P0 = compreg 'PGE::P5Regex'
+ $P1 = $P0('aabb*')
+ $P2 = $P1('fooaabbbar')
+
+ _dumper($P2)
+.end
+CODE
+"VAR1" => PMC 'PGE;Match' => "aabbb" @ 3
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'load_bytecode with .pbc (RT #39807)' );
+.sub main :main
+ load_bytecode 'PGE.pbc'
+ load_bytecode 'dumper.pbc'
+ load_bytecode 'PGE/Dumper.pbc'
+
+ $P0 = compreg 'PGE::P5Regex'
+ $P1 = $P0('aabb*')
+ $P2 = $P1('fooaabbbar')
+
+ _dumper($P2)
+.end
+CODE
+"VAR1" => PMC 'PGE;Match' => "aabbb" @ 3
+OUTPUT
+
+
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
Modified: branches/pluggable_runcore/t/configure/008-file_based_configuration.t
==============================================================================
--- branches/pluggable_runcore/t/configure/008-file_based_configuration.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/configure/008-file_based_configuration.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -17,7 +17,7 @@
use Parrot::Configure::Options qw| process_options |;
{
- my $configfile = q{xconf/samples/testfoobar};
+ my $configfile = q{examples/config/file/configwithfatalstep};
my ($args, $steps_list_ref) = _test_good_config_file($configfile);
ok(! defined $args->{maintainer},
@@ -40,7 +40,7 @@
}
{
- my $configfile = q{xconf/samples/yourfoobar};
+ my $configfile = q{examples/config/file/configcompiler};
my ($args, $steps_list_ref) = _test_good_config_file($configfile);
my $c_compiler = '/usr/bin/gcc';
Copied: branches/pluggable_runcore/t/dynoplibs/math.t (from r40540, trunk/t/dynoplibs/math.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/dynoplibs/math.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/dynoplibs/math.t)
@@ -0,0 +1,82 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/dynoplibs/math.t - Tests for mathematical ops
+
+=head1 SYNOPSIS
+
+ % prove t/dynoblibs/math.t
+
+=head1 DESCRIPTION
+
+Tests math.ops
+
+=cut
+
+.loadlib 'math_ops'
+.sub main :main
+ .include 'test_more.pir'
+ plan(7)
+ ok(1, "load math_ops")
+ basic_test_1_arg()
+ basic_test_2_arg()
+ basic_test_3_arg()
+.end
+
+.sub basic_test_1_arg
+ rand $N0
+ lt $N0, 0, fail1
+ ok(1, 'rand returns a number greater than or equal to 0')
+ goto upper
+fail1:
+ ok(0, 'rand returns a number greater than or equal to 0')
+upper:
+ gt $N0, 1, fail2
+ ok(1, 'rand returns a number less than or equal to 1')
+ goto finish
+fail2:
+ ok(0, 'rand returns a number less than or equal to 1')
+finish:
+.end
+
+.sub basic_test_2_arg
+ rand $N0, 5
+ lt $N0, 0, fail1
+ ok(1, 'rand returns a number greater than or equal to 0')
+ goto upper
+fail1:
+ ok(0, 'rand returns a number greater than or equal to 0')
+upper:
+ gt $N0, 5, fail2
+ ok(1, 'rand returns a number less than or equal to 5')
+ goto finish
+fail2:
+ ok(0, 'rand returns a number less than or equal to 5')
+finish:
+.end
+
+.sub basic_test_3_arg
+ rand $N0, 5, 25
+ lt $N0, 5, fail1
+ ok(1, 'rand returns a number greater than or equal to 5')
+ goto upper
+fail1:
+ ok(0, 'rand returns a number greater than or equal to 5')
+upper:
+ gt $N0, 25, fail2
+ ok(1, 'rand returns a number less than or equal to 25')
+ goto finish
+fail2:
+ ok(0, 'rand returns a number less than or equal to 25')
+finish:
+.end
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 filetype=pir:
Copied: branches/pluggable_runcore/t/dynoplibs/obscure.t (from r40540, trunk/t/dynoplibs/obscure.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/dynoplibs/obscure.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/dynoplibs/obscure.t)
@@ -0,0 +1,106 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/dynoplibs/obscure.t - Tests for obscure mathematical functions
+
+=head1 SYNOPSIS
+
+ % prove t/dynoblibs/obscure.t
+
+=head1 DESCRIPTION
+
+Tests obscure.ops
+
+=cut
+
+.loadlib 'obscure_ops'
+.sub main :main
+ .include 'fp_equality.pasm'
+ .include 'test_more.pir'
+ plan(17)
+ ok(1,"load obscure_ops")
+
+ test_covers()
+ test_vers()
+ test_hav()
+ test_exsec()
+.end
+
+.sub test_covers
+ .local num x, pi, halfpi, y
+ y = atan 1.0, 1.0
+ halfpi = y
+ halfpi *= 2
+ pi = halfpi
+ pi *= 2
+ covers x, 0
+ .fp_eq_ok(x, 1, "covers of 0")
+ covers x, halfpi
+ .fp_eq_ok(x, 0, 'covers of pi/2')
+ covers x, pi
+ .fp_eq_ok(x, 1, 'covers of pi')
+ covers x, y
+ .fp_eq_ok(x, 0.292893218813453, 'covers of pi/4')
+.end
+
+.sub test_vers
+ .local num x, pi, halfpi, y
+ y = atan 1.0, 1.0
+ halfpi = y
+ halfpi *= 2
+ pi = halfpi
+ pi *= 2
+ vers x, 0
+ .fp_eq_ok(x, 0, "vers of 0")
+ vers x, halfpi
+ .fp_eq_ok(x, 1, 'vers of pi/2')
+ vers x, pi
+ .fp_eq_ok(x, 2, 'vers of pi')
+ vers x, y
+ .fp_eq_ok(x, 0.292893218813453, 'covers of pi/4')
+.end
+
+.sub test_hav
+ .local num x, pi, halfpi, y
+ y = atan 1.0, 1.0
+ halfpi = y
+ halfpi *= 2
+ pi = halfpi
+ pi *= 2
+ hav x, 0
+ .fp_eq_ok(x, 0, "hav of 0")
+ hav x, halfpi
+ .fp_eq_ok(x, 0.5, 'hav of pi/2')
+ hav x, pi
+ .fp_eq_ok(x, 1, 'hav of pi')
+ hav x, y
+ .fp_eq_ok(x, 0.146446609406726, 'hav of pi/4')
+.end
+
+.sub test_exsec
+ .local num x, pi, halfpi, y
+ y = atan 1.0, 1.0
+ halfpi = y
+ halfpi *= 2
+ pi = halfpi
+ pi *= 2
+ hav x, 0
+ .fp_eq_ok(x, 0, "exsec of 0")
+ exsec x, halfpi
+ .fp_eq_ok(x, 'nan', 'exsec of pi/2')
+ exsec x, pi
+ .fp_eq_ok(x, -2, 'exsec of pi')
+ exsec x, y
+ .fp_eq_ok(x, 0.414213562373095, 'exsec of pi/4')
+.end
+
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 filetype=pir:
Modified: branches/pluggable_runcore/t/dynpmc/dynlexpad.t
==============================================================================
--- branches/pluggable_runcore/t/dynpmc/dynlexpad.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/dynpmc/dynlexpad.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -228,7 +228,7 @@
dlp = interp['lexpad']
say "Getting iterator"
- it = new 'Iterator', dlp
+ it = iter dlp
say "Have iterator"
iter_loop:
unless it goto iter_done
Modified: branches/pluggable_runcore/t/dynpmc/foo.t
==============================================================================
--- branches/pluggable_runcore/t/dynpmc/foo.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/dynpmc/foo.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -26,7 +26,7 @@
pir_output_is( << 'CODE', << 'OUTPUT', "get_integer" );
.sub main :main
- loadlib $P1, "foo"
+ loadlib $P1, "foo_group"
$P1 = new "Foo"
$I1 = $P1
@@ -41,7 +41,7 @@
.sub main :main
## load a relative pathname without the extension. loadlib will convert the
## '/' characters to '\\' on windows.
- $S0 = "runtime/parrot/dynext/foo"
+ $S0 = "runtime/parrot/dynext/foo_group"
loadlib $P1, $S0
## ensure that we can still make Foo instances.
@@ -65,7 +65,7 @@
## convert cwd to an absolute pathname without the extension, and load it.
## this should always find the version in the build directory, since that's
## the only place "make test" will work.
- $S0 = concat "/runtime/parrot/dynext/foo"
+ $S0 = concat "/runtime/parrot/dynext/foo_group"
loadlib $P1, $S0
## ensure that we can still make Foo instances.
@@ -87,7 +87,7 @@
$S0 = $P12["load_ext"]
## load a relative pathname with an extension.
- $S0 = concat "runtime/parrot/dynext/foo", $S0
+ $S0 = concat "runtime/parrot/dynext/foo_group", $S0
loadlib $P1, $S0
## ensure that we can still make Foo instances.
@@ -112,7 +112,7 @@
## convert $S0 to an absolute pathname with extension, and load it.
## this should always find the version in the build directory, since that's
## the only place "make test" will work.
- $S0 = concat $S0, "/runtime/parrot/dynext/foo"
+ $S0 = concat $S0, "/runtime/parrot/dynext/foo_group"
$S0 = concat $S0, $S1
loadlib $P1, $S0
@@ -132,7 +132,7 @@
pir_output_is( << 'CODE', << 'OUTPUT', "inherited add" );
.sub _main :main
.local pmc d, l, r
- $P0 = loadlib "foo"
+ $P0 = loadlib "foo_group"
print "ok\n"
l = new "Foo"
l = 42
@@ -157,7 +157,7 @@
pir_output_is( <<'CODE', <<'OUTPUT', "Foo subclass isa Integer" );
.sub main :main
.local pmc F, f, d, r
- loadlib F, "foo"
+ loadlib F, "foo_group"
f = new "Foo"
f = 1
d = new 'Integer'
@@ -175,7 +175,7 @@
# load our Foo test (pseudo) language
# it defines one PMC type "Foo"
.HLL "Fool"
-.loadlib "foo"
+.loadlib "foo_group"
.sub main :main
new $P1, "Foo" # load by name
$I1 = $P1
@@ -188,7 +188,7 @@
pir_output_is( << 'CODE', << 'OUTPUT', ".HLL 2" );
.HLL "Fool"
-.loadlib "foo"
+.loadlib "foo_group"
.sub main :main
new $P1, 'Foo' # load by index
$I1 = $P1
Copied: branches/pluggable_runcore/t/dynpmc/foo2.t (from r40540, trunk/t/dynpmc/foo2.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/dynpmc/foo2.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/dynpmc/foo2.t)
@@ -0,0 +1,44 @@
+#! perl
+# Copyright (C) 2005, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+use Test::More;
+use Parrot::Test tests => 1;
+use Parrot::Config;
+
+=head1 NAME
+
+t/dynpmc/foo.t - Test for a very simple dynamic PMC
+
+=head1 SYNOPSIS
+
+ % prove t/dynpmc/foo.t
+
+=head1 DESCRIPTION
+
+Tests the Foo PMC.
+
+=cut
+
+pir_output_is( << 'CODE', << 'OUTPUT', "dynpmcs can use SUPER to call parent dynpmc VTABLE functions" );
+
+.sub main :main
+ $P0 = loadlib 'foo_group'
+ $P1 = new "Foo2"
+
+ $I1 = $P1
+ say $I1
+.end
+CODE
+43
+OUTPUT
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
Deleted: branches/pluggable_runcore/t/dynpmc/pair.t
==============================================================================
--- branches/pluggable_runcore/t/dynpmc/pair.t Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,85 +0,0 @@
-#! parrot
-# Copyright (C) 2001-2009, Parrot Foundation.
-# $Id$
-
-.const int NUM_OF_TESTS = 8
-
-.sub main :main
- loadlib $P1, 'pair'
- load_bytecode 'Test/More.pbc'
-
- .local pmc plan, is, ok
- plan = get_hll_global [ 'Test'; 'More' ], 'plan'
- is = get_hll_global [ 'Test'; 'More' ], 'is'
- ok = get_hll_global [ 'Test'; 'More' ], 'ok'
-
- # set a test plan
- plan(NUM_OF_TESTS)
-
- new $P0, ['Pair']
- ok(1, "still alive")
- new $P1, ['Integer']
- set $P1, 42
- set $P0["key"], $P1
- ok(1, "still alive")
- set $P2, $P0["key"]
- is($P2, 42, "fetching value")
-
- .local pmc p, kv
- new p, ['Pair']
- new $P1, ['Integer']
- set $P1, 42
- set p["key"], $P1
-
- $P0 = p."key"()
- is( $P0, 'key', 'get key' )
- $P0 = p."value"()
- is( $P0, 42, 'get key' )
- kv = p."kv"()
- $I0 = elements kv
- is( $I0, 2, 'number of elements returned from "kv"' )
- $P0 = kv[0]
- is( $P0, 'key', 'first element returned from "kv"' )
- $P0 = kv[1]
- is( $P0, 42, 'third element returned from "kv"' )
-.end
-
-=for get it
-
-SKIP: {
- skip( "instantiate disabled", 1 );
- pir_output_is( <<'CODE', <<'OUT', 'instantiate, assign' );
-.sub main :main
- .local pmc cl, p, kv, k, v
- k = new ['String']
- k = "key"
- v = new ['String']
- v = "value"
- cl = get_class "Pair"
- p = cl."instantiate"(k, v)
-
- $P0 = p."key"()
- print $P0
- print ' '
- $P0 = p."value"()
- print $P0
- print ' '
-
- v = new ['Integer']
- v = 77
- assign p, v
- $P0 = p."value"()
- say $P0
-.end
-CODE
-key value 77
-OUT
-}
-
-=cut
-
-# Local Variables:
-# mode: pir
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/t/examples/namespace.t
==============================================================================
--- branches/pluggable_runcore/t/examples/namespace.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/examples/namespace.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -33,13 +33,13 @@
# Set up expected output for examples
# cannot test the exact result, just adding one method somewhere
-# changes all. Also namespaces are hashes. While we preserve
-# insert order, we do not gurantee any specific order.
-# test the name of the 2 toplevel names, parrot is using
+# changes all. Also namespaces are hashes. And we do not gurantee any specific
+# order of keys. test the name of the 2 toplevel names, parrot is using
my %expected = (
'namespace_dump.pir' => << 'END_EXPECTED',
-/^parrot.*
-^MULTI\s=>\sMULTI/sm
+/(?:^parrot.*
+^MULTI\s=>\sMULTI)|(?:^MULTI\s=>\sMULTI.*
+^parrot.*)/sm
END_EXPECTED
);
Modified: branches/pluggable_runcore/t/examples/pir.t
==============================================================================
--- branches/pluggable_runcore/t/examples/pir.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/examples/pir.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,5 +1,5 @@
#!perl
-# Copyright (C) 2005-2006, Parrot Foundation.
+# Copyright (C) 2005-2009, Parrot Foundation.
# $Id$
use strict;
@@ -266,7 +266,7 @@
## Added test this way, so we can have more interesting tests.
pir_output_is( <<'CODE', <<OUTPUT, "Test Levenshtein example" );
-.include "../../examples/pir/levenshtein.pir"
+.include "examples/pir/levenshtein.pir"
.sub main :main
$S1 = "purl"
$S2 = "perl"
Modified: branches/pluggable_runcore/t/examples/pod.t
==============================================================================
--- branches/pluggable_runcore/t/examples/pod.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/examples/pod.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -159,7 +159,7 @@
=item * FRAGMENT
-For PIR, wraps the code in a C<.sub> block to
+For PIR, wraps the code in a C<.sub> block.
=item * TODO
Modified: branches/pluggable_runcore/t/examples/subs.t
==============================================================================
--- branches/pluggable_runcore/t/examples/subs.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/examples/subs.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -6,7 +6,7 @@
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 7;
+use Parrot::Test tests => 5;
use Parrot::Config;
=head1 NAME
@@ -31,14 +31,6 @@
# Set up expected output for examples
my %expected = (
- 'bsr_ret.pasm' => << 'END_EXPECTED',
-Main
-TestSub
-NestSub
-TestSub: Ret from NestSub
-Main: Return from TestSub
-END_EXPECTED
-
'coroutine.pasm' => << 'END_EXPECTED',
Calling 1st co-routine
Entry
@@ -50,19 +42,6 @@
Done
END_EXPECTED
- 'jsr_ret.pasm' => << 'END_EXPECTED',
-Example of the jump op.
-
-Jumping to subroutine SUB_1.
-Entered subroutine SUB_1.
-Returning from subroutine SUB_1.
-Returned from subroutine SUB_1.
-Jumping to subroutine SUB_2.
-Entered subroutine SUB_2.
-Returning from subroutine SUB_2.
-Returned from subroutine SUB_2.
-END_EXPECTED
-
'pasm_sub1.pasm' => << 'END_EXPECTED',
Hello from subroutine
Hello from main
Copied: branches/pluggable_runcore/t/include/fp_equality.t (from r40540, trunk/t/include/fp_equality.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/include/fp_equality.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/include/fp_equality.t)
@@ -0,0 +1,43 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/include/fp_equality.t - Test runtime/parrot/include/fp_equality.pasm
+
+=head1 SYNOPSIS
+
+ % prove t/include/fp_equality.t
+
+=head1 DESCRIPTION
+
+Tests fp_* functions.
+
+=cut
+
+.sub main :main
+ .include 'fp_equality.pasm'
+ .include 'test_more.pir'
+ .local num epsilon, zplus, zminus
+ .local num oplus, ominus
+ plan(4)
+ epsilon = 0.00000005
+ oplus = 1 + epsilon
+ ominus = 1 - epsilon
+ zplus = 0 + epsilon
+ zminus = 0 - epsilon
+
+ .fp_eq_ok(zplus, 0, 'zero')
+ .fp_eq_ok(0, zplus, 'zero')
+
+ .fp_eq_ok(oplus, 1, 'one')
+ .fp_eq_ok(1, oplus, 'one')
+
+.end
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/t/library/mime_base64.t
==============================================================================
--- branches/pluggable_runcore/t/library/mime_base64.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/library/mime_base64.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -332,7 +332,7 @@
.local pmc test_iterator, test_case
.local string plain, base64, comment, comment_cnt
- test_iterator = new 'Iterator', encode_decode_tests
+ test_iterator = iter encode_decode_tests
enc_dec_loop:
unless test_iterator goto enc_dec_loop_end
test_case = shift test_iterator
@@ -350,7 +350,7 @@
goto enc_dec_loop
enc_dec_loop_end:
- test_iterator = new 'Iterator', decode_tests
+ test_iterator = iter decode_tests
dec_loop:
unless test_iterator goto dec_loop_end
test_case = shift test_iterator
Modified: branches/pluggable_runcore/t/library/pcre.t
==============================================================================
--- branches/pluggable_runcore/t/library/pcre.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/library/pcre.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -7,7 +7,7 @@
use lib qw( t . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 1;
+use Parrot::Test tests => 2;
=head1 NAME
@@ -46,9 +46,65 @@
unless $has_pcre;
## 1
+## Check that the library can be loaded and initialized,
+## diganose the failure otherwise.
+ pir_output_is(<<"CODE", <<'OUT', 'libpcre loading');
+
+.include 'iglobals.pasm'
+.include 'libpaths.pasm'
+
+.sub main :main
+ .local pmc interp
+ getinterp interp
+
+ .local pmc lib_paths
+ lib_paths = interp[.IGLOBALS_LIB_PATHS]
+
+ .local pmc dynext_path
+ dynext_path = lib_paths[.PARROT_LIB_PATH_DYNEXT]
+ unshift dynext_path, '$pcre_libpath'
+
+ load_bytecode 'pcre.pbc'
+ .local pmc pcre_init
+ .local pmc pcre_lib
+
+ get_global pcre_init, ['PCRE'], 'init'
+ if null pcre_init goto NOINIT
+ push_eh CATCH
+ pcre_lib = pcre_init()
+ pop_eh
+ if null pcre_lib goto NULLINIT
+ unless pcre_lib goto FALSEINIT
+ say 'Loaded'
+ .return()
+CATCH:
+ .local pmc exception
+ .get_results(exception)
+ .local string message
+ message = exception['message']
+ pop_eh
+ say message
+ .return()
+NOINIT:
+ say 'No init function'
+ .return()
+NULLINIT:
+ say 'init returned null value'
+ .return()
+FALSEINIT:
+ say 'init returned false value'
+ .return()
+.end
+
+CODE
+Loaded
+OUT
+
+## 2
pir_output_is( <<"CODE", <<'OUT', 'soup to nuts' );
.include 'iglobals.pasm'
+.include 'libpaths.pasm'
.sub main :main
.local pmc interp
@@ -57,9 +113,8 @@
.local pmc lib_paths
lib_paths = interp[.IGLOBALS_LIB_PATHS]
- # TT #747 - hard-coded magic constant (should be PARROT_LIB_PATH_DYNEXT)
.local pmc dynext_path
- dynext_path = lib_paths[2]
+ dynext_path = lib_paths[.PARROT_LIB_PATH_DYNEXT]
unshift dynext_path, '$pcre_libpath'
load_bytecode 'pcre.pbc'
Modified: branches/pluggable_runcore/t/library/protoobject.t
==============================================================================
--- branches/pluggable_runcore/t/library/protoobject.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/library/protoobject.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -143,12 +143,12 @@
attrs = split ' ', '$a $b $c $d'
protomaker.'new_subclass'(hashclass, 'Foo::Bar', attrs :flat)
- .local pmc object, iter
+ .local pmc object, it
object = new 'Foo::Bar'
- iter = new 'Iterator', attrs
+ it = iter attrs
iter_loop:
- unless iter goto iter_end
- $P0 = shift iter
+ unless it goto iter_end
+ $P0 = shift it
$S0 = $P0
setattribute object, $S0, $P0
$P1 = getattribute object, $S0
Modified: branches/pluggable_runcore/t/native_pbc/annotations.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pluggable_runcore/t/native_pbc/integer_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pluggable_runcore/t/native_pbc/number_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pluggable_runcore/t/native_pbc/number_2.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pluggable_runcore/t/native_pbc/string_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pluggable_runcore/t/oo/metamodel.t
==============================================================================
--- branches/pluggable_runcore/t/oo/metamodel.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/oo/metamodel.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -109,13 +109,12 @@
.sub init_pmc :vtable :method
.param pmc init_args
# Iterate over the constructor arguments, calling the accessor for each
- .local pmc iter
- iter = new 'Iterator', init_args
- iter = 0
+ .local pmc it
+ it = iter init_args
iter_loop:
- unless iter goto iter_end
- $S1 = shift iter
- $P1 = iter[$S1]
+ unless it goto iter_end
+ $S1 = shift it
+ $P1 = it[$S1]
self.$S1($P1)
goto iter_loop
iter_end:
Modified: branches/pluggable_runcore/t/op/basic.t
==============================================================================
--- branches/pluggable_runcore/t/op/basic.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/op/basic.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -6,7 +6,7 @@
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 24;
+use Parrot::Test tests => 23;
=head1 NAME
@@ -97,22 +97,6 @@
end
CODE
-pasm_output_is( <<'CODE', <<'OUTPUT', "bsr_i" );
- print "start\n"
-
- bsr LAB1
-
- print "done\n"
- end
-
-LAB1: print "lab 1\n"
- ret
-CODE
-start
-lab 1
-done
-OUTPUT
-
pasm_output_is( <<'CODE', <<'OUTPUT', "local_branch_c_i" );
print "start\n"
Modified: branches/pluggable_runcore/t/op/cmp-nonbranch.t
==============================================================================
--- branches/pluggable_runcore/t/op/cmp-nonbranch.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/op/cmp-nonbranch.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -22,15 +22,15 @@
.macro EXP()
exp_nok:
exp = 0
- ret
+ local_return jmpstack
exp_ok:
exp = 1
- ret
+ local_return jmpstack
.endm
.macro TEST()
is( res, exp, desc )
- ret
+ local_return jmpstack
.endm
.macro SET_DESC(op)
@@ -72,22 +72,24 @@
.sub 'issame'
.local int exp, res
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
.SET_DESC('issame')
init:
$P0 = new 'Integer'
$P1 = new 'String'
- bsr exp_nok
- bsr test_it # not ok
+ local_branch jmpstack, exp_nok
+ local_branch jmpstack, test_it # not ok
$P0 = new 'String'
- bsr test_it # not ok
- bsr exp_ok
+ local_branch jmpstack, test_it # not ok
+ local_branch jmpstack, exp_ok
$P1 = $P0
- bsr test_it # ok
+ local_branch jmpstack, test_it # ok
$P0 = new 'Null'
$P1 = new 'Null'
- bsr test_it # ok -- Null is a singleton
- .return ()
+ local_branch jmpstack, test_it # ok -- Null is a singleton
+ .return()
.EXP()
test_it:
@@ -98,22 +100,24 @@
.sub 'isntsame'
.local int exp, res
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
.SET_DESC('isntsame')
init:
$P0 = new 'Integer'
$P1 = new 'String'
- bsr exp_ok
- bsr test_it # ok
+ local_branch jmpstack, exp_ok
+ local_branch jmpstack, test_it # ok
$P0 = new 'String'
- bsr test_it # ok
+ local_branch jmpstack, test_it # ok
$P1 = $P0
- bsr exp_nok
- bsr test_it # not ok
+ local_branch jmpstack, exp_nok
+ local_branch jmpstack, test_it # not ok
$P0 = new 'Null'
$P1 = new 'Null'
- bsr test_it # not ok -- Null is a singleton
- .return ()
+ local_branch jmpstack, test_it # not ok -- Null is a singleton
+ .return()
.EXP()
test_it:
@@ -124,17 +128,19 @@
.sub 'istrue'
.local int exp, res
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
.SET_DESC('istrue')
init:
$P0 = new 'Integer'
$P0 = 0
- bsr exp_nok
- bsr test_it # not ok
+ local_branch jmpstack, exp_nok
+ local_branch jmpstack, test_it # not ok
$P0 = 1
- bsr exp_ok
- bsr test_it # ok
- .return ()
+ local_branch jmpstack, exp_ok
+ local_branch jmpstack, test_it # ok
+ .return()
.EXP()
test_it:
@@ -145,17 +151,19 @@
.sub 'isfalse'
.local int exp, res
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
.SET_DESC('isfalse')
init:
$P0 = new 'Integer'
$P0 = 0
- bsr exp_ok
- bsr test_it # ok
+ local_branch jmpstack, exp_ok
+ local_branch jmpstack, test_it # ok
$P0 = 1
- bsr exp_nok
- bsr test_it # not ok
- .return ()
+ local_branch jmpstack, exp_nok
+ local_branch jmpstack, test_it # not ok
+ .return()
.EXP()
test_it:
@@ -166,18 +174,20 @@
.sub 'isnull_pmc'
.local int exp, res
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
.SET_DESC('isnull pmc')
init:
$S0 = 'FUBAR'
- bsr exp_ok
- bsr test_it
+ local_branch jmpstack, exp_ok
+ local_branch jmpstack, test_it
$S0 = 'Null' # this is a valid pmc type -- you can't trick parrot :)
- bsr exp_nok
- bsr test_it
+ local_branch jmpstack, exp_nok
+ local_branch jmpstack, test_it
$S0 = 'Integer'
- bsr test_it
- .return ()
+ local_branch jmpstack, test_it
+ .return()
.EXP()
test_it:
Modified: branches/pluggable_runcore/t/op/gc.t
==============================================================================
--- branches/pluggable_runcore/t/op/gc.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/op/gc.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -533,17 +533,20 @@
reg[b] = nil
reg[c] = nil
+ $P1 = new ['ResizablePMCArray']
it = iter reg
loop:
unless it goto done
$P0 = shift it
- print $P0
+ $S0 = $P0
+ push $P1, $S0
goto loop
done:
+ $P1.'sort'()
+ $S1 = join '', $P1
+ print $S1
print "\n"
.end
-# the current hash implementation returns entries in order
-# for a few keys, and if there were no deletes
CODE
k1k2k3
OUTPUT
Modified: branches/pluggable_runcore/t/op/io.t
==============================================================================
--- branches/pluggable_runcore/t/op/io.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/op/io.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -96,7 +96,8 @@
unless pipe goto open_pipe_for_reading_failed
.local string line
line = readline pipe
- like('This is Parrot', ":s This is Parrot", 'open pipe for reading')
+ line = substr line, 0, 14
+ is('This is Parrot', line, 'open pipe for reading')
.return ()
open_pipe_for_reading_failed:
Modified: branches/pluggable_runcore/t/op/jit.t
==============================================================================
--- branches/pluggable_runcore/t/op/jit.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/op/jit.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -6,7 +6,7 @@
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 62;
+use Parrot::Test tests => 61;
=head1 NAME
@@ -876,13 +876,14 @@
set I0, 42
print I0
print "\n"
- bsr sub
+ new P0, 'ResizableIntegerArray'
+ local_branch P0, sub
end
sub:
set I0, 43
print I0
print "\n"
- ret
+ local_return P0
CODE
42
43
@@ -907,11 +908,12 @@
set I0, 42
print I0
print "\n"
- bsr sub
+ new P0, 'ResizableIntegerArray'
+ local_branch P0, sub
end
sub:
print "ok\n"
- ret
+ local_return P0
CODE
42
ok
@@ -929,19 +931,6 @@
Jump succeeded
OUTPUT
-pasm_output_is( <<'CODE', <<'OUTPUT', "jsr" );
- set_addr I1, FOO
- jsr I1
- print "and back again\n"
- end
-
-FOO: print "There "
- ret
-
-CODE
-There and back again
-OUTPUT
-
pasm_output_is( <<'CODE', <<'OUTPUT', "last is branch" );
print "ok 1\n"
branch l2
Modified: branches/pluggable_runcore/t/op/lexicals.t
==============================================================================
--- branches/pluggable_runcore/t/op/lexicals.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/op/lexicals.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,5 +1,5 @@
#!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
use strict;
@@ -14,7 +14,7 @@
plan( skip_all => 'lexicals not thawed properly from PBC, RT #60652' )
if $ENV{TEST_PROG_ARGS} =~ /--run-pbc/;
-plan( tests => 47 );
+plan( tests => 48 );
=head1 NAME
@@ -1465,6 +1465,34 @@
# ]
OUTPUT
+pir_output_is( <<'CODE', <<'OUTPUT', 'TT #536: lexical sub lookup' );
+.sub 'main'
+ .const 'Sub' $P0 = 'lexfoo'
+ .lex 'foo1', $P0
+ .lex 'foo2', $P0
+
+ 'foo1'(1)
+ 'foo2'(2)
+.end
+
+.sub 'lexfoo'
+ .param int count
+ print 'ok '
+ print count
+ say ' - looking up lexical sub'
+.end
+
+.sub 'foo2'
+ .param int count
+ print 'not ok '
+ print count
+ say ' - looked up global sub, not lexical'
+.end
+CODE
+ok 1 - looking up lexical sub
+ok 2 - looking up lexical sub
+OUTPUT
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Modified: branches/pluggable_runcore/t/op/sprintf.t
==============================================================================
--- branches/pluggable_runcore/t/op/sprintf.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/op/sprintf.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -61,8 +61,6 @@
.sub main :main
load_bytecode 'Test/Builder.pbc'
- load_bytecode 'PGE.pbc'
- load_bytecode 'PGE/Dumper.pbc'
.include "iglobals.pasm"
.include "sysinfo.pasm"
@@ -87,7 +85,7 @@
.local pmc file_iterator # iterate over list of files..
- file_iterator = new 'Iterator', test_files
+ file_iterator = iter test_files
.local int test_number # the number of the test we're running
test_number = 0
@@ -284,10 +282,12 @@
.local pmc todo_info
todo_info = new 'Hash'
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
.local string test_file
- bsr reset_todo_info
+ local_branch jmpstack, reset_todo_info
test_file = 'sprintf_tests'
# TODOs
todo_info[64] = 'undecided perl5 vs. posix behavior'
@@ -306,7 +306,7 @@
reset_todo_info:
todo_info = new 'Hash'
- ret
+ local_return jmpstack
set_todo_loop:
if $I0 > $I1 goto end_loop
@@ -314,7 +314,7 @@
$I0 += 1
goto set_todo_loop
end_loop:
- ret
+ local_return jmpstack
.end
@@ -325,10 +325,12 @@
.local pmc skip_info
skip_info = new 'Hash'
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
.local string test_file
- bsr reset_skip_info
+ local_branch jmpstack, reset_skip_info
test_file = 'sprintf_tests'
skip_info[5] = 'parrot extension (%B)'
skip_info[7] = 'perl5-specific extension (%D)'
@@ -343,7 +345,7 @@
$S0 = 'perl5-specific extension (%v...)'
$I0 = 71
$I1 = 99
- bsr set_skip_loop
+ local_branch jmpstack, set_skip_loop
skip_info[114] = 'harness needs support for * modifier'
skip_info[144] = 'perl5 expresssion as test value'
@@ -366,12 +368,12 @@
$S0 = 'perl5-specific test'
$I0 = 238
$I1 = 251
- bsr set_skip_loop
+ local_branch jmpstack, set_skip_loop
$S0 = 'perl5-specific extension (%v...)'
$I0 = 252
$I1 = 298
- bsr set_skip_loop
+ local_branch jmpstack, set_skip_loop
skip_info[307] = 'perl5-specific extension (%v...)'
skip_info[308] = 'perl5-specific extension (%v...)'
@@ -382,7 +384,7 @@
reset_skip_info:
skip_info = new 'Hash'
- ret
+ local_return jmpstack
set_skip_loop:
if $I0 > $I1 goto end_loop
@@ -394,7 +396,7 @@
goto set_skip_loop
end_loop:
$S0 = ''
- ret
+ local_return jmpstack
.end
@@ -478,16 +480,16 @@
.local pmc skip_os
skip_os = split ' ', skip_list
- .local pmc iter
- iter = new 'Iterator', skip_os
+ .local pmc it
+ it = iter skip_os
.local string osname
osname = sysinfo .SYSINFO_PARROT_OS
iter_loop:
- unless iter goto iter_end
+ unless it goto iter_end
.local string os_name
- os_name = shift iter
+ os_name = shift it
eq os_name, osname, skip_it
goto iter_loop
iter_end:
Modified: branches/pluggable_runcore/t/op/string.t
==============================================================================
--- branches/pluggable_runcore/t/op/string.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/op/string.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -1783,120 +1783,121 @@
NEWARYP:
new P1, 'ResizablePMCArray'
set P1[0], P0
- ret
+ local_return P4
NEWARYS:
new P1, 'ResizablePMCArray'
set P1[0], S0
- ret
+ local_return P4
NEWARYI:
new P1, 'ResizablePMCArray'
set P1[0], I0
- ret
+ local_return P4
NEWARYN:
new P1, 'ResizablePMCArray'
set P1[0], N0
- ret
+ local_return P4
PRINTF:
sprintf S2, S1, P1
print S2
- ret
+ local_return P4
MAIN:
+ new P4, 'ResizableIntegerArray'
set S1, "Hello, %s\n"
set S0, "Parrot!"
- bsr NEWARYS
- bsr PRINTF
+ local_branch P4, NEWARYS
+ local_branch P4, PRINTF
set S1, "Hash[0x%x]\n"
set I0, 256
- bsr NEWARYI
- bsr PRINTF
+ local_branch P4, NEWARYI
+ local_branch P4, PRINTF
set S1, "Hash[0x%lx]\n"
set I0, 256
- bsr NEWARYI
- bsr PRINTF
+ local_branch P4, NEWARYI
+ local_branch P4, PRINTF
set S1, "Hello, %.2s!\n"
set S0, "Parrot"
- bsr NEWARYS
- bsr PRINTF
+ local_branch P4, NEWARYS
+ local_branch P4, PRINTF
set S1, "Hello, %Ss"
set S0, S2
- bsr NEWARYS
- bsr PRINTF
+ local_branch P4, NEWARYS
+ local_branch P4, PRINTF
set S1, "1 == %Pd\n"
new P0, 'Integer'
set P0, 1
- bsr NEWARYP
- bsr PRINTF
+ local_branch P4, NEWARYP
+ local_branch P4, PRINTF
set S1, "-255 == %vd\n"
set I0, -255
- bsr NEWARYI
- bsr PRINTF
+ local_branch P4, NEWARYI
+ local_branch P4, PRINTF
set S1, "+123 == %+vd\n"
set I0, 123
- bsr NEWARYI
- bsr PRINTF
+ local_branch P4, NEWARYI
+ local_branch P4, PRINTF
set S1, "256 == %vu\n"
set I0, 256
- bsr NEWARYI
- bsr PRINTF
+ local_branch P4, NEWARYI
+ local_branch P4, PRINTF
set S1, "1 == %+vu\n"
set I0, 1
- bsr NEWARYI
- bsr PRINTF
+ local_branch P4, NEWARYI
+ local_branch P4, PRINTF
set S1, "001 == %0.3u\n"
set I0, 1
- bsr NEWARYI
- bsr PRINTF
+ local_branch P4, NEWARYI
+ local_branch P4, PRINTF
set S1, "001 == %+0.3u\n"
set I0, 1
- bsr NEWARYI
- bsr PRINTF
+ local_branch P4, NEWARYI
+ local_branch P4, PRINTF
set S1, "0.500000 == %f\n"
set N0, 0.5
- bsr NEWARYN
- bsr PRINTF
+ local_branch P4, NEWARYN
+ local_branch P4, PRINTF
set S1, "0.500 == %5.3f\n"
set N0, 0.5
- bsr NEWARYN
- bsr PRINTF
+ local_branch P4, NEWARYN
+ local_branch P4, PRINTF
set S1, "0.001 == %g\n"
set N0, 0.001
- bsr NEWARYN
- bsr PRINTF
+ local_branch P4, NEWARYN
+ local_branch P4, PRINTF
set S1, "1e+06 == %g\n"
set N0, 1.0e6
- bsr NEWARYN
- bsr PRINTF
+ local_branch P4, NEWARYN
+ local_branch P4, PRINTF
set S1, "0.5 == %3.3g\n"
set N0, 0.5
- bsr NEWARYN
- bsr PRINTF
+ local_branch P4, NEWARYN
+ local_branch P4, PRINTF
set S1, "%% == %%\n"
set I0, 0
- bsr NEWARYI
- bsr PRINTF
+ local_branch P4, NEWARYI
+ local_branch P4, PRINTF
set S1, "That's all, %s\n"
set S0, "folks!"
- bsr NEWARYS
- bsr PRINTF
+ local_branch P4, NEWARYS
+ local_branch P4, PRINTF
end
CODE
@@ -1927,22 +1928,23 @@
PRINTF:
sprintf P3, P2, P1
print P3
- ret
+ local_return P4
MAIN:
+ new P4, 'ResizableIntegerArray'
new P3, 'String'
new P2, 'String'
set P2, "15 is %b\n"
new P1, 'ResizablePMCArray'
set P1[0], 15
- bsr PRINTF
+ local_branch P4, PRINTF
new P2, 'String'
set P2, "128 is %o\n"
new P1, 'ResizablePMCArray'
set P1[0], 128
- bsr PRINTF
+ local_branch P4, PRINTF
end
CODE
Modified: branches/pluggable_runcore/t/pharness/01-default_tests.t
==============================================================================
--- branches/pluggable_runcore/t/pharness/01-default_tests.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pharness/01-default_tests.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,5 +1,5 @@
#! perl
-# Copyright (C) 2007, Parrot Foundation.
+# Copyright (C) 2007-2009, Parrot Foundation.
# $Id$
# 01-default_tests.t
@@ -23,6 +23,8 @@
@Parrot::Harness::DefaultTests::configure_tests = qw( gamma.t );
@Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
@Parrot::Harness::DefaultTests::developing_tests = qw( epsilon.t );
+ at Parrot::Harness::DefaultTests::library_tests = qw( zeta.t );
+
my ($core_tests_only, $runcore_tests_only);
my (@default_tests, $default_tests_ref);
@@ -54,16 +56,16 @@
ok(@default_tests =
get_default_tests($core_tests_only, $runcore_tests_only),
"get_default_tests() returned successfully");
- is(scalar(@default_tests), 3, "Got expected 3 tests");
+ is(scalar(@default_tests), 4, "Got expected 4 tests");
is($default_tests[0], q{gamma.t}, "Start with configure_tests as expected");
- is($default_tests[2], q{beta.t}, "End with core_tests as expected");
+ is($default_tests[3], q{zeta.t}, "End with library_tests as expected");
@default_tests = ();
($core_tests_only, $runcore_tests_only) = (0,0);
ok($default_tests_ref =
get_default_tests($core_tests_only, $runcore_tests_only),
"get_default_tests() returned successfully");
- is(scalar(@{ $default_tests_ref }), 3, "Got expected 3 tests");
+ is(scalar(@{ $default_tests_ref }), 4, "Got expected 4 tests");
ok(chdir $cwd, "Able to change back to starting directory after testing");
}
@@ -101,9 +103,9 @@
ok(@default_tests =
get_default_tests($core_tests_only, $runcore_tests_only),
"get_default_tests() returned successfully");
- is(scalar(@default_tests), 3, "Got expected 3 tests");
+ is(scalar(@default_tests), 4, "Got expected 4 tests");
is($default_tests[0], q{gamma.t}, "Start with configure_tests as expected");
- is($default_tests[2], q{beta.t}, "End with core_tests as expected");
+ is($default_tests[3], q{zeta.t}, "End with library_tests as expected");
is(scalar(@Parrot::Harness::DefaultTests::standard_tests),
2, "Got expected 2 coding standards tests");
# reset for subsequent tests
@@ -114,7 +116,7 @@
ok($default_tests_ref =
get_default_tests($core_tests_only, $runcore_tests_only),
"get_default_tests() returned successfully");
- is(scalar(@{ $default_tests_ref }), 3, "Got expected 3 tests");
+ is(scalar(@{ $default_tests_ref }), 4, "Got expected 4 tests");
# reset for subsequent tests
@Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
Copied: branches/pluggable_runcore/t/pir/macro.t (from r40540, trunk/t/pir/macro.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/pir/macro.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/pir/macro.t)
@@ -0,0 +1,43 @@
+#! parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pir/macro.t - Tests for macros in PIR
+
+=head1 SYNOPSIS
+
+ % prove t/pir/macro.t
+
+=head1 DESCRIPTION
+
+Tests for macros in PIR.
+
+=cut
+
+.macro foo()
+ ok(1, 'basic macro')
+.endm
+
+.macro bar(x)
+ ok(x, 'basic macro with argument')
+.endm
+
+.macro_const PI_APPROX 4
+
+.sub main :main
+ .include 'test_more.pir'
+ .local int x
+ plan(3)
+ .foo()
+ .bar(42)
+ is(.PI_APPROX, 4, '.macro_const')
+.end
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 filetype=pir:
Modified: branches/pluggable_runcore/t/pmc/array.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/array.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/array.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -146,7 +146,7 @@
.sub defined_sub
.local pmc foo, bar, baz
.local int ival
-
+
foo = new ['Array']
defined ival, foo
is(ival, 1, 'newed array is defined')
@@ -218,7 +218,7 @@
.local int ival
.local num nval
.local string sval, inner
-
+
foo = new ['Array']
foo = 4
bar = new ['Key']
@@ -387,7 +387,7 @@
p = new ['Array']
is(p, 0, 'newed array is not true correctly')
-
+
p = 4
is(p, 4, 'resized array is true correctly')
@@ -497,4 +497,4 @@
# cperl-indent-level: 4
# fill-column: 100
# End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:
Copied: branches/pluggable_runcore/t/pmc/arrayiterator.t (from r40540, trunk/t/pmc/arrayiterator.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/pmc/arrayiterator.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/pmc/arrayiterator.t)
@@ -0,0 +1,96 @@
+#! parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pmc/arrayiterator.t - ArrayIterator PMC
+
+=head1 SYNOPSIS
+
+ % prove t/pmc/array.t
+
+=head1 DESCRIPTION
+
+Tests C<ArrayIterator> PMC. Navigate in both directions, check bounds.
+
+=cut
+
+.namespace []
+
+.include 'iterator.pasm'
+
+.sub main :main
+ .include 'test_more.pir'
+
+ plan(14)
+
+ iterate_forward() # 8 tests
+ iterate_backward() # 5 tests
+.end
+
+
+.sub 'iterate_forward'
+ .local pmc foo, it
+
+ foo = new ['ResizablePMCArray']
+
+ it = iter foo
+ nok(it, "Iterator for empty array is empty")
+ $I0 = isa it, 'Iterator'
+ ok($I0, "Have proper type")
+
+ push foo, 1
+ push foo, 42
+
+ it = iter foo
+ ok(it, "Iterator for 2-elem list is not empty")
+ $P0 = shift it
+ ok(it, "Can shift 1st element")
+ is($P0, 1, "With expected value")
+ $P0 = shift it
+ nok(it, "Iterator is finished after second shift")
+ is($P0, 42, "2nd element has correct value")
+
+ $I0 = 1
+ push_eh fail
+ $P0 = shift it
+ $I0 = 0
+ fail:
+ pop_eh
+ ok($I0, "Shifting from finished iterator throws exception")
+
+.end
+
+.sub 'iterate_backward'
+ .local pmc foo, it
+
+ foo = new ['ResizablePMCArray']
+ push foo, 1
+ push foo, 42
+
+ it = iter foo
+ it = .ITERATE_FROM_END
+ ok(it, "Iterator reset to backward iteration")
+ $P0 = pop it
+ ok(it, "Can shift 1st element")
+ is($P0, 42, "With expected value")
+ $P0 = pop it
+ nok(it, "Iterator is finished after second shift")
+ is($P0, 1, "2nd element has correct value")
+
+ $I0 = 1
+ push_eh fail
+ $P0 = shift it
+ $I0 = 0
+ fail:
+ pop_eh
+ ok($I0, "Shifting from finished iterator throws exception")
+.end
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
Modified: branches/pluggable_runcore/t/pmc/capture.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/capture.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/capture.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -231,7 +231,8 @@
.get_results (exception)
message = exception['message']
- like(message, ':s get_integer\(\) not implemented', 'get_integer not implemented')
+ message = substr message, 0, 29
+ is(message, 'get_integer() not implemented', 'get_integer not implemented')
.return ()
.end
@@ -251,7 +252,8 @@
.get_results (exception)
message = exception['message']
- like(message, ':s get_number\(\) not implemented', 'get_number not implemented')
+ message = substr message, 0, 28
+ is(message, 'get_number() not implemented', 'get_number not implemented')
.return ()
.end
Modified: branches/pluggable_runcore/t/pmc/complex.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/complex.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/complex.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -91,19 +91,6 @@
is( message, .M, .M )
.endm
-.macro fp_eq_ok( J, K, L )
- set $N10, .J
- set $N11, .K
- sub $N12, $N11, $N10
- abs $N12, $N12
-
- set $I0, 0
- gt $N12, 0.000001, .$FPEQNOK
- set $I0, 1
-.label $FPEQNOK:
- ok( $I0, .L )
-.endm
-
.sub string_parsing
$P0 = new ['Complex']
$P1 = new ['String']
Modified: branches/pluggable_runcore/t/pmc/hash.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/hash.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/hash.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -21,8 +21,9 @@
.sub main :main
.include 'test_more.pir'
.include 'except_types.pasm'
+ .include 'datatypes.pasm'
- plan(146)
+ plan(161)
initial_hash_tests()
more_than_one_hash()
@@ -67,6 +68,9 @@
unicode_keys_register_rt_39249()
unicode_keys_literal_rt_39249()
+ integer_keys()
+ value_types_convertion()
+ elements_in_hash()
.end
.sub initial_hash_tests
@@ -1200,44 +1204,53 @@
thash["c"] = "d"
thash["e"] = "f"
- .local pmc iter
- iter = new ['Iterator'], thash
- iter = .ITERATE_FROM_START
+ .local pmc it
+ it = iter thash
+ it = .ITERATE_FROM_START
- .local string key
+ .local pmc keys, key
+ keys = new ['ResizablePMCArray']
# go through the hash, print out all the keys: should be a c and e
preit_loop:
- unless iter goto preit_end
+ unless it goto preit_end
- key = shift iter
- result .= key
+ key = shift it
+ $S0 = key
+ push keys, $S0
branch preit_loop
preit_end:
+ keys.'sort'()
+ result = join '', keys
is( result, 'ace', 'iterated through keys successfully' )
# get rid of the c element?
delete thash["c"]
+ keys = new ['ResizablePMCArray']
# what do we have after deletion?
result = ""
- iter = new ['Iterator'], thash
- iter = .ITERATE_FROM_START
+ it = iter thash
+ it = .ITERATE_FROM_START
# go through the hash, print out all the keys... I believe it should be a and e?
# it actually outputs a, c and e.
postit_loop:
- unless iter goto postit_end
+ unless it goto postit_end
+
+ key = shift it
+ $S0 = key
+ push keys, $S0
- key = shift iter
- result .= key
branch postit_loop
postit_end:
+ keys.'sort'()
+ result = join '', keys
is( result, 'ae', 'the c key was no longer iterated over' )
.end
@@ -1262,6 +1275,100 @@
is( $S1, 'ok', 'literal unicode key lookup via var' )
.end
+# Switch to use integer keys instead of strings.
+.sub integer_keys
+ .include "hash_key_type.pasm"
+ .local pmc hash
+ hash = new ['Hash']
+ hash = .Hash_key_type_int
+
+ hash[0] = 'foo'
+ hash[42] = 'bar'
+ $S0 = 'foo'
+ hash[$S0] = 'BAZ'
+
+ $S0 = '42 parrots'
+ hash[$S0] = 'Wins!'
+
+ # 'foo' numifies to '0'. So check it
+ $S0 = hash[0]
+ is($S0, 'BAZ', 'Key was numified')
+
+ # '42 parrots' numifies to '42'. So check it
+ $S0 = hash[42]
+ is($S0, 'Wins!', 'Key was numified again')
+.end
+
+# Check that we can set various value types and they properly converted
+.sub value_types_convertion
+ .local pmc hash
+ hash = new ['Hash']
+
+ # PMC is first value type
+ hash.'set_value_type'(.DATATYPE_PMC)
+ $P0 = new 'Env' # arbitary choice. Just to prevent possible casting.
+ hash['env'] = $P0
+ hash['foo'] = 42
+ hash['bar'] = 21285.06
+ hash['baz'] = 'forty two'
+
+ # Check that original value preserved
+ $P1 = hash['env']
+ $I0 = isa $P1, 'Env'
+ ok($I0, 'Env PMC preserved')
+ $I0 = hash['foo']
+ is($I0, 42, 'Intval preserved')
+ $N0 = hash['bar']
+ is($N0, 21285.06, 'Number preserved')
+ $S0 = hash['baz']
+ is($S0, 'forty two', 'String preserved')
+
+ # Clear the Hash and set INTVAL as stored values.
+ hash.'set_value_type'(.DATATYPE_INTVAL)
+ hash['foo'] = 42 # Use as-is
+ hash['bar'] = 21285.06 # Truncate to int
+ hash['baz'] = 'forty two' # Cast to int
+
+ $I0 = hash['foo']
+ is($I0, 42, 'Intval preserved with datatype int')
+ $I0 = hash['bar']
+ is($I0, 21285, 'Floatval trunkated to int')
+ $I0 = hash['baz']
+ is($I0, 0, 'String casted to int')
+
+ # TODO Add tests for String.
+.end
+
+# Check number of elements in Hash
+.sub 'elements_in_hash'
+ .local pmc hash
+ hash = new ['Hash']
+
+ $I0 = elements hash
+ is($I0, 0, "Empty hash has 0 items")
+
+ hash['foo'] = 'FOO'
+ $I0 = elements hash
+ is($I0, 1, "Hash has 1 item")
+
+ hash['foo'] = 'BAR'
+ $I0 = elements hash
+ is($I0, 1, "Hash still has 1 item after update")
+
+ hash['bar'] = 'BAR'
+ $I0 = elements hash
+ is($I0, 2, "Hash has 2 items")
+
+ delete hash['foo']
+ $I0 = elements hash
+ is($I0, 1, "Hash has 1 item after delete")
+
+ delete hash['bar']
+ $I0 = elements hash
+ is($I0, 0, "Hash has 0 items after delete")
+
+.end
+
# Local Variables:
# mode: pir
# fill-column: 100
Copied: branches/pluggable_runcore/t/pmc/hashiterator.t (from r40540, trunk/t/pmc/hashiterator.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/pmc/hashiterator.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/pmc/hashiterator.t)
@@ -0,0 +1,74 @@
+#! parrot
+# Copyright (C) 2001-2008, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pmc/hash.t - Test the Hash PMC
+
+=head1 SYNOPSIS
+
+ % prove t/pmc/hash.t
+
+=head1 DESCRIPTION
+
+Tests the C<Hash> PMC. Checks key access with various types of
+normal and potentially hazardous keys. Does a bit of stress testing as
+well.
+
+=cut
+
+.sub main :main
+ .include 'test_more.pir'
+ .include 'except_types.pasm'
+
+ plan(6)
+
+ iter_over_empty_hash()
+ iter_over_single_element()
+ iter_over_single_element_with_checks()
+
+.end
+
+.sub 'iter_over_empty_hash'
+ .local pmc hash, it
+ hash = new 'Hash'
+ it = new 'HashIterator', hash
+ $I0 = isfalse it
+ ok($I0, "Iterator for empty Hash is empty")
+.end
+
+.sub 'iter_over_single_element'
+ .local pmc hash, it
+ hash = new 'Hash'
+ hash["foo"] = "bar"
+ it = new 'HashIterator', hash
+ $I0 = istrue it
+ ok($I0, "Iterator for non empty Hash is not empty")
+ $P0 = shift it
+ $I0 = isfalse it
+ ok($I0, "And contains one element")
+.end
+
+.sub 'iter_over_single_element_with_checks'
+ .local pmc hash, it
+ hash = new 'Hash'
+ hash["foo"] = "bar"
+
+ it = new 'HashIterator', hash
+ $P0 = shift it
+ $I0 = isa $P0, 'HashIteratorKey'
+ ok($I0, "HashIteratorKey fetched successfully")
+
+ $S0 = $P0 # Get key
+ is($S0, "foo", "Key fetched successfully")
+ $S1 = hash[$P0]
+ is($S1, "bar", "Value fetched successfully")
+
+.end
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
Copied: branches/pluggable_runcore/t/pmc/hashiteratorkey.t (from r40540, trunk/t/pmc/hashiteratorkey.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/pmc/hashiteratorkey.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/pmc/hashiteratorkey.t)
@@ -0,0 +1,36 @@
+#!./parrot
+# Copyright (C) 2001-2006, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pmc/hashiteratorkey.t - HashIteratorKey PMC
+
+=head1 SYNOPSIS
+
+ % prove t/pmc/hashiteratorkey.t
+
+=head1 DESCRIPTION
+
+Do almost nothing test. HashIteratorKey is supplementary class for
+iterating over Hash. Just check that we create it.
+
+=cut
+
+.sub 'main'
+ .include 'test_more.pir'
+
+ plan(1)
+
+ $P0 = new ['HashIteratorKey']
+ ok(1, "Can create HashIteratorKey directly")
+
+.end
+
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
Modified: branches/pluggable_runcore/t/pmc/integer.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/integer.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/integer.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -434,47 +434,50 @@
pir_output_is( <<'CODE', <<'OUTPUT', "get_as_base(various)" );
.sub main :main
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
+
$P0 = new ['Integer']
$P0 = 42
$S0 = $P0.'get_as_base'(2)
- bsr PRINT
+ local_branch jmpstack, PRINT
$S0 = $P0.'get_as_base'(3)
- bsr PRINT
+ local_branch jmpstack, PRINT
$S0 = $P0.'get_as_base'(5)
- bsr PRINT
+ local_branch jmpstack, PRINT
$S0 = $P0.'get_as_base'(7)
- bsr PRINT
+ local_branch jmpstack, PRINT
$S0 = $P0.'get_as_base'(11)
- bsr PRINT
+ local_branch jmpstack, PRINT
$S0 = $P0.'get_as_base'(13)
- bsr PRINT
+ local_branch jmpstack, PRINT
$S0 = $P0.'get_as_base'(17)
- bsr PRINT
+ local_branch jmpstack, PRINT
$S0 = $P0.'get_as_base'(19)
- bsr PRINT
+ local_branch jmpstack, PRINT
$S0 = $P0.'get_as_base'(23)
- bsr PRINT
+ local_branch jmpstack, PRINT
$S0 = $P0.'get_as_base'(29)
- bsr PRINT
+ local_branch jmpstack, PRINT
$S0 = $P0.'get_as_base'(31)
- bsr PRINT
+ local_branch jmpstack, PRINT
goto END
PRINT:
print $S0
print "\n"
- ret
+ local_return jmpstack
END:
.end
CODE
Modified: branches/pluggable_runcore/t/pmc/io_iterator.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/io_iterator.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/io_iterator.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -26,18 +26,18 @@
pir_output_is( <<'CODE', <<'OUT', 'new', todo => 'not yet implemented' );
.sub 'test' :main
$P99 = 1 # RT #46847 replace with io object
- $P0 = new ['Iterator'], $P99
- say "ok 1 - $P0 = new ['Iterator'], $P1"
+ $P0 = iter $P99
+ say "ok 1 - $P0 = iter $P1"
.end
CODE
-ok 1 - $P0 = new ['Iterator'], $P1
+ok 1 - $P0 = iter $P1
OUT
# L<PDD22/I\/O Iterator PMC API/=item shift>
pir_output_is( <<'CODE', <<'OUT', 'shift', todo => 'not yet implemented' );
.sub 'test' :main
$P99 = 1 # RT #46847 replace with io object
- $P0 = new ['Iterator'], $P99
+ $P0 = iter $P99
$S0 = shift $P0
@@ -56,7 +56,7 @@
pir_output_is( <<'CODE', <<'OUT', 'get_bool (vtable)', todo => 'not yet implemented' );
.sub 'test' :main
$P99 = 1 # RT #46847 replace with io object
- $P0 = new ['Iterator'], $P99
+ $P0 = iter $P99
# empty i/o object
unless $P0 goto ok_1
Modified: branches/pluggable_runcore/t/pmc/iterator.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/iterator.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/iterator.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -23,9 +23,11 @@
=cut
+# XXX Split this test into aggregate specific one.
+
pasm_output_is( <<'CODE', <<'OUTPUT', "new iter" );
new P2, ['ResizablePMCArray']
- new P1, ['Iterator'], P2
+ iter P1, P2
print "ok 1\n"
end
CODE
@@ -39,19 +41,19 @@
push P2, 10
push P2, 20
set I0, P2
- new P1, ['Iterator'], P2
+ iter P1, P2
print "ok 1\n"
set I1, P1
eq I0, I1, ok2 # iter.length() == array.length()
print "not "
ok2: print "ok 2\n"
- new P1, ['Iterator'], P0
+ iter P1, P0
set P1, .ITERATE_FROM_START
print "ok 3\n"
unless P1, ok4 # if(iter) == false on empty
print "not "
ok4: print "ok 4\n"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
if P1, ok5 # if(iter) == true on non empty
print "not "
@@ -115,19 +117,19 @@
set P2["ab"], 100
set P2["xy"], "value"
set I0, P2
- new P1, ['Iterator'], P2
+ iter P1, P2
print "ok 1\n"
set I1, P1
eq I0, I1, ok2 # iter.length() == hash.length()
print "not "
ok2: print "ok 2\n"
- new P1, ['Iterator'], P0
+ iter P1, P0
set P1, .ITERATE_FROM_START
print "ok 3\n"
unless P1, ok4 # if(iter) == false on empty
print "not "
ok4: print "ok 4\n"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
if P1, ok5 # if(iter) == true on non empty
print "not "
@@ -169,19 +171,19 @@
set P2["ab"], 100
set P2["xy"], "value"
set I0, P2
- new P1, ['Iterator'], P2
+ iter P1, P2
print "ok 1\n"
set I1, P1
eq I0, I1, ok2 # iter.length() == hash.length()
print "not "
ok2: print "ok 2\n"
- new P1, ['Iterator'], P0
+ iter P1, P0
set P1, .ITERATE_FROM_START
print "ok 3\n"
unless P1, ok4 # if(iter) == false on empty
print "not "
ok4: print "ok 4\n"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
if P1, ok5 # if(iter) == true on non empty
print "not "
@@ -231,7 +233,7 @@
dec I1
if I1, fill
- new P1, ['Iterator'], P0
+ iter P1, P0
set I0, P1
eq I0, I10, ok1
print "not "
@@ -260,7 +262,7 @@
.include "iterator.pasm"
new P2, ['String']
set P2, "parrot"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
iter_loop:
unless P1, iter_end # while (entries) ...
@@ -281,7 +283,7 @@
.include "iterator.pasm"
new P2, ['String']
set P2, "parrot"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_END
iter_loop:
unless P1, iter_end # while (entries) ...
@@ -302,7 +304,7 @@
.include "iterator.pasm"
new P2, ['String']
set P2, "ABC"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
iter_loop:
unless P1, iter_end # while (entries) ...
@@ -323,7 +325,7 @@
.include "iterator.pasm"
new P2, ['String']
set P2, "ABC"
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_END
iter_loop:
unless P1, iter_end # while (entries) ...
@@ -351,7 +353,7 @@
print "\n"
.local pmc iter_1
- iter_1 = new ['Iterator'], string_1
+ iter_1 = iter string_1
iter_1 = .ITERATE_FROM_START
.local int code_point_1
@@ -389,7 +391,7 @@
print "\n"
.local pmc iter_1
- iter_1 = new ['Iterator'], string_1
+ iter_1 = iter string_1
iter_1 = .ITERATE_FROM_START
.local int code_point_1
@@ -447,7 +449,7 @@
print "\n"
.local pmc iter_1
- iter_1 = new ['Iterator'], array_1
+ iter_1 = iter array_1
iter_1 = .ITERATE_FROM_START
.local string elem_1
@@ -502,12 +504,12 @@
print "\n"
.local pmc iter_2
- iter_2 = new ['Iterator'], array_1
+ iter_2 = iter array_1
iter_2 = .ITERATE_FROM_END
print 'Iterator shift_float: '
.local num felem_2
- shift felem_2, iter_2
+ pop felem_2, iter_2
print felem_2
print "\n"
@@ -543,7 +545,7 @@
push P2, 20
push P2, 30
push P2, 40
- new P1, ['Iterator'], P2
+ iter P1, P2
set P1, .ITERATE_FROM_START
set I0, P1 # arr.length
@@ -713,7 +715,7 @@
.local pmc ar, i1, i2
ar = new ['ResizableIntegerArray']
push ar, 17
- new i1, ['Iterator'], ar
+ i1 = iter ar
clone i2, i1
.end
CODE
@@ -726,7 +728,7 @@
push ar, 17
push ar, 42
- new i1, ['Iterator'], ar
+ i1 = iter ar
clone i2, i1
.local pmc temp
@@ -759,7 +761,7 @@
ar = new ['ResizableIntegerArray']
push ar, 1
push ar, 2
- new i1, ['Iterator'], ar
+ i1 = iter ar
shift temp, i1
unless temp == 1 goto fail
@@ -790,7 +792,7 @@
temp = new ['Integer']
ar = new ['ResizableIntegerArray']
push ar, 1
- new i1, ['Iterator'], ar
+ i1 = iter ar
# i1 and i2 now "point" to the same element of the same array.
clone i2, i1
Modified: branches/pluggable_runcore/t/pmc/key.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/key.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/key.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -169,7 +169,6 @@
.namespace []
.sub prepare_lib :init
- load_bytecode 'PGE.pbc'
$P0 = get_class 'Sub'
$P1 = subclass $P0, 'TclProc'
$P1 = new ['ResizablePMCArray']
Modified: branches/pluggable_runcore/t/pmc/namespace.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/namespace.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/namespace.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -6,7 +6,7 @@
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 67;
+use Parrot::Test tests => 68;
use Parrot::Config;
=head1 NAME
@@ -1699,21 +1699,24 @@
$P1 = 0
set_root_global [ "DUMMY"; "X"; "Y" ], "T0", $P0
- .local pmc dummy_x_y_ns, iter
+ .local pmc dummy_x_y_ns, it, res
dummy_x_y_ns = get_root_namespace [ "DUMMY"; "X"; "Y" ]
- iter = new ['Iterator'], dummy_x_y_ns
+ it = iter dummy_x_y_ns
+ res = new ['ResizablePMCArray']
loop:
- unless iter goto loop_end
- $S0 = shift iter
- print $S0
- print "\n"
+ unless it goto loop_end
+ $S0 = shift it
+ push res, $S0
goto loop
loop_end:
+ res.'sort'()
+ $S0 = join ' ', res
+ say $S0
+
.end
CODE
-Explosion
-T0
+Explosion T0
OUT
pir_error_output_like( <<'CODE', <<OUT, "NameSpace with no class, RT #55620" );
@@ -1730,17 +1733,24 @@
.namespace [ 'bar' ]
.sub 'main' :main
+ .local pmc res
+ res = new ['ResizablePMCArray']
+
$P0 = get_namespace
say $P0
$I0 = elements $P0
say $I0
- new $P1 , 'Iterator', $P0
+ $P1 = iter $P0
L1:
unless $P1 goto L2
$P2 = shift $P1
- say $P2
+ $S0 = $P2
+ push res, $S0
goto L1
L2:
+ res.'sort'()
+ $S0 = join "\n", res
+ say $S0
say 'OK'
.end
@@ -1750,8 +1760,8 @@
CODE
bar
2
-main
foo
+main
OK
OUT
@@ -1798,6 +1808,35 @@
Could not find non-existent sub nok/
OUT
+
+pir_output_is( <<'CODE', <<'OUT', 'HLL_map on namespace', todo => 'TT #867');
+.HLL 'tcl'
+
+.sub 'foo' :anon :init
+ $P1 = get_class 'NameSpace'
+ $P2 = subclass $P1, 'BSNS'
+ $P0 = getinterp
+ $P0.'hll_map'($P1, $P2)
+.end
+
+.namespace ['a';'b';'c']
+
+.sub 'hi'
+ noop
+.end
+
+.namespace []
+
+.sub 'blah' :main
+ $P1 = get_hll_namespace ['a';'b';'c']
+ $S0 = typeof $P1
+ print 'ok 1 - '
+ say $S0
+.end
+CODE
+ok 1 - BSNS
+OUT
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Modified: branches/pluggable_runcore/t/pmc/nci.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/nci.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/nci.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,5 +1,5 @@
#! perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
use strict;
@@ -2646,11 +2646,6 @@
3
OUTPUT
-{
- local $TODO = 0;
- if ($PConfig{jitcapable}){
- $TODO = "TT #551 - jitted NCI sig with V is broken";
- }
pir_output_is( << 'CODE', << 'OUTPUT', "nci_vVi - void** out parameter" );
.sub test :main
.local string library_name
@@ -2673,7 +2668,6 @@
CODE
got 10
OUTPUT
-}
pir_output_is( << 'CODE', << 'OUTPUT', "nci_ttt - t_tt parameter" );
.sub test :main
@@ -2711,11 +2705,6 @@
1
OUTPUT
-{
- local $TODO = 0;
- if ($PConfig{jitcapable}){
- $TODO = "TT #551 - jitted NCI sig with V is broken";
- }
pir_output_is( << 'CODE', << 'OUTPUT', "nci_vV - char** out parameter" );
.sub test :main
.local string library_name
@@ -2763,7 +2752,6 @@
It is a beautiful day!
Go suck a lemon.
OUTPUT
-}
# Local Variables:
# mode: cperl
Modified: branches/pluggable_runcore/t/pmc/object-meths.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/object-meths.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/object-meths.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -462,7 +462,8 @@
subclass P6, P3, "F"
addparent P6, P4
- bsr _check_isa
+ new P10, 'ResizableIntegerArray'
+ local_branch P10, _check_isa
print "new F\n"
new P16, ['F']
@@ -527,7 +528,7 @@
isa I0, P1, "D"
print I0
print "\n"
- ret
+ local_return P10
.namespace ["A"]
Modified: branches/pluggable_runcore/t/pmc/object-mro.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/object-mro.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/object-mro.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -44,7 +44,7 @@
subclass F, C, "F"
addparent F, D
mro = F.'inspect'('all_parents')
- it = new ['Iterator'], mro
+ it = iter mro
it = 0
loop:
unless it goto ex
@@ -113,7 +113,7 @@
.local pmc mro, it, p
mro = A.'inspect'('all_parents')
- it = new ['Iterator'], mro
+ it = iter mro
it = 0
loop:
unless it goto ex
@@ -183,7 +183,7 @@
.local pmc mro, it, p
mro = A.'inspect'('all_parents')
- it = new ['Iterator'], mro
+ it = iter mro
it = 0
loop:
unless it goto ex
@@ -220,7 +220,7 @@
.local pmc mro, it, p
mro = D.'inspect'('all_parents')
- it = new ['Iterator'], mro
+ it = iter mro
it = 0
loop:
unless it goto ex
@@ -279,7 +279,7 @@
.local pmc mro, it, p
mro = Vulcan.'inspect'('all_parents')
- it = new ['Iterator'], mro
+ it = iter mro
it = 0
loop:
unless it goto ex
Modified: branches/pluggable_runcore/t/pmc/orderedhash.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/orderedhash.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/orderedhash.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -89,12 +89,13 @@
set P1, "ok 3\n"
set P0["j"], P1
- new P2, ['Iterator'], P0
+ iter P2, P0
set P2, .ITERATE_FROM_START
iter_loop:
unless P2, end_iter
shift P3, P2
- print P3
+ set P4, P0[P3]
+ print P4
branch iter_loop
end_iter:
@@ -102,7 +103,8 @@
iter_loop2:
unless P2, end_iter2
pop P3, P2
- print P3
+ set P4, P0[P3]
+ print P4
branch iter_loop2
end_iter2:
end
@@ -266,7 +268,7 @@
delete P0["a"]
- new P2, ['Iterator'], P0
+ iter P2, P0
set P2, .ITERATE_FROM_START_KEYS
iter_loop:
unless P2, end_iter
@@ -333,7 +335,7 @@
set P1, "ok 3\n"
set P0["j"], P1
- new P2, ['Iterator'], P0
+ iter P2, P0
set P2, .ITERATE_FROM_START_KEYS
iter_loop:
unless P2, end_iter
@@ -357,7 +359,7 @@
set P1, "ok 3\n"
set P0["j"], P1
- new P2, ['Iterator'], P0
+ iter P2, P0
set P2, .ITERATE_FROM_START_KEYS
iter_loop:
unless P2, end_iter
Copied: branches/pluggable_runcore/t/pmc/orderedhashiterator.t (from r40540, trunk/t/pmc/orderedhashiterator.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/pmc/orderedhashiterator.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/pmc/orderedhashiterator.t)
@@ -0,0 +1,48 @@
+#!./parrot
+# Copyright (C) 2001-2006, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pmc/orderedhashiterator.t - Ordered Hash Iterator
+
+=head1 SYNOPSIS
+
+ % prove t/pmc/orderedhashiterator.t
+
+=head1 DESCRIPTION
+
+Do almost nothing test. Main purpose of OrderedHashIterator covered by
+t/pmc/orderedhash.t.
+
+=cut
+
+.sub 'main'
+ .include 'test_more.pir'
+
+ plan(2)
+
+ # Just test that we can't create OrderedHashIterator directly
+ $I0 = 1
+ push_eh fail
+ $P0 = new ['OrderedHashIterator']
+ $I0 = 0
+ fail:
+ pop_eh
+ ok($I0, "Can't create OrderedHashIterator directly")
+
+ $P0 = new ['OrderedHash']
+ $P1 = iter $P0
+ $I0 = isa $P1, 'Iterator'
+ ok($I0, 'OrderedHashIterator has proper type')
+
+
+.end
+
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
Modified: branches/pluggable_runcore/t/pmc/packfile.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/packfile.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/packfile.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,5 +1,5 @@
#! parrot
-# Copyright (C) 2006-2008, Parrot Foundation.
+# Copyright (C) 2006-2009, Parrot Foundation.
# $Id$
=head1 NAME
@@ -53,7 +53,7 @@
pf = new ['Packfile']
$S0 = pf["uuid"]
ok(1, 'get_string(uuid)')
-
+
# Requesting unknown key should throw exception
push_eh unknown_key
$S0 = pf["foo"]
@@ -81,7 +81,7 @@
$S1 = pf["uuid"]
$I1 = length $S1
is($I1, 1, "Fetched length is 1")
-
+
# Requesting unknown key should throw exception
push_eh unknown_key
pf["foo"] = "fe9ab64082e0f6bbbd7b1e8264127908"
@@ -172,7 +172,7 @@
# Helper sub to check fields in Packfile header
.sub '_check_header'
.param pmc pf
-
+
# wordsize always greater than 0
$I0 = pf["wordsize"]
ok($I0, "Wordsize set")
@@ -217,7 +217,7 @@
# Set uuid_type
pf['uuid_type'] = 1
$S0 = pf
-
+
# Pack it
ok(1, "PackFile packed")
@@ -278,7 +278,7 @@
.local string second
# Pack
second = packfile
-
+
$I0 = cmp first, second
$I0 = not $I0
todo($I0, 'pack produced same result twice')
Modified: branches/pluggable_runcore/t/pmc/packfileannotation.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/packfileannotation.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/packfileannotation.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -5,7 +5,6 @@
t/pmc/packfileannotation.t - test the PackfileAnnotation PMC
-
=head1 SYNOPSIS
% prove t/pmc/packfileannotation.t
@@ -48,3 +47,10 @@
ok($I0, "Can't fetch wrong value from Annotation")
.end
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/t/pmc/packfileannotations.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/packfileannotations.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/packfileannotations.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -6,7 +6,6 @@
t/pmc/packfileannotations.t - test the PackfileAnnotations PMC
-
=head1 SYNOPSIS
% prove t/pmc/packfileannotations.t
@@ -148,3 +147,10 @@
# BAIL_OUT
skip(9, "PackfileAnnotations tests failed")
.end
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/t/pmc/packfileconstanttable.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/packfileconstanttable.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/packfileconstanttable.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -6,7 +6,6 @@
t/pmc/packfileconstanttable.t - test the PackfileConstantTable PMC
-
=head1 SYNOPSIS
% prove t/pmc/packfileconstanttable.t
@@ -120,7 +119,7 @@
ct[0] = "string"
$I0 = elements ct
is($I0, 1, "String element added")
-
+
ct[1] = 1.0
$I0 = elements ct
is($I0, 2, "Number elements added")
@@ -147,7 +146,7 @@
$I1 = pfc.'get_or_create_constant'('foo')
$I2 = pfc.'get_or_create_constant'('foo')
is($I1, $I2, "get_or_create_constant returs same string value for same key")
-
+
$I2 = pfc.'get_or_create_constant'('bar')
$I0 = $I1 != $I2
ok($I0, "get_or_create_constant returs different string values for different keys")
@@ -156,7 +155,7 @@
$I1 = pfc.'get_or_create_constant'(1.0)
$I2 = pfc.'get_or_create_constant'(1.0)
is($I1, $I2, "get_or_create_constant returs same number value for same key")
-
+
$I2 = pfc.'get_or_create_constant'(42.1)
$I0 = $I1 != $I2
ok($I0, "get_or_create_constant returs different number values for different keys")
@@ -184,4 +183,4 @@
# cperl-indent-level: 4
# fill-column: 100
# End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/t/pmc/packfilefixupentry.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/packfilefixupentry.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/packfilefixupentry.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -86,4 +86,4 @@
# cperl-indent-level: 4
# fill-column: 100
# End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/t/pmc/packfilefixuptable.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/packfilefixuptable.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/packfilefixuptable.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -66,4 +66,4 @@
# cperl-indent-level: 4
# fill-column: 100
# End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/t/pmc/packfilerawsegment.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/packfilerawsegment.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/packfilerawsegment.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -34,9 +34,7 @@
.local pmc pf, pfdir, pfseg
pf = _pbc()
pfdir = pf.'get_directory'()
- $P0 = iter pfdir
- $S0 = shift $P0
- pfseg = pfdir[$S0]
+ pfseg = '_find_segment_by_prefix'(pf, 'BYTECODE')
$I0 = elements pfseg
ok($I0, 'PackfileRawSegment contains some data')
.end
@@ -46,9 +44,7 @@
.local pmc pf, pfdir, pfseg
pf = _pbc()
pfdir = pf.'get_directory'()
- $P0 = iter pfdir
- $S0 = shift $P0
- pfseg = pfdir[$S0]
+ pfseg = '_find_segment_by_prefix'(pf, 'BYTECODE')
$I0 = 0
$I1 = pfseg[0]
Modified: branches/pluggable_runcore/t/pmc/packfilesegment.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/packfilesegment.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/packfilesegment.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -30,4 +30,4 @@
# cperl-indent-level: 4
# fill-column: 100
# End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:
Modified: branches/pluggable_runcore/t/pmc/pmc.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/pmc.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/pmc.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -49,7 +49,7 @@
my $checkTypes;
my %types_we_cant_test
= map { $_ => 1; } ( # These require initializers.
- qw(default Null Iterator Enumerate ParrotObject ParrotThread BigInt LexInfo LexPad Object Handle),
+ qw(default Null Iterator ArrayIterator HashIterator StringIterator OrderedHashIterator Enumerate ParrotObject ParrotThread BigInt LexInfo LexPad Object Handle),
# Instances of these appear to have other types.
qw(PMCProxy Class) );
Modified: branches/pluggable_runcore/t/pmc/resizablebooleanarray.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/resizablebooleanarray.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/resizablebooleanarray.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -393,6 +393,8 @@
.end
.sub aerobics
+ .local pmc jmpstack
+ jmpstack = new 'ResizableIntegerArray'
new $P0, ['ResizableBooleanArray']
set $I10, 10000
@@ -470,27 +472,27 @@
.return()
errFirstPop:
print "FAILED: first pop\n"
- bsr info
+ local_branch jmpstack, info
.return()
errSecondPop:
print "FAILED: second pop\n"
- bsr info
+ local_branch jmpstack, info
.return()
errBuildLen:
print "FAILED: buildup length\n"
- bsr info
+ local_branch jmpstack, info
.return()
errLeftGet:
print "FAILED: left get\n"
- bsr info
+ local_branch jmpstack, info
.return()
errRightGet:
print "FAILED: right get\n"
- bsr info
+ local_branch jmpstack, info
.return()
errTearDown:
print "FAILED: tear down cap\n"
- bsr info
+ local_branch jmpstack, info
.return()
info:
ok(0, "aerobics goof:")
@@ -499,7 +501,7 @@
print "\n#Wanted: "
print $I3
print "\n"
- ret
+ local_return jmpstack
.end
Modified: branches/pluggable_runcore/t/pmc/resizablepmcarray.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/resizablepmcarray.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/resizablepmcarray.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -703,7 +703,7 @@
.sub get_array_string
.param pmc p
$S0 = ''
- $P3 = new ['Iterator'], p
+ $P3 = iter p
loop:
unless $P3 goto loop_end
$P4 = shift $P3
@@ -833,7 +833,7 @@
#RT #40958 - can't iterate subclass of ResizablePMCArray
.sub iterate_subclass_of_rpa
- .local pmc arr, iter
+ .local pmc arr, it
$P0 = subclass 'ResizablePMCArray', 'MyArray'
arr = new ['MyArray']
@@ -844,10 +844,10 @@
is($I0, 3, "RPA subclass has correct element count")
$S1 = ''
- iter = new ['Iterator'], arr
+ it = iter arr
loop:
- unless iter goto end
- $P2 = shift iter
+ unless it goto end
+ $P2 = shift it
$S0 = $P2
concat $S1, $S0
concat $S1, ","
Modified: branches/pluggable_runcore/t/pmc/resizablestringarray.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/resizablestringarray.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/resizablestringarray.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -1354,7 +1354,8 @@
.get_results (exception)
message = exception
still_ok:
- like(message, 'illegal\ type\ for\ splice', "splice with a different type")
+ message = substr message, 22, 23
+ is(message, 'illegal type for splice', "splice with a different type")
.end
#
Modified: branches/pluggable_runcore/t/pmc/string.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/string.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/string.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -131,21 +131,6 @@
is( $I0, 0, 'string "foo" -> int' )
.end
-# Macro to ease testing of floating point comparisons
-# borrowed from fp_eq in fp_equality.pasm
-.macro fp_eq_ok ( J, K, L )
- set $N10, .J
- set $N11, .K
- sub $N12, $N11, $N10
- abs $N12, $N12
-
- set $I0, 0
- gt $N12, 0.000001, .$FPEQNOK
- set $I0, 1
-.label $FPEQNOK:
- ok( $I0, .L )
-.endm
-
.sub setting_numbers
.include 'fp_equality.pasm'
new $P0, ['String']
Copied: branches/pluggable_runcore/t/pmc/stringiterator.t (from r40540, trunk/t/pmc/stringiterator.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/pmc/stringiterator.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/pmc/stringiterator.t)
@@ -0,0 +1,104 @@
+#! parrot
+# Copyright (C) 2001-2008, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pmc/stringiterator.t - StringIterator.
+
+=head1 SYNOPSIS
+
+ % prove t/pmc/string.t
+
+=head1 DESCRIPTION
+
+Tests the C<StringIterator> PMC. Iterate over string in both directions.
+
+=cut
+
+.include 'iterator.pasm'
+
+.sub main :main
+ .include 'test_more.pir'
+
+ plan(18)
+
+ iterate_forward() # 10 tests
+ iterate_backward() # 8 tests
+
+.end
+
+.sub 'iterate_forward'
+ .local pmc s, it
+
+ s = new ['String']
+
+ it = iter s
+ nok(it, "Iterator for empty string is empty")
+ $I0 = isa it, 'Iterator'
+ ok($I0, "Have proper type")
+
+ s = "bar"
+ it = s
+
+ it = iter s
+ ok(it, "Iterator for 'bar' is not empty")
+ $S0 = shift it
+ ok(it, "Can shift 1st character")
+ is($S0, 'b', "With correct value")
+
+ $S0 = shift it
+ ok(it, "Can shift 2nd character")
+ is($S0, 'a', "With correct value")
+
+ $P0 = shift it
+ nok(it, "Iterator is finished after 3rd shift")
+ is($P0, 'r', "3rd character has correct value as PMC")
+
+ $I0 = 1
+ push_eh fail
+ $P0 = shift it
+ $I0 = 0
+ fail:
+ pop_eh:
+ ok($I0, "Shifting from finished iterator throws exception")
+
+.end
+
+.sub 'iterate_backward'
+ .local pmc s, it
+
+ s = new ['String']
+ s = 'BAZ'
+
+ it = iter s
+ it = .ITERATE_FROM_END
+ ok(it, "Iterator reset to backward iteration")
+
+ $S0 = pop it
+ ok(it, "Can shift 1st character")
+ is($S0, 'Z', "With expected value")
+
+ $S0 = pop it
+ ok(it, "Can shift 2nd character")
+ is($S0, 'A', "With expected value")
+
+ $P0 = pop it
+ nok(it, "Iterator is finished after third shift")
+ is($P0, 'B', "3rd element has correct value as PMC")
+
+ $I0 = 1
+ push_eh fail
+ $P0 = pop it
+ $I0 = 0
+ fail:
+ pop_eh
+ ok($I0, "Shifting from finished iterator throws exception")
+.end
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 filetype=pir:
Modified: branches/pluggable_runcore/t/pmc/sub.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/sub.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/sub.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -9,7 +9,7 @@
use Test::More;
use Parrot::Test::Util 'create_tempfile';
-use Parrot::Test tests => 69;
+use Parrot::Test tests => 67;
use Parrot::Config;
=head1 NAME
@@ -1224,38 +1224,6 @@
ok
OUTPUT
-pir_output_is( <<'CODE', <<'OUTPUT', 'load_bytecode with .pir (RT #39807)' );
-.sub main :main
- load_bytecode 'PGE.pbc'
- load_bytecode 'dumper.pir'
- load_bytecode 'PGE/Dumper.pir'
-
- $P0 = compreg 'PGE::P5Regex'
- $P1 = $P0('aabb*')
- $P2 = $P1('fooaabbbar')
-
- _dumper($P2)
-.end
-CODE
-"VAR1" => PMC 'PGE;Match' => "aabbb" @ 3
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', 'load_bytecode with .pbc (RT #39807)' );
-.sub main :main
- load_bytecode 'PGE.pbc'
- load_bytecode 'dumper.pbc'
- load_bytecode 'PGE/Dumper.pbc'
-
- $P0 = compreg 'PGE::P5Regex'
- $P1 = $P0('aabb*')
- $P2 = $P1('fooaabbbar')
-
- _dumper($P2)
-.end
-CODE
-"VAR1" => PMC 'PGE;Match' => "aabbb" @ 3
-OUTPUT
-
pir_error_output_like( <<'CODE', qr/Null PMC access in invoke()/, 'invoking null pmc' );
.sub main :main
null $P0
Modified: branches/pluggable_runcore/t/pmc/testlib/packfile_common.pir
==============================================================================
--- branches/pluggable_runcore/t/pmc/testlib/packfile_common.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/pmc/testlib/packfile_common.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -45,6 +45,24 @@
.return ()
.end
+.sub '_find_segment_by_prefix'
+ .param pmc pf
+ .param string prefix
+ .local pmc pfdir, it
+
+ pfdir = pf.'get_directory'()
+ it = iter pfdir
+ loop:
+ unless it goto done
+ $S0 = shift it
+ $I0 = index $S0, prefix
+ if $I0 != 0 goto loop
+ $P0 = pfdir[$S0]
+ .return ($P0)
+ done:
+ .return ()
+.end
+
.sub '_get_fixup_table'
.param pmc pf
Modified: branches/pluggable_runcore/t/src/extend.t
==============================================================================
--- branches/pluggable_runcore/t/src/extend.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/src/extend.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -731,13 +731,15 @@
for (i = 1; i <= niter; i++) {
printf("Starting interp %d\n", i);
+ fflush(stdout);
interp = Parrot_new(NULL);
- Parrot_set_flag(interp, PARROT_DESTROY_FLAG);
-
if (!interp)
return 1;
+ Parrot_set_flag(interp, PARROT_DESTROY_FLAG);
+
printf("Destroying interp %d\n", i);
+ fflush(stdout);
interp_cleanup(interp, 0);
}
Deleted: branches/pluggable_runcore/t/steps/auto/fink-01.t
==============================================================================
--- branches/pluggable_runcore/t/steps/auto/fink-01.t Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,289 +0,0 @@
-#! perl
-# Copyright (C) 2007-2009, Parrot Foundation.
-# $Id$
-# auto/fink-01.t
-
-use strict;
-use warnings;
-use Test::More;
-use Carp;
-use File::Temp;
-use lib qw( lib t/configure/testlib );
-
-plan( skip_all => 'fink is Darwin only' ) unless $^O =~ /darwin/i;
-plan( tests => 55 );
-
-use_ok('config::init::defaults');
-use_ok('config::auto::fink');
-
-use Parrot::Configure;
-use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Test qw(
- test_step_thru_runstep
- rerun_defaults_for_testing
- test_step_constructor_and_description
-);
-use IO::CaptureOutput qw( capture );
-
-########## Darwin but no good Fink ##########
-
-my ($args, $step_list_ref) = process_options( {
- argv => [],
- mode => q{configure},
-} );
-
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
-
-my $pkg = q{auto::fink};
-
-$conf->add_steps($pkg);
-
-my $serialized = $conf->pcfreeze();
-
-$conf->options->set(%{$args});
-my $step = test_step_constructor_and_description($conf);
-
-# Success in the following test means:
-# (a) OS is Darwin.
-# (b) Either Fink is not installed or it is installed correctly, i.e., we can
-# locate the Fink subdirectories we need for later Parrot configuration steps.
-ok($step->runstep($conf), "runstep() returned true value");
-
-$conf->replenish($serialized);
-
-########## not Darwin ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [],
- mode => q{configure},
-} );
-# mock not Darwin
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-$conf->data->set_p5( 'OSNAME' => 'foobar' );
-ok($step->runstep($conf), "runstep() returned true value");
-is($step->result(), q{skipped}, "Got expected result for non-Darwin OS");
-
-$conf->replenish($serialized);
-
-########## no Fink ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [],
- mode => q{configure},
-} );
-# mock no Fink
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-$step->{fink_conf} = q{my_ridiculous_foobar};
-my $msg = q{Fink not installed};
-
-{
- ok($step->runstep($conf), "runstep() returned true value");
- is($step->result(), $msg, "Got expected result for $msg");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin but defective Fink ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
- # mock Fink config file with no Basepath
- my $tfile = File::Temp->new();
- open my $fh, ">", $tfile
- or croak "Unable to open temporary file for writing";
- print $fh "Message: Hello world\n";
- close $fh or croak "Unable to close temporary file after writing";
- $step->{fink_conf} = $tfile;
- ok(! defined $step->runstep($conf),
- "runstep() returned undef due to defective Fink config file");
- is($step->result(), q{failed},
- "Got expected result for defective Fink Config file");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin but defective Fink ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
- # mock Fink config file with non-existent Basepath
- my $tfile = File::Temp->new();
- open my $fh, ">", $tfile
- or croak "Unable to open temporary file for writing";
- print $fh "Basepath: /my/phony/directory\n";
- close $fh or croak "Unable to close temporary file after writing";
- $step->{fink_conf} = $tfile;
- ok(! defined $step->runstep($conf),
- "runstep() returned undef due to unlocateable Fink directories");
- is($step->result(), q{failed},
- "Got expected result for unlocateable Fink directories");
-}
-
-$conf->replenish($serialized);
-
-########## not Darwin; --verbose ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--verbose} ],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
- # mock not Darwin
- my $phony_OS = q{foobar};
- $conf->data->set_p5( 'OSNAME' => $phony_OS );
- my ($rv, $stdout);
- capture(
- sub { $rv = $step->runstep($conf); },
- \$stdout,
- );
- ok($rv, "runstep() returned true value");
- is($step->result(), q{skipped}, "Got expected result for non-Darwin OS");
- like($stdout,
- qr/Operating system is $phony_OS; Fink is Darwin only/,
- "Got expected verbose output when OS is not Darwin");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin; --verbose; no Fink ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--verbose} ],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
- # mock no Fink
- $step->{fink_conf} = q{my_ridiculous_foobar};
- my $msg = q{Fink not installed};
- my ($rv, $stdout);
- capture(
- sub { $rv = $step->runstep($conf); },
- \$stdout,
- );
- ok($rv, "runstep() returned true value");
- is($step->result(), $msg,
- "Got expected result for $msg");
- like($stdout,
- qr/Fink configuration file not located/,
- "Got expected verbose output when OS is not Darwin");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin; --verbose; defective Fink ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--verbose} ],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
- # mock Fink config file with no Basepath
- my $tfile = File::Temp->new();
- open my $fh, ">", $tfile
- or croak "Unable to open temporary file for writing";
- print $fh "Message: Hello world\n";
- close $fh or croak "Unable to close temporary file after writing";
- $step->{fink_conf} = $tfile;
-
- my ($rv, $stdout);
- capture(
- sub { $rv = $step->runstep($conf); },
- \$stdout,
- );
- ok(! defined $rv,
- "runstep() returned undef due to defective Fink config file");
- is($step->result(), q{failed},
- "Got expected result for defective Fink Config file");
- like($stdout,
- qr/Fink configuration file defective: no 'Basepath'/,
- "Got expected verbose output when Fink config file lacked 'Basepath'");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin; --verbose; defective Fink ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--verbose} ],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
- # mock Fink config file with non-existent Basepath
- my $tfile = File::Temp->new();
- open my $fh, ">", $tfile
- or croak "Unable to open temporary file for writing";
- print $fh "Basepath: /my/phony/directory\n";
- close $fh or croak "Unable to close temporary file after writing";
- $step->{fink_conf} = $tfile;
-
- my ($rv, $stdout);
- capture(
- sub { $rv = $step->runstep($conf); },
- \$stdout,
- );
- ok(! defined $rv,
- "runstep() returned undef due to unlocateable Fink directories");
- is($step->result(), q{failed},
- "Got expected result for unlocateable Fink directories");
- like($stdout,
- qr/Could not locate Fink directories/,
- "Got expected verbose output for unlocateable Fink directories");
-}
-
-pass("Completed all tests in $0");
-
-################### DOCUMENTATION ###################
-
-=head1 NAME
-
-auto/fink-01.t - test auto::fink
-
-=head1 SYNOPSIS
-
- % prove t/steps/auto/fink-01.t
-
-=head1 DESCRIPTION
-
-The files in this directory test functionality used by F<Configure.pl>.
-
-The tests in this file test auto::fink. Some tests will run only on Darwin.
-Others simulate how auto::fink runs on operating systems other than Darwin.
-
-=head1 AUTHOR
-
-James E Keenan
-
-=head1 SEE ALSO
-
-config::auto::fink, F<Configure.pl>.
-
-=cut
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
Modified: branches/pluggable_runcore/t/steps/auto/gc-01.t
==============================================================================
--- branches/pluggable_runcore/t/steps/auto/gc-01.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/steps/auto/gc-01.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -5,7 +5,7 @@
use strict;
use warnings;
-use Test::More tests => 35;
+use Test::More tests => 8;
use lib qw( lib t/configure/testlib );
use_ok('config::auto::gc');
use Parrot::Configure;
@@ -48,94 +48,13 @@
"Got expected value for 'gc_flag'");
}
-$conf->replenish($serialized);
-
-########### --gc=gc ###########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--gc=gc} ],
- mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-my $ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($conf->data->get('gc_flag'), q{},
- "Got expected value for 'gc_flag'");
-
-$conf->replenish($serialized);
-
-########### --gc=libc ###########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--gc=libc} ],
- mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-$conf->data->set('i_malloc' => 1);
-$ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC',
- "Got expected value for 'gc_flag'");
-is($conf->data->get('malloc_header'), 'malloc.h',
- "Got expected value for 'malloc_header'");
-
-$conf->replenish($serialized);
-
-########### --gc=libc ###########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--gc=libc} ],
- mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-$conf->data->set('i_malloc' => undef);
-$ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC',
- "Got expected value for 'gc_flag'");
-is($conf->data->get('malloc_header'), 'stdlib.h',
- "Got expected value for 'malloc_header'");
-
-$conf->replenish($serialized);
-
-########### --gc=malloc ###########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--gc=malloc} ],
- mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-$ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC',
- "Got expected value for 'gc_flag'");
-
-$conf->replenish($serialized);
-
-########### --gc=malloc-trace ###########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--gc=malloc-trace} ],
- mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-$ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC',
- "Got expected value for 'gc_flag'");
-
pass("Completed all tests in $0");
################### DOCUMENTATION ###################
=head1 NAME
-auto/gc-01.t - test auto::gc
+auto_gc-01.t - test auto::gc
=head1 SYNOPSIS
Modified: branches/pluggable_runcore/t/steps/auto/gdbm-01.t
==============================================================================
--- branches/pluggable_runcore/t/steps/auto/gdbm-01.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/steps/auto/gdbm-01.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -5,7 +5,7 @@
use strict;
use warnings;
-use Test::More tests => 47;
+use Test::More tests => 40;
use Carp;
use Cwd;
use File::Spec;
@@ -56,7 +56,7 @@
$conf->replenish($serialized);
-########## --without-gdbm; _handle_darwin_for_fink() ##########
+########## --without-gdbm ##########
($args, $step_list_ref) = process_options( {
argv => [ q{--without-gdbm} ],
@@ -69,11 +69,6 @@
my $osname;
my ($flagsbefore, $flagsafter);
$osname = 'foobar';
-$flagsbefore = $conf->data->get( 'linkflags' );
-ok($step->_handle_darwin_for_fink($conf, $osname, 'gdbm.h'),
- "handle_darwin_for_fink() returned true value");
-$flagsafter = $conf->data->get( 'linkflags' );
-is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
my $cwd = cwd();
{
my $tdir = tempdir( CLEANUP => 1 );
@@ -84,12 +79,6 @@
my $includedir = File::Spec->catdir( $tdir, 'include' );
$conf->data->set('fink_lib_dir' => $libdir);
$conf->data->set('fink_include_dir' => $includedir);
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_fink($conf, $osname, 'gdbm.h'),
- "handle_darwin_for_fink() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
ok(chdir $cwd, "Able to change back to original directory after testing");
}
@@ -107,15 +96,6 @@
print $FH "Hello world\n";
close $FH or croak "Could not close after writing";
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_fink($conf, $osname, 'gdbm.h'),
- "handle_darwin_for_fink() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- isnt($flagsbefore, $flagsafter, "Change in linkflags, as expected");
- like($conf->data->get( 'linkflags' ), qr/-L\Q$libdir\E/,
- "'linkflags' modified as expected");
-
ok(chdir $cwd, "Able to change back to original directory after testing");
}
Modified: branches/pluggable_runcore/t/steps/auto/gmp-01.t
==============================================================================
--- branches/pluggable_runcore/t/steps/auto/gmp-01.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/steps/auto/gmp-01.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -5,7 +5,7 @@
use strict;
use warnings;
-use Test::More tests => 61;
+use Test::More tests => 31;
use Carp;
use Cwd;
use File::Spec;
@@ -102,63 +102,8 @@
'-lgmp',
"_select_lib() returned expected value");
-########### _handle_darwin_for_fink() ###########
-
my ($flagsbefore, $flagsafter);
-$osname = 'foobar';
-$flagsbefore = $conf->data->get( 'linkflags' );
-ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
- "handle_darwin_for_fink() returned true value");
-$flagsafter = $conf->data->get( 'linkflags' );
-is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
my $cwd = cwd();
-{
- my $tdir = tempdir( CLEANUP => 1 );
- ok(chdir $tdir, "Able to change to temporary directory");
- ok( (mkdir 'lib'), "Able to make lib directory");
- ok( (mkdir 'include'), "Able to make include directory");
- my $libdir = File::Spec->catdir( $tdir, 'lib' );
- my $includedir = File::Spec->catdir( $tdir, 'include' );
- $conf->data->set('fink_lib_dir' => $libdir);
- $conf->data->set('fink_include_dir' => $includedir);
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
- "handle_darwin_for_fink() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
- ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-{
- my $tdir2 = tempdir( CLEANUP => 1 );
- ok(chdir $tdir2, "Able to change to temporary directory");
- ok( (mkdir 'lib'), "Able to make lib directory");
- ok( (mkdir 'include'), "Able to make include directory");
- my $libdir = File::Spec->catdir( $tdir2, 'lib' );
- my $includedir = File::Spec->catdir( $tdir2, 'include' );
- $conf->data->set('fink_lib_dir' => $libdir);
- $conf->data->set('fink_include_dir' => $includedir);
- my $foo = File::Spec->catfile( $includedir, 'gmp.h' );
- open my $FH, ">", $foo or croak "Could not open for writing";
- print $FH "Hello world\n";
- close $FH or croak "Could not close after writing";
-
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
- "handle_darwin_for_fink() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- isnt($flagsbefore, $flagsafter, "Change in linkflags, as expected");
- like($conf->data->get( 'linkflags' ), qr/-L\Q$libdir\E/,
- "'linkflags' modified as expected");
-
- ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-$conf->replenish($serialized);
########### _evaluate_cc_run() ###########
@@ -210,66 +155,6 @@
$step->set_result(undef);
}
-########### _handle_darwin_for_fink() ###########
-
-($args, $step_list_ref) = process_options( {
- argv => [ ],
- mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-# Mock values for OS
-$osname = 'darwin';
-$conf->data->set( 'linkflags' => 'foobar' );
-$flagsbefore = $conf->data->get( 'linkflags' );
-$conf->data->set( fink_lib_dir => undef );
-$conf->data->set( fink_include_dir => undef );
-ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
- "handle_darwin_for_fink() returned true value");
-$flagsafter = $conf->data->get( 'linkflags' );
-is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
-$cwd = cwd();
-{
- my $tdir = tempdir( CLEANUP => 1 );
- ok(chdir $tdir, "Able to change to temporary directory");
- ok( (mkdir 'lib'), "Able to make lib directory");
-# ok( (mkdir 'include'), "Able to make include directory");
- my $libdir = File::Spec->catdir( $tdir, 'lib' );
- my $includedir = File::Spec->catdir( $tdir, 'include' );
- $conf->data->set('fink_lib_dir' => $libdir);
- $conf->data->set('fink_include_dir' => $includedir);
- $osname = 'darwin';
- $conf->data->set( 'linkflags' => 'foobar' );
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
- "handle_darwin_for_fink() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
- ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-{
- my $tdir1 = tempdir( CLEANUP => 1 );
- ok(chdir $tdir1, "Able to change to temporary directory");
-# ok( (mkdir 'lib'), "Able to make lib directory");
- ok( (mkdir 'include'), "Able to make include directory");
- my $libdir = File::Spec->catdir( $tdir1, 'lib' );
- my $includedir = File::Spec->catdir( $tdir1, 'include' );
- $conf->data->set('fink_lib_dir' => $libdir);
- $conf->data->set('fink_include_dir' => $includedir);
- $osname = 'darwin';
- $conf->data->set( 'linkflags' => 'foobar' );
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
- "handle_darwin_for_fink() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
- ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
pass("Completed all tests in $0");
################### DOCUMENTATION ###################
Deleted: branches/pluggable_runcore/t/steps/auto/macports-01.t
==============================================================================
--- branches/pluggable_runcore/t/steps/auto/macports-01.t Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,226 +0,0 @@
-#! perl
-# Copyright (C) 2007-2009, Parrot Foundation.
-# $Id$
-# auto/macports-01.t
-
-use strict;
-use warnings;
-use Test::More;
-use Carp;
-use Cwd;
-use File::Spec;
-use File::Temp qw( tempdir );
-use lib qw( lib t/configure/testlib );
-
-plan( skip_all => 'Macports is Darwin only' ) unless $^O =~ /darwin/;
-plan( tests => 52 );
-
-use_ok('config::init::defaults');
-use_ok('config::auto::macports');
-use Parrot::Configure;
-use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Test qw(
- test_step_thru_runstep
- test_step_constructor_and_description
-);
-use IO::CaptureOutput qw( capture );
-
-########## not Darwin ##########
-
-my ($args, $step_list_ref) = process_options( {
- argv => [],
- mode => q{configure},
-} );
-
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
-
-my $pkg = q{auto::macports};
-
-$conf->add_steps($pkg);
-
-my $serialized = $conf->pcfreeze();
-
-$conf->options->set(%{$args});
-my $step = test_step_constructor_and_description($conf);
-
-# mock not Darwin
-$conf->data->set_p5( 'OSNAME' => 'foobar' );
-ok($step->runstep($conf), "runstep() returned true value");
-is($step->result(), q{skipped}, "Got expected result for non-Darwin OS");
-
-$conf->replenish($serialized);
-
-########## Darwin but no Macports ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-
-# mock no Macports-default directories
-$step->{ports_root} = File::Spec->catdir( qw( / my ridiculous foobar ) );
-ok($step->runstep($conf), "runstep() returned true value");
-is($step->result(), 'no', "Got expected result");
-
-$conf->replenish($serialized);
-
-########## Darwin with Macports ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-my $cwd = cwd();
-
-my $tdir = tempdir( CLEANUP => 1 );
-$step->{ports_root} = $tdir;
-ok(chdir $tdir, "Able to change to temporary directory");
-ok( (mkdir 'lib'), "Able to make lib directory");
-ok( (mkdir 'include'), "Able to make include directory");
-
-ok($step->runstep($conf), "runstep() returned true value");
-is($step->result(), q{yes}, "Got expected result");
-
-is($conf->data->get('ports_base_dir'), $tdir,
- "ports base directory set as expected");
-is($conf->data->get('ports_lib_dir'), qq{$tdir/lib},
- "ports 'lib' directory set as expected");
-is($conf->data->get('ports_include_dir'), qq{$tdir/include},
- "ports 'include' directory set as expected");
-
-ok(chdir $cwd, "Able to change back to original directory after testing");
-
-$conf->replenish($serialized);
-
-########## not Darwin; --verbose ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--verbose} ],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-# mock not Darwin
-my $osname = 'foobar';
-$conf->data->set_p5( 'OSNAME' => $osname );
-{
- my ($stdout, $stderr);
- my $ret = capture sub { $step->runstep($conf) }, \$stdout, \$stderr;
- ok($ret, "runstep() returned true value");
- is($step->result(), q{skipped}, "Got expected result for non-Darwin OS");
- like(
- $stdout,
- qr/^Operating system is $osname; Macports is Darwin only/,
- "Got expected verbose output"
- );
-}
-
-$conf->replenish($serialized);
-
-########## Darwin; --verbose; no Macports ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--verbose} ],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-# mock no Macports-default directories
-$step->{ports_root} = File::Spec->catdir( qw( / my ridiculous foobar ) );
-SKIP: {
- skip 'Macports is Darwin only', 3 unless $^O =~ /darwin/;
- my ($stdout, $stderr);
- my $ret = capture sub { $step->runstep($conf) }, \$stdout, \$stderr;
- ok($ret, "runstep() returned true value");
- is($step->result(), 'no', "Got expected result");
- like(
- $stdout,
- qr/^Could not locate Macports directories/,
- "Got expected verbose output"
- );
-}
-$step->{ports_root} = undef; # prepare for next test
-
-$conf->replenish($serialized);
-
-########## Darwin; defective Macports ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [ ],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-# mock no Macports root directory
-SKIP: {
- skip 'Macports is Darwin only', 2 unless $^O =~ /darwin/;
- $step->{ports_root} = undef;
- ok($step->runstep($conf), "runstep() returned true value");
- is($step->result(), 'no', "Got expected result");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin; --verbose; defective Macports ##########
-
-($args, $step_list_ref) = process_options( {
- argv => [ q{--verbose} ],
- mode => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-# mock no Macports root directory
-$step->{ports_root} = undef;
-
-my ($stdout, $stderr);
-my $ret = capture sub { $step->runstep($conf) }, \$stdout, \$stderr;
-ok($ret, "runstep() returned true value");
-is($step->result(), 'no', "Got expected result");
-like(
- $stdout,
- qr/^Could not locate Macports root directory/,
- "Got expected verbose output"
-);
-
-pass("Completed all tests in $0");
-
-################### DOCUMENTATION ###################
-
-=head1 NAME
-
-auto/macports-01.t - test auto::macports
-
-=head1 SYNOPSIS
-
- % prove t/steps/auto/macports-01.t
-
-=head1 DESCRIPTION
-
-The files in this directory test functionality used by F<Configure.pl>.
-
-The tests in this file test auto::macports. Some tests run only on Darwin.
-Others simulate what happens on operating systems other than Darwin.
-
-=head1 AUTHOR
-
-James E Keenan
-
-=head1 SEE ALSO
-
-config::auto::macports, F<Configure.pl>.
-
-=cut
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-
Deleted: branches/pluggable_runcore/t/steps/auto/macports-02.t
==============================================================================
--- branches/pluggable_runcore/t/steps/auto/macports-02.t Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,77 +0,0 @@
-#! perl
-# Copyright (C) 2007, Parrot Foundation.
-# $Id$
-# auto/macports-02.t
-
-use strict;
-use warnings;
-use Test::More;
-plan( skip_all => 'Macports is Darwin only' ) unless $^O =~ /darwin/;
-plan( tests => 12 );
-use Carp;
-use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
-$ENV{TEST_MACPORTS} = 'foobar';
-use_ok('config::auto::macports');
-
-use Parrot::Configure;
-use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Test qw(
- test_step_thru_runstep
- test_step_constructor_and_description
-);
-
-my ($args, $step_list_ref) = process_options( {
- argv => [],
- mode => q{configure},
-} );
-
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
-
-my $pkg = q{auto::macports};
-
-$conf->add_steps($pkg);
-$conf->options->set(%{$args});
-my $step = test_step_constructor_and_description($conf);
-
-# mock no Macports-default directories
-ok($step->runstep($conf), "runstep() returned true value");
-is($step->result(), 'no', "Got expected result");
-
-pass("Completed all tests in $0");
-
-################### DOCUMENTATION ###################
-
-=head1 NAME
-
-auto/macports-02.t - test auto::macports
-
-=head1 SYNOPSIS
-
- % prove t/steps/auto/macports-02.t
-
-=head1 DESCRIPTION
-
-The files in this directory test functionality used by F<Configure.pl>.
-
-The tests in this file test auto::macports.
-
-=head1 AUTHOR
-
-James E Keenan
-
-=head1 SEE ALSO
-
-config::auto::macports, F<Configure.pl>.
-
-=cut
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-
Modified: branches/pluggable_runcore/t/steps/auto/readline-01.t
==============================================================================
--- branches/pluggable_runcore/t/steps/auto/readline-01.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/steps/auto/readline-01.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -5,7 +5,7 @@
use strict;
use warnings;
-use Test::More tests => 69;
+use Test::More tests => 14;
use Carp;
use Cwd;
use File::Spec;
@@ -92,221 +92,6 @@
like($@, qr/_select_lib\(\) takes hashref/,
"Bad argument to _select_lib correctly detected");
-########## _handle_darwin_for_fink() ##########
-
-my ($flagsbefore, $flagsafter);
-
-$osname = 'foobar';
-$flagsbefore = $conf->data->get( 'linkflags' );
-ok($step->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h'),
- "handle_darwin_for_fink() returned true value");
-$flagsafter = $conf->data->get( 'linkflags' );
-is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
-my $cwd = cwd();
-{
- my $tdir1 = tempdir( CLEANUP => 1 );
- ok(chdir $tdir1, "Able to change to temporary directory");
- ok( (mkdir 'lib'), "Able to make lib directory");
- ok( (mkdir 'include'), "Able to make include directory");
- my $libdir = File::Spec->catdir( $tdir1, 'lib' );
- my $includedir = File::Spec->catdir( $tdir1, 'include' );
- $conf->data->set('fink_lib_dir' => $libdir);
- $conf->data->set('fink_include_dir' => $includedir);
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h'),
- "handle_darwin_for_fink() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- is($flagsbefore, $flagsafter,
- "No change in linkflags, as expected, where Fink lib and include directories exist but readline/readline.h does not");
-
- ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-{
- my $tdir2 = tempdir( CLEANUP => 1 );
- ok(chdir $tdir2, "Able to change to temporary directory");
- ok( (mkdir 'lib'), "Able to make lib directory");
- ok( (mkdir 'include'), "Able to make include directory");
- ok( (mkdir 'include/readline'), "Able to make include/readline directory");
- my $libdir = File::Spec->catdir( $tdir2, 'lib' );
- my $includedir = File::Spec->catdir( $tdir2, 'include' );
- $conf->data->set('fink_lib_dir' => $libdir);
- $conf->data->set('fink_include_dir' => $includedir);
- my $foo = File::Spec->catfile( $includedir, 'readline', 'readline.h' );
- open my $FH, ">", $foo or croak "Could not open for writing";
- print $FH "Hello world\n";
- close $FH or croak "Could not close after writing";
-
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h'),
- "handle_darwin_for_fink() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- isnt($flagsbefore, $flagsafter, "Change in linkflags, as expected");
- like($conf->data->get( 'linkflags' ), qr/-L\Q$libdir\E/,
- "'linkflags' modified as expected, in case where Fink lib and include dirs exist and readline/readline.h exists");
- $conf->data->set( linkflags => $flagsbefore ); #reset for next test
-
- ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-{
- my $tdir3 = tempdir( CLEANUP => 1 );
- ok(chdir $tdir3, "Able to change to temporary directory");
- ok( (mkdir 'lib'), "Able to make lib directory");
- ok( (mkdir 'include'), "Able to make include directory");
- ok( (mkdir 'include/readline'), "Able to make include/readline directory");
- my $libdir = File::Spec->catdir( $tdir3, 'lib' );
- my $includedir = File::Spec->catdir( $tdir3, 'include' );
- $conf->data->set('fink_lib_dir' => $libdir);
- $conf->data->set('fink_include_dir' => undef);
-
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h'),
- "handle_darwin_for_fink() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- is($flagsbefore, $flagsafter,
- "No change in linkflags, as expected, where Fink include directory does not exist");
-
- ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-{
- my $tdir4 = tempdir( CLEANUP => 1 );
- ok(chdir $tdir4, "Able to change to temporary directory");
- ok( (mkdir 'lib'), "Able to make lib directory");
- ok( (mkdir 'include'), "Able to make include directory");
- ok( (mkdir 'include/readline'), "Able to make include/readline directory");
- my $libdir = File::Spec->catdir( $tdir4, 'lib' );
- my $includedir = File::Spec->catdir( $tdir4, 'include' );
- $conf->data->set('fink_lib_dir' => undef );
- $conf->data->set('fink_include_dir' => $includedir );
-
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h'),
- "handle_darwin_for_fink() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- is($flagsbefore, $flagsafter,
- "No change in linkflags, as expected, where Fink lib directory does not exist");
-
- ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-########## _handle_darwin_for_macports() ##########
-
-$osname = 'foobar';
-$flagsbefore = $conf->data->get( 'linkflags' );
-ok($step->_handle_darwin_for_macports($conf, $osname, 'readline/readline.h'),
- "handle_darwin_for_macports() returned true value");
-$flagsafter = $conf->data->get( 'linkflags' );
-is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-# Get ready for the next test
-$conf->data->set( linkflags => $flagsbefore );
-
-$cwd = cwd();
-{
- my $xtdir1 = File::Spec->canonpath( tempdir( CLEANUP => 1 ) );
- ok(chdir $xtdir1, "Able to change to temporary directory");
- ok( (mkdir 'lib'), "Able to make lib directory");
- ok( (mkdir 'include'), "Able to make include directory");
- my $libdir = File::Spec->catdir( $xtdir1, 'lib' );
- my $includedir = File::Spec->catdir( $xtdir1, 'include' );
- $conf->data->set( ports_base_dir => $xtdir1 );
- $conf->data->set( ports_lib_dir => $libdir );
- $conf->data->set( ports_include_dir => $includedir );
- ok( (mkdir 'include/readline'), "Able to make include/readline directory");
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_macports($conf, $osname, 'readline/readline.h'),
- "handle_darwin_for_macports() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- is($flagsbefore, $flagsafter,
- "No change in linkflags, as expected, where macports lib and include directories exist but readline/readline.h does not");
-
- chdir $cwd or croak "Unable to change back to original directory";
-}
-
-$cwd = cwd();
-{
- my $xtdir2 = File::Spec->canonpath( tempdir( CLEANUP => 1 ) );
- ok(chdir $xtdir2, "Able to change to temporary directory");
- ok( (mkdir 'lib'), "Able to make lib directory");
- ok( (mkdir 'include'), "Able to make include directory");
- my $libdir = File::Spec->catdir( $xtdir2, 'lib' );
- my $includedir = File::Spec->catdir( $xtdir2, 'include' );
- $conf->data->set( ports_base_dir => $xtdir2 );
- $conf->data->set( ports_lib_dir => $libdir );
- $conf->data->set( ports_include_dir => $includedir );
- ok( (mkdir 'include/readline'), "Able to make include/readline directory");
- my $foo = File::Spec->catfile( $includedir, 'readline', 'readline.h' );
- open my $FH, ">", $foo or croak "Could not open for writing";
- print $FH "Hello world\n";
- close $FH or croak "Could not close after writing";
-
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_macports($conf, $osname, 'readline/readline.h'),
- "handle_darwin_for_macports() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- isnt($flagsbefore, $flagsafter, "Change in linkflags, as expected");
- like($conf->data->get( 'linkflags' ), qr/-L\Q$libdir\E/,
- "'linkflags' modified as expected, in case where macports lib and include dirs exist and readline/readline.h exists");
- $conf->data->set( linkflags => $flagsbefore );
-
- chdir $cwd or croak "Unable to change back to original directory";
-}
-
-
-$cwd = cwd();
-{
- my $xtdir3 = File::Spec->canonpath( tempdir( CLEANUP => 1 ) );
- ok(chdir $xtdir3, "Able to change to temporary directory");
- ok( (mkdir 'lib'), "Able to make lib directory");
- ok( (mkdir 'include'), "Able to make include directory");
- my $libdir = File::Spec->catdir( $xtdir3, 'lib' );
- my $includedir = File::Spec->catdir( $xtdir3, 'include' );
- $conf->data->set( ports_base_dir => $xtdir3 );
- $conf->data->set( ports_lib_dir => $libdir );
- $conf->data->set( ports_include_dir => undef );
-
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_macports($conf, $osname, 'readline/readline.h'),
- "handle_darwin_for_macports() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- is($flagsbefore, $flagsafter,
- "No change in linkflags, as expected, where Macports include directory does not exist");
-
- chdir $cwd or croak "Unable to change back to original directory";
-}
-
-$cwd = cwd();
-{
- my $xtdir4 = File::Spec->canonpath( tempdir( CLEANUP => 1 ) );
- ok(chdir $xtdir4, "Able to change to temporary directory");
- ok( (mkdir 'lib'), "Able to make lib directory");
- ok( (mkdir 'include'), "Able to make include directory");
- my $libdir = File::Spec->catdir( $xtdir4, 'lib' );
- my $includedir = File::Spec->catdir( $xtdir4, 'include' );
- $conf->data->set( ports_base_dir => $xtdir4 );
- $conf->data->set( ports_lib_dir => undef );
- $conf->data->set( ports_include_dir => $includedir );
-
- $osname = 'darwin';
- $flagsbefore = $conf->data->get( 'linkflags' );
- ok($step->_handle_darwin_for_macports($conf, $osname, 'readline/readline.h'),
- "handle_darwin_for_macports() returned true value");
- $flagsafter = $conf->data->get( 'linkflags' );
- is($flagsbefore, $flagsafter,
- "No change in linkflags, as expected, where Macports lib directory does not exist");
-
- chdir $cwd or croak "Unable to change back to original directory";
-}
-
pass("Completed all tests in $0");
################### DOCUMENTATION ###################
Modified: branches/pluggable_runcore/t/steps/init/hints/darwin-01.t
==============================================================================
--- branches/pluggable_runcore/t/steps/init/hints/darwin-01.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/steps/init/hints/darwin-01.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -5,9 +5,393 @@
use strict;
use warnings;
-use Test::More; # tests => 26;
+use Cwd;
+use File::Temp qw( tempdir );
+use Test::More;
plan( skip_all => 'only needs testing on Darwin' ) unless $^O =~ /darwin/i;
-plan( tests => 1 );
+plan( tests => 41 );
+#use Test::More qw(no_plan); # tests => 41;
+
+use lib qw( lib t/configure/testlib );
+use_ok('config::init::defaults');
+use_ok('config::init::hints');
+use_ok('config::init::hints::darwin');
+use Parrot::Configure;
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Test qw(
+ test_step_thru_runstep
+ test_step_constructor_and_description
+);
+use IO::CaptureOutput qw | capture |;
+
+my $cwd = cwd();
+my ($args, $step_list_ref) = process_options(
+ {
+ argv => [],
+ mode => q{configure},
+ }
+);
+
+my $conf = Parrot::Configure->new;
+
+test_step_thru_runstep( $conf, q{init::defaults}, $args );
+
+##### Tests of some internal subroutines #####
+
+##### _precheck() #####
+
+my $problematic_flag = 'ccflags';
+my $stored = $conf->data->get($problematic_flag);
+
+{
+ my ($stdout, $stderr);
+ capture(
+ sub { init::hints::darwin::_precheck(
+ $problematic_flag, $stored, 0
+ ) },
+ \$stdout,
+ \$stderr,
+ );
+ ok( ! $stdout, "_precheck(): Non-verbose mode produced no output" );
+}
+
+{
+ my ($stdout, $stderr);
+ capture(
+ sub { init::hints::darwin::_precheck(
+ $problematic_flag, $stored, 1
+ ) },
+ \$stdout,
+ \$stderr,
+ );
+ ok( $stdout, "_precheck(): Verbose mode produced output" );
+ like($stdout, qr/Checking\s+$problematic_flag/,
+ "_precheck(): Got expected verbose output" );
+ like($stdout, qr/Pre-check:\s+$stored/,
+ "_precheck(): Got expected verbose output" );
+}
+
+{
+ my ($stdout, $stderr);
+ capture(
+ sub { init::hints::darwin::_precheck(
+ $problematic_flag, q{}, 1
+ ) },
+ \$stdout,
+ \$stderr,
+ );
+ ok( $stdout, "_precheck(): Verbose mode produced output" );
+ like($stdout, qr/Checking\s+$problematic_flag/,
+ "_precheck(): Got expected verbose output" );
+ like($stdout, qr/Pre-check:\s+\(nil\)/,
+ "_precheck(): Got expected verbose output" );
+}
+
+##### _strip_arch_flags_engine #####
+
+{
+ my %defaults = (
+ architectures => [ qw( i386 ppc64 ppc x86_64 ) ],
+ );
+ my $flagsref = {};
+ my $stored = q{-someflag -arch i386 -someotherflag -arch ppc};
+ my $flag = q{ccflags};
+ $flagsref = init::hints::darwin::_strip_arch_flags_engine(
+ $defaults{architectures}, $stored, $flagsref, $flag
+ );
+ like(
+ $flagsref->{$flag},
+ qr{-someflag -someotherflag},
+ "_strip_arch_flags_engine(): '-arch' flags and extra whitespace removed",
+ );
+
+
+}
+
+##### _postcheck #####
+
+{
+ my $flag = 'ccflags';
+ my $flagsref = { 'ccflags' => 'my ccflag' };
+ my ($stdout, $stderr);
+
+ capture(
+ sub { init::hints::darwin::_postcheck(
+ $flagsref, $flag, 0
+ ) },
+ \$stdout,
+ \$stderr,
+ );
+ ok( ! $stdout, "_postcheck(): Non-verbose mode produced no output" );
+
+ capture(
+ sub { init::hints::darwin::_postcheck(
+ $flagsref, $flag, 1
+ ) },
+ \$stdout,
+ \$stderr,
+ );
+ ok( $stdout, "_postcheck(): Verbose mode produced output" );
+ like($stdout, qr/Post-check:\s+$flagsref->{$flag}/,
+ "_postcheck(): Got expected verbose output" );
+
+ $flagsref = { 'ccflags' => undef };
+ capture(
+ sub { init::hints::darwin::_postcheck(
+ $flagsref, $flag, 1
+ ) },
+ \$stdout,
+ \$stderr,
+ );
+ ok( $stdout, "_postcheck(): Verbose mode produced output" );
+ like($stdout, qr/Post-check:\s+\(nil\)/,
+ "_postcheck(): Got expected verbose output" );
+}
+
+##### _strip_arch_flags #####
+
+{
+ my %defaults = (
+ problem_flags => [ qw( ccflags ldflags ) ],
+ architectures => [ qw( i386 ppc64 ppc x86_64 ) ],
+ );
+ my $flagsref = {};
+ my $flag = q{ccflags};
+ my $oldflag = $conf->data->get( $flag );
+
+ my $stored = q{-someflag -arch i386 -someotherflag -arch ppc};
+ $conf->data->set( $flag => $stored );
+
+ $flagsref = init::hints::darwin::_strip_arch_flags($conf, 0);
+ like($flagsref->{$flag},
+ qr/-someflag -someotherflag/,
+ "_strip_arch_flags(): '-arch' flags and extra whitespace removed",
+ );
+
+ my ($stdout, $stderr);
+ capture(
+ sub {
+ $flagsref = init::hints::darwin::_strip_arch_flags($conf, 1);
+ },
+ \$stdout,
+ \$stderr,
+ );
+ like($flagsref->{$flag},
+ qr/-someflag -someotherflag/,
+ "_strip_arch_flags(): '-arch' flags and extra whitespace removed",
+ );
+ like(
+ $stdout,
+ qr/Stripping -arch flags due to Apple multi-architecture build problems:/,
+ "_strip_arch_flags(): Got expected verbose output",
+ );
+
+ $flag = q{ccflags};
+ $conf->data->set( $flag => undef );
+ $flagsref = init::hints::darwin::_strip_arch_flags($conf, 0);
+ is( $flagsref->{$flag}, q{},
+ "_strip_arch_flags(): Got empty flag when expected" );
+
+ $conf->data->set( $flag => $oldflag );
+}
+
+##### _strip_ldl_as_needed #####
+
+{
+ my $oldflag = $conf->data->get( 'libs ' );
+ my ( $major, $libs );
+
+ $major = '7.99.11';
+ local $init::hints::darwin::defaults{uname} = $major;
+ $conf->data->set( libs => '-somelib -ldl -someotherlib' );
+ $libs = init::hints::darwin::_strip_ldl_as_needed(
+ $conf->data->get( 'libs' )
+ );
+ like( $libs, qr/-somelib\s+-someotherlib/,
+ "_strip_ldl_as_needed(): '-ldl' stripped as expected" );
+
+ $major = '6.99.11';
+ local $init::hints::darwin::defaults{uname} = $major;
+ $conf->data->set( libs => '-somelib -ldl -someotherlib' );
+ $libs = init::hints::darwin::_strip_ldl_as_needed(
+ $conf->data->get( 'libs' )
+ );
+ like( $libs, qr/-somelib\s+-ldl\s+-someotherlib/,
+ "_strip_ldl_as_needed(): '-ldl' not stripped as expected in older darwin" );
+
+ $conf->data->set( libs => $oldflag );
+}
+
+##### _set_deployment_environment() #####
+
+{
+ my $predicted = '10.99';
+ local $ENV{'MACOSX_DEPLOYMENT_TARGET'} = undef;
+ no warnings 'once';
+ local $init::hints::darwin::defaults{sw_vers} = qq{$predicted.11};
+ use warnings;
+ init::hints::darwin::_set_deployment_environment();
+ is($ENV{'MACOSX_DEPLOYMENT_TARGET'}, $predicted,
+ "_set_deployment_environment(): MACOSX_DEPLOYMENT_TARGET set as expected");
+}
+
+##### _probe_for_fink() #####
+
+{
+ my $tdir = tempdir( CLEANUP => 1 );
+ chdir $tdir or die "Unable to change to temporary directory: $!";
+
+ local $init::hints::darwin::defaults{fink_conf} = qq{$tdir/fink.conf};
+ ok( ! defined( init::hints::darwin::_probe_for_fink( $conf ) ),
+ "_probe_for_fink(): returned undefined value for no config file" );
+ $conf->options->set( 'verbose' => 1 );
+ {
+ my ($stdout, $stderr);
+ capture(
+ sub { init::hints::darwin::_probe_for_fink( $conf ); },
+ \$stdout,
+ \$stderr,
+ );
+ like( $stdout, qr/Fink configuration file not located/,
+ "Got expected verbose output when Fink config not located" );
+ }
+ $conf->options->set( 'verbose' => 0 );
+
+ my $fink_conf_file = q{fink.conf};
+ open my $CONF, '>', $fink_conf_file
+ or die "Unable to open $fink_conf_file for writing: $!";
+ print $CONF "Hello, world, but no Fink info\n";
+ close $CONF or die "Unable to close $fink_conf_file after writing: $!";
+ ok( ! defined( init::hints::darwin::_probe_for_fink( $conf ) ),
+ "_probe_for_fink(): returned undefined value for defective config file" );
+
+ $conf->options->set( 'verbose' => 1 );
+ {
+ my ($stdout, $stderr);
+ capture(
+ sub { init::hints::darwin::_probe_for_fink( $conf ); },
+ \$stdout,
+ \$stderr,
+ );
+ like( $stdout, qr/Fink configuration file defective/,
+ "Got expected verbose output when Fink config was defective" );
+ }
+ $conf->options->set( 'verbose' => 0 );
+
+ my $other = qq{$tdir/other_fink.conf};
+ local $init::hints::darwin::defaults{fink_conf} = $other;
+ $fink_conf_file = $other;
+ open my $OCONF, '>', $fink_conf_file
+ or die "Unable to open $fink_conf_file for writing: $!";
+ print $OCONF "Basepath: /tmp/foobar\n";
+ close $OCONF or die "Unable to close $fink_conf_file after writing: $!";
+ ok( ! defined( init::hints::darwin::_probe_for_fink( $conf ) ),
+ "_probe_for_fink(): returned undefined value for missing directories" );
+
+ $conf->options->set( 'verbose' => 1 );
+ {
+ my ($stdout, $stderr);
+ capture(
+ sub { init::hints::darwin::_probe_for_fink( $conf ); },
+ \$stdout,
+ \$stderr,
+ );
+ like( $stdout, qr/Could not locate Fink directories/,
+ "Got expected verbose output when Fink directories were missing" );
+ }
+ $conf->options->set( 'verbose' => 0 );
+
+ chdir $cwd or die "Unable to change back to starting directory: $!";
+}
+
+##### _probe_for_macports() #####
+
+{
+ my $tdir = tempdir( CLEANUP => 1 );
+ chdir $tdir or die "Unable to change to temporary directory: $!";
+
+ local $init::hints::darwin::defaults{ports_base_dir} = qq{$tdir/foobar};
+ ok( ! defined( init::hints::darwin::_probe_for_macports( $conf ) ),
+ "_probe_for_macports(): returned undefined value for no config file" );
+
+ $conf->options->set( 'verbose' => 1 );
+ {
+ my ($stdout, $stderr);
+ capture(
+ sub { init::hints::darwin::_probe_for_macports( $conf ); },
+ \$stdout,
+ \$stderr,
+ );
+ like( $stdout, qr/Could not locate Macports directories/,
+ "Got expected verbose output when Macports directories not found" );
+ }
+ $conf->options->set( 'verbose' => 0 );
+}
+
+##### _probe_for_libraries() #####
+
+{
+ $conf->options->set( 'darwin_no_fink' => 1 );
+ $conf->options->set( 'verbose' => 0 );
+ my $lib_dir = $conf->data->get('build_dir') . "/blib/lib";
+ my $flagsref = {};
+ $flagsref->{ldflags} .= " -L$lib_dir";
+ $flagsref->{ccflags} .= " -pipe -fno-common -Wno-long-double ";
+ $flagsref->{linkflags} .= " -undefined dynamic_lookup";
+ my %state_before = map { $_ => $flagsref->{$_} } keys %{ $flagsref };
+ ok( ! defined ( init::hints::darwin::_probe_for_libraries(
+ $conf, $flagsref, 'fink')
+ ), "_probe_for_libraries() returned undef as expected" );
+ is_deeply( $flagsref, { %state_before },
+ "No change in flags, as expected" );
+
+ $conf->options->set( 'darwin_no_fink' => 0 );
+}
+
+##### _add_to_flags() #####
+
+{
+ my ( $addl_flags_ref, $flagsref, $title, $verbose );
+ $addl_flags_ref = undef;
+ $flagsref = undef;
+ $title = 'Fink';
+ $verbose = 0;
+ ok( init::hints::darwin::_add_to_flags(
+ $addl_flags_ref, $flagsref, $title, $verbose
+ ), "_add_to_flags(): returned true value when no probes found" );
+
+ $verbose = 1;
+ {
+ my ($stdout, $stderr);
+ capture(
+ sub { init::hints::darwin::_add_to_flags(
+ $addl_flags_ref, $flagsref, $title, $verbose
+ ); },
+ \$stdout,
+ \$stderr,
+ );
+ like( $stdout, qr/Probe for $title unsuccessful/,
+ "_add_to_flags(): got expected verbose output when probe unsuccessful" );
+ }
+
+ $addl_flags_ref = {
+ ldflags => "-Lfink_lib_dir",
+ ccflags => "-Lfink_include_dir",
+ linkflags => "-Lfink_lib_dir",
+ };
+ my $lib_dir = $conf->data->get('build_dir') . "/blib/lib";
+ $flagsref = undef;
+ $flagsref->{ldflags} = " -L$lib_dir";
+ $flagsref->{ccflags} = " -pipe -fno-common -Wno-long-double ";
+ $flagsref->{linkflags} = undef;
+ $title = 'Fink';
+ $verbose = 0;
+ my $rv = init::hints::darwin::_add_to_flags(
+ $addl_flags_ref, $flagsref, $title, $verbose
+ );
+ is( $flagsref->{linkflags}, " $addl_flags_ref->{linkflags}",
+ "_add_to_flags(): flag added where not previously populated" );
+}
pass("Completed all tests in $0");
Modified: branches/pluggable_runcore/t/tools/dev/searchops/samples.pm
==============================================================================
--- branches/pluggable_runcore/t/tools/dev/searchops/samples.pm Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/tools/dev/searchops/samples.pm Fri Aug 14 01:24:23 2009 (r40541)
@@ -17,11 +17,13 @@
** pseudo-core.ops
*/
+BEGIN_OPS_PREAMBLE
+
#include "parrot/dynext.h"
#include "parrot/embed.h"
#include "../interp/interp_guts.h"
-VERSION = PARROT_VERSION;
+END_OPS_PREAMBLE
=head1 NAME
@@ -151,8 +153,6 @@
** pseudo-debug.ops
*/
-VERSION = PARROT_VERSION;
-
=head1 NAME
pseudo-debug.ops
@@ -270,8 +270,6 @@
** pseudo-string.ops
*/
-VERSION = PARROT_VERSION;
-
=head1 NAME
pseudo-string.ops - String Operations
Modified: branches/pluggable_runcore/t/tools/dump_pbc.t
==============================================================================
--- branches/pluggable_runcore/t/tools/dump_pbc.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/tools/dump_pbc.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,10 +1,10 @@
#! perl
-# Copyright (C) 2008, Parrot Foundation.
+# Copyright (C) 2008-2009, Parrot Foundation.
# $Id$
=head1 NAME
-t/tools/dumb_pbc.t - test the script tools/utils/dump_pbc.t
+t/tools/dumb_pbc.t - test the script tools/utils/dump_pbc.pl
=head1 SYNOPSIS
Modified: branches/pluggable_runcore/t/tools/ops2pm/08-sort_ops.t
==============================================================================
--- branches/pluggable_runcore/t/tools/ops2pm/08-sort_ops.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/tools/ops2pm/08-sort_ops.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -222,8 +222,6 @@
** dummy.ops
*/
-VERSION = PARROT_VERSION;
-
inline op zzzzzz(inout INT, in INT) :base_core {
goto NEXT();
}
Modified: branches/pluggable_runcore/t/tools/parrot_debugger.t
==============================================================================
--- branches/pluggable_runcore/t/tools/parrot_debugger.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/tools/parrot_debugger.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,5 +1,5 @@
#! perl
-# Copyright (C) 2007-2008, Parrot Foundation.
+# Copyright (C) 2007-2009, Parrot Foundation.
# $Id$
=head1 NAME
@@ -56,14 +56,246 @@
print "\\n"
.end
PIR
-pdb_output_like( <<PIR, "pir", "r", qr/3\.14159/, 'running the program');
+pdb_output_like( <<PIR, "pir", "r", qr/3\.14159/, 'running the program (pir)');
.sub main :main
\$N3 = 3.14159
print \$N3
print "\\n"
.end
PIR
-BEGIN { $tests += 2 }
+pdb_output_like( <<PASM, "pasm", "run", qr/42/, 'running the program (long,pasm)');
+ set I1,42
+ print I1
+ print "\\n"
+PASM
+pdb_output_like( <<PASM, "pasm", "r", qr/42/, 'running the program (pasm)');
+ set I1,42
+ print I1
+ print "\\n"
+PASM
+pdb_output_like( <<PASM, "pasm", "n", qr/one more time/, 'next instruction (pasm)');
+ print "one more time\\n"
+PASM
+pdb_output_like( <<PASM, "pasm", "next", qr/one more time/, 'next instruction (long,pasm)');
+ print "one more time\\n"
+PASM
+pdb_output_like( <<PIR, "pir", "n", qr/one more time/, 'next instruction (pir)');
+.sub main :main
+ print "one more time\\n"
+.end
+PIR
+pdb_output_like( <<PIR, "pir", "next", qr/one more time/, 'next instruction (long,pir)');
+.sub main :main
+ print "one more time\\n"
+.end
+PIR
+pdb_output_like( <<PIR, "pir", "s", qr/current instr.: 'main'/, 'show stack (pir)');
+.sub main :main
+ \$I1 = 242
+.end
+PIR
+pdb_output_like( <<PIR, "pir", "stack", qr/current instr.: 'main'/, 'show stack (long,pir)');
+.sub main :main
+ \$I1 = 242
+.end
+PIR
+pdb_output_like( <<PASM, "pasm", "s", qr/current instr.: '\(null\)'/, 'show stack (pasm)');
+ set I1, 242
+PASM
+pdb_output_like( <<PASM, "pasm", "info", qr/Total memory allocated =/, 'info (pasm)');
+ set I1, 242
+PASM
+pdb_output_like( <<PASM, "pasm", "b", qr/Breakpoint 1 at.*pos 0/, 'set breakpoint');
+ set I1, 242
+PASM
+pdb_output_like( <<PASM, "pasm", "b\nb\nL", qr/Breakpoint 1 at pos 0\nBreakpoint 2 at pos 0/, 'list breakpoints');
+ set I1, 242
+PASM
+
+pdb_output_like( <<PIR, "pir", "b\nb\nL", qr/Breakpoint 1 at pos 0\nBreakpoint 2 at pos 0/, 'list breakpoints (pir)');
+.sub main :main
+ \$I1 = 242
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t", qr/set I0, 242/, 'trace');
+ set I0, 242
+PASM
+
+pdb_output_like( <<PIR, "pir", "t", qr/set I0, 242/, 'trace (pir)');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t 2", qr/\d+ set I0, 242\s*I0=\d+\s*\d+ set I1, 1982/, 'trace multiple statements');
+ set I0, 242
+ set I1, 1982
+PASM
+
+pdb_output_like( <<PIR, "pir", "t 2", qr/\d+ set I0, 242\s*I0=\d+\s*\d+ set I1, 1982/, 'trace multiple statements (pir)');
+.sub main :main
+ \$I0 = 242
+ \$I1 = 1982
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t\np I0", qr/^242/m, 'print an integer register');
+ set I0, 242
+PASM
+
+pdb_output_like( <<PIR, "pir", "t\np I0", qr/^242/m, 'print an integer register (pir)');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t\np N0", qr/^3.14159/m, 'print a numeric register');
+ set N0, 3.14159
+PASM
+
+pdb_output_like( <<PIR, "pir", "t\np N0", qr/^3.14159/m, 'print a numeric register (pir)');
+.sub main :main
+ \$N0 = 3.14159
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t\np P0", qr/^ResizablePMCArray/m, 'print a PMC register');
+ new P0, 'ResizablePMCArray'
+PASM
+
+pdb_output_like( <<PIR, "pir", "t\np P0", qr/^ResizablePMCArray=PMC/m, 'print a PMC register (pir)');
+.sub main :main
+ \$P0 = new 'ResizablePMCArray'
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t\np S0", qr/^ceiling cat/m, 'print a string register');
+ set S0, "ceiling cat"
+PASM
+
+pdb_output_like( <<PIR, "pir", "t\np S0", qr/^ceiling cat/m, 'print a string register (pir)');
+.sub main :main
+ \$S0 = "ceiling cat"
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t 2\np I", qr/I0 = 242\s*I1 = 1982/, 'print all integer registers');
+ set I0, 242
+ set I1, 1982
+PASM
+
+pdb_output_like( <<PIR, "pir","t 2\np I", qr/I0 = 242\s*I1 = 1982/, 'print all integer registers (pir)');
+.sub main :main
+ \$I0 = 242
+ \$I1 = 1982
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "b\n d 1", qr/Breakpoint 1 deleted/, 'Delete a breakpoint');
+ set I0, 242
+PASM
+
+pdb_output_like( <<PIR, "pir", "b\nd 1", qr/Breakpoint 1 deleted/, 'Delete a breakpoint (pir)');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "l", qr/\.sub main :main/, 'list source');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "l 2", qr/N4 = 6.28/, 'list source with start line');
+.sub main :main
+ \$N3 = 3.14
+ \$N4 = 6.28
+ print "\\n"
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "d 42", qr/No breakpoint number 42/, 'delete invalid breakpoint');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+TODO: {
+
+local $TODO = 'eval support functions deprecated, TT #872, pending eval reworking';
+
+pdb_output_like( <<PIR, "pir", "e ", qr/Must give a command to eval/, 'eval nothing');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+}
+
+pdb_output_like( <<PIR, "pir", "t\na I0 17", qr/I0 = 17/, 'assign to an integer register');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "a Z0 42", qr/Invalid register type Z/, 'assign to an invalid register');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "a foo", qr/Must give a register number and value to assign/, 'invalid assignment command');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "t\na N0 3.14", qr/N0 = 3.14/, 'assign to a numeric register');
+.sub main :main
+ \$N0 = 9.99
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "t\np S", qr/S0 = foobar/, 'print string registers');
+.sub main :main
+ \$S0 = "foobar"
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "t\na S0 foobar", qr/S0 = no such register/, 'print string registers when none exist');
+.sub main :main
+ new \$P0, 'ResizableIntegerArray'
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "r", qr/great job!/, 'run code');
+.sub main :main
+ print "great job!"
+.end
+PIR
+
+TODO: {
+
+local $TODO = 'arguments do not seem to populate $P0';
+pdb_output_like( <<PIR, "pir", "r gomer", qr/gomer/, 'run code with args');
+.sub main :main
+ print \$P0
+.end
+PIR
+
+}
+
+pdb_output_like( <<PIR, "pir", "t\nw I0 == 2\nt", qr/Adding watchpoint/, 'watchpoint');
+.sub main :main
+ \$I0 = 1
+ \$I0 = 2
+ \$I0 = 3
+.end
+PIR
+
+BEGIN { $tests += 44 }
BEGIN { plan tests => $tests; }
@@ -75,7 +307,7 @@
Takes 4 arguments: a file to run, the filename-extension of the file
(probably "pir" or "pasm"), the command or commands to provide to
-parrot_debugger as input, and a regex string to match within
+parrot_debugger as script file, and a regex string to match within
parrot_debugger's output.
=cut
@@ -95,7 +327,7 @@
$f->print($input);
$f->print("\nquit\n");
$f->close();
- system("$path_to_pdb $codefn <$stdinfn >$stdoutfn 2>&1");
+ system("$path_to_pdb --script $stdinfn $codefn >$stdoutfn 2>&1");
$f = IO::File->new($stdoutfn);
my $output = join( '', <$f> );
Copied: branches/pluggable_runcore/t/tools/pgegrep.t (from r40540, trunk/t/tools/pgegrep.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/tools/pgegrep.t Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/tools/pgegrep.t)
@@ -0,0 +1,111 @@
+#! perl
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/tools/pgegrep.t - test the script tools/utils/pgegrep
+
+=head1 SYNOPSIS
+
+ % prove t/tools/pgegrep.t
+
+=head1 DESCRIPTION
+
+Tests the features of of the C<pgegrep> utility.
+
+=cut
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+
+use Fatal qw{open close};
+use Test::More;
+use Parrot::Test tests => 10;
+use Parrot::Config;
+use File::Spec ();
+
+my $testdata = File::Spec->catfile(qw{. t tools testdata });
+my $testdata_escaped = $testdata;
+$testdata_escaped =~ s!\\!\\\\!g;
+
+sub pgegrep_output_like {
+ my ($options, $snippet, $desc) = @_;
+
+ my $PARROT = ".$PConfig{slash}$PConfig{test_prog}";
+ my $pgegrep = File::Spec->catfile( qw{. tools util pgegrep} );
+ my $out = `$PARROT $pgegrep $options`;
+
+ like( $out, $snippet, $desc );
+
+ return;
+}
+
+pgegrep_output_like(
+ '-V',
+ qr!\Qpgegrep v0.0.1\E!,
+ 'pge reports correct version'
+);
+
+pgegrep_output_like(
+ "cat $testdata",
+ qr!keyboardcat!,
+ 'basic sanity of matching a literal'
+);
+
+pgegrep_output_like(
+ "-n cat $testdata",
+ qr!1:keyboardcat!,
+ 'matching a literal with line number'
+);
+
+pgegrep_output_like(
+ "--line-number cat $testdata",
+ qr!1:keyboardcat!,
+ 'matching a literal with line number with long option'
+);
+
+pgegrep_output_like(
+ "-H cat $testdata",
+ qr!$testdata_escaped:keyboardcat!,
+ 'matching a literal with file name'
+);
+
+pgegrep_output_like(
+ "--with-filename cat $testdata",
+ qr!$testdata_escaped:keyboardcat!,
+ 'matching a literal with file name with long option'
+);
+
+
+pgegrep_output_like(
+ "-v cat $testdata",
+ qr!saxophonegiraffe!,
+ 'test inversion of match'
+);
+
+pgegrep_output_like(
+ "--invert-match cat $testdata",
+ qr!saxophonegiraffe!,
+ 'test inversion of match with long option'
+);
+
+pgegrep_output_like(
+ "-l cat $testdata",
+ qr!$testdata_escaped!,
+ 'find files that match'
+);
+
+pgegrep_output_like(
+ "--files-with-matches cat $testdata",
+ qr!$testdata_escaped!,
+ 'find files that match with long option'
+);
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
Modified: branches/pluggable_runcore/t/tools/pmc2c.t
==============================================================================
--- branches/pluggable_runcore/t/tools/pmc2c.t Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/t/tools/pmc2c.t Fri Aug 14 01:24:23 2009 (r40541)
@@ -149,19 +149,19 @@
pmc2c_output_like( <<'END_PMC', <<'END_C', 'maps' );
pmclass a hll dale maps Integer { }
END_PMC
- const INTVAL pmc_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "dale"));
- if (pmc_id > 0) {
- Parrot_register_HLL_type( interp, pmc_id, enum_class_Integer, entry);
+ const INTVAL hll_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "dale"));
+ if (hll_id > 0) {
+ Parrot_register_HLL_type( interp, hll_id, enum_class_Integer, entry);
}
END_C
pmc2c_output_like( <<'END_PMC', <<'END_C', 'maps, more than one.' );
pmclass a hll dale maps Integer maps Float { }
END_PMC
- const INTVAL pmc_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "dale"));
- if (pmc_id > 0) {
- Parrot_register_HLL_type( interp, pmc_id, enum_class_Float, entry);
- Parrot_register_HLL_type( interp, pmc_id, enum_class_Integer, entry);
+ const INTVAL hll_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "dale"));
+ if (hll_id > 0) {
+ Parrot_register_HLL_type( interp, hll_id, enum_class_Float, entry);
+ Parrot_register_HLL_type( interp, hll_id, enum_class_Integer, entry);
}
END_C
Copied: branches/pluggable_runcore/t/tools/testdata (from r40540, trunk/t/tools/testdata)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/tools/testdata Fri Aug 14 01:24:23 2009 (r40541, copy of r40540, trunk/t/tools/testdata)
@@ -0,0 +1,2 @@
+keyboardcat
+saxophonegiraffe
Modified: branches/pluggable_runcore/tools/build/nativecall.pl
==============================================================================
--- branches/pluggable_runcore/tools/build/nativecall.pl Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/tools/build/nativecall.pl Fri Aug 14 01:24:23 2009 (r40541)
@@ -141,7 +141,7 @@
my $ret_sig = $sig_table{$ret};
- if ($args =~ /[234]/) {
+ if ($args =~ /[234V]/) {
push @nci_defs, create_function(
$sig, $ret,
$args, [@arg],
Modified: branches/pluggable_runcore/tools/dev/create_language.pl
==============================================================================
--- branches/pluggable_runcore/tools/dev/create_language.pl Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/tools/dev/create_language.pl Fri Aug 14 01:24:23 2009 (r40541)
@@ -810,11 +810,11 @@
.sub 'say'
.param pmc args :slurpy
- .local pmc iter
- iter = new 'Iterator', args
+ .local pmc it
+ it = iter args
iter_loop:
- unless iter goto iter_end
- $P0 = shift iter
+ unless it goto iter_end
+ $P0 = shift it
print $P0
goto iter_loop
iter_end:
Modified: branches/pluggable_runcore/tools/dev/mk_language_shell.pl
==============================================================================
--- branches/pluggable_runcore/tools/dev/mk_language_shell.pl Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/tools/dev/mk_language_shell.pl Fri Aug 14 01:24:23 2009 (r40541)
@@ -1228,8 +1228,11 @@
* Copyright (C) 20xx, Parrot Foundation.
*/
+BEGIN_OPS_PREAMBLE
+
#include "parrot/dynext.h"
-VERSION = PARROT_VERSION;
+
+END_OPS_PREAMBLE
/* Op to get the address of a PMC. */
inline op @lclang at _pmc_addr(out INT, invar PMC) :base_core {
@@ -1256,11 +1259,11 @@
.sub 'say'
.param pmc args :slurpy
- .local pmc iter
- iter = new 'Iterator', args
+ .local pmc it
+ it = iter args
iter_loop:
- unless iter goto iter_end
- $P0 = shift iter
+ unless it goto iter_end
+ $P0 = shift it
print $P0
goto iter_loop
iter_end:
Modified: branches/pluggable_runcore/tools/dev/mk_manifest_and_skip.pl
==============================================================================
--- branches/pluggable_runcore/tools/dev/mk_manifest_and_skip.pl Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/tools/dev/mk_manifest_and_skip.pl Fri Aug 14 01:24:23 2009 (r40541)
@@ -10,6 +10,12 @@
my $script = $0;
+if (-e '.git') {
+ print "Sorry, this script is not compatible with git-svn\n";
+ print "Patches Welcome!\n";
+ exit 1;
+}
+
my $mani = Parrot::Manifest->new( { script => $script, } );
my $manifest_lines_ref = $mani->prepare_manifest();
Modified: branches/pluggable_runcore/tools/dev/parrot-fuzzer
==============================================================================
--- branches/pluggable_runcore/tools/dev/parrot-fuzzer Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/tools/dev/parrot-fuzzer Fri Aug 14 01:24:23 2009 (r40541)
@@ -419,7 +419,6 @@
class OpfuncGenerator:
opfunc_list = []
opfunc_blacklist = [
- 'branch_cs', # TT# 470 - known to segfault
'check_events', #only for testing
'check_events__', #not for direct use
'clears', #clearing all [SPIN] registers isn't useful
Modified: branches/pluggable_runcore/tools/dev/parrot.supp
==============================================================================
--- branches/pluggable_runcore/tools/dev/parrot.supp Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/tools/dev/parrot.supp Fri Aug 14 01:24:23 2009 (r40541)
@@ -42,20 +42,20 @@
{
trace_system_stack_2
Memcheck:Cond
- fun:pobject_lives
+ fun:Parrot_gc_mark_PObj_alive
fun:trace_mem_block
}
{
trace_system_stack_3
Memcheck:Value4
- fun:pobject_lives
+ fun:Parrot_gc_mark_PObj_alive
fun:trace_mem_block
}
{
trace_system_stack_4
Memcheck:Value4
fun:mark_special
- fun:pobject_lives
+ fun:Parrot_gc_mark_PObj_alive
fun:trace_mem_block
}
{
Deleted: branches/pluggable_runcore/tools/dev/parrot_8.supp
==============================================================================
--- branches/pluggable_runcore/tools/dev/parrot_8.supp Fri Aug 14 01:24:23 2009 (r40540)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,244 +0,0 @@
-# valgrind suppression file for 64bit parrot
-#
-# valgrind --suppressions=tools/dev/parrot_8.supp ./parrot xx.pasm
-#
-{
- supp_1
- Memcheck:Cond
- fun:trace_mem_block
- fun:trace_system_stack
- fun:trace_system_areas
- fun:Parrot_dod_trace_root
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
- fun:get_new_pmc_header
- fun:pmc_new_noinit
-}
-{
- supp_2
- Memcheck:Cond
- fun:trace_mem_block
- fun:trace_system_stack
- fun:trace_system_areas
- fun:Parrot_dod_trace_root
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
- fun:get_new_pmc_header
- fun:pmc_new_noinit
-}
-{
- supp_3
- Memcheck:Cond
- fun:contained_in_pool
- fun:is_pmc_ptr
- fun:trace_mem_block
- fun:trace_system_stack
- fun:trace_system_areas
- fun:Parrot_dod_trace_root
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
-}
-{
- supp_4
- Memcheck:Value8
- fun:pobject_lives
- fun:trace_mem_block
- fun:trace_system_stack
- fun:trace_system_areas
- fun:Parrot_dod_trace_root
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
- fun:get_new_pmc_header
-}
-{
- supp_5
- Memcheck:Value8
- fun:mark_special
- fun:pobject_lives
- fun:trace_mem_block
- fun:trace_system_stack
- fun:trace_system_areas
- fun:Parrot_dod_trace_root
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
-}
-{
- supp_6
- Memcheck:Cond
- fun:contained_in_pool
- fun:is_buffer_ptr
- fun:trace_mem_block
- fun:trace_system_stack
- fun:trace_system_areas
- fun:Parrot_dod_trace_root
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
-}
-{
- supp_7
- Memcheck:Cond
- fun:Parrot_dod_trace_children
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
- fun:get_new_pmc_header
- fun:pmc_new_noinit
- fun:pmc_new
- fun:new_ret_continuation_pmc
- fun:Parrot_Sub_invoke
-}
-{
- supp_7
- Memcheck:Value8
- fun:Parrot_dod_trace_children
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
- fun:get_new_pmc_header
- fun:pmc_new_noinit
- fun:pmc_new
- fun:new_ret_continuation_pmc
- fun:Parrot_Sub_invoke
-}
-{
- supp_8
- Memcheck:Cond
- fun:mark_special
- fun:pobject_lives
- fun:Parrot_dod_trace_children
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
- fun:get_new_pmc_header
- fun:pmc_new_noinit
- fun:pmc_new
-}
-{
- supp_9
- Memcheck:Value8
- fun:mark_special
- fun:pobject_lives
- fun:Parrot_dod_trace_children
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
- fun:get_new_pmc_header
- fun:pmc_new_noinit
- fun:pmc_new
-}
-{
- supp_10
- Memcheck:Value8
- fun:Parrot_Hash_mark
- fun:Parrot_NameSpace_mark
- fun:Parrot_dod_trace_children
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
- fun:get_new_pmc_header
- fun:pmc_new_noinit
- fun:pmc_new
-}
-{
- supp_11
- Memcheck:Cond
- fun:mark_special
- fun:pobject_lives
- fun:parrot_mark_hash
- fun:Parrot_Hash_mark
- fun:Parrot_NameSpace_mark
- fun:Parrot_dod_trace_children
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
-}
-{
- supp_12
- Memcheck:Value8
- fun:mark_special
- fun:pobject_lives
- fun:parrot_mark_hash
- fun:Parrot_Hash_mark
- fun:Parrot_NameSpace_mark
- fun:Parrot_dod_trace_children
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
-}
-{
- supp_13
- Memcheck:Value8
- fun:Parrot_NameSpace_mark
- fun:Parrot_dod_trace_children
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
- fun:get_new_pmc_header
- fun:pmc_new_noinit
- fun:pmc_new
- fun:new_ret_continuation_pmc
-}
-{
- supp_1
- Memcheck:Value8
- fun:Parrot_Continuation_mark
- fun:Parrot_dod_trace_children
- fun:trace_active_PMCs
- fun:Parrot_dod_ms_run
- fun:Parrot_do_dod_run
- fun:more_traceable_objects
- fun:gc_ms_get_free_object
- fun:new_pmc_header
- fun:get_new_pmc_header
- fun:pmc_new_noinit
- fun:Parrot_new_p_ic
- fun:runops_slow_core
-}
Modified: branches/pluggable_runcore/tools/dev/pbc_header.pl
==============================================================================
--- branches/pluggable_runcore/tools/dev/pbc_header.pl Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/tools/dev/pbc_header.pl Fri Aug 14 01:24:23 2009 (r40541)
@@ -99,18 +99,6 @@
return;
}
-sub pbc_info {
- for my $f (@ARGV) {
- open my $F, "<", "$f" or die "Can't open $f: $!";
- binmode $F;
- print "$f\n";
-
- show_pbc_file_info($F);
- }
-
- return;
-}
-
my @pbc_header_type_names;
BEGIN {
@pbc_header_type_names = qw( directory default fixup constant
Modified: branches/pluggable_runcore/tools/dev/pbc_to_exe.pir
==============================================================================
--- branches/pluggable_runcore/tools/dev/pbc_to_exe.pir Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/tools/dev/pbc_to_exe.pir Fri Aug 14 01:24:23 2009 (r40541)
@@ -4,7 +4,7 @@
=head1 NAME
-pbc_to_exe
+pbc_to_exe - compile bytecode to executable
=head2 SYNOPSIS
Modified: branches/pluggable_runcore/tools/dev/vtablize.pl
==============================================================================
--- branches/pluggable_runcore/tools/dev/vtablize.pl Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/tools/dev/vtablize.pl Fri Aug 14 01:24:23 2009 (r40541)
@@ -243,9 +243,6 @@
s/^(\s*)(void\s+delete_keyed\(PMC\s+\*\w*\)\s+{)/$1VTABLE $2/;
s/^(\s*)(void\s+delete_keyed_int\(INTVAL\s+\w*\)\s+{)/$1VTABLE $2/;
s/^(\s*)(void\s+delete_keyed_str\(STRING\s+\*\w*\)\s+{)/$1VTABLE $2/;
-s/^(\s*)(PMC\s+\*nextkey_keyed\(PMC\s+\*\w*,\s+INTVAL\s+\w*\)\s+{)/$1VTABLE $2/;
-s/^(\s*)(PMC\s+\*nextkey_keyed_int\(INTVAL\s+\w*,\s+INTVAL\s+\w*\)\s+{)/$1VTABLE $2/;
-s/^(\s*)(PMC\s+\*nextkey_keyed_str\(STRING\s+\*\w*,\s+INTVAL\s+\w*\)\s+{)/$1VTABLE $2/;
s/^(\s*)(PMC\s+\*get_iter\(\)\s+{)/$1VTABLE $2/;
s/^(\s*)(opcode_t\s+\*invoke\(void\s+\*\w*\)\s+{)/$1VTABLE $2/;
s/^(\s*)(INTVAL\s+can\(STRING\s+\*\w*\)\s+{)/$1VTABLE $2/;
Modified: branches/pluggable_runcore/tools/util/pgegrep
==============================================================================
--- branches/pluggable_runcore/tools/util/pgegrep Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/tools/util/pgegrep Fri Aug 14 01:24:23 2009 (r40541)
@@ -150,7 +150,7 @@
$I1 = File.'is_file'(filename)
.IfElse($I1, {
# Is a file
- handle = open filename, '<'
+ handle = open filename, 'r'
},{
# Not a file, hopefully a directory
$I1 = File.'is_dir'(filename)
Modified: branches/pluggable_runcore/tools/util/release.json
==============================================================================
--- branches/pluggable_runcore/tools/util/release.json Fri Aug 14 00:38:12 2009 (r40540)
+++ branches/pluggable_runcore/tools/util/release.json Fri Aug 14 01:24:23 2009 (r40541)
@@ -1,9 +1,9 @@
{
- "release.version" : "1.3.0",
- "release.name" : "Andean Swift",
+ "release.version" : "1.4.0",
+ "release.name" : "Mundo Cani",
"release.day" : "Tuesday",
- "release.date" : "16 June 2009",
- "release.nextdate" : "21 July 2009",
+ "release.date" : "21 July 2009",
+ "release.nextdate" : "18 August 2009",
"web.root" : "http://parrot.org/",
"web.source" : "download",
@@ -11,13 +11,13 @@
"web.repository" : "https://svn.parrot.org/parrot/trunk/",
"bugday.day" : "Saturday",
- "bugday.date" : "18 July 2009",
+ "bugday.date" : "15 August 2009",
"wiki.root" : "https://trac.parrot.org/parrot/wiki/",
- "wiki.bugday" : "bug_day_2009_07_18",
+ "wiki.bugday" : "bug_day_2009_08_15",
"cpan.search" : "http://search.cpan.org/dist/parrot",
- "ftp.path" : "ftp://ftp.parrot.org/pub/parrot/releases/devel/1.3.0/",
+ "ftp.path" : "ftp://ftp.parrot.org/pub/parrot/releases/devel/1.4.0/",
"subversion.root" : "http://subversion.tigris.org/",
"svk.root" : "http://svk.bestpractical.com/"
}
More information about the parrot-commits
mailing list