diff --git a/tools/cooja/java/se/sics/cooja/plugins/ScriptParser.java b/tools/cooja/java/se/sics/cooja/plugins/ScriptParser.java index 0ef07be75..6d4b73db8 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/ScriptParser.java +++ b/tools/cooja/java/se/sics/cooja/plugins/ScriptParser.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ScriptParser.java,v 1.5 2009/05/26 14:27:00 fros4943 Exp $ + * $Id: ScriptParser.java,v 1.6 2009/06/12 15:12:46 fros4943 Exp $ */ package se.sics.cooja.plugins; @@ -67,8 +67,6 @@ public class ScriptParser { code = replaceWaitUntils(code); - code = replaceGenerateMessages(code); - this.code = code; } @@ -219,30 +217,11 @@ public class ScriptParser { return code; } - private String replaceGenerateMessages(String code) throws ScriptSyntaxErrorException { - Pattern pattern = Pattern.compile( - "GENERATE_MSG\\(" + - "([0-9]+)" /* timeout */ + - "[\\s]*,[\\s]*" + - "(.*)" /* code */ + - "\\)" - ); - Matcher matcher = pattern.matcher(code); - - while (matcher.find()) { - long time = Long.parseLong(matcher.group(1))*Simulation.MILLISECOND; - String msg = matcher.group(2); - - code = matcher.replaceFirst( - "log.generateMessage(" + time + "," + msg + ")"); - matcher.reset(code); - } - - return code; - } - public String getJSCode() { return + "function GENERATE_MSG(time, msg) { " + + " log.generateMessage(time, msg); " + + "};\n" + "function SCRIPT_KILL() { " + " SEMAPHORE_SIM.release(100); " + " throw('test script killed'); " +