mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-08 10:15:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a47fb7838a | ||
|
|
089c39aab2 | ||
|
|
3841fe9de4 | ||
|
|
7024830c72 | ||
|
|
720943cff0 | ||
|
|
706ebd0fa5 | ||
|
|
ff9eee58c3 | ||
|
|
4f6785aee9 | ||
|
|
c3f856a430 | ||
|
|
8d101c19d4 | ||
|
|
3169c1e7a2 | ||
|
|
39c1239ed5 | ||
|
|
dcf16ff191 | ||
|
|
c6d1f65185 | ||
|
|
c1144a5076 | ||
|
|
5d2c34b48c | ||
|
|
5209a67035 | ||
|
|
df2ed793af | ||
|
|
84119fd53e | ||
|
|
f8793e27f0 | ||
|
|
2ceaf03d69 | ||
|
|
5d0d1b4965 | ||
|
|
42a5f17b8f | ||
|
|
4ff0741f58 | ||
|
|
d7527048a8 | ||
|
|
6a4b3240cf | ||
|
|
aa0c96bf14 | ||
|
|
3ad31c23f1 | ||
|
|
41a939eece | ||
|
|
8b3df1a443 | ||
|
|
97852f39f4 | ||
|
|
25b3d0e1a3 | ||
|
|
de3041b69a | ||
|
|
0faf371992 | ||
|
|
be4528096e | ||
|
|
c025891547 | ||
|
|
15b97a0a6a | ||
|
|
290d3d09d4 | ||
|
|
374cf8bbaf | ||
|
|
dd6ca19927 | ||
|
|
3661ebbb2c | ||
|
|
6376364120 | ||
|
|
eb83487606 | ||
|
|
ec9c5556d9 | ||
|
|
cfef21f5b0 | ||
|
|
5555f4d051 | ||
|
|
a166d5450e | ||
|
|
b7bdf78c18 | ||
|
|
722070124e | ||
|
|
657dbff05c | ||
|
|
6d58f297cc | ||
|
|
d95df5028d | ||
|
|
4e89da6e5d | ||
|
|
aa58acb76e | ||
|
|
db8c1bbbfd | ||
|
|
cf686be382 | ||
|
|
c70b68c60d | ||
|
|
78b767d3eb | ||
|
|
cb679b2a09 | ||
|
|
6ee1494d6e | ||
|
|
a475c4d5c1 | ||
|
|
1183d5ebfe | ||
|
|
8b96c82b05 | ||
|
|
07e18e7fb4 | ||
|
|
013d598219 | ||
|
|
83a8f8b707 | ||
|
|
f8e8f57e9f | ||
|
|
6571c2d1b1 | ||
|
|
c95d0dd5f5 | ||
|
|
76301e7399 | ||
|
|
c83425ef4e | ||
|
|
c9b5b46d74 | ||
|
|
7558cbf373 | ||
|
|
6e6950fbbc | ||
|
|
4fe5a375fa | ||
|
|
7c90a28f17 | ||
|
|
9beba1919c | ||
|
|
80ebbe7330 | ||
|
|
028df02a9f | ||
|
|
71dfc86d58 | ||
|
|
5c1069c7d8 | ||
|
|
3fc3ef658e | ||
|
|
dd6e78360a | ||
|
|
eeb5d6f11b | ||
|
|
70441b5ab1 | ||
|
|
7538d8dc1a | ||
|
|
b07b5ce423 | ||
|
|
157e91dcc6 | ||
|
|
b820718adf | ||
|
|
6e6e11795c | ||
|
|
6bfdf22c50 | ||
|
|
d432079f8a | ||
|
|
b6ac175a1c | ||
|
|
5f90ef59a4 | ||
|
|
10ee04479f | ||
|
|
c09524cf8f | ||
|
|
28152fc10a | ||
|
|
9babd05a90 | ||
|
|
3e94b12ddd | ||
|
|
7cb6de2533 | ||
|
|
4ec4309cce | ||
|
|
ca96df89b2 | ||
|
|
2142e59155 | ||
|
|
a75072476e | ||
|
|
7c47598d4f | ||
|
|
fdaedc780a | ||
|
|
85f5e3b9d5 | ||
|
|
c3a4686a03 | ||
|
|
9cdfd86cbb |
+11
-4
@@ -1,10 +1,19 @@
|
||||
*.a
|
||||
*.bak
|
||||
*.diff
|
||||
*.exe
|
||||
*.log
|
||||
*.o
|
||||
*.orig
|
||||
*.out
|
||||
*.output
|
||||
*.pdf
|
||||
*.rej
|
||||
*.stamp
|
||||
*.tmp
|
||||
*.trs
|
||||
*~
|
||||
.deps
|
||||
.deps/
|
||||
.dirstamp
|
||||
/*.cache
|
||||
/*.flc
|
||||
@@ -20,11 +29,9 @@
|
||||
/Makefile.in
|
||||
/README-release
|
||||
/_*
|
||||
/a.exe
|
||||
/a.out
|
||||
/aclocal.m4
|
||||
/b.out
|
||||
/bison-*
|
||||
/build-aux/move-if-change
|
||||
/conf[0-9]*
|
||||
/confdefs*
|
||||
/config.log
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
3.8
|
||||
3.8.2
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ jobs:
|
||||
- git submodule update --init --recursive
|
||||
|
||||
# As of 2021-08, we don't have Autoconf 2.71 on Ubuntu.
|
||||
- sed -i 's/AC_PREREQ(\[2\.71\])/AC_PREREQ([2.69])/g' configure.ac
|
||||
- sed -i 's/AC_PREREQ(\[2\.71])/AC_PREREQ([2.69])/g' configure.ac
|
||||
- ./bootstrap
|
||||
- ./configure --enable-gcc-warnings || { cat config.log && false; }
|
||||
- make -j2
|
||||
|
||||
@@ -24,7 +24,8 @@ and nasty bugs.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1998-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2015, 2018-2022, 2025-2026 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+2
-2
@@ -26732,8 +26732,8 @@
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1987-1988, 1991-2015, 2018-2021 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright (C) 1987-1988, 1991-2015, 2018-2022, 2025-2026 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without
|
||||
modification, are permitted provided the copyright notice and this
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
|
||||
# Copyright (C) 2001-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -1,5 +1,34 @@
|
||||
GNU Bison NEWS
|
||||
|
||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
||||
|
||||
The `cex.timeout` %define variable allows to control when we give up
|
||||
finding a unifying counterexample. For instance `bison -Wcex
|
||||
-Dcex.timeout=.5 gram.y` to limit to 1/2s.
|
||||
|
||||
The C++ skeletons now expose copy and move operators for symbols.
|
||||
|
||||
The default (C) skeleton now supports user-defined semantic and location
|
||||
types that are trivially copyable in C++.
|
||||
|
||||
Fixed portability issues of the test suite on Solaris.
|
||||
|
||||
Fixed spurious warnings about input containing `m4_` or `b4_`.
|
||||
|
||||
Fixed assertion violations found by fuzzing.
|
||||
|
||||
Fixed issues with the D skeleton.
|
||||
|
||||
Fixed new compiler warnings in the generated parsers (yacc.c, lalr1.cc,
|
||||
glr2.cc).
|
||||
|
||||
* Noteworthy changes in release 3.8.2 (2021-09-25) [stable]
|
||||
|
||||
Fixed portability issues of bison on Cygwin.
|
||||
|
||||
Improvements in glr2.cc: add support for custom error messages (`%define
|
||||
parse.error custom`), allow linking several parsers together.
|
||||
|
||||
* Noteworthy changes in release 3.8.1 (2021-09-11) [stable]
|
||||
|
||||
The generation of prototypes for yylex and yyerror in Yacc mode is
|
||||
@@ -4722,7 +4751,8 @@ mode: outline
|
||||
fill-column: 76
|
||||
End:
|
||||
|
||||
Copyright (C) 1995-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2015, 2018-2022, 2025-2026 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This file is part of Bison, the GNU Parser Generator.
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ to the bison package.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2005, 2009-2015, 2018-2021 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright (C) 2002, 2005, 2009-2015, 2018-2022, 2025-2026 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -120,8 +120,8 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018-2021 Free
|
||||
Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018-2022,
|
||||
2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ the problems you encounter.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2015, 2018-2021 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2015, 2018-2022, 2025-2026 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
+2
-2
@@ -638,8 +638,8 @@ bootstrapped.
|
||||
|
||||
<!--
|
||||
|
||||
Copyright (C) 2002-2005, 2007-2015, 2018-2021 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright (C) 2002-2005, 2007-2015, 2018-2022, 2025-2026 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ Alexandre Duret-Lutz [email protected]
|
||||
Andre da Costa Barros [email protected]
|
||||
Andreas Damm [email protected]
|
||||
Andreas Schwab [email protected]
|
||||
Andrei Malashkin [email protected]
|
||||
Andrew Suffield [email protected]
|
||||
Angelo Borsotti [email protected]
|
||||
Anthony Heading [email protected]
|
||||
@@ -46,8 +47,8 @@ Csaba Raduly [email protected]
|
||||
Dagobert Michelsen [email protected]
|
||||
Daniel Frużyński [email protected]
|
||||
Daniel Galloway [email protected]
|
||||
Daniela Becker [email protected]
|
||||
Daniel Hagerty [email protected]
|
||||
Daniela Becker [email protected]
|
||||
David Barto [email protected]
|
||||
David J. MacKenzie [email protected]
|
||||
David Kastrup [email protected]
|
||||
@@ -81,6 +82,7 @@ Gavin Smith [email protected]
|
||||
Georg Sauthoff [email protected]
|
||||
George Neuner [email protected]
|
||||
Gilles Espinasse [email protected]
|
||||
Giorgos Pap [email protected]
|
||||
Goran Uddeborg [email protected]
|
||||
Guido Trentalancia [email protected]
|
||||
H. Merijn Brand [email protected]
|
||||
@@ -117,6 +119,7 @@ Marc Autret [email protected]
|
||||
Marc Mendiola [email protected]
|
||||
Marc Schönefeld [email protected]
|
||||
Mark Boyall [email protected]
|
||||
Marko Mäkelä [email protected]
|
||||
Martin Blais [email protected]
|
||||
Martin Jacobs [email protected]
|
||||
Martin Mokrejs [email protected]
|
||||
@@ -128,6 +131,7 @@ Michael Catanzaro [email protected]
|
||||
Michael Felt [email protected]
|
||||
Michael Hayes [email protected]
|
||||
Michael Raskin [email protected]
|
||||
Michał Majchrowicz [email protected]
|
||||
Michel d'Hooge [email protected]
|
||||
Michiel De Wilde [email protected]
|
||||
Mickael Labau [email protected]
|
||||
@@ -142,6 +146,7 @@ Nick Bowler [email protected]
|
||||
Nicolas Bedon [email protected]
|
||||
Nicolas Burrus [email protected]
|
||||
Nicolas Tisserand [email protected]
|
||||
Nikita Popov [email protected]
|
||||
Nikki Valen [email protected]
|
||||
Noah Friedman [email protected]
|
||||
Odd Arild Olsen [email protected]
|
||||
@@ -169,7 +174,6 @@ 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]
|
||||
@@ -178,6 +182,7 @@ Rob Vermaas [email protected]
|
||||
Robert Anisko [email protected]
|
||||
Robert Yang [email protected]
|
||||
Roland Levillain [email protected]
|
||||
Ryan [email protected]
|
||||
Satya Kiran Popuri [email protected]
|
||||
Sebastian Setzer [email protected]
|
||||
Sebastien Fricker [email protected]
|
||||
@@ -238,7 +243,8 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2000-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2015, 2018-2022, 2025-2026 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This file is part of Bison, the GNU Parser Generator.
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
* Soon
|
||||
** yyerror_range in GLR
|
||||
It seems useless that it is based on glr_stack_item, it should be doable
|
||||
with location only.
|
||||
|
||||
** scan-code
|
||||
The default case is scanning char-per-char.
|
||||
|
||||
@@ -710,8 +714,8 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2001-2004, 2006, 2008-2015, 2018-2021 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright (C) 2001-2004, 2006, 2008-2015, 2018-2022, 2025-2026 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
# Convenience script for regenerating all autogeneratable files that are
|
||||
# omitted from the version control repository. In particular, this script
|
||||
# also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files
|
||||
# with new versions of autoconf or automake.
|
||||
|
||||
# Copyright (C) 2003-2026 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Originally written by Paul Eggert. The canonical version of this
|
||||
# script is maintained as top/autogen.sh in gnulib. However, to be
|
||||
# useful to your package, you should place a copy of it under version
|
||||
# control in the top-level directory of your package. The intent is
|
||||
# that all customization can be done with a bootstrap.conf file also
|
||||
# maintained in your version control; gnulib comes with a template
|
||||
# build-aux/bootstrap.conf to get you started.
|
||||
#
|
||||
# Alternatively, you can use an autogen.sh script that is specific
|
||||
# to your package.
|
||||
|
||||
me="$0"
|
||||
medir=`dirname "$me"`
|
||||
|
||||
# Read the function library and the configuration.
|
||||
. "$medir"/bootstrap-funclib.sh
|
||||
|
||||
autogen "$@"
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
# Convenience script for fetching auxiliary files that are omitted from
|
||||
# the version control repository of this package.
|
||||
|
||||
# Copyright (C) 2003-2026 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Originally written by Paul Eggert. The canonical version of this
|
||||
# script is maintained as top/autopull.sh in gnulib. However, to be
|
||||
# useful to your package, you should place a copy of it under version
|
||||
# control in the top-level directory of your package. The intent is
|
||||
# that all customization can be done with a bootstrap.conf file also
|
||||
# maintained in your version control; gnulib comes with a template
|
||||
# build-aux/bootstrap.conf to get you started.
|
||||
#
|
||||
# Alternatively, you can use an autopull.sh script that is specific
|
||||
# to your package.
|
||||
|
||||
me="$0"
|
||||
medir=`dirname "$me"`
|
||||
|
||||
# Read the function library and the configuration.
|
||||
. "$medir"/bootstrap-funclib.sh
|
||||
|
||||
autopull "$@"
|
||||
File diff suppressed because it is too large
Load Diff
+20
-9
@@ -1,6 +1,7 @@
|
||||
# Bootstrap configuration.
|
||||
|
||||
# Copyright (C) 2006-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2015, 2018-2022, 2025-2026 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
|
||||
@@ -19,11 +20,11 @@
|
||||
gnulib_modules='
|
||||
argmatch array-list assert assure attribute
|
||||
bitsetv
|
||||
calloc-posix close closeout config-h c-strcase
|
||||
calloc-posix close closeout config-h c-strcase c-strtod
|
||||
configmake
|
||||
dirname
|
||||
error execute extensions
|
||||
fdl fopen-safer fstrcmp
|
||||
fopen-safer fstrcmp
|
||||
getopt-gnu
|
||||
gettext-h git-version-gen gitlog-to-changelog
|
||||
gpl-3.0 intprops inttypes isnan javacomp-script
|
||||
@@ -33,8 +34,8 @@ gnulib_modules='
|
||||
libtextstyle-optional
|
||||
linked-list
|
||||
malloc-gnu
|
||||
mcel-prefer
|
||||
mbfile mbswidth
|
||||
non-recursive-gnulib-prefix-hack
|
||||
obstack
|
||||
obstack-printf
|
||||
perror progname
|
||||
@@ -45,7 +46,7 @@ gnulib_modules='
|
||||
realloc-posix
|
||||
relocatable-prog relocatable-script
|
||||
rename
|
||||
spawn-pipe stdbool stpcpy stpncpy strdup-posix strerror strtod strverscmp
|
||||
spawn-pipe stdbool stpcpy stpncpy strdup-posix strerror strverscmp
|
||||
sys_ioctl
|
||||
termios
|
||||
timevar
|
||||
@@ -80,13 +81,23 @@ XGETTEXT_OPTIONS_RUNTIME=$XGETTEXT_OPTIONS'\\\
|
||||
--keyword=YY_ \\\
|
||||
'
|
||||
|
||||
gnulib_tool_option_extras='--symlink --conditional-dependencies --makefile-name=gnulib.mk --po-base=gnulib-po --po-domain=bison'
|
||||
gnulib_tool_option_extras="\
|
||||
--automake-subdir\
|
||||
--automake-subdir-tests\
|
||||
--avoid=mbiterf\
|
||||
--conditional-dependencies\
|
||||
--makefile-name=gnulib.mk\
|
||||
--po-base=gnulib-po\
|
||||
--po-domain=bison\
|
||||
--symlink\
|
||||
"
|
||||
|
||||
gnulib_extra_files="$gnulib_extra_files build-aux/move-if-change"
|
||||
|
||||
gnulib_extra_files="$gnulib_extra_files build-aux/epsf.tex"
|
||||
|
||||
bootstrap_post_import_hook()
|
||||
{
|
||||
# Massage lib/gnulib.mk before using it later in the bootstrapping process.
|
||||
build-aux/prefix-gnulib-mk --lib-name="$gnulib_name" "lib/$gnulib_mk"
|
||||
|
||||
# Ensure that ChangeLog exists, for automake.
|
||||
test -f ChangeLog || touch ChangeLog
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
/config.guess
|
||||
/config.libpath
|
||||
/config.rpath
|
||||
/config.rpath~
|
||||
/config.sub
|
||||
/depcomp
|
||||
/do-release-commit-and-tag
|
||||
/epsf.tex
|
||||
/gendocs.sh
|
||||
/git-version-gen
|
||||
/gitlog-to-changelog
|
||||
@@ -19,7 +19,6 @@
|
||||
/libtool-reloc
|
||||
/mdate-sh
|
||||
/missing
|
||||
/prefix-gnulib-mk
|
||||
/reloc-ldflags
|
||||
/relocatable.sh.in
|
||||
/test-driver
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright (C) 2012-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2012-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright (C) 2012-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2012-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Generate a release announcement message.
|
||||
|
||||
# Copyright (C) 2007-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2022, 2025-2026 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
|
||||
|
||||
+3
-1
@@ -1,4 +1,5 @@
|
||||
## Copyright (C) 2000-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2000-2015, 2018-2022, 2025-2026 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
|
||||
@@ -17,6 +18,7 @@ EXTRA_DIST += \
|
||||
build-aux/Darwin.valgrind \
|
||||
build-aux/Linux.valgrind \
|
||||
build-aux/cross-options.pl \
|
||||
build-aux/epsf.tex \
|
||||
build-aux/move-if-change \
|
||||
build-aux/prev-version.txt \
|
||||
build-aux/update-b4-copyright
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../gnulib/build-aux/move-if-change
|
||||
@@ -3,7 +3,8 @@
|
||||
# Update b4_copyright invocations or b4_copyright_years definitions to
|
||||
# include the current year.
|
||||
|
||||
# Copyright (C) 2009-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2009-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
||||
|
||||
# Copyright (C) 2010-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2010-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Update expectations in an Autotest test suite.
|
||||
|
||||
# Copyright (C) 2019-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2019-2022, 2025-2026 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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
## Customize maint.mk -*- makefile -*-
|
||||
## Copyright (C) 2008-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2008-2015, 2018-2022, 2025-2026 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
|
||||
@@ -42,7 +43,7 @@ url_dir_list = \
|
||||
# Tests not to run as part of "make distcheck".
|
||||
local-checks-to-skip = \
|
||||
sc_immutable_NEWS \
|
||||
sc_prohibit_atoi_atof
|
||||
sc_indent
|
||||
|
||||
# The local directory containing the checked-out copy of gnulib used in
|
||||
# this release. Used solely to get a date for the "announcement" target.
|
||||
@@ -164,6 +165,7 @@ $(call exclude,
|
||||
prohibit_always-defined_macros=^data/skeletons/yacc.c$$ \
|
||||
prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \
|
||||
prohibit_always-defined_macros+=?|^tests/regression.at$$ \
|
||||
prohibit_atoi_atof=^(doc|etc|examples|tests)/ \
|
||||
prohibit_doubled_word=^tests/named-refs.at$$ \
|
||||
prohibit_magic_number_exit=^doc/bison.texi$$ \
|
||||
prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \
|
||||
|
||||
+19
-6
@@ -1,6 +1,7 @@
|
||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2001-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2015, 2018-2022, 2025-2026 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
|
||||
@@ -24,7 +25,7 @@ AC_INIT([GNU Bison],
|
||||
[[email protected]],
|
||||
[],
|
||||
[https://www.gnu.org/software/bison/])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2021])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2026])
|
||||
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
|
||||
[The copyright year for this package])
|
||||
|
||||
@@ -55,9 +56,6 @@ AC_PROG_CXX
|
||||
# Gnulib (early checks).
|
||||
gl_EARLY
|
||||
|
||||
# We want ostream_printf and hyperlink support.
|
||||
gl_LIBTEXTSTYLE_OPTIONAL([0.20.5])
|
||||
|
||||
# Gnulib uses '#pragma GCC diagnostic push' to silence some
|
||||
# warnings, but older gcc doesn't support this.
|
||||
AC_CACHE_CHECK([whether pragma GCC diagnostic push works],
|
||||
@@ -132,12 +130,14 @@ if test "$enable_gcc_warnings" = yes; then
|
||||
-Wformat -Wimplicit-fallthrough -Wmismatched-dealloc -Wnull-dereference
|
||||
-Wno-sign-compare -Wno-tautological-constant-out-of-range-compare
|
||||
-Wpointer-arith -Wshadow -Wstrict-aliasing
|
||||
-Wunused-but-set-variable
|
||||
-Wwrite-strings
|
||||
-wr188 -wr2259 -wr3179'
|
||||
warn_c='-Wbad-function-cast
|
||||
-Wmissing-prototypes
|
||||
-Wstrict-prototypes'
|
||||
warn_cxx='-Wextra-semi -Wnoexcept -Wold-style-cast -Wundefined-func-template
|
||||
warn_cxx='-Wextra-semi -Wnoexcept -Wsubobject-linkage
|
||||
-Wold-style-cast -Wundefined-func-template
|
||||
-Wweak-vtables'
|
||||
# Warnings for the test suite only.
|
||||
#
|
||||
@@ -227,6 +227,16 @@ if test "$enable_gcc_warnings" = yes; then
|
||||
gl_WARN_ADD([-Wno-deprecated], [WNO_DEPRECATED_CXXFLAGS])
|
||||
CXXFLAGS=$save_CXXFLAGS
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
|
||||
AH_VERBATIM([FORTIFY_SOURCE],
|
||||
[/* Enable compile-time and run-time bounds-checking, and some warnings,
|
||||
without upsetting glibc 2.15+. */
|
||||
#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
|
||||
# define _FORTIFY_SOURCE 2
|
||||
#endif
|
||||
])
|
||||
AC_DEFINE([GNULIB_PORTCHECK], [1], [Enable some gnulib portability checks.])
|
||||
fi
|
||||
|
||||
|
||||
@@ -284,6 +294,9 @@ AC_C_INLINE
|
||||
# gl_EARLY avoids some redundant checks.
|
||||
gl_INIT
|
||||
|
||||
# We want ostream_printf and hyperlink support.
|
||||
gl_LIBTEXTSTYLE_OPTIONAL([0.20.5])
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS_ONCE([setlocale])
|
||||
|
||||
|
||||
+2
-1
@@ -207,7 +207,8 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2002, 2008-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2008-2015, 2018-2022, 2025-2026 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Default styling rules for Bison when doing terminal output.
|
||||
Copyright (C) 2019-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2019-2022, 2025-2026 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
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
## Copyright (C) 2002, 2005-2015, 2018-2021 Free Software Foundation,
|
||||
## Inc.
|
||||
## Copyright (C) 2002, 2005-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
# Language-independent M4 Macros for Bison.
|
||||
|
||||
# Copyright (C) 2002, 2004-2015, 2018-2021 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright (C) 2002, 2004-2015, 2018-2022, 2025-2026 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
|
||||
@@ -409,8 +409,12 @@ b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||
# b4_glr_cc_if([IF-TRUE], [IF-FALSE])
|
||||
# -----------------------------------
|
||||
m4_define([b4_glr_cc_if],
|
||||
[m4_if(m4_bregexp(b4_skeleton, [^"glr.cc"$]), [0], $@)])
|
||||
[m4_if(b4_skeleton, ["glr.cc"], $@)])
|
||||
|
||||
# b4_glr2_cc_if([IF-TRUE], [IF-FALSE])
|
||||
# ------------------------------------
|
||||
m4_define([b4_glr2_cc_if],
|
||||
[m4_if(b4_skeleton, ["glr2.cc"], $@)])
|
||||
|
||||
## --------- ##
|
||||
## Symbols. ##
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# C++ skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2015, 2018-2021 Free Software
|
||||
# Copyright (C) 2006-2007, 2009-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+87
-31
@@ -2,7 +2,7 @@
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2022, 2025-2026 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
|
||||
@@ -227,6 +227,8 @@ m4_define([b4_value_type_declare],
|
||||
# Define the public types: token, semantic value, location, and so forth.
|
||||
# Depending on %define token_lex, may be output in the header or source file.
|
||||
m4_define([b4_public_types_declare],
|
||||
[b4_glr2_cc_if(
|
||||
[b4_value_type_declare],
|
||||
[[#ifdef ]b4_api_PREFIX[STYPE
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC message "bison: do not #define ]b4_api_PREFIX[STYPE in C++, use %define api.value.type"
|
||||
@@ -236,7 +238,8 @@ m4_define([b4_public_types_declare],
|
||||
]b4_value_type_declare[
|
||||
#endif
|
||||
/// Backward compatibility (Bison 3.8).
|
||||
typedef value_type semantic_type;]b4_locations_if([
|
||||
typedef value_type semantic_type;
|
||||
]])[]b4_locations_if([
|
||||
/// Symbol locations.
|
||||
typedef b4_percent_define_get([[api.location.type]],
|
||||
[[location]]) location_type;])[
|
||||
@@ -262,16 +265,16 @@ m4_define([b4_public_types_declare],
|
||||
/// Token kinds.
|
||||
struct token
|
||||
{
|
||||
]b4_token_enums[
|
||||
]b4_token_enums[]b4_glr2_cc_if([], [[
|
||||
/// Backward compatibility alias (Bison 3.6).
|
||||
typedef token_kind_type yytokentype;
|
||||
typedef token_kind_type yytokentype;]])[
|
||||
};
|
||||
|
||||
/// Token kind, as returned by yylex.
|
||||
typedef token::yytokentype token_kind_type;
|
||||
typedef token::token_kind_type token_kind_type;]b4_glr2_cc_if([], [[
|
||||
|
||||
/// Backward compatibility alias (Bison 3.6).
|
||||
typedef token_kind_type token_type;
|
||||
typedef token_kind_type token_type;]])[
|
||||
|
||||
/// Symbol kinds.
|
||||
struct symbol_kind
|
||||
@@ -305,7 +308,7 @@ m4_define([b4_symbol_type_define],
|
||||
typedef Base super_type;
|
||||
|
||||
/// Default constructor.
|
||||
basic_symbol ()
|
||||
basic_symbol () YY_NOEXCEPT
|
||||
: value ()]b4_locations_if([
|
||||
, location ()])[
|
||||
{}
|
||||
@@ -343,6 +346,30 @@ m4_define([b4_symbol_type_define],
|
||||
clear ();
|
||||
}
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
/// Copy assignment.
|
||||
basic_symbol& operator= (const basic_symbol& that)
|
||||
{
|
||||
Base::operator= (that);]b4_variant_if([[
|
||||
]b4_symbol_variant([this->kind ()], [value], [copy],
|
||||
[that.value])], [[
|
||||
value = that.value]])[;]b4_locations_if([[
|
||||
location = that.location;]])[
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// Move assignment.
|
||||
basic_symbol& operator= (basic_symbol&& that)
|
||||
{
|
||||
Base::operator= (std::move (that));]b4_variant_if([[
|
||||
]b4_symbol_variant([this->kind ()], [value], [move],
|
||||
[std::move (that.value)])], [[
|
||||
value = std::move (that.value)]])[;]b4_locations_if([[
|
||||
location = std::move (that.location);]])[
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Destroy contents, and record that is empty.
|
||||
void clear () YY_NOEXCEPT
|
||||
{]b4_variant_if([[
|
||||
@@ -383,10 +410,10 @@ m4_define([b4_symbol_type_define],
|
||||
std::string name () const YY_NOEXCEPT
|
||||
{
|
||||
return ]b4_parser_class[::symbol_name (this->kind ());
|
||||
}]])[
|
||||
}]])[]b4_glr2_cc_if([], [[
|
||||
|
||||
/// Backward compatibility (Bison 3.6).
|
||||
symbol_kind_type type_get () const YY_NOEXCEPT;
|
||||
symbol_kind_type type_get () const YY_NOEXCEPT;]])[
|
||||
|
||||
/// Whether empty.
|
||||
bool empty () const YY_NOEXCEPT;
|
||||
@@ -410,22 +437,30 @@ m4_define([b4_symbol_type_define],
|
||||
/// Type access provider for token (enum) based symbols.
|
||||
struct by_kind
|
||||
{
|
||||
/// Default constructor.
|
||||
by_kind ();
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
/// Move constructor.
|
||||
by_kind (by_kind&& that);
|
||||
#endif
|
||||
|
||||
/// Copy constructor.
|
||||
by_kind (const by_kind& that);
|
||||
|
||||
/// The symbol kind as needed by the constructor.
|
||||
typedef token_kind_type kind_type;
|
||||
|
||||
/// Default constructor.
|
||||
by_kind () YY_NOEXCEPT;
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
/// Move constructor.
|
||||
by_kind (by_kind&& that) YY_NOEXCEPT;
|
||||
#endif
|
||||
|
||||
/// Copy constructor.
|
||||
by_kind (const by_kind& that) YY_NOEXCEPT;
|
||||
|
||||
/// Constructor from (external) token numbers.
|
||||
by_kind (kind_type t);
|
||||
by_kind (kind_type t) YY_NOEXCEPT;
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
/// Copy assignment.
|
||||
by_kind& operator= (const by_kind& that);
|
||||
|
||||
/// Move assignment.
|
||||
by_kind& operator= (by_kind&& that);
|
||||
#endif
|
||||
|
||||
/// Record that this symbol is empty.
|
||||
void clear () YY_NOEXCEPT;
|
||||
@@ -435,18 +470,18 @@ m4_define([b4_symbol_type_define],
|
||||
|
||||
/// The (internal) type number (corresponding to \a type).
|
||||
/// \a empty when empty.
|
||||
symbol_kind_type kind () const YY_NOEXCEPT;
|
||||
symbol_kind_type kind () const YY_NOEXCEPT;]b4_glr2_cc_if([], [[
|
||||
|
||||
/// Backward compatibility (Bison 3.6).
|
||||
symbol_kind_type type_get () const YY_NOEXCEPT;
|
||||
symbol_kind_type type_get () const YY_NOEXCEPT;]])[
|
||||
|
||||
/// The symbol kind.
|
||||
/// \a ]b4_symbol_prefix[YYEMPTY when empty.
|
||||
symbol_kind_type kind_;
|
||||
};
|
||||
};]b4_glr2_cc_if([], [[
|
||||
|
||||
/// Backward compatibility for a private implementation detail (Bison 3.6).
|
||||
typedef by_kind by_type;
|
||||
typedef by_kind by_type;]])[
|
||||
|
||||
/// "External" symbols: returned by the scanner.
|
||||
struct symbol_type : basic_symbol<by_kind>
|
||||
@@ -455,7 +490,7 @@ m4_define([b4_symbol_type_define],
|
||||
typedef basic_symbol<by_kind> super_type;
|
||||
|
||||
/// Empty symbol.
|
||||
symbol_type () {}
|
||||
symbol_type () YY_NOEXCEPT {}
|
||||
|
||||
/// Constructor for valueless symbols, and symbols from each type.
|
||||
]b4_type_foreach([_b4_symbol_constructor_define])dnl
|
||||
@@ -501,12 +536,14 @@ m4_define([b4_public_types_define],
|
||||
(void) v;
|
||||
]b4_symbol_variant([this->kind ()], [value], [YY_MOVE_OR_COPY], [YY_MOVE (v)])])[}]])[
|
||||
|
||||
]b4_glr2_cc_if([], [[
|
||||
template <typename Base>
|
||||
]b4_parser_class[::symbol_kind_type
|
||||
]b4_parser_class[::basic_symbol<Base>::type_get () const YY_NOEXCEPT
|
||||
{
|
||||
return this->kind ();
|
||||
}
|
||||
]])[
|
||||
|
||||
template <typename Base>
|
||||
bool
|
||||
@@ -527,26 +564,43 @@ m4_define([b4_public_types_define],
|
||||
}
|
||||
|
||||
// by_kind.
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind ()
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind () YY_NOEXCEPT
|
||||
: kind_ (]b4_symbol(empty, kind)[)
|
||||
{}
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind (by_kind&& that)
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT
|
||||
: kind_ (that.kind_)
|
||||
{
|
||||
that.clear ();
|
||||
}
|
||||
#endif
|
||||
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind (const by_kind& that)
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT
|
||||
: kind_ (that.kind_)
|
||||
{}
|
||||
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind (token_kind_type t)
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT
|
||||
: kind_ (yytranslate_ (t))
|
||||
{}
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
]b4_inline([$1])]b4_parser_class[::by_kind&
|
||||
b4_parser_class[::by_kind::by_kind::operator= (const by_kind& that)
|
||||
{
|
||||
kind_ = that.kind_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
]b4_inline([$1])]b4_parser_class[::by_kind&
|
||||
b4_parser_class[::by_kind::by_kind::operator= (by_kind&& that)
|
||||
{
|
||||
kind_ = that.kind_;
|
||||
that.clear ();
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
]b4_inline([$1])[void
|
||||
]b4_parser_class[::by_kind::clear () YY_NOEXCEPT
|
||||
{
|
||||
@@ -566,11 +620,13 @@ m4_define([b4_public_types_define],
|
||||
return kind_;
|
||||
}
|
||||
|
||||
]b4_glr2_cc_if([], [[
|
||||
]b4_inline([$1])[]b4_parser_class[::symbol_kind_type
|
||||
]b4_parser_class[::by_kind::type_get () const YY_NOEXCEPT
|
||||
{
|
||||
return this->kind ();
|
||||
}
|
||||
]])[
|
||||
]])
|
||||
|
||||
|
||||
@@ -587,7 +643,7 @@ m4_define([b4_token_constructor_define], [])
|
||||
# sometimes in the cc file.
|
||||
m4_define([b4_yytranslate_define],
|
||||
[ b4_inline([$1])b4_parser_class[::symbol_kind_type
|
||||
]b4_parser_class[::yytranslate_ (int t)
|
||||
]b4_parser_class[::yytranslate_ (int t) YY_NOEXCEPT
|
||||
{
|
||||
]b4_api_token_raw_if(
|
||||
[[ return static_cast<symbol_kind_type> (t);]],
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
# Common code for C-like languages (C, C++, Java, etc.)
|
||||
|
||||
# Copyright (C) 2012-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2012-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# C skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2015, 2018-2021 Free Software
|
||||
# Copyright (C) 2006-2007, 2009-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
|
||||
# C M4 Macros for Bison.
|
||||
|
||||
# Copyright (C) 2002, 2004-2015, 2018-2021 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright (C) 2002, 2004-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# D skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2022, 2025-2026 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
|
||||
|
||||
+3
-4
@@ -2,7 +2,7 @@
|
||||
|
||||
# D language support for Bison
|
||||
|
||||
# Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2022, 2025-2026 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
|
||||
@@ -284,8 +284,7 @@ m4_define([b4_declare_symbol_enum],
|
||||
that double-quoting is unnecessary unless the string contains an
|
||||
apostrophe, a comma, or backslash (other than backslash-backslash).
|
||||
YYSTR is taken from yytname. */
|
||||
final void toString(W)(W sink) const
|
||||
if (isOutputRange!(W, char))
|
||||
final void toString(void delegate(const(char)[]) sink) const
|
||||
{
|
||||
immutable string[] yy_sname = @{
|
||||
]b4_symbol_names[
|
||||
@@ -296,7 +295,7 @@ m4_define([b4_declare_symbol_enum],
|
||||
]b4_translatable[
|
||||
@};]])[
|
||||
|
||||
put(sink, yy_sname[yycode_]);
|
||||
sink.formattedWrite!"%s"(yy_sname[yycode_]);
|
||||
}
|
||||
}
|
||||
]])
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
# GLR skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2022, 2025-2026 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
|
||||
@@ -199,7 +200,7 @@ b4_glr_cc_if([],
|
||||
[b4_header_if(
|
||||
[b4_output_begin([b4_spec_header_file])
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||
[2002-2015, 2018-2021])[
|
||||
[2002-2015, 2018-2022, 2025-2026])[
|
||||
]b4_cpp_guard_open([b4_spec_mapped_header_file])[
|
||||
]b4_shared_declarations[
|
||||
]b4_cpp_guard_close([b4_spec_mapped_header_file])[
|
||||
@@ -213,7 +214,7 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||
|
||||
b4_output_begin([b4_parser_file_name])
|
||||
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
||||
[2002-2015, 2018-2021])[
|
||||
[2002-2015, 2018-2022, 2025-2026])[
|
||||
/* C GLR parser skeleton written by Paul Hilfinger. */
|
||||
|
||||
]b4_disclaimer[
|
||||
@@ -306,6 +307,10 @@ static YYLTYPE yyloc_default][]b4_yyloc_default;])[
|
||||
# include <setjmp.h>
|
||||
# define YYJMP_BUF jmp_buf
|
||||
# define YYSETJMP(Env) setjmp (Env)
|
||||
/* Pacify GCC <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21161>. */
|
||||
#if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
|
||||
# pragma GCC diagnostic ignored "-Wclobbered"
|
||||
#endif
|
||||
/* Pacify Clang and ICC. */
|
||||
# define YYLONGJMP(Env, Val) \
|
||||
do { \
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# C++ GLR skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2022, 2025-2026 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
|
||||
@@ -381,7 +382,7 @@ b4_percent_code_get([[requires]])[
|
||||
]b4_header_if(
|
||||
[b4_output_begin([b4_spec_header_file])
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
[2002-2015, 2018-2021])[
|
||||
[2002-2015, 2018-2022, 2025-2026])[
|
||||
// C++ GLR parser skeleton written by Akim Demaille.
|
||||
|
||||
]b4_disclaimer[
|
||||
|
||||
+2507
-2439
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,8 @@
|
||||
|
||||
# Java skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2007, 2009-2015, 2018-2021 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright (C) 2007, 2009-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
# Java language support for Bison
|
||||
|
||||
# Copyright (C) 2007-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
+19
-16
@@ -1,6 +1,7 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2022, 2025-2026 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
|
||||
@@ -159,7 +160,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))])])
|
||||
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2015, 2018-2021])
|
||||
[2002-2015, 2018-2022, 2025-2026])
|
||||
|
||||
m4_define([b4_parser_class],
|
||||
[b4_percent_define_get([[api.parser.class]])])
|
||||
@@ -325,19 +326,19 @@ m4_define([b4_shared_declarations],
|
||||
|
||||
/// Whether the given \c yypact_ value indicates a defaulted state.
|
||||
/// \param yyvalue the value to check
|
||||
static bool yy_pact_value_is_default_ (int yyvalue);
|
||||
static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT;
|
||||
|
||||
/// Whether the given \c yytable_ value indicates a syntax error.
|
||||
/// \param yyvalue the value to check
|
||||
static bool yy_table_value_is_error_ (int yyvalue);
|
||||
static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT;
|
||||
|
||||
static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_;
|
||||
static const ]b4_int_type(b4_table_ninf, b4_table_ninf)[ yytable_ninf_;
|
||||
|
||||
/// Convert a scanner token kind \a t to a symbol kind.
|
||||
/// In theory \a t should be a token_kind_type, but character literals
|
||||
/// are valid, yet not members of the token_type enum.
|
||||
static symbol_kind_type yytranslate_ (int t);
|
||||
/// are valid, yet not members of the token_kind_type enum.
|
||||
static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT;
|
||||
|
||||
]b4_parse_error_bmatch(
|
||||
[simple],
|
||||
@@ -425,7 +426,7 @@ m4_define([b4_shared_declarations],
|
||||
/// Superclass.
|
||||
typedef basic_symbol<by_state> super_type;
|
||||
/// Construct an empty symbol.
|
||||
stack_symbol_type ();
|
||||
stack_symbol_type () YY_NOEXCEPT;
|
||||
/// Move or copy construction.
|
||||
stack_symbol_type (YY_RVREF (stack_symbol_type) that);
|
||||
/// Steal the contents from \a sym to build this.
|
||||
@@ -474,7 +475,7 @@ m4_define([b4_shared_declarations],
|
||||
void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
|
||||
|
||||
/// Pop \a n symbols from the stack.
|
||||
void yypop_ (int n = 1);
|
||||
void yypop_ (int n = 1) YY_NOEXCEPT;
|
||||
|
||||
/// Constants.
|
||||
enum
|
||||
@@ -637,9 +638,9 @@ m4_if(b4_prefix, [yy], [],
|
||||
]b4_parser_class[::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
|
||||
{}
|
||||
|
||||
/*---------------.
|
||||
| symbol kinds. |
|
||||
`---------------*/
|
||||
/*---------.
|
||||
| symbol. |
|
||||
`---------*/
|
||||
|
||||
]b4_token_ctor_if([], [b4_public_types_define([cc])])[
|
||||
|
||||
@@ -678,7 +679,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
return YY_CAST (symbol_kind_type, yystos_[+state]);
|
||||
}
|
||||
|
||||
]b4_parser_class[::stack_symbol_type::stack_symbol_type ()
|
||||
]b4_parser_class[::stack_symbol_type::stack_symbol_type () YY_NOEXCEPT
|
||||
{}
|
||||
|
||||
]b4_parser_class[::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
|
||||
@@ -779,7 +780,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
}
|
||||
|
||||
void
|
||||
]b4_parser_class[::yypop_ (int n)
|
||||
]b4_parser_class[::yypop_ (int n) YY_NOEXCEPT
|
||||
{
|
||||
yystack_.pop (n);
|
||||
}
|
||||
@@ -822,13 +823,13 @@ m4_if(b4_prefix, [yy], [],
|
||||
}
|
||||
|
||||
bool
|
||||
]b4_parser_class[::yy_pact_value_is_default_ (int yyvalue)
|
||||
]b4_parser_class[::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT
|
||||
{
|
||||
return yyvalue == yypact_ninf_;
|
||||
}
|
||||
|
||||
bool
|
||||
]b4_parser_class[::yy_table_value_is_error_ (int yyvalue)
|
||||
]b4_parser_class[::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT
|
||||
{
|
||||
return yyvalue == yytable_ninf_;
|
||||
}
|
||||
@@ -842,12 +843,13 @@ m4_if(b4_prefix, [yy], [],
|
||||
int
|
||||
]b4_parser_class[::parse ()
|
||||
{
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
int yyn;
|
||||
/// Length of the RHS of the rule being reduced.
|
||||
int yylen = 0;
|
||||
|
||||
// Error handling.
|
||||
int yynerrs_ = 0;
|
||||
int yynerrs_ YY_ATTRIBUTE_UNUSED = 0;
|
||||
int yyerrstatus_ = 0;
|
||||
|
||||
/// The lookahead symbol.
|
||||
@@ -1178,6 +1180,7 @@ b4_dollar_popdef])[]dnl
|
||||
}
|
||||
|
||||
return yyresult;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
}
|
||||
#if YY_EXCEPTIONS
|
||||
catch (...)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# D skeleton for Bison -*- autoconf -*-
|
||||
|
||||
# Copyright (C) 2007-2012, 2019-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2012, 2019-2022, 2025-2026 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
|
||||
@@ -61,7 +62,7 @@ b4_use_push_for_pull_if([
|
||||
# or as class instance variable when doing push parsing.
|
||||
b4_output_begin([b4_parser_file_name])
|
||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in D],
|
||||
[2007-2012, 2019-2021])[
|
||||
[2007-2012, 2019-2022, 2025-2026])[
|
||||
]b4_disclaimer[
|
||||
]b4_percent_define_ifdef([package], [module b4_percent_define_get([package]);
|
||||
])[
|
||||
@@ -269,9 +270,10 @@ b4_user_union_members
|
||||
}
|
||||
}]])[
|
||||
|
||||
]b4_lexer_if([[ private class YYLexer implements Lexer {
|
||||
]b4_lexer_if([[private class YYLexer: Lexer
|
||||
{
|
||||
]b4_percent_code_get([[lexer]])[
|
||||
}
|
||||
}
|
||||
]])[
|
||||
/** The object doing lexical analysis for us. */
|
||||
private Lexer yylexer;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Java skeleton for Bison -*- java -*-
|
||||
|
||||
# Copyright (C) 2007-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2022, 2025-2026 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
|
||||
@@ -16,7 +17,7 @@
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2015, 2018-2021])
|
||||
[2002-2015, 2018-2022, 2025-2026])
|
||||
|
||||
|
||||
# b4_location_file
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2022, 2025-2026 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
|
||||
@@ -37,7 +38,7 @@ m4_define([b4_stack_define],
|
||||
typedef typename S::size_type size_type;
|
||||
typedef typename std::ptrdiff_t index_type;
|
||||
|
||||
stack (size_type n = 200)
|
||||
stack (size_type n = 200) YY_NOEXCEPT
|
||||
: seq_ (n)
|
||||
{}
|
||||
|
||||
@@ -116,7 +117,7 @@ m4_define([b4_stack_define],
|
||||
class slice
|
||||
{
|
||||
public:
|
||||
slice (const stack& stack, index_type range)
|
||||
slice (const stack& stack, index_type range) YY_NOEXCEPT
|
||||
: stack_ (stack)
|
||||
, range_ (range)
|
||||
{}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2022, 2025-2026 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
|
||||
@@ -470,7 +471,7 @@ m4_define([_b4_symbol_constructor_define],
|
||||
b4_symbol_if([$1], [has_type],
|
||||
[b4_symbol([$1], [type]) v]),
|
||||
b4_locations_if([location_type l]))[)
|
||||
: super_type (]b4_join([token_type (tok)],
|
||||
: super_type (]b4_join([token_kind_type (tok)],
|
||||
b4_symbol_if([$1], [has_type], [std::move (v)]),
|
||||
b4_locations_if([std::move (l)]))[)
|
||||
#else
|
||||
@@ -479,7 +480,7 @@ m4_define([_b4_symbol_constructor_define],
|
||||
b4_symbol_if([$1], [has_type],
|
||||
[const b4_symbol([$1], [type])& v]),
|
||||
b4_locations_if([const location_type& l]))[)
|
||||
: super_type (]b4_join([token_type (tok)],
|
||||
: super_type (]b4_join([token_kind_type (tok)],
|
||||
b4_symbol_if([$1], [has_type], [v]),
|
||||
b4_locations_if([l]))[)
|
||||
#endif
|
||||
|
||||
+29
-10
@@ -1,11 +1,11 @@
|
||||
# -*- C -*-
|
||||
# Yacc compatible skeleton for Bison
|
||||
|
||||
# Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2022, 2025-2026 Free
|
||||
# Software Foundation, Inc.
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[1984, 1989-1990, 2000-2015, 2018-2021])
|
||||
[1984, 1989-1990, 2000-2015, 2018-2022, 2025-2026])
|
||||
|
||||
# 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
|
||||
@@ -256,7 +256,7 @@ int yynerrs;]])])
|
||||
m4_define([b4_declare_parser_state_variables],
|
||||
[b4_pure_if([[
|
||||
/* Number of syntax errors so far. */
|
||||
int yynerrs]m4_ifval([$1], [ = 0])[;
|
||||
int yynerrs YY_ATTRIBUTE_UNUSED]m4_ifval([$1], [ = 0])[;
|
||||
]])[
|
||||
yy_state_fast_t yystate]m4_ifval([$1], [ = 0])[;
|
||||
/* Number of tokens to shift before error messages enabled. */
|
||||
@@ -581,10 +581,27 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
|
||||
# define YYCOPY_NEEDED 1]])[
|
||||
#endif /* ]b4_lac_if([[1]], [b4_parse_error_case([simple], [[!defined yyoverflow]], [[1]])])[ */
|
||||
|
||||
#if (! defined yyoverflow \
|
||||
&& (! defined __cplusplus \
|
||||
|| (]b4_locations_if([[defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL \
|
||||
&& ]])[defined ]b4_api_PREFIX[STYPE_IS_TRIVIAL && ]b4_api_PREFIX[STYPE_IS_TRIVIAL)))
|
||||
#ifndef yyoverflow
|
||||
/* In C++, ]b4_api_PREFIX[STYPE must be trivially copyable.
|
||||
If ]b4_api_PREFIX[STYPE_IS_TRIVIAL, this is already known.
|
||||
Otherwise check this if easy, as in newer C++ compilers.]b4_locations_if([[
|
||||
Likewise for ]b4_api_PREFIX[LTYPE.]])[ */
|
||||
# if (! (]b4_locations_if([[defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL \
|
||||
&& ]])[defined ]b4_api_PREFIX[STYPE_IS_TRIVIAL && ]b4_api_PREFIX[STYPE_IS_TRIVIAL) \
|
||||
&& defined __cplusplus && 201103 <= __cplusplus \
|
||||
&& !(defined _GLIBCXX_RELEASE \
|
||||
? _GLIBCXX_RELEASE < 5 \
|
||||
: defined __GLIBCXX__) \
|
||||
&& defined __has_include)
|
||||
# if __has_include (<type_traits>)
|
||||
# include <type_traits>
|
||||
]b4_locations_if(
|
||||
[[static_assert (std::is_trivially_copyable<]b4_api_PREFIX[LTYPE>::value,
|
||||
"Bison error: api.location.type is not trivially copyable");
|
||||
]])[static_assert (std::is_trivially_copyable<]b4_api_PREFIX[STYPE>::value,
|
||||
"Bison error: api.value.type is not trivially copyable");
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* A type that is properly aligned for any stack member. */
|
||||
union yyalloc
|
||||
@@ -1531,9 +1548,11 @@ yypull_parse (yypstate *yyps]b4_user_formals[)
|
||||
YYLTYPE yylloc = yyloc_default;]])])[
|
||||
int yystatus;
|
||||
do {
|
||||
]b4_pure_if([[ YYSTYPE yylval;
|
||||
]b4_pure_if([[ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
YYSTYPE yylval;
|
||||
int ]])[yychar = ]b4_yylex[;
|
||||
yystatus = yypush_parse (yyps]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])[);
|
||||
yystatus = yypush_parse (yyps]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])[);]b4_pure_if([[
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END]])[
|
||||
} while (yystatus == YYPUSH_MORE);
|
||||
return yystatus;
|
||||
}]])[
|
||||
|
||||
+2
-1
@@ -3,7 +3,8 @@
|
||||
<!--
|
||||
bison.xsl - common templates for Bison XSLT.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015, 2018-2022, 2025-2026 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<!--
|
||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015, 2018-2022, 2025-2026 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<!--
|
||||
xml2text.xsl - transform Bison XML Report into plain text.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015, 2018-2022, 2025-2026 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<!--
|
||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015, 2018-2022, 2025-2026 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+2
-12
@@ -8,28 +8,18 @@
|
||||
#/bison.cp
|
||||
#/bison.cps
|
||||
#/bison.toc
|
||||
|
||||
/*~
|
||||
/.dirstamp
|
||||
*.dvi
|
||||
*.ps
|
||||
/bison.1
|
||||
/bison.dvi
|
||||
/bison.help
|
||||
/bison.html
|
||||
/bison.info
|
||||
/bison.info.bak
|
||||
/bison.log
|
||||
/bison.pdf
|
||||
/bison.ps
|
||||
/cross-options.texi
|
||||
/fdl.texi
|
||||
/figs/*.eps
|
||||
/figs/*.svg
|
||||
/gendocs_template
|
||||
/gendocs_template_min
|
||||
/gpl-3.0.texi
|
||||
/refcard.dvi
|
||||
/refcard.log
|
||||
/refcard.ps
|
||||
/relocatable.texi
|
||||
/stamp-vti
|
||||
/version.texi
|
||||
|
||||
+180
-49
@@ -173,8 +173,8 @@
|
||||
This manual (@value{UPDATED}) is for GNU Bison (version @value{VERSION}),
|
||||
the GNU parser generator.
|
||||
|
||||
Copyright @copyright{} 1988--1993, 1995, 1998--2015, 2018--2021 Free
|
||||
Software Foundation, Inc.
|
||||
Copyright @copyright{} 1988--1993, 1995, 1998--2015, 2018--2022,
|
||||
2025--2026 Free Software Foundation, Inc.
|
||||
|
||||
@quotation
|
||||
Permission is granted to copy, distribute and/or modify this document under
|
||||
@@ -1736,8 +1736,8 @@ after @samp{//}.
|
||||
@example
|
||||
/* Parser for rpcalc. -*- C -*-
|
||||
|
||||
Copyright (C) 1988-1993, 1995, 1998-2015, 2018-2021 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright (C) 1988--1993, 1995, 1998--2015, 2018--2021, 2025--2026
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -2365,6 +2365,8 @@ analyzer.
|
||||
* Ltcalc Lexer:: The lexical analyzer.
|
||||
@end menu
|
||||
|
||||
See @ref{Tracking Locations} for details about locations.
|
||||
|
||||
@node Ltcalc Declarations
|
||||
@subsection Declarations for @code{ltcalc}
|
||||
|
||||
@@ -2488,7 +2490,7 @@ yylex (void)
|
||||
@group
|
||||
/* Skip white space. */
|
||||
while ((c = getchar ()) == ' ' || c == '\t')
|
||||
++yylloc.last_column;
|
||||
yylloc.last_column += c == '\t' ? 8 - ((yylloc.last_column - 1) & 7) : 1;
|
||||
@end group
|
||||
|
||||
@group
|
||||
@@ -2627,8 +2629,8 @@ calculator.
|
||||
@example
|
||||
/* Parser for mfcalc. -*- C -*-
|
||||
|
||||
Copyright (C) 1988-1993, 1995, 1998-2015, 2018-2021 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright (C) 1988--1993, 1995, 1998--2015, 2018--2021, 2025--2026
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -2644,6 +2646,13 @@ calculator.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
%code top {
|
||||
/* Portability issues for strdup. */
|
||||
#ifndef _XOPEN_SOURCE
|
||||
# define _XOPEN_SOURCE 600
|
||||
#endif
|
||||
}
|
||||
@end example
|
||||
@end ignore
|
||||
|
||||
@@ -2756,8 +2765,8 @@ provides for either functions or variables to be placed in the table.
|
||||
@example
|
||||
/* Functions for mfcalc. -*- C -*-
|
||||
|
||||
Copyright (C) 1988-1993, 1995, 1998-2015, 2018-2021 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright (C) 1988--1993, 1995, 1998--2015, 2018--2021, 2025--2026
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -2875,7 +2884,7 @@ found, a pointer to that symbol is returned; otherwise zero is returned.
|
||||
not make these assumptions. */
|
||||
#include <assert.h>
|
||||
#include <stdlib.h> /* malloc, realloc. */
|
||||
#include <string.h> /* strlen. */
|
||||
#include <string.h> /* strdup, strlen. */
|
||||
@end group
|
||||
|
||||
@group
|
||||
@@ -4744,6 +4753,33 @@ to 1 for @code{yylloc} at the beginning of the parsing. To initialize
|
||||
initialization), use the @code{%initial-action} directive. @xref{Initial
|
||||
Action Decl}.
|
||||
|
||||
@sp 1
|
||||
|
||||
@cindex column
|
||||
The meaning of ``column'' is deliberately left vague since there are several
|
||||
options, depending on the use cases.
|
||||
|
||||
With multibyte input (say UTF-8), simply counting the number of bytes does
|
||||
not match character positions on the screen. One needs advanced functions
|
||||
mapping multibyte characters to their visual width (see for instance
|
||||
Gnulib's @code{mbswidth} and @code{mbsnwidth} functions). Tabulation
|
||||
characters probably need a dedicated implementation, to match the ``go to
|
||||
next multiple of 8'' behavior.
|
||||
|
||||
However to quote input in error messages, as @command{bison} does:
|
||||
|
||||
@example
|
||||
@group
|
||||
1.10-12: @derror{error}: invalid identifier: ‘3.8’
|
||||
1 | %require @derror{3.8}
|
||||
| @derror{^~~}
|
||||
@end group
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
then byte positions are more handy. So in some cases, tracking both visual
|
||||
character position @emph{and} byte position is the best option. This is
|
||||
what @command{bison} does.
|
||||
|
||||
@node Actions and Locations
|
||||
@subsection Actions and Locations
|
||||
@@ -4988,7 +5024,12 @@ exp[result]: exp[left] '/' exp[right]
|
||||
@end group
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
Like symbol names (@pxref{Symbols}), reference names can contain letters,
|
||||
underscores, periods, and non-initial digits and dashes. In bracketed
|
||||
reference names, leading and trailing blanks and comments are ignored:
|
||||
@samp{[ name ]} and @samp{[/* A */ name /* for references. */]} are
|
||||
equivalent to @samp{[name]}.
|
||||
|
||||
In order to access a semantic value generated by a midrule action, an
|
||||
explicit name may also be declared by putting a bracketed name after the
|
||||
closing brace of the midrule action code:
|
||||
@@ -5282,15 +5323,27 @@ exclusively nonterminal symbols, use the safer @code{%nterm}:
|
||||
The syntax of the various directives to declare symbols is as follows.
|
||||
|
||||
@example
|
||||
%token @var{tag}? ( @var{id} @var{number}? @var{string}? )+ ( @var{tag} ( @var{id} @var{number}? @var{string}? )+ )*
|
||||
%left @var{tag}? ( @var{id} @var{number}?)+ ( @var{tag} ( @var{id} @var{number}? )+ )*
|
||||
%type @var{tag}? ( @var{id} | @var{char} | @var{string} )+ ( @var{tag} ( @var{id} | @var{char} | @var{string} )+ )*
|
||||
%nterm @var{tag}? @var{id}+ ( @var{tag} @var{id}+ )*
|
||||
@group
|
||||
%token @var{tag}? ( (@var{id}|@var{char}) @var{number}? @var{string}? )+ \
|
||||
( @var{tag} ( (@var{id}|@var{char}) @var{number}? @var{string}? )+ )*
|
||||
@end group
|
||||
@group
|
||||
%left @var{tag}? ( (@var{id}|@var{char}|@var{string}) @var{number}? )+ \
|
||||
( @var{tag} ( (@var{id}|@var{char}|@var{string}) @var{number}? )+ )*
|
||||
@end group
|
||||
@group
|
||||
%type @var{tag}? (@var{id}|@var{char}|@var{string})+ \
|
||||
( @var{tag} (@var{id}|@var{char}|@var{string})+ )*
|
||||
@end group
|
||||
@group
|
||||
%nterm @var{tag}? @var{id}+ \
|
||||
( @var{tag} @var{id}+ )*
|
||||
@end group
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
where @var{tag} denotes a type tag such as @samp{<ival>}, @var{id} denotes
|
||||
an identifier such as @samp{NUM}, @var{number} a decimal or hexadecimal
|
||||
an identifier such as @samp{NUM} or @samp{exp}, @var{number} a decimal or hexadecimal
|
||||
integer such as @samp{300} or @samp{0x12d}, @var{char} a character literal
|
||||
such as @samp{'+'}, and @var{string} a string literal such as
|
||||
@samp{"number"}. The postfix quantifiers are @samp{?} (zero or one),
|
||||
@@ -5973,6 +6026,7 @@ Introduced in Bison 3.8.
|
||||
|
||||
@deffn {Directive} %header @var{header-file}
|
||||
Same as above, but save in the file @file{@var{header-file}}.
|
||||
The @var{header-file} name should not contain slashes.
|
||||
@end deffn
|
||||
|
||||
@deffn {Directive} %language "@var{language}"
|
||||
@@ -6026,6 +6080,7 @@ file, treating it as an independent source file in its own right.
|
||||
|
||||
@deffn {Directive} %output "@var{file}"
|
||||
Generate the parser implementation in @file{@var{file}}.
|
||||
The @var{file} name should not contain slashes.
|
||||
@end deffn
|
||||
|
||||
@deffn {Directive} %pure-parser
|
||||
@@ -6841,6 +6896,23 @@ Introduced in Bison 3.0.3.
|
||||
@c api.value.union.name
|
||||
|
||||
|
||||
@c ================================================== cex.timeout
|
||||
|
||||
@deffn Directive {%define cex.timeout} @var{duration}
|
||||
|
||||
@itemize @bullet
|
||||
@item Language(s): all
|
||||
|
||||
@item Purpose:
|
||||
Define the time limit for finding unifying counterexamples.
|
||||
|
||||
@item Accepted Values: duration in seconds, e.g., @samp{1}, @samp{0.5}.
|
||||
|
||||
@item Default Value: 5
|
||||
@end itemize
|
||||
@end deffn
|
||||
|
||||
|
||||
@c ================================================== lr.default-reduction
|
||||
|
||||
@deffn Directive {%define lr.default-reduction} @var{when}
|
||||
@@ -7509,22 +7581,41 @@ numeric code for that character is also the code for the token kind. So
|
||||
@code{unsigned char} to avoid sign-extension. The null character must not
|
||||
be used this way, because its code is zero and that signifies end-of-input.
|
||||
|
||||
Here is an example showing these things:
|
||||
A simple program might use the following declaration:
|
||||
|
||||
@example
|
||||
%code provides @{
|
||||
int yylex (void);
|
||||
@}
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
and the following definition, either in the grammar file itself or in some
|
||||
other module that has @code{#include "y.tab.h"}:
|
||||
|
||||
@example
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
yylex (void)
|
||||
@{
|
||||
@dots{}
|
||||
if (c == EOF) /* Detect end-of-input. */
|
||||
return YYEOF;
|
||||
@dots{}
|
||||
else if (c == '+' || c == '-')
|
||||
return c; /* Assume token kind for '+' is '+'. */
|
||||
@dots{}
|
||||
else
|
||||
return INT; /* Return the kind of the token. */
|
||||
@dots{}
|
||||
for (;;)
|
||||
@{
|
||||
int c = getchar ();
|
||||
if (c == EOF)
|
||||
return YYEOF; /* Report end-of-input. */
|
||||
if (c == '+' || c == '-')
|
||||
return c; /* Assume token kind for '+' is '+'. */
|
||||
if ('0' <= c && c <= '9')
|
||||
@{
|
||||
yylval = c - '0';
|
||||
while ('0' <= (c = getchar ()) && c <= '9')
|
||||
yylval = yylval * 10 + (c - '0');
|
||||
ungetc (c, stdin);
|
||||
return INT; /* Return the kind of the token. */
|
||||
@}
|
||||
@dots{}
|
||||
@}
|
||||
@}
|
||||
@end example
|
||||
|
||||
@@ -7539,15 +7630,18 @@ utility can be used without change as the definition of @code{yylex}.
|
||||
In addition to the user defined tokens, Bison generates a few special tokens
|
||||
that @code{yylex} may return.
|
||||
|
||||
@findex YYEOF
|
||||
The @code{YYEOF} token denotes the end of file, and signals to the parser
|
||||
that there is nothing left afterwards. @xref{Calling Convention}, for an
|
||||
example.
|
||||
|
||||
@findex YYUNDEF
|
||||
Returning @code{YYUNDEF} tells the parser that some lexical error was found.
|
||||
It will emit an error message about an ``invalid token'', and enter
|
||||
error-recovery (@pxref{Error Recovery}). Returning an unknown token kind
|
||||
results in the exact same behavior.
|
||||
|
||||
@findex YYerror
|
||||
Returning @code{YYerror} requires the parser to enter error-recovery
|
||||
@emph{without} emitting an error message. This way the lexical analyzer can
|
||||
produce an accurate error messages about the invalid input (something the
|
||||
@@ -7799,10 +7893,22 @@ In some cases diagnostics like @w{@code{"syntax error"}} are
|
||||
translated automatically from English to some other language before
|
||||
they are passed to @code{yyerror}. @xref{Internationalization}.
|
||||
|
||||
The following definition suffices in simple programs:
|
||||
A simple program might use the following declaration:
|
||||
|
||||
@example
|
||||
%code provides @{
|
||||
void yyerror (char const *);
|
||||
@}
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
and the following definition, either in the grammar file itself or in some
|
||||
other module that has @code{#include "y.tab.h"}:
|
||||
|
||||
@example
|
||||
@group
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
yyerror (char const *s)
|
||||
@{
|
||||
@@ -11544,22 +11650,26 @@ Options controlling the diagnostics.
|
||||
Output warnings falling in @var{category}. @var{category} can be one
|
||||
of:
|
||||
@table @code
|
||||
@item @anchor{Wconflicts-sr}conflicts-sr
|
||||
@itemx @anchor{Wconflicts-rr}conflicts-rr
|
||||
@item conflicts-sr
|
||||
@itemx conflicts-rr
|
||||
@anchor{Wconflicts-sr}
|
||||
@anchor{Wconflicts-rr}
|
||||
S/R and R/R conflicts. These warnings are enabled by default. However, if
|
||||
the @code{%expect} or @code{%expect-rr} directive is specified, an
|
||||
unexpected number of conflicts is an error, and an expected number of
|
||||
conflicts is not reported, so @option{-W} and @option{--warning} then have
|
||||
no effect on the conflict report.
|
||||
|
||||
@item @anchor{Wcounterexamples}counterexamples
|
||||
@item counterexamples
|
||||
@itemx cex
|
||||
@anchor{Wcounterexamples}
|
||||
Provide counterexamples for conflicts. @xref{Counterexamples}.
|
||||
Counterexamples take time to compute. The option @option{-Wcex} should be
|
||||
used by the developer when working on the grammar; it hardly makes sense to
|
||||
use it in a CI.
|
||||
|
||||
@item @anchor{Wdangling-alias}dangling-alias
|
||||
@item dangling-alias
|
||||
@anchor{Wdangling-alias}
|
||||
Report string literals that are not bound to a token symbol.
|
||||
|
||||
String literals, which allow for better error messages, are (too) liberally
|
||||
@@ -11605,16 +11715,19 @@ foo: "baz" @{@}
|
||||
| @dwarning{^~~~~}
|
||||
@end example
|
||||
|
||||
@item @anchor{Wdeprecated}deprecated
|
||||
@item deprecated
|
||||
@anchor{Wdeprecated}
|
||||
Deprecated constructs whose support will be removed in future versions of
|
||||
Bison.
|
||||
|
||||
@item @anchor{Wempty-rule}empty-rule
|
||||
@item empty-rule
|
||||
@anchor{Wempty-rule}
|
||||
Empty rules without @code{%empty}. @xref{Empty Rules}. Disabled by
|
||||
default, but enabled by uses of @code{%empty}, unless
|
||||
@option{-Wno-empty-rule} was specified.
|
||||
|
||||
@item @anchor{Wmidrule-values}midrule-values
|
||||
@item midrule-values
|
||||
@anchor{Wmidrule-values}
|
||||
Warn about midrule values that are set but not used within any of the actions
|
||||
of the parent rule.
|
||||
For example, warn about unused @code{$2} in:
|
||||
@@ -11634,7 +11747,8 @@ These warnings are not enabled by default since they sometimes prove to
|
||||
be false alarms in existing grammars employing the Yacc constructs
|
||||
@code{$0} or @code{$-@var{n}} (where @var{n} is some positive integer).
|
||||
|
||||
@item @anchor{Wprecedence}precedence
|
||||
@item precedence
|
||||
@anchor{Wprecedence}
|
||||
Useless precedence and associativity directives. Disabled by default.
|
||||
|
||||
Consider for instance the following grammar:
|
||||
@@ -11695,21 +11809,24 @@ One would get the exact same parser with the following directives instead:
|
||||
@end group
|
||||
@end example
|
||||
|
||||
@item @anchor{Wyacc}yacc
|
||||
@item yacc
|
||||
@anchor{Wyacc}
|
||||
Incompatibilities with POSIX Yacc.
|
||||
|
||||
@item @anchor{Wother}other
|
||||
@item other
|
||||
@anchor{Wother}
|
||||
All warnings not categorized above. These warnings are enabled by default.
|
||||
|
||||
This category is provided merely for the sake of completeness. Future
|
||||
releases of Bison may move warnings from this category to new, more specific
|
||||
categories.
|
||||
|
||||
@item @anchor{Wall}all
|
||||
@item all
|
||||
All the warnings except @code{counterexamples}, @code{dangling-alias} and
|
||||
@code{yacc}.
|
||||
|
||||
@item @anchor{Wnone}none
|
||||
@item none
|
||||
@anchor{Wnone}
|
||||
Turn off all the warnings.
|
||||
|
||||
@item error
|
||||
@@ -11720,7 +11837,8 @@ A category can be turned off by prefixing its name with @samp{no-}. For
|
||||
instance, @option{-Wno-yacc} will hide the warnings about
|
||||
POSIX Yacc incompatibilities.
|
||||
|
||||
@item @anchor{Werror}-Werror
|
||||
@item -Werror
|
||||
@anchor{Werror}
|
||||
Turn enabled warnings for every @var{category} into errors, unless they are
|
||||
explicitly disabled by @option{-Wno-error=@var{category}}.
|
||||
|
||||
@@ -11868,7 +11986,8 @@ This is similar to how most shells resolve commands.
|
||||
Pretend that @code{%token-table} was specified. @xref{Decl Summary}.
|
||||
|
||||
@item -y
|
||||
@itemx @anchor{option-yacc} --yacc
|
||||
@itemx --yacc
|
||||
@anchor{option-yacc}
|
||||
Act more like the traditional @command{yacc} command:
|
||||
@itemize
|
||||
@item
|
||||
@@ -12115,7 +12234,8 @@ generate C++.
|
||||
@example
|
||||
/* Simple variant-based parser. -*- C++ -*-
|
||||
|
||||
Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988--1993, 1995, 1998--2015, 2018--2021, 2025--2026
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -13206,7 +13326,8 @@ library components, and the declaration of the parser class.
|
||||
@example
|
||||
/* Driver for calc++. -*- C++ -*-
|
||||
|
||||
Copyright (C) 2005-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988--1993, 1995, 1998--2015, 2018--2021, 2025--2026
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -13302,7 +13423,8 @@ The implementation of the driver (@file{driver.cc}) is straightforward.
|
||||
@example
|
||||
/* Driver for calc++. -*- C++ -*-
|
||||
|
||||
Copyright (C) 2005-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988--1993, 1995, 1998--2015, 2018--2021, 2025--2026
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -13369,7 +13491,8 @@ designed the grammar for.
|
||||
@example
|
||||
/* Parser for calc++. -*- C++ -*-
|
||||
|
||||
Copyright (C) 2005-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988--1993, 1995, 1998--2015, 2018--2021, 2025--2026
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -13581,7 +13704,8 @@ then the parser's to get the set of defined tokens.
|
||||
@example
|
||||
/* Scanner for calc++. -*- C++ -*-
|
||||
|
||||
Copyright (C) 2005-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988--1993, 1995, 1998--2015, 2018--2021, 2025--2026
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -13735,8 +13859,14 @@ the blanks preceding tokens. Comments would be treated equally.
|
||||
@example
|
||||
@group
|
||||
%@{
|
||||
// Take 8-space tabulations into account.
|
||||
void add_columns (yy::location& loc, const char *buf, int bufsize)
|
||||
@{
|
||||
for (int i = 0; i < bufsize; ++i)
|
||||
loc.columns (buf[i] == '\t' ? 8 - ((loc.end.column - 1) & 7) : 1);
|
||||
@}
|
||||
// Code run each time a pattern is matched.
|
||||
# define YY_USER_ACTION loc.columns (yyleng);
|
||||
#define YY_USER_ACTION add_columns (loc, yytext, yyleng);
|
||||
%@}
|
||||
@end group
|
||||
%%
|
||||
@@ -13836,7 +13966,8 @@ The top level file, @file{calc++.cc}, poses no problem.
|
||||
@example
|
||||
/* Main for calc++. -*- C++ -*-
|
||||
|
||||
Copyright (C) 2005-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988--1993, 1995, 1998--2015, 2018--2021, 2025--2026
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+29
-28
@@ -2,48 +2,49 @@
|
||||
bison \- GNU Project parser generator (yacc replacement)
|
||||
|
||||
[description]
|
||||
.I Bison
|
||||
is a parser generator in the style of
|
||||
.IR yacc (1).
|
||||
It should be upwardly compatible with input files designed
|
||||
for
|
||||
.IR yacc .
|
||||
The
|
||||
.B bison
|
||||
parser generator inputs grammars in the style of
|
||||
.BR yacc (1)
|
||||
and outputs parsers for those grammers.
|
||||
.PP
|
||||
Input files should follow the
|
||||
.I yacc
|
||||
.B yacc
|
||||
convention of ending in
|
||||
.BR .y .
|
||||
.IR .y .
|
||||
Unlike
|
||||
.IR yacc ,
|
||||
.BR yacc ,
|
||||
the generated files do not have fixed names, but instead use the prefix
|
||||
of the input file.
|
||||
Moreover, if you need to put
|
||||
.I C++
|
||||
code in the input file, you can end his name by a C++-like extension
|
||||
(.ypp or .y++), then bison will follow your extension to name the
|
||||
output file (.cpp or .c++).
|
||||
Moreover, if you need to put C++
|
||||
code in the input file, you can end its name by a C++-like extension
|
||||
.RI ( .ypp
|
||||
or
|
||||
.IR .y++ ),
|
||||
and then
|
||||
.B bison
|
||||
will follow your extension to name the
|
||||
output file
|
||||
.RI ( .cpp
|
||||
or
|
||||
.IR .c++ ).
|
||||
For instance, a grammar description file named
|
||||
.B parse.yxx
|
||||
.I parse.yxx
|
||||
would produce the generated parser in a file named
|
||||
.BR parse.tab.cxx ,
|
||||
.IR parse.tab.cxx ,
|
||||
instead of
|
||||
.IR yacc 's
|
||||
.B y.tab.c
|
||||
or old
|
||||
.I Bison
|
||||
version's
|
||||
.BR parse.tab.c .
|
||||
.BR yacc 's
|
||||
.IR y.tab.c .
|
||||
.PP
|
||||
This description of the options that can be given to
|
||||
.I bison
|
||||
.B bison
|
||||
is adapted from the node
|
||||
.B Invocation
|
||||
in the
|
||||
.B bison.texi
|
||||
manual, which should be taken as authoritative.
|
||||
in the Bison manual, which should be taken as authoritative.
|
||||
.PP
|
||||
.I Bison
|
||||
supports both traditional single-letter options and mnemonic long
|
||||
The
|
||||
.B bison
|
||||
command supports both traditional single-letter options and mnemonic long
|
||||
option names. Long option names are indicated with
|
||||
.B \-\-
|
||||
instead of
|
||||
|
||||
+505
@@ -0,0 +1,505 @@
|
||||
@c The GNU Free Documentation License.
|
||||
@center Version 1.3, 3 November 2008
|
||||
|
||||
@c This file is intended to be included within another document,
|
||||
@c hence no sectioning command or @node.
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
|
||||
@uref{https://fsf.org/}
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
@end display
|
||||
|
||||
@enumerate 0
|
||||
@item
|
||||
PREAMBLE
|
||||
|
||||
The purpose of this License is to make a manual, textbook, or other
|
||||
functional and useful document @dfn{free} in the sense of freedom: to
|
||||
assure everyone the effective freedom to copy and redistribute it,
|
||||
with or without modifying it, either commercially or noncommercially.
|
||||
Secondarily, this License preserves for the author and publisher a way
|
||||
to get credit for their work, while not being considered responsible
|
||||
for modifications made by others.
|
||||
|
||||
This License is a kind of ``copyleft'', which means that derivative
|
||||
works of the document must themselves be free in the same sense. It
|
||||
complements the GNU General Public License, which is a copyleft
|
||||
license designed for free software.
|
||||
|
||||
We have designed this License in order to use it for manuals for free
|
||||
software, because free software needs free documentation: a free
|
||||
program should come with manuals providing the same freedoms that the
|
||||
software does. But this License is not limited to software manuals;
|
||||
it can be used for any textual work, regardless of subject matter or
|
||||
whether it is published as a printed book. We recommend this License
|
||||
principally for works whose purpose is instruction or reference.
|
||||
|
||||
@item
|
||||
APPLICABILITY AND DEFINITIONS
|
||||
|
||||
This License applies to any manual or other work, in any medium, that
|
||||
contains a notice placed by the copyright holder saying it can be
|
||||
distributed under the terms of this License. Such a notice grants a
|
||||
world-wide, royalty-free license, unlimited in duration, to use that
|
||||
work under the conditions stated herein. The ``Document'', below,
|
||||
refers to any such manual or work. Any member of the public is a
|
||||
licensee, and is addressed as ``you''. You accept the license if you
|
||||
copy, modify or distribute the work in a way requiring permission
|
||||
under copyright law.
|
||||
|
||||
A ``Modified Version'' of the Document means any work containing the
|
||||
Document or a portion of it, either copied verbatim, or with
|
||||
modifications and/or translated into another language.
|
||||
|
||||
A ``Secondary Section'' is a named appendix or a front-matter section
|
||||
of the Document that deals exclusively with the relationship of the
|
||||
publishers or authors of the Document to the Document's overall
|
||||
subject (or to related matters) and contains nothing that could fall
|
||||
directly within that overall subject. (Thus, if the Document is in
|
||||
part a textbook of mathematics, a Secondary Section may not explain
|
||||
any mathematics.) The relationship could be a matter of historical
|
||||
connection with the subject or with related matters, or of legal,
|
||||
commercial, philosophical, ethical or political position regarding
|
||||
them.
|
||||
|
||||
The ``Invariant Sections'' are certain Secondary Sections whose titles
|
||||
are designated, as being those of Invariant Sections, in the notice
|
||||
that says that the Document is released under this License. If a
|
||||
section does not fit the above definition of Secondary then it is not
|
||||
allowed to be designated as Invariant. The Document may contain zero
|
||||
Invariant Sections. If the Document does not identify any Invariant
|
||||
Sections then there are none.
|
||||
|
||||
The ``Cover Texts'' are certain short passages of text that are listed,
|
||||
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
|
||||
the Document is released under this License. A Front-Cover Text may
|
||||
be at most 5 words, and a Back-Cover Text may be at most 25 words.
|
||||
|
||||
A ``Transparent'' copy of the Document means a machine-readable copy,
|
||||
represented in a format whose specification is available to the
|
||||
general public, that is suitable for revising the document
|
||||
straightforwardly with generic text editors or (for images composed of
|
||||
pixels) generic paint programs or (for drawings) some widely available
|
||||
drawing editor, and that is suitable for input to text formatters or
|
||||
for automatic translation to a variety of formats suitable for input
|
||||
to text formatters. A copy made in an otherwise Transparent file
|
||||
format whose markup, or absence of markup, has been arranged to thwart
|
||||
or discourage subsequent modification by readers is not Transparent.
|
||||
An image format is not Transparent if used for any substantial amount
|
||||
of text. A copy that is not ``Transparent'' is called ``Opaque''.
|
||||
|
||||
Examples of suitable formats for Transparent copies include plain
|
||||
ASCII without markup, Texinfo input format, La@TeX{} input
|
||||
format, SGML or XML using a publicly available
|
||||
DTD, and standard-conforming simple HTML,
|
||||
PostScript or PDF designed for human modification. Examples
|
||||
of transparent image formats include PNG, XCF and
|
||||
JPG@. Opaque formats include proprietary formats that can be
|
||||
read and edited only by proprietary word processors, SGML or
|
||||
XML for which the DTD and/or processing tools are
|
||||
not generally available, and the machine-generated HTML,
|
||||
PostScript or PDF produced by some word processors for
|
||||
output purposes only.
|
||||
|
||||
The ``Title Page'' means, for a printed book, the title page itself,
|
||||
plus such following pages as are needed to hold, legibly, the material
|
||||
this License requires to appear in the title page. For works in
|
||||
formats which do not have any title page as such, ``Title Page'' means
|
||||
the text near the most prominent appearance of the work's title,
|
||||
preceding the beginning of the body of the text.
|
||||
|
||||
The ``publisher'' means any person or entity that distributes copies
|
||||
of the Document to the public.
|
||||
|
||||
A section ``Entitled XYZ'' means a named subunit of the Document whose
|
||||
title either is precisely XYZ or contains XYZ in parentheses following
|
||||
text that translates XYZ in another language. (Here XYZ stands for a
|
||||
specific section name mentioned below, such as ``Acknowledgements'',
|
||||
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
|
||||
of such a section when you modify the Document means that it remains a
|
||||
section ``Entitled XYZ'' according to this definition.
|
||||
|
||||
The Document may include Warranty Disclaimers next to the notice which
|
||||
states that this License applies to the Document. These Warranty
|
||||
Disclaimers are considered to be included by reference in this
|
||||
License, but only as regards disclaiming warranties: any other
|
||||
implication that these Warranty Disclaimers may have is void and has
|
||||
no effect on the meaning of this License.
|
||||
|
||||
@item
|
||||
VERBATIM COPYING
|
||||
|
||||
You may copy and distribute the Document in any medium, either
|
||||
commercially or noncommercially, provided that this License, the
|
||||
copyright notices, and the license notice saying this License applies
|
||||
to the Document are reproduced in all copies, and that you add no other
|
||||
conditions whatsoever to those of this License. You may not use
|
||||
technical measures to obstruct or control the reading or further
|
||||
copying of the copies you make or distribute. However, you may accept
|
||||
compensation in exchange for copies. If you distribute a large enough
|
||||
number of copies you must also follow the conditions in section 3.
|
||||
|
||||
You may also lend copies, under the same conditions stated above, and
|
||||
you may publicly display copies.
|
||||
|
||||
@item
|
||||
COPYING IN QUANTITY
|
||||
|
||||
If you publish printed copies (or copies in media that commonly have
|
||||
printed covers) of the Document, numbering more than 100, and the
|
||||
Document's license notice requires Cover Texts, you must enclose the
|
||||
copies in covers that carry, clearly and legibly, all these Cover
|
||||
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
|
||||
the back cover. Both covers must also clearly and legibly identify
|
||||
you as the publisher of these copies. The front cover must present
|
||||
the full title with all words of the title equally prominent and
|
||||
visible. You may add other material on the covers in addition.
|
||||
Copying with changes limited to the covers, as long as they preserve
|
||||
the title of the Document and satisfy these conditions, can be treated
|
||||
as verbatim copying in other respects.
|
||||
|
||||
If the required texts for either cover are too voluminous to fit
|
||||
legibly, you should put the first ones listed (as many as fit
|
||||
reasonably) on the actual cover, and continue the rest onto adjacent
|
||||
pages.
|
||||
|
||||
If you publish or distribute Opaque copies of the Document numbering
|
||||
more than 100, you must either include a machine-readable Transparent
|
||||
copy along with each Opaque copy, or state in or with each Opaque copy
|
||||
a computer-network location from which the general network-using
|
||||
public has access to download using public-standard network protocols
|
||||
a complete Transparent copy of the Document, free of added material.
|
||||
If you use the latter option, you must take reasonably prudent steps,
|
||||
when you begin distribution of Opaque copies in quantity, to ensure
|
||||
that this Transparent copy will remain thus accessible at the stated
|
||||
location until at least one year after the last time you distribute an
|
||||
Opaque copy (directly or through your agents or retailers) of that
|
||||
edition to the public.
|
||||
|
||||
It is requested, but not required, that you contact the authors of the
|
||||
Document well before redistributing any large number of copies, to give
|
||||
them a chance to provide you with an updated version of the Document.
|
||||
|
||||
@item
|
||||
MODIFICATIONS
|
||||
|
||||
You may copy and distribute a Modified Version of the Document under
|
||||
the conditions of sections 2 and 3 above, provided that you release
|
||||
the Modified Version under precisely this License, with the Modified
|
||||
Version filling the role of the Document, thus licensing distribution
|
||||
and modification of the Modified Version to whoever possesses a copy
|
||||
of it. In addition, you must do these things in the Modified Version:
|
||||
|
||||
@enumerate A
|
||||
@item
|
||||
Use in the Title Page (and on the covers, if any) a title distinct
|
||||
from that of the Document, and from those of previous versions
|
||||
(which should, if there were any, be listed in the History section
|
||||
of the Document). You may use the same title as a previous version
|
||||
if the original publisher of that version gives permission.
|
||||
|
||||
@item
|
||||
List on the Title Page, as authors, one or more persons or entities
|
||||
responsible for authorship of the modifications in the Modified
|
||||
Version, together with at least five of the principal authors of the
|
||||
Document (all of its principal authors, if it has fewer than five),
|
||||
unless they release you from this requirement.
|
||||
|
||||
@item
|
||||
State on the Title page the name of the publisher of the
|
||||
Modified Version, as the publisher.
|
||||
|
||||
@item
|
||||
Preserve all the copyright notices of the Document.
|
||||
|
||||
@item
|
||||
Add an appropriate copyright notice for your modifications
|
||||
adjacent to the other copyright notices.
|
||||
|
||||
@item
|
||||
Include, immediately after the copyright notices, a license notice
|
||||
giving the public permission to use the Modified Version under the
|
||||
terms of this License, in the form shown in the Addendum below.
|
||||
|
||||
@item
|
||||
Preserve in that license notice the full lists of Invariant Sections
|
||||
and required Cover Texts given in the Document's license notice.
|
||||
|
||||
@item
|
||||
Include an unaltered copy of this License.
|
||||
|
||||
@item
|
||||
Preserve the section Entitled ``History'', Preserve its Title, and add
|
||||
to it an item stating at least the title, year, new authors, and
|
||||
publisher of the Modified Version as given on the Title Page. If
|
||||
there is no section Entitled ``History'' in the Document, create one
|
||||
stating the title, year, authors, and publisher of the Document as
|
||||
given on its Title Page, then add an item describing the Modified
|
||||
Version as stated in the previous sentence.
|
||||
|
||||
@item
|
||||
Preserve the network location, if any, given in the Document for
|
||||
public access to a Transparent copy of the Document, and likewise
|
||||
the network locations given in the Document for previous versions
|
||||
it was based on. These may be placed in the ``History'' section.
|
||||
You may omit a network location for a work that was published at
|
||||
least four years before the Document itself, or if the original
|
||||
publisher of the version it refers to gives permission.
|
||||
|
||||
@item
|
||||
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
|
||||
the Title of the section, and preserve in the section all the
|
||||
substance and tone of each of the contributor acknowledgements and/or
|
||||
dedications given therein.
|
||||
|
||||
@item
|
||||
Preserve all the Invariant Sections of the Document,
|
||||
unaltered in their text and in their titles. Section numbers
|
||||
or the equivalent are not considered part of the section titles.
|
||||
|
||||
@item
|
||||
Delete any section Entitled ``Endorsements''. Such a section
|
||||
may not be included in the Modified Version.
|
||||
|
||||
@item
|
||||
Do not retitle any existing section to be Entitled ``Endorsements'' or
|
||||
to conflict in title with any Invariant Section.
|
||||
|
||||
@item
|
||||
Preserve any Warranty Disclaimers.
|
||||
@end enumerate
|
||||
|
||||
If the Modified Version includes new front-matter sections or
|
||||
appendices that qualify as Secondary Sections and contain no material
|
||||
copied from the Document, you may at your option designate some or all
|
||||
of these sections as invariant. To do this, add their titles to the
|
||||
list of Invariant Sections in the Modified Version's license notice.
|
||||
These titles must be distinct from any other section titles.
|
||||
|
||||
You may add a section Entitled ``Endorsements'', provided it contains
|
||||
nothing but endorsements of your Modified Version by various
|
||||
parties---for example, statements of peer review or that the text has
|
||||
been approved by an organization as the authoritative definition of a
|
||||
standard.
|
||||
|
||||
You may add a passage of up to five words as a Front-Cover Text, and a
|
||||
passage of up to 25 words as a Back-Cover Text, to the end of the list
|
||||
of Cover Texts in the Modified Version. Only one passage of
|
||||
Front-Cover Text and one of Back-Cover Text may be added by (or
|
||||
through arrangements made by) any one entity. If the Document already
|
||||
includes a cover text for the same cover, previously added by you or
|
||||
by arrangement made by the same entity you are acting on behalf of,
|
||||
you may not add another; but you may replace the old one, on explicit
|
||||
permission from the previous publisher that added the old one.
|
||||
|
||||
The author(s) and publisher(s) of the Document do not by this License
|
||||
give permission to use their names for publicity for or to assert or
|
||||
imply endorsement of any Modified Version.
|
||||
|
||||
@item
|
||||
COMBINING DOCUMENTS
|
||||
|
||||
You may combine the Document with other documents released under this
|
||||
License, under the terms defined in section 4 above for modified
|
||||
versions, provided that you include in the combination all of the
|
||||
Invariant Sections of all of the original documents, unmodified, and
|
||||
list them all as Invariant Sections of your combined work in its
|
||||
license notice, and that you preserve all their Warranty Disclaimers.
|
||||
|
||||
The combined work need only contain one copy of this License, and
|
||||
multiple identical Invariant Sections may be replaced with a single
|
||||
copy. If there are multiple Invariant Sections with the same name but
|
||||
different contents, make the title of each such section unique by
|
||||
adding at the end of it, in parentheses, the name of the original
|
||||
author or publisher of that section if known, or else a unique number.
|
||||
Make the same adjustment to the section titles in the list of
|
||||
Invariant Sections in the license notice of the combined work.
|
||||
|
||||
In the combination, you must combine any sections Entitled ``History''
|
||||
in the various original documents, forming one section Entitled
|
||||
``History''; likewise combine any sections Entitled ``Acknowledgements'',
|
||||
and any sections Entitled ``Dedications''. You must delete all
|
||||
sections Entitled ``Endorsements.''
|
||||
|
||||
@item
|
||||
COLLECTIONS OF DOCUMENTS
|
||||
|
||||
You may make a collection consisting of the Document and other documents
|
||||
released under this License, and replace the individual copies of this
|
||||
License in the various documents with a single copy that is included in
|
||||
the collection, provided that you follow the rules of this License for
|
||||
verbatim copying of each of the documents in all other respects.
|
||||
|
||||
You may extract a single document from such a collection, and distribute
|
||||
it individually under this License, provided you insert a copy of this
|
||||
License into the extracted document, and follow this License in all
|
||||
other respects regarding verbatim copying of that document.
|
||||
|
||||
@item
|
||||
AGGREGATION WITH INDEPENDENT WORKS
|
||||
|
||||
A compilation of the Document or its derivatives with other separate
|
||||
and independent documents or works, in or on a volume of a storage or
|
||||
distribution medium, is called an ``aggregate'' if the copyright
|
||||
resulting from the compilation is not used to limit the legal rights
|
||||
of the compilation's users beyond what the individual works permit.
|
||||
When the Document is included in an aggregate, this License does not
|
||||
apply to the other works in the aggregate which are not themselves
|
||||
derivative works of the Document.
|
||||
|
||||
If the Cover Text requirement of section 3 is applicable to these
|
||||
copies of the Document, then if the Document is less than one half of
|
||||
the entire aggregate, the Document's Cover Texts may be placed on
|
||||
covers that bracket the Document within the aggregate, or the
|
||||
electronic equivalent of covers if the Document is in electronic form.
|
||||
Otherwise they must appear on printed covers that bracket the whole
|
||||
aggregate.
|
||||
|
||||
@item
|
||||
TRANSLATION
|
||||
|
||||
Translation is considered a kind of modification, so you may
|
||||
distribute translations of the Document under the terms of section 4.
|
||||
Replacing Invariant Sections with translations requires special
|
||||
permission from their copyright holders, but you may include
|
||||
translations of some or all Invariant Sections in addition to the
|
||||
original versions of these Invariant Sections. You may include a
|
||||
translation of this License, and all the license notices in the
|
||||
Document, and any Warranty Disclaimers, provided that you also include
|
||||
the original English version of this License and the original versions
|
||||
of those notices and disclaimers. In case of a disagreement between
|
||||
the translation and the original version of this License or a notice
|
||||
or disclaimer, the original version will prevail.
|
||||
|
||||
If a section in the Document is Entitled ``Acknowledgements'',
|
||||
``Dedications'', or ``History'', the requirement (section 4) to Preserve
|
||||
its Title (section 1) will typically require changing the actual
|
||||
title.
|
||||
|
||||
@item
|
||||
TERMINATION
|
||||
|
||||
You may not copy, modify, sublicense, or distribute the Document
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense, or distribute it is void, and
|
||||
will automatically terminate your rights under this License.
|
||||
|
||||
However, if you cease all violation of this License, then your license
|
||||
from a particular copyright holder is reinstated (a) provisionally,
|
||||
unless and until the copyright holder explicitly and finally
|
||||
terminates your license, and (b) permanently, if the copyright holder
|
||||
fails to notify you of the violation by some reasonable means prior to
|
||||
60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, receipt of a copy of some or all of the same material does
|
||||
not give you any rights to use it.
|
||||
|
||||
@item
|
||||
FUTURE REVISIONS OF THIS LICENSE
|
||||
|
||||
The Free Software Foundation may publish new, revised versions
|
||||
of the GNU Free Documentation License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns. See
|
||||
@uref{https://www.gnu.org/licenses/}.
|
||||
|
||||
Each version of the License is given a distinguishing version number.
|
||||
If the Document specifies that a particular numbered version of this
|
||||
License ``or any later version'' applies to it, you have the option of
|
||||
following the terms and conditions either of that specified version or
|
||||
of any later version that has been published (not as a draft) by the
|
||||
Free Software Foundation. If the Document does not specify a version
|
||||
number of this License, you may choose any version ever published (not
|
||||
as a draft) by the Free Software Foundation. If the Document
|
||||
specifies that a proxy can decide which future versions of this
|
||||
License can be used, that proxy's public statement of acceptance of a
|
||||
version permanently authorizes you to choose that version for the
|
||||
Document.
|
||||
|
||||
@item
|
||||
RELICENSING
|
||||
|
||||
``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
|
||||
World Wide Web server that publishes copyrightable works and also
|
||||
provides prominent facilities for anybody to edit those works. A
|
||||
public wiki that anybody can edit is an example of such a server. A
|
||||
``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
|
||||
site means any set of copyrightable works thus published on the MMC
|
||||
site.
|
||||
|
||||
``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
|
||||
license published by Creative Commons Corporation, a not-for-profit
|
||||
corporation with a principal place of business in San Francisco,
|
||||
California, as well as future copyleft versions of that license
|
||||
published by that same organization.
|
||||
|
||||
``Incorporate'' means to publish or republish a Document, in whole or
|
||||
in part, as part of another Document.
|
||||
|
||||
An MMC is ``eligible for relicensing'' if it is licensed under this
|
||||
License, and if all works that were first published under this License
|
||||
somewhere other than this MMC, and subsequently incorporated in whole
|
||||
or in part into the MMC, (1) had no cover texts or invariant sections,
|
||||
and (2) were thus incorporated prior to November 1, 2008.
|
||||
|
||||
The operator of an MMC Site may republish an MMC contained in the site
|
||||
under CC-BY-SA on the same site at any time before August 1, 2009,
|
||||
provided the MMC is eligible for relicensing.
|
||||
|
||||
@end enumerate
|
||||
|
||||
@page
|
||||
@heading ADDENDUM: How to use this License for your documents
|
||||
|
||||
To use this License in a document you have written, include a copy of
|
||||
the License in the document and put the following copyright and
|
||||
license notices just after the title page:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
Copyright (C) @var{year} @var{your name}.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
|
||||
Texts. A copy of the license is included in the section entitled ``GNU
|
||||
Free Documentation License''.
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
|
||||
replace the ``with@dots{}Texts.''@: line with this:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
with the Invariant Sections being @var{list their titles}, with
|
||||
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
|
||||
being @var{list}.
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
If you have Invariant Sections without Cover Texts, or some other
|
||||
combination of the three, merge those two alternatives to suit the
|
||||
situation.
|
||||
|
||||
If your document contains nontrivial examples of program code, we
|
||||
recommend releasing these examples in parallel under your choice of
|
||||
free software license, such as the GNU General Public License,
|
||||
to permit their use in free software.
|
||||
|
||||
@c Local Variables:
|
||||
@c ispell-local-pdict: "ispell-dict"
|
||||
@c End:
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
## Copyright (C) 2001-2003, 2005-2015, 2018-2021 Free Software
|
||||
## Foundation, Inc.
|
||||
## Copyright (C) 2001-2003, 2005-2015, 2018-2022, 2025-2026 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
|
||||
@@ -114,7 +114,7 @@ $(top_srcdir)/%D%/bison.help: src/bison$(EXEEXT)
|
||||
$(AM_V_at) LC_ALL=C tests/bison --version >%D%/bison.help.tmp
|
||||
$(AM_V_at) LC_ALL=C tests/bison --help | \
|
||||
## Avoid depending on the path to Bison.
|
||||
sed -e 's,^Usage: .*/bison \[OPTION\],Usage: bison [OPTION],g' \
|
||||
sed -e 's,^Usage: .*/bison \[OPTION],Usage: bison [OPTION],g' \
|
||||
## Avoid variations in the output depending on whether we are
|
||||
## on a glibc system.
|
||||
-e '/translation bugs/d' >>%D%/bison.help.tmp
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@
|
||||
\def\finalout{\overfullrule=0pt}
|
||||
%\finalout
|
||||
|
||||
% Copyright (c) 1998, 2001, 2009--2015, 2018--2021 Free Software
|
||||
% Foundation, Inc.
|
||||
% Copyright (c) 1998, 2001, 2009--2015, 2018--2022, 2025--2026 Free
|
||||
% Software Foundation, Inc.
|
||||
%
|
||||
% This file is part of Bison.
|
||||
%
|
||||
|
||||
+4
-3
@@ -5,14 +5,15 @@ yacc \- GNU Project parser generator
|
||||
.B yacc
|
||||
[\fIOPTION\fR]... \fIFILE\fR
|
||||
.SH DESCRIPTION
|
||||
.I Yacc
|
||||
The program
|
||||
.B yacc
|
||||
(Yet Another Compiler Compiler) is a parser generator. This
|
||||
version is a simple wrapper around
|
||||
.IR bison (1).
|
||||
.BR bison (1).
|
||||
It passes option
|
||||
\fB\-y\fR, \fB\-\-yacc\fR
|
||||
to activate the upward compatibility mode. See
|
||||
.IR bison (1)
|
||||
.BR bison (1)
|
||||
for more information.
|
||||
.SH AUTHOR
|
||||
Written by Paul Eggert.
|
||||
|
||||
+2
-1
@@ -22,7 +22,8 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2006, 2009-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2009-2015, 2018-2022, 2025-2026 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2006, 2008-2015, 2018-2021 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright (C) 2006, 2008-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
#
|
||||
# This file is part of Bison, the GNU Compiler Compiler.
|
||||
#
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
## Copyright (C) 2006, 2008-2015, 2018-2021 Free Software Foundation,
|
||||
## Inc.
|
||||
## Copyright (C) 2006, 2008-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
*.c
|
||||
*.cc
|
||||
*.class
|
||||
*.h
|
||||
*.hh
|
||||
!/c++/glr/ast.hh
|
||||
*.java
|
||||
*.ll
|
||||
/c/bistromathic/bistromathic
|
||||
/c/calc/calc
|
||||
/c/glr/c++-types
|
||||
/c/lexcalc/lexcalc
|
||||
/c/pushcalc/calc
|
||||
+1
-1
@@ -17,7 +17,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
/glr/c++-types
|
||||
/simple
|
||||
/simple.yy
|
||||
/variant
|
||||
/variant-11
|
||||
|
||||
+10
-1
@@ -39,6 +39,15 @@ 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).
|
||||
|
||||
## glr
|
||||
|
||||
This example demonstrates the use of GLR parsers to handle (local)
|
||||
ambiguities in the C++ language. See the node "Merging GLR Parses" in
|
||||
Bison's documentation.
|
||||
|
||||
It uses (Bison) variants to store objects as semantic values. It also
|
||||
demonstrates custom error messages in C++.
|
||||
|
||||
<!---
|
||||
|
||||
Local Variables:
|
||||
@@ -46,7 +55,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
||||
@@ -1,19 +1,2 @@
|
||||
/*.o
|
||||
/*.tmp
|
||||
/.deps
|
||||
/calc++
|
||||
/calc++.cc
|
||||
/calc++.exe
|
||||
/calc.stamp
|
||||
/driver.cc
|
||||
/driver.hh
|
||||
/location.hh
|
||||
/parser.cc
|
||||
/parser.hh
|
||||
/parser.output
|
||||
/parser.stamp
|
||||
/parser.yy
|
||||
/position.hh
|
||||
/scanner.cc
|
||||
/scanner.ll
|
||||
/stack.hh
|
||||
|
||||
@@ -36,7 +36,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015, 2018-2022, 2025-2026 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
|
||||
@@ -50,6 +51,21 @@ EOF
|
||||
run 1 'err: -:2.1: syntax error, unexpected end of file, expecting ( or identifier or number'
|
||||
|
||||
|
||||
# Check handling of tabs.
|
||||
cat >input <<EOF
|
||||
*1
|
||||
EOF
|
||||
run 1 'err: -:1.9: syntax error, unexpected *, expecting ( or identifier or number'
|
||||
cat >input <<EOF
|
||||
*2
|
||||
EOF
|
||||
run 1 'err: -:1.9: syntax error, unexpected *, expecting ( or identifier or number'
|
||||
cat >input <<EOF
|
||||
*3
|
||||
EOF
|
||||
run 1 'err: -:1.9: syntax error, unexpected *, expecting ( or identifier or number'
|
||||
|
||||
|
||||
# LAC finds many more tokens.
|
||||
cat >input <<EOF
|
||||
a := 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## Copyright (C) 2005-2006, 2008-2015, 2018-2021 Free Software
|
||||
## Foundation, Inc.
|
||||
## Copyright (C) 2005-2006, 2008-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -4,13 +4,16 @@ This example demonstrates the use of GLR parsers to handle (local)
|
||||
ambiguities in the C++ language. See the node "Merging GLR Parses" in
|
||||
Bison's documentation.
|
||||
|
||||
It uses (Bison) variants to store objects as semantic values. It also
|
||||
demonstrates custom error messages in C++.
|
||||
|
||||
<!---
|
||||
Local Variables:
|
||||
fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2020-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2020-2022, 2025-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2020-2022, 2025-2026 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
|
||||
@@ -47,4 +47,4 @@ run 0 "\
|
||||
5.0-13: <OR>(<init-declare>(T, y, +(z, q)), =(<cast>(y, T), +(z, q)))
|
||||
7.0-15: <error>
|
||||
9.0-5: +(z, q)
|
||||
err: 7.5: syntax error, unexpected identifier, expecting = or + or )"
|
||||
err: 7.5: syntax error on token identifier (expected = or + or ))"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* -*- C++ -*-
|
||||
Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2020-2022, 2025-2026 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
|
||||
@@ -27,8 +27,8 @@
|
||||
%locations
|
||||
%debug
|
||||
|
||||
// Nice error messages with details.
|
||||
%define parse.error detailed
|
||||
// Custom error messages.
|
||||
%define parse.error custom
|
||||
|
||||
%code requires
|
||||
{
|
||||
@@ -44,9 +44,11 @@
|
||||
#include <fstream>
|
||||
#include <cstring>
|
||||
|
||||
// Merge two semantic values.
|
||||
static Node
|
||||
stmt_merge (const Node& x0, const Node& x1);
|
||||
|
||||
// Fetch a token.
|
||||
static yy::parser::symbol_type
|
||||
yylex ();
|
||||
}
|
||||
@@ -100,13 +102,41 @@ declarator
|
||||
std::istream* input = nullptr;
|
||||
yy::parser::location_type loc;
|
||||
|
||||
// An error reporting function.
|
||||
|
||||
/*---------.
|
||||
| Parser. |
|
||||
`---------*/
|
||||
|
||||
// Generate a custom error message.
|
||||
void
|
||||
yy::parser::report_syntax_error (const context& ctx) const
|
||||
{
|
||||
std::cerr << ctx.location () << ": syntax error";
|
||||
if (!ctx.lookahead ().empty ())
|
||||
std::cerr << " on token " << ctx.lookahead ().name ();
|
||||
{
|
||||
enum { TOKENMAX = 10 };
|
||||
symbol_kind_type expected[TOKENMAX];
|
||||
int n = ctx.expected_tokens (expected, TOKENMAX);
|
||||
if (0 < n)
|
||||
{
|
||||
for (int i = 0; i < n; ++i)
|
||||
std::cerr << (i == 0 ? " (expected " : " or ")
|
||||
<< symbol_name (expected[i]);
|
||||
std::cerr << ')';
|
||||
}
|
||||
}
|
||||
std::cerr << '\n';
|
||||
}
|
||||
|
||||
// Report the error to the user.
|
||||
void
|
||||
yy::parser::error (const location_type& l, const std::string& m)
|
||||
{
|
||||
std::cerr << l << ": " << m << '\n';
|
||||
}
|
||||
|
||||
// Fetch the next token.
|
||||
static yy::parser::symbol_type
|
||||
yylex ()
|
||||
{
|
||||
@@ -168,12 +198,19 @@ yylex ()
|
||||
}
|
||||
}
|
||||
|
||||
// Merge two semantic values as an AST including both alternatives.
|
||||
static Node
|
||||
stmt_merge (const Node& x0, const Node& x1)
|
||||
{
|
||||
return Nterm ("<OR>", x0, x1);
|
||||
}
|
||||
|
||||
|
||||
/*-------.
|
||||
| Main. |
|
||||
`-------*/
|
||||
|
||||
// Parse `file` using parser `parse`.
|
||||
int
|
||||
process (yy::parser& parse, const std::string& file)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2020-2022, 2025-2026 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright (C) 2008-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright (C) 2008-2015, 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2015, 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -81,7 +81,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2020-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2020-2022, 2025-2026 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
|
||||
@@ -366,3 +366,26 @@ err: 1.15: syntax error: expected - or ( or number or function or variable befor
|
||||
err: 1 | (1++2) + 3 + ''
|
||||
err: | ^
|
||||
'
|
||||
|
||||
# Check handling of literal tabs. "Escape" them with a C-v, so that
|
||||
# they are not processed as completion requests.
|
||||
cat >input<<EOF
|
||||
*1
|
||||
*2
|
||||
*3
|
||||
EOF
|
||||
# readline processes the tabs itself, and replaces then with spaces.
|
||||
run -n 0 '> *1
|
||||
> *2
|
||||
> *3
|
||||
> ''
|
||||
err: 1.9: syntax error: expected end of file or - or ( or exit or number or function etc., before *
|
||||
err: 1 | *1
|
||||
err: | ^
|
||||
err: 2.9: syntax error: expected end of file or - or ( or exit or number or function etc., before *
|
||||
err: 2 | *2
|
||||
err: | ^
|
||||
err: 3.9: syntax error: expected end of file or - or ( or exit or number or function etc., before *
|
||||
err: 3 | *3
|
||||
err: | ^
|
||||
'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2020-2022, 2025-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Parser and scanner for bistromathic. -*- C -*-
|
||||
|
||||
Copyright (C) 2019-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2019-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
|
||||
// Emitted on top of the implementation file.
|
||||
%code top {
|
||||
/* Portability issues for strdup. */
|
||||
#ifndef _XOPEN_SOURCE
|
||||
# define _XOPEN_SOURCE 600
|
||||
#endif
|
||||
|
||||
#include <ctype.h> // isdigit
|
||||
#include <locale.h> // LC_ALL
|
||||
#include <math.h> // cos, sin, etc.
|
||||
@@ -244,7 +249,7 @@ init_table (void)
|
||||
symrec *
|
||||
putsym (char const *name, int sym_type)
|
||||
{
|
||||
symrec *res = (symrec *) malloc (sizeof (symrec));
|
||||
symrec *res = malloc (sizeof *res);
|
||||
res->name = strdup (name);
|
||||
res->type = sym_type;
|
||||
res->value.var = 0; // Set value to 0 even if fun.
|
||||
@@ -303,14 +308,15 @@ yylex (const char **line, YYSTYPE *yylval, YYLTYPE *yylloc,
|
||||
{
|
||||
int c;
|
||||
|
||||
// Ignore white space, get first nonwhite character.
|
||||
// Get next character, ignore white spaces.
|
||||
do {
|
||||
// Move the first position onto the last.
|
||||
yylloc->first_line = yylloc->last_line;
|
||||
yylloc->first_column = yylloc->last_column;
|
||||
|
||||
yylloc->last_column += 1;
|
||||
c = *((*line)++);
|
||||
// Tab characters go to the next column multiple of 8.
|
||||
yylloc->last_column +=
|
||||
c == '\t' ? 8 - ((yylloc->last_column - 1) & 7) : 1;
|
||||
} while (c == ' ' || c == '\t');
|
||||
|
||||
switch (c)
|
||||
@@ -465,8 +471,9 @@ yyreport_syntax_error (const yypcontext_t *ctx, const user_context *uctx)
|
||||
}
|
||||
|
||||
|
||||
// Called by yyparse on error.
|
||||
void yyerror (const YYLTYPE *loc, const user_context *uctx, char const *format, ...)
|
||||
// Called by yyparse on errors to report the error to the user.
|
||||
void
|
||||
yyerror (const YYLTYPE *loc, const user_context *uctx, char const *format, ...)
|
||||
{
|
||||
if (uctx->silent)
|
||||
return;
|
||||
|
||||
@@ -9,7 +9,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2019-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2019-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2019-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2019-2022, 2025-2026 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2019-2021 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2019-2022, 2025-2026 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
|
||||
|
||||
@@ -10,7 +10,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2020-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2020-2022, 2025-2026 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
|
||||
@@ -17,31 +17,46 @@
|
||||
|
||||
cat >input <<EOF
|
||||
z + q;
|
||||
EOF
|
||||
run 0 "1.0-5: +(z, q)"
|
||||
|
||||
cat >input <<EOF
|
||||
T x;
|
||||
EOF
|
||||
run 0 "1.0-3: <declare>(T, x)"
|
||||
|
||||
cat >input <<EOF
|
||||
T x = y;
|
||||
EOF
|
||||
run 0 "1.0-7: <init-declare>(T, x, y)"
|
||||
|
||||
cat >input <<EOF
|
||||
x = y;
|
||||
EOF
|
||||
run 0 "1.0-5: =(x, y)"
|
||||
|
||||
cat >input <<EOF
|
||||
T (x) + y;
|
||||
EOF
|
||||
run 0 "1.0-9: +(<cast>(x, T), y)"
|
||||
|
||||
cat >input <<EOF
|
||||
T (x);
|
||||
EOF
|
||||
run 0 "1.0-5: <OR>(<declare>(T, x), <cast>(x, T))"
|
||||
|
||||
cat >input <<EOF
|
||||
T (y) = z + q;
|
||||
EOF
|
||||
run 0 "1.0-13: <OR>(<init-declare>(T, y, +(z, q)), =(<cast>(y, T), +(z, q)))"
|
||||
|
||||
cat >input <<EOF
|
||||
T (y y) = z + q;
|
||||
EOF
|
||||
run 0 "1.0-15: <error>
|
||||
err: 1.5: syntax error, unexpected identifier, expecting '=' or '+' or ')'"
|
||||
|
||||
cat >input <<EOF
|
||||
z + q;
|
||||
EOF
|
||||
run 0 "\
|
||||
1.0-5: +(z, q)
|
||||
3.0-3: <declare>(T, x)
|
||||
5.0-7: <init-declare>(T, x, y)
|
||||
7.0-5: =(x, y)
|
||||
9.0-9: +(<cast>(x, T), y)
|
||||
11.0-5: <OR>(<declare>(T, x), <cast>(x, T))
|
||||
13.0-13: <OR>(<init-declare>(T, y, +(z, q)), =(<cast>(y, T), +(z, q)))
|
||||
15.0-15: <error>
|
||||
17.0-5: +(z, q)
|
||||
err: 15.5: syntax error, unexpected identifier, expecting '=' or '+' or ')'"
|
||||
run 0 "1.0-5: +(z, q)"
|
||||
|
||||
+53
-52
@@ -1,5 +1,5 @@
|
||||
/* -*- C -*-
|
||||
Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2020-2022, 2025-2026 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
|
||||
@@ -29,30 +29,34 @@
|
||||
|
||||
%code requires
|
||||
{
|
||||
union Node {
|
||||
union node {
|
||||
struct {
|
||||
int isNterm;
|
||||
int is_nterm;
|
||||
int parents;
|
||||
} nodeInfo;
|
||||
} node_info;
|
||||
struct {
|
||||
int isNterm; /* 1 */
|
||||
int is_nterm; /* 1 */
|
||||
int parents;
|
||||
char const *form;
|
||||
union Node *children[3];
|
||||
union node *children[3];
|
||||
} nterm;
|
||||
struct {
|
||||
int isNterm; /* 0 */
|
||||
int is_nterm; /* 0 */
|
||||
int parents;
|
||||
char *text;
|
||||
} term;
|
||||
};
|
||||
typedef union Node Node;
|
||||
typedef union node node_t;
|
||||
}
|
||||
|
||||
%define api.value.type union
|
||||
|
||||
%code
|
||||
{
|
||||
/* Portability issues for strdup. */
|
||||
#ifndef _XOPEN_SOURCE
|
||||
# define _XOPEN_SOURCE 600
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
@@ -61,12 +65,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static Node *new_nterm (char const *, Node *, Node *, Node *);
|
||||
static Node *new_term (char *);
|
||||
static void free_node (Node *);
|
||||
static char *node_to_string (const Node *);
|
||||
static void node_print (FILE *, const Node *);
|
||||
static Node *stmt_merge (YYSTYPE x0, YYSTYPE x1);
|
||||
static node_t *new_nterm (char const *, node_t *, node_t *, node_t *);
|
||||
static node_t *new_term (char *);
|
||||
static void free_node (node_t *);
|
||||
static char *node_to_string (const node_t *);
|
||||
static void node_print (FILE *, const node_t *);
|
||||
static node_t *stmt_merge (YYSTYPE x0, YYSTYPE x1);
|
||||
|
||||
static void yyerror (YYLTYPE const * const loc, const char *msg);
|
||||
static yytoken_kind_t yylex (YYSTYPE *lval, YYLTYPE *lloc);
|
||||
@@ -83,9 +87,9 @@
|
||||
|
||||
%glr-parser
|
||||
|
||||
%type <Node *> stmt expr decl declarator TYPENAME ID
|
||||
%destructor { free_node ($$); } <Node *>
|
||||
%printer { node_print (yyo, $$); } <Node *>
|
||||
%type <node_t *> stmt expr decl declarator TYPENAME ID
|
||||
%destructor { free_node ($$); } <node_t *>
|
||||
%printer { node_print (yyo, $$); } <node_t *>
|
||||
|
||||
%%
|
||||
|
||||
@@ -140,8 +144,8 @@ FILE * input = NULL;
|
||||
yytoken_kind_t
|
||||
yylex (YYSTYPE *lval, YYLTYPE *lloc)
|
||||
{
|
||||
static int lineNum = 1;
|
||||
static int colNum = 0;
|
||||
static int line_num = 1;
|
||||
static int col_num = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
@@ -153,20 +157,20 @@ yylex (YYSTYPE *lval, YYLTYPE *lloc)
|
||||
case EOF:
|
||||
return 0;
|
||||
case '\t':
|
||||
colNum = (colNum + 7) & ~7;
|
||||
col_num = (col_num + 7) & ~7;
|
||||
break;
|
||||
case ' ': case '\f':
|
||||
colNum += 1;
|
||||
col_num += 1;
|
||||
break;
|
||||
case '\n':
|
||||
lineNum += 1;
|
||||
colNum = 0;
|
||||
line_num += 1;
|
||||
col_num = 0;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
yytoken_kind_t tok;
|
||||
lloc->first_line = lloc->last_line = lineNum;
|
||||
lloc->first_column = colNum;
|
||||
lloc->first_line = lloc->last_line = line_num;
|
||||
lloc->first_column = col_num;
|
||||
if (isalpha (c))
|
||||
{
|
||||
char buffer[256];
|
||||
@@ -175,7 +179,7 @@ yylex (YYSTYPE *lval, YYLTYPE *lloc)
|
||||
do
|
||||
{
|
||||
buffer[i++] = (char) c;
|
||||
colNum += 1;
|
||||
col_num += 1;
|
||||
assert (i != sizeof buffer - 1);
|
||||
c = getc (input);
|
||||
}
|
||||
@@ -186,65 +190,65 @@ yylex (YYSTYPE *lval, YYLTYPE *lloc)
|
||||
if (isupper ((unsigned char) buffer[0]))
|
||||
{
|
||||
tok = TYPENAME;
|
||||
lval->TYPENAME = new_term (strcpy (malloc (i), buffer));
|
||||
lval->TYPENAME = new_term (strdup (buffer));
|
||||
}
|
||||
else
|
||||
{
|
||||
tok = ID;
|
||||
lval->ID = new_term (strcpy (malloc (i), buffer));
|
||||
lval->ID = new_term (strdup (buffer));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
colNum += 1;
|
||||
col_num += 1;
|
||||
tok = c;
|
||||
}
|
||||
lloc->last_column = colNum;
|
||||
lloc->last_column = col_num;
|
||||
return tok;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Node *
|
||||
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
|
||||
static node_t *
|
||||
new_nterm (char const *form, node_t *child0, node_t *child1, node_t *child2)
|
||||
{
|
||||
Node *res = malloc (sizeof *res);
|
||||
res->nterm.isNterm = 1;
|
||||
node_t *res = malloc (sizeof *res);
|
||||
res->nterm.is_nterm = 1;
|
||||
res->nterm.parents = 0;
|
||||
res->nterm.form = form;
|
||||
res->nterm.children[0] = child0;
|
||||
if (child0)
|
||||
child0->nodeInfo.parents += 1;
|
||||
child0->node_info.parents += 1;
|
||||
res->nterm.children[1] = child1;
|
||||
if (child1)
|
||||
child1->nodeInfo.parents += 1;
|
||||
child1->node_info.parents += 1;
|
||||
res->nterm.children[2] = child2;
|
||||
if (child2)
|
||||
child2->nodeInfo.parents += 1;
|
||||
child2->node_info.parents += 1;
|
||||
return res;
|
||||
}
|
||||
|
||||
static Node *
|
||||
static node_t *
|
||||
new_term (char *text)
|
||||
{
|
||||
Node *res = malloc (sizeof *res);
|
||||
res->term.isNterm = 0;
|
||||
node_t *res = malloc (sizeof *res);
|
||||
res->term.is_nterm = 0;
|
||||
res->term.parents = 0;
|
||||
res->term.text = text;
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
free_node (Node *node)
|
||||
free_node (node_t *node)
|
||||
{
|
||||
if (!node)
|
||||
return;
|
||||
node->nodeInfo.parents -= 1;
|
||||
node->node_info.parents -= 1;
|
||||
/* Free only if 0 (last parent) or -1 (no parents). */
|
||||
if (node->nodeInfo.parents > 0)
|
||||
if (node->node_info.parents > 0)
|
||||
return;
|
||||
if (node->nodeInfo.isNterm == 1)
|
||||
if (node->node_info.is_nterm == 1)
|
||||
{
|
||||
free_node (node->nterm.children[0]);
|
||||
free_node (node->nterm.children[1]);
|
||||
@@ -256,15 +260,12 @@ free_node (Node *node)
|
||||
}
|
||||
|
||||
static char *
|
||||
node_to_string (const Node *node)
|
||||
node_to_string (const node_t *node)
|
||||
{
|
||||
char *res;
|
||||
if (!node)
|
||||
{
|
||||
res = malloc (1);
|
||||
res[0] = 0;
|
||||
}
|
||||
else if (node->nodeInfo.isNterm == 1)
|
||||
res = strdup ("");
|
||||
else if (node->node_info.is_nterm)
|
||||
{
|
||||
char *child0 = node_to_string (node->nterm.children[0]);
|
||||
char *child1 = node_to_string (node->nterm.children[1]);
|
||||
@@ -282,7 +283,7 @@ node_to_string (const Node *node)
|
||||
}
|
||||
|
||||
static void
|
||||
node_print (FILE *out, const Node *n)
|
||||
node_print (FILE *out, const node_t *n)
|
||||
{
|
||||
char *str = node_to_string (n);
|
||||
fputs (str, out);
|
||||
@@ -290,7 +291,7 @@ node_print (FILE *out, const Node *n)
|
||||
}
|
||||
|
||||
|
||||
static Node *
|
||||
static node_t *
|
||||
stmt_merge (YYSTYPE x0, YYSTYPE x1)
|
||||
{
|
||||
return new_nterm ("<OR>(%s, %s)", x0.stmt, x1.stmt, NULL);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2020-2021 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2020-2022, 2025-2026 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
|
||||
|
||||
@@ -11,7 +11,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2018-2022, 2025-2026 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Parser for lexcalc. -*- C -*-
|
||||
|
||||
Copyright (C) 2018-2021 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user