start of new file
[IRC.git] / Robust / src / IR / Tree / CreateObjectNode.java
index d6dd24441c21f750dcaced94d7267394fe3502f5..5f19aae22d775ffe69eb72550d02963146a6d35b 100644 (file)
@@ -7,10 +7,25 @@ public class CreateObjectNode extends ExpressionNode {
     TypeDescriptor td;
     Vector argumentlist;
     MethodDescriptor md;
+    FlagEffects fe;
+    boolean isglobal;
 
-    public CreateObjectNode(TypeDescriptor type) {
+    public CreateObjectNode(TypeDescriptor type, boolean isglobal) {
        td=type;
        argumentlist=new Vector();
+       this.isglobal=isglobal;
+    }
+
+    public boolean isGlobal() {
+       return isglobal;
+    }
+
+    public void addFlagEffects(FlagEffects fe) {
+       this.fe=fe;
+    }
+
+    public FlagEffects getFlagEffects() {
+       return fe;
     }
 
     public void addArgument(ExpressionNode en) {
@@ -38,14 +53,26 @@ public class CreateObjectNode extends ExpressionNode {
     }
 
     public String printNode(int indent) {
-       String st="new "+td.toString()+"(";
+       String st;
+       boolean isarray=td.isArray();
+       if (isarray)
+           st="new "+td.toString()+"[";
+       else
+           st="new "+td.toString()+"(";
        for(int i=0;i<argumentlist.size();i++) {
            ExpressionNode en=(ExpressionNode)argumentlist.get(i);
            st+=en.printNode(indent);
-           if ((i+1)!=argumentlist.size())
-               st+=", ";
+           if ((i+1)!=argumentlist.size()) {
+               if (isarray) 
+                   st+="][";
+               else
+                   st+=", ";
+           }
        }
-       return st+")";
+       if (isarray)
+           return st+"]";
+       else
+           return st+")";
     }
 
     public int kind() {