Charj: add basic recognition of explicit proxy types
authorAaron Becker <akbecker@gmail.com>
Wed, 26 May 2010 16:21:44 +0000 (11:21 -0500)
committerAaron Becker <akbecker@gmail.com>
Wed, 26 May 2010 16:21:44 +0000 (11:21 -0500)
src/langs/charj/src/charj/translator/Charj.g
src/langs/charj/src/charj/translator/CharjASTModifier.g
src/langs/charj/src/charj/translator/CharjEmitter.g
src/langs/charj/src/charj/translator/CharjSemantics.g
src/langs/charj/src/charj/translator/SymbolTable.java

index 5dfc8f4d294dc4fb68613ea2ea970385b6724dc3..aa940a08d73243dc4d4f05bc91b2f33ce52a4a59 100644 (file)
@@ -177,6 +177,7 @@ tokens {
     OBJECT_TYPE;
     REFERENCE_TYPE;
     POINTER_TYPE;
+    PROXY_TYPE;
     PRIMITIVE_VAR_DECLARATION;
     OBJECT_VAR_DECLARATION;
     VAR_DECLARATOR;
@@ -402,9 +403,15 @@ localModifier
 type
     :   simpleType
     |   objectType
+    |   proxyType
     |   VOID
     ;
 
+proxyType
+    :   qualifiedTypeIdent '@' arrayDeclaratorList?
+        ->  ^(PROXY_TYPE qualifiedTypeIdent arrayDeclaratorList?)
+    ;
+
 simpleType
     :   primitiveType arrayDeclaratorList?
         ->  ^(SIMPLE_TYPE primitiveType arrayDeclaratorList?)  
index 4a2cd89d1953429596484d467faaeed81c58184f..6c46e60e151a2697dc6e14a32eb3ed9a34548022 100644 (file)
@@ -177,6 +177,7 @@ simpleType
     
 objectType
     :   ^(OBJECT_TYPE qualifiedTypeIdent arrayDeclaratorList?)
+    |   ^(PROXY_TYPE qualifiedTypeIdent arrayDeclaratorList?)
     |   ^(REFERENCE_TYPE qualifiedTypeIdent arrayDeclaratorList?)
     |   ^(POINTER_TYPE qualifiedTypeIdent arrayDeclaratorList?)
     ;
index 81353f56b630147d7ab9280d2e9bbdb0994e839a..0043717f231a1debc4183b1104a39ee72fecc648 100644 (file)
@@ -384,6 +384,8 @@ simpleType
 objectType
     :   ^(OBJECT_TYPE qualifiedTypeIdent arrayDeclaratorList?)
         -> obj_type(typeID={$qualifiedTypeIdent.st}, arrDeclList={$arrayDeclaratorList.st})
+    |   ^(PROXY_TYPE qualifiedTypeIdent arrayDeclaratorList?)
+        -> proxy_type(typeID={$qualifiedTypeIdent.st}, arrDeclList={$arrayDeclaratorList.st})
     |   ^(POINTER_TYPE qualifiedTypeIdent arrayDeclaratorList?)
         -> pointer_type(typeID={$qualifiedTypeIdent.st}, arrDeclList={$arrayDeclaratorList.st})
     |   ^(REFERENCE_TYPE qualifiedTypeIdent arrayDeclaratorList?)
index de5798eedd01162a658a55d8e642eb6300959c1c..1531a0f3d8062cb4648123be8a9ac09f23e31f96 100644 (file)
@@ -107,7 +107,6 @@ packageDeclaration
             }
             currentPackage = ps;
             $ScopeStack::current = ps;
-//            $qualifiedIdentifier.start.symbol = ps; ----- commented out while dealing with the namespaces issue (Minas)
         }
     ;
     
@@ -280,6 +279,7 @@ simpleType returns [ClassSymbol type]
 objectType returns [ClassSymbol type]
     :   ^(OBJECT_TYPE qualifiedTypeIdent arrayDeclaratorList?)
     |   ^(REFERENCE_TYPE qualifiedTypeIdent arrayDeclaratorList?)
+    |   ^(PROXY_TYPE qualifiedTypeIdent arrayDeclaratorList?)
     |   ^(POINTER_TYPE qualifiedTypeIdent arrayDeclaratorList?)
         {
             $type = currentClass.resolveType($qualifiedTypeIdent.name);
index 3812e3e6fbd5aeeb3e8febf11b3f611b04774016..fdec096a69db0b6964e6412570099b3aead5d36e 100644 (file)
@@ -56,7 +56,6 @@ public class SymbolTable {
     {
         PackageScope lang = resolvePackage("charj.lang");
         objectRoot = new ClassSymbol(this, "Object", null, lang);
-        objectRoot.define("EOF", new VariableSymbol(this,"EOF",null));
         lang.define("Object", objectRoot);
 
         primitiveTypes.put("void",   new ClassSymbol(this, "void",   null, lang));