Author: bernhard
Date: Wed Apr 25 10:50:24 2007
New Revision: 18333

Added:
   trunk/languages/plumhead/lib/Parrot/Test/Plumhead/Yacc.pm
      - copied, changed from r18331, 
/trunk/languages/plumhead/lib/Parrot/Test/Plumhead/Perl5re.pm
   trunk/languages/plumhead/src/yacc/
Modified:
   trunk/MANIFEST
   trunk/MANIFEST.SKIP
   trunk/languages/plumhead/TODO
   trunk/languages/plumhead/config/makefiles/root.in
   trunk/languages/plumhead/docs/overview.pod
   trunk/languages/plumhead/lib/Parrot/Test/Plumhead.pm
   trunk/languages/plumhead/plumhead.pl
   trunk/languages/plumhead/src/common/plumhead.pir
   trunk/languages/plumhead/t/harness

Log:
[Plumhead]
Add stubs for planned 'Plumhead yacc'


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Wed Apr 25 10:50:24 2007
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Tue Apr 24 21:11:44 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Wed Apr 25 17:46:50 2007 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -1767,6 +1767,7 @@
 languages/plumhead/lib/Parrot/Test/Plumhead/Partridge.pm    [plumhead]
 languages/plumhead/lib/Parrot/Test/Plumhead/Perl5re.pm      [plumhead]
 languages/plumhead/lib/Parrot/Test/Plumhead/Phc.pm          [plumhead]
+languages/plumhead/lib/Parrot/Test/Plumhead/Yacc.pm         [plumhead]
 languages/plumhead/past_xml.xsd                             [plumhead]
 languages/plumhead/plumhead.pl                              [plumhead]
 languages/plumhead/src/antlr3/GenPastPir.g                  [plumhead]

Modified: trunk/MANIFEST.SKIP
==============================================================================
--- trunk/MANIFEST.SKIP (original)
+++ trunk/MANIFEST.SKIP Wed Apr 25 10:50:24 2007
@@ -1,6 +1,6 @@
 # ex: set ro:
 # $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Tue Apr 24 21:11:44 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Wed Apr 25 17:46:50 2007 UT
 #
 # This file should contain a transcript of the svn:ignore properties
 # of the directories in the Parrot subversion repository. (Needed for

Modified: trunk/languages/plumhead/TODO
==============================================================================
--- trunk/languages/plumhead/TODO       (original)
+++ trunk/languages/plumhead/TODO       Wed Apr 25 10:50:24 2007
@@ -10,4 +10,5 @@
 - Implement var_dump()
 - Subclass OrderedHash for PlumheadArray
 - Add another variant 'perl5regex', using Perl 5.10 (ir)regular expressions
+- Add another variant 'yacc'
 - distinguish between subs and keywords

Modified: trunk/languages/plumhead/config/makefiles/root.in
==============================================================================
--- trunk/languages/plumhead/config/makefiles/root.in   (original)
+++ trunk/languages/plumhead/config/makefiles/root.in   Wed Apr 25 10:50:24 2007
@@ -28,6 +28,7 @@
        @echo "                     Current this has nothing to do."
        @echo "  build-antlr3       Build support for variant 'Plumhead 
antlr3'."
        @echo "                     Needs javac and a proper CLASSPATH."
+       @echo "  build-yacc         Build support for variant 'Plumhead yacc'."
        @echo "  build-perl5re      Build support for variant 'Plumhead 
perl5re'."
        @echo "                     Currently nothing to do. Perl 5.9.x needed."
        @echo ""
@@ -38,6 +39,7 @@
        @echo "  test-phc:          Run the test suite for 'Plumhead phc'."
        @echo "  test-antlr3:       Run the test suite for 'Plumhead antlr3'."
        @echo "  test-partridge:    Run the test suite for 'Plumhead 
partridge'."
+       @echo "  test-yacc:         Run the test suite for 'Plumhead yacc'."
        @echo "  test-perl5re:      Run the test suite for 'Plumhead perl5re'."
        @echo ""
        @echo "Cleaning:"
