Charj: add SDAG reference number support
authorAaron Becker <akbecker@gmail.com>
Tue, 24 Aug 2010 21:05:33 +0000 (16:05 -0500)
committerAaron Becker <akbecker@gmail.com>
Tue, 24 Aug 2010 21:05:33 +0000 (16:05 -0500)
src/langs/charj/src/charj/translator/Charj.g
src/langs/charj/src/charj/translator/CharjASTModifier.g
src/langs/charj/src/charj/translator/CharjASTModifier2.g
src/langs/charj/src/charj/translator/CharjEmitter.g
src/langs/charj/src/charj/translator/ClassSymbol.java

index dfab5e090146a2d4448941b2be480bab58f214fd..c76a1835698075422e3a306eacd2daa4c29c9fe4 100644 (file)
@@ -587,8 +587,8 @@ statement
 sdagStatement
     :   OVERLAP block
         -> ^(OVERLAP block)
-    |   WHEN IDENT '(' type IDENT ')' (',' '(' type IDENT ')')* block
-        -> ^(WHEN (IDENT type IDENT)+ block)
+    |   WHEN IDENT ('[' expression ']')? ('(' type IDENT ')' (',' '(' type IDENT ')')*)* block
+        -> ^(WHEN IDENT expression? (type IDENT)* block)
     ;
 
 nonBlockStatement
index f0cf7e1f566763bc711eb2e29b769a9a423aa367..38cdb0a1cb685ece4666eb792bd0b11e6ba1cef9 100644 (file)
@@ -311,7 +311,7 @@ statement
 
 sdagStatement
     :   ^(OVERLAP block)
-    |   ^(WHEN (IDENT type IDENT)+ block)
+    |   ^(WHEN IDENT expression? (type IDENT)* block)
     ;
 
 nonBlockStatement
index 1a0f7e0d3492af5b4f38aa5a81462f40d4a5a8dd..2d6199030e0e663fe777cc3d5b1cc8294ce5c149 100644 (file)
@@ -326,7 +326,7 @@ statement
 
 sdagStatement
     :   ^(OVERLAP block)
-    |   ^(WHEN (IDENT type IDENT)+ block)
+    |   ^(WHEN IDENT expression? (type IDENT)* block)
     ;
 
 nonBlockStatement
index 5104d71417529aef788eee546643295db6eeb395..22648b546d811703d44980ea90df27888f6ffcba 100644 (file)
@@ -676,9 +676,9 @@ statement
 
 sdagStatement
     :   ^(OVERLAP block)
-        -> template(b={$block.st}) "/* !!overlap not implemented <block> */
-    |   ^(WHEN (IDENT type IDENT)+ block)
-        -> template(b={$block.st}) "/* !!when not implemented <block> */
+        -> template(b={$block.st}) "/* !!overlap not implemented */"
+    |   ^(WHEN IDENT expression? (type IDENT)* block)
+        -> template(b={$block.st}) "/* !!when not implemented */"
     ;
 
 nonBlockStatement
index 20a25a847f7fc9628e3d11536432c3806a39ecfe..c4aac8de1aeeb19976b3188ce9cbe304c8b9d9b4 100644 (file)
@@ -346,7 +346,7 @@ public class ClassSymbol extends SymbolWithScope implements Scope, Type {
         return PUPers;
     }
 
-    public boolean hasSDAG() {
+    public boolean getHasSDAG() {
         List<String> inits = new ArrayList<String>();
         for (Map.Entry<String, MethodSymbol> e : methods.entrySet()) {
             if (e.getValue().hasSDAG) return true;