X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/beda758b1f805686378e7cba5b70216bb7278080..e91ff6ce3d2653b41265591dafd4bdb32ae114c2:/src/muscle_tab.c diff --git a/src/muscle_tab.c b/src/muscle_tab.c index 380a0471..30eb442c 100644 --- a/src/muscle_tab.c +++ b/src/muscle_tab.c @@ -92,3 +92,26 @@ muscle_find (const char *key) muscle_entry_t *result = hash_lookup (muscle_table, &pair); return result ? result->value : NULL; } + + +/* Output the definition of all the current muscles into a list of + m4_defines. */ + +static void +muscle_m4_output (muscle_entry_t *entry, FILE *out) +{ + fprintf (out, "m4_define([b4_%s],\n", entry->key); + fprintf (out, " [[%s]])\n\n\n", entry->value); +} + + +/* Output the definition of all the current muscles into a list of + m4_defines. */ + +void +muscles_m4_output (FILE *out) +{ + hash_do_for_each (muscle_table, + (Hash_processor) muscle_m4_output, + out); +}