Can now use the rblock keyword instead of sese keyword to write OoOJava programs...
authorjjenista <jjenista>
Wed, 26 May 2010 17:33:04 +0000 (17:33 +0000)
committerjjenista <jjenista>
Wed, 26 May 2010 17:33:04 +0000 (17:33 +0000)
Robust/src/Lex/Keyword.java
Robust/src/Lex/Lexer.java
Robust/src/Parse/java14.cup

index b661593789fea8d497b9d2d71ab0715fc8abe82f..763086ed6538dd7652a4fe8d2c78ea83f335f127 100644 (file)
@@ -86,5 +86,6 @@ class Keyword extends Token {
     key_table.put("disjoint", new Integer(Sym.DISJOINT));
     //Keywords for coarse-grain parallelization
     key_table.put("sese", new Integer(Sym.SESE));
+    key_table.put("rblock", new Integer(Sym.RBLOCK));
   }
 }
index 7b79531bb4858214227633e54468b7bc5873a57e..2d16e68ad7b35148de9286849c4a8c9049e0e380 100644 (file)
@@ -267,8 +267,9 @@ public class Lexer {
     //"interface",
     "isavailable",
     "long",
-    "native", "new", "optional", "package", "private", "protected", "public",
-    "return", "scratch", "sese", "short", "static", "strictfp", "super", "switch", "synchronized",
+    "native", "new", "optional", "package", "private", "protected", "public", 
+    "rblock", "return",
+    "scratch", "sese", "short", "static", "strictfp", "super", "switch", "synchronized",
     "tag", "task", "taskexit", //keywords for failure aware computation
     "this", "throw", "throws", "transient", "try", "void",
     "volatile", "while"
index dbe8dda0cd3d77f3cd638fc0d9d48cb73b1173f0..4831dee39206975f9f04fd1265a898b6545a20e8 100644 (file)
@@ -267,6 +267,7 @@ terminal DISJOINT;
 
 //coarse-grain parallelization
 terminal SESE;
+terminal RBLOCK;
 non terminal ParseNode sese_statement;
 
 
@@ -1392,6 +1393,17 @@ sese_statement ::=
               pn.addChild("identifier").addChild(id);
               RESULT=pn;
        :}
+       |      RBLOCK block:blk {: 
+              ParseNode pn = new ParseNode("sese");
+              pn.addChild("body").addChild(blk);
+              RESULT=pn;
+       :}
+       |      RBLOCK variable_declarator_id:id block:blk {: 
+              ParseNode pn = new ParseNode("sese");
+              pn.addChild("body").addChild(blk);
+              pn.addChild("identifier").addChild(id);
+              RESULT=pn;
+       :}
        ;
 //try_statement ::=
 //             TRY block catches