mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-09 18:55:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0535d2a608 | ||
|
|
52ce2a008b | ||
|
|
12f4091de4 | ||
|
|
8ece778cb8 | ||
|
|
f80890c4bb | ||
|
|
1ebc2ac55c | ||
|
|
94952779b6 | ||
|
|
4d9fa28ba8 | ||
|
|
a100a3c4c1 | ||
|
|
b18ceb50f1 | ||
|
|
ff4d67ede8 | ||
|
|
465babb635 | ||
|
|
6a28e6d412 | ||
|
|
f4495da337 | ||
|
|
dbaed0bbf2 | ||
|
|
78c7fb6460 | ||
|
|
da29809969 | ||
|
|
87e4895189 | ||
|
|
01e3f45f83 | ||
|
|
091943f265 | ||
|
|
bf98d94f4f | ||
|
|
6bb37dbe27 | ||
|
|
c3585f41ef | ||
|
|
6525abdc83 | ||
|
|
2b63c54f5a | ||
|
|
2da399d15f | ||
|
|
0c77d69721 |
+1
-1
@@ -1 +1 @@
|
||||
3.5.94
|
||||
3.6.2
|
||||
|
||||
+58
-40
@@ -46,7 +46,7 @@ jobs:
|
||||
- ./bootstrap
|
||||
- ./configure --enable-gcc-warnings || { cat config.log && false; }
|
||||
- make -j2
|
||||
- make -j2 dist
|
||||
- make -j2 dist-xz
|
||||
# Can help understanding why we get "dirty" tarballs.
|
||||
- git status
|
||||
- dist=$(echo bison*.xz)
|
||||
@@ -69,53 +69,53 @@ jobs:
|
||||
|
||||
# Start with three completely different environments, to get errors asap.
|
||||
|
||||
- name: "GCC 9 -O3"
|
||||
- name: "GCC 10 -O3"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons: &gcc9
|
||||
addons: &gcc10
|
||||
apt:
|
||||
sources:
|
||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
packages: g++-9
|
||||
packages: g++-10
|
||||
env:
|
||||
- CC=gcc-9
|
||||
- CXX=g++-9
|
||||
- CC=gcc-10
|
||||
- CXX=g++-10
|
||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||
|
||||
# ASAN is time consuming, and we timeout the 50min granted by
|
||||
# Travis if we run all the tests in one go. Run in two parts.
|
||||
- name: "Clang 9 libc++ and ASAN part 1"
|
||||
- name: "Clang 10 libc++ and ASAN part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons: &clang9
|
||||
addons: &clang10
|
||||
apt:
|
||||
sources:
|
||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
|
||||
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
packages:
|
||||
- clang-9
|
||||
- libc++-9-dev
|
||||
- libc++abi-9-dev
|
||||
- clang-10
|
||||
- libc++-10-dev
|
||||
- libc++abi-10-dev
|
||||
env:
|
||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||
- CC='clang-9 -fsanitize=address'
|
||||
- CXX='clang++-9 -fsanitize=address -stdlib=libc++'
|
||||
- CC='clang-10 -fsanitize=address'
|
||||
- CXX='clang++-10 -fsanitize=address -stdlib=libc++'
|
||||
- PART=1
|
||||
|
||||
- name: "Clang 9 libc++ and ASAN part 2"
|
||||
- name: "Clang 10 libc++ and ASAN part 2"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons: *clang9
|
||||
addons: *clang10
|
||||
env:
|
||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||
- CC='clang-9 -fsanitize=address'
|
||||
- CXX='clang++-9 -fsanitize=address -stdlib=libc++'
|
||||
- CC='clang-10 -fsanitize=address'
|
||||
- CXX='clang++-10 -fsanitize=address -stdlib=libc++'
|
||||
- PART=2
|
||||
|
||||
- name: "ICC"
|
||||
@@ -135,46 +135,41 @@ jobs:
|
||||
packages:
|
||||
- intel-oneapi-icc
|
||||
|
||||
## ------- ##
|
||||
## First. ##
|
||||
## ------- ##
|
||||
|
||||
# Start with three completely different environments, to get
|
||||
# errors asap.
|
||||
|
||||
- name: "ARM64: GCC 9 -O3 part 1"
|
||||
- name: "ARM64: GCC 10 -O3 part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
arch: arm64
|
||||
dist: bionic
|
||||
addons: *gcc9
|
||||
addons: *gcc10
|
||||
env:
|
||||
- CC=gcc-9
|
||||
- CXX=g++-9
|
||||
- CC=gcc-10
|
||||
- CXX=g++-10
|
||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||
- PART=1
|
||||
|
||||
# GCC10 on PPC seems to be buggy.
|
||||
# E.g., https://travis-ci.org/github/akimd/bison/jobs/687812428.
|
||||
- name: "PPC64le: GCC 9 part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
arch: ppc64le
|
||||
dist: bionic
|
||||
addons: *gcc9
|
||||
addons: *gcc10
|
||||
env:
|
||||
- CC=gcc-9
|
||||
- CXX=g++-9
|
||||
- CONFIGUREFLAGS='CFLAGS=-O3 CXXFLAGS=-O3'
|
||||
- PART=1
|
||||
|
||||
- name: "s390x: GCC 9 part 1"
|
||||
- name: "s390x: GCC 10 part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
arch: s390x
|
||||
dist: bionic
|
||||
addons: *gcc9
|
||||
addons: *gcc10
|
||||
env:
|
||||
- CC=gcc-9
|
||||
- CXX=g++-9
|
||||
- CC=gcc-10
|
||||
- CXX=g++-10
|
||||
- CONFIGUREFLAGS='CFLAGS=-O3 CXXFLAGS=-O3'
|
||||
- PART=1
|
||||
|
||||
@@ -182,15 +177,19 @@ jobs:
|
||||
## GCC. ##
|
||||
## ----- ##
|
||||
|
||||
- name: "GCC 8 with sanitizers part 1"
|
||||
- name: "GCC 9 with sanitizers part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
packages: g++-8
|
||||
sources:
|
||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
packages: g++-9
|
||||
env:
|
||||
- CC='gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
||||
- CXX='g++-8 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
||||
- CC='gcc-9 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
||||
- CXX='g++-9 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
||||
- CONFIGUREFLAGS='CFLAGS=-O1 CXXFLAGS=-O1'
|
||||
- PART=1
|
||||
|
||||
@@ -292,7 +291,27 @@ jobs:
|
||||
## Clang. ##
|
||||
## ------- ##
|
||||
|
||||
- name: "Clang 8 -O3"
|
||||
- name: "Clang 9 -O3"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
packages:
|
||||
- clang-9
|
||||
- libc++-9-dev
|
||||
- libc++abi-9-dev
|
||||
env:
|
||||
- CC='clang-9'
|
||||
- CXX='clang++-9 -stdlib=libc++'
|
||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||
|
||||
- name: "Clang 8"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
@@ -305,7 +324,6 @@ jobs:
|
||||
env:
|
||||
- CC=clang-8
|
||||
- CXX='clang++-8 -stdlib=libc++'
|
||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||
|
||||
- name: "Clang 7"
|
||||
stage: check
|
||||
|
||||
@@ -127,3 +127,7 @@ gen-ChangeLog:
|
||||
--since=$(gen_start_date) > $$cl.tmp && \
|
||||
mv -f $$cl.tmp $$cl; \
|
||||
fi
|
||||
|
||||
# Useful to debug.
|
||||
.c.i:
|
||||
$(CC) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -o $@ -E $<
|
||||
|
||||
@@ -1,5 +1,41 @@
|
||||
GNU Bison NEWS
|
||||
|
||||
* Noteworthy changes in release 3.6.3 (2020-06-03) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Incorrect comments in the generated parsers.
|
||||
|
||||
Warnings in push parsers (yacc.c).
|
||||
|
||||
Incorrect display of gotos in LAC traces (lalr1.cc).
|
||||
|
||||
* Noteworthy changes in release 3.6.2 (2020-05-17) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Some tests were fixed.
|
||||
|
||||
When token aliases contain comment delimiters:
|
||||
|
||||
%token FOO "/* foo */"
|
||||
|
||||
bison used to emit "nested" comments, which is invalid C.
|
||||
|
||||
* Noteworthy changes in release 3.6.1 (2020-05-10) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Restored ANSI-C compliance in yacc.c.
|
||||
|
||||
GNU readline portability issues.
|
||||
|
||||
In C++, yy::parser::symbol_name is now a public member, as was intended.
|
||||
|
||||
** New features
|
||||
|
||||
In C++, yy::parser::symbol_type now has a public name() member function.
|
||||
|
||||
* Noteworthy changes in release 3.6 (2020-05-08) [stable]
|
||||
|
||||
** Backward incompatible changes
|
||||
|
||||
@@ -162,6 +162,7 @@ Quoc Peyrot [email protected]
|
||||
R Blake [email protected]
|
||||
Raja R Harinath [email protected]
|
||||
Ralf Wildenhues [email protected]
|
||||
Ryan [email protected]
|
||||
Rich Wilson [email protected]
|
||||
Richard Stallman [email protected]
|
||||
Rici Lake [email protected]
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
* Bison 3.6
|
||||
* Bison 3.7
|
||||
** Bistromathic
|
||||
- Hitting tab on a line with a syntax error is ugly
|
||||
|
||||
- Be robust to existing ~/.inputrc
|
||||
|
||||
- How about not evaluating incomplete lines when the text is not finished
|
||||
(as shells do).
|
||||
|
||||
** Doc
|
||||
*** api.header.include
|
||||
|
||||
@@ -31,7 +39,6 @@ enough.
|
||||
*** calc.at
|
||||
Stop hard-coding "Calc". Adjust local.at (look for FIXME).
|
||||
|
||||
* Bison 3.7
|
||||
** Counter example generation
|
||||
See https://github.com/akimd/bison/pull/15.
|
||||
|
||||
@@ -121,6 +128,25 @@ Rici:
|
||||
> At a minimum, the fact that yyclearin does not invoke the %destructor
|
||||
> should be highlighted in the documentation, since it is not at all obvious.
|
||||
|
||||
** Issues in i18n
|
||||
|
||||
Les catégories d'avertissements incluent :
|
||||
conflicts-sr conflits S/R (activé par défaut)
|
||||
conflicts-rr conflits R/R (activé par défaut)
|
||||
dangling-alias l'alias chaîne n'est pas attaché à un symbole
|
||||
deprecated construction obsolète
|
||||
empty-rule règle vide sans %empty
|
||||
midrule-values valeurs de règle intermédiaire non définies ou inutilisées
|
||||
precedence priorité et associativité inutiles
|
||||
yacc incompatibilités avec POSIX Yacc
|
||||
other tous les autres avertissements (activé par défaut)
|
||||
all tous les avertissements sauf « dangling-alias » et « yacc »
|
||||
no-CATEGORY désactiver les avertissements dans CATEGORIE
|
||||
none désactiver tous les avertissements
|
||||
error[=CATEGORY] traiter les avertissements comme des erreurs
|
||||
|
||||
Line -1 and -3 should mention CATEGORIE, not CATEGORY.
|
||||
|
||||
* Bison 3.8
|
||||
** Unit rules / Injection rules (Akim Demaille)
|
||||
Maybe we could expand unit rules (or "injections", see
|
||||
|
||||
@@ -73,6 +73,11 @@ def diff_to_re(match):
|
||||
is_diff = True
|
||||
to.append(l)
|
||||
if is_diff:
|
||||
# Do not run s//SOMETHING/g (with an emty pattern), that won't
|
||||
# work well...
|
||||
if frm == []:
|
||||
trace("no from for", match.group(1))
|
||||
return
|
||||
frm = "\n".join(frm)
|
||||
to = "\n".join(to)
|
||||
subst[frm] = to
|
||||
@@ -112,4 +117,6 @@ def process(logfile):
|
||||
|
||||
for logfile in args.logs:
|
||||
trace("FILE:", logfile)
|
||||
if os.path.isdir(logfile):
|
||||
logfile = os.path.join(logfile, 'testsuite.log')
|
||||
process(logfile)
|
||||
|
||||
@@ -51,7 +51,7 @@ gnulib_dir = $(srcdir)/gnulib
|
||||
bootstrap-tools = autoconf,automake,flex,gettext,gnulib
|
||||
|
||||
announcement_Cc_ = \
|
||||
[email protected], [email protected], bison-patches@gnu.org, \
|
||||
[email protected], bison-announce@gnu.org, \
|
||||
[email protected]
|
||||
|
||||
update-copyright: update-b4-copyright update-package-copyright-year
|
||||
|
||||
+5
-5
@@ -36,10 +36,8 @@ AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# We use Automake 1.14's %D% and %C%.
|
||||
#
|
||||
# When we move to Automake 1.16, simplify examples/c/reccalc/local.mk.
|
||||
# Our CI runs on Xenial, which has only Automake 1.15.
|
||||
# Our CI build the packages on Bionic, which has only Automake 1.15.
|
||||
#
|
||||
# We want gnits strictness only when rolling a stable release. For
|
||||
# release candidates, we use version strings like 2.4.3_rc1, but gnits
|
||||
@@ -47,7 +45,7 @@ AC_CONFIG_MACRO_DIR([m4])
|
||||
# releases, we want to be able run make dist without being required to
|
||||
# add a bogus NEWS entry. In that case, the version string
|
||||
# automatically contains a dash, which we also let disable gnits.
|
||||
AM_INIT_AUTOMAKE([1.14 dist-xz nostdinc
|
||||
AM_INIT_AUTOMAKE([1.15 dist-lzip dist-xz nostdinc
|
||||
color-tests parallel-tests
|
||||
silent-rules]
|
||||
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]],
|
||||
@@ -137,7 +135,9 @@ if test "$enable_gcc_warnings" = yes; then
|
||||
-Wpointer-arith -Wshadow
|
||||
-Wwrite-strings
|
||||
-wr188 -wr2259 -wr3179'
|
||||
warn_c='-Wbad-function-cast -Wstrict-prototypes'
|
||||
warn_c='-Wbad-function-cast
|
||||
-Wmissing-prototypes
|
||||
-Wstrict-prototypes'
|
||||
warn_cxx='-Wextra-semi -Wnoexcept -Wold-style-cast -Wundefined-func-template
|
||||
-Wweak-vtables'
|
||||
# Warnings for the test suite only.
|
||||
|
||||
@@ -34,6 +34,7 @@ dist_skeletons_DATA = \
|
||||
data/skeletons/lalr1.java \
|
||||
data/skeletons/location.cc \
|
||||
data/skeletons/stack.hh \
|
||||
data/skeletons/traceon.m4 \
|
||||
data/skeletons/variant.hh \
|
||||
data/skeletons/yacc.c
|
||||
|
||||
|
||||
@@ -19,6 +19,27 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
# m4_gsub(STRING, RE1, SUBST1, RE2, SUBST2, ...)
|
||||
# ----------------------------------------------
|
||||
# m4 equivalent of
|
||||
#
|
||||
# $_ = STRING;
|
||||
# s/RE1/SUBST1/g;
|
||||
# s/RE2/SUBST2/g;
|
||||
# ...
|
||||
#
|
||||
# Really similar to m4_bpatsubsts, but behaves properly with quotes.
|
||||
# See m4.at's "Generating Comments". Super inelegant, but so far, I
|
||||
# did not find any better solution.
|
||||
m4_define([b4_gsub],
|
||||
[m4_bpatsubst(m4_bpatsubst(m4_bpatsubst([[[[$1]]]],
|
||||
[$2], [$3]),
|
||||
[$4], [$5]),
|
||||
[$6], [$7])])
|
||||
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Identification. ##
|
||||
## ---------------- ##
|
||||
|
||||
@@ -357,6 +357,29 @@ m4_define([b4_symbol_type_define],
|
||||
Base::clear ();
|
||||
}
|
||||
|
||||
]b4_parse_error_bmatch(
|
||||
[custom\|detailed],
|
||||
[[ /// The user-facing name of this symbol.
|
||||
const char *name () const YY_NOEXCEPT
|
||||
{
|
||||
return ]b4_parser_class[::symbol_name (this->kind ());
|
||||
}]],
|
||||
[simple],
|
||||
[[#if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
/// The user-facing name of this symbol.
|
||||
const char *name () const YY_NOEXCEPT
|
||||
{
|
||||
return ]b4_parser_class[::symbol_name (this->kind ());
|
||||
}
|
||||
#endif // #if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
]],
|
||||
[verbose],
|
||||
[[ /// The user-facing name of this symbol.
|
||||
std::string name () const YY_NOEXCEPT
|
||||
{
|
||||
return ]b4_parser_class[::symbol_name (this->kind ());
|
||||
}]])[
|
||||
|
||||
/// Backward compatibility (Bison 3.6).
|
||||
symbol_kind_type type_get () const YY_NOEXCEPT;
|
||||
|
||||
|
||||
@@ -17,15 +17,21 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# _b4_comment(TEXT, OPEN, CONTINUE, END)
|
||||
# --------------------------------------
|
||||
# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines.
|
||||
# Avoid adding indentation to the first line, as the indentation comes
|
||||
# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]).
|
||||
# Turn "*/" in TEXT into "* /" so that we don't unexpectedly close
|
||||
# the comments before its end.
|
||||
#
|
||||
# Prefix all the output lines with PREFIX.
|
||||
m4_define([_b4_comment],
|
||||
[$2[]m4_bpatsubst(m4_expand([[$1]]), [
|
||||
[$2[]b4_gsub(m4_expand([$1]),
|
||||
[[*]/], [*\\/],
|
||||
[/[*]], [/\\*],
|
||||
[
|
||||
\(.\)], [
|
||||
$3\1])$4])
|
||||
|
||||
|
||||
+100
-93
@@ -241,6 +241,23 @@ m4_define([b4_shared_declarations],
|
||||
/// Report a syntax error.
|
||||
void error (const syntax_error& err);
|
||||
|
||||
]b4_parse_error_bmatch(
|
||||
[custom\|detailed],
|
||||
[[ /// The user-facing name of the symbol whose (internal) number is
|
||||
/// YYSYMBOL. No bounds checking.
|
||||
static const char *symbol_name (symbol_kind_type yysymbol);]],
|
||||
[simple],
|
||||
[[#if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
/// The user-facing name of the symbol whose (internal) number is
|
||||
/// YYSYMBOL. No bounds checking.
|
||||
static const char *symbol_name (symbol_kind_type yysymbol);
|
||||
#endif // #if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
]],
|
||||
[verbose],
|
||||
[[ /// The user-facing name of the symbol whose (internal) number is
|
||||
/// YYSYMBOL. No bounds checking.
|
||||
static std::string symbol_name (symbol_kind_type yysymbol);]])[
|
||||
|
||||
]b4_token_constructor_define[
|
||||
]b4_parse_error_bmatch([custom\|detailed\|verbose], [[
|
||||
class context
|
||||
@@ -317,26 +334,14 @@ m4_define([b4_shared_declarations],
|
||||
static symbol_kind_type yytranslate_ (int t);
|
||||
|
||||
]b4_parse_error_bmatch(
|
||||
[custom\|detailed],
|
||||
[[ /// The user-facing name of the symbol whose (internal) number is
|
||||
/// YYSYMBOL. No bounds checking.
|
||||
static const char *symbol_name (symbol_kind_type yysymbol);]],
|
||||
[simple],
|
||||
[[#if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
/// The user-facing name of the symbol whose (internal) number is
|
||||
/// YYSYMBOL. No bounds checking.
|
||||
static const char *symbol_name (symbol_kind_type yysymbol);
|
||||
|
||||
/// For a symbol, its name in clear.
|
||||
static const char* const yytname_[];
|
||||
#endif // #if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
]],
|
||||
[verbose],
|
||||
[[ /// The user-facing name of the symbol whose (internal) number is
|
||||
/// YYSYMBOL. No bounds checking.
|
||||
static std::string symbol_name (symbol_kind_type yysymbol);
|
||||
|
||||
/// Convert the symbol name \a n to a form suitable for a diagnostic.
|
||||
[[ /// Convert the symbol name \a n to a form suitable for a diagnostic.
|
||||
static std::string yytnamerr_ (const char *yystr);
|
||||
|
||||
/// For a symbol, its name in clear.
|
||||
@@ -474,6 +479,7 @@ m4_define([b4_shared_declarations],
|
||||
};
|
||||
|
||||
]b4_parse_param_vars[
|
||||
]b4_percent_code_get([[yy_bison_internal_hook]])[
|
||||
};
|
||||
|
||||
]b4_token_ctor_if([b4_yytranslate_define([$1])[
|
||||
@@ -607,83 +613,6 @@ m4_if(b4_prefix, [yy], [],
|
||||
#define YYRECOVERING() (!!yyerrstatus_)
|
||||
|
||||
]b4_namespace_open[
|
||||
]b4_parse_error_bmatch([custom\|detailed],
|
||||
[[ const char *
|
||||
]b4_parser_class[::symbol_name (symbol_kind_type yysymbol)
|
||||
{
|
||||
static const char *const yy_sname[] =
|
||||
{
|
||||
]b4_symbol_names[
|
||||
};]b4_has_translations_if([[
|
||||
/* YYTRANSLATABLE[SYMBOL-NUM] -- Whether YY_SNAME[SYMBOL-NUM] is
|
||||
internationalizable. */
|
||||
static ]b4_int_type_for([b4_translatable])[ yytranslatable[] =
|
||||
{
|
||||
]b4_translatable[
|
||||
};
|
||||
return (yysymbol < YYNTOKENS && yytranslatable[yysymbol]
|
||||
? _(yy_sname[yysymbol])
|
||||
: yy_sname[yysymbol]);]], [[
|
||||
return yy_sname[yysymbol];]])[
|
||||
}
|
||||
]],
|
||||
[simple],
|
||||
[[#if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
const char *
|
||||
]b4_parser_class[::symbol_name (symbol_kind_type yysymbol)
|
||||
{
|
||||
return yytname_[yysymbol];
|
||||
}
|
||||
#endif // #if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
]],
|
||||
[verbose],
|
||||
[[ /* Return YYSTR after stripping away unnecessary quotes and
|
||||
backslashes, so that it's suitable for yyerror. The heuristic is
|
||||
that double-quoting is unnecessary unless the string contains an
|
||||
apostrophe, a comma, or backslash (other than backslash-backslash).
|
||||
YYSTR is taken from yytname. */
|
||||
std::string
|
||||
]b4_parser_class[::yytnamerr_ (const char *yystr)
|
||||
{
|
||||
if (*yystr == '"')
|
||||
{
|
||||
std::string yyr;
|
||||
char const *yyp = yystr;
|
||||
|
||||
for (;;)
|
||||
switch (*++yyp)
|
||||
{
|
||||
case '\'':
|
||||
case ',':
|
||||
goto do_not_strip_quotes;
|
||||
|
||||
case '\\':
|
||||
if (*++yyp != '\\')
|
||||
goto do_not_strip_quotes;
|
||||
else
|
||||
goto append;
|
||||
|
||||
append:
|
||||
default:
|
||||
yyr += *yyp;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
return yyr;
|
||||
}
|
||||
do_not_strip_quotes: ;
|
||||
}
|
||||
|
||||
return yystr;
|
||||
}
|
||||
|
||||
std::string
|
||||
]b4_parser_class[::symbol_name (symbol_kind_type yysymbol)
|
||||
{
|
||||
return yytnamerr_ (yytname_[yysymbol]);
|
||||
}
|
||||
]])[
|
||||
|
||||
/// Build a parser object.
|
||||
]b4_parser_class::b4_parser_class[ (]b4_parse_param_decl[)
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
@@ -815,7 +744,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
{
|
||||
symbol_kind_type yykind = yysym.kind ();
|
||||
yyo << (yykind < YYNTOKENS ? "token" : "nterm")
|
||||
<< ' ' << symbol_name (yykind) << " ("]b4_locations_if([
|
||||
<< ' ' << yysym.name () << " ("]b4_locations_if([
|
||||
<< yysym.location << ": "])[;
|
||||
]b4_symbol_actions([printer])[
|
||||
yyo << ')';
|
||||
@@ -1267,8 +1196,86 @@ b4_dollar_popdef])[]dnl
|
||||
{
|
||||
error (]b4_join(b4_locations_if([yyexc.location]),
|
||||
[[yyexc.what ()]])[);
|
||||
}]b4_parse_error_bmatch([custom\|detailed\|verbose], [[
|
||||
}
|
||||
|
||||
]b4_parse_error_bmatch([custom\|detailed],
|
||||
[[ const char *
|
||||
]b4_parser_class[::symbol_name (symbol_kind_type yysymbol)
|
||||
{
|
||||
static const char *const yy_sname[] =
|
||||
{
|
||||
]b4_symbol_names[
|
||||
};]b4_has_translations_if([[
|
||||
/* YYTRANSLATABLE[SYMBOL-NUM] -- Whether YY_SNAME[SYMBOL-NUM] is
|
||||
internationalizable. */
|
||||
static ]b4_int_type_for([b4_translatable])[ yytranslatable[] =
|
||||
{
|
||||
]b4_translatable[
|
||||
};
|
||||
return (yysymbol < YYNTOKENS && yytranslatable[yysymbol]
|
||||
? _(yy_sname[yysymbol])
|
||||
: yy_sname[yysymbol]);]], [[
|
||||
return yy_sname[yysymbol];]])[
|
||||
}
|
||||
]],
|
||||
[simple],
|
||||
[[#if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
const char *
|
||||
]b4_parser_class[::symbol_name (symbol_kind_type yysymbol)
|
||||
{
|
||||
return yytname_[yysymbol];
|
||||
}
|
||||
#endif // #if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
]],
|
||||
[verbose],
|
||||
[[ /* Return YYSTR after stripping away unnecessary quotes and
|
||||
backslashes, so that it's suitable for yyerror. The heuristic is
|
||||
that double-quoting is unnecessary unless the string contains an
|
||||
apostrophe, a comma, or backslash (other than backslash-backslash).
|
||||
YYSTR is taken from yytname. */
|
||||
std::string
|
||||
]b4_parser_class[::yytnamerr_ (const char *yystr)
|
||||
{
|
||||
if (*yystr == '"')
|
||||
{
|
||||
std::string yyr;
|
||||
char const *yyp = yystr;
|
||||
|
||||
for (;;)
|
||||
switch (*++yyp)
|
||||
{
|
||||
case '\'':
|
||||
case ',':
|
||||
goto do_not_strip_quotes;
|
||||
|
||||
case '\\':
|
||||
if (*++yyp != '\\')
|
||||
goto do_not_strip_quotes;
|
||||
else
|
||||
goto append;
|
||||
|
||||
append:
|
||||
default:
|
||||
yyr += *yyp;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
return yyr;
|
||||
}
|
||||
do_not_strip_quotes: ;
|
||||
}
|
||||
|
||||
return yystr;
|
||||
}
|
||||
|
||||
std::string
|
||||
]b4_parser_class[::symbol_name (symbol_kind_type yysymbol)
|
||||
{
|
||||
return yytnamerr_ (yytname_[yysymbol]);
|
||||
}
|
||||
]])[
|
||||
|
||||
]b4_parse_error_bmatch([custom\|detailed\|verbose], [[
|
||||
// ]b4_parser_class[::context.
|
||||
]b4_parser_class[::context::context (const ]b4_parser_class[& yyparser, const symbol_type& yyla)
|
||||
: yyparser_ (yyparser)
|
||||
@@ -1404,7 +1411,7 @@ b4_dollar_popdef])[]dnl
|
||||
: yylac_stack_.back ());
|
||||
// Push the resulting state of the reduction.
|
||||
state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]);
|
||||
YYCDEBUG << " G" << state;
|
||||
YYCDEBUG << " G" << int (state);
|
||||
yylac_stack_.push_back (state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
dnl GNU M4 treats -dV in a position-independent manner.
|
||||
m4_debugmode(V)m4_traceon()dnl
|
||||
@@ -1480,7 +1480,7 @@ yypull_parse (yypstate *yyps]b4_user_formals[)
|
||||
]b4_parse_state_variable_macros([b4_pstate_macro_define])[
|
||||
|
||||
/* Initialize the parser data structure. */
|
||||
void
|
||||
static void
|
||||
yypstate_clear (yypstate *yyps)
|
||||
{
|
||||
]b4_initialize_parser_state_variables[
|
||||
@@ -1979,7 +1979,7 @@ yyerrorlab:
|
||||
yyerrlab1:
|
||||
yyerrstatus = 3; /* Each real token shifted decrements this. */
|
||||
|
||||
// Pop stack until we find a state that shifts the error token.
|
||||
/* Pop stack until we find a state that shifts the error token. */
|
||||
for (;;)
|
||||
{
|
||||
yyn = yypact[yystate];
|
||||
|
||||
+17
-5
@@ -1879,6 +1879,7 @@ Here is the code for the lexical analyzer:
|
||||
and tabs, and returns 0 for end-of-input. */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
@end group
|
||||
|
||||
@group
|
||||
@@ -1895,7 +1896,8 @@ yylex (void)
|
||||
if (c == '.' || isdigit (c))
|
||||
@{
|
||||
ungetc (c, stdin);
|
||||
scanf ("%lf", &yylval);
|
||||
if (scanf ("%lf", &yylval) != 1)
|
||||
abort ();
|
||||
return NUM;
|
||||
@}
|
||||
@end group
|
||||
@@ -2728,7 +2730,8 @@ yylex (void)
|
||||
if (c == '.' || isdigit (c))
|
||||
@{
|
||||
ungetc (c, stdin);
|
||||
scanf ("%lf", &yylval.NUM);
|
||||
if (scanf ("%lf", &yylval.NUM) != 1)
|
||||
abort ();
|
||||
return NUM;
|
||||
@}
|
||||
@end group
|
||||
@@ -2755,10 +2758,10 @@ Bison generated a definition of @code{YYSTYPE} with a member named
|
||||
if (bufsize <= i)
|
||||
@{
|
||||
bufsize = 2 * bufsize + 40;
|
||||
symbuf = realloc (symbuf, bufsize);
|
||||
symbuf = realloc (symbuf, (size_t) bufsize);
|
||||
@}
|
||||
/* Add this character to the buffer. */
|
||||
symbuf[i++] = c;
|
||||
symbuf[i++] = (char) c;
|
||||
/* Get another character. */
|
||||
c = getchar ();
|
||||
@}
|
||||
@@ -10629,7 +10632,7 @@ when there were errors. No file was generated (except the reports generated
|
||||
by @option{--verbose}, etc.). In particular, the output files that possibly
|
||||
existed were not changed.
|
||||
|
||||
@item 63 (mistmatch)
|
||||
@item 63 (mismatch)
|
||||
when @command{bison} does not meet the version requirements of the grammar
|
||||
file. @xref{Require Decl}. No file was generated or changed.
|
||||
@end table
|
||||
@@ -12154,6 +12157,8 @@ values, which is always less than @code{YYNTOKENS}.
|
||||
|
||||
@deftypemethod {parser} {const char *} symbol_name (@code{symbol_kind_t} @var{symbol}) @code{const}
|
||||
The name of the symbol whose kind is @var{symbol}, possibly translated.
|
||||
|
||||
Returns a @code{std::string} when @code{parse.error} is @code{verbose}.
|
||||
@end deftypemethod
|
||||
|
||||
A custom syntax error function looks as follows. This implementation is
|
||||
@@ -12286,6 +12291,12 @@ applicable) location.
|
||||
The kind of this symbol.
|
||||
@end deftypemethod
|
||||
|
||||
@deftypemethod {symbol_type} {const char *} name () @code{const}
|
||||
The name of the kind of this symbol.
|
||||
|
||||
Returns a @code{std::string} when @code{parse.error} is @code{verbose}.
|
||||
@end deftypemethod
|
||||
|
||||
@sp 1
|
||||
|
||||
For each token kind, Bison generates named constructors as follows.
|
||||
@@ -15261,6 +15272,7 @@ London, Department of Computer Science, TR-00-12 (December 2000).
|
||||
@c LocalWords: YYUNDEF SymbolKind yypcontext YYENOMEM TOKENMAX getBundle
|
||||
@c LocalWords: ResourceBundle myResources getString getName getToken
|
||||
@c LocalWords: getLocation getExpectedTokens reportSyntaxError bistromathic
|
||||
@c LocalWords: TokenKind
|
||||
|
||||
@c Local Variables:
|
||||
@c ispell-dictionary: "american"
|
||||
|
||||
@@ -13,8 +13,8 @@ semantic value.
|
||||
|
||||
Run as `./simple`.
|
||||
|
||||
Extracted from the documentation: "A Simple C++ Example".
|
||||
https://www.gnu.org/software/bison/manual/html_node/A-Simple-C_002b_002b-Example.html
|
||||
Extracted from the documentation: [A Simple C++
|
||||
Example](https://www.gnu.org/software/bison/manual/html_node/A-Simple-C_002b_002b-Example.html).
|
||||
|
||||
## variant.yy - Self-contained example in C++98
|
||||
A variation of simple.yy, in C++98.
|
||||
@@ -36,8 +36,8 @@ starting point for a clean parser in C++. The previous examples are better
|
||||
introductory examples, and the C examples are also useful introductory
|
||||
examples.
|
||||
|
||||
Extracted from the documentation: "A Complete C++ Example".
|
||||
https://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html
|
||||
Extracted from the documentation: [A Complete C++
|
||||
Example](https://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html).
|
||||
|
||||
<!---
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ saw the traditional implementation in C, please first read
|
||||
examples/c/lexcalc, which can be seen as a C precursor of this example.
|
||||
|
||||
Read the corresponding chapter in the documentation: "A Complete C++
|
||||
Example". It is also available on line (maybe with a different version of
|
||||
Bison):
|
||||
https://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html
|
||||
Example". It is also available [on
|
||||
line](https://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html)
|
||||
(maybe with a different version of Bison).
|
||||
|
||||
To use it, copy this directory into some work directory, and run `make` to
|
||||
compile the executable, and try it. It is a simple calculator which accepts
|
||||
|
||||
@@ -10,8 +10,8 @@ The first example is that of a simple double-precision Reverse Polish
|
||||
Notation calculator (a calculator using postfix operators). This example
|
||||
provides a good starting point, since operator precedence is not an issue.
|
||||
|
||||
Extracted from the documentation: "Reverse Polish Notation Calculator"
|
||||
https://www.gnu.org/software/bison/manual/html_node/RPN-Calc.html
|
||||
Extracted from the documentation: [Reverse Polish Notation
|
||||
Calculator](https://www.gnu.org/software/bison/manual/html_node/RPN-Calc.html).
|
||||
|
||||
## calc - Simple Calculator
|
||||
This example is slightly more complex than rpcalc: it features infix
|
||||
@@ -24,18 +24,18 @@ A more complete C example: a multi-function calculator. More complex than
|
||||
the previous example. Using precedence directives to support infix
|
||||
operators.
|
||||
|
||||
Extracted from the documentation: "Multi-Function Calculator: mfcalc".
|
||||
https://www.gnu.org/software/bison/manual/html_node/Multi_002dfunction-Calc.html
|
||||
Extracted from the documentation: [Multi-Function Calculator:
|
||||
mfcalc](https://www.gnu.org/software/bison/manual/html_node/Multi_002dfunction-Calc.html).
|
||||
|
||||
## lexcalc - calculator with Flex and Bison
|
||||
The calculator with precedence directives and location tracking. It uses
|
||||
Flex to generate the scanner.
|
||||
|
||||
## reccalc - recursive calculator with Flex and Bison
|
||||
The example builds on top of the previous one to provide a reentrant parser.
|
||||
Such parsers can be called concurrently in different threads, or even
|
||||
recursively. To demonstrate this feature, expressions in parentheses are
|
||||
tokenized as strings, and then recursively parsed from the parser. So
|
||||
This example builds on top of the previous one to provide a reentrant
|
||||
parser. Such parsers can be called concurrently in different threads, or
|
||||
even recursively. To demonstrate this feature, expressions in parentheses
|
||||
are tokenized as strings, and then recursively parsed from the parser. So
|
||||
`(((1)+(2))*((3)+(4)))` uses eight parsers, with a depth of four.
|
||||
|
||||
## pushcalc - calculator implemented with a push parser
|
||||
|
||||
@@ -14,6 +14,9 @@ This example demonstrates best practices when using Bison.
|
||||
- It supports debug traces with semantic values.
|
||||
- It uses named references instead of the traditional $1, $2, etc.
|
||||
|
||||
To customize the interaction with bistromathic, see the GNU Readline user
|
||||
manual (see `info rluserman`).
|
||||
|
||||
<!---
|
||||
Local Variables:
|
||||
fill-column: 76
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Users may customize the behavior of readline, which might break our
|
||||
# expected results.
|
||||
INPUTRC=/dev/null
|
||||
export INPUTRC
|
||||
|
||||
# Beware of portability issues of readline when not feeding it from a
|
||||
# terminal.
|
||||
@@ -41,7 +45,7 @@ echo >perfect '> 0
|
||||
echo >ok '0'
|
||||
echo '0' | prog >effective
|
||||
|
||||
echo "checking for readline output"
|
||||
echo "checking for readline output..."
|
||||
if diff perfect effective; then
|
||||
# Alles ist gut.
|
||||
strip_prompt=false
|
||||
@@ -265,8 +269,8 @@ fi
|
||||
# On Windows10/MSYS2 the ^G coming from <tab> completion is not
|
||||
# emitted the same way
|
||||
# (https://lists.gnu.org/r/bug-bison/2020-05/msg00076.html).
|
||||
echo "checking for kernel name"
|
||||
case `uname -s` in
|
||||
echo "checking for kernel name... $(uname -s)"
|
||||
case $(uname -s) in
|
||||
(MSYS*)
|
||||
echo "SKIP: this is Windows/MSYS"
|
||||
exit $status
|
||||
|
||||
@@ -31,6 +31,7 @@ if ENABLE_BISTROMATHIC
|
||||
-DBISON_LOCALEDIR='"$(localdir)"' \
|
||||
-DLOCALEDIR='"$(localdir)"' \
|
||||
-I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||
%C%_bistromathic_CFLAGS = $(TEST_CFLAGS)
|
||||
%C%_bistromathic_LDADD = -lm $(LIBREADLINE) $(LIBINTL)
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
%require "3.6"
|
||||
|
||||
%code top {
|
||||
#include <assert.h>
|
||||
#include <ctype.h> // isdigit
|
||||
#include <locale.h> // LC_ALL
|
||||
#include <math.h> // cos, sin, etc.
|
||||
@@ -218,7 +217,7 @@ getsym (char const *name)
|
||||
}
|
||||
|
||||
// How many symbols are registered.
|
||||
int
|
||||
static int
|
||||
symbol_count (void)
|
||||
{
|
||||
int res = 0;
|
||||
@@ -312,7 +311,7 @@ yylex (const char **line, YYSTYPE *yylval, YYLTYPE *yylloc)
|
||||
`---------*/
|
||||
|
||||
|
||||
const char *
|
||||
static const char *
|
||||
error_format_string (int argc)
|
||||
{
|
||||
switch (argc)
|
||||
@@ -407,7 +406,8 @@ xstrndup (const char *string, size_t n)
|
||||
const char *end = memchr (string, '\0', n);
|
||||
size_t len = end ? (size_t) (end - string) : n;
|
||||
char *new = malloc (len + 1);
|
||||
assert (new);
|
||||
if (!new)
|
||||
abort ();
|
||||
new[len] = '\0';
|
||||
return memcpy (new, string, len);
|
||||
}
|
||||
@@ -418,7 +418,8 @@ xstrndup (const char *string, size_t n)
|
||||
`-----------*/
|
||||
|
||||
// Parse (and execute) this line.
|
||||
int process_line (YYLTYPE *lloc, const char *line)
|
||||
static int
|
||||
process_line (YYLTYPE *lloc, const char *line)
|
||||
{
|
||||
yypstate *ps = yypstate_new ();
|
||||
int status = 0;
|
||||
@@ -433,7 +434,8 @@ int process_line (YYLTYPE *lloc, const char *line)
|
||||
}
|
||||
|
||||
// Get the list of possible tokens after INPUT was read.
|
||||
int
|
||||
// Returns a nonnegative.
|
||||
static int
|
||||
expected_tokens (const char *input,
|
||||
int *tokens, int ntokens)
|
||||
{
|
||||
@@ -454,6 +456,8 @@ expected_tokens (const char *input,
|
||||
|
||||
// Then query for the accepted tokens at this point.
|
||||
int res = yypstate_expected_tokens (ps, tokens, ntokens);
|
||||
if (res < 0)
|
||||
abort ();
|
||||
yypstate_delete (ps);
|
||||
return res;
|
||||
}
|
||||
@@ -463,7 +467,7 @@ expected_tokens (const char *input,
|
||||
// TEXT is the word to complete. We can use the entire contents of
|
||||
// rl_line_buffer in case we want to do some simple parsing. Return
|
||||
// the array of matches, or NULL if there aren't any.
|
||||
char **
|
||||
static char **
|
||||
completion (const char *text, int start, int end)
|
||||
{
|
||||
YYDPRINTF ((stderr, "completion (\"%.*s[%.*s]%s\")\n",
|
||||
@@ -473,14 +477,17 @@ completion (const char *text, int start, int end)
|
||||
|
||||
// Get list of token numbers.
|
||||
int tokens[YYNTOKENS];
|
||||
char *line = xstrndup (rl_line_buffer, start);
|
||||
char *line = xstrndup (rl_line_buffer, (size_t) start);
|
||||
int ntokens = expected_tokens (line, tokens, YYNTOKENS);
|
||||
free (line);
|
||||
|
||||
// Build MATCHES, the list of possible completions.
|
||||
const int len = strlen (text);
|
||||
const size_t len = strlen (text);
|
||||
// Need initial prefix and final NULL.
|
||||
char **matches = calloc (ntokens + symbol_count () + 2, sizeof *matches);
|
||||
char **matches
|
||||
= calloc ((size_t) ntokens + (size_t) symbol_count () + 2, sizeof *matches);
|
||||
if (!matches)
|
||||
abort ();
|
||||
int match = 1;
|
||||
for (int i = 0; i < ntokens; ++i)
|
||||
switch (tokens[i])
|
||||
@@ -510,9 +517,9 @@ completion (const char *text, int start, int end)
|
||||
matches[0] = strdup (text);
|
||||
else
|
||||
{
|
||||
int lcplen = strlen (matches[1]);
|
||||
size_t lcplen = strlen (matches[1]);
|
||||
for (int i = 2; i < match && lcplen; ++i)
|
||||
for (int j = 0; j < lcplen; ++j)
|
||||
for (size_t j = 0; j < lcplen; ++j)
|
||||
if (matches[1][j] != matches[i][j])
|
||||
lcplen = j;
|
||||
matches[0] = xstrndup (matches[1], lcplen);
|
||||
@@ -536,7 +543,8 @@ completion (const char *text, int start, int end)
|
||||
return matches;
|
||||
}
|
||||
|
||||
void init_readline (void)
|
||||
static void
|
||||
init_readline (void)
|
||||
{
|
||||
// Allow conditional parsing of the ~/.inputrc file.
|
||||
rl_readline_name = "bistromathic";
|
||||
@@ -555,7 +563,8 @@ void init_readline (void)
|
||||
| Main. |
|
||||
`-------*/
|
||||
|
||||
int main (int argc, char const* argv[])
|
||||
int
|
||||
main (int argc, char const* argv[])
|
||||
{
|
||||
#if defined ENABLE_NLS && ENABLE_NLS
|
||||
// Set up internationalization.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
%code top {
|
||||
#include <ctype.h> /* isdigit. */
|
||||
#include <stdio.h> /* For printf, etc. */
|
||||
#include <stdio.h> /* printf. */
|
||||
#include <stdlib.h> /* abort. */
|
||||
#include <string.h> /* strcmp. */
|
||||
|
||||
int yylex (void);
|
||||
@@ -73,7 +74,8 @@ yylex (void)
|
||||
if (c == '.' || isdigit (c))
|
||||
{
|
||||
ungetc (c, stdin);
|
||||
scanf ("%lf", &yylval.NUM);
|
||||
if (scanf ("%lf", &yylval.NUM) != 1)
|
||||
abort ();
|
||||
return NUM;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ nodist_%C%_calc_SOURCES = %D%/calc.y
|
||||
|
||||
# Don't use gnulib's system headers.
|
||||
%C%_calc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||
%C%_calc_CFLAGS = $(TEST_CFLAGS)
|
||||
|
||||
dist_calc_DATA = %D%/calc.y %D%/Makefile %D%/README.md
|
||||
CLEANFILES += %D%/calc.[ch] %D%/calc.output %D%/scan.c
|
||||
|
||||
@@ -25,6 +25,8 @@ if FLEX_WORKS
|
||||
nodist_%C%_lexcalc_SOURCES = %D%/parse.y %D%/parse.h %D%/scan.l
|
||||
# Don't use gnulib's system headers.
|
||||
%C%_lexcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||
# Fighting warnings triggered by Flex is just too painful.
|
||||
# %C%_lexcalc_CFLAGS = $(TEST_CFLAGS)
|
||||
endif FLEX_WORKS
|
||||
|
||||
%D%/parse.c: $(dependencies)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
%option nodefault noinput nounput noyywrap
|
||||
|
||||
%{
|
||||
#include <errno.h> /* errno, ERANGE */
|
||||
#include <errno.h> /* errno, ERANGE */
|
||||
#include <limits.h> /* INT_MIN */
|
||||
#include <stdlib.h> /* strtol */
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
// Each time a rule is matched, advance the end cursor/position.
|
||||
#define YY_USER_ACTION \
|
||||
yylloc->last_column += yyleng;
|
||||
yylloc->last_column += (int) yyleng;
|
||||
|
||||
// Move the first position onto the last.
|
||||
#define LOCATION_STEP() \
|
||||
|
||||
@@ -31,6 +31,7 @@ nodist_%C%_mfcalc_SOURCES = $(mfcalc_sources)
|
||||
%D%/mfcalc.c: $(dependencies)
|
||||
# Don't use gnulib's system headers.
|
||||
%C%_mfcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||
%C%_mfcalc_CFLAGS = $(TEST_CFLAGS)
|
||||
%C%_mfcalc_LDADD = -lm
|
||||
|
||||
dist_TESTS += %D%/mfcalc.test
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%code top {
|
||||
#include <ctype.h> /* isdigit. */
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h> /* For printf, etc. */
|
||||
#include <stdio.h> /* printf. */
|
||||
#include <stdlib.h> /* abort. */
|
||||
#include <string.h> /* strcmp. */
|
||||
}
|
||||
|
||||
@@ -81,7 +81,8 @@ yylex (YYSTYPE *yylval)
|
||||
if (c == '.' || isdigit (c))
|
||||
{
|
||||
ungetc (c, stdin);
|
||||
scanf ("%lf", &yylval->NUM);
|
||||
if (scanf ("%lf", &yylval->NUM) != 1)
|
||||
abort ();
|
||||
return NUM;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ nodist_%C%_calc_SOURCES = %D%/calc.y
|
||||
|
||||
# Don't use gnulib's system headers.
|
||||
%C%_calc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||
%C%_calc_CFLAGS = $(TEST_CFLAGS)
|
||||
|
||||
dist_pushcalc_DATA = %D%/calc.y %D%/Makefile %D%/README.md
|
||||
CLEANFILES += %D%/calc.[ch] %D%/calc.output
|
||||
|
||||
@@ -26,6 +26,8 @@ if FLEX_WORKS
|
||||
BUILT_SOURCES += $(nodist_%C%_reccalc_SOURCES)
|
||||
# Don't use gnulib's system headers.
|
||||
%C%_reccalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||
# Fighting warnings triggered by Flex is just too painful.
|
||||
# %C%_reccalc_CFLAGS = $(TEST_CFLAGS)
|
||||
endif FLEX_WORKS
|
||||
|
||||
%D%/parse.c: $(dependencies)
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
do \
|
||||
capacity = capacity ? 2 * capacity : 128; \
|
||||
while (capacity < size + yyleng + 1); \
|
||||
str = realloc (str, capacity); \
|
||||
str = realloc (str, (size_t) capacity); \
|
||||
} \
|
||||
memcpy (str + size, yytext, yyleng); \
|
||||
memcpy (str + size, yytext, (size_t) yyleng); \
|
||||
size += yyleng; \
|
||||
assert (size < capacity); \
|
||||
} while (0)
|
||||
|
||||
@@ -31,6 +31,7 @@ nodist_%C%_rpcalc_SOURCES = $(rpcalc_sources)
|
||||
%D%/rpcalc.c: $(dependencies)
|
||||
# Don't use gnulib's system headers.
|
||||
%C%_rpcalc_CPPFLAGS = -I$(top_builddir)/%D%
|
||||
%C%_rpcalc_CFLAGS = $(TEST_CFLAGS)
|
||||
%C%_rpcalc_LDADD = -lm
|
||||
|
||||
dist_TESTS += %D%/rpcalc.test
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
dist_noinst_SCRIPTS = %D%/extexi %D%/test
|
||||
TEST_LOG_COMPILER = $(SHELL) $(top_srcdir)/%D%/test
|
||||
|
||||
TEST_CFLAGS = \
|
||||
$(WARN_CFLAGS) $(WARN_CFLAGS_TEST) $(WERROR_CFLAGS)
|
||||
|
||||
AM_CXXFLAGS = \
|
||||
$(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
|
||||
|
||||
|
||||
+2
-1
@@ -36,10 +36,11 @@ strip_prompt=false
|
||||
|
||||
# If diff supports --strip-trailing-cr, use it, to avoid EOL issues
|
||||
# when testing Java programs on Windows.
|
||||
echo "checking for diff --strip-trailing-cr"
|
||||
echo "checking for diff --strip-trailing-cr..."
|
||||
if diff --strip-trailing-cr "$1" "$1"; then
|
||||
diff_opts=--strip-trailing-cr
|
||||
fi
|
||||
echo "checking for diff --strip-trailing-cr... $diff_opts"
|
||||
|
||||
# The exercised program.
|
||||
abs_medir=$cwd/examples/$medir
|
||||
|
||||
+1
-1
Submodule gnulib updated: 2ac33b29fc...ffbb0ced8b
+3
-1
@@ -257,7 +257,8 @@ static const argmatch_trace_doc argmatch_trace_docs[] =
|
||||
{ "sets", "grammar sets: firsts, nullable etc." },
|
||||
{ "muscles", "m4 definitions passed to the skeleton" },
|
||||
{ "tools", "m4 invocation" },
|
||||
{ "m4", "m4 traces" },
|
||||
{ "m4-early", "m4 traces starting from the start" },
|
||||
{ "m4", "m4 traces starting from the skeleton evaluation" },
|
||||
{ "skeleton", "skeleton postprocessing" },
|
||||
{ "time", "time consumption" },
|
||||
{ "ielr", "IELR conversion" },
|
||||
@@ -279,6 +280,7 @@ static const argmatch_trace_arg argmatch_trace_args[] =
|
||||
{ "sets", trace_sets },
|
||||
{ "muscles", trace_muscles },
|
||||
{ "tools", trace_tools },
|
||||
{ "m4-early", trace_m4_early },
|
||||
{ "m4", trace_m4 },
|
||||
{ "skeleton", trace_skeleton },
|
||||
{ "time", trace_time },
|
||||
|
||||
+6
-5
@@ -100,11 +100,12 @@ enum trace
|
||||
trace_grammar = 1 << 7, /**< Reading, reducing the grammar. */
|
||||
trace_time = 1 << 8, /**< Time consumption. */
|
||||
trace_skeleton = 1 << 9, /**< Skeleton postprocessing. */
|
||||
trace_m4 = 1 << 10, /**< M4 traces. */
|
||||
trace_muscles = 1 << 11, /**< M4 definitions of the muscles. */
|
||||
trace_ielr = 1 << 12, /**< IELR conversion. */
|
||||
trace_closure = 1 << 13, /**< Input/output of closure(). */
|
||||
trace_locations = 1 << 14, /**< Full display of locations. */
|
||||
trace_m4_early = 1 << 10, /**< M4 early traces. */
|
||||
trace_m4 = 1 << 11, /**< M4 traces. */
|
||||
trace_muscles = 1 << 12, /**< M4 definitions of the muscles. */
|
||||
trace_ielr = 1 << 13, /**< IELR conversion. */
|
||||
trace_closure = 1 << 14, /**< Input/output of closure(). */
|
||||
trace_locations = 1 << 15, /**< Full display of locations. */
|
||||
trace_all = ~0 /**< All of the above. */
|
||||
};
|
||||
/** What debug items bison displays during its run. */
|
||||
|
||||
+18
-13
@@ -687,6 +687,7 @@ output_skeleton (void)
|
||||
char *skeldir = xpath_join (datadir, "skeletons");
|
||||
char *m4sugar = xpath_join (datadir, "m4sugar/m4sugar.m4");
|
||||
char *m4bison = xpath_join (skeldir, "bison.m4");
|
||||
char *traceon = xpath_join (skeldir, "traceon.m4");
|
||||
char *skel = (IS_PATH_WITH_DIR (skeleton)
|
||||
? xstrdup (skeleton)
|
||||
: xpath_join (skeldir, skeleton));
|
||||
@@ -698,21 +699,10 @@ output_skeleton (void)
|
||||
|
||||
/* Create an m4 subprocess connected to us via two pipes. */
|
||||
|
||||
if (trace_flag & trace_tools)
|
||||
fprintf (stderr, "running: %s %s - %s %s\n",
|
||||
m4, m4sugar, m4bison, skel);
|
||||
|
||||
/* Some future version of GNU M4 (most likely 1.6) may treat the -dV in a
|
||||
position-dependent manner. Keep it as the first argument so that all
|
||||
files are traced.
|
||||
|
||||
See the thread starting at
|
||||
<http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>
|
||||
for details. */
|
||||
int filter_fd[2];
|
||||
pid_t pid;
|
||||
{
|
||||
char const *argv[10];
|
||||
char const *argv[11];
|
||||
int i = 0;
|
||||
argv[i++] = m4;
|
||||
|
||||
@@ -730,15 +720,29 @@ output_skeleton (void)
|
||||
|
||||
argv[i++] = "-I";
|
||||
argv[i++] = datadir;
|
||||
if (trace_flag & trace_m4)
|
||||
/* Some future version of GNU M4 (most likely 1.6) may treat the
|
||||
-dV in a position-dependent manner. See the thread starting at
|
||||
<http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>
|
||||
for details. */
|
||||
if (trace_flag & trace_m4_early)
|
||||
argv[i++] = "-dV";
|
||||
argv[i++] = m4sugar;
|
||||
argv[i++] = "-";
|
||||
argv[i++] = m4bison;
|
||||
if (trace_flag & trace_m4)
|
||||
argv[i++] = traceon;
|
||||
argv[i++] = skel;
|
||||
argv[i++] = NULL;
|
||||
aver (i <= ARRAY_CARDINALITY (argv));
|
||||
|
||||
if (trace_flag & trace_tools)
|
||||
{
|
||||
fputs ("running:", stderr);
|
||||
for (int j = 0; argv[j]; ++j)
|
||||
fprintf (stderr, " %s", argv[j]);
|
||||
fputc ('\n', stderr);
|
||||
}
|
||||
|
||||
/* The ugly cast is because gnulib gets the const-ness wrong. */
|
||||
pid = create_pipe_bidi ("m4", m4, (char **)(void*)argv, false, true,
|
||||
true, filter_fd);
|
||||
@@ -747,6 +751,7 @@ output_skeleton (void)
|
||||
free (skeldir);
|
||||
free (m4sugar);
|
||||
free (m4bison);
|
||||
free (traceon);
|
||||
free (skel);
|
||||
|
||||
if (trace_flag & trace_muscles)
|
||||
|
||||
+1
-1
@@ -2705,7 +2705,7 @@ yyerrorlab:
|
||||
yyerrlab1:
|
||||
yyerrstatus = 3; /* Each real token shifted decrements this. */
|
||||
|
||||
// Pop stack until we find a state that shifts the error token.
|
||||
/* Pop stack until we find a state that shifts the error token. */
|
||||
for (;;)
|
||||
{
|
||||
yyn = yypact[yystate];
|
||||
|
||||
+18
-11
@@ -109,11 +109,6 @@ AT_DATA_GRAMMAR([list.yy],
|
||||
%define parse.assert
|
||||
%debug
|
||||
|
||||
%code top
|
||||
{
|
||||
// Get access to stack_symbol_type for the tests.
|
||||
# define private public
|
||||
}
|
||||
%code provides
|
||||
{
|
||||
]AT_YYLEX_DECLARE[
|
||||
@@ -136,6 +131,14 @@ AT_DATA_GRAMMAR([list.yy],
|
||||
%code requires { #include <vector> }
|
||||
%code { int yylex (yy::parser::semantic_type* lvalp); }
|
||||
|
||||
// A hack which relies on internal hooks to check stack_symbol_type,
|
||||
// which is private.
|
||||
%code yy_bison_internal_hook {
|
||||
public:
|
||||
typedef stack_symbol_type yy_stack_symbol_type;
|
||||
typedef stack_type yy_stack_type;
|
||||
}
|
||||
|
||||
%%
|
||||
exp: "int" { $$.push_back ($1); }
|
||||
%%
|
||||
@@ -157,6 +160,9 @@ int main()
|
||||
// symbol_type: construction, accessor.
|
||||
{
|
||||
parser::symbol_type s = parser::make_INT (12);
|
||||
assert_eq (s.kind (), parser::symbol_kind::S_INT);
|
||||
assert_eq (parser::symbol_name (s.kind ()), std::string ("\"int\""));
|
||||
assert_eq (s.name (), std::string ("\"int\""));
|
||||
assert_eq (s.value.as<int> (), 12);
|
||||
}
|
||||
|
||||
@@ -180,12 +186,13 @@ int main()
|
||||
}
|
||||
|
||||
// stack_symbol_type: construction, accessor.
|
||||
typedef parser::yy_stack_symbol_type stack_symbol_type;
|
||||
{
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
auto ss = parser::stack_symbol_type(1, parser::make_INT(123));
|
||||
auto ss = stack_symbol_type (1, parser::make_INT(123));
|
||||
#else
|
||||
parser::symbol_type s = parser::make_INT (123);
|
||||
parser::stack_symbol_type ss(1, s);
|
||||
stack_symbol_type ss(1, s);
|
||||
#endif
|
||||
assert_eq (ss.value.as<int> (), 123);
|
||||
}
|
||||
@@ -194,17 +201,17 @@ int main()
|
||||
// Sufficiently many so that it will be resized.
|
||||
// Probably 3 times (starting at 200).
|
||||
{
|
||||
parser::stack_type st;
|
||||
parser::yy_stack_type st;
|
||||
const int mucho = 1700;
|
||||
const int int_reduction_state = 1; // Read list.output to find it.
|
||||
for (int i = 0; i < mucho; ++i)
|
||||
{
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
st.push(parser::stack_symbol_type{int_reduction_state,
|
||||
parser::make_INT (i)});
|
||||
st.push(stack_symbol_type{int_reduction_state,
|
||||
parser::make_INT (i)});
|
||||
#else
|
||||
parser::symbol_type s = parser::make_INT (i);
|
||||
parser::stack_symbol_type ss (int_reduction_state, s);
|
||||
stack_symbol_type ss (int_reduction_state, s);
|
||||
st.push (ss);
|
||||
#endif
|
||||
}
|
||||
|
||||
+18
-1
@@ -1352,8 +1352,20 @@ AT_BISON_CHECK([-fcaret input.y], [1], [],
|
||||
]])
|
||||
|
||||
|
||||
# Clang chokes on some of our comments, because it tries to "parse"
|
||||
# some documentation directives in the comments:
|
||||
#
|
||||
# input.c:166:50: error: '\a' command does not have a valid word argument [-Werror,-Wdocumentation]
|
||||
# FAKE = 258 /* "fake [] \a\b\f\n\r\t\v\"'?\\[\\ ??!??'??(??)??-??/??<??=??> \001\001" */
|
||||
# ~~^
|
||||
AT_DATA_GRAMMAR([input.y],
|
||||
[[%{
|
||||
[[%code requires {
|
||||
#if defined __clang__ && 10 <= __clang_major__
|
||||
# pragma clang diagnostic ignored "-Wdocumentation"
|
||||
#endif
|
||||
}
|
||||
|
||||
%{
|
||||
/* This is seen in GCC: a %{ and %} in middle of a comment. */
|
||||
const char *foo = "So %{ and %} can be here too.";
|
||||
|
||||
@@ -1424,6 +1436,11 @@ char quote[] = "@:>@@:>@,";
|
||||
/* Exercise quotes in strings. */
|
||||
%token FAKE "fake @<:@@:>@ \a\b\f\n\r\t\v\"\'\?\\\u005B\U0000005c ??!??'??(??)??-??/??<??=??> \x1\1"
|
||||
|
||||
/* Beware of the generated comments that embed string aliases that
|
||||
might close the comment. */
|
||||
%token COMMENT_CLOSE "*/"
|
||||
%token COMMENT "/* comment */"
|
||||
|
||||
%%
|
||||
/* Exercise M4 quoting: '@:>@@:>@', @<:@, 1. */
|
||||
exp: '@<:@' '\1' two '$' '@' '{' oline output.or.oline.opt
|
||||
|
||||
+1
-1
@@ -500,7 +500,7 @@ m4_define([AT_DATA_SOURCE_PROLOGUE],
|
||||
# The prologue that should be included in any grammar whose parser is
|
||||
# meant to be compiled.
|
||||
m4_define([AT_DATA_GRAMMAR_PROLOGUE],
|
||||
[[%code top {
|
||||
[[%code top { /* -*- ]AT_LANG[ -*- */
|
||||
]AT_DATA_SOURCE_PROLOGUE[]dnl
|
||||
[}
|
||||
]])
|
||||
|
||||
@@ -56,6 +56,7 @@ TESTSUITE_AT = \
|
||||
%D%/java.at \
|
||||
%D%/javapush.at \
|
||||
%D%/local.at \
|
||||
%D%/m4.at \
|
||||
%D%/named-refs.at \
|
||||
%D%/output.at \
|
||||
%D%/package.m4 \
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
# Basic m4 macros. -*- Autotest -*-
|
||||
|
||||
# Copyright (C) 2020 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
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
AT_BANNER([[M4 Macros.]])
|
||||
|
||||
|
||||
AT_SETUP([Generating Comments])
|
||||
|
||||
AT_DATA([input.y],
|
||||
[%%
|
||||
exp:
|
||||
])
|
||||
|
||||
AT_DATA([input.m4],
|
||||
[[m4@&t@_include(b4_skeletonsdir/[c.m4])
|
||||
|
||||
b4_output_begin([output.txt])
|
||||
|
||||
b4_gsub([[abcd]],
|
||||
[a], [b])
|
||||
b4_gsub([[abcd]],
|
||||
[a], [b],
|
||||
[b], [c],
|
||||
[c], [d])
|
||||
|
||||
_b4_comment([["/* () */"]])
|
||||
_b4_comment([["/* ( */"]])
|
||||
_b4_comment([["/* ) */"]])
|
||||
_b4_comment([["/* [] */"]])
|
||||
|
||||
b4_comment([["/* () */"]])
|
||||
b4_comment([["/* ( */"]])
|
||||
b4_comment([["/* ) */"]])
|
||||
b4_comment([["/* [] */"]])
|
||||
|
||||
b4_output_end([output.txt])
|
||||
]])
|
||||
|
||||
AT_BISON_CHECK([-S ./input.m4 input.y])
|
||||
|
||||
AT_CHECK([cat output.txt], [],
|
||||
[[
|
||||
[bbcd]
|
||||
[dddd]
|
||||
|
||||
"/\* () *\/"
|
||||
"/\* ( *\/"
|
||||
"/\* ) *\/"
|
||||
"/\* [] *\/"
|
||||
|
||||
/* "/\* () *\/" */
|
||||
/* "/\* ( *\/" */
|
||||
/* "/\* ) *\/" */
|
||||
/* "/\* [] *\/" */
|
||||
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
+17
-6
@@ -372,8 +372,19 @@ m4_pushdef([AT_TEST],
|
||||
|
||||
AT_BISON_OPTION_PUSHDEFS([$1])
|
||||
|
||||
|
||||
# Clang chokes on some of our comments, because it tries to "parse"
|
||||
# some documentation directives in the comments:
|
||||
#
|
||||
# input.c:131:48: error: '\a' command does not have a valid word argument [-Werror,-Wdocumentation]
|
||||
# SPECIAL = 261 /* "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" */
|
||||
# ~~^
|
||||
AT_DATA_GRAMMAR([input.y],
|
||||
[%{
|
||||
#if defined __clang__ && 10 <= __clang_major__
|
||||
# pragma clang diagnostic ignored "-Wdocumentation"
|
||||
#endif
|
||||
|
||||
]AT_YYERROR_DECLARE[
|
||||
]AT_YYLEX_DECLARE[
|
||||
%}
|
||||
@@ -398,14 +409,14 @@ exp: ]AT_ERROR_VERBOSE_IF(["\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"], ["
|
||||
# C-string literal. Also notice that unnecessary escaping, such as "\?", from
|
||||
# the user specification is eliminated.
|
||||
AT_BISON_CHECK([-fcaret -o input.c input.y], [[0]], [[]],
|
||||
[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
|
||||
22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||
[[input.y:26.8-14: warning: symbol SPECIAL redeclared [-Wother]
|
||||
26 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||
| ^~~~~~~
|
||||
input.y:21.8-14: note: previous declaration
|
||||
21 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||
input.y:25.8-14: note: previous declaration
|
||||
25 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||
| ^~~~~~~
|
||||
input.y:22.16-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
|
||||
22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||
input.y:26.16-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
|
||||
26 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
]])
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Basic M4 macros.
|
||||
m4_include([m4.at])
|
||||
|
||||
# Resistance to user bugs.
|
||||
m4_include([input.at])
|
||||
|
||||
Reference in New Issue
Block a user