add support for nop
authoradam <adam@megacz.com>
Fri, 26 Jan 2007 15:22:36 +0000 (16:22 +0100)
committeradam <adam@megacz.com>
Fri, 26 Jan 2007 15:22:36 +0000 (16:22 +0100)
src/edu/berkeley/fleet/parser/Parser.java
src/edu/berkeley/fleet/parser/fleet.g

index ba87e40..6c73537 100644 (file)
@@ -4,7 +4,6 @@ import edu.berkeley.fleet.api.*;
 
 // used only for special interpreter parsing extensions
 import edu.berkeley.fleet.interpreter.Interpreter;
-
 import edu.berkeley.fleet.interpreter.CodeBag;
 
 import edu.berkeley.sbp.*;
@@ -186,6 +185,7 @@ public class Parser {
                 for(int i=0; i<ttx.size(); i++) {
                     Tree ttt = ttx.child(i);
                     if      ("Wait".equals(ttt.head()))    { tokenIn = true; }
+                    else if ("Nop".equals(ttt.head()))     { }
                     else if ("Kill".equals(ttt.head()))    {
                         cb.add(new Instruction.Kill(benkobox, count));
                         continue OUTER;
index c16dc7b..2e6578a 100644 (file)
@@ -18,7 +18,8 @@ Statement       = Fiber:: Source ws! ":" ws! (Instruction +/ ws)
                 | NamedCodeBag:: name ":" "{" CodeBagBody "}" /ws
 
 Instruction     = Instruction:: (Brack:: "[" (int|(Star::"*"))? ("r")? "]" ws!)? (Command +/ (ws! "," ws!) ws! ";"!)
-Command         = Kill::    "kill"
+Command         = Nop::     "nop"
+                | Kill::    "kill"
                 | Wait::    "wait"
                 | Discard:: "discard"
                 | Take::    "take"