[svn:parrot] r39988 - in branches/ops_pct: compilers/opsc compilers/opsc/op compilers/opsc/ops config/gen/makefiles

bacek at svn.parrot.org bacek at svn.parrot.org
Sat Jul 11 02:35:08 UTC 2009


Author: bacek
Date: Sat Jul 11 02:35:07 2009
New Revision: 39988
URL: https://trac.parrot.org/parrot/changeset/39988

Log:
[opsc] Rename dir op to ops

Added:
   branches/ops_pct/compilers/opsc/ops/
   branches/ops_pct/compilers/opsc/ops/op.pir
      - copied, changed from r39987, branches/ops_pct/compilers/opsc/op/op.pir
   branches/ops_pct/compilers/opsc/ops/op.pm
      - copied, changed from r39987, branches/ops_pct/compilers/opsc/op/op.pm
Deleted:
   branches/ops_pct/compilers/opsc/op/op.pir
   branches/ops_pct/compilers/opsc/op/op.pm
Modified:
   branches/ops_pct/compilers/opsc/opsc.pir
   branches/ops_pct/config/gen/makefiles/opsc.in

Deleted: branches/ops_pct/compilers/opsc/op/op.pir
==============================================================================
--- branches/ops_pct/compilers/opsc/op/op.pir	Sat Jul 11 02:35:07 2009	(r39987)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,34 +0,0 @@
-# $Id$
-
-=head1 NAME
-
-PAST - Parrot abstract syntax tree for PMC.
-
-=head1 DESCRIPTION
-
-PAST node for a single Op
-
-=cut
-
-.sub '' :anon :load :init
-    ##   create the classes
-    .local pmc p6meta
-    p6meta = new 'P6metaclass'
-
-    p6meta.'new_class'('Ops::Op', 'parent'=>'PAST::Op')
-
-    .return ()
-.end
-
-
-=head1 COPYRIGHT
-
-Copyright (C) 2009, Parrot Foundation.
-
-=cut
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Deleted: branches/ops_pct/compilers/opsc/op/op.pm
==============================================================================
--- branches/ops_pct/compilers/opsc/op/op.pm	Sat Jul 11 02:35:07 2009	(r39987)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,66 +0,0 @@
-# Copyright (C) 2009, Parrot Foundation.
-# $Id$
-
-class Ops::Op;
-
-=item C<set_body>
-
-Set the body of this Op and do some processing on the body to determine which
-jump flags need to be set.
-
-=cut
-
-method set_body($body) {
-    my %jumps;
-    my @jumps;
-
-    #figure out which control flow flags need to be set for this op
-    if (match( " 'goto' \s+ 'ADDRESS' ", $body)) {
-        %jumps{'PARROT_JUMP_ADDRESS'} := 1;
-    }
-
-    if (match( " 'goto' \s+ 'OFFSET' ", $body) ||
-        self.name eq 'runinterp' ) {
-        %jumps{'PARROT_JUMP_RELATIVE'} := 1;
-    }
-
-    if (match( " 'goto' \s+ 'POP' ", $body)) {
-        %jumps{'PARROT_JUMP_POP'} := 1;
-    }
-
-    if (match( " 'expr' \s+ 'NEXT' ", $body) ||
-        self.name eq 'runinterp' ) {
-        %jumps{'PARROT_JUMP_ENEXT'} := 1;
-    }
-
-    if (match( " 'restart' \s+ 'OFFSET' ", $body)) {
-        %jumps{'PARROT_JUMP_RELATIVE'} := 1;
-        %jumps{'PARROT_JUMP_RESTART'}  := 1;
-    }
-    elsif (match( " 'restart' \s+ 'OFFSET' ", $body)) {
-        %jumps{'PARROT_JUMP_RESTART'} := 1;
-        %jumps{'PARROT_JUMP_ENEXT'}   := 1;
-    }
-    elsif (self.name eq 'branch_cs' || self.name eq 'returncc' ) {
-        %jumps{'PARROT_JUMP_RESTART'} := 1;
-    }
-    elsif (match( " 'restart' \s+ 'ADDRESS' ", $body)) {
-        %jumps{'PARROT_JUMP_RESTART'} := 1;
-        %jumps{'PARROT_JUMP_ENEXT'}   := 0;
-    }
-
-    #XXX: need to handle PARROT_JUMP_GNEXT
-    
-    for %jumps {
-        if %jumps{$_} {
-            @jumps.push($_);
-        }
-    }
-    
-    if + at jumps == 0 {
-        self<jump_flags> := '0';
-    }
-    else {
-        self<jump_flags> := join('|', @jumps);
-    }
-}

