Charj : added basic support for automatic puping of pointer types
[charm.git] / src / langs / charj / src / charj / translator / Charj.g
index 5dfc8f4d294dc4fb68613ea2ea970385b6724dc3..95191f91eba71e4ec73a6629175d82146d967227 100644 (file)
@@ -67,6 +67,7 @@ tokens {
     THROW                   = 'throw'           ;
     BREAK                   = 'break'           ;
 
+    DOT                     = '.'               ;
     NEW                     = 'new'             ;
     BITWISE_OR              = '|'               ;
     BITWISE_AND             = '&'               ;
@@ -700,7 +701,7 @@ postfixedExpression
         )
         // ... and than the optional things that may follow a primary
         // expression 0 or more times.
-        (   outerDot='.'                 
+        (   outerDot=DOT                 
             // Note: generic type arguments are only valid for method calls,
             // i.e. if there is an argument list
             (   (   genericTypeArgumentList?  
@@ -712,10 +713,10 @@ postfixedExpression
                 )?
             |   THIS
                 ->  ^($outerDot $postfixedExpression THIS)
-            |   s='super' arguments
+            |   s=SUPER arguments
                 ->  ^(SUPER_CONSTRUCTOR_CALL[$s, "SUPER_CONSTRUCTOR_CALL"] $postfixedExpression arguments)
-            |   (   'super' innerDot='.' IDENT
-                    ->  ^($innerDot ^($outerDot $postfixedExpression 'super') IDENT)
+            |   (   SUPER innerDot=DOT IDENT
+                    ->  ^($innerDot ^($outerDot $postfixedExpression SUPER) IDENT)
                 )
                 (   arguments
                     ->  ^(METHOD_CALL $postfixedExpression arguments)
@@ -736,11 +737,11 @@ primaryExpression
     |   newExpression
     |   qualifiedIdentExpression
     |   genericTypeArgumentList 
-        (   s='super'
+        (   s=SUPER
             (   arguments
                 ->  ^(SUPER_CONSTRUCTOR_CALL[$s, "SUPER_CONSTRUCTOR_CALL"] genericTypeArgumentList arguments)
             |   IDENT arguments
-                ->  ^(METHOD_CALL ^('.' 'super' IDENT) genericTypeArgumentList arguments)
+                ->  ^(METHOD_CALL ^(DOT SUPER IDENT) genericTypeArgumentList arguments)
             )
         |   IDENT arguments
             ->  ^(METHOD_CALL IDENT genericTypeArgumentList arguments)
@@ -753,13 +754,13 @@ primaryExpression
         (   arguments
             ->  ^(THIS_CONSTRUCTOR_CALL[$t, "THIS_CONSTRUCTOR_CALL"] arguments)
         )?
-    |   s='super' arguments
+    |   s=SUPER arguments
         ->  ^(SUPER_CONSTRUCTOR_CALL[$s, "SUPER_CONSTRUCTOR_CALL"] arguments)
-    |   (   'super' '.' IDENT
+    |   (   SUPER DOT IDENT
         )
         (   arguments
-            ->  ^(METHOD_CALL ^('.' 'super' IDENT) arguments)
-        |   ->  ^('.' 'super' IDENT)
+            ->  ^(METHOD_CALL ^(DOT SUPER IDENT) arguments)
+        |   ->  ^(DOT SUPER IDENT)
         )
     ;
     
@@ -773,18 +774,18 @@ qualifiedIdentExpression
             ->  ^(METHOD_CALL qualifiedIdentifier arguments)
         |   outerDot='.'
             (   genericTypeArgumentList 
-                (   s='super' arguments
+                (   s=SUPER arguments
                     ->  ^(SUPER_CONSTRUCTOR_CALL[$s, "SUPER_CONSTRUCTOR_CALL"]
                             qualifiedIdentifier genericTypeArgumentList arguments)
-                |   'super' innerDot='.' IDENT arguments
-                    ->  ^(METHOD_CALL ^($innerDot ^($outerDot qualifiedIdentifier 'super') IDENT)
+                |   SUPER innerDot='.' IDENT arguments
+                    ->  ^(METHOD_CALL ^($innerDot ^($outerDot qualifiedIdentifier SUPER) IDENT)
                             genericTypeArgumentList arguments)
                 |   IDENT arguments
                     ->  ^(METHOD_CALL ^($outerDot qualifiedIdentifier IDENT) genericTypeArgumentList arguments)
                 )
             |   THIS
                 ->  ^($outerDot qualifiedIdentifier THIS)
-            |   s='super' arguments
+            |   s=SUPER arguments
                 ->  ^(SUPER_CONSTRUCTOR_CALL[$s, "SUPER_CONSTRUCTOR_CALL"] qualifiedIdentifier arguments)
             )
         )?