gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gzz Space.java impl/AbstractSpace.java


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz/gzz Space.java impl/AbstractSpace.java
Date: Thu, 29 Aug 2002 08:46:14 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/08/29 08:46:14

Modified files:
        gzz            : Space.java 
        gzz/impl       : AbstractSpace.java 

Log message:
        Forgot one part of PEG 1002: zzclone move. Here.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/Space.java.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/impl/AbstractSpace.java.diff?tr1=1.9&tr2=1.10&r1=text&r2=text

Patches:
Index: gzz/gzz/Space.java
diff -c gzz/gzz/Space.java:1.20 gzz/gzz/Space.java:1.21
*** gzz/gzz/Space.java:1.20     Sat Aug  3 14:22:30 2002
--- gzz/gzz/Space.java  Thu Aug 29 08:46:14 2002
***************
*** 31,37 ****
   */
  
  public interface Space {
! String rcsid = "$Id: Space.java,v 1.20 2002/08/03 18:22:30 benja Exp $";
  
      /** Get the home cell of this space.
       * The home cell is where everything begins.
--- 31,37 ----
   */
  
  public interface Space {
! String rcsid = "$Id: Space.java,v 1.21 2002/08/29 12:46:14 tjl Exp $";
  
      /** Get the home cell of this space.
       * The home cell is where everything begins.
***************
*** 76,81 ****
--- 76,88 ----
       * @diagram zzstruct
       */
      Dim getCloneDim();
+ 
+     /** Clone a cell.
+      * @param cellToClone The cell to clone
+      * @param cloneInSlice A cell of the slice the clone should be in. 
+      *   May be null.
+      */
+     Cell zzclone(Cell cellToClone, Cell cloneInSlice);
  
      /** Create a new span containing the given character.
       * The cell argument is for use when the space is in several
Index: gzz/gzz/impl/AbstractSpace.java
diff -c gzz/gzz/impl/AbstractSpace.java:1.9 gzz/gzz/impl/AbstractSpace.java:1.10
*** gzz/gzz/impl/AbstractSpace.java:1.9 Thu Aug 29 06:08:34 2002
--- gzz/gzz/impl/AbstractSpace.java     Thu Aug 29 08:46:14 2002
***************
*** 33,39 ****
   */
  
  public abstract class AbstractSpace implements SliceSpace {
! public static final String rcsid = "$Id: AbstractSpace.java,v 1.9 2002/08/29 
10:08:34 tjl Exp $";
  
      protected ModularCellTexter cellTexter;
      protected JavaObjector javaObjector;
--- 33,39 ----
   */
  
  public abstract class AbstractSpace implements SliceSpace {
! public static final String rcsid = "$Id: AbstractSpace.java,v 1.10 2002/08/29 
12:46:14 tjl Exp $";
  
      protected ModularCellTexter cellTexter;
      protected JavaObjector javaObjector;
***************
*** 87,91 ****
--- 87,112 ----
  
      public Cell getMSBlockCell(String msid, Cell cell) {
        return null;
+     }
+ 
+     public Cell zzclone(Cell cellToClone, Cell cloneInSlice) {
+       Dim cl = getCloneDim();
+       if(cloneInSlice == null) {
+           return N(cl.h(cellToClone, 1), cl, 1, null);
+       }
+       Cell end = cl.h(cellToClone, 1);
+       Cell nu = N(cloneInSlice);
+       Cell firstroot = nu.getRootclone();
+       end.connect(cl, 1, nu);
+       if(!nu.getRootclone().equals(cellToClone.getRootclone()))
+           throw new ZZError("ARGH: zzclone(Cell) didn't work: "+
+                             cellToClone.getRootclone() + " != " + 
nu.getRootclone()+"\n"+
+                             "Nu was: "+nu+" in "+nu.space+"\n"+
+                             "This is: "+cellToClone+" in "+this+"\n"+
+                             "End was: "+end+" in "+end.space+"\n"+
+                             "Nu's negconn was: "+nu.s(cl, -1)+"\n"+
+                             "Nu's head was: "+nu.h(cl, -1)+"\n"+
+                             "Firstroot was: "+firstroot);
+       return nu;
      }
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]