+char *program_name;
+
+
+/** Decode an option's set of keys.
+ *
+ * \param option option being decoded.
+ * \param keys array of valid subarguments.
+ * \param values array of corresponding (int) values.
+ * \param flags the flags to update
+ * \param args colon separated list of effective subarguments to decode.
+ * If 0, then activate all the flags.
+ *
+ * The special value 0 resets the flags to 0.
+ */
+static void
+flags_argmatch (const char *option,
+ const char * const keys[], const int values[],
+ int *flags, char *args)
+{
+ if (args)
+ {
+ args = strtok (args, ",");
+ while (args)
+ {
+ int value = XARGMATCH (option, args, keys, values);
+ if (value == 0)
+ *flags = 0;
+ else
+ *flags |= value;
+ args = strtok (NULL, ",");
+ }
+ }
+ else
+ *flags = ~0;
+}
+
+/** Decode a set of sub arguments.
+ *
+ * \param FlagName the flag familly to update.
+ * \param Args the effective sub arguments to decode.
+ *
+ * \arg FlagName_args the list of keys.
+ * \arg FlagName_types the list of values.
+ * \arg FlagName_flag the flag to update.
+ */
+#define FLAGS_ARGMATCH(FlagName, Args) \
+ flags_argmatch ("--" #FlagName, FlagName ## _args, FlagName ## _types, \
+ &FlagName ## _flag, Args)
+
+
+/*----------------------.
+| --report's handling. |
+`----------------------*/
+
+static const char * const report_args[] =
+{
+ /* In a series of synonyms, present the most meaningful first, so
+ that argmatch_valid be more readable. */
+ "none",
+ "state", "states",
+ "itemset", "itemsets",
+ "lookahead", "lookaheads", "look-ahead",
+ "solved",
+ "all",
+ 0
+};
+
+static const int report_types[] =
+{
+ report_none,
+ report_states, report_states,
+ report_states | report_itemsets, report_states | report_itemsets,
+ report_states | report_lookahead_tokens,
+ report_states | report_lookahead_tokens,
+ report_states | report_lookahead_tokens,
+ report_states | report_solved_conflicts,
+ report_all
+};
+
+ARGMATCH_VERIFY (report_args, report_types);