new syntax: receive, notify, dismiss
[fleet.git] / src / edu / berkeley / fleet / api / Instruction.java
index 263c40b..5e3c106 100644 (file)
@@ -65,16 +65,21 @@ public abstract class Instruction {
         public String toString() {
             String ret = benkoBox.toString() + ": ";
             if (count==0 || count>1 || recycle) {
-                ret += "[";
+                ret += recycle ? "(" : "[";
                 if (count>1) ret += count;
                 if (count==0) ret += "*";
-                if (recycle) ret += "r";
-                ret += "] ";
+                ret += recycle ? ")" : "] ";
             }
             boolean needcomma = false;
             if (tokenIn)           { ret += (needcomma ? ", " : "") + "wait";    needcomma = true; }
-            if (dataIn && latch)   { ret += (needcomma ? ", " : "") + "take";    needcomma = true; }
-            if (dataIn && !latch)  { ret += (needcomma ? ", " : "") + "discard"; needcomma = true; }
+            if (dataIn && latch)  {
+                if (benkoBox instanceof BenkoBox.Inbox)
+                    ret += (needcomma ? ", " : "") + "receive";
+                else
+                    ret += (needcomma ? ", " : "") + "take";
+                needcomma = true;
+            }
+            if (dataIn && !latch)  { ret += (needcomma ? ", " : "") + "dismiss"; needcomma = true; }
             if (dataOut)  {
                 if (benkoBox instanceof BenkoBox.Inbox || dest==null)
                     ret += (needcomma ? ", " : "") + "deliver";
@@ -82,7 +87,7 @@ public abstract class Instruction {
                     ret += (needcomma ? ", " : "") + "sendto "+dest;
                 needcomma = true;
             }
-            if (tokenOut) { ret += (needcomma ? ", " : "") + "ack "+dest; needcomma = true; }
+            if (tokenOut) { ret += (needcomma ? ", " : "") + "notify "+dest; needcomma = true; }
             return ret;
         }