@Override
    public void codeGen(Writer w, String indent) throws IOException {
        w.write("new ");
        type.codeGen(w, indent);
        w.write("(");
        if (args.length > 0) {
            w.write("\n" + indent + "\t");
            args[0].codeGen(w, indent + "\t");
            for (int i = 1; i < args.length; i++) {
                w.write(", ");
                w.write("\n" + indent + "\t");
                args[i].codeGen(w, indent + "\t");
            }
        }
        w.write(")");
        if(methods!= null) {
            w.write(" {\n");
            for(Method m : methods) {
                m.codeGen(w, indent+"\t");
            }
            w.write(indent+"}");
        }
    }