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,
boolean latch,
boolean dataOut,
boolean tokenOut,
- boolean recycle) {
+ boolean requeue) {
this.benkoBox = benkoBox;
this.dest = dest;
this.count = count;
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");
}
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; }
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;
}
cb.add(new Instruction.Executable(benkobox,
dest, count, tokenIn, dataIn,
- latch, dataOut, tokenOut, recycle));
+ latch, dataOut, tokenOut, requeue));
}
}
}
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: {
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;
boolean ret = service(executing);
if (!ret) return;
- if (executing.recycle) {
+ if (executing.requeue) {
executing = executing.decrementCount();
if (executing != null)
addInstruction(executing);