fw.write("typedef struct __" + current.getIdent() + " {\n"); for (int j = 0; j < current.getFields().length; j++) { fw.write("\t" + current.getFields()[j].getType() + " " + current.getFields()[j].getVariable().getIdent() + ";\n"); } fw.write("} " + current.getIdent() + ";\n");
fw.write(at.dms.kjc.common.CommonUtils.structToTypedef(current,true)); fw.write("\n");
    private void createStructureDefs(SIRStructure[] structs, FileWriter fw)        throws Exception {        fw.write("#ifndef round\n#define round(x) (floorf((x)+0.5))\n#endif\n");        fw.write("#ifndef roundf\n#define roundf(x) (floorf((x)+0.5))\n#endif\n");        for (int i = 0; i < structs.length; i++) {            SIRStructure current = structs[i];            fw.write("typedef struct __" + current.getIdent() + " {\n");            for (int j = 0; j < current.getFields().length; j++) {                fw.write("\t" + current.getFields()[j].getType() + " "                         + current.getFields()[j].getVariable().getIdent()                         + ";\n");            }            fw.write("} " + current.getIdent() + ";\n");            // write the defs for the push/pop functions            if (!KjcOptions.standalone) {                String network;                for (int x = 0; x < 2; x++) {                    if (x == 0)                        network = "Dynamic";                    else                        network = "Static";                    if (x == 0) {                        // 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                        fw.write("inline void pushNested" + network                                 + current.getIdent() + "(" + current.getIdent()                                 + "*);\n");                    }                    fw.write("inline void push" + network + current.getIdent()                             + "(" + current.getIdent() + "*);\n");                    fw.write("inline " + current.getIdent() + " pop" + network                             + current.getIdent() + "();\n");                    fw.write("inline void "                             + RawExecutionCode.structReceivePrefix + network                             + current.getIdent() + "(" + current.getIdent()                             + "*);\n\n");                }            }        }    }