2 import java.util.Vector;
3 import IR.TypeDescriptor;
4 import IR.MethodDescriptor;
6 public class CreateObjectNode extends ExpressionNode {
11 public CreateObjectNode(TypeDescriptor type) {
13 argumentlist=new Vector();
16 public void addArgument(ExpressionNode en) {
20 public void setConstructor(MethodDescriptor md) {
24 public MethodDescriptor getConstructor() {
28 public TypeDescriptor getType() {
32 public int numArgs() {
33 return argumentlist.size();
36 public ExpressionNode getArg(int i) {
37 return (ExpressionNode) argumentlist.get(i);
40 public String printNode(int indent) {
42 boolean isarray=td.isArray();
44 st="new "+td.toString()+"[";
46 st="new "+td.toString()+"(";
47 for(int i=0;i<argumentlist.size();i++) {
48 ExpressionNode en=(ExpressionNode)argumentlist.get(i);
49 st+=en.printNode(indent);
50 if ((i+1)!=argumentlist.size()) {
64 return Kind.CreateObjectNode;