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 __STRUCTS_H\n");        fw.write("#define __STRUCTS_H\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 && passedTypes.contains(current)) {                fw.write("inline void push" + current.getIdent() + "(" + current.getIdent() +                         "*);\n");                fw.write("inline " + current.getIdent() + " pop" + current.getIdent() + "();\n");                fw.write("inline void " + CommonConstants.structReceiveMethodPrefix +                          current.getIdent() + "(" + current.getIdent() + "*);\n\n");            }        }        /* RMR { moved typedef outside of loop */        // FIXME put in kluge for 'bit'  We do not have bit handling so         // bit is defined here as 'unsigned char'        // Further kluge: until can figure out how to get cluster to expand        // from unsigned byte to integer we just use integer!        //    fw.write("typedef unsigned char bit;\n");        fw.write("typedef int bit;\n");        /* } RMR */        fw.write("#ifndef round\n#define round(x) (floor((x)+0.5))\n#endif\n");        fw.write("#endif // __STRUCTS_H\n");    }