]> git.saurik.com Git - bison.git/commitdiff
* src/getargs.h, src/getargs.c: Swap --report and --trace handling
authorAkim Demaille <akim@epita.fr>
Sun, 9 Jul 2006 15:38:42 +0000 (15:38 +0000)
committerAkim Demaille <akim@epita.fr>
Sun, 9 Jul 2006 15:38:42 +0000 (15:38 +0000)
to be in alphabetical order.
(trace_args): Spelling fixes.

ChangeLog
src/getargs.c
src/getargs.h

index a1823b9dccbd7a4cf888f937588447a15503699c..fb6297732700f14e20310a688a2e03d74918e090 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-07-09  Akim Demaille  <akim@lrde.epita.fr>
+
+       * src/getargs.h, src/getargs.c: Swap --report and --trace handling
+       to be in alphabetical order.
+       (trace_args): Spelling fixes.
+
 2006-07-09  Paul Eggert  <eggert@cs.ucla.edu>
 
        * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
index 0a7f3727bbf8350aa48724479ba5229d9381a040..4b417d59523f8fc4804c3d0a2fb0ec01c476e20f 100644 (file)
@@ -69,6 +69,54 @@ const char *include = NULL;
 extern char *program_name;
 
 
+/*----------------------.
+| --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);
+
+static void
+report_argmatch (char *args)
+{
+  args = strtok (args, ",");
+  do
+    {
+      int report = XARGMATCH ("--report", args,
+                             report_args, report_types);
+      if (report == report_none)
+       report_flag = report_none;
+      else
+       report_flag |= report;
+    }
+  while ((args = strtok (NULL, ",")));
+}
+
+
 /*---------------------.
 | --trace's handling.  |
 `---------------------*/
@@ -77,12 +125,12 @@ 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",
+  "none       - no traces",
   "scan       - grammar scanner traces",
   "parse      - grammar parser traces",
-  "automaton  - contruction of the automaton",
+  "automaton  - construction of the automaton",
   "bitsets    - use of bitsets",
-  "grammar    - reading, reducing of the grammar",
+  "grammar    - reading, reducing the grammar",
   "resource   - memory consumption (where available)",
   "sets       - grammar sets: firsts, nullable etc.",
   "tools      - m4 invocation",
@@ -134,54 +182,6 @@ trace_argmatch (char *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);
-
-static void
-report_argmatch (char *args)
-{
-  args = strtok (args, ",");
-  do
-    {
-      int report = XARGMATCH ("--report", args,
-                             report_args, report_types);
-      if (report == report_none)
-       report_flag = report_none;
-      else
-       report_flag |= report;
-    }
-  while ((args = strtok (NULL, ",")));
-}
-
-
 /*-------------------------------------------.
 | Display the help message and exit STATUS.  |
 `-------------------------------------------*/
index 2d764cba7d684ae03a77717dbe8e6f97e9c10820..7deefa0d046b93dc69e20ef33187d35c75a135fe 100644 (file)
@@ -59,25 +59,6 @@ extern bool pure_parser;
 
 extern bool nondeterministic_parser;
 
-/* --trace.  */
-enum trace
-  {
-    trace_none      = 0,
-    trace_scan      = 1 << 0,
-    trace_parse     = 1 << 1,
-    trace_resource  = 1 << 2,
-    trace_sets      = 1 << 3,
-    trace_bitsets   = 1 << 4,
-    trace_tools     = 1 << 5,
-    trace_automaton = 1 << 6,
-    trace_grammar   = 1 << 7,
-    trace_time      = 1 << 8,
-    trace_skeleton  = 1 << 9,
-    trace_m4        = 1 << 10,
-    trace_all       = ~0
-  };
-extern int trace_flag;
-
 /* --report.  */
 enum report
   {
@@ -88,8 +69,29 @@ enum report
     report_solved_conflicts = 1 << 3,
     report_all              = ~0
   };
+/** What appears in the *.output file.  */
 extern int report_flag;
 
+/* --trace.  */
+enum trace
+  {
+    trace_none      = 0,       /**< No traces. */
+    trace_scan      = 1 << 0,  /**< Grammar scanner traces. */
+    trace_parse     = 1 << 1,  /**< Grammar parser traces. */
+    trace_resource  = 1 << 2,  /**< Memory allocation. */
+    trace_sets      = 1 << 3,  /**< Grammar sets: firsts, nullable etc. */
+    trace_bitsets   = 1 << 4,  /**< Use of bitsets. */
+    trace_tools     = 1 << 5,  /**< m4 invocation. */
+    trace_automaton = 1 << 6,  /**< Construction of the automaton. */
+    trace_grammar   = 1 << 7,  /**< Reading, reducing the grammar. */
+    trace_time      = 1 << 8,  /**< Time consumption. */
+    trace_skeleton  = 1 << 9,  /**< Skeleton postprocessing. */
+    trace_m4        = 1 << 10, /**< M4 traces. */
+    trace_all       = ~0       /**< All of the above.  */
+  };
+/** What debug items bison displays during its run.  */
+extern int trace_flag;
+
 void getargs (int argc, char *argv[]);
 
 #endif /* !GETARGS_H_ */