Dereference ref type arguments to entry methods
authorAaron Becker <akbecker@gmail.com>
Wed, 21 Mar 2012 21:54:40 +0000 (16:54 -0500)
committerAaron Becker <akbecker@gmail.com>
Wed, 21 Mar 2012 21:54:40 +0000 (16:54 -0500)
src/langs/charj/src/charj/translator/CharjEmitter.g
src/langs/charj/src/charj/translator/CharjPostAnalysis.g
src/langs/charj/src/charj/translator/SymbolResolver.g
src/langs/charj/tests/functional/EntryInvocation.cj

index 81e708aed6e65b79d9b8891f5705565be638868b..f507e679fb928c7adb709de4eced9cdb06963b5e 100644 (file)
@@ -994,7 +994,7 @@ primaryExpression
     |   ^(METHOD_CALL pe=primaryExpression gtal=genericTypeArgumentList? args=arguments)
         -> method_call(primary={$pe.st}, generic_types={$gtal.st}, args={$args.st})
     |   ^(ENTRY_METHOD_CALL pe=primaryExpression gtal=genericTypeArgumentList? args=arguments)
-        -> entry_method_call(primary={$pe.st}, generic_types={$gtal.st}, args={$args.st})
+        -> method_call(primary={$pe.st}, generic_types={$gtal.st}, args={$args.st})
     |   explicitConstructorCall
         -> {$explicitConstructorCall.st}
     |   ^(ARRAY_ELEMENT_ACCESS pe=primaryExpression ex=expressionArrayAccess) {
index 9df0030e50ad4e5b35834f25537ad43b833c5014..315755243591bba911cd1aa6fd0ee5e25095c2d0 100644 (file)
@@ -582,6 +582,8 @@ entryArguments
 
 entryArgExpr
     :   ^(EXPR entryExpr)
+        -> {$EXPR.symbolType instanceof PointerType}? ^(EXPR ^(POINTER_DEREFERENCE entryExpr))
+        -> ^(EXPR entryExpr)
     ;
 
 entryExpr
index b46d7ff8e35e5e0955deb83d5317834e1988bfb3..c301442d518a9d037eef800ece075adf5b944800 100644 (file)
@@ -50,8 +50,6 @@ enterMethod
                 if (currentMethod.isEntry) {
                     Type argType = (Type)$argid.def.type;
                     currentMethod.addEntryArg(argType.getTypeName(), $argid.text);
-                    System.out.println("processing method argument " + $argid.text);
-                    System.out.println("type is " + argType.getTypeName());
                 }
             }
             ))*)
index c786ddd6940363b8cc8e01bbd77f48be30d342ad..c4e6911005a88951e4a982cf8c10ccf66762e844 100644 (file)
@@ -16,6 +16,8 @@ public mainchare Main {
         c@obj1(a);
         c@obj2(a, a);
         c@mix2(x, a);
+        SimpleChare c2;
+        c2.local(x, a);
     }
 }
 
@@ -33,4 +35,6 @@ public chare SimpleChare {
     }
     entry void mix2(int x, Foo a) {
     }
+    public void local(int x, Foo a) {
+    }
 }