From 95100d3ec8458ce45845677212be1e6dda979566 Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 28 Aug 2007 01:25:09 +0100 Subject: [PATCH] better error reporting on invalid instructions --- src/edu/berkeley/fleet/api/Instruction.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/edu/berkeley/fleet/api/Instruction.java b/src/edu/berkeley/fleet/api/Instruction.java index 55e2b52..0e03bf1 100644 --- a/src/edu/berkeley/fleet/api/Instruction.java +++ b/src/edu/berkeley/fleet/api/Instruction.java @@ -73,6 +73,12 @@ public abstract class Instruction { this.ignoreUntilLast = ignoreUntilLast; if (count < 0) throw new RuntimeException("count field of an instruction must be >=0"); + if (pump.isInbox() && tokenIn && dataIn) + throw new RuntimeException("cannot have both \"wait\" and \"take\"/\"recieve\" on an inbox: " + this); + if (pump.isOutbox() && tokenOut && dataOut) + throw new RuntimeException("cannot have both \"sendto\" and \"notify\" on an outbox: " + this); + if (latch && !dataIn) + throw new RuntimeException("cannot have latch bit set without dataIn bit: " + this); } public boolean isStanding() { -- 1.7.10.4