1. removed the limitation of JArray dimensions (was 3)
authorChao Huang <chuang10@uiuc.edu>
Thu, 10 Mar 2005 06:13:13 +0000 (06:13 +0000)
committerChao Huang <chuang10@uiuc.edu>
Thu, 10 Mar 2005 06:13:13 +0000 (06:13 +0000)
2. moved the .decl.h in generated .h file to immediately above main class
   to support user classes in .decl.h

src/langs/jade/JArray.h
src/langs/jade/java.tree.g

index 4a568d6ee2f4e12967f0f0c0c58b90521730a03e..847e8e70d6fd655d95af1bba02bba9206bde1a27 100644 (file)
@@ -44,7 +44,7 @@ public:
        JArray(const int numDims):dims(NULL), data(NULL), dimSize(NULL), useVirtual(0), start(NULL), end(NULL), stride(NULL)
        {
                //ckout << CkMyPe() << ": JArray(" << numDims << ") reached" << endl;
-               assert(numDims<=3); // @@ arbitrary limitation, code should work ok for larger dims
+//             assert(numDims<=3); // @@ arbitrary limitation, code should work ok for larger dims
                setDimension(numDims);
        }
 
index 4660a690713bbbfe8de9b158f5d6c308fe695d32..c07de8fd3ace70c907661d992733fefe78f8c5e4 100644 (file)
@@ -37,12 +37,14 @@ compilationUnit
        :       (p:packageDefinition {
                 String name = J.pE(p.getFirstChild());
                 J.tmp.push(name);
+               J.pgmName = name;
 
                 J.ci.append((p.status?"main":"") +
                     "module " + name + " {\n");
                 J.h.append("\n#include <vector>\nusing std::vector;\n#include \"pup_stl.h\"\n");
                 J.h.append("\n#include \"jade.h\"\n");
-                J.h.append("\n#include \"" + name + ".decl.h\"\n\n");
+                // .decl.h is inserted right before main class
+                // J.h.append("\n#include \"" + name + ".decl.h\"\n\n");
                 J.c.append("\n#include \"" + name + ".h\"\n\n");
                 J.indentLevel++;
             }
@@ -133,6 +135,9 @@ typeDefinition
 //                     J.ciOff();
                 }
 
+                // insert .decl.h right before main class
+                if(c.status)
+                   J.h.append("\n#include \"" + J.pgmName + ".decl.h\"\n\n");
                 J.h.append(J.indent() + "class " + #IDENT.getText());
 //                 J.c.append(J.indent() + "class " + #IDENT.getText());