mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
Treat %debug as %define debug.
* 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.
This commit is contained in:
@@ -678,11 +678,13 @@ 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_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])
|
||||
|
||||
@@ -224,7 +224,7 @@ b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
|
||||
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG ]b4_debug_flag[
|
||||
# define YYDEBUG ]b4_debug_if([1], [0])[
|
||||
#endif
|
||||
|
||||
/* Enabling verbose error messages. */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 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
|
||||
@@ -215,7 +215,7 @@ m4_popdef([b4_parse_param])
|
||||
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. */
|
||||
|
||||
@@ -239,7 +239,7 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
|
||||
/* 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].
|
||||
|
||||
@@ -161,7 +161,7 @@ dnl FIXME: This is wrong, we want computed header guards.
|
||||
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG ]b4_debug_flag[
|
||||
# define YYDEBUG ]b4_debug_if([1], [0])[
|
||||
#endif
|
||||
|
||||
/* Enabling verbose error messages. */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 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
|
||||
@@ -20,6 +20,9 @@ m4_include(b4_pkgdatadir/[java.m4])
|
||||
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],
|
||||
|
||||
@@ -192,7 +192,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG ]b4_debug_flag[
|
||||
# define YYDEBUG ]b4_debug_if([1], [0])[
|
||||
#endif
|
||||
|
||||
/* Enabling verbose error messages. */
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#include "muscle_tab.h"
|
||||
#include "uniqstr.h"
|
||||
|
||||
bool debug_flag;
|
||||
bool defines_flag;
|
||||
bool graph_flag;
|
||||
bool xml_flag;
|
||||
@@ -618,7 +617,7 @@ getargs (int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 't':
|
||||
debug_flag = true;
|
||||
muscle_percent_define_insert ("debug", command_line_location (), "");
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
|
||||
@@ -35,7 +35,6 @@ extern int skeleton_prio;
|
||||
/* 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 */
|
||||
|
||||
@@ -700,7 +700,6 @@ prepare (void)
|
||||
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);
|
||||
|
||||
@@ -225,7 +225,10 @@ prologue_declaration:
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user