2 import java.util.Vector;
3 import IR.TypeDescriptor;
4 import IR.MethodDescriptor;
6 public class CreateObjectNode extends ExpressionNode {
13 public CreateObjectNode(TypeDescriptor type, boolean isglobal) {
15 argumentlist=new Vector();
16 this.isglobal=isglobal;
19 public boolean isGlobal() {
23 public void addFlagEffects(FlagEffects fe) {
27 public FlagEffects getFlagEffects() {
31 public void addArgument(ExpressionNode en) {
35 public void setConstructor(MethodDescriptor md) {
39 public MethodDescriptor getConstructor() {
43 public TypeDescriptor getType() {
47 public int numArgs() {
48 return argumentlist.size();
51 public ExpressionNode getArg(int i) {
52 return (ExpressionNode) argumentlist.get(i);
55 public String printNode(int indent) {
57 boolean isarray=td.isArray();
59 st="new "+td.toString()+"[";
61 st="new "+td.toString()+"(";
62 for(int i=0;i<argumentlist.size();i++) {
63 ExpressionNode en=(ExpressionNode)argumentlist.get(i);
64 st+=en.printNode(indent);
65 if ((i+1)!=argumentlist.size()) {
79 return Kind.CreateObjectNode;