develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r34970 - in branches/pct_hll/languages/pipp: . src/pct

From:
tene
Date:
January 5, 2009 00:29
Subject:
[svn:parrot] r34970 - in branches/pct_hll/languages/pipp: . src/pct
Message ID:
20090105082929.7101BCB9F9@x12.develooper.com
Author: tene
Date: Mon Jan  5 00:29:28 2009
New Revision: 34970

Modified:
   branches/pct_hll/languages/pipp/pipp.pir
   branches/pct_hll/languages/pipp/src/pct/actions.pm

Log:
[pipp]: Move to the 'pipp' HLL NameSpace

Modified: branches/pct_hll/languages/pipp/pipp.pir
==============================================================================
--- branches/pct_hll/languages/pipp/pipp.pir	(original)
+++ branches/pct_hll/languages/pipp/pipp.pir	Mon Jan  5 00:29:28 2009
@@ -28,15 +28,31 @@
 
 =cut
 
+.HLL 'pipp'
+
+.sub '' :anon :load :init
+
+    # Pipp uses the Parrot Compiler Toolkit
+    load_bytecode 'PCT.pbc'
+
+    # Export namespaces to the appropriate HLL ns
+    .local pmc parrotns, phpns, exports
+    parrotns = get_root_namespace ['parrot']
+    phpns = get_hll_namespace
+    exports = split ' ', 'PAST PCT PGE'
+    parrotns.'export_to'(phpns, exports)
+.end
+
+.include 'src/pct/gen_grammar.pir'
+.include 'src/pct/gen_actions.pir'
+.include 'src/pct/quote_expression.pir'
+
 .HLL '_pipp'
 
 .const string VERSION = "0.0.1"
 
 .sub '__onload' :anon :load :init
 
-    # Pipp uses the Parrot Compiler Toolkit
-    load_bytecode 'PCT.pbc'
-
     # %valflags specifies when PAST::Val nodes are allowed to
     # be used as a constant.  The 'e' flag indicates that the
     # value must be quoted+escaped in PIR code.
@@ -77,13 +93,15 @@
 
     # Initialize the stack @?BLOCK
     $P0 = new 'ResizablePMCArray'
-    set_root_global ['parrot';'Pipp';'Grammar';'Actions'], '@?BLOCK', $P0
+    set_root_global ['pipp';'Pipp';'Grammar';'Actions'], '@?BLOCK', $P0
 
     # register and set up the the HLLCompiler
     $P1 = new ['PCT';'HLLCompiler']
     $P1.'language'('Pipp')
-    $P1.'parsegrammar'('Pipp::Grammar')
-    $P1.'parseactions'('Pipp::Grammar::Actions')
+    $P0 = get_root_namespace ['pipp';'Pipp';'Grammar']
+    $P1.'parsegrammar'($P0)
+    $P0 = get_root_namespace ['pipp';'Pipp';'Grammar';'Actions']
+    $P1.'parseactions'($P0)
 
 .end
 
@@ -342,12 +360,6 @@
 
 .end
 
-.HLL 'parrot'
-
-.include 'src/pct/gen_grammar.pir'
-.include 'src/pct/gen_actions.pir'
-.include 'src/pct/quote_expression.pir'
-
 # Local Variables:
 #   mode: pir
 #   fill-column: 100

Modified: branches/pct_hll/languages/pipp/src/pct/actions.pm
==============================================================================
--- branches/pct_hll/languages/pipp/src/pct/actions.pm	(original)
+++ branches/pct_hll/languages/pipp/src/pct/actions.pm	Mon Jan  5 00:29:28 2009
@@ -48,6 +48,8 @@
             $block.push( $($_) );
         }
 
+        $block.hll('pipp');
+
         make $block;
     }
 }



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