-static const char *if_directive_name PARAMS ((cpp_reader *,
- struct if_stack *));
-
-/* Here is the actual list of #-directives.
- This table is ordered by frequency of occurrence; the numbers
- at the end are directive counts from all the source code I have
- lying around (egcs and libc CVS as of 1999-05-18, plus grub-0.5.91,
- linux-2.2.9, and pcmcia-cs-3.0.9). */
-
-static const struct directive directive_table[] = {
- /* In C89 */
- { 6, do_define, "define", T_DEFINE }, /* 270554 */
- { 7, do_include, "include", T_INCLUDE }, /* 52262 */
- { 5, do_endif, "endif", T_ENDIF }, /* 45855 */
- { 5, do_ifdef, "ifdef", T_IFDEF }, /* 22000 */
- { 2, do_if, "if", T_IF }, /* 18162 */
- { 4, do_else, "else", T_ELSE }, /* 9863 */
- { 6, do_ifdef, "ifndef", T_IFNDEF }, /* 9675 */
- { 5, do_undef, "undef", T_UNDEF }, /* 4837 */
- { 4, do_line, "line", T_LINE }, /* 2465 */
- { 4, do_elif, "elif", T_ELIF }, /* 610 */
- { 5, do_error, "error", T_ERROR }, /* 475 */
- { 6, do_pragma, "pragma", T_PRAGMA }, /* 195 */
-
- /* Extensions. All deprecated except #warning and #include_next. */
- { 7, do_warning, "warning", T_WARNING }, /* 22 - GNU */
- { 12, do_include, "include_next", T_INCLUDE_NEXT }, /* 19 - GNU */
- { 5, do_ident, "ident", T_IDENT }, /* 11 - SVR4 */
- { 6, do_include, "import", T_IMPORT }, /* 0 - ObjC */
- { 6, do_assert, "assert", T_ASSERT }, /* 0 - SVR4 */
- { 8, do_unassert, "unassert", T_UNASSERT }, /* 0 - SVR4 */
-#ifdef SCCS_DIRECTIVE
- { 4, do_sccs, "sccs", T_SCCS }, /* 0 - SVR2? */
-#endif
- { -1, 0, "", T_UNUSED }
+
+/* This is the table of directive handlers. It is ordered by
+ frequency of occurrence; the numbers at the end are directive
+ counts from all the source code I have lying around (egcs and libc
+ CVS as of 1999-05-18, plus grub-0.5.91, linux-2.2.9, and
+ pcmcia-cs-3.0.9).
+
+ The entries with a dash and a name after the count are extensions,
+ of which all but #warning and #include_next are deprecated. The name
+ is where the extension appears to have come from. */
+
+#define DIRECTIVE_TABLE \
+D("define", do_define, T_DEFINE) /* 270554 */ \
+D("include", do_include, T_INCLUDE) /* 52262 */ \
+D("endif", do_endif, T_ENDIF) /* 45855 */ \
+D("ifdef", do_ifdef, T_IFDEF) /* 22000 */ \
+D("if", do_if, T_IF) /* 18162 */ \
+D("else", do_else, T_ELSE) /* 9863 */ \
+D("ifndef", do_ifndef, T_IFNDEF) /* 9675 */ \
+D("undef", do_undef, T_UNDEF) /* 4837 */ \
+D("line", do_line, T_LINE) /* 2465 */ \
+D("elif", do_elif, T_ELIF) /* 610 */ \
+D("error", do_error, T_ERROR) /* 475 */ \
+D("pragma", do_pragma, T_PRAGMA) /* 195 */ \
+D("warning", do_warning, T_WARNING) /* 22 - GNU */ \
+D("include_next", do_include_next, T_INCLUDE_NEXT) /* 19 - GNU */ \
+D("ident", do_ident, T_IDENT) /* 11 - SVR4 */ \
+D("import", do_import, T_IMPORT) /* 0 - ObjC */ \
+D("assert", do_assert, T_ASSERT) /* 0 - SVR4 */ \
+D("unassert", do_unassert, T_UNASSERT) /* 0 - SVR4 */ \
+D("sccs", do_sccs, T_SCCS) /* 0 - SVR2? */
+
+/* Use the table to generate a series of prototypes, an enum for the
+ directive names, and an array of directive handlers. */
+
+/* The directive-processing functions are declared to return int
+ instead of void, because some old compilers have trouble with
+ pointers to functions returning void. */
+
+#define D(name, fun, tag) static int fun PARAMS ((cpp_reader *));
+DIRECTIVE_TABLE
+#undef D
+
+#define D(name, fun, tag) tag,
+enum
+{
+ DIRECTIVE_TABLE
+ N_DIRECTIVES