* src/getargs.h, src/getargs.c (trace_muscle): New.
(trace_types, trace_args): Support it.
* src/output.c (output_skeleton): Use it.
(cherry picked from commit
5263bea9f7d576c20938619af2197eb5b47a90c3)
+2008-11-10 Akim Demaille <demaille@gostai.com>
+
+ --trace=muscles
+ * src/getargs.h, src/getargs.c (trace_muscle): New.
+ (trace_types, trace_args): Support it.
+ * src/output.c (output_skeleton): Use it.
+
2008-11-10 Akim Demaille <demaille@gostai.com>
muscles_output.
2008-11-10 Akim Demaille <demaille@gostai.com>
muscles_output.
"grammar - reading, reducing the grammar",
"resource - memory consumption (where available)",
"sets - grammar sets: firsts, nullable etc.",
"grammar - reading, reducing the grammar",
"resource - memory consumption (where available)",
"sets - grammar sets: firsts, nullable etc.",
+ "muscles - m4 definitions passed to the skeleton",
"tools - m4 invocation",
"m4 - m4 traces",
"skeleton - skeleton postprocessing",
"tools - m4 invocation",
"m4 - m4 traces",
"skeleton - skeleton postprocessing",
trace_grammar,
trace_resource,
trace_sets,
trace_grammar,
trace_resource,
trace_sets,
trace_tools,
trace_m4,
trace_skeleton,
trace_tools,
trace_m4,
trace_skeleton,
trace_time = 1 << 8, /**< Time consumption. */
trace_skeleton = 1 << 9, /**< Skeleton postprocessing. */
trace_m4 = 1 << 10, /**< M4 traces. */
trace_time = 1 << 8, /**< Time consumption. */
trace_skeleton = 1 << 9, /**< Skeleton postprocessing. */
trace_m4 = 1 << 10, /**< M4 traces. */
+ trace_muscles = 1 << 11, /**< M4 definitions of the muscles. */
trace_all = ~0 /**< All of the above. */
};
/** What debug items bison displays during its run. */
trace_all = ~0 /**< All of the above. */
};
/** What debug items bison displays during its run. */
output_skeleton (void)
{
FILE *in;
output_skeleton (void)
{
FILE *in;
int filter_fd[2];
char const *argv[9];
pid_t pid;
int filter_fd[2];
char const *argv[9];
pid_t pid;
free (full_m4bison);
free (full_skeleton);
free (full_m4bison);
free (full_skeleton);
- out = fdopen (filter_fd[0], "w");
- if (! out)
- error (EXIT_FAILURE, get_errno (),
- "fdopen");
- muscles_output (out);
- xfclose (out);
+
+ if (trace_flag & trace_muscles)
+ muscles_output (stderr);
+ {
+ FILE *out = fdopen (filter_fd[0], "w");
+ if (! out)
+ error (EXIT_FAILURE, get_errno (),
+ "fdopen");
+ muscles_output (out);
+ xfclose (out);
+ }
/* Read and process m4's output. */
timevar_push (TV_M4);
/* Read and process m4's output. */
timevar_push (TV_M4);