Charj : fixed namespace generation so that we don't output the
authorMinas Charalambides <charala1@illinois.edu>
Sun, 23 May 2010 20:43:53 +0000 (15:43 -0500)
committerMinas Charalambides <charala1@illinois.edu>
Sun, 23 May 2010 20:43:53 +0000 (15:43 -0500)
            top-level default namespace

            fixed namespace order generation (broke in a previous commit)

src/langs/charj/src/charj/translator/Charj.stg
src/langs/charj/src/charj/translator/ClassSymbol.java

index 233e21a77966f5c32286400e385fac12916ff75e..cc8c6b902948c1343456b03740a5fc944d4bb29f 100644 (file)
@@ -164,11 +164,9 @@ module <ident> {
 <if(ext)>
     extern module <ext>;
 <endif>
 <if(ext)>
     extern module <ext>;
 <endif>
-};
     <chareDeclaration_ci_cont(pds = sym.packageNames, chareType = chareType, arrayDim = arrayDim, ident = ident, ext = ext, csds = csds)>
     <chareDeclaration_ci_cont(pds = sym.packageNames, chareType = chareType, arrayDim = arrayDim, ident = ident, ext = ext, csds = csds)>
-
 <if(debug)>/* \</typeDeclaration> */<endif>
 <if(debug)>/* \</typeDeclaration> */<endif>
-
+};
 >>
 
 
 >>
 
 
index 95e5931ee80903a9bd04f13e4a03e6911d7d1000..d9b8bd8229a45587dc05c84880b36340f9d8dd4f 100644 (file)
@@ -262,7 +262,8 @@ public class ClassSymbol extends SymbolWithScope implements Scope {
         List<String> list = new ArrayList<String>();
         String namespace = "";
         for(Scope currentScope = scope; currentScope != null; currentScope = currentScope.getEnclosingScope())
         List<String> list = new ArrayList<String>();
         String namespace = "";
         for(Scope currentScope = scope; currentScope != null; currentScope = currentScope.getEnclosingScope())
-            list.add(currentScope.getScopeName());
+            list.add(0, currentScope.getScopeName());
+        list.remove(0);
         return list;
     }
 
         return list;
     }