Charj: improve "include" formatting and add charm++.h by default
authorAaron Becker <akbecker@gmail.com>
Sat, 22 May 2010 02:59:50 +0000 (21:59 -0500)
committerAaron Becker <akbecker@gmail.com>
Sat, 22 May 2010 02:59:50 +0000 (21:59 -0500)
src/langs/charj/src/charj/translator/Charj.stg
src/langs/charj/src/charj/translator/ClassSymbol.java

index 9370053d1a3f5a05bb06a552abab30ad7b67c017..dcd1e7d121d3e9d8ed9cb5de9629efcea1e85c38 100644 (file)
@@ -89,6 +89,7 @@ class <ident> {
 
 classDeclaration_cc(sym, ident, ext, csds) ::=
 <<
+<sym.IncludeString>
 <sym.NamespaceOpeningString>
 <if(ext)>
 class <ident>: public <ext> {
index 676197a8d4c74d5974c0e8c30661725b9e0a7d40..5d9524639675337641624ba5fd9d3daaa7f8a32c 100644 (file)
@@ -49,6 +49,7 @@ public class ClassSymbol extends SymbolWithScope implements Scope {
         this.scope = scope;
 
         // manually add automatic class methods and symbols here
+        this.includes.add("charm++.h");
     }
 
     public Scope getEnclosingScope() {
@@ -251,7 +252,7 @@ public class ClassSymbol extends SymbolWithScope implements Scope {
     public String getIncludeString() {
         String includeString = "";
         for (String include : includes) {
-            includeString += "#include<" + include + ">\n";
+            includeString += "#include <" + include + ">\n";
         }
         return includeString;
     }