public String toString() {
String s = predicate.toString();
if (s.length()>0) s = "["+s+"] ";
- if (looping) s += "[L] ";
+ if (looping) s += "[Rq] ";
return dock+": "+s;
}
switch(dest) {
case InnerLoopCounter:
switch(source) {
- /*
- case Infinity: return super.toString()+"set ilc=*";
- case DataLatch: return super.toString()+"set ilc=data";
- case Immediate: return super.toString()+"set ilc="+immediate;
- */
- case Infinity: return super.toString()+"load repeat counter with *;";
- case DataLatch: return super.toString()+"set ilc=data";
- case Immediate: return super.toString()+"load repeat counter with "+immediate+";";
+ case Infinity: return super.toString()+"set ilc=*;";
+ case DataLatch: return super.toString()+"set ilc=data;";
+ case Immediate: return super.toString()+"set ilc="+immediate+";";
}
case OuterLoopCounter:
switch(source) {
- /*
- case Decrement: return super.toString()+"set olc--";
- case DataLatch: return super.toString()+"set olc=data";
- case Immediate: return super.toString()+"set olc="+immediate;
- */
- case Decrement: return super.toString()+"decrement loop counter;";
+ case Decrement: return super.toString()+"set olc--;";
case DataLatch: return super.toString()+"set olc=data;";
- case Immediate: return super.toString()+"load loop counter with "+immediate+";";
+ case Immediate: return super.toString()+"set olc="+immediate+";";
}
- case Flags: return super.toString()+"set flags a="+newFlagA+" b="+newFlagB;
- case DataLatch: return super.toString()+"literal "+immediate+";";
+ case Flags: return super.toString()+"set flags a="+newFlagA+", b="+newFlagB+";";
+ case DataLatch: return super.toString()+"set word="+immediate+";";
}
throw new Error("impossible");
}
this.tokenOut = tokenOut;
this.interruptible = interruptible;
if (dock != null && dock.isInputDock() && tokenIn && dataIn)
- throw new RuntimeException("cannot have both \"wait\" and \"take\"/\"recieve\" on an input dock: " + this);
+ throw new RuntimeException("cannot have two \"recv\"s: " + this);
if (dock != null && dock.isOutputDock() && tokenOut && dataOut)
- throw new RuntimeException("cannot have both \"sendto\" and \"notify\" on an output dock: " + this);
+ throw new RuntimeException("cannot have two \"send\"s: " + this);
if (latchData && !dataIn)
throw new RuntimeException("cannot have latchData bit set without dataIn bit: " + this);
if (latchPath && !dataIn)
public String toString() {
StringBuffer ret = new StringBuffer();
- if (tokenIn) ret.append(", wait");
+ if (tokenIn) ret.append(", recv token");
if (dataIn) {
if (latchPath) ret.append(!dock.isInputDock() ? ", collect path" : ", recv path");
if (latchData) ret.append(!dock.isInputDock() ? ", collect" : ", recv");
if (!latchPath && !latchData) ret.append(", discard");
}
if (dataOut && dock.isInputDock()) ret.append(", deliver");
- if (dataOut && !dock.isInputDock()) ret.append(path==null ? ", send" : ", sendto " + path.getDestination().getDock());
- if (tokenOut) ret.append(path==null ? ", token" : ", notify " + path.getDestination().getDock());
+ if (dataOut && !dock.isInputDock()) ret.append(path==null ? ", send" : ", send to " + path.getDestination().getDock());
+ if (tokenOut) ret.append(path==null ? ", token" : ", send token to " + path.getDestination().getDock());
String s = ret.toString();
s = s.equals("") ? "nop" : s.substring(2);
if (interruptible) s = "[T] " + s;
/** marks the end of a loop; closes the hatch */
public static class Tail extends Instruction {
public Tail(Dock dock) { super(dock, false, Predicate.IgnoreOLC); }
- public String toString() { return super.toString() + "tail;"; }
+ public String toString() { return dock+": tail;"; }
}
}