Implement --trace=m4.

* src/getargs.c (trace_types, trace_args): Accept trace_m4.
* src/output.c (output_skeleton): When set, pass -dV to m4.
Factor the handling of flags in m4.
* src/output.c (prepare): Rename the muscle names debug, defines,
error_verbose to debug_flag, defines_flag, error_verbose_flag.
* data/c.m4: Adjust.
(_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
Use b4_define_flag_if to define other b4_FLAG_if macros.
(b4_location_if): As a consequence, rename as...
(b4_locations_if): this, for consistency.
Adjust all the skeletons.
This commit is contained in:
Akim Demaille
2006-05-14 20:40:35 +00:00
parent ba9ecd1910
commit 327afc7c84
9 changed files with 153 additions and 126 deletions

View File

@@ -49,7 +49,7 @@ m4_divert(-1) -*- C -*-
# We require a pure interface using locations.
m4_define([b4_location_flag], [1])
m4_define([b4_pure], [1])
m4_define([b4_pure_flag], [1])
m4_include(b4_pkgdatadir/[c++.m4])
m4_include(b4_pkgdatadir/[location.cc])
@@ -80,7 +80,7 @@ m4_define([b4_yy_symbol_print_generate],
b4_parse_param)[
{
]b4_parse_param_use[]dnl
[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_location_if([, yylocationp])[);
[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_locations_if([, yylocationp])[);
}
]])
@@ -243,7 +243,7 @@ b4_syncline([@oline@], [@ofile@])[
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG ]b4_debug[
# define YYDEBUG ]b4_debug_flag[
#endif
/* Enabling verbose error messages. */
@@ -251,7 +251,7 @@ b4_syncline([@oline@], [@ofile@])[
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE ]b4_error_verbose[
# define YYERROR_VERBOSE ]b4_error_verbose_flag[
#endif
/* Enabling the token table. */