Charj: fix missing modifier and consolidate entry method output rules
authorAaron Becker <akbecker@gmail.com>
Fri, 24 Sep 2010 21:12:09 +0000 (16:12 -0500)
committerAaron Becker <akbecker@gmail.com>
Fri, 24 Sep 2010 21:12:09 +0000 (16:12 -0500)
src/langs/charj/src/charj/translator/CharjASTModifier2.g
src/langs/charj/src/charj/translator/CharjEmitter.g

index 9672e6b7ad94a86090eed886c828ff25babfdebe..ffc1839ebefa798a1c75a0fe4b3b195b6ec15da1 100644 (file)
@@ -370,8 +370,8 @@ nonBlockStatement returns [boolean sdag]
 @init { $sdag = false; }
     :   ^(ASSERT expression expression?)
     |   ^(IF parenthesizedExpression (i=block { $sdag |= $i.sdag; }) (e=block { $sdag |= $e.sdag; })?)
-        -> {$sdag}? ^(SDAG_IF parenthesizedExpression $i $e)
-        -> ^(IF parenthesizedExpression $i $e)
+        -> {$sdag}? ^(SDAG_IF parenthesizedExpression $i $e?)
+        -> ^(IF parenthesizedExpression $i $e?)
     |   ^(FOR forInit? FOR_EXPR (e1=expression)? FOR_UPDATE (e2+=expression)* block {
             $sdag = $block.sdag;
         })
index add206306f72c2459e9eb5533e8e93da63bd1dd2..bfe338aab85bfae7798fd3ae4465dcff526d1572 100644 (file)
@@ -249,23 +249,13 @@ classScopeDeclaration
                 block={$b.st})
         -> {emitCI()}? // do nothing, since it's not an entry method
         ->
-    |   ^(ENTRY_FUNCTION_DECL m=modifierList? g=genericTypeParameterList? 
-            ty=type IDENT f=formalParameterList a=domainExpression[null]?) 
-        -> {emitCI()}?  funcMethodDecl_ci(
-                modl={$m.st}, 
-                gtpl={$g.st}, 
-                ty={$ty.st},
-                id={$IDENT.text}, 
-                fpl={$f.st}, 
-                block={null})
-        ->
     |   ^(ENTRY_FUNCTION_DECL m=modifierList? g=genericTypeParameterList? 
             ty=type IDENT f=formalParameterList a=domainExpression[null]? 
             {
                 currentMethod = (MethodSymbol)$IDENT.def;
                 sdagMethod = currentMethod.hasSDAG;
             }
-            b=block) 
+            b=block?
         -> {emitCC()}? funcMethodDecl_cc(
                 classSym={currentClass},
                 methodSym={currentMethod},