* data/bison.m4 (b4_debug_if): New.
* data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
* data/lalr1.java: Use it instead of b4_debug_flag.
* src/getargs.h, src/getargs.c (debug_flag): Remove.
* src/output.c (prepare): Don't output it.
* src/parse-gram.y: Treat %debug as %define debug.
# b4_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT])
+# b4_debug_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([error_verbose])
b4_percent_define_if_define([lex_symbol])
b4_percent_define_if_define([variant])
/* Enabling traces. */
#ifndef YYDEBUG
-# define YYDEBUG ]b4_debug_flag[
+# define YYDEBUG ]b4_debug_if([1], [0])[
#endif
/* Enabling verbose error messages. */
# C++ GLR skeleton for Bison
-# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
-# Inc.
+# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
m4_divert_push(0)
@output(b4_spec_defines_file@)@
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
- [2002, 2003, 2004, 2005, 2006])[
+ [2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009])[
/* C++ GLR parser skeleton written by Akim Demaille. */
/* Enabling traces. */
#ifndef YYDEBUG
-# define YYDEBUG ]b4_debug_flag[
+# define YYDEBUG ]b4_debug_if([1], [0])[
#endif
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
/* Enabling traces. */
#ifndef YYDEBUG
-# define YYDEBUG ]b4_debug_flag[
+# define YYDEBUG ]b4_debug_if([1], [0])[
#endif
/* Enabling verbose error messages. */
# Java skeleton for Bison -*- autoconf -*-
-# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
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])
+
m4_define([b4_symbol_no_destructor_assert],
[b4_symbol_if([$1], [has_destructor],
[b4_fatal([%s: %s: %%destructor does not make sense in Java],
/* Enabling traces. */
#ifndef YYDEBUG
-# define YYDEBUG ]b4_debug_flag[
+# define YYDEBUG ]b4_debug_if([1], [0])[
#endif
/* Enabling verbose error messages. */
#include "muscle_tab.h"
#include "uniqstr.h"
-bool debug_flag;
bool defines_flag;
bool graph_flag;
bool xml_flag;
break;
case 't':
- debug_flag = true;
+ muscle_percent_define_insert ("debug", command_line_location (), "");
break;
case 'v':
/* for -I */
extern char const *include;
-extern bool debug_flag; /* for -t */
extern bool defines_flag; /* for -d */
extern bool graph_flag; /* for -g */
extern bool xml_flag; /* for -x */
use_push_for_pull_flag = true;
/* Flags. */
- MUSCLE_INSERT_BOOL ("debug_flag", debug_flag);
MUSCLE_INSERT_BOOL ("defines_flag", defines_flag);
MUSCLE_INSERT_BOOL ("glr_flag", glr_parser);
MUSCLE_INSERT_BOOL ("locations_flag", locations_flag);
plain_code.code, @1);
code_scanner_last_string_free ();
}
-| "%debug" { debug_flag = true; }
+| "%debug"
+ {
+ muscle_percent_define_insert ("debug", @$, "");
+ }
| "%define" variable content.opt
{
muscle_percent_define_insert ($2, @2, $3);