Charj: add automatic forward declarations for class variables
[charm.git] / src / langs / charj / src / charj / translator / SymbolTable.java
index c5f7726f904f9c47e31426ea6c2eb8835468a6cb..3812e3e6fbd5aeeb3e8febf11b3f611b04774016 100644 (file)
@@ -67,14 +67,11 @@ public class SymbolTable {
         primitiveTypes.put("char",   new ClassSymbol(this, "char",   null, lang)); 
         primitiveTypes.put("short",  new ClassSymbol(this, "short",  null, lang)); 
         primitiveTypes.put("bool",   new ClassSymbol(this, "bool",   null, lang)); 
-        lang.define("void", primitiveTypes.get("void"));
-        lang.define("int", primitiveTypes.get("int"));
-        lang.define("long", primitiveTypes.get("long"));
-        lang.define("float", primitiveTypes.get("float"));
-        lang.define("double", primitiveTypes.get("double"));
-        lang.define("char", primitiveTypes.get("char"));
-        lang.define("short", primitiveTypes.get("short"));
-        lang.define("bool", primitiveTypes.get("bool"));
+        for (Map.Entry<String, ClassSymbol> entry : primitiveTypes.entrySet()) {
+            ClassSymbol c = entry.getValue();
+            lang.define(entry.getKey(), c);
+            c.isPrimitive = true;
+        }
     }
 
     public ClassSymbol resolveBuiltinType(String type) {