rename recycle=>requeue
authoradam <adam@megacz.com>
Mon, 20 Aug 2007 07:35:01 +0000 (08:35 +0100)
committeradam <adam@megacz.com>
Mon, 20 Aug 2007 07:35:01 +0000 (08:35 +0100)
src/edu/berkeley/fleet/api/Instruction.java
src/edu/berkeley/fleet/assembler/Parser.java
src/edu/berkeley/fleet/ies44/InstructionEncoder.java
src/edu/berkeley/fleet/interpreter/InstructionBenkoBox.java

index 6482198..0be7246 100644 (file)
@@ -29,7 +29,7 @@ public abstract class Instruction {
         public final boolean  latch;
         public final boolean  dataOut;
         public final boolean  tokenOut;
-        public final boolean  recycle;
+        public final boolean  requeue;
 
         /** count=0 denotes a standing move */
         public Executable(BenkoBox    benkoBox,
@@ -40,7 +40,7 @@ public abstract class Instruction {
                           boolean     latch,
                           boolean     dataOut,
                           boolean     tokenOut,
-                          boolean     recycle) {
+                          boolean     requeue) {
             this.benkoBox = benkoBox;
             this.dest = dest;
             this.count = count;
@@ -49,7 +49,7 @@ public abstract class Instruction {
             this.latch = latch;
             this.dataOut = dataOut;
             this.tokenOut = tokenOut;
-            this.recycle = recycle;
+            this.requeue = requeue;
             if (count < 0)
                 throw new RuntimeException("count field of an instruction must be >=0");
         }
@@ -61,16 +61,16 @@ public abstract class Instruction {
         public Instruction.Executable decrementCount() {
             if (count==1) return null;
             return new Executable(benkoBox, dest, count==0 ? 0 : count-1,
-                                  tokenIn, dataIn, latch, dataOut, tokenOut, recycle);
+                                  tokenIn, dataIn, latch, dataOut, tokenOut, requeue);
         }
 
         public String toString() {
             String ret = benkoBox.toString() + ": ";
-            if (count==0 || count>1 || recycle) {
-                ret += recycle ? "(" : "[";
+            if (count==0 || count>1 || requeue) {
+                ret += requeue ? "(" : "[";
                 if (count>1) ret += count;
                 if (count==0) ret += "*";
-                ret += recycle ? ")" : "] ";
+                ret += requeue ? ")" : "] ";
             }
             boolean needcomma = false;
             if (tokenIn)           { ret += (needcomma ? ", " : "") + "wait";    needcomma = true; }
index ad9ac87..890304f 100644 (file)
@@ -247,22 +247,22 @@ public class Parser {
             OUTER: for(Tree tt : t.child(1)) {
                 int count = 1;
                 Tree ttx = null;
-                boolean recycle = false;
+                boolean requeue = false;
                 ttx = tt.child(1);
                 if (tt.size() > 1 && tt.child(0).size()>0) {
                     tt = tt.child(0).child(0);
                     if (tt.head().equals("BrackStar")) {
                         count = 0;
-                        recycle = false;
+                        requeue = false;
                     } else if (tt.head().equals("ParenStar")) {
                         count = 0;
-                        recycle = true;
+                        requeue = true;
                     } else if (tt.head().equals("Brack")) {
                         count = Integer.parseInt(string(tt.child(0)));
-                        recycle = false;
+                        requeue = false;
                     } else if (tt.head().equals("Paren")) {
                         count = Integer.parseInt(string(tt.child(0)));
-                        recycle = true;
+                        requeue = true;
                     }
                 }
                 boolean tokenIn = false;
@@ -290,7 +290,7 @@ public class Parser {
                 }
                 cb.add(new Instruction.Executable(benkobox,
                                                   dest, count, tokenIn, dataIn,
-                                                  latch, dataOut, tokenOut, recycle));
+                                                  latch, dataOut, tokenOut, requeue));
             }
         }
     }
index c72c4fe..5d1e3b3 100644 (file)
@@ -63,10 +63,10 @@ public abstract class InstructionEncoder {
                 boolean latch    = getBit(OFFSET_DL, instr);
                 boolean dataOut  = getBit(OFFSET_DO, instr);
                 boolean tokenOut = getBit(OFFSET_TO, instr);
-                boolean recycle  = getBit(OFFSET_RQ, instr);
+                boolean requeue  = getBit(OFFSET_RQ, instr);
                 if (latch & !dataIn) return new Instruction.Kill(name, count, tokenIn);
                 return new Instruction.Executable(name, dest, count, tokenIn, dataIn,
-                                                  latch, dataOut, tokenOut, recycle);
+                                                  latch, dataOut, tokenOut, requeue);
             }
 
             case 1: {
@@ -111,7 +111,7 @@ public abstract class InstructionEncoder {
             instr |= putField(OFFSET_DL,                          OFFSET_DL,          inst.latch?1:0);
             instr |= putField(OFFSET_DO,                          OFFSET_DO,          inst.dataOut?1:0);
             instr |= putField(OFFSET_TO,                          OFFSET_TO,          inst.tokenOut?1:0);
-            instr |= putField(OFFSET_RQ,                          OFFSET_RQ,          inst.recycle?1:0);
+            instr |= putField(OFFSET_RQ,                          OFFSET_RQ,          inst.requeue?1:0);
 
         } else if (d instanceof Instruction.Literal.CodeBagDescriptor) {
             Instruction.Literal.CodeBagDescriptor lc = (Instruction.Literal.CodeBagDescriptor)d;
index 2ff5f1b..8b74ac1 100644 (file)
@@ -72,7 +72,7 @@ abstract class InstructionBenkoBox extends InterpreterBenkoBox {
 
         boolean ret = service(executing);
         if (!ret) return;
-        if (executing.recycle) {
+        if (executing.requeue) {
             executing = executing.decrementCount();
             if (executing != null)
                 addInstruction(executing);