Skip to content
Browse files

Merge branch 'master' into branch 'lazyrakudo'

git-svn-id: https://svn.parrot.org/parrot/branches/lazyrakudo@31009 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent c097071 commit 4d24c46b0cafd9b76005d273d54cf34ce41a13b1 tene committed Sep 12, 2008
Showing with 10,201 additions and 4,710 deletions.
  1. +8 −0 CREDITS
  2. +305 −19 Configure.pl
  3. +15 −0 DEPRECATED.pod
  4. +99 −28 MANIFEST
  5. +15 −1 MANIFEST.SKIP
  6. +2 −0 MANIFEST.generated
  7. +17 −0 NEWS
  8. +1 −0 PLATFORMS
  9. +18 −15 compilers/imcc/cfg.c
  10. +12 −5 compilers/imcc/imcc.y
  11. +607 −593 compilers/imcc/imcparser.c
  12. +12 −0 compilers/imcc/main.c
  13. +14 −11 compilers/imcc/optimizer.c
  14. +1 −1 compilers/imcc/reg_alloc.c
  15. +1 −1 compilers/imcc/unit.h
  16. +7 −0 compilers/ncigen/MAINTAINER
  17. +6 −0 compilers/ncigen/NCIGEN.TODO
  18. +136 −0 compilers/ncigen/c99.pir
  19. +121 −0 compilers/ncigen/config/makefiles/ncigen.in
  20. +167 −0 compilers/ncigen/lib/Parrot/Test/C99AST.pm
  21. +103 −0 compilers/ncigen/nci_gen.pl
  22. +336 −0 compilers/ncigen/src/NCIPIR.pir
  23. +82 −0 compilers/ncigen/src/builtins/say.pir
  24. +581 −0 compilers/ncigen/src/c99.pg
  25. +315 −0 compilers/ncigen/src/c99AST.pir
  26. +238 −0 compilers/ncigen/src/parser/actions.pm
  27. +762 −0 compilers/ncigen/src/parser/grammar.pg
  28. +18 −0 compilers/ncigen/t/c99AST/struct_00.t
  29. +23 −0 compilers/ncigen/t/c99AST/typedef_00.t
  30. +7 −0 compilers/ncigen/t/harness
  31. +175 −0 compilers/ncigen/t/parse_00.t
  32. +28 −0 compilers/ncigen/t/parse_01.t
  33. +8 −6 compilers/pct/src/PAST/Compiler.pir
  34. +3 −2 compilers/pct/src/PAST/Node.pir
  35. +0 −8 compilers/pct/src/POST/Compiler.pir
  36. +79 −19 compilers/pirc/README.pod
  37. +146 −42 compilers/pirc/new/main.c
  38. +146 −284 compilers/pirc/new/pir.l
  39. +826 −569 compilers/pirc/new/pir.y
  40. +90 −0 compilers/pirc/new/pircompiler.c
  41. +21 −8 compilers/pirc/new/pircompiler.h
  42. +615 −196 compilers/pirc/new/pircompunit.c
  43. +51 −23 compilers/pirc/new/pircompunit.h
  44. +546 −692 compilers/pirc/new/pirlexer.c
  45. +1 −1 compilers/pirc/new/pirlexer.h
  46. +2,053 −1,821 compilers/pirc/new/pirparser.c
  47. +194 −204 compilers/pirc/new/pirparser.h
  48. +39 −34 compilers/pirc/new/pirsymbol.c
  49. +15 −3 compilers/pirc/new/pirsymbol.h
  50. +23 −0 compilers/pirc/new/piryy.h
  51. +20 −8 config/auto/aio.pm
  52. +4 −4 config/auto/aio/aio.in
  53. +1 −2 config/auto/msvc.pm
  54. +53 −10 config/auto/pmc.pm
  55. +0 −1 config/auto/warnings.pm
  56. +8 −0 config/gen/call_list/misc.in
  57. +0 −2 config/gen/config_h.pm
  58. +1 −4 config/gen/crypto.pm
  59. +3 −8 config/gen/makefiles.pm
  60. +31 −19 config/gen/makefiles/root.in
  61. +3 −0 config/init/defaults.pm
  62. +0 −8 docs/book/ch08_reference.pod
  63. +32 −34 docs/configuration.pod
  64. +6 −4 docs/pdds/draft/pdd11_extending.pod
  65. +292 −0 docs/pdds/draft/pdd30_install.pod
  66. +607 −0 docs/pdds/draft/pdd31_hll_interop.pod
  67. +1 −4 docs/pdds/pdd07_codingstd.pod
  68. +3 −3 docs/pdds/pdd09_gc.pod
  69. +3 −2 docs/pdds/pdd17_pmc.pod
  70. +23 −1 docs/pdds/pdd19_pir.pod
  71. +3 −5 docs/pdds/pdd23_exceptions.pod
  72. +15 −1 docs/pdds/pdd26_ast.pod
  73. +4 −4 docs/pdds/pdd27_multiple_dispatch.pod
