+
+/*---------------------.
+| --trace's handling. |
+`---------------------*/
+
+static const char * const trace_args[] =
+{
+ /* In a series of synonyms, present the most meaningful first, so
+ that argmatch_valid be more readable. */
+ "none - no report",
+ "automaton - contruction of the automaton",
+ "bitsets - use of bitsets",
+ "grammar - reading, reducing of the grammar",
+ "resource - memory consumption (where available)",
+ "sets - grammar sets: firsts, nullable etc.",
+ "time - time consumption",
+ "tools - m4 invocation and preserve the temporary file",
+ "all - all of the above",
+ 0
+};
+
+static const int trace_types[] =
+{
+ trace_none,
+ trace_automaton,
+ trace_bitsets,
+ trace_grammar,
+ trace_resource,
+ trace_sets,
+ trace_time,
+ trace_tools,
+ trace_all
+};
+
+
+static void
+trace_argmatch (char *args)
+{
+ ARGMATCH_ASSERT (trace_args, trace_types);
+ if (args)
+ {
+ args = strtok (args, ",");
+ do
+ {
+ int trace = XARGMATCH ("--trace", args,
+ trace_args, trace_types);
+ if (trace == trace_none)
+ trace_flag = trace_none;
+ else
+ trace_flag |= trace;
+ }
+ while ((args = strtok (NULL, ",")));
+ }
+ else
+ trace_flag = trace_all;
+}
+
+