@@ -64,7 +66,7 @@
 
 build:           build-partridge
 
-build-all:       build-partridge build-phc build-antlr3 build-perl5re
+build-all:       build-partridge build-phc build-antlr3 build-yacc 
build-perl5re
 
 build-common:    src/common/plumheadlib.pbc plumhead.pbc
 
@@ -72,6 +74,8 @@
 
 build-phc:       build-common
 
+build-yacc:      build-common
+
 build-perl5re:   build-common
 
 build-antlr3:    build-common
@@ -106,6 +110,9 @@
 test-partridge:
        - cd .. && $(PERL) -I../lib -I plumhead/lib plumhead/t/harness 
--with-partridge
 
+test-yacc:
+       - cd .. && $(PERL) -I../lib -I plumhead/lib plumhead/t/harness 
--with-yacc
+
 test-perl5re:
        - cd .. && $(PERL) -I../lib -I plumhead/lib plumhead/t/harness 
--with-perl5re
 

Modified: trunk/languages/plumhead/docs/overview.pod
==============================================================================
--- trunk/languages/plumhead/docs/overview.pod  (original)
+++ trunk/languages/plumhead/docs/overview.pod  Wed Apr 25 10:50:24 2007
@@ -24,6 +24,8 @@
 
 =item partridge - Parrot compiler toolchain, started
 
+=item yacc      - with lex and yacc, planned
+
 =item perl5re   - Perl5.10 regexes, planned
 
 =back
@@ -42,7 +44,11 @@
 
 =item antlr3
 
-java.
+ANTLR3 generating Java code.
+
+=item yacc
+
+lex and yacc, or flex and bison
 
 =item perl5re
 

Modified: trunk/languages/plumhead/lib/Parrot/Test/Plumhead.pm
==============================================================================
--- trunk/languages/plumhead/lib/Parrot/Test/Plumhead.pm        (original)
+++ trunk/languages/plumhead/lib/Parrot/Test/Plumhead.pm        Wed Apr 25 
10:50:24 2007
@@ -14,6 +14,7 @@
 use Parrot::Test::Plumhead::Phc;
 use Parrot::Test::Plumhead::Antlr3;
 use Parrot::Test::Plumhead::Partridge;
+use Parrot::Test::Plumhead::Yacc;
 use Parrot::Test::Plumhead::Perl5re;
 
 =head1 NAME

Copied: trunk/languages/plumhead/lib/Parrot/Test/Plumhead/Yacc.pm (from r18331, 
/trunk/languages/plumhead/lib/Parrot/Test/Plumhead/Perl5re.pm)
==============================================================================
--- /trunk/languages/plumhead/lib/Parrot/Test/Plumhead/Perl5re.pm       
(original)
+++ trunk/languages/plumhead/lib/Parrot/Test/Plumhead/Yacc.pm   Wed Apr 25 
10:50:24 2007
@@ -1,6 +1,6 @@
 # $Id$
 
-package Parrot::Test::Plumhead::Perl5re;
+package Parrot::Test::Plumhead::Yacc;
 
 # pragmata
 use strict;
@@ -12,7 +12,7 @@
     my $self = shift;
     my ( $count, $options ) = @_;
 
-    return Parrot::Test::per_test( '_perl5re.out', $count );
+    return Parrot::Test::per_test( '_yacc.out', $count );
 }
 
 # Use PHP on the command line
@@ -22,7 +22,7 @@
 
     my $lang_fn = Parrot::Test::per_test( '.php', $count );
 
-    return "./parrot languages/plumhead/plumhead.pbc --variant=perl5re 
languages/${lang_fn}";
+    return "./parrot languages/plumhead/plumhead.pbc --variant=yacc 
languages/${lang_fn}";
 }
 
 # never skip the reference implementation

Modified: trunk/languages/plumhead/plumhead.pl
==============================================================================
--- trunk/languages/plumhead/plumhead.pl        (original)
+++ trunk/languages/plumhead/plumhead.pl        Wed Apr 25 10:50:24 2007
@@ -7,7 +7,7 @@
 use strict;
 use warnings;
 