Sorry, we could not display the entire diff because too many files (492) changed.
View
8 CREDITS
@@ -437,6 +437,10 @@ S: Herrnbaumgarten, Austria
N: Luke Palmer
D: Many fixes
+N: Marcelo Serra Castilhos
+E: mhelix@terra.com.br
+D: Bug fix
+
N: Marcus Thiesen
D: URM language, bugfixes
@@ -545,6 +549,10 @@ D: Miscellaneous cleanup and PDD07-conformance
N: Ovid
D: Rename 'pbc_to_c' to 'pbc_to_exe'
+N: Paco Alguacil
+D: Building on various platorms
+E: paco.linux@gmail.com
+
N: Pancake
D: Fixes for pdb, the Parrot debugger
View
324 Configure.pl
@@ -7,6 +7,7 @@
use strict;
use warnings;
use lib 'lib';
+use Data::Dumper;$Data::Dumper::Indent = 1;
use Parrot::Configure;
use Parrot::Configure::Options qw( process_options );
@@ -19,7 +20,6 @@
print_introduction
print_conclusion
);
-use Parrot::Configure::Step::List qw( get_steps_list );
use Parrot::Revision;
$| = 1; # $OUTPUT_AUTOFLUSH = 1;
@@ -34,12 +34,15 @@
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# from Parrot::Configure::Options
-my $args = process_options(
+my ($args, $steps_list_ref) = process_options(
{
- mode => 'configure',
+ mode => (defined $ARGV[0] and $ARGV[0] =~ /^--file=/)
+ ? 'file'
+ : 'configure',
argv => [@ARGV],
}
);
+#print STDERR Dumper ($args, $steps_list_ref);
exit(1) unless defined $args;
my $opttest = Parrot::Configure::Options::Test->new($args);
@@ -58,14 +61,14 @@
my $conf = Parrot::Configure->new();
-# from Parrot::Configure::Step::List
-$conf->add_steps( get_steps_list() );
+$conf->add_steps( @{ $steps_list_ref } );
# from Parrot::Configure::Data
$conf->options->set( %{$args} );
# Log files created by Configure.pl in MANIFEST.configure.generated
$conf->{active_configuration} = 1;
+unlink 'MANIFEST.configure.generated';
# Run the actual steps from Parrot::Configure
$conf->runsteps or exit(1);
@@ -82,22 +85,44 @@
=head1 NAME
-Configure.pl - Parrot's Configuration Script
+Configure.pl - Parrot's configuration script
=head1 SYNOPSIS
% perl Configure.pl [options]
+or:
+
+ % perl Configure.pl --file=/path/to/configuration/directives
+
=head1 DESCRIPTION
This is Parrot's configuration program. It should be run to create
the necessary system-specific files before building Parrot.
-=head2 Command-line Options
+We now offer two interfaces to configuration:
+
+=over 4
+
+=item * Command-Line Interface
-General Options
+All configuration options are placed on the command-line. You may request
+interactive configuration with the C<--ask> option. You may not use the
+C<--file> option, as that is reserved for the Configuration-File interface.
-=over
+=item * Configuration-File Interface
+
+All configuration options are placed in a special configuration file whose
+full path is invoked on the command-line as
+C<--file=/path/to/configuration/directives> as the sole command-line option.
+You may not request interactive configuration. For specific instructions, see
+L</"CONFIGURATION-FILE INTERFACE"> below.
+
+=back
+
+=head2 General Options
+
+=over 4
=item C<--help>
@@ -145,7 +170,8 @@ =head2 Command-line Options
=item C<--ask>
-This turns on the user prompts.
+This turns on the user prompts during configuraion. Available only in
+Command-Line interface. Not available in Configuration-File interface.
=item C<--test>
@@ -176,9 +202,9 @@ =head2 Command-line Options
=back
-Compile Options
+=head2 Compile Options
-=over
+=over 4
=item C<--debugging=0>
@@ -269,9 +295,9 @@ =head2 Command-line Options
=back
-Parrot Options
+=head2 Parrot Options
-=over
+=over 4
=item C<--intval=(type)>
@@ -312,9 +338,9 @@ =head2 Command-line Options
=back
-International Components For Unicode (ICU) Options
+=head2 International Components For Unicode (ICU) Options
-=over
+=over 4
=item C<--icu-config=/path/to/icu-config>
@@ -346,9 +372,9 @@ =head2 Command-line Options
=back
-Other Options
+=head2 Other Options
-=over
+=over 4
=item C<--maintainer>
@@ -361,9 +387,269 @@ =head2 Command-line Options
=back
+=head1 CONFIGURATION-FILE INTERFACE
+
+In the Configuration-File interface, unlike the Command-Line interface, you
+may delete configuration steps or run them in an order different from that
+listed in Parrot::Configure::Step::List.
+
+A configuration file is a plain-text file located somewhere in or under your
+top-level Parrot directory. Unless indicated otherwise, all lines in this
+file must have no leading whitespace. As in Perl 5, lines beginning with C<#>
+marks are comments and are ignored during parsing of the file. Unlike Perl 5,
+you may not begin comments in the middle of a line.
+
+The configuration file must contain these three sections:
+
+=over 4
+
+=item * variables
+
+=over 4
+
+=item *
+
+Section begins with line C<=variables> and must be followed by at least one
+blank line. All other content in this section is optional.
+
+=item *
+
+Section may contain one or more I<key=value> pairs which assign strings to
+variables much in the way that you would do in a shell script wrapping around
+F<Configure.pl>.
+
+ =variables
+
+ CC=/usr/bin/gcc
+ CX=/usr/bin/g++
+
+So if you typically invoked F<Configure.pl> by wrapping it in a shell script
+for the purpose of setting environmental variables used in options, like this:
+
+ CC="/usr/bin/gcc"
+ CX="/usr/bin/g++"
+ /usr/local/bin/perl Configure.pl \
+ --cc="$CC" \
+ --cxx="$CX" \
+ --link="$CX" \
+ --ld="$CX"
+
+... you would now place the assignments to C<CC> and C<CX> in the
+I<=variables> section of the configuration file (as above).
+
+=back
+
+=item * general
+
+=over 4
+
+=item *
+
+Section begins with line C<=general> and must be followed by at least one
+blank line. All other content in this section is optional.
+
+=item *
+
+This section is the location recommended for listing options whose impact is
+not conceptually limited to a single step. It is also the location where the
+variables defined in the I<=variables> section are assigned to particular
+Parrot configuration options. Entries in this section must be either
+I<option=value> pairs or be options which will be assigned a true value.
+
+ cc=$CC
+ cxx=$CX
+ link=$CX
+ ld=/usr/bin/g++
+ verbose
+
+Note that when the value is a variable defined in the I<=variables> section,
+it must be preceded by a C<$> sign.
+
+=item *
+
+You I<may> list options here which are I<conceptually> limited to a single
+configuration step. For example, if you wished to skip validation of the
+F<MANIFEST> during configuration and to configure without ICU, you I<could>,
+in this section, say:
+
+ nomanicheck
+ without-icu
+
+However, as we shall quickly see, it's conceptually clearer to place these
+values next to those configuration steps that actually use them.
+
+=back
+
+=item * steps
+
+=over 4
+
+=item *
+
+Section begins with line C<=steps> and must be followed by at least one
+blank line, in turn followed by the list of configuration steps, followed by
+another blank line followed by a line C<=cut> (just like POD).
+
+=item *
+
+The order in which you list the steps is the order in which they will be
+executed. If you delete a step from the canonical list or comment a step out,
+it will not be executed.
+
+ ...
+ auto::snprintf
+ # auto::perldoc
+ auto::ctags
+ ...
+
+In the above example, step C<auto::perldoc> will be completely skipped. You
+will not see it listed as C<....skipped> in F<Configure.pl>'s output; it will
+simply not be there at all.
+
+=item *
+
+This is the recommended location to call options whose impact is
+I<conceptually> limited to a single configuration step. Type the
+configuration step's name, type a whitespace, type the option (with no leading
+C<-->) and repeat as needed for additional step-specific options.
+
+ init::manifest nomanicheck
+ ...
+
+=item *
+
+This is also the location to call options whose impact is limited to one step
+at a time but which may be applied to more than one configuration step. The
+C<fatal-step> and C<verbose-step> options are the best examples of this case.
+Rather than requesting verbose output from all configuration steps, you may,
+for example, wish to designate only a few steps for verbose output:
+
+ ...
+ init::hints verbose-step
+ init::headers
+ inter::progs fatal-step
+ ...
+ auto::gcc verbose-step
+ ...
+
+In the above example, F<Configure.pl> will grind to a halt if C<inter::progs>
+does not complete successfully. You will get verbose output only from
+C<init::hints> and C<auto::gcc>; the other 60+ steps will be terse.
+
+=item *
+
+Nothing prevents you from listing general options anywhere in this section.
+
+ init::manifest nomanicheck cc=$CC ld=/usr/bin/g++ verbose
+ init::defaults
+ ...
+
+That will work -- but why would you want to do something that messy?
+
+=back
+
+=back
+
+=head2 Example
+
+Ignoring leading whitespace, this is an example of a correctly formed
+configuration file.
+
+ =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::miniparrot
+ 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::env
+ auto::aio
+ auto::gmp
+ auto::readline
+ auto::gdbm
+ auto::pcre
+ auto::opengl
+ auto::crypto
+ auto::gettext
+ auto::snprintf
+ # auto::perldoc
+ 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
+
+You may see how this works in practice by calling:
+
+ perl Configure.pl --file=xconf/samples/yourfoobar
+
+or
+
+ perl Configure.pl --file=xconf/samples/testfoobar
+
=head1 SEE ALSO
-F<config/init/data.pl>, F<lib/Parrot/Configure/RunSteps.pm>,
+F<config/init/data.pl>, F<lib/Parrot/Configure.pm>,
F<lib/Parrot/Configure/Step.pm>, F<docs/configuration.pod>
=cut
View
15 DEPRECATED.pod
@@ -45,6 +45,10 @@ See RT #48567.
See RT #47011.
+=item * C<cmodulus> and variants [post 0.7.0]
+
+See RT #58550.
+
=back
=head1 Opcodes
@@ -71,6 +75,10 @@ See RT #47011.
See RT #47976.
+=item * C<n_*> math opcode variants [post 0.7.1]
+
+See RT #58410.
+
=back
=head1 Class Features
@@ -180,6 +188,13 @@ Will have to be:
These opcodes are part of the old MMD system, now deprecated and to be removed
when the branch is merged in after the release.
+=item * C<addr> shortcut for C<set_addr> op [post 0.7.1]
+
+The C<addr> shortcut that is mapped to the C<set_addr> will no longer be
+supported. Instead, use the C<set_addr> directly.
+
+See RT#58238.
+
=back
=head1 Parrot Compiler tools
View
127 MANIFEST
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Aug 20 04:58:13 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Mon Sep 8 16:35:15 2008 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -83,6 +83,23 @@ compilers/json/JSON/grammar.pg []
compilers/json/JSON/pge2pir.tg []
compilers/json/postalcodes.pir []
compilers/json/test.pir []
+compilers/ncigen/MAINTAINER []
+compilers/ncigen/NCIGEN.TODO []
+compilers/ncigen/c99.pir []
+compilers/ncigen/config/makefiles/ncigen.in []
+compilers/ncigen/lib/Parrot/Test/C99AST.pm []
+compilers/ncigen/nci_gen.pl []
+compilers/ncigen/src/NCIPIR.pir []
+compilers/ncigen/src/builtins/say.pir []
+compilers/ncigen/src/c99.pg []
+compilers/ncigen/src/c99AST.pir []
+compilers/ncigen/src/parser/actions.pm []
+compilers/ncigen/src/parser/grammar.pg []
+compilers/ncigen/t/c99AST/struct_00.t []
+compilers/ncigen/t/c99AST/typedef_00.t []
+compilers/ncigen/t/harness []
+compilers/ncigen/t/parse_00.t []
+compilers/ncigen/t/parse_01.t []
compilers/nqp/README.pod []
compilers/nqp/TODO.pod []
compilers/nqp/bootstrap/actions.pm []
@@ -160,6 +177,7 @@ compilers/pirc/new/pasm.l []
compilers/pirc/new/pasm.y []
compilers/pirc/new/pir.l []
compilers/pirc/new/pir.y []
+compilers/pirc/new/pircompiler.c []
compilers/pirc/new/pircompiler.h []
compilers/pirc/new/pircompunit.c []
compilers/pirc/new/pircompunit.h []
@@ -169,6 +187,7 @@ compilers/pirc/new/pirparser.c []
compilers/pirc/new/pirparser.h []
compilers/pirc/new/pirsymbol.c []
compilers/pirc/new/pirsymbol.h []
+compilers/pirc/new/piryy.h []
compilers/pirc/pirc.c []
compilers/pirc/src/README.pod []
compilers/pirc/src/jsonout.c []
@@ -475,6 +494,8 @@ docs/pdds/draft/pdd11_extending.pod [main]doc
docs/pdds/draft/pdd14_bignum.pod [main]doc
docs/pdds/draft/pdd16_native_call.pod [main]doc
docs/pdds/draft/pdd29_compiler_tools.pod [main]doc
+docs/pdds/draft/pdd30_install.pod [main]doc
+docs/pdds/draft/pdd31_hll_interop.pod [main]doc
docs/pdds/pdd00_pdd.pod [main]doc
docs/pdds/pdd03_calling_conventions.pod [main]doc
docs/pdds/pdd07_codingstd.pod [main]doc
@@ -660,11 +681,19 @@ examples/mops/mops.py [main]doc
examples/mops/mops.rb [main]doc
examples/mops/mops.scheme [main]doc
examples/namespace/namespace_dump.pir [main]doc
+examples/nci/Mysql.pir [main]doc
examples/nci/PQt.C [main]doc
examples/nci/QtHelloWorld.pasm [main]doc
+examples/nci/Xlib.pir [main]doc
+examples/nci/Xlibconstants.pir [main]doc
examples/nci/ls.pir [main]doc
+examples/nci/mysqltest.p6 [main]doc
+examples/nci/mysqltest.pir [main]doc
examples/nci/sdl_blue_rectangle.pir [main]doc
examples/nci/win32api.pir [main]doc
+examples/nci/xlibtest.nqp [main]doc
+examples/nci/xlibtest.p6 [main]doc
+examples/nci/xlibtest.pir [main]doc
examples/opengl/shapes.pir [main]doc
examples/opengl/triangle.pir [main]doc
examples/pasm/cat.pasm [main]doc
@@ -1179,26 +1208,58 @@ languages/c99/t/spi.t [c99]
languages/cardinal/cardinal.pir [cardinal]
languages/cardinal/config/makefiles/root.in [cardinal]
languages/cardinal/src/builtins/cmp.pir [cardinal]
+languages/cardinal/src/builtins/eval.pir [cardinal]
+languages/cardinal/src/builtins/globals.pir [cardinal]
languages/cardinal/src/builtins/guts.pir [cardinal]
+languages/cardinal/src/builtins/op.pir [cardinal]
languages/cardinal/src/builtins/say.pir [cardinal]
languages/cardinal/src/classes/Array.pir [cardinal]
+languages/cardinal/src/classes/Bool.pir [cardinal]
languages/cardinal/src/classes/Hash.pir [cardinal]
languages/cardinal/src/classes/Integer.pir [cardinal]
+languages/cardinal/src/classes/NilClass.pir [cardinal]
languages/cardinal/src/classes/Object.pir [cardinal]
languages/cardinal/src/classes/String.pir [cardinal]
languages/cardinal/src/parser/actions.pm [cardinal]
languages/cardinal/src/parser/grammar.pg [cardinal]
+languages/cardinal/src/parser/quote_expression.pir [cardinal]
languages/cardinal/t/00-sanity.t [cardinal]
languages/cardinal/t/01-stmts.t [cardinal]
languages/cardinal/t/02-functions.t [cardinal]
languages/cardinal/t/03-return.t [cardinal]
languages/cardinal/t/04-indexed.t [cardinal]
-languages/cardinal/t/06-hash.t [cardinal]
+languages/cardinal/t/05-op-cmp.t [cardinal]
languages/cardinal/t/07-loops.t [cardinal]
languages/cardinal/t/08-class.t [cardinal]
+languages/cardinal/t/09-test.t [cardinal]
+languages/cardinal/t/10-regex.t [cardinal]
languages/cardinal/t/99-other.t [cardinal]
-languages/cardinal/t/classes/array.t [cardinal]
+languages/cardinal/t/array/array.t [cardinal]
+languages/cardinal/t/array/at.t [cardinal]
+languages/cardinal/t/array/clear.t [cardinal]
+languages/cardinal/t/array/delete.t [cardinal]
+languages/cardinal/t/array/equals.t [cardinal]
+languages/cardinal/t/array/first.t [cardinal]
+languages/cardinal/t/array/flatten.t [cardinal]
+languages/cardinal/t/array/include.t [cardinal]
+languages/cardinal/t/array/intersection.t [cardinal]
+languages/cardinal/t/array/join.t [cardinal]
+languages/cardinal/t/array/mathop.t [cardinal]
+languages/cardinal/t/array/pop.t [cardinal]
+languages/cardinal/t/array/reverse.t [cardinal]
+languages/cardinal/t/array/shift.t [cardinal]
+languages/cardinal/t/array/slice.t [cardinal]
+languages/cardinal/t/array/sort.t [cardinal]
+languages/cardinal/t/array/to_s.t [cardinal]
+languages/cardinal/t/array/uniq.t [cardinal]
+languages/cardinal/t/array/warray.t [cardinal]
languages/cardinal/t/harness [cardinal]
+languages/cardinal/t/hash/hash.t [cardinal]
+languages/cardinal/t/splat.t [cardinal]
+languages/cardinal/t/string/cmp.t [cardinal]
+languages/cardinal/t/string/concat.t [cardinal]
+languages/cardinal/t/zip.t [cardinal]
+languages/cardinal/test.rb [cardinal]
languages/chitchat/MAINTAINER [chitchat]
languages/chitchat/chitchat.pir [chitchat]
languages/chitchat/config/makefiles/root.in [chitchat]
@@ -1342,7 +1403,6 @@ languages/eclectus/config/makefiles/root.in [eclectus]
languages/eclectus/docs/eclectus.pod [eclectus]
languages/eclectus/driver_nqp.pir [eclectus]
languages/eclectus/gauche/prelude.scm [eclectus]
-languages/eclectus/lib/Parrot/Test/Eclectus.pm [eclectus]
languages/eclectus/riaxpander/LICENCE [eclectus]
languages/eclectus/riaxpander/chicken-sexp.scm [eclectus]
languages/eclectus/riaxpander/chicken.scm [eclectus]
@@ -1634,6 +1694,7 @@ languages/lua/src/lib/gl.lua [lua]
languages/lua/src/lib/gl_binding.pir [lua]
languages/lua/src/lib/glut.pir [lua]
languages/lua/src/lib/lfs.pir [lua]
+languages/lua/src/lib/lpeg.pir [lua]
languages/lua/src/lib/luaaux.pir [lua]
languages/lua/src/lib/luabasic.pir [lua]
languages/lua/src/lib/luabytecode.pir [lua]
@@ -1651,6 +1712,7 @@ languages/lua/src/lib/luastring.pir [lua]
languages/lua/src/lib/luatable.pir [lua]
languages/lua/src/lib/md5.pir [lua]
languages/lua/src/lib/random.pir [lua]
+languages/lua/src/lib/struct.pir [lua]
languages/lua/src/lib/uuid.pir [lua]
languages/lua/src/lua51.pg [lua]
languages/lua/src/lua51.pir [lua]
@@ -1704,6 +1766,7 @@ languages/lua/t/io.t [lua]
languages/lua/t/iterator.t [lua]
languages/lua/t/lexico.t [lua]
languages/lua/t/lfs.t [lua]
+languages/lua/t/lpeg.t [lua]
languages/lua/t/luad.t [lua]
languages/lua/t/math.t [lua]
languages/lua/t/md5.t [lua]
@@ -1776,6 +1839,7 @@ languages/lua/t/shootout/sumcol.lua [lua]
languages/lua/t/standalone.t [lua]
languages/lua/t/string.t [lua]
languages/lua/t/strings.t [lua]
+languages/lua/t/struct.t [lua]
languages/lua/t/table.t [lua]
languages/lua/t/tables.t [lua]
languages/lua/t/test-from-lua.t [lua]
@@ -2239,6 +2303,7 @@ languages/pipp/t/php/superglobals.t [pipp]
languages/pipp/t/php/type.t [pipp]
languages/pipp/t/php/var.t [pipp]
languages/pipp/t/php/variables.t [pipp]
+languages/pipp/t/pmc/array.t [pipp]
languages/pipp/t/pmc/boolean.t [pipp]
languages/punie/MAINTAINER [punie]
languages/punie/README [punie]
@@ -2700,6 +2765,9 @@ lib/Parrot/Configure/Data.pm [devel]
lib/Parrot/Configure/Messages.pm [devel]
lib/Parrot/Configure/Options.pm [devel]
lib/Parrot/Configure/Options/Conf.pm [devel]
+lib/Parrot/Configure/Options/Conf/CLI.pm [devel]
+lib/Parrot/Configure/Options/Conf/File.pm [devel]
+lib/Parrot/Configure/Options/Conf/Shared.pm [devel]
lib/Parrot/Configure/Options/Reconf.pm [devel]
lib/Parrot/Configure/Options/Test.pm [devel]
lib/Parrot/Configure/Options/Test/Prepare.pm [devel]
@@ -2753,9 +2821,11 @@ lib/Parrot/OpTrans/CSwitch.pm [devel]
lib/Parrot/OpTrans/Compiled.pm [devel]
lib/Parrot/Ops2c/Auxiliary.pm [devel]
lib/Parrot/Ops2c/Utils.pm [devel]
+lib/Parrot/Ops2pm.pm [devel]
lib/Parrot/Ops2pm/Auxiliary.pm [devel]
-lib/Parrot/Ops2pm/Utils.pm [devel]
+lib/Parrot/Ops2pm/Base.pm [devel]
lib/Parrot/OpsFile.pm [devel]
+lib/Parrot/OpsRenumber.pm [devel]
lib/Parrot/Pmc2c/Attribute.pm [devel]
lib/Parrot/Pmc2c/ComposedMethod.pm [devel]
lib/Parrot/Pmc2c/Dumper.pm [devel]
@@ -2830,6 +2900,7 @@ parrotbug []
runtime/parrot/dynext/README [devel]doc
runtime/parrot/include/DWIM.pir [devel]doc
runtime/parrot/include/README [devel]doc
+runtime/parrot/include/fp_equality.pasm [library]
runtime/parrot/include/hllmacros.pir [library]
runtime/parrot/include/sockets.pasm [library]
runtime/parrot/include/test_more.pir [library]
@@ -3310,10 +3381,9 @@ t/configure/035-step.t []
t/configure/037-run_single_step.t []
t/configure/038-run_single_step.t []
t/configure/039-run_single_step.t []
-t/configure/040-return_undef.t []
t/configure/041-return_undef.t []
t/configure/042-list_of_steps.t []
-t/configure/043-verbose_step_name.t []
+t/configure/043-verbose_step.t []
t/configure/044-slurp_file.t []
t/configure/045-generated_file_header.t []
t/configure/046-inter.t []
@@ -3322,21 +3392,14 @@ t/configure/048-return_result_undef.t []
t/configure/049-options_test.t []
t/configure/050-fatal.t []
t/configure/051-fatal_step.t []
-t/configure/052-fatal_step.t []
-t/configure/053-fatal_step.t []
-t/configure/054-fatal_step.t []
-t/configure/055-verbose_step.t []
-t/configure/056-verbose_step.t []
t/configure/059-silent.t []
-t/configure/060-silent.t []
t/configure/061-revision_from_cache.t []
t/configure/testlib/Make_VERSION_File.pm []
t/configure/testlib/Tie/Filehandle/Preempt/Stdin.pm []
t/configure/testlib/init/alpha.pm []
t/configure/testlib/init/beta.pm []
t/configure/testlib/init/delta.pm []
t/configure/testlib/init/epsilon.pm []
-t/configure/testlib/init/eta.pm []
t/configure/testlib/init/foobar.pm []
t/configure/testlib/init/gamma.pm []
t/configure/testlib/init/iota.pm []
@@ -3358,7 +3421,7 @@ t/dynpmc/dynlexpad.t []
t/dynpmc/foo.t []
t/dynpmc/gdbmhash.t []
t/dynpmc/rational.t []
-t/dynpmc/sub.t []
+t/dynpmc/subproxy.t []
t/dynpmc/subclass_with_pir_method.t []
t/examples/japh.t []
t/examples/library.t []
@@ -3665,6 +3728,9 @@ t/steps/inter_lex-03.t []
t/steps/inter_libparrot-01.t []
t/steps/inter_make-01.t []
t/steps/inter_progs-01.t []
+t/steps/inter_progs-02.t []
+t/steps/inter_progs-03.t []
+t/steps/inter_progs-04.t []
t/steps/inter_shlibs-01.t []
t/steps/inter_types-01.t []
t/steps/inter_yacc-01.t []
@@ -3690,18 +3756,23 @@ t/tools/ops2cutils/08-nolines.t []
t/tools/ops2cutils/09-dynamic_nolines.t []
t/tools/ops2cutils/10-print_c_source_file.t []
t/tools/ops2cutils/testlib/GenerateCore.pm []
-t/tools/ops2pmutils/00-qualify.t []
-t/tools/ops2pmutils/01-ops2pmutils.t []
-t/tools/ops2pmutils/02-usage.t []
-t/tools/ops2pmutils/03-new.t []
-t/tools/ops2pmutils/04-prepare_ops.t []
-t/tools/ops2pmutils/05-renum_op_map_file.t []
-t/tools/ops2pmutils/06-load_op_map_files.t []
-t/tools/ops2pmutils/07-no_ops_skip.t []
-t/tools/ops2pmutils/08-sort_ops.t []
-t/tools/ops2pmutils/09-prepare_real_ops.t []
-t/tools/ops2pmutils/10-print_module.t []
-t/tools/ops2pmutils/11-print_h.t []
+t/tools/ops2pm/00-qualify.t []
+t/tools/ops2pm/01-ops2pm.t []
+t/tools/ops2pm/02-usage.t []
+t/tools/ops2pm/03-new.t []
+t/tools/ops2pm/04-prepare_ops.t []
+t/tools/ops2pm/05-renum_op_map_file.t []
+t/tools/ops2pm/06-load_op_map_files.t []
+t/tools/ops2pm/07-no_ops_skip.t []
+t/tools/ops2pm/08-sort_ops.t []
+t/tools/ops2pm/09-prepare_real_ops.t []
+t/tools/ops2pm/10-print_module.t []
+t/tools/ops2pm/11-print_h.t []
+t/tools/ops2pm/samples/bit_ops.orig []
+t/tools/ops2pm/samples/bit_ops.second []
+t/tools/ops2pm/samples/core_ops.orig []
+t/tools/ops2pm/samples/ops_num.orig []
+t/tools/ops2pm/samples/pic_ops.orig []
t/tools/parrot_debugger.t []
t/tools/pbc_merge.t []
t/tools/pmc2c.t []
@@ -3748,7 +3819,7 @@ tools/dev/mk_rpm_manifests.pl [devel]
tools/dev/nm.pl [devel]
tools/dev/nopaste.pl [devel]
tools/dev/ops_not_tested.pl [devel]
-tools/dev/ops_renum.mak [devel]
+tools/dev/opsrenumber.pl [devel]
tools/dev/parrot.supp [devel]
tools/dev/parrot_8.supp [devel]
tools/dev/parrot_api.pl [devel]
View
16 MANIFEST.SKIP
@@ -1,6 +1,6 @@
# ex: set ro:
# $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Aug 20 01:57:37 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sat Sep 6 05:05:03 2008 UT
#
# This file should contain a transcript of the svn:ignore properties
# of the directories in the Parrot subversion repository. (Needed for
@@ -192,6 +192,18 @@
^compilers/json/JSON/.*\.pbc/
^compilers/json/JSON/.*\.pir$
^compilers/json/JSON/.*\.pir/
+# generated from svn:ignore of 'compilers/ncigen/'
+^compilers/ncigen/Makefile$
+^compilers/ncigen/Makefile/
+^compilers/ncigen/c99\.pbc$
+^compilers/ncigen/c99\.pbc/
+# generated from svn:ignore of 'compilers/ncigen/src/'
+^compilers/ncigen/src/gen_actions\.pir$
+^compilers/ncigen/src/gen_actions\.pir/
+^compilers/ncigen/src/gen_builtins\.pir$
+^compilers/ncigen/src/gen_builtins\.pir/
+^compilers/ncigen/src/gen_grammar\.pir$
+^compilers/ncigen/src/gen_grammar\.pir/
# generated from svn:ignore of 'compilers/nqp/'
^compilers/nqp/Makefile$
^compilers/nqp/Makefile/
@@ -979,6 +991,8 @@
^languages/perl6/.*\.pbc/
^languages/perl6/Makefile$
^languages/perl6/Makefile/
+^languages/perl6/Test\.pir$
+^languages/perl6/Test\.pir/
^languages/perl6/perl6$
^languages/perl6/perl6/
^languages/perl6/perl6\.c$
View
2 MANIFEST.generated
@@ -62,6 +62,8 @@ installable_disassemble [main]bin
installable_disassemble.exe [main]bin
installable_parrot [main]bin
installable_parrot.exe [main]bin
+installable_parrot_config [main]bin
+installable_parrot_config.exe [main]bin
installable_parrot_debugger [main]bin
installable_parrot_debugger.exe [main]bin
installable_pbc_info [main]bin
View
17 NEWS
@@ -1,5 +1,22 @@
# $Id$
+New in [placeholder 0.7.1]
+
+- Compilers
+ + PIRC:
+ - major refactoring to allow all PIR keywords as identifiers
+ - links to libparrot now, so all Parrot ops are recognized as such
+ - implemented .loadlib, .HLL_map, .HLL
+- Languages
+ + Rakudo (Perl 6)
+ - Precompiled modules
+ - Precompiled scripts
+ - Support for @*INC and %*INC varialbes
+ - additional builtin methods and subs
+ - added 'fail' function
+ - m/.../ regexes
+ - run tests in parallel
+
New in 0.7.0
- Specification
+ PDD27: add multisub lookup
View
1 PLATFORMS
@@ -19,6 +19,7 @@ freebsd-amd64-gcc3.4.6 Y Y*3 ? ? ? Y Y ? 20071008
freebsd-x86-gcc-3.4.6 Y ? ? ? ? Y Y ? 20080519
linux-ppc-gcc3.4.5 Y Y Y ? ? Y Y ? 20080519
linux-ps3-gcc4.1.1 B Y Y Y Y Y Y Y/3 - 20070308
+linux-s390x-gcc4.1.2 B4 ? - - Y Y Y Y/2 ? 20080908
linux-x86-gcc3.3.3.20040412 Y/2 ? ? ? ? Y Y ? 20070116
linux-x86-gcc3.3.5.2005013 Y Y Y Y Y Y Y ? 20060618
linux-x86-gcc3.4.5 Y Y Y ? ? Y Y ? 20071016
View
33 compilers/imcc/cfg.c
@@ -354,7 +354,8 @@ void
build_cfg(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
{
Basic_block *last = NULL;
- int i, changes;
+ unsigned int i;
+ int changes;
IMCC_info(interp, 2, "build_cfg\n");
@@ -394,7 +395,7 @@ build_cfg(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
* s. #25948
*/
if (!bb->pred_list) {
- int j;
+ unsigned int j;
for (j = i; j < unit->n_basic_blocks; j++) {
Basic_block * const b_bsr = unit->bb_list[j];
@@ -456,7 +457,7 @@ build_cfg(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
/* Decouple unreachable blocks (not the first block, with no predecessors)
* from the CFG */
do {
- int i;
+ unsigned int i;
changes = 0;
for (i = 1; i < unit->n_basic_blocks; i++) {
@@ -732,7 +733,7 @@ Analyzes the lifetime for a given symbol.
static void
analyse_life_symbol(ARGIN(const IMC_Unit *unit), ARGMOD(SymReg* r))
{
- int i;
+ unsigned int i;
#if IMC_TRACE_HIGH
fprintf(stderr, "cfg.c: analyse_life_symbol(%s)\n", r->name);
@@ -798,7 +799,7 @@ free_life_info(ARGIN(const IMC_Unit *unit), ARGMOD(SymReg *r))
fprintf(stderr, "free_life_into(%s)\n", r->name);
#endif
if (r->life_info) {
- int i;
+ unsigned int i;
for (i = 0; i < unit->n_basic_blocks; i++) {
mem_sys_free(r->life_info[i]);
@@ -1167,7 +1168,7 @@ static void
free_dominators(ARGMOD(IMC_Unit *unit))
{
if (unit->dominators) {
- int i;
+ unsigned int i;
for (i = 0; i < unit->n_basic_blocks; i++) {
set_free(unit->dominators[i]);
@@ -1194,7 +1195,7 @@ static void
free_dominance_frontiers(ARGMOD(IMC_Unit *unit))
{
if (unit->dominance_frontiers) {
- int i;
+ unsigned int i;
for (i = 0; i < unit->n_basic_blocks; i++) {
set_free(unit->dominance_frontiers[i]);
@@ -1223,7 +1224,8 @@ sort_loops(PARROT_INTERP, ARGIN(IMC_Unit *unit))
Loop_info *li;
Loop_info **loop_info = unit->loop_info;
int n_loops = (int)unit->n_loops;
- int i, j, changed;
+ int i, k, changed;
+ unsigned int j;
for (i = 0; i < n_loops; i++) {
loop_info[i]->size = 0;
@@ -1263,22 +1265,22 @@ sort_loops(PARROT_INTERP, ARGIN(IMC_Unit *unit))
last = j;
}
- for (j = i + 1; j < n_loops; j++) {
+ for (k = i + 1; k < n_loops; k++) {
if (set_contains(loop_info[i]->loop, first)
&& !set_contains(loop_info[i]->loop, last)) {
IMCC_debug(interp, DEBUG_CFG, "sort_loops",
"loop %d contains first but not"
- "last of outer loop %d\n", j, i);
+ "last of outer loop %d\n", k, i);
}
if (set_contains(loop_info[i]->loop, last)
&& !set_contains(loop_info[i]->loop, first)) {
IMCC_debug(interp, DEBUG_CFG, "sort_loops",
"loop %d contains last but not"
- "first of outer loop %d\n", j, i);
+ "first of outer loop %d\n", k, i);
}
- loop_info[j]->depth = loop_info[i]->depth + 1;
+ loop_info[k]->depth = loop_info[i]->depth + 1;
}
}
}
@@ -1298,7 +1300,7 @@ of its dominators.
void
find_loops(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
{
- int i;
+ unsigned int i;
IMCC_info(interp, 2, "find_loops\n");
@@ -1381,7 +1383,8 @@ mark_loop(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGIN(const Edge *e))
Basic_block *footer = e->from;
Basic_block *enter = 0;
- int i, n_loops;
+ unsigned int i;
+ int n_loops;
/* look from where loop was entered */
for (i = 0, edge=header->pred_list; edge; edge=edge->pred_next)
@@ -1540,7 +1543,7 @@ void
clear_basic_blocks(ARGMOD(IMC_Unit *unit))
{
if (unit->bb_list) {
- int i;
+ unsigned int i;
for (i = 0; i < unit->n_basic_blocks; i++)
mem_sys_free(unit->bb_list[i]);
View
17 compilers/imcc/imcc.y
@@ -901,7 +901,14 @@ class_namespace:
;
maybe_ns:
- '[' keylist ']' { $$ = $2; }
+ '[' keylist ']'
+ {
+ if (IMCC_INFO(interp)->in_slice)
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+ "Slice not allowed in namespace.");
+
+ $$ = $2;
+ }
| '[' ']' { $$ = NULL; }
| { $$ = NULL; }
;
@@ -1508,10 +1515,10 @@ assignment:
{ $$ = iNEW(interp, IMCC_INFO(interp)->cur_unit, $1, $4, NULL, 1); }
| target '=' NEW var
{ $$ = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 2, $1, $4); }
- | target '=' NEW '[' keylist ']'
- { $$ = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 2, $1, $5); }
- | target '=' NEW '[' keylist ']' COMMA var
- { $$ = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 3, $1, $5, $8); }
+ | target '=' NEW maybe_ns
+ { $$ = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 2, $1, $4); }
+ | target '=' NEW maybe_ns COMMA var
+ { $$ = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 3, $1, $4, $6); }
| target '=' NEW var COMMA var
{ $$ = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 3, $1, $4, $6); }
| target '=' NEW var '[' keylist ']'
View
1,200 compilers/imcc/imcparser.c
607 additions, 593 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
12 compilers/imcc/main.c
@@ -187,6 +187,8 @@ help(void)
" Options:\n"
" -h --help\n"
" -V --version\n"
+ " -I add path to include search\n"
+ " -L add path to library search\n"
" <Run core options>\n"
" -R --runcore CORE\n"
" -b --bounds-checks|--slow-core\n"
@@ -266,6 +268,8 @@ static struct longopt_opt_decl options[] = {
{ 'D', 'D', OPTION_optional_FLAG, { "--parrot-debug" } },
{ 'E', 'E', (OPTION_flags)0, { "--pre-process-only" } },
{ 'G', 'G', (OPTION_flags)0, { "--no-gc" } },
+ { 'I', 'I', OPTION_required_FLAG, { NULL } },
+ { 'L', 'L', OPTION_required_FLAG, { NULL } },
{ 'O', 'O', OPTION_optional_FLAG, { "--optimize" } },
{ 'R', 'R', OPTION_required_FLAG, { "--runcore" } },
{ 'S', 'S', (OPTION_flags)0, { "--switched-core" } },
@@ -522,6 +526,14 @@ parseflags(PARROT_INTERP, int *argc, char **argv[])
case OPT_DESTROY_FLAG:
SET_FLAG(PARROT_DESTROY_FLAG);
break;
+ case 'I':
+ Parrot_add_library_path(interp, opt.opt_arg,
+ PARROT_LIB_PATH_INCLUDE);
+ break;
+ case 'L':
+ Parrot_add_library_path(interp, opt.opt_arg,
+ PARROT_LIB_PATH_LIBRARY);
+ break;
default:
Parrot_ex_throw_from_c_args(interp, NULL, 1,
"main: Invalid flag '%s' used.\n\nhelp: parrot -h\n",
View
25 compilers/imcc/optimizer.c
@@ -969,14 +969,16 @@ IMCC_subst_constants(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGIN(const char *na
/*
* abs_i_ic ...
*/
- if (n == 3 &&
- r[1]->type & (VTCONST|VT_CONSTP) &&
- STREQ(name, ops2[i])) {
- found = 3;
- snprintf(op, sizeof (op), "%s_%c_%c", name, tolower((unsigned char)r[0]->set),
- tolower((unsigned char)r[1]->set));
- debug_fmt = "opt %s_x_xc => ";
- break;
+ if (n == 3) {
+ PARROT_ASSERT(r[1]);
+ if (r[1]->type & (VTCONST|VT_CONSTP) &&
+ STREQ(name, ops2[i])) {
+ found = 3;
+ snprintf(op, sizeof (op), "%s_%c_%c", name, tolower((unsigned char)r[0]->set),
+ tolower((unsigned char)r[1]->set));
+ debug_fmt = "opt %s_x_xc => ";
+ break;
+ }
}
}
for (i = 0; !found && i < N_ELEMENTS(ops3); i++) {
@@ -1154,7 +1156,7 @@ PARROT_WARN_UNUSED_RESULT
static int
branch_reorg(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
{
- int i;
+ unsigned int i;
int changed = 0;
IMCC_info(interp, 2, "\tbranch_reorg\n");
@@ -1394,7 +1396,8 @@ PARROT_WARN_UNUSED_RESULT
static int
unused_label(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
{
- int i, used;
+ unsigned int i;
+ int used;
int changed = 0;
IMCC_info(interp, 2, "\tunused_label\n");
@@ -1465,7 +1468,7 @@ RT #48260: Not yet documented!!!
static int
dead_code_remove(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
{
- int i;
+ unsigned int i;
int changed = 0;
Instruction *ins, *last;
View
2 compilers/imcc/reg_alloc.c
@@ -835,7 +835,7 @@ static int
interferes(PARROT_INTERP, ARGIN(const IMC_Unit *unit),
ARGIN(const SymReg *r0), ARGIN(const SymReg *r1))
{
- int i;
+ unsigned int i;
/* Registers don't interfere with themselves */
if (r0 == r1)
View
2 compilers/imcc/unit.h
@@ -38,7 +38,7 @@ typedef struct _IMC_Unit {
Instruction *last_ins;
SymHash hash;
int bb_list_size;
- int n_basic_blocks;
+ unsigned int n_basic_blocks;
Basic_block **bb_list;
Set **dominators;
int *idoms;
View
7 compilers/ncigen/MAINTAINER
@@ -0,0 +1,7 @@
+# $Id$
+
+N: Kevin Tew
+E: kevintew@tewk.com
+
+N: Klaas-Jan Stol (kjs)
+E: parrotcode@gmail.com
View
6 compilers/ncigen/NCIGEN.TODO
@@ -0,0 +1,6 @@
+Add option to generate dlfuncs for certain h files not all includes.
+Allow typedefs and structs with the same name in the symbol table.
+Generate ManagedStructs definitions for structs and typedefs.
+Generate parrot_builtin_type entries in the AST such as INT NUM STR o PMC
+Add -I include support to ncigen.pl
+Convert ncigen.pl to ncigen.pir
View
136 compilers/ncigen/c99.pir
@@ -0,0 +1,136 @@
+# $Id$
+# Copyright (C) 2008, The Perl Foundation.
+
+=head1 TITLE
+
+c99.pir - A C99 compiler.
+
+=head2 Description
+
+This is the base file for the C99 compiler.
+
+This file includes the parsing and grammar rules from
+the src/ directory, loads the relevant PGE libraries,
+and registers the compiler under the name 'C99'.
+
+=head2 Functions
+
+=over 4
+
+=item onload()
+
+Creates the C compiler using a C<PCT::HLLCompiler>
+object.
+
+=cut
+
+.namespace [ 'C99::Compiler' ]
+
+.loadlib 'c99_group'
+
+.sub 'onload' :anon :load :init
+ load_bytecode 'PCT.pbc'
+
+ $P0 = get_hll_global ['PCT'], 'HLLCompiler'
+ $P1 = $P0.'new'()
+ $P1.'language'('C99')
+ $P1.'parsegrammar'('C99::Grammar')
+ $P1.'parseactions'('C99::Grammar::Actions')
+.end
+
+=item main(args :slurpy) :main
+
+Start compilation by passing any command line C<args>
+to the C compiler.
+
+=cut
+
+.sub 'main' :main
+ .param pmc args
+
+ $P0 = compreg 'C99'
+ $P1 = split ' ', 'parse nci_ast gen_nci_pir'
+ setattribute $P0, '@stages', $P1
+ $P1 = split ' ', 'e=s help|h target=s trace|t=s encoding=s output|o=s combine version|v libname|l=s nsname|n=s raw|r'
+ setattribute $P0, '@cmdoptions', $P1
+
+ ## set the $usage attribute
+ $P2 = new 'String'
+ $P2 = <<'USAGE'
+Usage: ncigen [switches] [--] [preprocessedfile] [arguments]
+ -l, --libname library to load symbols from
+ -n --nsname pir namepsace to place symbols into
+ -r --raw dump dlfunc pir statements only
+
+Standard HLLCompiler Options:
+ -e program one line of program
+ -h, --help display this help text
+ --target=[stage] specify compilation stage to emit
+ -t, --trace=[flags] enable trace flags
+ --encoding=[mode] specify string encoding mode
+ -o, --output=[name] specify name of output file
+ -v, --version display version information
+USAGE
+ setattribute $P0, '$usage', $P2
+
+ $P2 = $P0.'command_line'(args)
+.end
+
+.namespace [ 'PCT::HLLCompiler' ]
+
+.sub 'nci_ast' :method
+ .param pmc source
+ .param pmc adverbs :slurpy :named
+
+ compile_match:
+ push_eh err_past
+ .local pmc ast
+ ast = source.'item'()
+ pop_eh
+ $I0 = isa ast, 'c99AST::Decls'
+ unless $I0 goto err_past
+ .return (ast)
+
+ err_past:
+ $S0 = typeof source
+ .return self.'panic'('Unable to obtain c99AST from ', $S0)
+.end
+
+.sub 'gen_nci_pir' :method
+ .param pmc source
+ .param pmc adverbs :slurpy :named
+
+ $P0 = compreg 'NCIPIR'
+ $P1 = $P0.'to_pir'(source, adverbs :flat :named)
+ say $P1
+ .return ($P1)
+.end
+
+
+.include 'src/c99AST.pir'
+.include 'src/NCIPIR.pir'
+.include 'src/gen_builtins.pir'
+.include 'src/gen_grammar.pir'
+.include 'src/gen_actions.pir'
+
+
+.namespace [ 'C99::Grammar' ]
+
+.sub 'debug'
+ .param pmc match
+ .param pmc arg
+ .param pmc attrs :slurpy
+ printerr arg
+ printerr "\n"
+.end
+
+=back
+
+=cut
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+
View
121 compilers/ncigen/config/makefiles/ncigen.in
@@ -0,0 +1,121 @@
+## $Id$
+
+## arguments we want to run parrot with
+PARROT_ARGS =
+
+## configuration settings
+BUILD_DIR = @build_dir@
+LOAD_EXT = @load_ext@
+O = @o@
+
+## Setup some commands
+LN_S = @lns@
+PERL = @perl@
+RM_RF = @rm_rf@
+CP = @cp@
+PARROT = ../../parrot@exe@
+CAT = $(PERL) -MExtUtils::Command -e cat
+BUILD_DYNPMC = $(PERL) $(BUILD_DIR)/tools/build/dynpmc.pl
+RECONFIGURE = $(PERL) $(BUILD_DIR)/tools/dev/reconfigure.pl
+
+## places to look for things
+PARROT_DYNEXT = $(BUILD_DIR)/runtime/parrot/dynext
+PGE_LIBRARY = $(BUILD_DIR)/runtime/parrot/library/PGE
+PERL6GRAMMAR = $(PGE_LIBRARY)/Perl6Grammar.pbc
+NQP = $(BUILD_DIR)/compilers/nqp/nqp.pbc
+PCT = $(BUILD_DIR)/runtime/parrot/library/PCT.pbc
+
+PMC_DIR = src/pmc
+
+all: c99.pbc
+
+C_GROUP = $(PMC_DIR)/c_group$(LOAD_EXT)
+
+SOURCES = c99.pir \
+ src/gen_grammar.pir \
+ src/gen_actions.pir \
+ src/gen_builtins.pir \
+ src/c99AST.pir \
+ src/NCIPIR.pir \
+# $(C_GROUP)
+
+BUILTINS_PIR = \
+ src/builtins/say.pir \
+
+# PMCS = c
+# PMC_SOURCES = $(PMC_DIR)/c.pmc
+
+# the default target
+c99.pbc: $(PARROT) $(SOURCES)
+ $(PARROT) $(PARROT_ARGS) -o c99.pbc c99.pir
+
+src/gen_grammar.pir: $(PERL6GRAMMAR) src/parser/grammar.pg
+ $(PARROT) $(PARROT_ARGS) $(PERL6GRAMMAR) \
+ --output=src/gen_grammar.pir \
+ src/parser/grammar.pg
+
+src/gen_actions.pir: $(NQP) $(PCT) src/parser/actions.pm
+ $(PARROT) $(PARROT_ARGS) $(NQP) --output=src/gen_actions.pir \
+ --target=pir src/parser/actions.pm
+
+src/gen_builtins.pir: $(BUILTINS_PIR)
+ $(CAT) $(BUILTINS_PIR) >src/gen_builtins.pir
+
+$(C_GROUP): $(PARROT) $(PMC_SOURCES)
+ cd $(PMC_DIR) && $(BUILD_DYNPMC) generate $(PMCS)
+ cd $(PMC_DIR) && $(BUILD_DYNPMC) compile $(PMCS)
+ cd $(PMC_DIR) && $(BUILD_DYNPMC) linklibs $(PMCS)
+ cd $(PMC_DIR) && $(BUILD_DYNPMC) copy --destination=$(PARROT_DYNEXT) $(PMCS)
+
+# This is a listing of all targets, that are meant to be called by users
+help:
+ @echo ""
+ @echo "Following targets are available for the user:"
+ @echo ""
+ @echo " all: c.pbc"
+ @echo " This is the default."
+ @echo "Testing:"
+ @echo " test: Run the test suite."
+ @echo " testclean: Clean up test results."
+ @echo ""
+ @echo "Cleaning:"
+ @echo " clean: Basic cleaning up."
+ @echo " realclean: Removes also files generated by 'Configure.pl'"
+ @echo " distclean: Removes also anything built, in theory"
+ @echo ""
+ @echo "Misc:"
+ @echo " help: Print this help message."
+ @echo ""
+
+test: all
+ $(PERL) t/harness
+
+# this target has nothing to do
+testclean:
+
+CLEANUPS = \
+ c99.pbc \
+ src/gen_grammar.pir \
+ src/gen_actions.pir \
+ src/gen_builtins.pir \
+ $(PMC_DIR)/*.h \
+ $(PMC_DIR)/*.c \
+ $(PMC_DIR)/*.dump \
+ $(PMC_DIR)/*$(O) \
+ $(PMC_DIR)/*$(LOAD_EXT) \
+ $(PMC_DIR)/*.exp \
+ $(PMC_DIR)/*.ilk \
+ $(PMC_DIR)/*.manifest \
+ $(PMC_DIR)/*.pdb \
+ $(PMC_DIR)/*.lib \
+
+
+clean:
+ $(RM_RF) $(CLEANUPS)
+
+realclean: clean
+ $(RM_RF) Makefile
+
+distclean: realclean
+
+
View
167 compilers/ncigen/lib/Parrot/Test/C99AST.pm
@@ -0,0 +1,167 @@
+# $Id$
+# Copyright (C) 2006-2008, The Perl Foundation.
+
+package Parrot::Test::C99AST;
+
+
+use strict;
+use warnings;
+
+use Cwd;
+use File::Spec;
+use File::Basename;
+use Parrot::Test;
+use Data::Dumper;
+
+use Parrot::Config;
+
+require Exporter;
+require Test::Builder;
+require Test::More;
+
+our @EXPORT = qw( ast parse plan skip like istypedef ispointer decl_ident_is type_is is_builtin parse_failure parse_success contains);
+our @EXPORT_OK = qw();
+
+use base qw( Exporter );
+
+# Memoize functions with a fixed output
+# Memoize::memoize('path_to_parrot');
+#
+# # Tell parrot it's being tested--disables searching of installed libraries.
+# # (see Parrot_get_runtime_prefix in src/library.c).
+# $ENV{PARROT_TEST} = 1 unless defined $ENV{PARROT_TEST};
+#
+my $builder = Test::Builder->new();
+
+our $ME = new();
+$ME->{builder} = $builder;
+$ME->{path_to_parrot} = Parrot::Test::path_to_parrot();
+$ME->{parrot} = File::Spec->join( $ME->{path_to_parrot}, 'parrot' . $PConfig{exe} );
+our $results;
+
+
+sub import {
+ my ( $class, $plan, @args ) = @_;
+
+ $builder->plan( $plan, @args );
+
+ __PACKAGE__->export_to_level( 1, __PACKAGE__ );
+}
+
+*plan = \&Test::More::plan;
+*skip = \&Test::More::skip;
+
+=head1 Parrot::Test::C99
+
+Provide language specific testing routines here...
+
+This is currently alarmingly similar to the generated subs in Parrot::Test.
+Perhaps someone can do a better job of delegation here.
+
+=cut
+
+sub new {
+ return bless {};
+}
+
+sub ast {
+ my ( $code ) = @_;
+ $results = $ME->ncigenit($code, '--target=nci_ast');
+}
+
+sub parse {
+ my ( $code ) = @_;
+ $results = $ME->ncigenit($code, '--target=parse');
+}
+
+sub like {
+ return $ME->testit('like', @$results, @_);
+}
+
+sub istypedef {
+ return like( qr/c99AST::TypeDef/, @_);
+}
+sub ispointer {
+ return like( qr/<pointer> => 1/, @_);
+}
+
+sub decl_ident_is {
+ my $id = shift @_;
+ return like( qr/<name> => \"$id/, @_);
+}
+sub type_is {
+ my $id = shift @_;
+ return like( qr/<type> => \"$id/, @_);
+}
+sub is_builtin{
+ return like( qr/<builtin_type> => 1/, @_);
+}
+
+sub contains {
+ my $it = shift @_;
+ return like( qr/$it/, @_);
+}
+
+sub parse_failure {
+ $ME->{builder}->ok( $results->[3] == 1, @_ );
+}
+
+sub parse_success {
+ my $code = shift @_;
+ $results = $ME->ncigenit($code, '--target=parse');
+ $ME->{builder}->ok( $results->[3] == 0, @_ );
+}
+
+sub ncigenit {
+ my ( $self, $code, $c99args ) = @_;
+
+ my $count = $self->{builder}->current_test + 1;
+ my $parrotdir = dirname $self->{parrot};
+
+ my @fns = map { File::Spec->rel2abs( Parrot::Test::per_test( $_, $count ) ) } ( '.c', '.out' );
+ my ( $lang_f, $out_f ) = @fns;
+
+ Parrot::Test::write_code_to_file( $code, $lang_f );
+
+ my $args = $ENV{TEST_PROG_ARGS} || '';
+
+ my $cmd = "$self->{parrot} $args $parrotdir/compilers/ncigen/c99.pbc $c99args $lang_f";
+ my $exit_code = Parrot::Test::run_command(
+ $cmd,
+ CD => $self->{relpath},
+ STDOUT => $out_f,
+ STDERR => $out_f
+ );
+ my $output = Parrot::Test::slurp_file($out_f);
+
+ unless ( $ENV{POSTMORTEM} ) {
+ unlink $lang_f;
+ unlink $out_f;
+ }
+
+ my @results = ($code, $cmd, $output, $exit_code, $count);
+ wantarray ? return @results : return [ @results ];
+}
+
+sub testit {
+ my ( $self, $method, $code, $cmd, $output, $exit_code, $count, $expected, $desc ) = @_;
+ #print "$cmd, $exit_code, $count, $expected, $desc \n";
+
+ $desc = "C99AST Test $count" unless $desc;
+ my $pass = $self->{builder}->$method( $output, $expected, $desc );
+ if ($exit_code or not $pass) {
+ $self->{builder}->diag("'$cmd' failed with exit code $exit_code") if $exit_code or not $pass;
+ $self->{builder}->diag("CODE:\n$code"."CODE");
+ }
+
+ return $pass;
+}
+
+1;
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
View
103 compilers/ncigen/nci_gen.pl
@@ -0,0 +1,103 @@
+#! perl
+# Copyright (C) 2008, The Perl Foundation.
+# $Id$
+
+use strict;
+use warnings;
+
+use Getopt::Long;
+use Pod::Usage;
+use File::Temp;
+use File::Spec;
+use IPC::Run3;
+
+my $man = 0;
+my $help = 0;
+my $PARROT = "../../parrot";
+my ($incpaths,$libname,$nsname);
+
+GetOptions('help|?' => \$help,
+ man => \$man,
+ libname => \$libname,
+ nsname => \$nsname,
+ "I=s@" => \$incpaths) or pod2usage(2);
+pod2usage(1) if $help;
+pod2usage(-exitstatus => 0, -verbose => 2) if $man;
+
+#sub usage()
+
+sub cc_preprocess {
+ my ($file) = @_;
+ my ($volume, $directories, $fileonly) = File::Spec->splitpath( $file );
+ print "$fileonly\n";
+
+ my $ofile = mktemp( $fileonly . "_XXXX");
+ #execit("gcc -x c -fdirectives-only -E $file > $ofile");
+ execit("gcc -x c -E $file > $ofile");
+ return $ofile;
+}
+
+sub dump_parse_tree {
+ my ( $file, $more_args ) = @_;
+ return execit("make; $PARROT c99.pbc $more_args $file");
+}
+
+sub execit {
+ my ($cmd) = @_;
+ print "$cmd\n";
+ my $output = `$cmd`;
+ return $output;
+}
+
+sub main {
+ my $more_args = "";
+ $ARGV[0] = 't/spi.c' unless $ARGV[0];
+ $libname = "libexamplelib" unless $libname;
+ $nsname = "CLIB::examplelib" unless $nsname;
+
+ #$more_args = "--target=parse --libname=fred --nsname=GO::Mojo";
+ $more_args = "--libname=$libname --nsname=$nsname";
+ my $preproc_fn = cc_preprocess($ARGV[0]);
+
+ my $parse_tree = dump_parse_tree($preproc_fn, $more_args);
+ unlink($preproc_fn);
+ print $parse_tree;
+ print "$preproc_fn\n";
+}
+
+main();
+
+__END__
+
+=head1 NAME
+
+sample - Using nci_gen.pl
+
+=head1 SYNOPSIS
+
+nci_gen [options] [file ...]
+
+Options:
+-help brief help message
+-man full documentation
+
+=head1 OPTIONS
+
+=over 8
+
+=item B<-help>
+
+Print a brief help message and exits.
+
+=item B<-man>
+
+Prints the manual page and exits.
+
+=back
+
+=head1 DESCRIPTION
+
+B<nci_gen> will read the given input file c header file and create a pir interface file.
+
+=cut
+
View
336 compilers/ncigen/src/NCIPIR.pir
@@ -0,0 +1,336 @@
+=head1 NAME
+
+NCIPIR::Compiler - NCI PIR Compiler for c99AST trees.
+
+=head1 DESCRIPTION
+
+NCIPIR::Compiler defines a compiler that converts a c99AST tree into PIR
+
+=head1 METHODS
+
+=over
+
+=cut
+
+.namespace [ 'NCIPIR::Compiler' ]
+
+.sub '__onload' :load :init
+ .local pmc p6meta, cproto
+ p6meta = new 'P6metaclass'
+ cproto = p6meta.'new_class'('NCIPIR::Compiler', 'parent'=>'PCT::HLLCompiler', 'attr'=>'$!code')
+ cproto.'language'('NCIPIR')
+ $P1 = split ' ', 'pir evalpmc'
+ cproto.'stages'($P1)
+
+ $P0 = new 'String'
+ set_global '$?NAMESPACE', $P0
+ .return ()
+.end
+
+
+.sub 'to_pir' :method
+ .param pmc ast
+ .param pmc adverbs :slurpy :named
+
+ .local pmc newself
+ newself = new 'NCIPIR::Compiler'
+
+ ## start with empty code
+ .local pmc code
+ code = new 'CodeString'
+ newself.'code'(code)
+
+ ## if the root node isn't a Sub, wrap it
+ $I0 = isa ast, 'c99AST::Decls'
+ if $I0 goto have_sub
+ $P0 = get_hll_global ['c99AST'], 'Decls'
+ ast = $P0.'new'(ast, 'name'=>'anon')
+ have_sub:
+
+ .local string raw
+
+ raw = adverbs['raw']
+ if raw goto Lgenpir
+ $P0 = newself.'gen_preamble'(adverbs :flat :named)
+ Lgenpir:
+ ## now generate the pir
+ newself.'pir'(ast)
+
+ ## and return whatever code was generated
+ .return newself.'code'()
+.end
+
+.sub 'gen_preamble' :method
+ .param pmc adverbs :slurpy :named
+ .local string nsname
+ .local string libname
+ .local string fmt
+
+ nsname = adverbs['nsname']
+ libname = adverbs['libname']
+
+fmt = <<'FMT'
+.namespace ['%n']
+.sub __load_lib_dlfunc_init__ :anon :init :load
+FMT
+
+ .local pmc code
+ code = new 'CodeString'
+ code.'emit'(fmt, 'n'=>nsname)
+ if null libname goto LNOLIBNAME
+fmt = <<'FMT'
+loadlib $P1, '%l'
+if $P1 goto has_lib
+FMT
+ goto LEMITLIBNAME
+ LNOLIBNAME:
+fmt = <<'FMT'
+$P1 = null
+goto has_lib
+FMT
+ LEMITLIBNAME:
+ code.'emit'(fmt, 'l'=>libname)
+
+
+fmt = <<'FMT'
+$P2 = new 'Exception'
+$P2[0] = 'error loading %l - loadlib failed'
+throw $P2
+has_lib:
+FMT
+ code.'emit'(fmt, 'l'=>libname)
+ $P0 = self.'code'()
+ $P0 .= code
+ .return(code)
+.end
+
+
+=item code([str])
+
+Get/set the code generated by this compiler.
+
+=cut
+
+.sub 'code' :method
+ .param pmc code :optional
+ .param int has_code :opt_flag
+
+ if has_code goto set_code
+ code = getattribute self, '$!code'
+ .return (code)
+ set_code:
+ setattribute self, '$!code', code
+ .return (code)
+.end
+
+
+=item pir_children(node)
+
+Return generated PIR for C<node> and all of its children.
+
+=cut
+
+.sub 'pir_children' :method
+ .param pmc node
+ .local pmc code, iter
+ code = new 'CodeString'
+ iter = new 'Iterator', node
+ iter_loop:
+ unless iter goto iter_end
+ .local string key
+ .local pmc cast
+ key = shift iter
+ cast = node[key]
+ $P0 = self.'pir'(cast)
+ code .= $P0
+ goto iter_loop
+ iter_end:
+ .return (code)
+.end
+
+
+=item pir(Any node)
+
+Return generated pir for any POST::Node. Returns
+the generated pir of C<node>'s children.
+
+=cut
+
+.sub 'pir' :method :multi(_,_)
+ .param pmc node
+ .local string code
+ code = self.'pir_children'(node)
+ $P0 = self.'code'()
+ $P0 .= code
+ .return ($P0)
+.end
+
+
+=item pir(POST::Op node)
+
+Return pir for an operation node.
+
+=cut
+
+.sub 'pir' :method :multi(_,['c99AST::FuncDecl'])
+ .param pmc node
+
+ ## get list of arguments to operation
+ .local pmc arglist
+ arglist = node.'list'()
+
+ .local string fmt, name, type
+ type = param_to_code(node, 1)
+
+ .local pmc itera
+ .local pmc param
+ iter itera, arglist
+ LIS:
+ unless itera, LI0
+ param = shift itera
+ $S0 = param_to_code(param)
+ #say $S0
+ type .= $S0
+ goto LIS
+
+ LI0:
+ name = node.'name'()
+ fmt = "dlfunc $P2, $P1, '%n', '%s'\nstore_global '%n', $P2"
+
+ #$S0 = "##"
+ #$S1 = node.'attr'('source', '', 0)
+ #$S0 .= $S1
+ #print $S0
+
+ .local pmc code
+ code = new 'CodeString'
+ code.'emit'(fmt, 's'=>type, 'n'=>name)
+ #$S0 = code
+ #say $S0
+
+ .return (code)
+.end
+
+.sub 'param_to_code'
+ .param pmc node
+ .param int returncode :optional
+ $I0 = node.'pointer'()
+ $S0 = node.'primitive_type'()
+
+ if $I0, LPOINTER
+
+ iseq $I1, $S0, 'void'
+ unless $I1, LL2
+ if returncode, LL11
+ .return("")
+ LL11:
+ .return("v")
+ LL2:
+ iseq $I1, $S0, 'int'
+ unless $I1, LL3
+ .return("i")
+ LL3:
+ iseq $I1, $S0, 'long'
+ unless $I1, LL4
+ .return("l")
+ LL4:
+ iseq $I1, $S0, 'char'
+ unless $I1, LL5
+ .return("c")
+ LL5:
+ iseq $I1, $S0, 'short'
+ unless $I1, LL6
+ .return("s")
+ LL6:
+ .return("p")
+
+ LPOINTER:
+ iseq $I1, $S0, 'char'
+ unless $I1, LL7
+ $I0 = node.'pointer_cnt'()
+ iseq $I1, $I0, 1
+ unless $I1, LL7
+ .return("t")
+ LL7:
+ .return("p")
+.end
+
+=item pir(POST::Label node)
+
+Generate a label.
+
+=cut
+
+.sub 'pir' :method :multi(_, ['c99AST::TypeDef'])
+ .param pmc node
+ .return ('')
+ .return pir_dump(node)
+.end
+
+=item pir(POST::Label node)
+
+Generate a label.
+
+=cut
+
+.sub 'pir' :method :multi(_, ['c99AST::VarDecl'])
+ .param pmc node
+ .return ('')
+ .return pir_dump(node)
+.end
+
+=item pir(POST::Label node)
+
+Generate a label.
+
+=cut
+
+.sub 'pir_dump'
+ .param pmc node
+ .local string code
+ code = '#'
+ code .= 'typedef '
+ $S0 = node.'type'()
+ code .= $S0
+ code .= ' '
+ $S0 = node.'name'()
+ code .= $S0
+ $S0 = node.'builtin_type'()
+ unless $S0 goto LN1
+ code .= ' builtin '
+ code .= $S0
+ LN1:
+ $S0 = node.'pointer'()
+ unless $S0 goto LN2
+ code .= ' pointer '
+ code .= $S0
+ LN2:
+ code .= ":\n"
+ print code
+ .return ('')
+.end
+
+
+=back
+
+=head1 AUTHOR
+
+Patrick Michaud <pmichaud@pobox.com> is the author and maintainer.
+Please send patches and suggestions to the Parrot porters or
+Perl 6 compilers mailing lists.
+
+=head1 HISTORY
+
+2007-11-21 Significant refactor as part of Parrot Compiler Toolkit
+
+=head1 COPYRIGHT
+
+Copyright (C) 2006-2008, The Perl Foundation.
+
+=cut
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
View
82 compilers/ncigen/src/builtins/say.pir
@@ -0,0 +1,82 @@
+# $Id$
+
+=head1
+
+say.pir -- simple implementation of a say function
+
+=cut
+
+.namespace []
+
+.sub 'say'
+ .param pmc args :slurpy
+ .local pmc iter
+ iter = new 'Iterator', args
+ iter_loop:
+ unless iter goto iter_end
+ $P0 = shift iter
+ print $P0
+ goto iter_loop
+ iter_end:
+ print "\n"
+ .return ()
+.end
+
+.sub 'printf'
+ .param pmc format
+ .param pmc args :slurpy
+ .local pmc iter
+ iter = new 'Iterator', args
+ iter_loop:
+ unless iter goto iter_end
+ goto iter_loop
+ iter_end:
+.end
+
+.sub 'puts'
+ <