variables: use parse.assert' instead of debug'.

* src/getargs.c (getargs): Map -t to %define trace.parse.
	* src/scan-gram.l (%debug): Map to %define trace.parse.
	* data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
	names to `_' in macro names.
	(b4_debug_if): Replace with...
	(b4_parse_trace_if): this.
	* data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
	* data/yacc.c: Adjust.
	* doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
	Use @code to label the variable list.
	Document the variable parse.trace.
	(Tracing): Promote the parse.trace variable.
	* TODO: %printer is not documented.
This commit is contained in:
Akim Demaille
2009-04-14 06:51:01 +02:00
parent f7dae1ea51
commit fa81950916
11 changed files with 76 additions and 29 deletions

View File

@@ -668,22 +668,23 @@ m4_define([b4_percent_define_default],
# b4_percent_define_if_define(VARIABLE)
# -------------------------------------
# Define b4_VARIABLE_if that executes its $1 or $2 depending whether
# VARIABLE was %defined.
# VARIABLE was %defined. The character `.' in VARIABLE is mapped to `_'.
m4_define([b4_percent_define_if_define_],
[m4_define([b4_$1_if], [b4_percent_define_flag_if([$1], [$2], [$3])])])
[m4_define(m4_bpatsubst([b4_$1_if], [[.]], [_]),
[b4_percent_define_flag_if([$1], [$2], [$3])])])
m4_define([b4_percent_define_if_define],
[b4_percent_define_default([[$1]], [[false]])
b4_percent_define_if_define_([$1], $[1], $[2])])
# b4_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT])
# b4_debug_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT])
# b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT])
# b4_error_verbose_if([IF-ERRORS-ARE-VERBOSE], [IF-NOT])
# b4_lex_symbol_if([IF-YYLEX-RETURNS-A-COMPLETE-SYMBOL], [IF-NOT])
# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT])
# ----------------------------------------------
b4_percent_define_if_define([assert])
b4_percent_define_if_define([debug])
b4_percent_define_if_define([parse.trace])
b4_percent_define_if_define([error_verbose])
b4_percent_define_if_define([lex_symbol])
b4_percent_define_if_define([locations]) # Whether locations are tracked.

View File

@@ -224,7 +224,7 @@ b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG ]b4_debug_if([1], [0])[
# define YYDEBUG ]b4_parse_trace_if([1], [0])[
#endif
/* Enabling verbose error messages. */

View File

@@ -239,7 +239,7 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++],
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG ]b4_debug_if([1], [0])[
# define YYDEBUG ]b4_parse_trace_if([1], [0])[
#endif
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].

View File

@@ -161,7 +161,7 @@ dnl FIXME: This is wrong, we want computed header guards.
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG ]b4_debug_if([1], [0])[
# define YYDEBUG ]b4_parse_trace_if([1], [0])[
#endif
/* Enabling verbose error messages. */

View File

@@ -21,7 +21,7 @@ b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java],
[b4_skeleton])])
# We don't depend on %debug in Java, but pacify warnings about non-used flags.
b4_debug_if([0], [0])
b4_parse_trace_if([0], [0])
m4_define([b4_symbol_no_destructor_assert],
[b4_symbol_if([$1], [has_destructor],

View File

@@ -192,7 +192,7 @@ m4_if(b4_prefix, [yy], [],
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG ]b4_debug_if([1], [0])[
# define YYDEBUG ]b4_parse_trace_if([1], [0])[
#endif
/* Enabling verbose error messages. */