-# possible values are qw( phc antlr3 partridge perl5re );
+# possible values are qw( phc antlr3 partridge yacc perl5re );
 my $variant = $ENV{PLUMHEAD_VARIANT} || 'partridge';
 exec './parrot', 'languages/plumhead/plumhead.pbc', "--variant=$variant", 
@ARGV;
 

Modified: trunk/languages/plumhead/src/common/plumhead.pir
==============================================================================
--- trunk/languages/plumhead/src/common/plumhead.pir    (original)
+++ trunk/languages/plumhead/src/common/plumhead.pir    Wed Apr 25 10:50:24 2007
@@ -29,6 +29,10 @@
 
 Parse PHP with Java based parser and tree parser, generated from ANTLR3 
grammars.
 
+=head2 Plumhead yacc
+
+Parse PHP with lex and yacc.
+
 =head2 Plumhead perl5re
 
 Parse PHP with Perl 5 regexes.
@@ -97,6 +101,7 @@
     if variant == 'antlr3'    goto VARIANT_ANTLR3
     if variant == 'partridge' goto VARIANT_PARTRIDGE
     if variant == 'phc'       goto VARIANT_PHC
+    if variant == 'yacc'      goto VARIANT_YACC
     if variant == 'perl5re'   goto VARIANT_PERL5RE
 
 VARIANT_PARTRIDGE:
@@ -145,6 +150,16 @@
     if ret goto ERROR
     goto EXECUTE_PAST_PIR
 
+VARIANT_YACC:
+    err_msg = 'Creating PAST with lex and yacc'
+    # Do it with YACC
+    cmd = 'perl5.9.5 languages/plumhead/src/perl5re/gen_past_pir.pl '
+    concat cmd, php_source_fn
+    concat cmd, '> plumhead_past.pir'
+    ret = spawnw cmd
+    if ret goto ERROR
+    goto EXECUTE_PAST_PIR
+
 VARIANT_PERL5RE:
     err_msg = 'Creating PAST with Perl 5 regexes failed'
     # TODO: this is not portable

Modified: trunk/languages/plumhead/t/harness
==============================================================================
--- trunk/languages/plumhead/t/harness  (original)
+++ trunk/languages/plumhead/t/harness  Wed Apr 25 10:50:24 2007
@@ -18,6 +18,8 @@
 
   cd languages && perl -I../lib plumhead/t/harness --with-partridge
 
+  cd languages && perl -I../lib plumhead/t/harness --with-yacc
+
   cd languages && perl -I../lib plumhead/t/harness --with-perl5re
 
   cd languages && perl -I../lib plumhead/t/harness \
@@ -68,6 +70,9 @@
     my $with_partridge = ( grep { m/^--with-partridge$/ } @ARGV ) ? 1 : 0;
     @ARGV = grep { ! m/^--with-partridge$/ } @ARGV;
 
+    my $with_yacc = ( grep { m/^--with-yacc$/ } @ARGV ) ? 1 : 0;
+    @ARGV = grep { ! m/^--with-yacc$/ } @ARGV;
+
     my $with_perl5re = ( grep { m/^--with-perl5re$/ } @ARGV ) ? 1 : 0;
     @ARGV = grep { ! m/^--with-perl5re$/ } @ARGV;
 
@@ -100,6 +105,9 @@
     elsif ( $with_partridge ) {
        $ENV{PARROT_PLUMHEAD_TEST_MODULE} = 'Parrot::Test::Plumhead::Partridge';
     }
+    elsif ( $with_yacc ) {
+       $ENV{PARROT_PLUMHEAD_TEST_MODULE} = 'Parrot::Test::Plumhead::Yacc';
+    }
     elsif ( $with_perl5re ) {
        $ENV{PARROT_PLUMHEAD_TEST_MODULE} = 'Parrot::Test::Plumhead::Perl5re';
     }

Reply via email to