f_print(fout, "};\n"); f_print(fout, "typedef enum %s %s;\n", name, name);
else { if (last == NULL) { f_print (fout, " = %d", count++); } else { f_print (fout, " = %s + %d", last, count++); } } f_print (fout, ",\n"); } f_print (fout, "};\n"); f_print (fout, "typedef enum %s %s;\n", name, name);
penumdef(definition *def){	const char *name = def->def_name;	enumval_list *l;	const char *last = NULL;	int count = 0;	f_print(fout, "enum %s {\n", name);	for (l = def->def.en.vals; l != NULL; l = l->next) {		f_print(fout, "\t%s", l->name);		if (l->assignment) {			f_print(fout, " = %s", l->assignment);			last = l->assignment;			count = 1;		} else {			if (last == NULL) {				f_print(fout, " = %d", count++);			} else {				f_print(fout, " = %s + %d", last, count++);			}		}		f_print(fout, ",\n");	}	f_print(fout, "};\n");	f_print(fout, "typedef enum %s %s;\n", name, name);}