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

[svn:parrot] r34971 - in branches/pct_hll/languages/pynie: . src/parser

From:
tene
Date:
January 5, 2009 00:39
Subject:
[svn:parrot] r34971 - in branches/pct_hll/languages/pynie: . src/parser
Message ID:
20090105083942.8EC91CB9F9@x12.develooper.com
Author: tene
Date: Mon Jan  5 00:39:41 2009
New Revision: 34971

Modified:
   branches/pct_hll/languages/pynie/pynie.pir
   branches/pct_hll/languages/pynie/src/parser/Actions.pm

Log:
[pynie]: Start using the 'pynie' HLL namespace.

Modified: branches/pct_hll/languages/pynie/pynie.pir
==============================================================================
--- branches/pct_hll/languages/pynie/pynie.pir	(original)
+++ branches/pct_hll/languages/pynie/pynie.pir	Mon Jan  5 00:39:41 2009
@@ -18,14 +18,36 @@
 
 =cut
 
-.sub '__onload' :load :init
+.HLL 'pynie'
+
+.sub '' :anon :load :init
     load_bytecode 'PCT.pbc'
 
+    .local pmc parrotns, pyns, exports
+    parrotns = get_root_namespace ['parrot']
+    pyns = get_hll_namespace
+    exports = split ' ', 'PAST PCT PGE'
+    parrotns.'export_to'(pyns, exports)
+.end
+
+.include 'src/gen_grammar.pir'
+.include 'src/gen_actions.pir'
+.include 'src/parser/indent.pir'
+
+.include 'src/builtins/funcs.pir'
+.include 'src/builtins/io.pir'
+.include 'src/builtins/lists.pir'
+.include 'src/builtins/oper.pir'
+
+
+.sub '__onload' :load :init
     $P0 = get_hll_global ['PCT'], 'HLLCompiler'
     $P0 = $P0.'new'()
     $P0.'language'('Pynie')
-    $P0.'parsegrammar'('Pynie::Grammar')
-    $P0.'parseactions'('Pynie::Grammar::Actions')
+    $P1 = get_hll_namespace ['Pynie';'Grammar']
+    $P0.'parsegrammar'($P1)
+    $P1 = get_hll_namespace ['Pynie';'Grammar';'Actions']
+    $P0.'parseactions'($P1)
 
     $P0.'commandline_banner'("Pynie: a Python compiler for Parrot.\n")
     $P0.'commandline_prompt'('>>> ')
@@ -48,15 +70,6 @@
 .end
 
 
-.include 'src/gen_grammar.pir'
-.include 'src/gen_actions.pir'
-.include 'src/parser/indent.pir'
-
-.include 'src/builtins/funcs.pir'
-.include 'src/builtins/io.pir'
-.include 'src/builtins/lists.pir'
-.include 'src/builtins/oper.pir'
-
 =back
 
 =cut

Modified: branches/pct_hll/languages/pynie/src/parser/Actions.pm
==============================================================================
--- branches/pct_hll/languages/pynie/src/parser/Actions.pm	(original)
+++ branches/pct_hll/languages/pynie/src/parser/Actions.pm	Mon Jan  5 00:39:41 2009
@@ -4,7 +4,9 @@
 class Pynie::Grammar::Actions;
 
 method TOP($/) {
-    make $( $<file_input> );
+    my $block := PAST::Block.new( $( $<file_input> ) );
+    $block.hll('pynie');
+    make $block;
 }
 
 method file_input($/) {



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