fw.write(Util.networkReceiveSuffix(dynamic, current.getFields()[j].getType()) + "\n");
fw.write(" = "); fw.write(Util.networkReceive(dynamic, current.getFields()[j].getType()) + ";\n");
    private void createPushPopFunctions(SIRStructure[] structs,					FileWriter fw,					String network) throws Exception    {	assert network.equals("Static") || network.equals("Dynamic");	//which network we are using	boolean dynamic = false;	if (network.equals("Dynamic"))	    dynamic = true;	//create the pop functions	for (int i = 0; i < structs.length; i++) {	    SIRStructure current = structs[i];	    fw.write("inline " + current.getIdent() + " pop" + network + 		     current.getIdent() + "() {\n");	    fw.write("\t" + current.getIdent() + "* temp = (" + 		     current.getIdent() + "*)" + 		     "malloc(sizeof(" + current.getIdent() + "));\n");	    for (int j = 0; j < current.getFields().length; j++) {		fw.write("\t//" + current.getFields()[j].getType() + "\n");		if (current.getFields()[j].getType().isArrayType()) {		    //System.out.println(((CArrayType)current.getFields()[j].getType()).getDims());		    //assert false;		}		else if (current.getFields()[j].getType().isClassType()) {		 		    fw.write("\ttemp->" + current.getFields()[j].getVariable().getIdent() +			     " = pop" + network + current.getFields()[j].getType() + "();\n");		}		else {		    fw.write("\t" + Util.networkReceivePrefix(dynamic));		    fw.write("temp->" + current.getFields()[j].getVariable().getIdent());		    fw.write(Util.networkReceiveSuffix(dynamic, current.getFields()[j].getType()) + "\n");		}	    }	    fw.write("\treturn *temp;\n}\n");	    //create the pop functions that take a pointer argument	    //these are more efficent, we use these when we can	    fw.write("inline void " + RawExecutionCode.structReceivePrefix + network + 		     current.getIdent() + "(" + 		     current.getIdent() + "* temp) {\n");	    for (int j = 0; j < current.getFields().length; j++) {		if (current.getFields()[j].getType().isArrayType()) {		    //assert false;		}		else if (current.getFields()[j].getType().isClassType()) {		    //if this is struct field, call the struct's popPointer method		    fw.write("\t" + RawExecutionCode.structReceivePrefix + network + 			     current.getFields()[j].getType() +			     "(&temp->" + current.getFields()[j].getVariable().getIdent() +			     ");\n");		}		else {		    fw.write("\t" + Util.networkReceivePrefix(dynamic));		    fw.write("temp->" + current.getFields()[j].getVariable().getIdent());		    fw.write(Util.networkReceiveSuffix(dynamic, current.getFields()[j].getType()) + "\n");		}	    }	    fw.write("}\n");	    	    //create the push functions, 	    //for the dynamic network we must create two push functions	    //one that sends a header and one that does not,	    //the one that does not send the header is used by enclosing structs	    //push functions, only one header is sent and it accounts for the 	    //total size of the struct	    for (int funct = 0; funct < 2; funct++) {		//if we are generating a dynamic push function that does not need to send a header		//set this to "Nested"		String dynHeader = "";				//the static network only needs one push method		if (network.equals("Static") && funct == 1)		    break;		//set dynHeader to nested if this is dynamic and 2nd function decl		if (network.equals("Dynamic") && funct == 1)		    dynHeader = "Nested";		fw.write("inline void push" + dynHeader + network + 			 current.getIdent() + "(" + current.getIdent() +			 "* temp) {\n");				if (network.equals("Dynamic") && funct == 0) {		    //we must generate the header for the dynamic network send (not the nested version)		    fw.write(Util.CGNOINTVAR + " = " + FlatIRToC.DYNMSGHEADER + ";\n");		}				for (int j = 0; j < current.getFields().length; j++) {		    //if this field is a struct type, use its method to push the field		    if (current.getFields()[j].getType().isArrayType()) {			//System.out.println(((CArrayType)current.getFields()[j].getType()).getDims()[0]);			//assert false;		    }		    else if (current.getFields()[j].getType().isClassType()) {			//if we have a nested struct in this struct and we are sending the struct			//over the dynamic network, we use the push function of the nested struct that			//does not send over a header, call this function pushNested***			String nested = "";			if (network.equals("Dynamic")) {			    nested = "Nested";			}						fw.write("push" + nested + network + current.getFields()[j].getType() + "(&temp->" +				 current.getFields()[j].getVariable().getIdent() + ");\n");		    }		    else {			fw.write("\t" + Util.networkSendPrefix(dynamic, current.getFields()[j].getType()));			fw.write("temp->" + current.getFields()[j].getVariable().getIdent());			fw.write(Util.networkSendSuffix(dynamic) + ";\n");		    }		}		fw.write("}\n");	    }	    	}    }