mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
Add maintainer-push-check to run maintainer-check using push parsing in
place of pull parsing where available. * Makefile.am (maintainer-push-check): New. * data/bison.m4 (b4_use_push_for_pull_if): New. * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if appropriately based on their existing values. (yypush_parse): Don't print push-parser-specific diagnostics if push parsing is being used in place of pull parsing. * data/yacc.c: If push parsing should replace pull parsing, redirect to push.c. * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment variable, and insert b4_use_push_for_pull_flag into muscles. * tests/Makefile.am (maintainer-push-check): New.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
m4_divert(-1) -*- Autoconf -*-
|
||||
|
||||
# Language-independent M4 Macros for Bison.
|
||||
# Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2004, 2005, 2006, 2007 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
|
||||
@@ -130,6 +130,10 @@ b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled.
|
||||
b4_define_flag_if([pull]) # Whether pull parsing is requested.
|
||||
b4_define_flag_if([pure]) # Whether the interface is pure.
|
||||
b4_define_flag_if([push]) # Whether push parsing is requested.
|
||||
b4_define_flag_if([use_push_for_pull]) # Whether push parsing should be used
|
||||
# in place of pull parsing (where
|
||||
# available) for the sake of the test
|
||||
# suite.
|
||||
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||
|
||||
|
||||
|
||||
21
data/push.c
21
data/push.c
@@ -2,8 +2,8 @@ m4_divert(-1) -*- C -*-
|
||||
|
||||
# Yacc compatible skeleton for Bison
|
||||
|
||||
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
# 2007 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,18 @@ m4_divert(-1) -*- C -*-
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
# Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing
|
||||
# tests function as written, don't let BISON_USE_PUSH_FOR_PULL modify Bison's
|
||||
# behavior at all when push parsing is already requested.
|
||||
b4_use_push_for_pull_if([
|
||||
b4_push_if([
|
||||
m4_define([b4_use_push_for_pull_flag], [[0]])
|
||||
b4_define_flag_if([use_push_for_pull])
|
||||
], [
|
||||
m4_define([b4_push_flag], [[1]])
|
||||
b4_define_flag_if([push])
|
||||
])])
|
||||
|
||||
m4_include(b4_pkgdatadir/[c.m4])
|
||||
|
||||
## ---------------- ##
|
||||
@@ -1317,8 +1329,9 @@ yybackup:
|
||||
{
|
||||
]b4_push_if([[ if (!yyps->yynew)
|
||||
{
|
||||
YYDPRINTF ((stderr, "Return for a new token:\n"));
|
||||
yyresult = YYPUSH_MORE;
|
||||
]b4_use_push_for_pull_if([],
|
||||
[[ YYDPRINTF ((stderr, "Return for a new token:\n"));
|
||||
]])[ yyresult = YYPUSH_MORE;
|
||||
goto yypushreturn;
|
||||
}
|
||||
yyps->yynew = 0;
|
||||
|
||||
@@ -2,8 +2,8 @@ m4_divert(-1) -*- C -*-
|
||||
|
||||
# Yacc compatible skeleton for Bison
|
||||
|
||||
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
# 2007 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_divert(-1) -*- C -*-
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
# Handle BISON_USE_PUSH_FOR_PULL for the test suite.
|
||||
b4_use_push_for_pull_if([m4_include(b4_pkgdatadir/[push.c])m4_exit])
|
||||
|
||||
m4_include(b4_pkgdatadir/[c.m4])
|
||||
|
||||
## ---------------- ##
|
||||
|
||||
Reference in New Issue
Block a user