[svn:parrot] r44478 - in branches/ops_pct/compilers/opsc: . compiler

bacek at svn.parrot.org bacek at svn.parrot.org
Thu Feb 25 20:31:59 UTC 2010


Author: bacek
Date: Thu Feb 25 20:31:59 2010
New Revision: 44478
URL: https://trac.parrot.org/parrot/changeset/44478

Log:
Resurrect OPSC

Modified:
   branches/ops_pct/compilers/opsc/Defines.mak
   branches/ops_pct/compilers/opsc/Rules.mak
   branches/ops_pct/compilers/opsc/compiler/grammar.pg
   branches/ops_pct/compilers/opsc/opsc.pir
   branches/ops_pct/compilers/opsc/opsc_core.pir

Modified: branches/ops_pct/compilers/opsc/Defines.mak
==============================================================================
--- branches/ops_pct/compilers/opsc/Defines.mak	Thu Feb 25 20:27:40 2010	(r44477)
+++ branches/ops_pct/compilers/opsc/Defines.mak	Thu Feb 25 20:31:59 2010	(r44478)
@@ -1,5 +1,6 @@
 OPSC_CLEANUPS = \
 	compilers/opsc/opsc.pbc \
+	compilers/opsc/compiler/gen_compiler.pir \
 	compilers/opsc/compiler/gen_grammar.pir \
 	compilers/opsc/compiler/gen_actions.pir \
 	compilers/opsc/ops/gen_oplib.pir \
@@ -11,6 +12,7 @@
 	compilers/opsc/opsc_core.pir \
 	compilers/opsc/builtins.pir \
 	compilers/opsc/ops/gen_oplib.pir \
+	compilers/opsc/compiler/gen_compiler.pir \
 	compilers/opsc/compiler/gen_grammar.pir \
 	compilers/opsc/compiler/gen_actions.pir \
 	compilers/opsc/runcore/gen_base.pir \

Modified: branches/ops_pct/compilers/opsc/Rules.mak
==============================================================================
--- branches/ops_pct/compilers/opsc/Rules.mak	Thu Feb 25 20:27:40 2010	(r44477)
+++ branches/ops_pct/compilers/opsc/Rules.mak	Thu Feb 25 20:31:59 2010	(r44478)
@@ -5,6 +5,10 @@
 compilers/opsc/opsc_core.pbc: $(NQP_RX) $(OPSC_SOURCES)
 	$(PARROT) -o compilers/opsc/opsc_core.pbc compilers/opsc/opsc_core.pir
 
+compilers/opsc/compiler/gen_compiler.pir: $(NQP_RX) compilers/opsc/compiler/compiler.pm
+	$(NQP_RX) --output=compilers/opsc/compiler/gen_compiler.pir \
+	--target=pir compilers/opsc/compiler/compiler.pm
+
 compilers/opsc/compiler/gen_grammar.pir: $(NQP_RX) compilers/opsc/compiler/grammar.pg
 	$(NQP_RX) --output=compilers/opsc/compiler/gen_grammar.pir \
 	--target=pir compilers/opsc/compiler/grammar.pg

Modified: branches/ops_pct/compilers/opsc/compiler/grammar.pg
==============================================================================
--- branches/ops_pct/compilers/opsc/compiler/grammar.pg	Thu Feb 25 20:27:40 2010	(r44477)
+++ branches/ops_pct/compilers/opsc/compiler/grammar.pg	Thu Feb 25 20:31:59 2010	(r44478)
@@ -1,8 +1,9 @@
 # Copyright (C) 2009, Parrot Foundation.
 # $Id$
 
+INIT { pir::load_bytecode('HLL.pbc'); }
 
-grammar Ops::Grammar is PCT::Grammar;
+grammar Ops::Grammar is HLL::Grammar;
 
 rule TOP {
     <body> 
@@ -102,5 +103,4 @@
 }
 
 
-
 # vim: expandtab shiftwidth=4 ft=perl6:

Modified: branches/ops_pct/compilers/opsc/opsc.pir
==============================================================================
--- branches/ops_pct/compilers/opsc/opsc.pir	Thu Feb 25 20:27:40 2010	(r44477)
+++ branches/ops_pct/compilers/opsc/opsc.pir	Thu Feb 25 20:31:59 2010	(r44478)
@@ -3,15 +3,12 @@
 
 .namespace [ 'Ops';'Compiler' ]
 
-.sub 'onload' :load :init
-    # opsc_core.pir don't load NQP to avoid clash in nqp-based tests.
-    load_bytecode 'PCT.pbc'
-.end
+.loadlib 'PCT.pbc'
 
 .sub 'main' :main
     .param pmc args
     $P0 = compreg 'Ops'
-    .tailcall $P0.'command_line'(args, 'encoding'=>'utf8', 'transcode'=>'ascii')
+    $P1 = $P0.'command_line'(args, 'encoding'=>'utf8', 'transcode'=>'ascii')
 .end
 
 .include 'compilers/opsc/opsc_core.pir'

Modified: branches/ops_pct/compilers/opsc/opsc_core.pir
==============================================================================
--- branches/ops_pct/compilers/opsc/opsc_core.pir	Thu Feb 25 20:27:40 2010	(r44477)
+++ branches/ops_pct/compilers/opsc/opsc_core.pir	Thu Feb 25 20:31:59 2010	(r44478)
@@ -3,17 +3,24 @@
 
 .namespace [ 'Ops';'Compiler' ]
 
-.sub 'onload' :load :init
-    .local pmc p6meta
-    p6meta = new 'P6metaclass'
+.loadlib 'PCT.pbc'
 
-    p6meta.'new_class'('Ops::Compiler', 'parent'=>'PCT::HLLCompiler')
+.include 'compilers/opsc/builtins.pir'
+.include 'compilers/opsc/compiler/gen_grammar.pir'
+.include 'compilers/opsc/compiler/gen_actions.pir'
+.include 'compilers/opsc/compiler/gen_compiler.pir'
+.include 'compilers/opsc/ops/gen_oplib.pir'
 
+.include 'compilers/opsc/runcore/gen_base.pir'
+.include 'compilers/opsc/runcore/gen_c.pir'
+.include 'compilers/opsc/runcore/gen_cgoto.pir'
+.include 'compilers/opsc/runcore/gen_cprederef.pir'
+.include 'compilers/opsc/runcore/gen_cgp.pir'
+.include 'compilers/opsc/runcore/gen_cswitch.pir'
+
+.sub 'onload' :load :init
     # Register grammar and action
     $P0 = new [ 'Ops';'Compiler' ]
-    $P0.'language'('Ops')
-    $P0.'parsegrammar'('Ops::Grammar')
-    $P0.'parseactions'('Ops::Grammar::Actions')
 
     #these stages aren't currently used, although generate_files exits before
     #they can be called anyway
@@ -50,18 +57,6 @@
 .end
 
 
-.include 'compilers/opsc/builtins.pir'
-.include 'compilers/opsc/compiler/gen_grammar.pir'
-.include 'compilers/opsc/compiler/gen_actions.pir'
-.include 'compilers/opsc/ops/gen_oplib.pir'
-
-.include 'compilers/opsc/runcore/gen_base.pir'
-.include 'compilers/opsc/runcore/gen_c.pir'
-.include 'compilers/opsc/runcore/gen_cgoto.pir'
-.include 'compilers/opsc/runcore/gen_cprederef.pir'
-.include 'compilers/opsc/runcore/gen_cgp.pir'
-.include 'compilers/opsc/runcore/gen_cswitch.pir'
-
 # Local Variables:
 #   mode: pir
 #   fill-column: 100


More information about the parrot-commits mailing list