Copied and modified: branches/ops_pct/compilers/opsc/ops/op.pir (from r39987, branches/ops_pct/compilers/opsc/op/op.pir)
==============================================================================

Copied and modified: branches/ops_pct/compilers/opsc/ops/op.pm (from r39987, branches/ops_pct/compilers/opsc/op/op.pm)
==============================================================================
--- branches/ops_pct/compilers/opsc/op/op.pm	Sat Jul 11 02:33:56 2009	(r39987, copy source)
+++ branches/ops_pct/compilers/opsc/ops/op.pm	Sat Jul 11 02:35:07 2009	(r39988)
@@ -3,6 +3,18 @@
 
 class Ops::Op;
 
+=head1 NAME
+
+C<Ops::Op> - Parrot Operation
+
+=head1 DESCRIPTION
+
+Extends PAST::Block with various helper methods.
+
+=head2 Methods
+
+=over 4
+
 =item C<set_body>
 
 Set the body of this Op and do some processing on the body to determine which
@@ -64,3 +76,6 @@
         self<jump_flags> := join('|', @jumps);
     }
 }
+
+
+

Modified: branches/ops_pct/compilers/opsc/opsc.pir
==============================================================================
--- branches/ops_pct/compilers/opsc/opsc.pir	Sat Jul 11 02:33:56 2009	(r39987)
+++ branches/ops_pct/compilers/opsc/opsc.pir	Sat Jul 11 02:35:07 2009	(r39988)
@@ -45,8 +45,8 @@
 .include 'builtins.pir'
 .include 'compiler/gen_grammar.pir'
 .include 'compiler/gen_actions.pir'
-.include 'op/op.pir'
-.include 'op/gen_op.pir'
+.include 'ops/op.pir'
+.include 'ops/gen_op.pir'
 
 .include 'runcore/gen_base.pir'
 .include 'runcore/gen_c.pir'

Modified: branches/ops_pct/config/gen/makefiles/opsc.in
==============================================================================
--- branches/ops_pct/config/gen/makefiles/opsc.in	Sat Jul 11 02:33:56 2009	(r39987)
+++ branches/ops_pct/config/gen/makefiles/opsc.in	Sat Jul 11 02:35:07 2009	(r39988)
@@ -17,8 +17,8 @@
 SOURCES := \
   opsc.pir \
   builtins.pir \
-  op/op.pir \
-  op/gen_op.pir \
+  ops/op.pir \
+  ops/gen_op.pir \
   compiler/gen_grammar.pir \
   compiler/gen_actions.pir \
   runcore/gen_base.pir \
@@ -40,9 +40,9 @@
 	$(PARROT) $(PARROT_ARGS) $(NQP) --output=compiler/gen_actions.pir \
 	    --target=pir compiler/actions.pm
 
-op/gen_op.pir: $(NQP) $(PCT) op/op.pm
-	$(PARROT) $(PARROT_ARGS) $(NQP) --output=op/gen_op.pir \
-	    --target=pir op/op.pm
+ops/gen_op.pir: $(NQP) $(PCT) ops/op.pm
+	$(PARROT) $(PARROT_ARGS) $(NQP) --output=ops/gen_op.pir \
+	    --target=pir ops/op.pm
 
 runcore/gen_base.pir: $(NQP) $(PCT) runcore/base.pm
 	$(PARROT) $(PARROT_ARGS) $(NQP) --output=runcore/gen_base.pir \
@@ -98,7 +98,7 @@
   opsc.pbc \
   compiler/gen_grammar.pir \
   compiler/gen_actions.pir \
-  op/gen_op.pir \
+  ops/gen_op.pir \
   runcore/gen_base.pir \
   runcore/gen_c.pir \
 


More information about the parrot-commits mailing list