Charj: made SDAG grammar reflect actual SDAG implementation
authorAaron Becker <akbecker@gmail.com>
Wed, 25 Aug 2010 16:20:59 +0000 (11:20 -0500)
committerAaron Becker <akbecker@gmail.com>
Wed, 25 Aug 2010 16:20:59 +0000 (11:20 -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

index 24b5960f8193a801a6d53e1015f7399d27cbdc42..49d92eba8df165d239c7eda9ac825e7dd64e4a07 100644 (file)
@@ -589,8 +589,8 @@ statement
 sdagStatement
     :   OVERLAP block
         -> ^(OVERLAP block)
-    |   WHEN IDENT ('[' expression ']')? ('(' type IDENT ')' (',' '(' type IDENT ')')*)* block
-        -> ^(WHEN IDENT expression? (type IDENT)* block)
+    |   WHEN (IDENT ('[' expression ']')? formalParameterList)* block
+        -> ^(WHEN (IDENT expression? formalParameterList)* block)
     ;
 
 nonBlockStatement
index 2e378bd18f2a04b0232381564a4273b55d002860..7fe91aa7e305265bbb1662021c73ff2c1bb6e77d 100644 (file)
@@ -312,7 +312,7 @@ statement
 
 sdagStatement
     :   ^(OVERLAP block)
-    |   ^(WHEN IDENT expression? (type IDENT)* block)
+    |   ^(WHEN (IDENT expression? formalParameterList)* block)
     ;
 
 nonBlockStatement
index 3ce1af38404d193263b26e90feef8c21429245d8..83650747e856fe9730f94ff0614d050a03ff2cf2 100644 (file)
@@ -327,7 +327,7 @@ statement
 
 sdagStatement
     :   ^(OVERLAP block)
-    |   ^(WHEN IDENT expression? (type IDENT)* block)
+    |   ^(WHEN (IDENT expression? formalParameterList)* block)
     ;
 
 nonBlockStatement
index 04b6c9d702c0da70ed7c4d5ae6c862d46f3f8c07..5fd1378674615689a919183b65a9b8b6ca8e0773 100644 (file)
@@ -695,12 +695,13 @@ statement
 sdagStatement
     :   ^(OVERLAP block)
         -> template(b={$block.st}) "} overlap <b> atomic {"
-    |   ^(WHEN IDENT expression? (wa+=whenArgument)* block)
-        -> template(i={$IDENT}, e={$expression.st}, w={wa}, b={$block.st}) "} when <i> <if(e)>[<e>]<endif> <w> <b> atomic {"
+    |   ^(WHEN (wa+=whenArgument)* block)
+        -> template(w={wa}, b={$block.st}) "} when <w> <b> atomic {"
     ;
 
 whenArgument
-    : type IDENT -> template(t={$type.st}, i={$IDENT}) "(<t> <i>)"
+    :   IDENT expression? formalParameterList
+        -> template(i={$IDENT}, e={$expression.st}, f={$formalParameterList.st}) "<i> <if(e)>[<e>] <endif><f>"
     ;
 
 nonBlockStatement