2 import java.util.Vector;
3 import IR.TypeDescriptor;
4 import IR.MethodDescriptor;
6 public class CreateObjectNode extends ExpressionNode {
12 public CreateObjectNode(TypeDescriptor type) {
14 argumentlist=new Vector();
17 public void addFlagEffects(FlagEffects fe) {
21 public FlagEffects getFlagEffects() {
25 public void addArgument(ExpressionNode en) {
29 public void setConstructor(MethodDescriptor md) {
33 public MethodDescriptor getConstructor() {
37 public TypeDescriptor getType() {
41 public int numArgs() {
42 return argumentlist.size();
45 public ExpressionNode getArg(int i) {
46 return (ExpressionNode) argumentlist.get(i);
49 public String printNode(int indent) {
51 boolean isarray=td.isArray();
53 st="new "+td.toString()+"[";
55 st="new "+td.toString()+"(";
56 for(int i=0;i<argumentlist.size();i++) {
57 ExpressionNode en=(ExpressionNode)argumentlist.get(i);
58 st+=en.printNode(indent);
59 if ((i+1)!=argumentlist.size()) {
73 return Kind.CreateObjectNode;