[svn:parrot] r38360 - in branches/pmc_pct: compilers/pmc compilers/pmc/src config/gen/makefiles

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Apr 26 02:10:36 UTC 2009


Author: bacek
Date: Sun Apr 26 02:10:35 2009
New Revision: 38360
URL: https://trac.parrot.org/parrot/changeset/38360

Log:
Inherit PMC::Compiler from PCT::HLLCompiler

Added:
   branches/pmc_pct/compilers/pmc/src/compiler.pir
      - copied, changed from r38359, branches/pmc_pct/compilers/pmc/pmc.pir
Modified:
   branches/pmc_pct/compilers/pmc/pmc.pir
   branches/pmc_pct/config/gen/makefiles/pmc.in

Modified: branches/pmc_pct/compilers/pmc/pmc.pir
==============================================================================
--- branches/pmc_pct/compilers/pmc/pmc.pir	Sun Apr 26 02:10:12 2009	(r38359)
+++ branches/pmc_pct/compilers/pmc/pmc.pir	Sun Apr 26 02:10:35 2009	(r38360)
@@ -3,24 +3,13 @@
 
 .namespace [ 'PMC';'Compiler' ]
 
-.sub '__onload' :load :init
-    load_bytecode 'PGE.pbc'
-    load_bytecode 'PCT.pbc'
-    load_bytecode 'compilers/nqp/nqp.pbc'
-
-    $P0 = new [ 'PCT';'HLLCompiler' ]
-    $P0.'language'('PMC')
-    $P0.'parsegrammar'('PMC::Grammar')
-    $P0.'parseactions'('PMC::Grammar::Actions')
-
-.end
-
 .sub 'main' :main
     .param pmc args
     $P0 = compreg 'PMC'
     .tailcall $P0.'command_line'(args, 'encoding'=>'utf8', 'transcode'=>'ascii')
 .end
 
+.include 'src/compiler.pir'
 .include 'src/nodes.pir'
 .include 'src/parser/gen_grammar.pir'
 .include 'src/parser/gen_actions.pir'

Copied and modified: branches/pmc_pct/compilers/pmc/src/compiler.pir (from r38359, branches/pmc_pct/compilers/pmc/pmc.pir)
==============================================================================
--- branches/pmc_pct/compilers/pmc/pmc.pir	Sun Apr 26 02:10:12 2009	(r38359, copy source)
+++ branches/pmc_pct/compilers/pmc/src/compiler.pir	Sun Apr 26 02:10:35 2009	(r38360)
@@ -1,6 +1,15 @@
-# Copyright (C) 2009, Parrot Foundation.
 # $Id$
 
+=head1 NAME
+
+Compiler for PMC
+
+=head1 DESCRIPTION
+
+Extends PCT::HLLCompiler with emit_something functions
+
+=cut
+
 .namespace [ 'PMC';'Compiler' ]
 
 .sub '__onload' :load :init
@@ -8,23 +17,25 @@
     load_bytecode 'PCT.pbc'
     load_bytecode 'compilers/nqp/nqp.pbc'
 
-    $P0 = new [ 'PCT';'HLLCompiler' ]
+    .local pmc p6meta
+    p6meta = new 'P6metaclass'
+
+    p6meta.'new_class'('PMC::Compiler', 'parent'=>'PCT::HLLCompiler')
+
+
+    $P0 = new [ 'PMC';'Compiler' ]
     $P0.'language'('PMC')
     $P0.'parsegrammar'('PMC::Grammar')
     $P0.'parseactions'('PMC::Grammar::Actions')
 
 .end
 
-.sub 'main' :main
-    .param pmc args
-    $P0 = compreg 'PMC'
-    .tailcall $P0.'command_line'(args, 'encoding'=>'utf8', 'transcode'=>'ascii')
-.end
 
-.include 'src/nodes.pir'
-.include 'src/parser/gen_grammar.pir'
-.include 'src/parser/gen_actions.pir'
-.include 'src/builtins.pir'
+=head1 COPYRIGHT
+
+Copyright (C) 2009, Parrot Foundation.
+
+=cut
 
 # Local Variables:
 #   mode: pir

Modified: branches/pmc_pct/config/gen/makefiles/pmc.in
==============================================================================
--- branches/pmc_pct/config/gen/makefiles/pmc.in	Sun Apr 26 02:10:12 2009	(r38359)
+++ branches/pmc_pct/config/gen/makefiles/pmc.in	Sun Apr 26 02:10:35 2009	(r38360)
@@ -19,6 +19,7 @@
   src/parser/gen_grammar.pir \
   src/parser/gen_actions.pir \
   src/nodes.pir \
+  src/compiler.pir \
   src/builtins.pir
 
 # the default target


More information about the parrot-commits mailing list