[svn:parrot] r39544 - branches/pmc_pct/compilers/pmcc/src/emitter

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Jun 14 07:02:43 UTC 2009


Author: bacek
Date: Sun Jun 14 07:02:42 2009
New Revision: 39544
URL: https://trac.parrot.org/parrot/changeset/39544

Log:
[pmcc] Preliminary stub for MULTIs handling.

Modified:
   branches/pmc_pct/compilers/pmcc/src/emitter/pmc.pm

Modified: branches/pmc_pct/compilers/pmcc/src/emitter/pmc.pm
==============================================================================
--- branches/pmc_pct/compilers/pmcc/src/emitter/pmc.pm	Sun Jun 14 07:02:28 2009	(r39543)
+++ branches/pmc_pct/compilers/pmcc/src/emitter/pmc.pm	Sun Jun 14 07:02:42 2009	(r39544)
@@ -377,8 +377,10 @@
           "PARROT_EXPORT void Parrot_"
         ~ self.name
         ~ "_class_init(PARROT_INTERP, int entry, int pass) {\n");
+
     @res.push( self.generate_attr_defs() );
     @res.push( self.generate_passes() );
+    @res.push( self.generate_multis() );
 
     my $past := self.past;
     if ($past<class_init>) {
@@ -511,6 +513,27 @@
 method pre_method_gen() {
 }
 
+=item C<generate_multis>
+
+Generate code for register MULTIs.
+
+=cut
+method generate_multis() {
+    # First - gather all required constant strings in hash.
+    my %constant_strings;
+
+    for self.past.multis.keys {
+        if !%constant_strings{ $_ } {
+            %constant_strings{ $_ } := +%constant_strings;
+        }
+    }
+
+    say("constants:");
+    for %constant_strings.keys {
+        say("\t" ~ $_ ~ " -> " ~ %constant_strings{$_} );
+    }
+}
+
 method past() {
     self<past>;
 }


More information about the parrot-commits mailing list