mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-11 11:45:13 +00:00
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7347b2d316 | ||
|
|
58f5a6af40 | ||
|
|
888f3f0178 | ||
|
|
692be7fef0 | ||
|
|
4bfd57ce09 | ||
|
|
964db18ed6 | ||
|
|
598c90ee77 | ||
|
|
f7f37a7a0b | ||
|
|
671dc16a4a | ||
|
|
b3be630198 | ||
|
|
5aca537f83 |
+28
@@ -0,0 +1,28 @@
|
|||||||
|
*.cache
|
||||||
|
*.flc
|
||||||
|
*.patch *.log log patches applied
|
||||||
|
*.prj
|
||||||
|
.version
|
||||||
|
ABOUT-NLS
|
||||||
|
COPYING
|
||||||
|
INSTALL
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
_*
|
||||||
|
a.exe
|
||||||
|
a.out
|
||||||
|
aclocal.m4
|
||||||
|
b.out
|
||||||
|
bison-*
|
||||||
|
conf[0-9]*
|
||||||
|
confdefs*
|
||||||
|
config.log
|
||||||
|
config.status
|
||||||
|
configure
|
||||||
|
configure.lineno
|
||||||
|
conftest*
|
||||||
|
javacomp.sh
|
||||||
|
javaexec.sh
|
||||||
|
patches
|
||||||
|
releases
|
||||||
|
stamp-h*
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
-43
@@ -1,43 +0,0 @@
|
|||||||
*.eps
|
|
||||||
*.log
|
|
||||||
*.o
|
|
||||||
*.pdf
|
|
||||||
*.png
|
|
||||||
*.stamp
|
|
||||||
*.trs
|
|
||||||
*~
|
|
||||||
.deps
|
|
||||||
.dirstamp
|
|
||||||
/*.cache
|
|
||||||
/*.flc
|
|
||||||
/*.prj
|
|
||||||
/.tarball-version
|
|
||||||
/.version
|
|
||||||
/ABOUT-NLS
|
|
||||||
/COPYING
|
|
||||||
/ChangeLog
|
|
||||||
/GNUmakefile
|
|
||||||
/INSTALL
|
|
||||||
/Makefile
|
|
||||||
/Makefile.in
|
|
||||||
/README-release
|
|
||||||
/_*
|
|
||||||
/a.exe
|
|
||||||
/a.out
|
|
||||||
/aclocal.m4
|
|
||||||
/b.out
|
|
||||||
/bison-*
|
|
||||||
/conf[0-9]*
|
|
||||||
/confdefs*
|
|
||||||
/config.log
|
|
||||||
/config.status
|
|
||||||
/configure
|
|
||||||
/configure.lineno
|
|
||||||
/conftest*
|
|
||||||
/gnulib
|
|
||||||
/javacomp.sh
|
|
||||||
/javaexec.sh
|
|
||||||
/maint.mk
|
|
||||||
/patches
|
|
||||||
/releases
|
|
||||||
/stamp-h*
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[submodule "gnulib"]
|
|
||||||
path = gnulib
|
|
||||||
url = git://git.savannah.gnu.org/gnulib.git
|
|
||||||
[submodule "submodules/autoconf"]
|
|
||||||
path = submodules/autoconf
|
|
||||||
url = git://git.sv.gnu.org/autoconf.git
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
3.1
|
|
||||||
-293
@@ -1,293 +0,0 @@
|
|||||||
# Travis defines and exports CC and CXX *after* we have defined our
|
|
||||||
# environment variables via 'env'. So, do not use 'env' to define
|
|
||||||
# them. Instead, put their definitions in MATRIX_EVAL, which we eval
|
|
||||||
# after the definitions from Travis.
|
|
||||||
|
|
||||||
language: cpp
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
# ICC serial number.
|
|
||||||
secure: ED3w6rzxuE6tVu3oyxha2MoGMRzRQCtinvr9uor1gw9TGKB80esTLx4KyX0xHemUdyQVarFDDQfVS5rf7jSDY8XiWIR6O+2Af9/30gb+8eyngyvACu7E28n+1XHmYWIEHsbvB9mic6C60FBj5sPcDnFWZeyttGL0WooSjYHiw1Egafwqbeu1mD3Aet9OI9VaLQvy0KcWAdVrYWSI9UWLvLM+xPVUjPFko4oS+dTlETzVnmn6JFbZX1OKONtfcvdoDRFBzs3iHm5dQUt/Fz+y/DtKSuvF3zvePHSgF6c8URbEPPjBdh87gkovSLyy+83fVeh4WMkF8b+dGZmikQv6kRsjKJdbQrS8tiMhZlORC5Gfmn4HXNgmapL+paUweakH7UZQHm6d5SZoBgCHNazfqMrywbZsZkGvZTDQIVG1Be7Lhh2BDFbPhPZNDvI9XYiqZP0QSb0BVfeO+AUSRcUPM7TvarxB74jYdfpTBu7sqJP6dSwhcDTEUhHmuLGjzsNm3uTZe8SUw/TGGx5uPTXNsCjJq6ClIOAIYXZTXLbBmIL/NBWCy0MUpD+9zsiknU7vzzq1RfgCCExhvYgosTjBLcX1kKI+eRSU5M44e+xCg4xx0m9WfafbKbhA20FfnWxCFIkZeVpkOOsexJ9zfe0SflVLxkd7vmci5SCBixLVbN0=
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
## ----- ##
|
|
||||||
## GCC. ##
|
|
||||||
## ----- ##
|
|
||||||
#- name: "GCC 8 with sanitizers"
|
|
||||||
# os: linux
|
|
||||||
# addons:
|
|
||||||
# apt:
|
|
||||||
# sources:
|
|
||||||
# - ubuntu-toolchain-r-test
|
|
||||||
# packages:
|
|
||||||
# - g++-8
|
|
||||||
# env:
|
|
||||||
# # Can't use UBSAN: I get:
|
|
||||||
# # configure:4951: gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer conftest.c
|
|
||||||
# # /usr/bin/ld: unrecognized option '--push-state'
|
|
||||||
# - MATRIX_EVAL="CC='gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer' CXX='g++-8 -fsanitize=undefined,address -fno-omit-frame-pointer'"
|
|
||||||
|
|
||||||
- name: "GCC 7 -O3"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-7
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'"
|
|
||||||
|
|
||||||
- name: "GCC 6"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-6
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
|
|
||||||
|
|
||||||
- name: "GCC 5"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-5
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
|
|
||||||
|
|
||||||
- name: "GCC 4.9"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-4.9
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
|
|
||||||
|
|
||||||
- name: "GCC 4.8"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-4.8
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=gcc-4.8 && CXX=g++-4.8"
|
|
||||||
|
|
||||||
- name: "GCC 4.7"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-4.7
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=gcc-4.7 && CXX=g++-4.7"
|
|
||||||
|
|
||||||
- name: "GCC 4.6"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-4.6
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=gcc-4.6 && CXX=g++-4.6"
|
|
||||||
|
|
||||||
## ------- ##
|
|
||||||
## Clang. ##
|
|
||||||
## ------- ##
|
|
||||||
|
|
||||||
- name: "Clang 7 libc++ and ASAN"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- llvm-toolchain-trusty-7
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- clang-7
|
|
||||||
- libc++-7-dev
|
|
||||||
- libc++abi-7-dev
|
|
||||||
env:
|
|
||||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
|
||||||
- MATRIX_EVAL="CC='clang-7 -fsanitize=address' CXX='clang++-7 -fsanitize=address -stdlib=libc++'"
|
|
||||||
|
|
||||||
- name: "Clang 6 -O3 and libc++"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- llvm-toolchain-trusty-6.0
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- clang-6.0
|
|
||||||
- libc++-dev
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=clang-6.0 && CXX='clang++-6.0 -stdlib=libc++'"
|
|
||||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
|
||||||
|
|
||||||
- name: "Clang 5"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- llvm-toolchain-trusty-5.0
|
|
||||||
packages:
|
|
||||||
- clang-5.0
|
|
||||||
- libc++-dev
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC='clang-5.0' CXX='clang++-5.0'"
|
|
||||||
|
|
||||||
- name: "Clang 4"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- llvm-toolchain-trusty-4.0
|
|
||||||
packages:
|
|
||||||
- clang-4.0
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
|
|
||||||
|
|
||||||
- name: "Clang 3.9"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- llvm-toolchain-trusty-3.9
|
|
||||||
packages:
|
|
||||||
- clang-3.9
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
|
|
||||||
|
|
||||||
- name: "Clang 3.8"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.8
|
|
||||||
packages:
|
|
||||||
- clang-3.8
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
|
|
||||||
|
|
||||||
- name: "CLang 3.7"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.7
|
|
||||||
packages:
|
|
||||||
- clang-3.7
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7"
|
|
||||||
|
|
||||||
- name: "Clang 3.6"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.6
|
|
||||||
packages:
|
|
||||||
- clang-3.6
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6"
|
|
||||||
|
|
||||||
- name: "Clang 3.5"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-precise-3.5
|
|
||||||
packages:
|
|
||||||
- clang-3.5
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=clang-3.5 && CXX=clang++-3.5"
|
|
||||||
|
|
||||||
- name: "Clang 3.4"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.4
|
|
||||||
env:
|
|
||||||
# No versioned name installed, but beware that Travis installs
|
|
||||||
# a more modern clang earlier in the default PATH.
|
|
||||||
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++'
|
|
||||||
|
|
||||||
- name: "Clang 3.3"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- clang-3.3
|
|
||||||
env:
|
|
||||||
# See comment for 3.4.
|
|
||||||
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++'
|
|
||||||
|
|
||||||
## ----- ##
|
|
||||||
## ICC. ##
|
|
||||||
## ----- ##
|
|
||||||
- name: "ICC"
|
|
||||||
os: linux
|
|
||||||
env:
|
|
||||||
# ICC's warnings are often very wrong (e.g., it thinks foo ?
|
|
||||||
# "bar" : "baz" is char* instead of const char*), so don't try
|
|
||||||
# to work around the, and obviously, don't die on them.
|
|
||||||
- MATRIX_EVAL="CC=icc && CXX=icpc"
|
|
||||||
- MAKE_ARGS='WERROR_CFLAGS= WERROR_CXXFLAGS='
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- eval "$MATRIX_EVAL"
|
|
||||||
- env
|
|
||||||
- sudo apt-get update -qq
|
|
||||||
- sudo apt-get install -qq autoconf automake autopoint doxygen flex gettext graphviz help2man m4 texinfo
|
|
||||||
- if [[ $CC == "icc" ]]; then build-aux/install-icc.sh; fi
|
|
||||||
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
|
||||||
- autoconf --version
|
|
||||||
- automake --version
|
|
||||||
- autopoint --version
|
|
||||||
- $CC --version
|
|
||||||
- $CXX --version
|
|
||||||
- doxygen --version
|
|
||||||
- flex --version
|
|
||||||
- gettext --version
|
|
||||||
- dot -V
|
|
||||||
- help2man --version
|
|
||||||
- m4 --version
|
|
||||||
- makeinfo --version
|
|
||||||
|
|
||||||
script:
|
|
||||||
- git show
|
|
||||||
- git tag -l
|
|
||||||
# For some reasons, sometimes the checkout does not have any tags,
|
|
||||||
# so `git describe` fails, so bootstrap fails.
|
|
||||||
- git describe || git tag v3.0 -m "Fake version 3.0."
|
|
||||||
- git describe
|
|
||||||
- ./bootstrap
|
|
||||||
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
|
||||||
- ./configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
|
|
||||||
- make -j2 $MAKE_ARGS
|
|
||||||
- make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
|
||||||
- make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
|
||||||
- make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
|
||||||
|
|
||||||
after_script:
|
|
||||||
- if [[ $CC == "icc" ]]; then uninstall_intel_software; fi
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@VERSION@
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
COPYING
|
|
||||||
^bootstrap$
|
|
||||||
^doc/fdl\.texi$
|
|
||||||
^doc/gpl-3\.0\.texi$
|
|
||||||
^doc/yacc\.1\.in$
|
|
||||||
^src/parse-gram\.h$
|
|
||||||
@@ -5,38 +5,4 @@ Bison was written primarily by Robert Corbett.
|
|||||||
Richard Stallman made it Yacc-compatible.
|
Richard Stallman made it Yacc-compatible.
|
||||||
|
|
||||||
Wilfred Hansen of Carnegie Mellon University added multicharacter
|
Wilfred Hansen of Carnegie Mellon University added multicharacter
|
||||||
string literals and other features (Bison 1.25, 1995).
|
string literals and other features.
|
||||||
|
|
||||||
Akim Demaille rewrote the parser in Bison, and changed the back end to
|
|
||||||
use M4 (1.50, 2002).
|
|
||||||
|
|
||||||
Paul Hilfinger added GLR support (Bison 1.50, 2002).
|
|
||||||
|
|
||||||
Joel E. Denny contributed canonical-LR support, and invented and added
|
|
||||||
IELR and LAC (Lookahead Correction) support (Bison 2.5, 2011).
|
|
||||||
|
|
||||||
Paolo Bonzini contributed Java support (Bison 2.4, 2008).
|
|
||||||
|
|
||||||
Alex Rozenman added named reference support (Bison 2.5, 2011).
|
|
||||||
|
|
||||||
Paul Eggert fixed a million portability issues, arbitrary limitations,
|
|
||||||
and nasty bugs.
|
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 1998-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|||||||
+47
-6270
File diff suppressed because it is too large
Load Diff
+71
@@ -0,0 +1,71 @@
|
|||||||
|
# Having a separate GNUmakefile lets me `include' the dynamically
|
||||||
|
# generated rules created via Makefile.maint as well as Makefile.maint itself.
|
||||||
|
# This makefile is used only if you run GNU Make.
|
||||||
|
# It is necessary if you want to build targets usually of interest
|
||||||
|
# only to the maintainer.
|
||||||
|
|
||||||
|
# Copyright (C) 2001, 2003, 2006-2007, 2008 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Systems where /bin/sh is not the default shell need this. The $(shell)
|
||||||
|
# command below won't work with e.g. stock DOS/Windows shells.
|
||||||
|
ifeq ($(wildcard /bin/s[h]),/bin/sh)
|
||||||
|
SHELL = /bin/sh
|
||||||
|
else
|
||||||
|
# will be used only with the next shell-test line, then overwritten
|
||||||
|
# by a configured-in value
|
||||||
|
SHELL = sh
|
||||||
|
endif
|
||||||
|
|
||||||
|
have-Makefile := $(shell test -f Makefile && echo yes)
|
||||||
|
|
||||||
|
# If the user runs GNU make but has not yet run ./configure,
|
||||||
|
# give them a diagnostic.
|
||||||
|
ifeq ($(have-Makefile),yes)
|
||||||
|
|
||||||
|
# Make tar archive easier to reproduce.
|
||||||
|
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
|
||||||
|
|
||||||
|
include Makefile
|
||||||
|
|
||||||
|
# Ensure that $(VERSION) is up to date for dist-related targets, but not
|
||||||
|
# for others: rerunning autoconf and recompiling everything isn't cheap.
|
||||||
|
ifeq (0,$(MAKELEVEL))
|
||||||
|
_is-dist-target = $(filter dist% alpha beta major,$(MAKECMDGOALS))
|
||||||
|
ifneq (,$(_is-dist-target))
|
||||||
|
_curr-ver := $(shell build-aux/git-version-gen .version)
|
||||||
|
ifneq ($(_curr-ver),$(VERSION))
|
||||||
|
$(info INFO: rerunning autoconf for new version string: $(_curr-ver))
|
||||||
|
dummy := $(shell rm -rf autom4te.cache; $(AUTOCONF))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
include $(srcdir)/Makefile.cfg
|
||||||
|
include $(srcdir)/Makefile.maint
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
all:
|
||||||
|
@echo There seems to be no Makefile in this directory. 1>&2
|
||||||
|
@echo "You must run ./configure before running \`make'." 1>&2
|
||||||
|
@exit 1
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Tell version 3.79 and up of GNU make to not build goals in this
|
||||||
|
# directory in parallel. This is necessary in case someone tries to
|
||||||
|
# build multiple targets on one command line.
|
||||||
|
.NOTPARALLEL:
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
-*- outline -*-
|
||||||
|
|
||||||
|
This file attempts to describe the rules to use when hacking Bison.
|
||||||
|
Don't put this file into the distribution. Don't mention it in the
|
||||||
|
ChangeLog.
|
||||||
|
|
||||||
|
Everything related to the development of Bison is on Savannah:
|
||||||
|
|
||||||
|
http://savannah.gnu.org/projects/bison/
|
||||||
|
|
||||||
|
|
||||||
|
* Administrivia
|
||||||
|
|
||||||
|
** If you incorporate a change from somebody on the net:
|
||||||
|
First, if it is a large change, you must make sure they have signed
|
||||||
|
the appropriate paperwork. Second, be sure to add their name and
|
||||||
|
email address to THANKS.
|
||||||
|
|
||||||
|
** If a change fixes a test, mention the test in the ChangeLog entry.
|
||||||
|
|
||||||
|
** Bug reports
|
||||||
|
If somebody reports a new bug, mention his name in the ChangeLog entry
|
||||||
|
and in the test case you write. Put him into THANKS.
|
||||||
|
|
||||||
|
The correct response to most actual bugs is to write a new test case
|
||||||
|
which demonstrates the bug. Then fix the bug, re-run the test suite,
|
||||||
|
and check everything in.
|
||||||
|
|
||||||
|
|
||||||
|
* Hacking
|
||||||
|
|
||||||
|
** Visible changes
|
||||||
|
Which include serious bug fixes, must be mentioned in NEWS.
|
||||||
|
|
||||||
|
** Translations
|
||||||
|
Only user visible strings are to be translated: error messages, bits
|
||||||
|
of the .output file etc. This excludes impossible error messages
|
||||||
|
(comparable to assert/abort), and all the --trace output which is
|
||||||
|
meant for the maintainers only.
|
||||||
|
|
||||||
|
|
||||||
|
* Test suite
|
||||||
|
|
||||||
|
** make check
|
||||||
|
Use liberally.
|
||||||
|
|
||||||
|
** Release checks
|
||||||
|
Try to run the test suite with more severe conditions before a
|
||||||
|
release:
|
||||||
|
|
||||||
|
- Configure the package with --enable-gcc-warnings, so that one checks
|
||||||
|
that 1. Bison compiles cleanly, 2. the parsers it produces compile
|
||||||
|
cleanly too.
|
||||||
|
|
||||||
|
- run `make maintainer-check' which:
|
||||||
|
- runs `valgrind -q bison' to run Bison under Valgrind.
|
||||||
|
- runs the parsers under Valgrind.
|
||||||
|
- runs the test suite with G++ as C compiler...
|
||||||
|
|
||||||
|
- Change tests/atlocal/CFLAGS to add your preferred options. For
|
||||||
|
instance, `-traditional' to check that the parsers are K&R. Note
|
||||||
|
that it does not make sense for glr.c, which should be ANSI,
|
||||||
|
but currently is actually GNU C, nor for lalr1.cc, which anyway is
|
||||||
|
not exercised yet in the test suite.
|
||||||
|
|
||||||
|
|
||||||
|
* Release Procedure
|
||||||
|
|
||||||
|
** Try to get the *.pot files to the Translation Project at least one week
|
||||||
|
before a stable release, to give them time to translate them.
|
||||||
|
|
||||||
|
** Tests
|
||||||
|
See above.
|
||||||
|
|
||||||
|
** Update the foreign files
|
||||||
|
Running `./bootstrap' in the top level should update them all for you.
|
||||||
|
This covers PO files too. Sometimes a PO file contains problems that
|
||||||
|
causes it to be rejected by recent Gettext releases; please report
|
||||||
|
these to the Translation Project.
|
||||||
|
|
||||||
|
** Update NEWS
|
||||||
|
The version number, *and* the date of the release (including for
|
||||||
|
betas).
|
||||||
|
|
||||||
|
** Update ChangeLog
|
||||||
|
Should have an entry similar to `Version 1.49b.'.
|
||||||
|
Check all this in once `make distcheck' passes.
|
||||||
|
|
||||||
|
** make alpha
|
||||||
|
Running `make alpha' is absolutely perfect for beta releases: it makes
|
||||||
|
the tarballs, the xdeltas, and prepares (in /tmp/) a proto
|
||||||
|
announcement. It is so neat, that that's what I use anyway for
|
||||||
|
genuine releases, but adjusting things by hand (e.g., the urls in the
|
||||||
|
announcement file, the ChangeLog which is not needed etc.).
|
||||||
|
|
||||||
|
If it fails, you're on your own...
|
||||||
|
|
||||||
|
It requires GNU Make.
|
||||||
|
|
||||||
|
** Upload
|
||||||
|
Put the tarballs/xdeltas where they should be. Or put it somewhere,
|
||||||
|
and send the URL to [email protected].
|
||||||
|
|
||||||
|
** Bump the version number
|
||||||
|
In configure.ac. Run `make', check this in.
|
||||||
|
|
||||||
|
** Announce
|
||||||
|
Complete/fix the announcement file, and send it at least to
|
||||||
|
[email protected] (if a real release, or a ``serious beta''),
|
||||||
|
[email protected], [email protected], [email protected],
|
||||||
|
and [email protected].
|
||||||
|
|
||||||
|
Send the same announcement on the comp.compilers newsgroup by sending
|
||||||
|
email to [email protected]. Do not make any Cc as the moderator will
|
||||||
|
throw away anything cross-posted or Cc'ed. It really needs to be a
|
||||||
|
separate message.
|
||||||
|
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
+19
-83
@@ -1,7 +1,7 @@
|
|||||||
## Process this file with automake to produce Makefile.in.
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
|
## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
|
||||||
|
## Foundation, Inc.
|
||||||
|
|
||||||
# Copyright (C) 2001-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -15,94 +15,30 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = subdir-objects
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
SUBDIRS = po runtime-po .
|
SUBDIRS = build-aux po runtime-po lib data src doc examples tests etc
|
||||||
|
|
||||||
# Files installed for use by Automake.
|
# Files installed for use by Automake.
|
||||||
aclocaldir = @aclocaldir@
|
aclocaldir = @aclocaldir@
|
||||||
aclocal_DATA = m4/bison-i18n.m4
|
aclocal_DATA = m4/bison-i18n.m4
|
||||||
|
|
||||||
EXTRA_DIST = .prev-version .version cfg.mk PACKAGING \
|
EXTRA_DIST = GNUmakefile Makefile.cfg Makefile.maint \
|
||||||
ChangeLog-1998 ChangeLog-2012 ChangeLog
|
OChangeLog PACKAGING \
|
||||||
|
djgpp/Makefile.maint djgpp/README.in djgpp/config.bat \
|
||||||
|
djgpp/config.sed djgpp/config.site djgpp/config_h.sed \
|
||||||
|
djgpp/subpipe.c djgpp/subpipe.h djgpp/djunpack.bat \
|
||||||
|
djgpp/fnchange.lst djgpp/testsuite.sed
|
||||||
|
|
||||||
dist_doc_DATA = AUTHORS COPYING NEWS README THANKS TODO
|
|
||||||
|
|
||||||
## Running the bison from this tarball. To generate our own parser,
|
.PHONY: maintainer-check
|
||||||
## but also to run the tests. Of course, you ought to keep a sane
|
maintainer-check:
|
||||||
## version of Bison nearby...
|
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||||
BISON = $(top_builddir)/tests/bison
|
|
||||||
BISON_IN = $(top_srcdir)/tests/bison.in
|
|
||||||
YACC = $(BISON) -o y.tab.c
|
|
||||||
AM_YFLAGS = -d -v -Werror -Wall -Wno-yacc --report=all
|
|
||||||
|
|
||||||
# Initialization before completion by local.mk's.
|
.PHONY: maintainer-push-check
|
||||||
AM_CFLAGS = $(WARN_CFLAGS)
|
maintainer-push-check:
|
||||||
# Find builddir/src/scan-code.c etc. For some reason "-I./lib"
|
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||||
# instead of "-Ilib" avoids infinite recursions on #include_next.
|
|
||||||
AM_CPPFLAGS = -I. -I./lib -I$(top_srcdir) -I$(top_srcdir)/lib
|
|
||||||
BUILT_SOURCES =
|
|
||||||
CLEANDIRS =
|
|
||||||
CLEANFILES =
|
|
||||||
DISTCLEANFILES =
|
|
||||||
EXTRA_DIST += $(dist_TESTS)
|
|
||||||
MOSTLYCLEANDIRS =
|
|
||||||
MOSTLYCLEANFILES =
|
|
||||||
SUFFIXES =
|
|
||||||
TESTS = $(dist_TESTS)
|
|
||||||
check_PROGRAMS =
|
|
||||||
dist_TESTS =
|
|
||||||
noinst_LIBRARIES =
|
|
||||||
|
|
||||||
include build-aux/local.mk
|
.PHONY: maintainer-xml-check
|
||||||
include data/local.mk
|
maintainer-xml-check:
|
||||||
include djgpp/local.mk
|
cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||||
include doc/local.mk
|
|
||||||
include etc/local.mk
|
|
||||||
include examples/local.mk
|
|
||||||
include lib/local.mk
|
|
||||||
include src/local.mk
|
|
||||||
include tests/local.mk
|
|
||||||
|
|
||||||
clean-local:
|
|
||||||
rm -rf $(CLEANDIRS)
|
|
||||||
|
|
||||||
# See comments in build-aux/git-version-gen. However, we make .version depend
|
|
||||||
# on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the
|
|
||||||
# working copy (for example, when you run autoreconf && make). Allowing these
|
|
||||||
# to fall out of sync appears to have little potential to improve Bison build
|
|
||||||
# efficiency (even if we were to replace VERSION/PACKAGE_VERSION with .version
|
|
||||||
# everywhere possible). On the other hand, it could be harmful. For example,
|
|
||||||
# a developer might naively reference .version in a test case while the bison
|
|
||||||
# executable still compiles with VERSION, and so the test case might fail or
|
|
||||||
# pass incorrectly.
|
|
||||||
BUILT_SOURCES += $(top_srcdir)/.version
|
|
||||||
$(top_srcdir)/.version: configure
|
|
||||||
echo $(VERSION) > $@-t && mv $@-t $@
|
|
||||||
dist-hook: gen-ChangeLog
|
|
||||||
echo $(VERSION) > $(distdir)/.tarball-version
|
|
||||||
|
|
||||||
.PHONY: update-b4-copyright update-package-copyright-year
|
|
||||||
update-b4-copyright:
|
|
||||||
$(AM_V_GEN)find $(srcdir)/data -type f \
|
|
||||||
| xargs $(srcdir)/build-aux/$@
|
|
||||||
@echo 'warning: src/parse-gram.[hc] may need to be regenerated.'
|
|
||||||
update-package-copyright-year:
|
|
||||||
$(AM_V_GEN)$(srcdir)/build-aux/$@ $(srcdir)/configure.ac
|
|
||||||
|
|
||||||
gen_start_date = 2012-01-16
|
|
||||||
.PHONY: gen-ChangeLog
|
|
||||||
gen-ChangeLog:
|
|
||||||
$(AM_V_GEN)if test -d $(srcdir)/.git; then \
|
|
||||||
cl=$(distdir)/ChangeLog && \
|
|
||||||
rm -f $$cl.tmp && \
|
|
||||||
$(top_srcdir)/build-aux/gitlog-to-changelog \
|
|
||||||
--strip-tab \
|
|
||||||
--strip-cherry-pick \
|
|
||||||
--no-cluster \
|
|
||||||
--amend=$(srcdir)/build-aux/git-log-fix \
|
|
||||||
--srcdir=$(srcdir) \
|
|
||||||
--since=$(gen_start_date) > $$cl.tmp && \
|
|
||||||
mv -f $$cl.tmp $$cl; \
|
|
||||||
fi
|
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# Customize Makefile.maint. -*- makefile -*-
|
||||||
|
# Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Use alpha.gnu.org for alpha and beta releases.
|
||||||
|
# Use ftp.gnu.org for major releases.
|
||||||
|
gnu_ftp_host-alpha = alpha.gnu.org
|
||||||
|
gnu_ftp_host-beta = alpha.gnu.org
|
||||||
|
gnu_ftp_host-major = ftp.gnu.org
|
||||||
|
gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
|
||||||
|
|
||||||
|
url_dir_list = \
|
||||||
|
ftp://$(gnu_rel_host)/gnu/bison
|
||||||
|
|
||||||
|
# Tests not to run as part of "make distcheck".
|
||||||
|
# Exclude changelog-check here so that there's less churn in ChangeLog
|
||||||
|
# files -- otherwise, you'd need to have the upcoming version number
|
||||||
|
# at the top of the file for each `make distcheck' run.
|
||||||
|
local-checks-to-skip = changelog-check
|
||||||
|
|
||||||
|
# The local directory containing the checked-out copy of gnulib used in
|
||||||
|
# this release. Used solely to get a date for the "announcement" target.
|
||||||
|
gnulib_dir = /gnulib
|
||||||
+637
@@ -0,0 +1,637 @@
|
|||||||
|
# -*-Makefile-*-
|
||||||
|
# This Makefile fragment is shared between the coreutils,
|
||||||
|
# CPPI, Bison, and Autoconf.
|
||||||
|
|
||||||
|
## Copyright (C) 2001-2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# This is reported not to work with make-3.79.1
|
||||||
|
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||||
|
ME := Makefile.maint
|
||||||
|
|
||||||
|
# Do not save the original name or timestamp in the .tar.gz file.
|
||||||
|
# Use --rsyncable if available.
|
||||||
|
gzip_rsyncable = \
|
||||||
|
(gzip --help|grep rsyncable) >/dev/null 2>&1 && echo --rsyncable
|
||||||
|
GZIP_ENV = "--no-name --best `$(gzip_rsyncable)`"
|
||||||
|
|
||||||
|
CVS = cvs
|
||||||
|
|
||||||
|
# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
|
||||||
|
CVS_LIST = sh -c ' \
|
||||||
|
if test -x $(srcdir)/build-aux/cvsu; then \
|
||||||
|
$(srcdir)/build-aux/cvsu --find --types=AFGM $$*; \
|
||||||
|
else \
|
||||||
|
awk -F/ '\''{ \
|
||||||
|
if (!$$1 && $$3 !~ /^-/) { \
|
||||||
|
f=FILENAME; \
|
||||||
|
sub(/CVS\/Entries/, "", f); \
|
||||||
|
print f $$2; \
|
||||||
|
}}'\'' \
|
||||||
|
$$(find $${*-*} -name Entries -print) /dev/null; \
|
||||||
|
fi \
|
||||||
|
' dummy
|
||||||
|
|
||||||
|
CVS_LIST_EXCEPT = \
|
||||||
|
$(CVS_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
|
||||||
|
|
||||||
|
ifeq ($(origin prev_version_file), undefined)
|
||||||
|
prev_version_file = .prev-version
|
||||||
|
endif
|
||||||
|
|
||||||
|
PREV_VERSION := $(shell cat $(prev_version_file))
|
||||||
|
VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
||||||
|
|
||||||
|
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
|
||||||
|
tag-this-version = $(subst .,_,$(VERSION))
|
||||||
|
this-cvs-tag = $(tag-package)-$(tag-this-version)
|
||||||
|
my_distdir = $(PACKAGE)-$(VERSION)
|
||||||
|
|
||||||
|
# Old releases are stored here.
|
||||||
|
# Used for diffs and xdeltas.
|
||||||
|
release_archive_dir ?= ../release
|
||||||
|
|
||||||
|
# Prevent programs like 'sort' from considering distinct strings to be equal.
|
||||||
|
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
|
||||||
|
export LC_ALL = C
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## --------------- ##
|
||||||
|
## Sanity checks. ##
|
||||||
|
## --------------- ##
|
||||||
|
|
||||||
|
# FIXME: add a check to prohibit definition in src/*.c of symbols defined
|
||||||
|
# in system.h. E.g. today I removed from tail.c a useless definition of
|
||||||
|
# ENOSYS. It was useless because system.h ensures it's defined.
|
||||||
|
|
||||||
|
# Checks that don't require cvs.
|
||||||
|
# Run `changelog-check' last, as previous test may reveal problems requiring
|
||||||
|
# new ChangeLog entries.
|
||||||
|
local-checks-available = \
|
||||||
|
po-check copyright-check writable-files m4-check author_mark_check \
|
||||||
|
changelog-check strftime-check $(syntax-check-rules) \
|
||||||
|
makefile_path_separator_check \
|
||||||
|
makefile-check
|
||||||
|
.PHONY: $(local-checks-available)
|
||||||
|
|
||||||
|
local-check = $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
||||||
|
|
||||||
|
.PHONY: $(syntax-check-rules)
|
||||||
|
syntax-check-rules = \
|
||||||
|
sc_cast_of_argument_to_free \
|
||||||
|
sc_cast_of_x_alloc_return_value \
|
||||||
|
sc_cast_of_alloca_return_value \
|
||||||
|
sc_changelog \
|
||||||
|
sc_dd_max_sym_length \
|
||||||
|
sc_error_exit_success \
|
||||||
|
sc_file_system \
|
||||||
|
sc_no_if_have_config_h \
|
||||||
|
sc_obsolete_symbols \
|
||||||
|
sc_prohibit_atoi_atof \
|
||||||
|
sc_prohibit_jm_in_m4 \
|
||||||
|
sc_prohibit_assert_without_use \
|
||||||
|
sc_require_config_h \
|
||||||
|
sc_root_tests \
|
||||||
|
sc_space_tab \
|
||||||
|
sc_sun_os_names \
|
||||||
|
sc_system_h_headers \
|
||||||
|
sc_tight_scope \
|
||||||
|
sc_trailing_blank \
|
||||||
|
sc_two_space_separator_in_usage \
|
||||||
|
sc_unmarked_diagnostics \
|
||||||
|
sc_useless_cpp_parens
|
||||||
|
|
||||||
|
syntax-check: $(syntax-check-rules)
|
||||||
|
# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
|
||||||
|
# $$(find -type f -name '*.[chly]') && \
|
||||||
|
# { echo '$(ME): found conditional include' 1>&2; \
|
||||||
|
# exit 1; } || :
|
||||||
|
|
||||||
|
# grep -nE '^# *include <(string|stdlib)\.h>' \
|
||||||
|
# $(srcdir)/{lib,src}/*.[chy] && \
|
||||||
|
# { echo '$(ME): FIXME' 1>&2; \
|
||||||
|
# exit 1; } || :
|
||||||
|
# FIXME: don't allow `#include .strings\.h' anywhere
|
||||||
|
|
||||||
|
sc_cast_of_argument_to_free:
|
||||||
|
@grep -nE '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
|
||||||
|
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_cast_of_x_alloc_return_value:
|
||||||
|
@grep -nE --exclude=$(srcdir)/lib/regex.c \
|
||||||
|
'\*\) *x(m|c|re)alloc\>' \
|
||||||
|
$(srcdir)/{lib,src}/*.[chy] && \
|
||||||
|
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_cast_of_alloca_return_value:
|
||||||
|
@grep -nE '\*\) *alloca\>' \
|
||||||
|
$(srcdir)/src/*.[chy] && \
|
||||||
|
{ echo '$(ME): don'\''t cast alloca return value' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_space_tab:
|
||||||
|
@grep -n '[ ] ' $$($(CVS_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Don't use the old ato* functions in `real' code.
|
||||||
|
# They provide no error checking mechanism.
|
||||||
|
# Instead, use strto* functions.
|
||||||
|
sc_prohibit_atoi_atof:
|
||||||
|
@grep -nE '\<ato([filq]|ll)\>' $$($(CVS_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Using EXIT_SUCCESS as the first argument to error is misleading,
|
||||||
|
# since when that parameter is 0, error does not exit. Use `0' instead.
|
||||||
|
sc_error_exit_success:
|
||||||
|
@grep -nF 'error (EXIT_SUCCESS,' \
|
||||||
|
$$(find -type f -name '*.[chly]') && \
|
||||||
|
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_file_system:
|
||||||
|
@grep -ni 'file''system' $$($(CVS_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found use of "file''system";' \
|
||||||
|
'rewrite to use "file system"' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_no_if_have_config_h:
|
||||||
|
@grep -n '^# *if HAVE_CONFIG_H' $$($(CVS_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found use of #if HAVE_CONFIG_H; use #ifdef' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Nearly all .c files must include <config.h>.
|
||||||
|
sc_require_config_h:
|
||||||
|
@grep -L '^# *include <config\.h>' \
|
||||||
|
$$($(CVS_LIST_EXCEPT) | grep '\.c$$') \
|
||||||
|
| grep . && \
|
||||||
|
{ echo '$(ME): the above files do not include <config.h>' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Prohibit the inclusion of assert.h without an actual use of assert.
|
||||||
|
sc_prohibit_assert_without_use:
|
||||||
|
@files=$$(grep -l '# *include <assert\.h>' \
|
||||||
|
$$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \
|
||||||
|
grep -L '\<assert (' $$files \
|
||||||
|
| grep . && \
|
||||||
|
{ echo "$(ME): the above files include <assert.h> but don't use it" \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
sc_obsolete_symbols:
|
||||||
|
@grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
|
||||||
|
$$($(CVS_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
|
||||||
|
|
||||||
|
# Each nonempty line must start with a year number, or a TAB.
|
||||||
|
sc_changelog:
|
||||||
|
@grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
|
||||||
|
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
|
||||||
|
# with the strings from the two affected variables.
|
||||||
|
dd_c = $(srcdir)/src/dd.c
|
||||||
|
sc_dd_max_sym_length:
|
||||||
|
ifneq ($(wildcard $(dd_c)),)
|
||||||
|
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
|
||||||
|
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|
||||||
|
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
|
||||||
|
| wc --max-line-length); \
|
||||||
|
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|
||||||
|
|tr -d '"' | wc --max-line-length); \
|
||||||
|
if test "$$len" = "$$max"; then :; else \
|
||||||
|
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Many m4 macros names once began with `jm_'.
|
||||||
|
# On 2004-04-13, they were all changed to start with gl_ instead.
|
||||||
|
# Make sure that none are inadvertently reintroduced.
|
||||||
|
sc_prohibit_jm_in_m4:
|
||||||
|
@grep -nE 'jm_[A-Z]' \
|
||||||
|
$$($(CVS_LIST) $(srcdir)/m4 |grep '\.m4$$') && \
|
||||||
|
{ echo '$(ME): do not use jm_ in m4 macro names' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
sc_root_tests:
|
||||||
|
@t1=sc-root.expected; t2=sc-root.actual; \
|
||||||
|
grep -nl '^PRIV_CHECK_ARG=require-root' \
|
||||||
|
$$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1; \
|
||||||
|
sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
|
||||||
|
$(srcdir)/tests/Makefile.am |sort > $$t2; \
|
||||||
|
diff -u $$t1 $$t2 || diff=1; \
|
||||||
|
rm -f $$t1 $$t2; \
|
||||||
|
test "$$diff" \
|
||||||
|
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Create a list of regular expressions matching the names
|
||||||
|
# of files included from system.h. Exclude a couple.
|
||||||
|
.re-list:
|
||||||
|
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
|
||||||
|
| grep -Ev 'sys/(param|file)\.h' \
|
||||||
|
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
|
||||||
|
> $@-t
|
||||||
|
@mv $@-t $@
|
||||||
|
|
||||||
|
# Files in src/ should not include directly any of
|
||||||
|
# the headers already included via system.h.
|
||||||
|
sc_system_h_headers: .re-list
|
||||||
|
@if test -f $(srcdir)/src/system.h; then \
|
||||||
|
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
|
||||||
|
grep -nE -f .re-list \
|
||||||
|
$$($(CVS_LIST) src | \
|
||||||
|
grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
|
||||||
|
&& { echo '$(ME): the above are already included via system.h'\
|
||||||
|
1>&2; exit 1; } || :; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
sc_sun_os_names:
|
||||||
|
@grep -nEi \
|
||||||
|
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
||||||
|
$$($(CVS_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
sc_tight_scope:
|
||||||
|
$(MAKE) -C src $@
|
||||||
|
|
||||||
|
sc_trailing_blank:
|
||||||
|
@grep -n '[ ]$$' $$($(CVS_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found trailing blank(s)' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
sc_two_space_separator_in_usage:
|
||||||
|
@grep -n '^ *--[a-z][0-9A-Za-z-]* [^ ].*\\$$' \
|
||||||
|
$$($(CVS_LIST_EXCEPT)) && \
|
||||||
|
{ echo "$(ME): help2man requires at least two spaces between"; \
|
||||||
|
echo "$(ME): an option and its description"; \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Look for diagnostics that aren't marked for translation.
|
||||||
|
# This won't find any for which error's format string is on a separate line.
|
||||||
|
sc_unmarked_diagnostics:
|
||||||
|
@grep -nE \
|
||||||
|
'\<error \([^"]*"[^"]*[a-z]{3}' $$($(CVS_LIST_EXCEPT)) \
|
||||||
|
| grep -v '_''(' && \
|
||||||
|
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Avoid useless parentheses like those in this example:
|
||||||
|
# #if defined (SYMBOL) || defined (SYM2)
|
||||||
|
sc_useless_cpp_parens:
|
||||||
|
@grep -n '^# *if .*defined *(' $$($(CVS_LIST_EXCEPT)) && \
|
||||||
|
{ echo '$(ME): found useless parentheses in cpp directive' \
|
||||||
|
1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Ensure that date's --help output stays in sync with the info
|
||||||
|
# documentation for GNU strftime. The only exception is %N,
|
||||||
|
# which date accepts but GNU strftime does not.
|
||||||
|
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
|
||||||
|
strftime-check:
|
||||||
|
if test -f $(srcdir)/src/date.c; then \
|
||||||
|
grep '^ %. ' $(srcdir)/src/date.c | sort \
|
||||||
|
| $(extract_char) > $@-src; \
|
||||||
|
{ echo N; \
|
||||||
|
info libc date calendar format | grep '^ `%.'\' \
|
||||||
|
| $(extract_char); } | sort > $@-info; \
|
||||||
|
diff -u $@-src $@-info || exit 1; \
|
||||||
|
rm -f $@-src $@-info; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure that we use only the standard $(VAR) notation,
|
||||||
|
# not @...@ in Makefile.am, now that we can rely on automake
|
||||||
|
# to emit a definition for each substituted variable.
|
||||||
|
makefile-check:
|
||||||
|
grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
|
||||||
|
&& { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
news-date-check: NEWS
|
||||||
|
today=`date +%Y-%m-%d`; \
|
||||||
|
if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
|
||||||
|
>/dev/null; then \
|
||||||
|
:; \
|
||||||
|
else \
|
||||||
|
echo "version or today's date is not in NEWS" 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
changelog-check:
|
||||||
|
if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
|
||||||
|
>/dev/null; then \
|
||||||
|
:; \
|
||||||
|
else \
|
||||||
|
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
m4-check:
|
||||||
|
@grep -n 'AC_DEFUN([^[]' m4/*.m4 \
|
||||||
|
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Verify that all source files using _() are listed in po/POTFILES.in.
|
||||||
|
# FIXME: don't hard-code file names below; use a more general mechanism.
|
||||||
|
po-check:
|
||||||
|
if test -f po/POTFILES.in; then \
|
||||||
|
grep -E -v '^(#|$$)' po/POTFILES.in \
|
||||||
|
| grep -v '^src/false\.c$$' | sort > $@-1; \
|
||||||
|
files=; \
|
||||||
|
for file in $$($(CVS_LIST_EXCEPT)) lib/*.[ch]; do \
|
||||||
|
case $$file in \
|
||||||
|
djgpp/* | man/*) continue;; \
|
||||||
|
esac; \
|
||||||
|
case $$file in \
|
||||||
|
*.[ch]) \
|
||||||
|
base=`expr " $$file" : ' \(.*\)\..'`; \
|
||||||
|
{ test -f $$base.l || test -f $$base.y; } && continue;; \
|
||||||
|
esac; \
|
||||||
|
files="$$files $$file"; \
|
||||||
|
done; \
|
||||||
|
grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort -u > $@-2; \
|
||||||
|
diff -u $@-1 $@-2 || exit 1; \
|
||||||
|
rm -f $@-1 $@-2; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# In a definition of #define AUTHORS "... and ..." where the RHS contains
|
||||||
|
# the English word `and', the string must be marked with `N_ (...)' so that
|
||||||
|
# gettext recognizes it as a string requiring translation.
|
||||||
|
author_mark_check:
|
||||||
|
@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
|
||||||
|
{ echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
|
||||||
|
exit 1; } || :
|
||||||
|
|
||||||
|
# Sometimes it is useful to change the PATH environment variable
|
||||||
|
# in Makefiles. When doing so, it's better not to use the Unix-centric
|
||||||
|
# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
|
||||||
|
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
|
||||||
|
# and there probably aren't many projects with so many Makefile.am files
|
||||||
|
# that we'd have to worry about limits on command line length.
|
||||||
|
msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
||||||
|
makefile_path_separator_check:
|
||||||
|
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
|
||||||
|
&& { echo $(msg) 1>&2; exit 1; } || :
|
||||||
|
|
||||||
|
# Check that `make alpha' will not fail at the end of the process.
|
||||||
|
writable-files:
|
||||||
|
if test -d $(release_archive_dir); then :; else \
|
||||||
|
mkdir $(release_archive_dir); \
|
||||||
|
fi
|
||||||
|
for file in $(distdir).tar.gz $(xd-delta) \
|
||||||
|
$(release_archive_dir)/$(distdir).tar.gz \
|
||||||
|
$(release_archive_dir)/$(xd-delta); do \
|
||||||
|
test -e $$file || continue; \
|
||||||
|
test -w $$file \
|
||||||
|
|| { echo ERROR: $$file is not writable; fail=1; }; \
|
||||||
|
done; \
|
||||||
|
test "$$fail" && exit 1 || :
|
||||||
|
|
||||||
|
v_etc_file = lib/version-etc.c
|
||||||
|
# Make sure that the copyright date in $(v_etc_file) is up to date.
|
||||||
|
copyright-check:
|
||||||
|
@if test -f $(v_etc_file); then \
|
||||||
|
grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
|
||||||
|
>/dev/null \
|
||||||
|
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
|
||||||
|
exit 1; }; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Sanity checks with the CVS repository.
|
||||||
|
cvs-tag-check:
|
||||||
|
echo $(this-cvs-tag); \
|
||||||
|
if $(CVS) -n log -h README | grep -e $(this-cvs-tag): >/dev/null; then \
|
||||||
|
echo "$(this-cvs-tag) as already been used; not tagging" 1>&2; \
|
||||||
|
exit 1; \
|
||||||
|
else :; fi
|
||||||
|
|
||||||
|
cvs-diff-check:
|
||||||
|
if $(CVS) diff >cvs-diffs; then \
|
||||||
|
rm cvs-diffs; \
|
||||||
|
else \
|
||||||
|
echo "Some files are locally modified:" 1>&2; \
|
||||||
|
cat cvs-diffs; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
cvs-check: cvs-diff-check cvs-tag-check
|
||||||
|
|
||||||
|
maintainer-distcheck: changelog-check
|
||||||
|
$(MAKE) distcheck
|
||||||
|
$(MAKE) my-distcheck
|
||||||
|
|
||||||
|
|
||||||
|
# Tag before making distribution. Also, don't make a distribution if
|
||||||
|
# checks fail. Also, make sure the NEWS file is up-to-date.
|
||||||
|
# FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
|
||||||
|
cvs-dist: $(local-check) cvs-check maintainer-distcheck
|
||||||
|
$(CVS) update po
|
||||||
|
$(CVS) tag -c $(this-cvs-tag)
|
||||||
|
$(MAKE) dist
|
||||||
|
|
||||||
|
# Use this to make sure we don't run these programs when building
|
||||||
|
# from a virgin tgz file, below.
|
||||||
|
null_AM_MAKEFLAGS = \
|
||||||
|
ACLOCAL=false \
|
||||||
|
AUTOCONF=false \
|
||||||
|
AUTOMAKE=false \
|
||||||
|
AUTOHEADER=false \
|
||||||
|
MAKEINFO=false
|
||||||
|
|
||||||
|
# Detect format-string/arg-list mismatches that would normally be obscured
|
||||||
|
# by the use of _(). The --disable-nls effectively defines away that macro,
|
||||||
|
# and building with CFLAGS='-Wformat -Werror' causes any format warning to be
|
||||||
|
# treated as a failure. Also, check for shadowing problems with -Wshadow.
|
||||||
|
# These CFLAGS are pretty strict. If you build this target, you probably
|
||||||
|
# have to have a recent version of gcc and glibc headers.
|
||||||
|
TMPDIR ?= /tmp
|
||||||
|
t=$(TMPDIR)/$(PACKAGE)/test
|
||||||
|
my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz)
|
||||||
|
-rm -rf $(t)
|
||||||
|
mkdir -p $(t)
|
||||||
|
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
||||||
|
cd $(t)/$(distdir) \
|
||||||
|
&& ./configure --disable-nls \
|
||||||
|
&& $(MAKE) CFLAGS='-Werror -Wall -Wformat -Wshadow' \
|
||||||
|
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
||||||
|
&& $(MAKE) dvi \
|
||||||
|
&& $(MAKE) check \
|
||||||
|
&& $(MAKE) distclean
|
||||||
|
(cd $(t) && mv $(distdir) $(distdir).old \
|
||||||
|
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
|
||||||
|
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
||||||
|
-rm -rf $(t)
|
||||||
|
@echo "========================"; \
|
||||||
|
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||||
|
echo "========================"
|
||||||
|
|
||||||
|
WGET = wget
|
||||||
|
WGETFLAGS = -C off
|
||||||
|
|
||||||
|
rel-check:
|
||||||
|
tarz=/tmp/rel-check-tarz-$$$$; \
|
||||||
|
md5_tmp=/tmp/rel-check-md5-$$$$; \
|
||||||
|
set -e; \
|
||||||
|
trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
|
||||||
|
$(WGET) $(WGETFLAGS) -q --output-document=$$tarz $(url); \
|
||||||
|
echo "$(md5) -" > $$md5_tmp; \
|
||||||
|
md5sum -c $$md5_tmp < $$tarz
|
||||||
|
|
||||||
|
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
|
||||||
|
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
|
||||||
|
|
||||||
|
rel-files = $(xd-delta) $(DIST_ARCHIVES)
|
||||||
|
announcement: NEWS ChangeLog $(rel-files)
|
||||||
|
@./announce-gen \
|
||||||
|
--release-type=$(RELEASE_TYPE) \
|
||||||
|
--package=$(PACKAGE) \
|
||||||
|
--prev=$(PREV_VERSION) \
|
||||||
|
--curr=$(VERSION) \
|
||||||
|
--release-archive-directory=$(release_archive_dir) \
|
||||||
|
--gpg-key-id=$(gpg_key_ID) \
|
||||||
|
--news=NEWS \
|
||||||
|
$(addprefix --url-dir=, $(url_dir_list)) \
|
||||||
|
|
||||||
|
|
||||||
|
## ---------------- ##
|
||||||
|
## Updating files. ##
|
||||||
|
## ---------------- ##
|
||||||
|
|
||||||
|
ftp-gnu = ftp://ftp.gnu.org/gnu
|
||||||
|
www-gnu = http://www.gnu.org
|
||||||
|
|
||||||
|
# Use mv, if you don't have/want move-if-change.
|
||||||
|
move_if_change ?= move-if-change
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------- #
|
||||||
|
# Updating everything. #
|
||||||
|
# --------------------- #
|
||||||
|
|
||||||
|
.PHONY: update
|
||||||
|
local_updates ?= wget-update cvs-update po-update
|
||||||
|
update: $(local_updates)
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------- #
|
||||||
|
# Updating PO files. #
|
||||||
|
# ------------------- #
|
||||||
|
|
||||||
|
po_repo = http://www.iro.umontreal.ca/contrib/po/maint/$(PACKAGE)
|
||||||
|
.PHONY: do-po-update po-update
|
||||||
|
do-po-update:
|
||||||
|
tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
|
||||||
|
rm -rf $$tmppo && \
|
||||||
|
mkdir $$tmppo && \
|
||||||
|
(cd $$tmppo && \
|
||||||
|
$(WGET) $(WGETFLAGS) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
|
||||||
|
cp $$tmppo/*.po po
|
||||||
|
cd po && $(MAKE) update-po
|
||||||
|
$(MAKE) po-check
|
||||||
|
|
||||||
|
po-update:
|
||||||
|
if test -d "po"; then \
|
||||||
|
$(MAKE) do-po-update; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# -------------------------- #
|
||||||
|
# Updating GNU build tools. #
|
||||||
|
# -------------------------- #
|
||||||
|
|
||||||
|
# The following pseudo table associates a local directory and a URL
|
||||||
|
# with each of the files that belongs to some other package and is
|
||||||
|
# regularly updated from the specified URL.
|
||||||
|
wget_files ?= \
|
||||||
|
$(srcdir)/build-aux/config.guess \
|
||||||
|
$(srcdir)/build-aux/config.sub \
|
||||||
|
$(srcdir)/build-aux/texinfo.tex \
|
||||||
|
$(srcdir)/src/ansi2knr.c
|
||||||
|
|
||||||
|
get-targets = $(patsubst %, get-%, $(wget_files))
|
||||||
|
|
||||||
|
config.guess-url_prefix = $(ftp-gnu)/build-aux/
|
||||||
|
config.sub-url_prefix = $(ftp-gnu)/build-aux/
|
||||||
|
|
||||||
|
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
|
||||||
|
|
||||||
|
texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
|
||||||
|
|
||||||
|
standards.texi-url_prefix = $(www-gnu)/prep/
|
||||||
|
make-stds.texi-url_prefix = $(standards.texi-url_prefix)
|
||||||
|
|
||||||
|
target = $(patsubst get-%, %, $@)
|
||||||
|
url = $($(notdir $(target))-url_prefix)$(notdir $(target))
|
||||||
|
|
||||||
|
.PHONY: $(get-targets)
|
||||||
|
$(get-targets):
|
||||||
|
$(WGET) $(WGETFLAGS) $(url) -O $(target).t \
|
||||||
|
&& $(move_if_change) $(target).t $(target)
|
||||||
|
|
||||||
|
cvs_files ?= \
|
||||||
|
$(srcdir)/build-aux/depcomp \
|
||||||
|
$(srcdir)/build-aux/install-sh \
|
||||||
|
$(srcdir)/build-aux/missing \
|
||||||
|
$(srcdir)/build-aux/mkinstalldirs \
|
||||||
|
$(srcdir)/src/ansi2knr.c
|
||||||
|
automake_repo=:pserver:anoncvs:[email protected]:/cvs/automake
|
||||||
|
.PHONY: wget-update
|
||||||
|
wget-update: $(get-targets)
|
||||||
|
|
||||||
|
.PHONY: cvs-update
|
||||||
|
cvs-update:
|
||||||
|
fail=; \
|
||||||
|
for f in $(cvs_files); do \
|
||||||
|
test -f $$f || { echo "*** skipping $$f" 1>&2; continue; }; \
|
||||||
|
cvs diff $$f > /dev/null \
|
||||||
|
|| { echo "*** $$f is locally modified; skipping it" 1>&2; \
|
||||||
|
fail=yes; continue; }; \
|
||||||
|
file=$$(basename $$f); \
|
||||||
|
echo checking out $$file...; \
|
||||||
|
$(CVS) -d $(automake_repo) co -p automake/lib/$$file> $$f.t \
|
||||||
|
&& $(move_if_change) $$f.t $$f; \
|
||||||
|
done; \
|
||||||
|
test "$$fail" && exit 1
|
||||||
|
|
||||||
|
emit_upload_commands:
|
||||||
|
@echo =====================================
|
||||||
|
@echo =====================================
|
||||||
|
@echo "$(srcdir)/gnupload $(GNUPLOADFLAGS) \\"
|
||||||
|
@echo " --to $(gnu_rel_host):coreutils \\"
|
||||||
|
@echo " $(rel-files)"
|
||||||
|
@echo '# send the /tmp/announcement e-mail'
|
||||||
|
@echo =====================================
|
||||||
|
@echo =====================================
|
||||||
|
|
||||||
|
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
|
||||||
|
xdelta delta -9 $^ $@ || :
|
||||||
|
|
||||||
|
.PHONY: alpha beta major
|
||||||
|
alpha beta major: news-date-check $(local-check)
|
||||||
|
$(MAKE) cvs-dist
|
||||||
|
$(MAKE) $(xd-delta)
|
||||||
|
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
|
||||||
|
ln $(rel-files) $(release_archive_dir)
|
||||||
|
chmod a-w $(rel-files)
|
||||||
|
$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
|
||||||
|
echo $(VERSION) > $(prev_version_file)
|
||||||
|
$(CVS) ci -m. $(prev_version_file)
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
1996-05-12 Jim Meyering <[email protected]>
|
1996-05-12 Jim Meyering <[email protected]>
|
||||||
|
|
||||||
* src/bison.simple (__yy_memcpy) [__cplusplus]: Reorder declarations
|
* src/bison.simple (__yy_memcpy) [__cplusplus]: Reorder declarations
|
||||||
of variables f and t.
|
of variables f and t.
|
||||||
|
|
||||||
1996-05-11 Richard Stallman <[email protected]>
|
1996-05-11 Richard Stallman <[email protected]>
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ to the bison package.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2005, 2009-2015, 2018 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -1,53 +1,29 @@
|
|||||||
This package contains the GNU Bison parser generator.
|
This directory contains the Bison parser generator.
|
||||||
|
|
||||||
* Installation
|
See the file INSTALL for generic compilation and installation instructions.
|
||||||
** Build
|
See the file doc/FAQ for frequently asked questions.
|
||||||
See the file INSTALL for generic compilation and installation
|
|
||||||
instructions.
|
|
||||||
|
|
||||||
Bison requires GNU m4 1.4.6 or later. See:
|
Bison requires GNU m4 1.4.3 or later. See:
|
||||||
|
|
||||||
https://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz
|
ftp://ftp.gnu.org/gnu/m4/m4-1.4.3.tar.gz
|
||||||
|
|
||||||
** Internationalization
|
Bison can work with pre-1.4.3 distributions of GNU m4 if they are
|
||||||
Bison supports two catalogues: one for Bison itself (i.e., for the
|
sufficiently patched, but if you encounter a bug with an older
|
||||||
maintainer-side parser generation), and one for the generated parsers
|
distribution and report a bug we will probably suggest that you
|
||||||
(i.e., for the user-side parser execution). The requirements between
|
upgrade to 1.4.3 as the first step in trying to fix it.
|
||||||
both differ: bison needs ngettext, the generated parsers do not. To
|
|
||||||
simplify the build system, neither are installed if ngettext is not
|
|
||||||
supported, even if generated parsers could have been localized. See
|
|
||||||
http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html for
|
|
||||||
more details.
|
|
||||||
|
|
||||||
* Questions
|
Please send bug reports to <[email protected]>. Please include the
|
||||||
See the section FAQ in the documentation (doc/bison.info) for
|
version number from `bison --version', and a complete, self-contained
|
||||||
frequently asked questions. The documentation is also available in
|
test case in each bug report.
|
||||||
PDF and HTML, provided you have a recent version of Texinfo installed:
|
|
||||||
run "make pdf" or "make html".
|
|
||||||
|
|
||||||
If you have questions about using Bison and the documentation does
|
If you have questions about using Bison and the documentation does
|
||||||
not answer them, please send mail to <[email protected]>.
|
not answer them, please send mail to <[email protected]>.
|
||||||
|
|
||||||
* Bug reports
|
|
||||||
Please send bug reports to <[email protected]>. Please include the
|
|
||||||
version number from 'bison --version', and a complete, self-contained
|
|
||||||
test case in each bug report.
|
|
||||||
|
|
||||||
* Copyright statements
|
|
||||||
For any copyright year range specified as YYYY-ZZZZ in this package,
|
|
||||||
note that the range specifies every single year in that closed interval.
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Local Variables:
|
Copyright (C) 1992, 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
mode: outline
|
|
||||||
fill-column: 76
|
|
||||||
End:
|
|
||||||
|
|
||||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018 Free Software
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of GNU bison, the GNU Compiler Compiler.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ the problems you encounter.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002, 2004, 2009-2015, 2018 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
|
|||||||
+25
-422
@@ -1,456 +1,70 @@
|
|||||||
This file attempts to describe the rules to use when hacking Bison.
|
-*- outline -*-
|
||||||
Don't put this file into the distribution.
|
|
||||||
|
|
||||||
Everything related to the development of Bison is on Savannah:
|
|
||||||
|
|
||||||
http://savannah.gnu.org/projects/bison/
|
|
||||||
|
|
||||||
|
|
||||||
* Administrivia
|
|
||||||
|
|
||||||
** If you incorporate a change from somebody on the net:
|
|
||||||
First, if it is a large change, you must make sure they have signed the
|
|
||||||
appropriate paperwork. Second, be sure to add their name and email address
|
|
||||||
to THANKS.
|
|
||||||
|
|
||||||
** If a change fixes a test, mention the test in the commit message.
|
|
||||||
|
|
||||||
** Bug reports
|
|
||||||
If somebody reports a new bug, mention his name in the commit message and in
|
|
||||||
the test case you write. Put him into THANKS.
|
|
||||||
|
|
||||||
The correct response to most actual bugs is to write a new test case which
|
|
||||||
demonstrates the bug. Then fix the bug, re-run the test suite, and check
|
|
||||||
everything in.
|
|
||||||
|
|
||||||
|
|
||||||
* Hacking
|
|
||||||
|
|
||||||
** Visible changes
|
|
||||||
Which include serious bug fixes, must be mentioned in NEWS.
|
|
||||||
|
|
||||||
** Translations
|
|
||||||
Only user visible strings are to be translated: error messages, bits of the
|
|
||||||
.output file etc. This excludes impossible error messages (comparable to
|
|
||||||
assert/abort), and all the --trace output which is meant for the maintainers
|
|
||||||
only.
|
|
||||||
|
|
||||||
** Horizontal tabs
|
|
||||||
Do not add horizontal tab characters to any file in Bison's repository
|
|
||||||
except where required. For example, do not use tabs to format C code.
|
|
||||||
However, make files, ChangeLog, and some regular expressions require tabs.
|
|
||||||
Also, test cases might need to contain tabs to check that Bison properly
|
|
||||||
processes tabs in its input.
|
|
||||||
|
|
||||||
|
|
||||||
* Working from the repository
|
|
||||||
|
|
||||||
These notes intend to help people working on the checked-out sources.
|
These notes intend to help people working on the checked-out sources.
|
||||||
These requirements do not apply when building from a distribution tarball.
|
These requirements do not apply when building from a distribution tarball.
|
||||||
|
|
||||||
** Requirements
|
* Requirements
|
||||||
|
|
||||||
We've opted to keep only the highest-level sources in the repository. This
|
We've opted to keep only the highest-level sources in the repository.
|
||||||
eases our maintenance burden, (fewer merges etc.), but imposes more
|
This eases our maintenance burden, (fewer merges etc.), but imposes more
|
||||||
requirements on anyone wishing to build from the just-checked-out sources.
|
requirements on anyone wishing to build from the just-checked-out sources.
|
||||||
For example, you have to use the latest stable versions of the maintainer
|
For example, you have to use the latest stable versions of the maintainer
|
||||||
tools we depend upon, including:
|
tools we depend upon, including:
|
||||||
|
|
||||||
- Autoconf <http://www.gnu.org/software/autoconf/>
|
|
||||||
- Automake <http://www.gnu.org/software/automake/>
|
- Automake <http://www.gnu.org/software/automake/>
|
||||||
|
- Autoconf <http://www.gnu.org/software/autoconf/>
|
||||||
- Flex <http://www.gnu.org/software/flex/>
|
- Flex <http://www.gnu.org/software/flex/>
|
||||||
- Gettext <http://www.gnu.org/software/gettext/>
|
- Gettext <http://www.gnu.org/software/gettext/>
|
||||||
- Graphviz <http://www.graphviz.org>
|
|
||||||
- Gzip <http://www.gnu.org/software/gzip/>
|
- Gzip <http://www.gnu.org/software/gzip/>
|
||||||
- Help2man <http://www.gnu.org/software/help2man/>
|
|
||||||
- Perl <http://www.cpan.org/>
|
- Perl <http://www.cpan.org/>
|
||||||
- Rsync <http://samba.anu.edu.au/rsync/>
|
- Rsync <http://samba.anu.edu.au/rsync/>
|
||||||
- Tar <http://www.gnu.org/software/tar/>
|
- Tar <http://www.gnu.org/software/tar/>
|
||||||
- Texinfo <http://www.gnu.org/software/texinfo/>
|
|
||||||
|
|
||||||
Valgrind <http://valgrind.org/> is also highly recommended, if it supports
|
Valgrind <http://valgrind.org/> is also highly recommended, if
|
||||||
your architecture.
|
Valgrind supports your architecture.
|
||||||
|
|
||||||
If you're using a GNU/Linux distribution, the easiest way to install the
|
Bison is written using Bison grammars, so there are bootstrapping
|
||||||
above packages depends on your system. The following shell command should
|
issues. The bootstrap script attempts to discover when the C code
|
||||||
work for Debian-based systems such as Ubuntu:
|
generated from the grammars is out of date, and to bootstrap with an
|
||||||
|
out-of-date version of the C code, but the process is not foolproof.
|
||||||
|
Also, you may run into similar problems yourself if you modify Bison.
|
||||||
|
|
||||||
sudo apt-get install \
|
Only building the initial full source tree will be a bit painful.
|
||||||
autoconf automake autopoint flex graphviz help2man texinfo valgrind
|
Later, after synchronizing from the repository a plain `make' should
|
||||||
|
be sufficient.
|
||||||
|
|
||||||
Bison is written using Bison grammars, so there are bootstrapping issues.
|
* First checkout
|
||||||
The bootstrap script attempts to discover when the C code generated from the
|
|
||||||
grammars is out of date, and to bootstrap with an out-of-date version of the
|
|
||||||
C code, but the process is not foolproof. Also, you may run into similar
|
|
||||||
problems yourself if you modify Bison.
|
|
||||||
|
|
||||||
Only building the initial full source tree will be a bit painful. Later,
|
|
||||||
after synchronizing from the repository a plain 'make' should be sufficient.
|
|
||||||
Note, however, that when gnulib is updated, running './bootstrap' again
|
|
||||||
might be needed.
|
|
||||||
|
|
||||||
** First checkout
|
|
||||||
|
|
||||||
Obviously, if you are reading these notes, you did manage to check out
|
Obviously, if you are reading these notes, you did manage to check out
|
||||||
this package from the repository. For the record, you will find all the
|
this package from the repository. For the record, you will find all the
|
||||||
relevant information on:
|
relevant information on:
|
||||||
|
|
||||||
http://savannah.gnu.org/git/?group=bison
|
http://savannah.gnu.org/cvs/?group_id=56
|
||||||
|
|
||||||
Bison uses Git submodules: subscriptions to other Git repositories.
|
|
||||||
In particular it uses gnulib, the GNU portability library. To ask Git
|
|
||||||
to perform the first checkout of the submodules, run
|
|
||||||
|
|
||||||
$ git submodule update --init
|
|
||||||
|
|
||||||
The next step is to get other files needed to build, which are
|
The next step is to get other files needed to build, which are
|
||||||
extracted from other source packages:
|
extracted from other source packages:
|
||||||
|
|
||||||
$ ./bootstrap
|
$ ./bootstrap
|
||||||
|
|
||||||
Bootstrapping updates the submodules to the versions registered in the
|
And there you are! Just
|
||||||
top-level directory. To change gnulib, first check out the version you want
|
|
||||||
in `gnulib`, then commit this change in Bison's repository, and finally run
|
|
||||||
bootstrap.
|
|
||||||
|
|
||||||
If it fails with missing symbols (e.g., "error: possibly undefined macro:
|
$ ./configure
|
||||||
AC_PROG_GNU_M4"), you are likely to have forgotten the submodule
|
$ make
|
||||||
initialization part. Otherwise, there you are! Just
|
$ make check
|
||||||
|
|
||||||
$ ./configure
|
|
||||||
$ make
|
|
||||||
$ make check
|
|
||||||
|
|
||||||
At this point, there should be no difference between your local copy,
|
At this point, there should be no difference between your local copy,
|
||||||
and the master copy:
|
and the master copy:
|
||||||
|
|
||||||
$ git diff
|
$ cvs diff
|
||||||
|
|
||||||
should output no difference.
|
should output no difference.
|
||||||
|
|
||||||
Enjoy!
|
Enjoy!
|
||||||
|
|
||||||
** Updating
|
|
||||||
|
|
||||||
The use of submodules make things somewhat different because git does
|
|
||||||
not support recursive operations: submodules must be taken care of
|
|
||||||
explicitly by the user.
|
|
||||||
|
|
||||||
*** Updating Bison
|
|
||||||
|
|
||||||
If you pull a newer version of a branch, say via "git pull", you might
|
|
||||||
import requests for updated submodules. A simple "git diff" will reveal if
|
|
||||||
the current version of the submodule (i.e., the actual contents of the
|
|
||||||
gnulib directory) and the current request from the subscriber (i.e., the
|
|
||||||
reference of the version of gnulib that the Bison repository requests)
|
|
||||||
differ. To upgrade the submodules (i.e., to check out the version that is
|
|
||||||
actually requested by the subscriber, run "git submodule update".
|
|
||||||
|
|
||||||
$ git pull
|
|
||||||
$ git submodule update
|
|
||||||
|
|
||||||
*** Updating a submodule
|
|
||||||
To update a submodule, say gnulib, do as follows:
|
|
||||||
|
|
||||||
Get the most recent version of the master branch from git.
|
|
||||||
|
|
||||||
$ cd gnulib
|
|
||||||
$ git fetch
|
|
||||||
$ git checkout -b master --track origin/master
|
|
||||||
|
|
||||||
Make sure Bison can live with that version of gnulib.
|
|
||||||
|
|
||||||
$ cd ..
|
|
||||||
$ ./bootstrap
|
|
||||||
$ make distcheck
|
|
||||||
|
|
||||||
Register your changes.
|
|
||||||
|
|
||||||
$ git checkin ...
|
|
||||||
|
|
||||||
For a suggestion of what gnulib commit might be stable enough for a formal
|
|
||||||
release, see the ChangeLog in the latest gnulib snapshot at:
|
|
||||||
|
|
||||||
http://erislabs.net/ianb/projects/gnulib/
|
|
||||||
|
|
||||||
The Autoconf files we use are currently:
|
|
||||||
|
|
||||||
m4/m4.m4
|
|
||||||
lib/m4sugar/m4sugar.m4
|
|
||||||
lib/m4sugar/foreach.m4
|
|
||||||
|
|
||||||
These files don't change very often in Autoconf, so it should be relatively
|
|
||||||
straight-forward to examine the differences in order to decide whether to
|
|
||||||
update.
|
|
||||||
|
|
||||||
* Test suite
|
|
||||||
|
|
||||||
** make check
|
|
||||||
Use liberally.
|
|
||||||
|
|
||||||
** TESTSUITEFLAGS
|
|
||||||
|
|
||||||
To run just the testsuite (not the tests related to the examples), run `make
|
|
||||||
check-local`.
|
|
||||||
|
|
||||||
The default is for make check-local to run all tests sequentially. This can
|
|
||||||
be very time consuming when checking repeatedly or on slower setups. This
|
|
||||||
can be sped up in two ways:
|
|
||||||
|
|
||||||
Using -j, in a make-like fashion, for example:
|
|
||||||
$ make check-local TESTSUITEFLAGS='-j8'
|
|
||||||
|
|
||||||
Running only the tests of a certain category, as specified in the AT files
|
|
||||||
with AT_KEYWORDS([[category]]). Categories include:
|
|
||||||
- c++, for c++ parsers
|
|
||||||
- deprec, for tests concerning deprecated constructs.
|
|
||||||
- glr, for glr parsers
|
|
||||||
- java, for java parsers
|
|
||||||
- report, for automaton dumps
|
|
||||||
|
|
||||||
To run a specific set of tests, use -k (for "keyword"). For example:
|
|
||||||
$ make check-local TESTSUITEFLAGS='-k c++'
|
|
||||||
|
|
||||||
Both can be combined.
|
|
||||||
|
|
||||||
** Typical errors
|
|
||||||
If the test suite shows failures such as the following one
|
|
||||||
|
|
||||||
.../bison/lib/getopt.h:196:8: error: redefinition of 'struct option'
|
|
||||||
/usr/include/getopt.h:54:8: error: previous definition of 'struct option'
|
|
||||||
|
|
||||||
it probably means that some file was compiled without
|
|
||||||
AT_DATA_SOURCE_PROLOGUE. This error is due to the fact that our -I options
|
|
||||||
pick up gnulib's replacement headers, such as getopt.h, and this will go
|
|
||||||
wrong if config.h was not included first.
|
|
||||||
|
|
||||||
See tests/local.at for details.
|
|
||||||
|
|
||||||
** make maintainer-check-valgrind
|
|
||||||
This target uses valgrind both to check bison, and the generated parsers.
|
|
||||||
|
|
||||||
This is not mature on Mac OS X. First, Valgrind does support the way bison
|
|
||||||
calls m4, so Valgrind cannot be used to check bison on Mac OS X.
|
|
||||||
|
|
||||||
Second, there are many errors that come from the platform itself, not from
|
|
||||||
bison. build-aux/darwin11.4.0.valgrind addresses some of them.
|
|
||||||
|
|
||||||
Third, valgrind issues warnings such as:
|
|
||||||
|
|
||||||
--99312:0:syswrap- WARNING: Ignoring sigreturn( ..., UC_RESET_ALT_STACK );
|
|
||||||
|
|
||||||
which cause the test to fail uselessly. It is hard to ignore these errors
|
|
||||||
with a major overhaul of the way instrumentation is performed in the test
|
|
||||||
suite. So currently, do not try to run valgrind on Mac OS X.
|
|
||||||
|
|
||||||
** Release checks
|
|
||||||
Try to run the test suite with more severe conditions before a
|
|
||||||
release:
|
|
||||||
|
|
||||||
- Configure the package with --enable-gcc-warnings, so that one checks that
|
|
||||||
1. Bison compiles cleanly, 2. the parsers it produces compile cleanly too.
|
|
||||||
|
|
||||||
- Maybe build with -DGNULIB_POSIXCHECK, which suggests gnulib modules that
|
|
||||||
can fix portability issues. See if you really want to pay attention to
|
|
||||||
its warnings; there's no need to obey blindly to it
|
|
||||||
(<http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00057.html>).
|
|
||||||
|
|
||||||
- Check with "make syntax-check" if there are issues diagnosed by gnulib.
|
|
||||||
|
|
||||||
- run "make maintainer-check" which:
|
|
||||||
- runs "valgrind -q bison" to run Bison under Valgrind.
|
|
||||||
- runs the parsers under Valgrind.
|
|
||||||
- runs the test suite with G++ as C compiler...
|
|
||||||
|
|
||||||
- run "make maintainer-check-push", which runs "make maintainer-check" while
|
|
||||||
activating the push implementation and its pull interface wrappers in many
|
|
||||||
test cases that were originally written to exercise only the pull
|
|
||||||
implementation. This makes certain the push implementation can perform
|
|
||||||
every task the pull implementation can.
|
|
||||||
|
|
||||||
- run "make maintainer-check-xml", which runs "make maintainer-check" while
|
|
||||||
checking Bison's XML automaton report for every working grammar passed to
|
|
||||||
Bison in the test suite. The check just diffs the output of Bison's
|
|
||||||
included XSLT style sheets with the output of --report=all and --graph.
|
|
||||||
|
|
||||||
- running "make maintainer-check-release" takes care of running
|
|
||||||
maintainer-check, maintainer-check-push and maintainer-check-xml.
|
|
||||||
|
|
||||||
- Change tests/atlocal/CFLAGS to add your preferred options.
|
|
||||||
|
|
||||||
- Test with a very recent version of GCC for both C and C++. Testing with
|
|
||||||
older versions that are still in use is nice too.
|
|
||||||
|
|
||||||
|
|
||||||
* Release Procedure
|
|
||||||
This section needs to be updated to take into account features from gnulib.
|
|
||||||
In particular, be sure to read README-release.
|
|
||||||
|
|
||||||
** Update the submodules. See above.
|
|
||||||
|
|
||||||
** Update maintainer tools, such as Autoconf. See above.
|
|
||||||
|
|
||||||
** Try to get the *.pot files to the Translation Project at least one
|
|
||||||
week before a stable release, to give them time to translate them. Before
|
|
||||||
generating the *.pot files, make sure that po/POTFILES.in and
|
|
||||||
runtime-po/POTFILES.in list all files with translatable strings. This
|
|
||||||
helps: grep -l '\<_(' *.
|
|
||||||
|
|
||||||
** Tests
|
|
||||||
See above.
|
|
||||||
|
|
||||||
** Update the foreign files
|
|
||||||
Running "./bootstrap" in the top level should update them all for you. This
|
|
||||||
covers PO files too. Sometimes a PO file contains problems that causes it
|
|
||||||
to be rejected by recent Gettext releases; please report these to the
|
|
||||||
Translation Project.
|
|
||||||
|
|
||||||
** Update README
|
|
||||||
Make sure the information in README is current. Most notably, make sure it
|
|
||||||
recommends a version of GNU M4 that is compatible with the latest Bison
|
|
||||||
sources.
|
|
||||||
|
|
||||||
** Check copyright years.
|
|
||||||
We update years in copyright statements throughout Bison once at the start
|
|
||||||
of every year by running "make update-copyright". However, before a
|
|
||||||
release, it's good to verify that it's actually been run. Besides the
|
|
||||||
copyright statement for each Bison file, check the copyright statements that
|
|
||||||
the skeletons insert into generated parsers, and check all occurrences of
|
|
||||||
PACKAGE_COPYRIGHT_YEAR in configure.ac.
|
|
||||||
|
|
||||||
** Update NEWS, commit and tag.
|
|
||||||
See do-release-commit-and-tag in README-release. For a while, we used beta
|
|
||||||
names such as "2.6_rc1". Now that we use gnulib in the release procedure,
|
|
||||||
we must use "2.5.90", which has the additional benefit of being properly
|
|
||||||
sorted in "git tag -l".
|
|
||||||
|
|
||||||
** make alpha, beta, or stable
|
|
||||||
See README-release.
|
|
||||||
|
|
||||||
** Upload
|
|
||||||
There are two ways to upload the tarballs to the GNU servers: using gnupload
|
|
||||||
(from gnulib), or by hand. Obviously prefer the former. But in either
|
|
||||||
case, be sure to read the following paragraph.
|
|
||||||
|
|
||||||
*** Setup
|
|
||||||
You need "gnupg".
|
|
||||||
|
|
||||||
Make sure your public key has been uploaded at least to keys.gnupg.net. You
|
|
||||||
can upload it with:
|
|
||||||
|
|
||||||
gpg --keyserver keys.gnupg.net --send-keys F125BDF3
|
|
||||||
|
|
||||||
where F125BDF3 should be replaced with your key ID.
|
|
||||||
|
|
||||||
*** Using gnupload
|
|
||||||
You need "ncftp".
|
|
||||||
|
|
||||||
At the end "make stable" (or alpha/beta) will display the procedure to run.
|
|
||||||
Just copy and paste it in your shell.
|
|
||||||
|
|
||||||
*** By hand
|
|
||||||
|
|
||||||
The generic GNU upload procedure is at:
|
|
||||||
|
|
||||||
http://www.gnu.org/prep/maintain/maintain.html#Automated-FTP-Uploads
|
|
||||||
|
|
||||||
Follow the instructions there to register your information so you're permitted
|
|
||||||
to upload.
|
|
||||||
|
|
||||||
Here's a brief reminder of how to roll the tarballs and upload them:
|
|
||||||
|
|
||||||
*** make distcheck
|
|
||||||
*** gpg -b bison-2.3b.tar.gz
|
|
||||||
*** In a file named "bison-2.3b.tar.gz.directive", type:
|
|
||||||
|
|
||||||
version: 1.1
|
|
||||||
directory: bison
|
|
||||||
filename: bison-2.3b.tar.gz
|
|
||||||
|
|
||||||
*** gpg --clearsign bison-2.3b.tar.gz.directive
|
|
||||||
*** ftp ftp-upload.gnu.org # Log in as anonymous.
|
|
||||||
*** cd /incoming/alpha # cd /incoming/ftp for full release.
|
|
||||||
*** put bison-2.3b.tar.gz # This can take a while.
|
|
||||||
*** put bison-2.3b.tar.gz.sig
|
|
||||||
*** put bison-2.3b.tar.gz.directive.asc
|
|
||||||
*** Repeat all these steps for bison-2.3b.tar.xz.
|
|
||||||
|
|
||||||
** Update Bison manual on www.gnu.org.
|
|
||||||
|
|
||||||
*** You need a non-anonymous checkout of the web pages directory.
|
|
||||||
|
|
||||||
$ cvs -d [email protected]:/web/bison checkout bison
|
|
||||||
|
|
||||||
*** Get familiar with the instructions for web page maintainers.
|
|
||||||
http://www.gnu.org/server/standards/readme_index.html
|
|
||||||
http://www.gnu.org/server/standards/README.software.html
|
|
||||||
especially the note about symlinks.
|
|
||||||
|
|
||||||
*** Build the web pages.
|
|
||||||
Assuming BISON_CHECKOUT refers to a checkout of the Bison dir, and
|
|
||||||
BISON_WWW_CHECKOUT refers to the web directory created above, do:
|
|
||||||
|
|
||||||
$ cd $BISON_CHECKOUT/doc
|
|
||||||
$ make stamp-vti
|
|
||||||
$ ../build-aux/gendocs.sh -o "$BISON_WWW_CHECKOUT/manual" \
|
|
||||||
bison "Bison - GNU parser generator"
|
|
||||||
$ cd $BISON_WWW_CHECKOUT
|
|
||||||
|
|
||||||
Verify that the result looks sane.
|
|
||||||
|
|
||||||
*** Commit the modified and the new files.
|
|
||||||
|
|
||||||
*** Remove old files.
|
|
||||||
Find the files which have not been overwritten (because they belonged to
|
|
||||||
sections that have been removed or renamed):
|
|
||||||
|
|
||||||
$ cd manual/html_node
|
|
||||||
$ ls -lt
|
|
||||||
|
|
||||||
Remove these files and commit their removal to CVS. For each of these
|
|
||||||
files, add a line to the file .symlinks. This will ensure that hyperlinks
|
|
||||||
to the removed files will redirect to the entire manual; this is better than
|
|
||||||
a 404 error.
|
|
||||||
|
|
||||||
There is a problem with 'index.html' being written twice (once for POSIX
|
|
||||||
function 'index', once for the table of contents); you can ignore this
|
|
||||||
issue.
|
|
||||||
|
|
||||||
** Announce
|
|
||||||
The "make stable" (or alpha/beta) command just created a template,
|
|
||||||
$HOME/announce-bison-X.Y. Otherwise, to generate it, run:
|
|
||||||
|
|
||||||
make RELEASE_TYPE=alpha gpg_key_ID=F125BDF3 announcement
|
|
||||||
|
|
||||||
where alpha can be replaced by beta or stable and F125BDF3 should be
|
|
||||||
replaced with your key ID.
|
|
||||||
|
|
||||||
Complete/fix the announcement file. The generated list of recipients
|
|
||||||
([email protected], [email protected], [email protected],
|
|
||||||
[email protected], and [email protected]) is
|
|
||||||
appropriate for a stable release or a "serious beta". For any other
|
|
||||||
release, drop at least [email protected]. For an example of how to fill out
|
|
||||||
the rest of the template, search the mailing list archives for the most
|
|
||||||
recent release announcement.
|
|
||||||
|
|
||||||
For a stable release, send the same announcement on the comp.compilers
|
|
||||||
newsgroup by sending email to [email protected]. Do not make any Cc as the
|
|
||||||
moderator will throw away anything cross-posted or Cc'ed. It really needs
|
|
||||||
to be a separate message.
|
|
||||||
|
|
||||||
** Prepare NEWS
|
|
||||||
So that developers don't accidentally add new items to the old NEWS entry,
|
|
||||||
create a new empty entry in line 3 (without the two leading spaces):
|
|
||||||
|
|
||||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
|
||||||
|
|
||||||
Push these changes.
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2002-2005, 2007-2015, 2018 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software
|
||||||
|
Foundation, Inc.
|
||||||
This file is part of GNU Bison.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -464,14 +78,3 @@ GNU General Public License for more details.
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
LocalWords: Automake Autoconf Gettext Gzip Rsync Valgrind gnulib submodules
|
|
||||||
LocalWords: submodule init cd distcheck checkin ChangeLog valgrind sigreturn
|
|
||||||
LocalWords: UC gcc DGNULIB POSIXCHECK xml XSLT glr lalr README po runtime rc
|
|
||||||
LocalWords: gnupload gnupg gpg keyserver BDF ncftp filename clearsign cvs dir
|
|
||||||
LocalWords: symlinks vti html lt POSIX Cc'ed
|
|
||||||
|
|
||||||
Local Variables:
|
|
||||||
mode: outline
|
|
||||||
fill-column: 76
|
|
||||||
End:
|
|
||||||
|
|||||||
+3
-3
@@ -9,7 +9,7 @@ Bison supports the @N construction, which gives you access to
|
|||||||
the starting and ending line number and character number associated
|
the starting and ending line number and character number associated
|
||||||
with any of the symbols in the current rule.
|
with any of the symbols in the current rule.
|
||||||
|
|
||||||
Also, Bison supports the command '%expect N' which says not to mention
|
Also, Bison supports the command `%expect N' which says not to mention
|
||||||
the conflicts if there are N shift/reduce conflicts and no reduce/reduce
|
the conflicts if there are N shift/reduce conflicts and no reduce/reduce
|
||||||
conflicts.
|
conflicts.
|
||||||
|
|
||||||
@@ -25,8 +25,8 @@ LALR(1) Look-Ahead Sets", ACM Transactions on Programming Languages
|
|||||||
and Systems (TOPLAS) 4, 4 (October 1982), 615-649. Their
|
and Systems (TOPLAS) 4, 4 (October 1982), 615-649. Their
|
||||||
technique is the standard one now.)
|
technique is the standard one now.)
|
||||||
|
|
||||||
paul rubin
|
paul rubin
|
||||||
free software foundation
|
free software foundation
|
||||||
|
|
||||||
|
|
||||||
[DeRemer-Pennello reference corrected by Paul Eggert <[email protected]>,
|
[DeRemer-Pennello reference corrected by Paul Eggert <[email protected]>,
|
||||||
|
|||||||
@@ -1,206 +1,99 @@
|
|||||||
Bison was originally written by Robert Corbett. It would not be what
|
Bison was originally written by Robert Corbett. It would not be what
|
||||||
it is today without the invaluable help of these people:
|
it is today without the invaluable help of these people:
|
||||||
|
|
||||||
Aaro Koskinen [email protected]
|
|
||||||
Аскар Сафин [email protected]
|
|
||||||
Airy Andre [email protected]
|
Airy Andre [email protected]
|
||||||
Akim Demaille akim@lrde.epita.fr
|
Akim Demaille akim@freefriends.org
|
||||||
Albert Chin-A-Young [email protected]
|
Albert Chin-A-Young [email protected]
|
||||||
Alexander Belopolsky [email protected]
|
Alexander Belopolsky [email protected]
|
||||||
Alexandre Duret-Lutz adl@lrde.epita.fr
|
Alexandre Duret-Lutz adl@src.lip6.fr
|
||||||
Andreas Schwab [email protected]
|
Andreas Schwab [email protected]
|
||||||
Andrew Suffield [email protected]
|
Andrew Suffield [email protected]
|
||||||
Angelo Borsotti [email protected]
|
|
||||||
Anthony Heading [email protected]
|
Anthony Heading [email protected]
|
||||||
Antonio Silva Correia [email protected]
|
|
||||||
Arnold Robbins [email protected]
|
Arnold Robbins [email protected]
|
||||||
Art Haas [email protected]
|
Art Haas [email protected]
|
||||||
Askar Safin [email protected]
|
|
||||||
Baron Schwartz [email protected]
|
Baron Schwartz [email protected]
|
||||||
Ben Pfaff [email protected]
|
|
||||||
Benoit Perrot [email protected]
|
Benoit Perrot [email protected]
|
||||||
Bernd Edlinger [email protected]
|
|
||||||
Bernd Kiefer [email protected]
|
|
||||||
Bert Deknuydt [email protected]
|
Bert Deknuydt [email protected]
|
||||||
Bill Allombert [email protected]
|
|
||||||
Bob Rossi [email protected]
|
Bob Rossi [email protected]
|
||||||
Brandon Lucia [email protected]
|
Brandon Lucia [email protected]
|
||||||
Brooks Moses [email protected]
|
|
||||||
Bruce Lilly [email protected]
|
Bruce Lilly [email protected]
|
||||||
Bruno Haible [email protected]
|
Bruno Haible [email protected]
|
||||||
Charles-Henri de Boysson [email protected]
|
Charles-Henri de Boysson [email protected]
|
||||||
Christian Burger [email protected]
|
Christian Burger [email protected]
|
||||||
Colin Daley [email protected]
|
|
||||||
Cris Bailiff [email protected]
|
Cris Bailiff [email protected]
|
||||||
Cris van Pelt [email protected]
|
Cris van Pelt [email protected]
|
||||||
Csaba Raduly [email protected]
|
|
||||||
Dagobert Michelsen [email protected]
|
|
||||||
Daniel Frużyński [email protected]
|
|
||||||
Daniel Galloway [email protected]
|
|
||||||
Daniel Hagerty [email protected]
|
Daniel Hagerty [email protected]
|
||||||
David J. MacKenzie [email protected]
|
David J. MacKenzie [email protected]
|
||||||
David Kastrup [email protected]
|
|
||||||
David Michael [email protected]
|
|
||||||
Dengke Du [email protected]
|
|
||||||
Dennis Clarke [email protected]
|
|
||||||
Derek Clegg [email protected]
|
|
||||||
Derek M. Jones [email protected]
|
Derek M. Jones [email protected]
|
||||||
Di-an Jan [email protected]
|
|
||||||
Dick Streefland [email protected]
|
Dick Streefland [email protected]
|
||||||
Didier Godefroy [email protected]
|
|
||||||
Efi Fogel [email protected]
|
|
||||||
Enrico Scholz [email protected]
|
Enrico Scholz [email protected]
|
||||||
Eric Blake [email protected]
|
Eric Blake [email protected]
|
||||||
Étienne Renault [email protected]
|
|
||||||
Evgeny Stambulchik [email protected]
|
Evgeny Stambulchik [email protected]
|
||||||
Fabrice Bauzac [email protected]
|
Fabrice Bauzac [email protected]
|
||||||
Ferdinand Thiessen [email protected]
|
|
||||||
Florian Krohm [email protected]
|
Florian Krohm [email protected]
|
||||||
Frank Heckenbach [email protected]
|
Frank Heckenbach [email protected]
|
||||||
Frans Englich [email protected]
|
Frans Englich [email protected]
|
||||||
Gabriel Rassoul [email protected]
|
|
||||||
Gary L Peskin [email protected]
|
|
||||||
Georg Sauthoff [email protected]
|
|
||||||
George Neuner [email protected]
|
|
||||||
Gilles Espinasse [email protected]
|
|
||||||
Goran Uddeborg [email protected]
|
|
||||||
Guido Trentalancia [email protected]
|
Guido Trentalancia [email protected]
|
||||||
H. Merijn Brand [email protected]
|
H. Merijn Brand [email protected]
|
||||||
Hans Åberg haberg[email protected]
|
Hans Aberg haberg@matematik.su.se
|
||||||
Jan Nieuwenhuizen [email protected]
|
Jan Nieuwenhuizen [email protected]
|
||||||
Jannick [email protected]
|
|
||||||
Jerry Quinn [email protected]
|
|
||||||
Jesse Thilo [email protected]
|
Jesse Thilo [email protected]
|
||||||
Jim Kent [email protected]
|
Jim Kent [email protected]
|
||||||
Jim Meyering [email protected]
|
Jim Meyering [email protected]
|
||||||
Joel E. Denny joeldenny@joeldenny.org
|
Joel E. Denny jdenny@ces.clemson.edu
|
||||||
Johan van Selst [email protected]
|
|
||||||
John Horigan [email protected]
|
|
||||||
Jonathan Fabrizio [email protected]
|
|
||||||
Jonathan Nieder [email protected]
|
|
||||||
Josh Soref [email protected]
|
|
||||||
Juan Manuel Guerrero [email protected]
|
Juan Manuel Guerrero [email protected]
|
||||||
Kees Zeelenberg [email protected]
|
Kees Zeelenberg [email protected]
|
||||||
Keith Browne [email protected]
|
Keith Browne [email protected]
|
||||||
Ken Moffat [email protected]
|
|
||||||
Laurent Mascherpa [email protected]
|
Laurent Mascherpa [email protected]
|
||||||
Lie Yan [email protected]
|
|
||||||
Magnus Fromreide [email protected]
|
Magnus Fromreide [email protected]
|
||||||
Marc Autret [email protected]
|
Marc Autret [email protected]
|
||||||
Marc Mendiola [email protected]
|
|
||||||
Mark Boyall [email protected]
|
|
||||||
Martin Jacobs [email protected]
|
|
||||||
Martin Mokrejs [email protected]
|
Martin Mokrejs [email protected]
|
||||||
Martin Nylin [email protected]
|
Martin Nylin [email protected]
|
||||||
Matt Kraai [email protected]
|
Matt Kraai [email protected]
|
||||||
Matt Rosing [email protected]
|
Matt Rosing [email protected]
|
||||||
Maxim Prohorenko [email protected]
|
|
||||||
Michael Catanzaro [email protected]
|
|
||||||
Michael Felt [email protected]
|
|
||||||
Michael Hayes [email protected]
|
Michael Hayes [email protected]
|
||||||
Michael Raskin [email protected]
|
|
||||||
Michel d'Hooge [email protected]
|
|
||||||
Michiel De Wilde [email protected]
|
|
||||||
Mickael Labau [email protected]
|
Mickael Labau [email protected]
|
||||||
Mike Castle [email protected]
|
Mike Castle [email protected]
|
||||||
Mike Sullivan [email protected]
|
|
||||||
Nate Guerin [email protected]
|
|
||||||
Neil Booth [email protected]
|
Neil Booth [email protected]
|
||||||
Nelson H. F. Beebe [email protected]
|
Nelson H. F. Beebe [email protected]
|
||||||
Nick Bowler [email protected]
|
|
||||||
Nicolas Bedon [email protected]
|
|
||||||
Nicolas Burrus [email protected]
|
Nicolas Burrus [email protected]
|
||||||
Nicolas Tisserand [email protected]
|
Nicolas Tisserand [email protected]
|
||||||
Noah Friedman [email protected]
|
Noah Friedman [email protected]
|
||||||
Odd Arild Olsen [email protected]
|
|
||||||
Oleg Smolsky [email protected]
|
Oleg Smolsky [email protected]
|
||||||
Oleksii Taran [email protected]
|
|
||||||
Paolo Bonzini [email protected]
|
Paolo Bonzini [email protected]
|
||||||
Paolo Simone Gasparello [email protected]
|
|
||||||
Pascal Bart [email protected]
|
Pascal Bart [email protected]
|
||||||
Paul Eggert [email protected]
|
Paul Eggert [email protected]
|
||||||
Paul Hilfinger [email protected]
|
Paul Hilfinger [email protected]
|
||||||
Per Allansson [email protected]
|
Per Allansson [email protected]
|
||||||
Peter Eisentraut [email protected]
|
|
||||||
Peter Fales [email protected]
|
Peter Fales [email protected]
|
||||||
Peter Hamorsky [email protected]
|
Peter Hamorsky [email protected]
|
||||||
Peter Simons [email protected]
|
|
||||||
Petr Machata [email protected]
|
|
||||||
Pho [email protected]
|
|
||||||
Piotr Gackiewicz [email protected]
|
Piotr Gackiewicz [email protected]
|
||||||
Piotr Marcińczyk [email protected]
|
|
||||||
Quentin Hocquet [email protected]
|
|
||||||
Quoc Peyrot [email protected]
|
Quoc Peyrot [email protected]
|
||||||
R Blake [email protected]
|
R Blake [email protected]
|
||||||
Raja R Harinath [email protected]
|
Raja R Harinath [email protected]
|
||||||
Ralf Wildenhues [email protected]
|
|
||||||
Rich Wilson [email protected]
|
|
||||||
Richard Stallman [email protected]
|
Richard Stallman [email protected]
|
||||||
Rici Lake [email protected]
|
|
||||||
Rob Conde [email protected]
|
|
||||||
Rob Vermaas [email protected]
|
|
||||||
Robert Anisko [email protected]
|
Robert Anisko [email protected]
|
||||||
Robert Yang [email protected]
|
|
||||||
Roland Levillain [email protected]
|
|
||||||
Satya Kiran Popuri [email protected]
|
Satya Kiran Popuri [email protected]
|
||||||
Sebastian Setzer [email protected]
|
|
||||||
Sebastien Fricker [email protected]
|
Sebastien Fricker [email protected]
|
||||||
Sergei Steshenko sergstesh@yahoo.com
|
Sebastian Setzer sebastian.setzer.ext@siemens.com
|
||||||
Shura [email protected]
|
Shura [email protected]
|
||||||
Simon Sobisch [email protected]
|
|
||||||
Stefano Lattarini [email protected]
|
|
||||||
Stephen Cameron [email protected]
|
|
||||||
Steve Murphy [email protected]
|
Steve Murphy [email protected]
|
||||||
Sum Wu [email protected]
|
|
||||||
Théophile Ranquet [email protected]
|
|
||||||
Thiru Ramakrishnan [email protected]
|
|
||||||
Thomas Jahns [email protected]
|
|
||||||
Tim Josling [email protected]
|
Tim Josling [email protected]
|
||||||
Tim Landscheidt [email protected]
|
|
||||||
Tim Van Holder [email protected]
|
Tim Van Holder [email protected]
|
||||||
Tobias Frost [email protected]
|
|
||||||
Tom Lane [email protected]
|
Tom Lane [email protected]
|
||||||
Tom Tromey [email protected]
|
Tom Tromey [email protected]
|
||||||
Tommy Nordgren [email protected]
|
Tommy Nordgren [email protected]
|
||||||
Troy A. Johnson [email protected]
|
Troy A. Johnson [email protected]
|
||||||
Tys Lefering [email protected]
|
Tys Lefering [email protected]
|
||||||
Valentin Tolmer [email protected]
|
|
||||||
Victor Khomenko [email protected]
|
|
||||||
Vin Shelton [email protected]
|
Vin Shelton [email protected]
|
||||||
W.C.A. Wijngaards [email protected]
|
|
||||||
Wayne Green [email protected]
|
Wayne Green [email protected]
|
||||||
Wei Song [email protected]
|
|
||||||
Wojciech Polak [email protected]
|
|
||||||
Wolfgang S. Kechel [email protected]
|
|
||||||
Wolfram Wagner [email protected]
|
Wolfram Wagner [email protected]
|
||||||
Wwp [email protected]
|
Wwp [email protected]
|
||||||
xolodho [email protected]
|
|
||||||
Zack Weinberg [email protected]
|
Zack Weinberg [email protected]
|
||||||
長田偉伸 [email protected]
|
|
||||||
|
|
||||||
Many people are not named here because we lost track of them. We
|
Many people are not named here because we lost track of them. We
|
||||||
thank them! Please, help us keeping this list up to date.
|
thank them! Please, help us keeping this list up to date.
|
||||||
|
|
||||||
Local Variables:
|
Local Variables:
|
||||||
mode: text
|
mode: text
|
||||||
coding: utf-8
|
|
||||||
End:
|
End:
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Copyright (C) 2000-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of Bison, the GNU Parser Generator.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|||||||
@@ -1,174 +1,32 @@
|
|||||||
* Short term
|
-*- outline -*-
|
||||||
** Graphviz display code thoughts
|
|
||||||
The code for the --graph option is over two files: print_graph, and
|
|
||||||
graphviz. This is because Bison used to also produce VCG graphs, but since
|
|
||||||
this is no longer true, maybe we could consider these files for fusion.
|
|
||||||
|
|
||||||
An other consideration worth noting is that print_graph.c (correct me if I
|
* Header guards
|
||||||
am wrong) should contain generic functions, whereas graphviz.c and other
|
|
||||||
potential files should contain just the specific code for that output
|
|
||||||
format. It will probably prove difficult to tell if the implementation is
|
|
||||||
actually generic whilst only having support for a single format, but it
|
|
||||||
would be nice to keep stuff a bit tidier: right now, the construction of the
|
|
||||||
bitset used to show reductions is in the graphviz-specific code, and on the
|
|
||||||
opposite side we have some use of \l, which is graphviz-specific, in what
|
|
||||||
should be generic code.
|
|
||||||
|
|
||||||
Little effort seems to have been given to factoring these files and their
|
From Franc,ois: should we keep the directory part in the CPP guard?
|
||||||
rint{,-xml} counterpart. We would very much like to re-use the pretty format
|
|
||||||
of states from .output for the graphs, etc.
|
|
||||||
|
|
||||||
Also, the underscore in print_graph.[ch] isn't very fitting considering the
|
|
||||||
dashes in the other filenames.
|
|
||||||
|
|
||||||
Since graphviz dies on medium-to-big grammars, maybe consider an other tool?
|
|
||||||
|
|
||||||
** push-parser
|
|
||||||
Check it too when checking the different kinds of parsers. And be
|
|
||||||
sure to check that the initial-action is performed once per parsing.
|
|
||||||
|
|
||||||
** m4 names
|
|
||||||
b4_shared_declarations is no longer what it is. Make it
|
|
||||||
b4_parser_declaration for instance.
|
|
||||||
|
|
||||||
** yychar in lalr1.cc
|
|
||||||
There is a large difference bw maint and master on the handling of
|
|
||||||
yychar (which was removed in lalr1.cc). See what needs to be
|
|
||||||
back-ported.
|
|
||||||
|
|
||||||
|
|
||||||
/* User semantic actions sometimes alter yychar, and that requires
|
* Yacc.c: CPP Macros
|
||||||
that yytoken be updated with the new translation. We take the
|
|
||||||
approach of translating immediately before every use of yytoken.
|
|
||||||
One alternative is translating here after every semantic action,
|
|
||||||
but that translation would be missed if the semantic action
|
|
||||||
invokes YYABORT, YYACCEPT, or YYERROR immediately after altering
|
|
||||||
yychar. In the case of YYABORT or YYACCEPT, an incorrect
|
|
||||||
destructor might then be invoked immediately. In the case of
|
|
||||||
YYERROR, subsequent parser actions might lead to an incorrect
|
|
||||||
destructor call or verbose syntax error message before the
|
|
||||||
lookahead is translated. */
|
|
||||||
|
|
||||||
/* Make sure we have latest lookahead translation. See comments at
|
Do some people use YYPURE, YYLSP_NEEDED like we do in the test suite?
|
||||||
user semantic actions for why this is necessary. */
|
They should not: it is not documented. But if they need to, let's
|
||||||
yytoken = yytranslate_ (yychar);
|
find something clean (not like YYLSP_NEEDED...).
|
||||||
|
|
||||||
|
|
||||||
** stack.hh
|
* Installation
|
||||||
Get rid of it. The original idea is nice, but actually it makes
|
|
||||||
the code harder to follow, and uselessly different from the other
|
|
||||||
skeletons.
|
|
||||||
|
|
||||||
** Get rid of fake #lines [Bison: ...]
|
* Documentation
|
||||||
Possibly as simple as checking whether the column number is nonnegative.
|
Before releasing, make sure the documentation ("Understanding your
|
||||||
|
parser") refers to the current `output' format.
|
||||||
|
|
||||||
I have seen messages like the following from GCC.
|
* lalr1.cc
|
||||||
|
** vector
|
||||||
<built-in>:0: fatal error: opening dependency file .deps/libltdl/argz.Tpo: No such file or directory
|
Move to using vector, drop stack.hh.
|
||||||
|
|
||||||
|
|
||||||
** Discuss about %printer/%destroy in the case of C++.
|
|
||||||
It would be very nice to provide the symbol classes with an operator<<
|
|
||||||
and a destructor. Unfortunately the syntax we have chosen for
|
|
||||||
%destroy and %printer make them hard to reuse. For instance, the user
|
|
||||||
is invited to write something like
|
|
||||||
|
|
||||||
%printer { debug_stream() << $$; } <my_type>;
|
|
||||||
|
|
||||||
which is hard to reuse elsewhere since it wants to use
|
|
||||||
"debug_stream()" to find the stream to use. The same applies to
|
|
||||||
%destroy: we told the user she could use the members of the Parser
|
|
||||||
class in the printers/destructors, which is not good for an operator<<
|
|
||||||
since it is no longer bound to a particular parser, it's just a
|
|
||||||
(standalone symbol).
|
|
||||||
|
|
||||||
** Rename LR0.cc
|
|
||||||
as lr0.cc, why upper case?
|
|
||||||
|
|
||||||
* Various
|
|
||||||
** YYERRCODE
|
|
||||||
Defined to 256, but not used, not documented. Probably the token
|
|
||||||
number for the error token, which POSIX wants to be 256, but which
|
|
||||||
Bison might renumber if the user used number 256. Keep fix and doc?
|
|
||||||
Throw away?
|
|
||||||
|
|
||||||
Also, why don't we output the token name of the error token in the
|
|
||||||
output? It is explicitly skipped:
|
|
||||||
|
|
||||||
/* Skip error token and tokens without identifier. */
|
|
||||||
if (sym != errtoken && id)
|
|
||||||
|
|
||||||
Of course there are issues with name spaces, but if we disable we have
|
|
||||||
something which seems to be more simpler and more consistent instead
|
|
||||||
of the special case YYERRCODE.
|
|
||||||
|
|
||||||
enum yytokentype {
|
|
||||||
error = 256,
|
|
||||||
// ...
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
We could (should?) also treat the case of the undef_token, which is
|
|
||||||
numbered 257 for yylex, and 2 internal. Both appear for instance in
|
|
||||||
toknum:
|
|
||||||
|
|
||||||
const unsigned short
|
|
||||||
parser::yytoken_number_[] =
|
|
||||||
{
|
|
||||||
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
|
||||||
|
|
||||||
while here
|
|
||||||
|
|
||||||
enum yytokentype {
|
|
||||||
TOK_EOF = 0,
|
|
||||||
TOK_EQ = 258,
|
|
||||||
|
|
||||||
so both 256 and 257 are "mysterious".
|
|
||||||
|
|
||||||
const char*
|
|
||||||
const parser::yytname_[] =
|
|
||||||
{
|
|
||||||
"\"end of command\"", "error", "$undefined", "\"=\"", "\"break\"",
|
|
||||||
|
|
||||||
|
|
||||||
** yychar == yyempty_
|
|
||||||
The code in yyerrlab reads:
|
|
||||||
|
|
||||||
if (yychar <= YYEOF)
|
|
||||||
{
|
|
||||||
/* Return failure if at end of input. */
|
|
||||||
if (yychar == YYEOF)
|
|
||||||
YYABORT;
|
|
||||||
}
|
|
||||||
|
|
||||||
There are only two yychar that can be <= YYEOF: YYEMPTY and YYEOF.
|
|
||||||
But I can't produce the situation where yychar is YYEMPTY here, is it
|
|
||||||
really possible? The test suite does not exercise this case.
|
|
||||||
|
|
||||||
This shows that it would be interesting to manage to install skeleton
|
|
||||||
coverage analysis to the test suite.
|
|
||||||
|
|
||||||
* From lalr1.cc to yacc.c
|
|
||||||
** Single stack
|
|
||||||
Merging the three stacks in lalr1.cc simplified the code, prompted for
|
|
||||||
other improvements and also made it faster (probably because memory
|
|
||||||
management is performed once instead of three times). I suggest that
|
|
||||||
we do the same in yacc.c.
|
|
||||||
|
|
||||||
** yysyntax_error
|
|
||||||
The code bw glr.c and yacc.c is really alike, we can certainly factor
|
|
||||||
some parts.
|
|
||||||
|
|
||||||
|
** I18n
|
||||||
|
Catch up with yacc.c.
|
||||||
|
|
||||||
* Report
|
* Report
|
||||||
|
|
||||||
** Figures
|
|
||||||
Some statistics about the grammar and the parser would be useful,
|
|
||||||
especially when asking the user to send some information about the
|
|
||||||
grammars she is working on. We should probably also include some
|
|
||||||
information about the variables (I'm not sure for instance we even
|
|
||||||
specify what LR variant was used).
|
|
||||||
|
|
||||||
** GLR
|
** GLR
|
||||||
How would Paul like to display the conflicted actions? In particular,
|
How would Paul like to display the conflicted actions? In particular,
|
||||||
what when two reductions are possible on a given lookahead token, but one is
|
what when two reductions are possible on a given lookahead token, but one is
|
||||||
@@ -176,13 +34,13 @@ part of $default. Should we make the two reductions explicit, or just
|
|||||||
keep $default? See the following point.
|
keep $default? See the following point.
|
||||||
|
|
||||||
** Disabled Reductions
|
** Disabled Reductions
|
||||||
See 'tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
|
See `tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
|
||||||
what we want to do.
|
what we want to do.
|
||||||
|
|
||||||
** Documentation
|
** Documentation
|
||||||
Extend with error productions. The hard part will probably be finding
|
Extend with error productions. The hard part will probably be finding
|
||||||
the right rule so that a single state does not exhibit too many yet
|
the right rule so that a single state does not exhibit too many yet
|
||||||
undocumented ''features''. Maybe an empty action ought to be
|
undocumented ``features''. Maybe an empty action ought to be
|
||||||
presented too. Shall we try to make a single grammar with all these
|
presented too. Shall we try to make a single grammar with all these
|
||||||
features, or should we have several very small grammars?
|
features, or should we have several very small grammars?
|
||||||
|
|
||||||
@@ -196,30 +54,37 @@ DeRemer and Penello: they already provide the algorithm.
|
|||||||
|
|
||||||
|
|
||||||
* Extensions
|
* Extensions
|
||||||
** Multiple start symbols
|
|
||||||
Would be very useful when parsing closely related languages.
|
|
||||||
|
|
||||||
** Better error messages
|
** Labeling the symbols
|
||||||
The users are not provided with enough tools to forge their error messages.
|
Have a look at the Lemon parser generator: instead of $1, $2 etc. they
|
||||||
See for instance "Is there an option to change the message produced by
|
can name the values. This is much more pleasant. For instance:
|
||||||
YYERROR_VERBOSE?" by Simon Sobisch, on bison-help.
|
|
||||||
|
|
||||||
** %include
|
exp (res): exp (a) '+' exp (b) { $res = $a + $b; };
|
||||||
This is a popular demand. We already made many changes in the parser that
|
|
||||||
should make this reasonably easy to implement.
|
|
||||||
|
|
||||||
** Push parsers
|
I love this. I have been bitten too often by the removal of the
|
||||||
There is demand for push parsers in Java and C++. And GLR I guess.
|
symbol, and forgetting to shift all the $n to $n-1. If you are
|
||||||
|
unlucky, it compiles...
|
||||||
|
|
||||||
|
But instead of using $a etc., we can use regular variables. And
|
||||||
|
instead of using (), I propose to use `:' (again). Paul suggests
|
||||||
|
supporting `->' in addition to `:' to separate LHS and RHS. In other
|
||||||
|
words:
|
||||||
|
|
||||||
|
r:exp -> a:exp '+' b:exp { r = a + b; };
|
||||||
|
|
||||||
|
That requires an significant improvement of the grammar parser. Using
|
||||||
|
GLR would be nice. It also requires that Bison know the type of the
|
||||||
|
symbols (which will be useful for %include anyway). So we have some
|
||||||
|
time before...
|
||||||
|
|
||||||
|
Note that there remains the problem of locations: `@r'?
|
||||||
|
|
||||||
** Generate code instead of tables
|
|
||||||
This is certainly quite a lot of work. See
|
|
||||||
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.50.4539.
|
|
||||||
|
|
||||||
** $-1
|
** $-1
|
||||||
We should find a means to provide an access to values deep in the
|
We should find a means to provide an access to values deep in the
|
||||||
stack. For instance, instead of
|
stack. For instance, instead of
|
||||||
|
|
||||||
baz: qux { $$ = $<foo>-1 + $<bar>0 + $1; }
|
baz: qux { $$ = $<foo>-1 + $<bar>0 + $1; }
|
||||||
|
|
||||||
we should be able to have:
|
we should be able to have:
|
||||||
|
|
||||||
@@ -234,6 +99,9 @@ must be in the scanner: we must not parse what is in a switched off
|
|||||||
part of %if. Akim Demaille thinks it should be in the parser, so as
|
part of %if. Akim Demaille thinks it should be in the parser, so as
|
||||||
to avoid falling into another CPP mistake.
|
to avoid falling into another CPP mistake.
|
||||||
|
|
||||||
|
** -D, --define-muscle NAME=VALUE
|
||||||
|
To define muscles via cli. Or maybe support directly NAME=VALUE?
|
||||||
|
|
||||||
** XML Output
|
** XML Output
|
||||||
There are couple of available extensions of Bison targeting some XML
|
There are couple of available extensions of Bison targeting some XML
|
||||||
output. Some day we should consider including them. One issue is
|
output. Some day we should consider including them. One issue is
|
||||||
@@ -249,25 +117,21 @@ XML output for GNU Bison and gcc
|
|||||||
XML output for GNU Bison
|
XML output for GNU Bison
|
||||||
http://yaxx.sourceforge.net/
|
http://yaxx.sourceforge.net/
|
||||||
|
|
||||||
** Counterexample generation
|
|
||||||
https://lists.gnu.org/archive/html/bug-bison/2016-06/msg00000.html
|
|
||||||
http://www.cs.cornell.edu/andru/papers/cupex/
|
|
||||||
|
|
||||||
* Unit rules
|
* Unit rules
|
||||||
Maybe we could expand unit rules, i.e., transform
|
Maybe we could expand unit rules, i.e., transform
|
||||||
|
|
||||||
exp: arith | bool;
|
exp: arith | bool;
|
||||||
arith: exp '+' exp;
|
arith: exp '+' exp;
|
||||||
bool: exp '&' exp;
|
bool: exp '&' exp;
|
||||||
|
|
||||||
into
|
into
|
||||||
|
|
||||||
exp: exp '+' exp | exp '&' exp;
|
exp: exp '+' exp | exp '&' exp;
|
||||||
|
|
||||||
when there are no actions. This can significantly speed up some
|
when there are no actions. This can significantly speed up some
|
||||||
grammars. I can't find the papers. In particular the book 'LR
|
grammars. I can't find the papers. In particular the book `LR
|
||||||
parsing: Theory and Practice' is impossible to find, but according to
|
parsing: Theory and Practice' is impossible to find, but according to
|
||||||
'Parsing Techniques: a Practical Guide', it includes information about
|
`Parsing Techniques: a Practical Guide', it includes information about
|
||||||
this issue. Does anybody have it?
|
this issue. Does anybody have it?
|
||||||
|
|
||||||
|
|
||||||
@@ -278,28 +142,63 @@ this issue. Does anybody have it?
|
|||||||
Some history of Bison and some bibliography would be most welcome.
|
Some history of Bison and some bibliography would be most welcome.
|
||||||
Are there any Texinfo standards for bibliography?
|
Are there any Texinfo standards for bibliography?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* Java, Fortran, etc.
|
||||||
|
|
||||||
|
|
||||||
* Coding system independence
|
* Coding system independence
|
||||||
Paul notes:
|
Paul notes:
|
||||||
|
|
||||||
Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
|
Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
|
||||||
255). It also assumes that the 8-bit character encoding is
|
255). It also assumes that the 8-bit character encoding is
|
||||||
the same for the invocation of 'bison' as it is for the
|
the same for the invocation of 'bison' as it is for the
|
||||||
invocation of 'cc', but this is not necessarily true when
|
invocation of 'cc', but this is not necessarily true when
|
||||||
people run bison on an ASCII host and then use cc on an EBCDIC
|
people run bison on an ASCII host and then use cc on an EBCDIC
|
||||||
host. I don't think these topics are worth our time
|
host. I don't think these topics are worth our time
|
||||||
addressing (unless we find a gung-ho volunteer for EBCDIC or
|
addressing (unless we find a gung-ho volunteer for EBCDIC or
|
||||||
PDP-10 ports :-) but they should probably be documented
|
PDP-10 ports :-) but they should probably be documented
|
||||||
somewhere.
|
somewhere.
|
||||||
|
|
||||||
More importantly, Bison does not currently allow NUL bytes in
|
More importantly, Bison does not currently allow NUL bytes in
|
||||||
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
|
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
|
||||||
the source code. This should get fixed.
|
the source code. This should get fixed.
|
||||||
|
|
||||||
|
* --graph
|
||||||
|
Show reductions.
|
||||||
|
|
||||||
* Broken options ?
|
* Broken options ?
|
||||||
** %token-table
|
** %token-table
|
||||||
** Skeleton strategy
|
** Skeleton strategy
|
||||||
Must we keep %token-table?
|
Must we keep %token-table?
|
||||||
|
|
||||||
|
* src/print_graph.c
|
||||||
|
Find the best graph parameters.
|
||||||
|
|
||||||
|
* BTYacc
|
||||||
|
See if we can integrate backtracking in Bison. Charles-Henri de
|
||||||
|
Boysson <[email protected]> is working on this, and already has some
|
||||||
|
results. Vadim Maslow, the maintainer of BTYacc was contacted, and we
|
||||||
|
stay in touch with him. Adjusting the Bison grammar parser will be
|
||||||
|
needed to support some extra BTYacc features. This is less urgent.
|
||||||
|
|
||||||
|
** Keeping the conflicted actions
|
||||||
|
First, analyze the differences between byacc and btyacc (I'm referring
|
||||||
|
to the executables). Find where the conflicts are preserved.
|
||||||
|
|
||||||
|
** Compare with the GLR tables
|
||||||
|
See how isomorphic the way BTYacc and the way the GLR adjustments in
|
||||||
|
Bison are compatible. *As much as possible* one should try to use the
|
||||||
|
same implementation in the Bison executables. I insist: it should be
|
||||||
|
very feasible to use the very same conflict tables.
|
||||||
|
|
||||||
|
** Adjust the skeletons
|
||||||
|
Import the skeletons for C and C++.
|
||||||
|
|
||||||
|
** Improve the skeletons
|
||||||
|
Have them support yysymprint, yydestruct and so forth.
|
||||||
|
|
||||||
|
|
||||||
* Precedence
|
* Precedence
|
||||||
|
|
||||||
** Partial order
|
** Partial order
|
||||||
@@ -307,6 +206,15 @@ It is unfortunate that there is a total order for precedence. It
|
|||||||
makes it impossible to have modular precedence information. We should
|
makes it impossible to have modular precedence information. We should
|
||||||
move to partial orders (sounds like series/parallel orders to me).
|
move to partial orders (sounds like series/parallel orders to me).
|
||||||
|
|
||||||
|
** Correlation b/w precedence and associativity
|
||||||
|
Also, I fail to understand why we have to assign the same
|
||||||
|
associativity to operators with the same precedence. For instance,
|
||||||
|
why can't I decide that the precedence of * and / is the same, but the
|
||||||
|
latter is nonassoc?
|
||||||
|
|
||||||
|
If there is really no profound motivation, we should find a new syntax
|
||||||
|
to allow specifying this.
|
||||||
|
|
||||||
** RR conflicts
|
** RR conflicts
|
||||||
See if we can use precedence between rules to solve RR conflicts. See
|
See if we can use precedence between rules to solve RR conflicts. See
|
||||||
what POSIX says.
|
what POSIX says.
|
||||||
@@ -335,6 +243,20 @@ $<type_name>$ = $<type_name>1. I therefore think that one should implement
|
|||||||
a Bison option where every typed default rule is explicitly written out
|
a Bison option where every typed default rule is explicitly written out
|
||||||
(same typed ruled can of course be grouped together).
|
(same typed ruled can of course be grouped together).
|
||||||
|
|
||||||
|
Note: Robert Anisko handles this. He knows how to do it.
|
||||||
|
|
||||||
|
|
||||||
|
* Warnings
|
||||||
|
It would be nice to have warning support. See how Autoconf handles
|
||||||
|
them, it is fairly well described there. It would be very nice to
|
||||||
|
implement this in such a way that other programs could use
|
||||||
|
lib/warnings.[ch].
|
||||||
|
|
||||||
|
Don't work on this without first announcing you do, as I already have
|
||||||
|
thought about it, and know many of the components that can be used to
|
||||||
|
implement it.
|
||||||
|
|
||||||
|
|
||||||
* Pre and post actions.
|
* Pre and post actions.
|
||||||
From: Florian Krohm <[email protected]>
|
From: Florian Krohm <[email protected]>
|
||||||
Subject: YYACT_EPILOGUE
|
Subject: YYACT_EPILOGUE
|
||||||
@@ -366,33 +288,9 @@ to bison. If you're interested, I'll work on a patch.
|
|||||||
* Better graphics
|
* Better graphics
|
||||||
Equip the parser with a means to create the (visual) parse tree.
|
Equip the parser with a means to create the (visual) parse tree.
|
||||||
|
|
||||||
* Complaint submessage indentation.
|
|
||||||
We already have an implementation that works fairly well for named
|
|
||||||
reference messages, but it would be nice to use it consistently for all
|
|
||||||
submessages from Bison. For example, the "previous definition"
|
|
||||||
submessage or the list of correct values for a %define variable might
|
|
||||||
look better with indentation.
|
|
||||||
|
|
||||||
However, the current implementation makes the assumption that the
|
|
||||||
location printed on the first line is not usually much shorter than the
|
|
||||||
locations printed on the submessage lines that follow. That assumption
|
|
||||||
may not hold true as often for some kinds of submessages especially if
|
|
||||||
we ever support multiple grammar files.
|
|
||||||
|
|
||||||
Here's a proposal for how a new implementation might look:
|
|
||||||
|
|
||||||
http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00086.html
|
|
||||||
|
|
||||||
|
|
||||||
Local Variables:
|
|
||||||
mode: outline
|
|
||||||
coding: utf-8
|
|
||||||
fill-column: 76
|
|
||||||
End:
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Copyright (C) 2001-2004, 2006, 2008-2015, 2018 Free Software Foundation,
|
Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation,
|
||||||
Inc.
|
Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|||||||
+20
-59
@@ -1,6 +1,6 @@
|
|||||||
# Bootstrap configuration.
|
# Bootstrap configuration.
|
||||||
|
|
||||||
# Copyright (C) 2006-2015, 2018 Free Software Foundation, Inc.
|
# Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,44 +17,26 @@
|
|||||||
|
|
||||||
# gnulib modules used by this package.
|
# gnulib modules used by this package.
|
||||||
gnulib_modules='
|
gnulib_modules='
|
||||||
argmatch assert
|
argmatch config-h c-strcase configmake
|
||||||
calloc-posix close closeout config-h c-strcase
|
dirname error extensions fopen-safer git-version-gen
|
||||||
configmake
|
getopt gettext hash inttypes javacomp-script javaexec-script malloc
|
||||||
dirname
|
mbswidth obstack quote quotearg stdbool stpcpy strerror strtoul
|
||||||
error extensions fdl fopen-safer
|
strverscmp unistd unistd-safer unlocked-io verify xalloc xalloc-die
|
||||||
getopt-gnu
|
xstrndup
|
||||||
gettext git-version-gen gitlog-to-changelog
|
'
|
||||||
gpl-3.0 hash inttypes isnan javacomp-script
|
|
||||||
javaexec-script ldexpl malloc-gnu
|
|
||||||
mbswidth
|
|
||||||
non-recursive-gnulib-prefix-hack
|
|
||||||
obstack
|
|
||||||
obstack-printf
|
|
||||||
perror progname
|
|
||||||
quote quotearg
|
|
||||||
readme-release
|
|
||||||
realloc-posix
|
|
||||||
spawn-pipe stdbool stpcpy strdup-posix strerror strverscmp
|
|
||||||
timevar
|
|
||||||
unistd unistd-safer unlink unlocked-io
|
|
||||||
update-copyright unsetenv verify
|
|
||||||
warnings
|
|
||||||
xalloc
|
|
||||||
xalloc-die
|
|
||||||
xconcat-filename
|
|
||||||
xmemdup0
|
|
||||||
xstrndup
|
|
||||||
|
|
||||||
fprintf-posix printf-posix snprintf-posix sprintf-posix
|
# Any gnulib files needed that are not in modules.
|
||||||
vsnprintf-posix vsprintf-posix
|
gnulib_files='
|
||||||
|
m4/warning.m4
|
||||||
'
|
'
|
||||||
|
|
||||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||||
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
|
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
|
||||||
--from-code=UTF-8\\\
|
--from-code=UTF-8\\\
|
||||||
--flag=asprintf:2:c-format\\\
|
--flag=asprintf:2:c-format\\\
|
||||||
--flag=complain:3:c-format\\\
|
--flag=complain:1:c-format --flag=complain_at:2:c-format\\\
|
||||||
--flag=complain_indent:4:c-format\\\
|
--flag=fatal:1:c-format --flag=fatal_at:2:c-format\\\
|
||||||
|
--flag=warn:1:c-format --flag=warn_at:2:c-format\\\
|
||||||
--flag=unexpected_end:2:c-format\\\
|
--flag=unexpected_end:2:c-format\\\
|
||||||
'
|
'
|
||||||
XGETTEXT_OPTIONS_RUNTIME=$XGETTEXT_OPTIONS'\\\
|
XGETTEXT_OPTIONS_RUNTIME=$XGETTEXT_OPTIONS'\\\
|
||||||
@@ -64,43 +46,22 @@ XGETTEXT_OPTIONS_RUNTIME=$XGETTEXT_OPTIONS'\\\
|
|||||||
# Gettext supplies these files, but we don't need them since
|
# Gettext supplies these files, but we don't need them since
|
||||||
# we don't have an intl subdirectory.
|
# we don't have an intl subdirectory.
|
||||||
excluded_files='
|
excluded_files='
|
||||||
|
m4/codeset.m4
|
||||||
m4/glibc2.m4
|
m4/glibc2.m4
|
||||||
|
m4/glibc21.m4
|
||||||
m4/intdiv0.m4
|
m4/intdiv0.m4
|
||||||
m4/intl.m4
|
m4/intl.m4
|
||||||
m4/intldir.m4
|
m4/intldir.m4
|
||||||
m4/intmax.m4
|
m4/intmax.m4
|
||||||
|
m4/inttypes_h.m4
|
||||||
m4/lcmessage.m4
|
m4/lcmessage.m4
|
||||||
m4/lock.m4
|
m4/lock.m4
|
||||||
m4/longdouble.m4
|
m4/longdouble.m4
|
||||||
|
m4/printf-posix.m4
|
||||||
m4/signed.m4
|
m4/signed.m4
|
||||||
|
m4/size_max.m4
|
||||||
m4/uintmax_t.m4
|
m4/uintmax_t.m4
|
||||||
m4/ulonglong.m4
|
m4/ulonglong.m4
|
||||||
m4/visibility.m4
|
m4/visibility.m4
|
||||||
|
m4/xsize.m4
|
||||||
'
|
'
|
||||||
|
|
||||||
gnulib_tool_option_extras='--symlink --makefile-name=gnulib.mk'
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
bootstrap_epilogue()
|
|
||||||
{
|
|
||||||
# Make sure we don't need src/bison, which usually doesn't exist at
|
|
||||||
# the time of a bootstrap.
|
|
||||||
touch src/parse-gram.[ch]
|
|
||||||
|
|
||||||
perl -pi -e "s/\@PACKAGE\@/$package/g" README-release
|
|
||||||
}
|
|
||||||
|
|
||||||
# Keep our bootstrap script in sync with gnulib's. If we ever need to
|
|
||||||
# maintain our own bootstrap script again, set this to false, remove
|
|
||||||
# the bootstrap entry from the file .x-update-copyright, and add any
|
|
||||||
# needed copyright years to the copyright statement in the bootstrap
|
|
||||||
# script.
|
|
||||||
bootstrap_sync=true
|
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
compile
|
||||||
|
config.guess
|
||||||
|
config.rpath
|
||||||
|
config.sub
|
||||||
|
depcomp
|
||||||
|
git-version-gen
|
||||||
|
install-sh
|
||||||
|
javacomp.sh.in
|
||||||
|
javaexec.sh.in
|
||||||
|
link-warning.h
|
||||||
|
mdate-sh
|
||||||
|
missing
|
||||||
|
texinfo.tex
|
||||||
|
ylwrap
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
/announce-gen
|
|
||||||
/compile
|
|
||||||
/config.guess
|
|
||||||
/config.rpath
|
|
||||||
/config.rpath~
|
|
||||||
/config.sub
|
|
||||||
/depcomp
|
|
||||||
/do-release-commit-and-tag
|
|
||||||
/gendocs.sh
|
|
||||||
/git-version-gen
|
|
||||||
/gitlog-to-changelog
|
|
||||||
/gnu-web-doc-update
|
|
||||||
/gnupload
|
|
||||||
/install-sh
|
|
||||||
/javacomp.sh.in
|
|
||||||
/javaexec.sh.in
|
|
||||||
/mdate-sh
|
|
||||||
/missing
|
|
||||||
/prefix-gnulib-mk
|
|
||||||
/test-driver
|
|
||||||
/texinfo.tex
|
|
||||||
/update-copyright
|
|
||||||
/useless-if-before-free
|
|
||||||
/vc-list-files
|
|
||||||
/ylwrap
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
# Copyright (C) 2012-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# Valgrind suppression file for Bison.
|
|
||||||
|
|
||||||
{
|
|
||||||
Mac OS X initialization
|
|
||||||
Memcheck:Leak
|
|
||||||
fun:?alloc*
|
|
||||||
...
|
|
||||||
fun:*ImageLoader*
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Mac OS X initialization
|
|
||||||
Memcheck:Leak
|
|
||||||
fun:?alloc*
|
|
||||||
...
|
|
||||||
fun:*dyld*
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Mac OS X initialization
|
|
||||||
Memcheck:Leak
|
|
||||||
fun:?alloc*
|
|
||||||
...
|
|
||||||
fun:__CFInitialize
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Mac OS X I/O buffer
|
|
||||||
Memcheck:Leak
|
|
||||||
fun:malloc
|
|
||||||
fun:__smakebuf
|
|
||||||
fun:__swsetup
|
|
||||||
fun:__sfvwrite
|
|
||||||
fun:fwrite
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Mac OS X I/O buffer
|
|
||||||
Memcheck:Leak
|
|
||||||
fun:malloc
|
|
||||||
fun:__smakebuf
|
|
||||||
fun:__swsetup
|
|
||||||
fun:__swbuf
|
|
||||||
fun:putchar
|
|
||||||
}
|
|
||||||
|
|
||||||
# Local Variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# End:
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
# Copyright (C) 2012-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# Valgrind suppression file for Bison.
|
|
||||||
|
|
||||||
# Travis Trusty, 2018-09-07.
|
|
||||||
{
|
|
||||||
libstdcxx_init
|
|
||||||
Memcheck:Leak
|
|
||||||
match-leak-kinds: reachable
|
|
||||||
fun:malloc
|
|
||||||
obj:/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
|
|
||||||
fun:call_init.part.0
|
|
||||||
fun:call_init
|
|
||||||
fun:_dl_init
|
|
||||||
obj:/lib/x86_64-linux-gnu/ld-2.19.so
|
|
||||||
}
|
|
||||||
|
|
||||||
# Linux prague 4.1.2-2-ARCH #1 SMP PREEMPT Wed Jul 15 08:30:32 UTC 2015
|
|
||||||
# x86_64 GNU/Linux
|
|
||||||
{
|
|
||||||
Probably exception handling from G++ 5.1.
|
|
||||||
Memcheck:Leak
|
|
||||||
match-leak-kinds: reachable
|
|
||||||
fun:malloc
|
|
||||||
fun:pool
|
|
||||||
fun:__static_initialization_and_destruction_0
|
|
||||||
fun:_GLOBAL__sub_I_eh_alloc.cc
|
|
||||||
fun:call_init.part.0
|
|
||||||
fun:_dl_init
|
|
||||||
obj:/usr/lib/ld-2.21.so
|
|
||||||
}
|
|
||||||
|
|
||||||
# Linux seattle 2.6.32-5-amd64 #1 SMP Thu Mar 22 17:26:33 UTC 2012
|
|
||||||
# x86_64 GNU/Linux
|
|
||||||
{
|
|
||||||
index
|
|
||||||
Memcheck:Cond
|
|
||||||
fun:index
|
|
||||||
fun:expand_dynamic_string_token
|
|
||||||
fun:_dl_map_object
|
|
||||||
fun:map_doit
|
|
||||||
fun:_dl_catch_error
|
|
||||||
fun:do_preload
|
|
||||||
fun:dl_main
|
|
||||||
fun:_dl_sysdep_start
|
|
||||||
fun:_dl_start
|
|
||||||
obj:/lib/ld-2.11.3.so
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
|
EXTRA_DIST = prev-version.txt cross-options.pl
|
||||||
+21
-63
@@ -5,75 +5,33 @@ use 5.005;
|
|||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
my %option;
|
my %option;
|
||||||
my %directive;
|
while (<>)
|
||||||
my $scanner = `grep -i '"%[a-z]' $ARGV[0]`;
|
|
||||||
$scanner =~ s/"\[-_\]"/-/g;
|
|
||||||
while (<STDIN>)
|
|
||||||
{
|
{
|
||||||
if (/^\s* # Initial spaces.
|
if (/^\s* # Initial spaces.
|
||||||
(?:(-\w),\s+)? # $1: $short: Possible short option.
|
(?:(-\w),\s+)? # $1: Possible short option.
|
||||||
(--[-\w]+) # $2: $long: Long option.
|
(--[-\w]+) # $2: Long option.
|
||||||
(\[?) # $3: $opt: '[' iff the argument is optional.
|
(\[?) # $3: '[' iff the argument is optional.
|
||||||
(?:=(\S+))? # $4: $arg: Possible argument name.
|
(?:=([-\w]+))? # $4: Possible argument name.
|
||||||
\s # Spaces.
|
|
||||||
/x)
|
/x)
|
||||||
{
|
{
|
||||||
my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
|
my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
|
||||||
$short = '' if ! defined $short;
|
$short = defined $short ? '@option{' . $short . '}' : '';
|
||||||
$short = '-d' if $long eq '--defines' && ! $short;
|
if ($arg)
|
||||||
my $dir = '%' . substr($long, 2);
|
{
|
||||||
if (index ($scanner, "\"$dir\"") < 0)
|
$arg =~ s/^=//;
|
||||||
{
|
$arg = '@var{' . lc ($arg) . '}';
|
||||||
if ($long eq '--force-define') { $dir = '%define'; }
|
$arg = '[' . $arg . ']'
|
||||||
else { $dir = ''; }
|
if $opt eq '[';
|
||||||
}
|
$option{"$long=$arg"} = $short ? "$short $arg" : '';
|
||||||
if ($arg)
|
}
|
||||||
{
|
else
|
||||||
# if $opt, $arg contains the closing ].
|
{
|
||||||
substr ($arg, -1) = ''
|
$option{"$long"} = "$short";
|
||||||
if $opt eq '[';
|
}
|
||||||
$arg =~ s/^=//;
|
|
||||||
$arg = lc ($arg);
|
|
||||||
my $dir_arg = $arg;
|
|
||||||
# If the argument is complete (e.g., for --define[=NAME[=VALUE]]),
|
|
||||||
# put each word in @var, to build @var{name}[=@var{value}], not
|
|
||||||
# @var{name[=value]}].
|
|
||||||
$arg =~ s/(\w+)/\@var{$1}/g;
|
|
||||||
my $long_arg = "=$arg";
|
|
||||||
if ($opt eq '[') {
|
|
||||||
$long_arg = "[$long_arg]";
|
|
||||||
$arg = "[$arg]";
|
|
||||||
}
|
|
||||||
# For arguments of directives: this only works if all arguments
|
|
||||||
# are strings and have the same syntax as on the command line.
|
|
||||||
if ($dir_arg eq 'name[=value]')
|
|
||||||
{
|
|
||||||
$dir_arg = '@var{name} ["@var{value}"]';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$dir_arg =~ s/(\w+)/\@var{"$1"}/g;
|
|
||||||
$dir_arg = '[' . $dir_arg . ']'
|
|
||||||
if $opt eq '[';
|
|
||||||
}
|
|
||||||
$long = "$long$long_arg";
|
|
||||||
$short = "$short $arg" if $short && $short ne '-d';
|
|
||||||
$dir = "$dir $dir_arg" if $dir;
|
|
||||||
}
|
|
||||||
$option{$long} = $short;
|
|
||||||
$directive{$long} = $dir;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $sep = '';
|
|
||||||
foreach my $long (sort keys %option)
|
foreach my $long (sort keys %option)
|
||||||
{
|
{
|
||||||
# Avoid trailing spaces.
|
printf "\@item %-40s \@tab %s\n", '@option{' . $long . '}', $option{$long};
|
||||||
print $sep;
|
|
||||||
$sep = "\n";
|
|
||||||
print '@item @option{', $long, "}\n\@tab";
|
|
||||||
print ' @option{', $option{$long}, '}' if $option{$long};
|
|
||||||
print "\n\@tab";
|
|
||||||
print ' @code{', $directive{$long}, '}' if $directive{$long};
|
|
||||||
print "\n";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
# This file is expected to be used via gitlog-to-changelog's --amend=FILE
|
|
||||||
# option. It specifies what changes to make to each given SHA1's commit
|
|
||||||
# log and metadata, using Perl-eval'able expressions.
|
|
||||||
|
|
||||||
975bb564319aa4f4204c48aba265757ba207a80f
|
|
||||||
s/Edligner/Edlinger/;
|
|
||||||
|
|
||||||
0db2648930e3b6c376a539aabe368aade83ee29a
|
|
||||||
s/--flags/--feature/;
|
|
||||||
s/flag_flag/feature_flag/;
|
|
||||||
s/\bflag\b/feature/;
|
|
||||||
@@ -1,234 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Install Intel Parallel Studio on Travis CI
|
|
||||||
# https://github.com/nemequ/icc-travis
|
|
||||||
#
|
|
||||||
# Originally written for Squash <https://github.com/quixdb/squash> by
|
|
||||||
# Evan Nemerson. For documentation, bug reports, support requests,
|
|
||||||
# etc. please use <https://github.com/nemequ/icc-travis>.
|
|
||||||
#
|
|
||||||
# To the extent possible under law, the author(s) of this script have
|
|
||||||
# waived all copyright and related or neighboring rights to this work.
|
|
||||||
# See <https://creativecommons.org/publicdomain/zero/1.0/> for
|
|
||||||
# details.
|
|
||||||
|
|
||||||
# Tools - Not very useful in non-interactive mode.
|
|
||||||
COMPONENTS_VTUNE="intel-vtune-amplifier-xe-2016-cli__x86_64;intel-vtune-amplifier-xe-2016-common__noarch;intel-vtune-amplifier-xe-2016-cli-common__noarch;intel-vtune-amplifier-xe-2016-collector-64linux__x86_64;intel-vtune-amplifier-xe-2016-sep__noarch;intel-vtune-amplifier-xe-2016-gui-common__noarch;intel-vtune-amplifier-xe-2016-gui__x86_64;intel-vtune-amplifier-xe-2016-common-pset__noarch"
|
|
||||||
COMPONENTS_INSPECTOR="intel-inspector-xe-2016-cli__x86_64;intel-inspector-xe-2016-cli-common__noarch;intel-inspector-xe-2016-gui-common__noarch;intel-inspector-xe-2016-gui__x86_64;intel-inspector-xe-2016-cli-pset__noarch"
|
|
||||||
COMPONENTS_ADVISOR="intel-advisor-xe-2016-cli__x86_64;intel-advisor-xe-2016-cli-common__noarch;intel-advisor-xe-2016-gui-common__noarch;intel-advisor-xe-2016-gui__x86_64;intel-advisor-xe-2016-cli-pset__noarch"
|
|
||||||
COMPONENTS_GDB="intel-gdb-gt__x86_64;intel-gdb-gt-src__noarch;intel-gdb-gt-libelfdwarf__x86_64;intel-gdb-gt-devel__x86_64;intel-gdb-gt-common__noarch;intel-gdb-ps-cdt__x86_64;intel-gdb-ps-cdt-source__x86_64;intel-gdb-ps-mic__x86_64;intel-gdb-ps-mpm__x86_64;intel-gdb__x86_64;intel-gdb-source__noarch;intel-gdb-python-source__noarch;intel-gdb-common__noarch;intel-gdb-ps-common__noarch"
|
|
||||||
|
|
||||||
# Parallel libraries
|
|
||||||
COMPONENTS_MPI="intel-mpi-rt-core__x86_64;intel-mpi-rt-mic__x86_64;intel-mpi-sdk-core__x86_64;intel-mpi-sdk-mic__x86_64;intel-mpi-psxe__x86_64;intel-mpi-rt-psxe__x86_64"
|
|
||||||
COMPONENTS_TBB="intel-tbb-libs__noarch;intel-mkl-ps-tbb__x86_64;intel-mkl-ps-tbb-devel__x86_64;intel-mkl-ps-tbb-mic__x86_64;intel-mkl-ps-tbb-mic-devel__x86_64;intel-tbb-source__noarch;intel-tbb-devel__noarch;intel-tbb-common__noarch;intel-tbb-ps-common__noarch;intel-tbb-psxe__noarch"
|
|
||||||
COMPONENTS_MKL="intel-mkl__x86_64;intel-mkl-ps__x86_64;intel-mkl-common__noarch;intel-mkl-ps-common__noarch;intel-mkl-devel__x86_64;intel-mkl-ps-mic-devel__x86_64;intel-mkl-ps-f95-devel__x86_64;intel-mkl-gnu-devel__x86_64;intel-mkl-ps-gnu-devel__x86_64;intel-mkl-ps-pgi-devel__x86_64;intel-mkl-sp2dp-devel__x86_64;intel-mkl-ps-cluster-devel__x86_64;intel-mkl-ps-cluster-common__noarch;intel-mkl-ps-f95-common__noarch;intel-mkl-ps-cluster__x86_64;intel-mkl-gnu__x86_64;intel-mkl-ps-gnu__x86_64;intel-mkl-ps-pgi__x86_64;intel-mkl-sp2dp__x86_64;intel-mkl-ps-mic__x86_64;intel-mkl-ps-tbb__x86_64;intel-mkl-ps-tbb-devel__x86_64;intel-mkl-ps-tbb-mic__x86_64;intel-mkl-ps-tbb-mic-devel__x86_64;intel-mkl-psxe__noarch"
|
|
||||||
COMPONENTS_IPP="intel-ipp-l-common__noarch;intel-ipp-l-ps-common__noarch;intel-ipp-l-st__x86_64;intel-ipp-l-mt__x86_64;intel-ipp-l-st-devel__x86_64;intel-ipp-l-ps-st-devel__x86_64;intel-ipp-l-mt-devel__x86_64;intel-ipp-psxe__noarch"
|
|
||||||
COMPONENTS_IPP_CRYPTO="intel-crypto-ipp-st-devel__x86_64;intel-crypto-ipp-ps-st-devel__x86_64;intel-crypto-ipp-st__x86_64;intel-crypto-ipp-mt-devel__x86_64;intel-crypto-ipp-mt__x86_64;intel-crypto-ipp-ss-st-devel__x86_64;intel-crypto-ipp-common__noarch"
|
|
||||||
COMPONENTS_DAAL="intel-daal__x86_64;intel-daal-common__noarch"
|
|
||||||
|
|
||||||
# Compilers
|
|
||||||
COMPONENTS_OPENMP="intel-openmp-l-all__x86_64;intel-openmp-l-ps-mic__x86_64;intel-openmp-l-ps__x86_64;intel-openmp-l-ps-ss__x86_64;intel-openmp-l-all-devel__x86_64;intel-openmp-l-ps-mic-devel__x86_64;intel-openmp-l-ps-devel__x86_64;intel-openmp-l-ps-ss-devel__x86_64"
|
|
||||||
COMPONENTS_COMPILER_COMMON="intel-comp-l-all-vars__noarch;intel-comp-l-all-common;intel-comp-l-ps-common;intel-comp-l-all-devel;intel-comp-l-ps-ss-devel;intel-comp-l-ps-ss-wrapper;intel-comp-l-all-devel;intel-comp-l-ps-devel__x86_64;intel-comp-l-ps-ss-devel__x86_64;intel-psf-intel__x86_64;intel-icsxe-pset;intel-ipsf__noarch;intel-ccompxe__noarch;${COMPONENTS_OPENMP}"
|
|
||||||
COMPONENTS_IFORT="intel-ifort-l-ps__x86_64;intel-ifort-l-ps-vars__noarch;intel-ifort-l-ps-common__noarch;intel-ifort-l-ps-devel__x86_64;${COMPONENTS_COMPILER_COMMON}"
|
|
||||||
COMPONENTS_ICC="intel-icc-l-all__x86_64;intel-icc-l-ps-ss__x86_64;intel-icc-l-all-vars__noarch;intel-icc-l-all-common__noarch;intel-icc-l-ps-common__noarch;intel-icc-l-all-devel__x86_64;intel-icc-l-ps-devel__x86_64;intel-icc-l-ps-ss-devel__x86_64;${COMPONENTS_COMPILER_COMMON}"
|
|
||||||
|
|
||||||
DESTINATION="${HOME}/intel"
|
|
||||||
TEMPORARY_FILES="/tmp"
|
|
||||||
PHONE_INTEL="no"
|
|
||||||
COMPONENTS=""
|
|
||||||
|
|
||||||
add_components() {
|
|
||||||
if [ ! -z "${COMPONENTS}" ]; then
|
|
||||||
COMPONENTS="${COMPONENTS};$1"
|
|
||||||
else
|
|
||||||
COMPONENTS="$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
while [ $# != 0 ]; do
|
|
||||||
case "$1" in
|
|
||||||
"--dest")
|
|
||||||
DESTINATION="$(realpath "$2")"; shift
|
|
||||||
;;
|
|
||||||
"--tmpdir")
|
|
||||||
TEMPORARY_FILES="$2"; shift
|
|
||||||
;;
|
|
||||||
"--components")
|
|
||||||
shift
|
|
||||||
OLD_IFS="${IFS}"
|
|
||||||
IFS=","
|
|
||||||
for component in $1; do
|
|
||||||
case "$component" in
|
|
||||||
"icc")
|
|
||||||
add_components "${COMPONENTS_ICC}"
|
|
||||||
;;
|
|
||||||
"mpi")
|
|
||||||
add_components "${COMPONENTS_MPI}"
|
|
||||||
;;
|
|
||||||
"vtune")
|
|
||||||
add_components "${COMPONENTS_VTUNE}"
|
|
||||||
;;
|
|
||||||
"inspector")
|
|
||||||
add_components "${COMPONENTS_INSPECTOR}"
|
|
||||||
;;
|
|
||||||
"advisor")
|
|
||||||
add_components "${COMPONENTS_ADVISOR}"
|
|
||||||
;;
|
|
||||||
"tbb")
|
|
||||||
add_components "${COMPONENTS_TBB}"
|
|
||||||
;;
|
|
||||||
"ifort")
|
|
||||||
add_components "${COMPONENTS_IFORT}"
|
|
||||||
;;
|
|
||||||
"mkl")
|
|
||||||
add_components "${COMPONENTS_MKL}"
|
|
||||||
;;
|
|
||||||
"openmp")
|
|
||||||
# Noop, here for compatability. OpenMP is installed with icc and ifort now.
|
|
||||||
;;
|
|
||||||
"ipp")
|
|
||||||
add_components "${COMPONENTS_IPP}"
|
|
||||||
;;
|
|
||||||
"ipp-crypto")
|
|
||||||
add_components "${COMPONENTS_IPP_CRYPTO}"
|
|
||||||
;;
|
|
||||||
"gdb")
|
|
||||||
add_components "${COMPONENTS_GDB}"
|
|
||||||
;;
|
|
||||||
"daal")
|
|
||||||
add_components "${COMPONENTS_DAAL}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unknown component '$component'"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
IFS="${OLD_IFS}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unrecognized argument '$1'"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "${COMPONENTS}" ]; then
|
|
||||||
COMPONENTS="${COMPONENTS_ICC}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
INSTALLER_SCRIPT="parallel_studio_xe_2016_update3_online.sh"
|
|
||||||
INSTALLER="${TEMPORARY_FILES}/${INSTALLER_SCRIPT}"
|
|
||||||
INSTALLER_URL="http://registrationcenter-download.intel.com/akdlm/irc_nas/9061/${INSTALLER_SCRIPT}"
|
|
||||||
SILENT_CFG="${TEMPORARY_FILES}/silent.cfg"
|
|
||||||
SUCCESS_INDICATOR="${TEMPORARY_FILES}/icc-travis-success"
|
|
||||||
|
|
||||||
if [ ! -e "${TEMPORARY_FILES}" ]; then
|
|
||||||
echo "${TEMPORARY_FILES} does not exist, creating..."
|
|
||||||
mkdir -p "${TEMPORARY_FILES}" || (sudo mkdir -p "${TEMPORARY_FILES}" && sudo chown -R "${USER}:${USER}" "${TEMPORARY_FILES}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e "${DESTINATION}" ]; then
|
|
||||||
echo "${DESTINATION} does not exist, creating..."
|
|
||||||
mkdir -p "${DESTINATION}" || (sudo mkdir -p "${DESTINATION}" && sudo chown -R "${USER}:${USER}" "${DESTINATION}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e "${INSTALLER}" ]; then
|
|
||||||
wget -O "${INSTALLER}" "${INSTALLER_URL}" || exit 1
|
|
||||||
fi
|
|
||||||
chmod u+x "${INSTALLER}"
|
|
||||||
|
|
||||||
# See https://software.intel.com/en-us/articles/intel-composer-xe-2015-silent-installation-guide
|
|
||||||
echo "# Generated silent configuration file" > "${SILENT_CFG}"
|
|
||||||
echo "ACCEPT_EULA=accept" >> "${SILENT_CFG}"
|
|
||||||
echo "INSTALL_MODE=NONRPM" >> "${SILENT_CFG}"
|
|
||||||
echo "CONTINUE_WITH_OPTIONAL_ERROR=yes" >> "${SILENT_CFG}"
|
|
||||||
echo "PSET_INSTALL_DIR=${DESTINATION}" >> "${SILENT_CFG}"
|
|
||||||
echo "CONTINUE_WITH_INSTALLDIR_OVERWRITE=yes" >> "${SILENT_CFG}"
|
|
||||||
echo "COMPONENTS=${COMPONENTS}" >> "${SILENT_CFG}"
|
|
||||||
echo "PSET_MODE=install" >> "${SILENT_CFG}"
|
|
||||||
echo "PHONEHOME_SEND_USAGE_DATA=${PHONE_INTEL}" >> "${SILENT_CFG}"
|
|
||||||
if [ "x" != "x${INTEL_SERIAL_NUMBER}" ]; then
|
|
||||||
echo "ACTIVATION_SERIAL_NUMBER=${INTEL_SERIAL_NUMBER}" >> "${SILENT_CFG}"
|
|
||||||
echo "ACTIVATION_TYPE=serial_number" >> "${SILENT_CFG}"
|
|
||||||
else
|
|
||||||
echo "ACTIVATION_TYPE=trial_lic" >> "${SILENT_CFG}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
attempt=1;
|
|
||||||
while [ $attempt -le 3 ]; do
|
|
||||||
if [ ! -e "${TEMPORARY_FILES}/parallel-studio-install-data" ]; then
|
|
||||||
mkdir -p "${TEMPORARY_FILES}/parallel-studio-install-data" || (sudo mkdir -p "${TEMPORARY_FILES}/parallel-studio-install-data" && sudo chown -R "${USER}:${USER}" "${TEMPORARY_FILES}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
("${INSTALLER}" \
|
|
||||||
-t "${TEMPORARY_FILES}/parallel-studio-install-data" \
|
|
||||||
-s "${SILENT_CFG}" \
|
|
||||||
--cli-mode \
|
|
||||||
--user-mode && \
|
|
||||||
touch "${SUCCESS_INDICATOR}") &
|
|
||||||
|
|
||||||
# So Travis doesn't die in case of a long download/installation.
|
|
||||||
#
|
|
||||||
# NOTE: a watched script never terminates.
|
|
||||||
elapsed=0;
|
|
||||||
while kill -0 $! 2>/dev/null; do
|
|
||||||
sleep 1
|
|
||||||
elapsed=$(expr $elapsed + 1)
|
|
||||||
if [ $(expr $elapsed % 60) -eq 0 ]; then
|
|
||||||
mins_elapsed=$(expr $elapsed / 60)
|
|
||||||
if [ $mins_elapsed = 1 ]; then
|
|
||||||
minute_string="minute"
|
|
||||||
else
|
|
||||||
minute_string="minutes"
|
|
||||||
fi
|
|
||||||
echo "Still running... (about $(expr $elapsed / 60) ${minute_string} so far)."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ! -e "${SUCCESS_INDICATOR}" ]; then
|
|
||||||
echo "Installation failed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e "${DESTINATION}/bin/compilervars.sh" ]; then
|
|
||||||
# Sometimes the installer returns successfully without actually
|
|
||||||
# installing anything. Let's try again…
|
|
||||||
echo "Installation attempt #${attempt} completed, but unable to find compilervars.sh."
|
|
||||||
find "${DESTINATION}"
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -vrf "${TEMPORARY_FILES}/parallel-studio-install-data"
|
|
||||||
echo "Trying again..."
|
|
||||||
|
|
||||||
attempt=$(expr $attempt + 1)
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ! -e "${DESTINATION}/bin/compilervars.sh" ]; then
|
|
||||||
echo "Installation failed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Apparently the installer drops the license file in a location it
|
|
||||||
# doesn't know to check.
|
|
||||||
ln -s "${DESTINATION}"/licenses ~/Licenses
|
|
||||||
|
|
||||||
# Add configuration information to ~/.bashrc. Unfortunately this will
|
|
||||||
# not be picked up automatically by Travis, so you'll still need to
|
|
||||||
# source ~/.bashrc in your .travis.yml
|
|
||||||
#
|
|
||||||
# Container-based builds include a `[ -z "$PS1" ] && return` near the
|
|
||||||
# beginning of the file, so appending won't work, we'll need to
|
|
||||||
# prepend.
|
|
||||||
echo "export INTEL_INSTALL_PATH=\"${DESTINATION}\"" >> ~/.bashrc-intel
|
|
||||||
echo ". \"\${INTEL_INSTALL_PATH}/bin/compilervars.sh\" intel64" >> ~/.bashrc-intel
|
|
||||||
echo "export LD_LIBRARY_PATH=\"\${INTEL_INSTALL_PATH}/ism/bin/intel64:\${INTEL_INSTALL_PATH}/lib/intel64_lin:\$LD_LIBRARY_PATH\"" >> ~/.bashrc-intel
|
|
||||||
echo "export PATH=\"\${INTEL_INSTALL_PATH}/bin:\$PATH\"" >> ~/.bashrc-intel
|
|
||||||
echo "function uninstall_intel_software {" >> ~/.bashrc-intel
|
|
||||||
echo " find \"\${INTEL_INSTALL_PATH}\" -name 'uninstall.sh' -not -path '*/ism/uninstall.sh' -exec {} -s \;" >> ~/.bashrc-intel
|
|
||||||
echo "}" >> ~/.bashrc-intel
|
|
||||||
cat ~/.bashrc >> ~/.bashrc-intel
|
|
||||||
mv ~/.bashrc-intel ~/.bashrc
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
# Copyright (C) 2000-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
EXTRA_DIST += \
|
|
||||||
build-aux/Darwin.valgrind \
|
|
||||||
build-aux/Linux.valgrind \
|
|
||||||
build-aux/cross-options.pl \
|
|
||||||
build-aux/move-if-change \
|
|
||||||
build-aux/prev-version.txt \
|
|
||||||
build-aux/update-b4-copyright
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../gnulib/build-aux/move-if-change
|
|
||||||
@@ -1,152 +0,0 @@
|
|||||||
#!/usr/bin/perl -0777 -pi
|
|
||||||
|
|
||||||
# Update b4_copyright invocations or b4_copyright_years definitions to
|
|
||||||
# include the current year.
|
|
||||||
|
|
||||||
# Copyright (C) 2009-2015, 2018 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, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
|
|
||||||
my $margin = 72;
|
|
||||||
|
|
||||||
my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
|
|
||||||
if (!$this_year || $this_year !~ m/^\d{4}$/)
|
|
||||||
{
|
|
||||||
my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
|
|
||||||
$this_year = $year + 1900;
|
|
||||||
}
|
|
||||||
my $old_re = <<'EOF'
|
|
||||||
(
|
|
||||||
(?:^|\n)
|
|
||||||
#BEFORE
|
|
||||||
(?:
|
|
||||||
b4_copyright\(\[[^][]*]
|
|
||||||
| m4_(?:push|pop)def\(\[b4_copyright_years]
|
|
||||||
)
|
|
||||||
#AFTER
|
|
||||||
)
|
|
||||||
(?:
|
|
||||||
,\s*
|
|
||||||
(
|
|
||||||
\[\s* (?:\d{4}(?:,\s*|-))* (\d{4}) \s*]
|
|
||||||
)
|
|
||||||
)?
|
|
||||||
\)
|
|
||||||
EOF
|
|
||||||
;
|
|
||||||
|
|
||||||
while (/($old_re)/gx)
|
|
||||||
{
|
|
||||||
my $start = pos() - length ($1);
|
|
||||||
my $b4_copyright_line = $2;
|
|
||||||
my $year_lines = $3;
|
|
||||||
my $final_year = $4;
|
|
||||||
$year_lines .= ')';
|
|
||||||
|
|
||||||
# If there was a second argument, it contains years, so update them.
|
|
||||||
if ($final_year)
|
|
||||||
{
|
|
||||||
$b4_copyright_line .= ',';
|
|
||||||
if ($final_year != $this_year)
|
|
||||||
{
|
|
||||||
# Update the year.
|
|
||||||
$year_lines =~ s/$final_year/$final_year, $this_year/;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Normalize all whitespace.
|
|
||||||
$year_lines =~ s/\s+/ /g;
|
|
||||||
|
|
||||||
# Put spaces after commas.
|
|
||||||
$year_lines =~ s/, ?/, /g;
|
|
||||||
|
|
||||||
# Compress to intervals.
|
|
||||||
$year_lines =~
|
|
||||||
s/
|
|
||||||
(\d{4})
|
|
||||||
(?:
|
|
||||||
(,\ |-)
|
|
||||||
((??{
|
|
||||||
if ($2 eq '-') { '\d{4}'; }
|
|
||||||
elsif (!$3) { $1 + 1; }
|
|
||||||
else { $3 + 1; }
|
|
||||||
}))
|
|
||||||
)+
|
|
||||||
/$1-$3/gx;
|
|
||||||
|
|
||||||
# Format within margin.
|
|
||||||
my $year_lines_new;
|
|
||||||
my $indent = index ($b4_copyright_line, '[');
|
|
||||||
--$indent if ($b4_copyright_line =~ m/^\n/);
|
|
||||||
while (length $year_lines)
|
|
||||||
{
|
|
||||||
my $text_margin = $margin - $indent;
|
|
||||||
if (($year_lines =~ s/^(.{1,$text_margin})(?: |$)//)
|
|
||||||
|| ($year_lines =~ s/^([\S]+)(?: |$)//))
|
|
||||||
{
|
|
||||||
my $line = "\n" . (' 'x$indent) . $1;
|
|
||||||
++$indent if (!$year_lines_new);
|
|
||||||
$year_lines_new .= $line;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
# Should be unreachable, but we don't want an infinite
|
|
||||||
# loop if it can be reached.
|
|
||||||
die;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Replace the old invocation. Should never die.
|
|
||||||
die if (!s/$old_re\G/$b4_copyright_line$year_lines_new/x);
|
|
||||||
|
|
||||||
# Prepare for the next search.
|
|
||||||
pos () = $start + length ("$b4_copyright_line$year_lines_new");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (/(\bb4_copyright\()/g)
|
|
||||||
{
|
|
||||||
my $start = pos () - length ($1);
|
|
||||||
my $end = pos ();
|
|
||||||
my $re = $old_re;
|
|
||||||
pos () = $start;
|
|
||||||
$re =~ s/\#BEFORE/\\G/;
|
|
||||||
if (!/$re/x)
|
|
||||||
{
|
|
||||||
my $line = (substr ($_, 0, $start) =~ s/\n/\n/g) + 1;
|
|
||||||
print STDERR
|
|
||||||
"$ARGV:$line: warning: failed to update a b4_copyright\n";
|
|
||||||
}
|
|
||||||
pos () = $end;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (/(\[b4_copyright_years])/g)
|
|
||||||
{
|
|
||||||
my $start = pos () - length ($1);
|
|
||||||
my $end = pos ();
|
|
||||||
my $re = $old_re;
|
|
||||||
$re =~ s/\#AFTER/\\G/;
|
|
||||||
if (!/$re/x)
|
|
||||||
{
|
|
||||||
# The substr operation blows away pos (), so restoring pos ()
|
|
||||||
# at the end is necessary.
|
|
||||||
my $line = (substr ($_, 0, $start) =~ s/\n/\n/g) + 1;
|
|
||||||
print STDERR
|
|
||||||
"$ARGV:$line: warning: failed to update a"
|
|
||||||
. " b4_copyright_years\n";
|
|
||||||
}
|
|
||||||
pos () = $end;
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
#!/usr/bin/perl -0777 -pi
|
|
||||||
|
|
||||||
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
|
||||||
|
|
||||||
# Copyright (C) 2010-2015, 2018 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, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
|
|
||||||
my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
|
|
||||||
if (!$this_year || $this_year !~ m/^\d{4}$/)
|
|
||||||
{
|
|
||||||
my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
|
|
||||||
$this_year = $year + 1900;
|
|
||||||
}
|
|
||||||
my $old_re = <<'EOF'
|
|
||||||
(
|
|
||||||
MACRO\(
|
|
||||||
\[PACKAGE_COPYRIGHT_YEAR],
|
|
||||||
\s*\[
|
|
||||||
)
|
|
||||||
(\d{4})
|
|
||||||
(?=])
|
|
||||||
EOF
|
|
||||||
;
|
|
||||||
foreach my $macro ("AC_DEFINE", "AC_SUBST")
|
|
||||||
{
|
|
||||||
my $this_old_re = $old_re;
|
|
||||||
$this_old_re =~ s/MACRO/$macro/;
|
|
||||||
if (!s/$this_old_re/$1$this_year/x)
|
|
||||||
{
|
|
||||||
print STDERR
|
|
||||||
"$ARGV: warning: failed to update PACKAGE_COPYRIGHT_YEAR in"
|
|
||||||
. " $macro.\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
# Customize maint.mk -*- makefile -*-
|
|
||||||
# Copyright (C) 2008-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# Update version, then recompile so that tests/bison --version be
|
|
||||||
# up-to-date, then compile our parser again with our up-to-date bison.
|
|
||||||
.PHONY: regen
|
|
||||||
regen: _version
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS)
|
|
||||||
touch $(srcdir)/src/parse-gram.y
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS)
|
|
||||||
|
|
||||||
# Used in maint.mk's web-manual rule
|
|
||||||
manual_title = The Yacc-compatible Parser Generator
|
|
||||||
gendocs_options_ = -I $(abs_top_srcdir)/doc -I $(abs_top_builddir)/doc
|
|
||||||
|
|
||||||
# It's useful to run maintainer-check* targets during development, but we
|
|
||||||
# don't want to wait on a recompile because of an update to $(VERSION). Thus,
|
|
||||||
# override the _is-dist-target from GNUmakefile so that maintainer-check*
|
|
||||||
# targets are filtered out.
|
|
||||||
_is-dist-target = $(filter-out %clean maintainer-check%, \
|
|
||||||
$(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS)))
|
|
||||||
|
|
||||||
url_dir_list = \
|
|
||||||
https://$(gnu_rel_host)/gnu/bison
|
|
||||||
|
|
||||||
# Tests not to run as part of "make distcheck".
|
|
||||||
local-checks-to-skip = \
|
|
||||||
sc_immutable_NEWS \
|
|
||||||
sc_prohibit_atoi_atof
|
|
||||||
|
|
||||||
# The local directory containing the checked-out copy of gnulib used in
|
|
||||||
# this release. Used solely to get a date for the "announcement" target.
|
|
||||||
gnulib_dir = $(srcdir)/gnulib
|
|
||||||
|
|
||||||
bootstrap-tools = autoconf,automake,flex,gettext,gnulib
|
|
||||||
|
|
||||||
announcement_Cc_ = \
|
|
||||||
[email protected], [email protected], [email protected], \
|
|
||||||
[email protected]
|
|
||||||
|
|
||||||
update-copyright: update-b4-copyright update-package-copyright-year
|
|
||||||
update-copyright-env = \
|
|
||||||
UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1
|
|
||||||
|
|
||||||
|
|
||||||
## -------------------- ##
|
|
||||||
## More syntax-checks. ##
|
|
||||||
## -------------------- ##
|
|
||||||
|
|
||||||
# At least for Mac OS X's grep, the order between . and [ in "[^.[]"
|
|
||||||
# matters:
|
|
||||||
# $ LC_ALL=fr_FR grep -nE '[^[.]' /dev/null
|
|
||||||
# $ LC_ALL=C grep -nE '[^[.]' /dev/null
|
|
||||||
# grep: invalid collating element or class
|
|
||||||
# $ LC_ALL=fr_FR grep -nE '[^.[]' /dev/null
|
|
||||||
# $ LC_ALL=C grep -nE '[^.[]' /dev/null
|
|
||||||
sc_at_parser_check:
|
|
||||||
@prohibit='AT_PARSER_CHECK\(\[+[^.[]|AT_CHECK\(\[+\./' \
|
|
||||||
halt='use AT_PARSER_CHECK for and only for generated parsers' \
|
|
||||||
$(_sc_search_regexp)
|
|
||||||
|
|
||||||
# Indent only with spaces.
|
|
||||||
# Taken from Coreutils.
|
|
||||||
sc_prohibit_tab_based_indentation:
|
|
||||||
@prohibit='^ * ' \
|
|
||||||
halt='TAB in indentation; use only spaces' \
|
|
||||||
$(_sc_search_regexp)
|
|
||||||
|
|
||||||
# Prohibit the use of `...` in tests/. Use $(...) instead.
|
|
||||||
# Taken from Coreutils.
|
|
||||||
# Not ready for Bison yet.
|
|
||||||
#sc_prohibit_test_backticks:
|
|
||||||
# @prohibit='`' in_vc_files='^tests/' \
|
|
||||||
# halt='use $$(...), not `...` in tests/' \
|
|
||||||
# $(_sc_search_regexp)
|
|
||||||
|
|
||||||
# Enforce recommended preprocessor indentation style.
|
|
||||||
# Taken from Coreutils.
|
|
||||||
sc_preprocessor_indentation:
|
|
||||||
@if cppi --version >/dev/null 2>&1; then \
|
|
||||||
$(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \
|
|
||||||
|| { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
|
|
||||||
exit 1; }; \
|
|
||||||
else \
|
|
||||||
echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
###########################################################
|
|
||||||
# Taken from Coreutils.
|
|
||||||
_p0 = \([^"'/]\|"\([^\"]\|[\].\)*"\|'\([^\']\|[\].\)*'
|
|
||||||
_pre = $(_p0)\|[/][^"'/*]\|[/]"\([^\"]\|[\].\)*"\|[/]'\([^\']\|[\].\)*'\)*
|
|
||||||
_pre_anchored = ^\($(_pre)\)
|
|
||||||
_comment_and_close = [^*]\|[*][^/*]\)*[*][*]*/
|
|
||||||
# help font-lock mode: '
|
|
||||||
|
|
||||||
# A sed expression that removes ANSI C and ISO C99 comments.
|
|
||||||
# Derived from the one in GNU gettext's 'moopp' preprocessor.
|
|
||||||
_sed_remove_comments = \
|
|
||||||
/[/][/*]/{ \
|
|
||||||
ta; \
|
|
||||||
:a; \
|
|
||||||
s,$(_pre_anchored)//.*,\1,; \
|
|
||||||
te; \
|
|
||||||
s,$(_pre_anchored)/[*]\($(_comment_and_close),\1 ,; \
|
|
||||||
ta; \
|
|
||||||
/^$(_pre)[/][*]/{ \
|
|
||||||
s,$(_pre_anchored)/[*].*,\1 ,; \
|
|
||||||
tu; \
|
|
||||||
:u; \
|
|
||||||
n; \
|
|
||||||
s,^\($(_comment_and_close),,; \
|
|
||||||
tv; \
|
|
||||||
s,^.*$$,,; \
|
|
||||||
bu; \
|
|
||||||
:v; \
|
|
||||||
}; \
|
|
||||||
:e; \
|
|
||||||
}
|
|
||||||
# Quote all single quotes.
|
|
||||||
_sed_rm_comments_q = $(subst ','\'',$(_sed_remove_comments))
|
|
||||||
# help font-lock mode: '
|
|
||||||
|
|
||||||
_space_before_paren_exempt =? \\n\\$$
|
|
||||||
_space_before_paren_exempt = \
|
|
||||||
(^ *\#|(LA)?LR\([01]\)|percent_(code|define)|b4_syncline|m4_(define|init)|symbol)
|
|
||||||
# Ensure that there is a space before each open parenthesis in C code.
|
|
||||||
sc_space_before_open_paren:
|
|
||||||
@if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then \
|
|
||||||
fail=0; \
|
|
||||||
for c in $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$'); do \
|
|
||||||
sed '$(_sed_rm_comments_q)' $$c 2>/dev/null \
|
|
||||||
| grep -i '[[:alnum:]](' \
|
|
||||||
| grep -vE '$(_space_before_paren_exempt)' \
|
|
||||||
| grep . && { fail=1; echo "*** $$c"; }; \
|
|
||||||
done; \
|
|
||||||
test $$fail = 1 && \
|
|
||||||
{ echo '$(ME): the above files lack a space-before-open-paren' \
|
|
||||||
1>&2; exit 1; } || :; \
|
|
||||||
else :; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
## -------------------------- ##
|
|
||||||
## syntax-checks exceptions. ##
|
|
||||||
## -------------------------- ##
|
|
||||||
|
|
||||||
exclude = \
|
|
||||||
$(foreach a,$(1),$(eval $(subst $$,$$$$,exclude_file_name_regexp--sc_$(a))))
|
|
||||||
$(call exclude, \
|
|
||||||
bindtextdomain=^lib/main.c$$ \
|
|
||||||
preprocessor_indentation=^data/|^lib/|^src/parse-gram.[ch]$$ \
|
|
||||||
program_name=^lib/main.c$$ \
|
|
||||||
prohibit_always-defined_macros=^data/yacc.c$$|^djgpp/ \
|
|
||||||
prohibit_always-defined_macros+=?|^lib/timevar.c$$ \
|
|
||||||
prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \
|
|
||||||
prohibit_always-defined_macros+=?|^tests/regression.at$$ \
|
|
||||||
prohibit_always_true_header_tests=^djgpp/subpipe.h$$|^lib/timevar.c$$ \
|
|
||||||
prohibit_always_true_header_tests+=?|^m4/timevar.m4$$ \
|
|
||||||
prohibit_defined_have_decl_tests=?|^lib/timevar.c$$ \
|
|
||||||
prohibit_doubled_word=^tests/named-refs.at$$ \
|
|
||||||
prohibit_magic_number_exit=^doc/bison.texi$$ \
|
|
||||||
prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \
|
|
||||||
prohibit_strcmp=^doc/bison\.texi|tests/local\.at$$ \
|
|
||||||
prohibit_tab_based_indentation=install-icc.sh|\.(am|mk)$$|^djgpp/|^\.git|Makefile$$ \
|
|
||||||
require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \
|
|
||||||
space_before_open_paren=^(data/|djgpp/) \
|
|
||||||
two_space_separator_in_usage=^(bootstrap|build-aux/install-icc.sh) \
|
|
||||||
unmarked_diagnostics=^(djgpp/|doc/bison.texi$$|tests/c\+\+\.at$$) \
|
|
||||||
)
|
|
||||||
+292
@@ -0,0 +1,292 @@
|
|||||||
|
/* config.hin. Generated from configure.in by autoheader. */
|
||||||
|
|
||||||
|
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||||
|
systems. This function is required for `alloca.c' support on those systems.
|
||||||
|
*/
|
||||||
|
#undef CRAY_STACKSEG_END
|
||||||
|
|
||||||
|
/* Define if using `alloca.c'. */
|
||||||
|
#undef C_ALLOCA
|
||||||
|
|
||||||
|
/* Define to 1 if translation of program messages to the user's native
|
||||||
|
language is requested. */
|
||||||
|
#undef ENABLE_NLS
|
||||||
|
|
||||||
|
/* Define if you have `alloca', as a function or macro. */
|
||||||
|
#undef HAVE_ALLOCA
|
||||||
|
|
||||||
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
|
#undef HAVE_ALLOCA_H
|
||||||
|
|
||||||
|
/* Define if you have the <argz.h> header file. */
|
||||||
|
#undef HAVE_ARGZ_H
|
||||||
|
|
||||||
|
/* Define if you have the <ctype.h> header file. */
|
||||||
|
#undef HAVE_CTYPE_H
|
||||||
|
|
||||||
|
/* Define if backslash-a works in C strings. */
|
||||||
|
#undef HAVE_C_BACKSLASH_A
|
||||||
|
|
||||||
|
/* Define if you have the `dcgettext' function. */
|
||||||
|
#undef HAVE_DCGETTEXT
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `memchr', and to 0 if you don't.
|
||||||
|
*/
|
||||||
|
#undef HAVE_DECL_MEMCHR
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
|
||||||
|
*/
|
||||||
|
#undef HAVE_DECL_STPCPY
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
|
||||||
|
don't. */
|
||||||
|
#undef HAVE_DECL_STRERROR_R
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `strndup', and to 0 if you
|
||||||
|
don't. */
|
||||||
|
#undef HAVE_DECL_STRNDUP
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
|
||||||
|
don't. */
|
||||||
|
#undef HAVE_DECL_STRNLEN
|
||||||
|
|
||||||
|
/* Define if the malloc check has been performed. */
|
||||||
|
#undef HAVE_DONE_WORKING_MALLOC_CHECK
|
||||||
|
|
||||||
|
/* Define if the realloc check has been performed. */
|
||||||
|
#undef HAVE_DONE_WORKING_REALLOC_CHECK
|
||||||
|
|
||||||
|
/* Define if you have the `doprnt' function. */
|
||||||
|
#undef HAVE_DOPRNT
|
||||||
|
|
||||||
|
/* Define if you have the `feof_unlocked' function. */
|
||||||
|
#undef HAVE_FEOF_UNLOCKED
|
||||||
|
|
||||||
|
/* Define if you have the `fgets_unlocked' function. */
|
||||||
|
#undef HAVE_FGETS_UNLOCKED
|
||||||
|
|
||||||
|
/* Define if you have the `getcwd' function. */
|
||||||
|
#undef HAVE_GETCWD
|
||||||
|
|
||||||
|
/* Define if you have the `getegid' function. */
|
||||||
|
#undef HAVE_GETEGID
|
||||||
|
|
||||||
|
/* Define if you have the `geteuid' function. */
|
||||||
|
#undef HAVE_GETEUID
|
||||||
|
|
||||||
|
/* Define if you have the `getgid' function. */
|
||||||
|
#undef HAVE_GETGID
|
||||||
|
|
||||||
|
/* Define if you have the `getpagesize' function. */
|
||||||
|
#undef HAVE_GETPAGESIZE
|
||||||
|
|
||||||
|
/* Define if the GNU gettext() function is already present or preinstalled. */
|
||||||
|
#undef HAVE_GETTEXT
|
||||||
|
|
||||||
|
/* Define if you have the `getuid' function. */
|
||||||
|
#undef HAVE_GETUID
|
||||||
|
|
||||||
|
/* Define if you have the iconv() function. */
|
||||||
|
#undef HAVE_ICONV
|
||||||
|
|
||||||
|
/* Define if you have the <inttypes.h> header file. */
|
||||||
|
#undef HAVE_INTTYPES_H
|
||||||
|
|
||||||
|
/* Define if you have the `isascii' function. */
|
||||||
|
#undef HAVE_ISASCII
|
||||||
|
|
||||||
|
/* Define if you have the `iswprint' function. */
|
||||||
|
#undef HAVE_ISWPRINT
|
||||||
|
|
||||||
|
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
|
||||||
|
#undef HAVE_LANGINFO_CODESET
|
||||||
|
|
||||||
|
/* Define if your <locale.h> file defines LC_MESSAGES. */
|
||||||
|
#undef HAVE_LC_MESSAGES
|
||||||
|
|
||||||
|
/* Define if you have the <limits.h> header file. */
|
||||||
|
#undef HAVE_LIMITS_H
|
||||||
|
|
||||||
|
/* Define if you have the <locale.h> header file. */
|
||||||
|
#undef HAVE_LOCALE_H
|
||||||
|
|
||||||
|
/* Define if you have the <malloc.h> header file. */
|
||||||
|
#undef HAVE_MALLOC_H
|
||||||
|
|
||||||
|
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
|
||||||
|
#undef HAVE_MBRTOWC
|
||||||
|
|
||||||
|
/* Define if you have the `mbsinit' function. */
|
||||||
|
#undef HAVE_MBSINIT
|
||||||
|
|
||||||
|
/* Define if you have the `memchr' function. */
|
||||||
|
#undef HAVE_MEMCHR
|
||||||
|
|
||||||
|
/* Define if you have the <memory.h> header file. */
|
||||||
|
#undef HAVE_MEMORY_H
|
||||||
|
|
||||||
|
/* Define if you have the `mempcpy' function. */
|
||||||
|
#undef HAVE_MEMPCPY
|
||||||
|
|
||||||
|
/* Define if you have the `mkstemp' function. */
|
||||||
|
#undef HAVE_MKSTEMP
|
||||||
|
|
||||||
|
/* Define if you have a working `mmap' system call. */
|
||||||
|
#undef HAVE_MMAP
|
||||||
|
|
||||||
|
/* Define if you have the `munmap' function. */
|
||||||
|
#undef HAVE_MUNMAP
|
||||||
|
|
||||||
|
/* Define if you have the <nl_types.h> header file. */
|
||||||
|
#undef HAVE_NL_TYPES_H
|
||||||
|
|
||||||
|
/* Define if you have the `putenv' function. */
|
||||||
|
#undef HAVE_PUTENV
|
||||||
|
|
||||||
|
/* Define if you have the `setenv' function. */
|
||||||
|
#undef HAVE_SETENV
|
||||||
|
|
||||||
|
/* Define if you have the `setlocale' function. */
|
||||||
|
#undef HAVE_SETLOCALE
|
||||||
|
|
||||||
|
/* Define if you have the <stddef.h> header file. */
|
||||||
|
#undef HAVE_STDDEF_H
|
||||||
|
|
||||||
|
/* Define if you have the <stdint.h> header file. */
|
||||||
|
#undef HAVE_STDINT_H
|
||||||
|
|
||||||
|
/* Define if you have the <stdlib.h> header file. */
|
||||||
|
#undef HAVE_STDLIB_H
|
||||||
|
|
||||||
|
/* Define if you have the `stpcpy' function. */
|
||||||
|
#undef HAVE_STPCPY
|
||||||
|
|
||||||
|
/* Define if you have the `strcasecmp' function. */
|
||||||
|
#undef HAVE_STRCASECMP
|
||||||
|
|
||||||
|
/* Define if you have the `strchr' function. */
|
||||||
|
#undef HAVE_STRCHR
|
||||||
|
|
||||||
|
/* Define if you have the `strdup' function. */
|
||||||
|
#undef HAVE_STRDUP
|
||||||
|
|
||||||
|
/* Define if you have the `strerror' function. */
|
||||||
|
#undef HAVE_STRERROR
|
||||||
|
|
||||||
|
/* Define if you have the `strerror_r' function. */
|
||||||
|
#undef HAVE_STRERROR_R
|
||||||
|
|
||||||
|
/* Define if you have the <strings.h> header file. */
|
||||||
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
|
/* Define if you have the <string.h> header file. */
|
||||||
|
#undef HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Define if you have the `strndup' function. */
|
||||||
|
#undef HAVE_STRNDUP
|
||||||
|
|
||||||
|
/* Define if you have the `strnlen' function. */
|
||||||
|
#undef HAVE_STRNLEN
|
||||||
|
|
||||||
|
/* Define if you have the `strspn' function. */
|
||||||
|
#undef HAVE_STRSPN
|
||||||
|
|
||||||
|
/* Define if you have the `strtoul' function. */
|
||||||
|
#undef HAVE_STRTOUL
|
||||||
|
|
||||||
|
/* Define if you have the <sys/param.h> header file. */
|
||||||
|
#undef HAVE_SYS_PARAM_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/stat.h> header file. */
|
||||||
|
#undef HAVE_SYS_STAT_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/types.h> header file. */
|
||||||
|
#undef HAVE_SYS_TYPES_H
|
||||||
|
|
||||||
|
/* Define if you have the `tsearch' function. */
|
||||||
|
#undef HAVE_TSEARCH
|
||||||
|
|
||||||
|
/* Define if you have the <unistd.h> header file. */
|
||||||
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define if you have the `vprintf' function. */
|
||||||
|
#undef HAVE_VPRINTF
|
||||||
|
|
||||||
|
/* Define if you have the <wchar.h> header file. */
|
||||||
|
#undef HAVE_WCHAR_H
|
||||||
|
|
||||||
|
/* Define if you have the <wctype.h> header file. */
|
||||||
|
#undef HAVE_WCTYPE_H
|
||||||
|
|
||||||
|
/* Define to 1 if `strerror_r' returns a string. */
|
||||||
|
#undef HAVE_WORKING_STRERROR_R
|
||||||
|
|
||||||
|
/* Define if you have the `__argz_count' function. */
|
||||||
|
#undef HAVE___ARGZ_COUNT
|
||||||
|
|
||||||
|
/* Define if you have the `__argz_next' function. */
|
||||||
|
#undef HAVE___ARGZ_NEXT
|
||||||
|
|
||||||
|
/* Define if you have the `__argz_stringify' function. */
|
||||||
|
#undef HAVE___ARGZ_STRINGIFY
|
||||||
|
|
||||||
|
/* Define as const if the declaration of iconv() needs const. */
|
||||||
|
#undef ICONV_CONST
|
||||||
|
|
||||||
|
/* Name of package */
|
||||||
|
#undef PACKAGE
|
||||||
|
|
||||||
|
/* Define if compiler has function prototypes */
|
||||||
|
#undef PROTOTYPES
|
||||||
|
|
||||||
|
/* If using the C implementation of alloca, define if you know the
|
||||||
|
direction of stack growth for your system; otherwise it will be
|
||||||
|
automatically deduced at run-time.
|
||||||
|
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||||
|
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||||
|
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||||
|
#undef STACK_DIRECTION
|
||||||
|
|
||||||
|
/* Define if you have the ANSI C header files. */
|
||||||
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
/* Version number of package */
|
||||||
|
#undef VERSION
|
||||||
|
|
||||||
|
/* Define if using the dmalloc debugging malloc package */
|
||||||
|
#undef WITH_DMALLOC
|
||||||
|
|
||||||
|
/* Define to 1 for GNU C library extensions. */
|
||||||
|
#undef _GNU_SOURCE
|
||||||
|
|
||||||
|
/* Define if on MINIX. */
|
||||||
|
#undef _MINIX
|
||||||
|
|
||||||
|
/* Define if the system does not provide POSIX.1 features except with this
|
||||||
|
defined. */
|
||||||
|
#undef _POSIX_1_SOURCE
|
||||||
|
|
||||||
|
/* Define if you need to in order for `stat' and other things to work. */
|
||||||
|
#undef _POSIX_SOURCE
|
||||||
|
|
||||||
|
/* Define to empty if `const' does not conform to ANSI C. */
|
||||||
|
#undef const
|
||||||
|
|
||||||
|
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
|
||||||
|
if it is not supported. */
|
||||||
|
#undef inline
|
||||||
|
|
||||||
|
/* Define to rpl_malloc if the replacement function should be used. */
|
||||||
|
#undef malloc
|
||||||
|
|
||||||
|
/* Define to a type if <wchar.h> does not define. */
|
||||||
|
#undef mbstate_t
|
||||||
|
|
||||||
|
/* Define to `long' if <sys/types.h> does not define. */
|
||||||
|
#undef off_t
|
||||||
|
|
||||||
|
/* Define to rpl_realloc if the replacement function should be used. */
|
||||||
|
#undef realloc
|
||||||
|
|
||||||
|
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||||
|
#undef size_t
|
||||||
+71
-191
@@ -1,6 +1,7 @@
|
|||||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2001-2015, 2018 Free Software Foundation, Inc.
|
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,193 +16,81 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# In order for some versions of Sun Studio to compile our C++ test cases
|
# We have strange test case titles, so we need Autoconf 2.61 or better.
|
||||||
# correctly, we need Autoconf 2.64 or better to handle the restrict
|
AC_PREREQ(2.61)
|
||||||
# keyword in at least string.h from gnulib. We need Autoconf 2.68 or
|
|
||||||
# better to avoid a typo in the 'configure --help' entry for the YACC
|
|
||||||
# environment variable.
|
|
||||||
AC_PREREQ([2.68])
|
|
||||||
m4_pattern_forbid([^_?(gl_[A-Z]|AX_|BISON_)])
|
|
||||||
m4_pattern_allow([^BISON_USE_NLS$])
|
|
||||||
|
|
||||||
AC_INIT([GNU Bison],
|
AC_INIT([GNU Bison], [2.3a+], [[email protected]])
|
||||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
AC_DEFINE([PACKAGE_COPYRIGHT_YEAR], [2007],
|
||||||
[[email protected]])
|
[The copyright year for this package])
|
||||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2018])
|
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2007])
|
||||||
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
|
|
||||||
[The copyright year for this package])
|
|
||||||
|
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
||||||
# We use Automake 1.14's %D% and %C%.
|
# We don't have a file m4/Makefile.am, so we need Automake 1.8 or later.
|
||||||
#
|
AM_INIT_AUTOMAKE([1.8 check-news readme-alpha dist-bzip2])
|
||||||
# We want gnits strictness only when rolling a stable release. For
|
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
||||||
# release candidates, we use version strings like 2.4.3_rc1, but gnits
|
|
||||||
# doesn't like that, so we let the underscore disable gnits. Between
|
|
||||||
# releases, we want to be able run make dist without being required to
|
|
||||||
# add a bogus NEWS entry. In that case, the version string
|
|
||||||
# automatically contains a dash, which we also let disable gnits.
|
|
||||||
AM_INIT_AUTOMAKE([1.14 dist-xz nostdinc
|
|
||||||
color-tests parallel-tests
|
|
||||||
silent-rules]
|
|
||||||
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]],
|
|
||||||
[gnu], [gnits]))
|
|
||||||
AM_SILENT_RULES([yes])
|
|
||||||
AC_CONFIG_HEADERS([lib/config.h:lib/config.in.h])
|
|
||||||
|
|
||||||
# Checks for the compiler.
|
# Checks for the compiler.
|
||||||
AC_PROG_CC_STDC
|
AC_PROG_CC_STDC
|
||||||
AC_PROG_CXX
|
|
||||||
|
|
||||||
# Gnulib (early checks).
|
# Gnulib (early checks).
|
||||||
gl_EARLY
|
gl_EARLY
|
||||||
|
|
||||||
# Gnulib uses '#pragma GCC diagnostic push' to silence some
|
AC_ARG_ENABLE(gcc-warnings,
|
||||||
# warnings, but older gcc doesn't support this.
|
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
||||||
AC_CACHE_CHECK([whether pragma GCC diagnostic push works],
|
[case "${enableval}" in
|
||||||
[lv_cv_gcc_pragma_push_works], [
|
|
||||||
save_CFLAGS=$CFLAGS
|
|
||||||
CFLAGS='-Wunknown-pragmas -Werror'
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
]])],
|
|
||||||
[lv_cv_gcc_pragma_push_works=yes],
|
|
||||||
[lv_cv_gcc_pragma_push_works=no])
|
|
||||||
CFLAGS=$save_CFLAGS])
|
|
||||||
|
|
||||||
AC_LANG_PUSH([C++])
|
|
||||||
gl_WARN_ADD([-fno-exceptions], [NO_EXCEPTIONS_CXXFLAGS])
|
|
||||||
BISON_CXXSTD([98])
|
|
||||||
BISON_CXXSTD([03])
|
|
||||||
BISON_CXXSTD([11])
|
|
||||||
BISON_CXXSTD([14])
|
|
||||||
BISON_CXXSTD([17])
|
|
||||||
BISON_CXXSTD([2a])
|
|
||||||
AM_CONDITIONAL([ENABLE_CXX11], [test x"$CXX11_CXXFLAGS" != x])
|
|
||||||
AC_LANG_POP([C++])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([gcc-warnings],
|
|
||||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended).
|
|
||||||
Also, issue synclines from the examples/ to
|
|
||||||
the corresponding source in the Texinfo doc.],
|
|
||||||
[case $enable_gcc_warnings in
|
|
||||||
yes|no) ;;
|
yes|no) ;;
|
||||||
*) AC_MSG_ERROR([invalid value for --gcc-warnings: $enable_gcc_warnings]);;
|
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
|
||||||
esac],
|
esac],
|
||||||
[enable_gcc_warnings=no])
|
[enableval=no])
|
||||||
AM_CONDITIONAL([ENABLE_GCC_WARNINGS], [test "$enable_gcc_warnings" = yes])
|
if test "${enableval}" = yes; then
|
||||||
if test "$enable_gcc_warnings" = yes; then
|
gl_WARNING_CFLAGS([-Werror])
|
||||||
warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align
|
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
|
||||||
-fparse-all-comments -Wdocumentation
|
WARNING_CFLAGS=
|
||||||
-Wformat -Wnull-dereference -Wpointer-arith -Wwrite-strings'
|
gl_WARNING_CFLAGS([-Wall])
|
||||||
warn_c='-Wbad-function-cast -Wshadow -Wstrict-prototypes'
|
gl_WARNING_CFLAGS([-Wextra -Wno-sign-compare])
|
||||||
warn_cxx='-Wnoexcept'
|
gl_WARNING_CFLAGS([-Wcast-align])
|
||||||
# Warnings for the test suite only.
|
gl_WARNING_CFLAGS([-Wcast-qual])
|
||||||
#
|
gl_WARNING_CFLAGS([-Wformat])
|
||||||
# -fno-color-diagnostics: Clang's use of colors in the error
|
gl_WARNING_CFLAGS([-Wpointer-arith])
|
||||||
# messages is confusing the tests looking at the compiler's output
|
gl_WARNING_CFLAGS([-Wwrite-strings])
|
||||||
# (e.g., synclines.at).
|
AC_SUBST([WARNING_CXXFLAGS], [$WARNING_CFLAGS])
|
||||||
#
|
# The following warnings are not suitable for C++.
|
||||||
# -Wno-keyword-macro: We use the "#define private public" dirty
|
gl_WARNING_CFLAGS([-Wbad-function-cast])
|
||||||
# trick in the test suite to check some private implementation
|
gl_WARNING_CFLAGS([-Wmissing-declarations])
|
||||||
# details for lalr1.cc.
|
gl_WARNING_CFLAGS([-Wmissing-prototypes])
|
||||||
warn_tests='-Wundef -pedantic -Wdeprecated -Wsign-compare -fno-color-diagnostics
|
gl_WARNING_CFLAGS([-Wshadow])
|
||||||
-Wno-keyword-macro'
|
gl_WARNING_CFLAGS([-Wstrict-prototypes])
|
||||||
|
AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
|
||||||
AC_LANG_PUSH([C])
|
|
||||||
# Clang supports many of GCC's -W options, but only issues warnings
|
|
||||||
# on the ones it does not recognize. In that case, gl_WARN_ADD
|
|
||||||
# thinks the option is supported, and unknown options are then added
|
|
||||||
# to CFLAGS. But then, when -Werror is added in the test suite for
|
|
||||||
# instance, the warning about the unknown option turns into an
|
|
||||||
# error.
|
|
||||||
#
|
|
||||||
# This should be addressed by gnulib's gl_WARN_ADD, but in the
|
|
||||||
# meanwhile, turn warnings about unknown options into errors in
|
|
||||||
# CFLAGS, and restore CFLAGS after the tests.
|
|
||||||
save_CFLAGS=$CFLAGS
|
|
||||||
gl_WARN_ADD([-Werror=unknown-warning-option], [CFLAGS])
|
|
||||||
for i in $warn_common $warn_c;
|
|
||||||
do
|
|
||||||
gl_WARN_ADD([$i], [WARN_CFLAGS])
|
|
||||||
done
|
|
||||||
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
|
||||||
|
|
||||||
# Warnings for the test suite, and maybe for bison if GCC is modern
|
|
||||||
# enough.
|
|
||||||
gl_WARN_ADD([-Wmissing-declarations], [WARN_CFLAGS_TEST])
|
|
||||||
gl_WARN_ADD([-Wmissing-prototypes], [WARN_CFLAGS_TEST])
|
|
||||||
test $lv_cv_gcc_pragma_push_works = yes &&
|
|
||||||
AS_VAR_APPEND([WARN_CFLAGS], [" $WARN_CFLAGS_TEST"])
|
|
||||||
|
|
||||||
# Warnings for the test suite only.
|
|
||||||
for i in $warn_tests;
|
|
||||||
do
|
|
||||||
gl_WARN_ADD([$i], [WARN_CFLAGS_TEST])
|
|
||||||
done
|
|
||||||
CFLAGS=$save_CFLAGS
|
|
||||||
AC_LANG_POP([C])
|
|
||||||
|
|
||||||
AC_LANG_PUSH([C++])
|
|
||||||
save_CXXFLAGS=$CXXFLAGS
|
|
||||||
gl_WARN_ADD([-Werror=unknown-warning-option], [CXXFLAGS])
|
|
||||||
for i in $warn_common $warn_cxx;
|
|
||||||
do
|
|
||||||
gl_WARN_ADD([$i], [WARN_CXXFLAGS])
|
|
||||||
done
|
|
||||||
gl_WARN_ADD([-Wzero-as-null-pointer-constant], [WARN_CXXFLAGS],
|
|
||||||
[AC_LANG_PROGRAM([], [nullptr])])
|
|
||||||
gl_WARN_ADD([-Werror], [WERROR_CXXFLAGS])
|
|
||||||
# Warnings for the test suite only.
|
|
||||||
for i in $warn_tests;
|
|
||||||
do
|
|
||||||
gl_WARN_ADD([$i], [WARN_CXXFLAGS_TEST])
|
|
||||||
done
|
|
||||||
# Clang++ 3.2+ reject C code generated by Flex.
|
|
||||||
gl_WARN_ADD([-Wno-null-conversion], [FLEX_SCANNER_CXXFLAGS])
|
|
||||||
# So does G++ 4.8...
|
|
||||||
gl_WARN_ADD([-Wno-sign-compare], [FLEX_SCANNER_CXXFLAGS])
|
|
||||||
# ... possibly in std=c++11 mode.
|
|
||||||
gl_WARN_ADD([-Wno-zero-as-null-pointer-constant], [FLEX_SCANNER_CXXFLAGS])
|
|
||||||
CXXFLAGS=$save_CXXFLAGS
|
|
||||||
# Clang++ deprecates compiling C.
|
|
||||||
gl_WARN_ADD([-Wno-deprecated], [WNO_DEPRECATED_CXXFLAGS])
|
|
||||||
AC_LANG_POP([C++])
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
BISON_TEST_FOR_WORKING_C_COMPILER
|
BISON_TEST_FOR_WORKING_C_COMPILER
|
||||||
BISON_C_COMPILER_POSIXLY_CORRECT
|
|
||||||
BISON_TEST_FOR_WORKING_CXX_COMPILER
|
|
||||||
BISON_CXX_COMPILER_POSIXLY_CORRECT
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([yacc],
|
AC_ARG_ENABLE([yacc],
|
||||||
[AC_HELP_STRING([--disable-yacc],
|
[AC_HELP_STRING([--disable-yacc],
|
||||||
[do not build a yacc command or an -ly library])],
|
[do not build a yacc command or an -ly library])],
|
||||||
, [enable_yacc=yes])
|
, [enable_yacc=yes])
|
||||||
AM_CONDITIONAL([ENABLE_YACC], [test "$enable_yacc" = yes])
|
case $enable_yacc in
|
||||||
|
yes)
|
||||||
|
YACC_SCRIPT=yacc
|
||||||
|
YACC_LIBRARY=liby.a;;
|
||||||
|
*)
|
||||||
|
YACC_SCRIPT=
|
||||||
|
YACC_LIBRARY=;;
|
||||||
|
esac
|
||||||
|
AC_SUBST([YACC_SCRIPT])
|
||||||
|
AC_SUBST([YACC_LIBRARY])
|
||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
AM_MISSING_PROG([DOT], [dot])
|
|
||||||
AC_PROG_LEX
|
AC_PROG_LEX
|
||||||
$LEX_IS_FLEX || test "X$LEX" = X: || {
|
|
||||||
AC_MSG_WARN([bypassing lex because flex is required])
|
|
||||||
LEX=:
|
|
||||||
}
|
|
||||||
AM_CONDITIONAL([FLEX_CXX_WORKS],
|
|
||||||
[$LEX_IS_FLEX && test $bison_cv_cxx_works = yes])
|
|
||||||
AC_PROG_YACC
|
AC_PROG_YACC
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
AC_PROG_GNU_M4
|
BISON_PROG_GNU_M4
|
||||||
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
|
if test x"$ac_cv_prog_gnu_m4" != xyes; then
|
||||||
AC_DEFINE_UNQUOTED([M4_GNU_OPTION], ["$M4_GNU"], [Define to "-g" if GNU M4
|
AC_MSG_ERROR([GNU M4 1.4 is required])
|
||||||
supports -g, otherwise to "".])
|
|
||||||
AC_PATH_PROG([PERL], [perl])
|
|
||||||
if test -z "$PERL"; then
|
|
||||||
AC_MSG_ERROR([perl not found])
|
|
||||||
fi
|
fi
|
||||||
|
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
|
||||||
AM_MISSING_PROG([HELP2MAN], [help2man])
|
AM_MISSING_PROG([HELP2MAN], [help2man])
|
||||||
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||||
AC_SUBST([XSLTPROC])
|
AC_SUBST([XSLTPROC])
|
||||||
@@ -219,12 +108,13 @@ gl_INIT
|
|||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_CHECK_FUNCS_ONCE([setlocale])
|
AC_CHECK_FUNCS_ONCE([setlocale])
|
||||||
AM_WITH_DMALLOC
|
AM_WITH_DMALLOC
|
||||||
|
BISON_PREREQ_SUBPIPE
|
||||||
|
BISON_PREREQ_TIMEVAR
|
||||||
|
|
||||||
# Gettext.
|
# Gettext.
|
||||||
# We use gnulib, which is only guaranteed to work properly with the
|
# We've never tested with gettext versions before 0.15, so play it safe.
|
||||||
# latest Gettext.
|
AM_GNU_GETTEXT([external], [need-formatstring-macros])
|
||||||
AM_GNU_GETTEXT([external], [need-ngettext])
|
AM_GNU_GETTEXT_VERSION([0.15])
|
||||||
AM_GNU_GETTEXT_VERSION([0.18])
|
|
||||||
BISON_I18N
|
BISON_I18N
|
||||||
|
|
||||||
# Internationalized parsers.
|
# Internationalized parsers.
|
||||||
@@ -238,39 +128,29 @@ AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl])
|
|||||||
|
|
||||||
# Initialize the test suite.
|
# Initialize the test suite.
|
||||||
AC_CONFIG_TESTDIR(tests)
|
AC_CONFIG_TESTDIR(tests)
|
||||||
AC_CONFIG_FILES([tests/atlocal])
|
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
|
||||||
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
||||||
|
|
||||||
AC_CHECK_PROGS([VALGRIND], [valgrind])
|
AC_CHECK_PROGS([VALGRIND], [valgrind])
|
||||||
# Use something simpler that $host_os to select our suppression file.
|
AC_PROG_CXX
|
||||||
uname=`uname`
|
BISON_TEST_FOR_WORKING_CXX_COMPILER
|
||||||
case $VALGRIND:$uname in
|
|
||||||
'':*) ;;
|
|
||||||
*:Darwin)
|
|
||||||
# See README-hacking.
|
|
||||||
VALGRIND=;;
|
|
||||||
*:*)
|
|
||||||
suppfile=build-aux/$uname.valgrind
|
|
||||||
if test -f "$srcdir/$suppfile"; then
|
|
||||||
AC_SUBST([VALGRIND_OPTS_SUPPRESSION],
|
|
||||||
["--suppressions=\$(abs_top_srcdir)/$suppfile"])
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
AC_MSG_CHECKING([Valgrind suppression file])
|
|
||||||
AC_MSG_RESULT([$suppfile])
|
|
||||||
|
|
||||||
# Whether we cannot run the compiled bison.
|
|
||||||
AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
|
|
||||||
|
|
||||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||||
# Needed by tests/atlocal.in.
|
# Needed by tests/atlocal.in.
|
||||||
AC_SUBST([GCC])
|
AC_SUBST([GCC])
|
||||||
|
AC_SUBST([O0CFLAGS], [`echo $CFLAGS | sed 's/-O[[0-9]] *//'`])
|
||||||
|
AC_SUBST([O0CXXFLAGS], [`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`])
|
||||||
|
|
||||||
gt_JAVACOMP([1.7], [1.7])
|
gt_JAVACOMP([1.3])
|
||||||
gt_JAVAEXEC
|
gt_JAVAEXEC
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([.version
|
||||||
po/Makefile.in
|
Makefile
|
||||||
doc/yacc.1])
|
build-aux/Makefile
|
||||||
|
po/Makefile.in
|
||||||
|
data/Makefile
|
||||||
|
etc/Makefile
|
||||||
|
examples/Makefile
|
||||||
|
examples/calc++/Makefile
|
||||||
|
lib/Makefile src/Makefile
|
||||||
|
doc/Makefile
|
||||||
|
doc/yacc.1])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Makefile.in
|
||||||
|
Makefile
|
||||||
Executable → Regular
+13
-30
@@ -1,7 +1,5 @@
|
|||||||
#! /bin/sh
|
## Copyright (C) 2002, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -15,32 +13,17 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
cat >input <<EOF
|
dist_pkgdata_DATA = README bison.m4 \
|
||||||
1 2 3 * +
|
c-skel.m4 c.m4 yacc.c glr.c \
|
||||||
EOF
|
c++-skel.m4 c++.m4 location.cc lalr1.cc glr.cc \
|
||||||
run 0 7
|
java-skel.m4 java.m4 lalr1.java
|
||||||
|
|
||||||
cat >input <<EOF
|
m4sugardir = $(pkgdatadir)/m4sugar
|
||||||
1.1 2.2 3.3 * +
|
dist_m4sugar_DATA = m4sugar/m4sugar.m4
|
||||||
EOF
|
|
||||||
run 0 8.36
|
|
||||||
|
|
||||||
cat >input <<EOF
|
xsltdir = $(pkgdatadir)/xslt
|
||||||
1 2 + 3 *
|
dist_xslt_DATA = \
|
||||||
EOF
|
xslt/bison.xsl \
|
||||||
run 0 9
|
xslt/xml2dot.xsl \
|
||||||
|
xslt/xml2text.xsl \
|
||||||
cat >input <<EOF
|
xslt/xml2xhtml.xsl
|
||||||
1 2 3 4 5 6 7 8 9 * * * * * * * *
|
|
||||||
EOF
|
|
||||||
run 0 362880
|
|
||||||
|
|
||||||
cat >input <<EOF
|
|
||||||
3 7 + 3 4 5 * + - n
|
|
||||||
EOF
|
|
||||||
run 0 13
|
|
||||||
|
|
||||||
cat >input <<EOF
|
|
||||||
3 4 ^
|
|
||||||
EOF
|
|
||||||
run 0 81
|
|
||||||
+9
-38
@@ -1,60 +1,31 @@
|
|||||||
This directory contains data needed by Bison.
|
-*- outline -*-
|
||||||
|
|
||||||
* Skeletons
|
This directory contains Bison skeletons: the general shapes of the
|
||||||
Bison skeletons: the general shapes of the different parser kinds,
|
different parser kinds, that are specialized for specific grammars by
|
||||||
that are specialized for specific grammars by the bison program.
|
the bison program.
|
||||||
|
|
||||||
Currently, the supported skeletons are:
|
Currently, there are only three supported skeletons:
|
||||||
|
|
||||||
- yacc.c
|
- yacc.c
|
||||||
It used to be named bison.simple: it corresponds to C Yacc
|
It used to be named bison.simple: it corresponds to C Yacc
|
||||||
compatible LALR(1) parsers.
|
compatible LALR(1) parsers.
|
||||||
|
|
||||||
- lalr1.cc
|
- lalr1.cc
|
||||||
Produces a C++ parser class.
|
Produces a C++ parser class. It is still very experimental, and not
|
||||||
|
yet supported. Please, subscribe to [email protected].
|
||||||
- lalr1.java
|
|
||||||
Produces a Java parser class.
|
|
||||||
|
|
||||||
- glr.c
|
- glr.c
|
||||||
A Generalized LR C parser based on Bison's LALR(1) tables.
|
A Generalized LR C parser based on Bison's LALR(1) tables.
|
||||||
|
|
||||||
- glr.cc
|
|
||||||
A Generalized LR C++ parser. Actually a C++ wrapper around glr.c.
|
|
||||||
|
|
||||||
These skeletons are the only ones supported by the Bison team.
|
These skeletons are the only ones supported by the Bison team.
|
||||||
Because the interface between skeletons and the bison program is not
|
Because the interface between skeletons and the bison program is not
|
||||||
finished, *we are not bound to it*. In particular, Bison is not
|
finished, *we are not bound to it*. In particular, Bison is not
|
||||||
mature enough for us to consider that "foreign skeletons" are
|
mature enough for us to consider that ``foreign skeletons'' are
|
||||||
supported.
|
supported.
|
||||||
|
|
||||||
* m4sugar
|
|
||||||
This directory contains M4sugar, sort of an extended library for M4,
|
|
||||||
which is used by Bison to instantiate the skeletons.
|
|
||||||
|
|
||||||
* xslt
|
|
||||||
This directory contains XSLT programs that transform Bison's XML output
|
|
||||||
into various formats.
|
|
||||||
|
|
||||||
- bison.xsl
|
|
||||||
A library of routines used by the other XSLT programs.
|
|
||||||
|
|
||||||
- xml2dot.xsl
|
|
||||||
Conversion into GraphViz's dot format.
|
|
||||||
|
|
||||||
- xml2text.xsl
|
|
||||||
Conversion into text.
|
|
||||||
|
|
||||||
- xml2xhtml.xsl
|
|
||||||
Conversion into XHTML.
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Local Variables:
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
mode: outline
|
|
||||||
End:
|
|
||||||
|
|
||||||
Copyright (C) 2002, 2008-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of GNU Bison.
|
This file is part of GNU Bison.
|
||||||
|
|
||||||
|
|||||||
+119
-673
File diff suppressed because it is too large
Load Diff
+1
-3
@@ -1,9 +1,7 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C++ skeleton dispatching for Bison.
|
# C++ skeleton dispatching for Bison.
|
||||||
|
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
||||||
# Copyright (C) 2006-2007, 2009-2015, 2018 Free Software Foundation,
|
|
||||||
# Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+34
-476
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002-2018 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
|
||||||
|
# Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,494 +18,91 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Sanity checks, before defaults installed by c.m4.
|
|
||||||
b4_percent_define_ifdef([[api.value.union.name]],
|
|
||||||
[b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]),
|
|
||||||
[named %union is invalid in C++])])
|
|
||||||
|
|
||||||
m4_include(b4_pkgdatadir/[c.m4])
|
m4_include(b4_pkgdatadir/[c.m4])
|
||||||
|
|
||||||
b4_percent_define_check_kind([api.namespace], [code], [deprecated])
|
|
||||||
b4_percent_define_check_kind([parser_class_name], [code], [deprecated])
|
|
||||||
|
|
||||||
|
|
||||||
## ----- ##
|
|
||||||
## C++. ##
|
|
||||||
## ----- ##
|
|
||||||
|
|
||||||
# b4_comment(TEXT, [PREFIX])
|
|
||||||
# --------------------------
|
|
||||||
# Put TEXT in comment. Prefix all the output lines with PREFIX.
|
|
||||||
m4_define([b4_comment],
|
|
||||||
[_b4_comment([$1], [$2// ], [$2// ])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_inline(hh|cc)
|
|
||||||
# ----------------
|
|
||||||
# Expand to `inline\n ` if $1 is hh.
|
|
||||||
m4_define([b4_inline],
|
|
||||||
[m4_case([$1],
|
|
||||||
[cc], [],
|
|
||||||
[hh], [[inline
|
|
||||||
]],
|
|
||||||
[m4_fatal([$0: invalid argument: $1])])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_cxx_portability
|
|
||||||
# ------------------
|
|
||||||
m4_define([b4_cxx_portability],
|
|
||||||
[// Support move semantics when possible.
|
|
||||||
#if defined __cplusplus && 201103L <= __cplusplus
|
|
||||||
# define YY_MOVE std::move
|
|
||||||
# define YY_MOVE_OR_COPY move
|
|
||||||
# define YY_MOVE_REF(Type) Type&&
|
|
||||||
# define YY_RVREF(Type) Type&&
|
|
||||||
# define YY_COPY(Type) Type
|
|
||||||
#else
|
|
||||||
# define YY_MOVE
|
|
||||||
# define YY_MOVE_OR_COPY copy
|
|
||||||
# define YY_MOVE_REF(Type) Type&
|
|
||||||
# define YY_RVREF(Type) const Type&
|
|
||||||
# define YY_COPY(Type) const Type&
|
|
||||||
#endif[]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Default values. ##
|
## Default values. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
|
# Default parser class name.
|
||||||
b4_percent_define_default([[parser_class_name]], [[parser]])
|
b4_percent_define_default([[parser_class_name]], [[parser]])
|
||||||
|
b4_percent_define_default([[location_type]], [[location]])
|
||||||
# Don't do that so that we remember whether we're using a user
|
|
||||||
# request, or the default value.
|
|
||||||
#
|
|
||||||
# b4_percent_define_default([[api.location.type]], [[location]])
|
|
||||||
|
|
||||||
b4_percent_define_default([[filename_type]], [[std::string]])
|
b4_percent_define_default([[filename_type]], [[std::string]])
|
||||||
# Make it a warning for those who used betas of Bison 3.0.
|
b4_percent_define_default([[namespace]], m4_defn([b4_prefix]))
|
||||||
b4_percent_define_default([[api.namespace]], m4_defn([b4_prefix]))
|
|
||||||
|
|
||||||
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
||||||
b4_percent_define_default([[define_location_comparison]],
|
b4_percent_define_default([[define_location_comparison]],
|
||||||
[m4_if(b4_percent_define_get([[filename_type]]),
|
[m4_if(b4_percent_define_get([[filename_type]]),
|
||||||
[std::string], [[true]], [[false]])])
|
[std::string], [[true]], [[false]])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ----------- ##
|
## ----------- ##
|
||||||
## Namespace. ##
|
## Namespace. ##
|
||||||
## ----------- ##
|
## ----------- ##
|
||||||
|
|
||||||
m4_define([b4_namespace_ref], [b4_percent_define_get([[api.namespace]])])
|
m4_define([b4_namespace_ref], [b4_percent_define_get([[namespace]])])
|
||||||
|
|
||||||
|
# Don't permit an empty b4_namespace_ref. Any `::parser::foo' appended to it
|
||||||
# Don't permit an empty b4_namespace_ref. Any '::parser::foo' appended to it
|
# would compile as an absolute reference with `parser' in the global namespace.
|
||||||
# would compile as an absolute reference with 'parser' in the global namespace.
|
|
||||||
# b4_namespace_open would open an anonymous namespace and thus establish
|
# b4_namespace_open would open an anonymous namespace and thus establish
|
||||||
# internal linkage. This would compile. However, it's cryptic, and internal
|
# internal linkage. This would compile. However, it's cryptic, and internal
|
||||||
# linkage for the parser would be specified in all translation units that
|
# linkage for the parser would be specified in all translation units that
|
||||||
# include the header, which is always generated. If we ever need to permit
|
# include the header, which is always generated. If we ever need to permit
|
||||||
# internal linkage somehow, surely we can find a cleaner approach.
|
# internal linkage somehow, surely we can find a cleaner approach.
|
||||||
m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [],
|
m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [],
|
||||||
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
|
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
||||||
[[namespace reference is empty]])])
|
[[namespace reference is empty]])])
|
||||||
|
|
||||||
# Instead of assuming the C++ compiler will do it, Bison should reject any
|
# Instead of assuming the C++ compiler will do it, Bison should reject any
|
||||||
# invalid b4_namespace_ref that would be converted to a valid
|
# invalid b4_namepsace_ref that would be converted to a valid
|
||||||
# b4_namespace_open. The problem is that Bison doesn't always output
|
# b4_namespace_open. The problem is that Bison doesn't always output
|
||||||
# b4_namespace_ref to uncommented code but should reserve the ability to do so
|
# b4_namespace_ref to uncommented code but should reserve the ability to do so
|
||||||
# in future releases without risking breaking any existing user grammars.
|
# in future releases without risking breaking any existing user grammars.
|
||||||
# Specifically, don't allow empty names as b4_namespace_open would just convert
|
# Specifically, don't allow empty names as b4_namespace_open would just convert
|
||||||
# those into anonymous namespaces, and that might tempt some users.
|
# those into anonymous namespaces, and that might tempt some users.
|
||||||
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [],
|
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [],
|
||||||
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
|
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
||||||
[[namespace reference has consecutive "::"]])])
|
[[namespace reference has consecutive "::"]])])
|
||||||
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [],
|
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [],
|
||||||
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
|
[b4_complain_at(b4_percent_define_get_loc([[namespace]]),
|
||||||
[[namespace reference has a trailing "::"]])])
|
[[namespace reference has a trailing "::"]])])
|
||||||
|
|
||||||
m4_define([b4_namespace_open],
|
m4_define([b4_namespace_open],
|
||||||
[b4_user_code([b4_percent_define_get_syncline([[api.namespace]])
|
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
|
||||||
[namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
|
[namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
|
||||||
[^\(.\)[ ]*::], [\1])),
|
[^\(.\)[ ]*::], [\1])),
|
||||||
[::], [ { namespace ])[ {]])])
|
[::], [ { namespace ])[ {]])])
|
||||||
|
|
||||||
m4_define([b4_namespace_close],
|
m4_define([b4_namespace_close],
|
||||||
[b4_user_code([b4_percent_define_get_syncline([[api.namespace]])
|
[b4_user_code([b4_percent_define_get_syncline([[namespace]])
|
||||||
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref[ ]),
|
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
|
||||||
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^:]\)*],
|
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^][:]\)*],
|
||||||
[\1])),
|
[\1])),
|
||||||
[::\([^][:]\|:[^:]\)*], [} ])[} // ]b4_namespace_ref])])
|
[::\([^][:]\|:[^][:]\)*], [} ])[} // ]b4_namespace_ref])])
|
||||||
|
|
||||||
|
|
||||||
# b4_token_enums
|
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
# --------------
|
# -----------------------------------------------------
|
||||||
# Output the definition of the tokens as enums.
|
# Output the definition of the tokens as enums.
|
||||||
m4_define([b4_token_enums],
|
m4_define([b4_token_enums],
|
||||||
[[enum yytokentype
|
[/* Tokens. */
|
||||||
{
|
enum yytokentype {
|
||||||
]m4_join([,
|
m4_map_sep([ b4_token_enum], [,
|
||||||
],
|
],
|
||||||
b4_symbol_map([b4_token_enum]))[
|
[$@])
|
||||||
};]dnl
|
};
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ----------------- ##
|
## ----------------- ##
|
||||||
## Semantic Values. ##
|
## Semantic Values. ##
|
||||||
## ----------------- ##
|
## ----------------- ##
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# b4_value_type_declare
|
|
||||||
# ---------------------
|
|
||||||
# Declare semantic_type.
|
|
||||||
m4_define([b4_value_type_declare],
|
|
||||||
[b4_value_type_setup[]dnl
|
|
||||||
[ /// Symbol semantic values.
|
|
||||||
]m4_bmatch(b4_percent_define_get_kind([[api.value.type]]),
|
|
||||||
[code],
|
|
||||||
[[ typedef ]b4_percent_define_get([[api.value.type]])[ semantic_type;]],
|
|
||||||
[m4_bmatch(b4_percent_define_get([[api.value.type]]),
|
|
||||||
[union\|union-directive],
|
|
||||||
[[ union semantic_type
|
|
||||||
{
|
|
||||||
]b4_user_union_members[
|
|
||||||
};]])])dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_public_types_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],
|
|
||||||
[[#ifndef ]b4_api_PREFIX[STYPE
|
|
||||||
]b4_value_type_declare[
|
|
||||||
#else
|
|
||||||
typedef ]b4_api_PREFIX[STYPE semantic_type;
|
|
||||||
#endif]b4_locations_if([
|
|
||||||
/// Symbol locations.
|
|
||||||
typedef b4_percent_define_get([[api.location.type]],
|
|
||||||
[[location]]) location_type;])[
|
|
||||||
|
|
||||||
/// Syntax errors thrown from user actions.
|
|
||||||
struct syntax_error : std::runtime_error
|
|
||||||
{
|
|
||||||
syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m);]b4_locations_if([
|
|
||||||
location_type location;])[
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Tokens.
|
|
||||||
struct token
|
|
||||||
{
|
|
||||||
]b4_token_enums[
|
|
||||||
};
|
|
||||||
|
|
||||||
/// (External) token type, as returned by yylex.
|
|
||||||
typedef token::yytokentype token_type;
|
|
||||||
|
|
||||||
/// Symbol type: an internal symbol number.
|
|
||||||
typedef int symbol_number_type;
|
|
||||||
|
|
||||||
/// The symbol type number to denote an empty symbol.
|
|
||||||
enum { empty_symbol = -2 };
|
|
||||||
|
|
||||||
/// Internal symbol number for tokens (subsumed by symbol_number_type).
|
|
||||||
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
|
|
||||||
]])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_symbol_type_declare
|
|
||||||
# ----------------------
|
|
||||||
# Define symbol_type, the external type for symbols used for symbol
|
|
||||||
# constructors.
|
|
||||||
m4_define([b4_symbol_type_declare],
|
|
||||||
[[ /// A complete symbol.
|
|
||||||
///
|
|
||||||
/// Expects its Base type to provide access to the symbol type
|
|
||||||
/// via type_get ().
|
|
||||||
///
|
|
||||||
/// Provide access to semantic value]b4_locations_if([ and location])[.
|
|
||||||
template <typename Base>
|
|
||||||
struct basic_symbol : Base
|
|
||||||
{
|
|
||||||
/// Alias to Base.
|
|
||||||
typedef Base super_type;
|
|
||||||
|
|
||||||
/// Default constructor.
|
|
||||||
basic_symbol ();
|
|
||||||
|
|
||||||
/// Move or copy constructor.
|
|
||||||
basic_symbol (YY_RVREF (basic_symbol) other);
|
|
||||||
|
|
||||||
]b4_variant_if([[
|
|
||||||
/// Constructor for valueless symbols, and symbols from each type.
|
|
||||||
]b4_type_foreach([b4_basic_symbol_constructor_declare])], [[
|
|
||||||
/// Constructor for valueless symbols.
|
|
||||||
basic_symbol (typename Base::kind_type t]b4_locations_if([,
|
|
||||||
YY_MOVE_REF (location_type) l])[);
|
|
||||||
|
|
||||||
/// Constructor for symbols with semantic value.
|
|
||||||
basic_symbol (typename Base::kind_type t,
|
|
||||||
YY_RVREF (semantic_type) v]b4_locations_if([,
|
|
||||||
YY_RVREF (location_type) l])[);]])[
|
|
||||||
|
|
||||||
/// Destroy the symbol.
|
|
||||||
~basic_symbol ();
|
|
||||||
|
|
||||||
/// Destroy contents, and record that is empty.
|
|
||||||
void clear ();
|
|
||||||
|
|
||||||
/// Whether empty.
|
|
||||||
bool empty () const;
|
|
||||||
|
|
||||||
/// Destructive move, \a s is emptied into this.
|
|
||||||
void move (basic_symbol& s);
|
|
||||||
|
|
||||||
/// The semantic value.
|
|
||||||
semantic_type value;]b4_locations_if([
|
|
||||||
|
|
||||||
/// The location.
|
|
||||||
location_type location;])[
|
|
||||||
|
|
||||||
private:
|
|
||||||
#if defined __cplusplus && __cplusplus < 201103L
|
|
||||||
/// Assignment operator.
|
|
||||||
basic_symbol& operator= (const basic_symbol& other);
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Type access provider for token (enum) based symbols.
|
|
||||||
struct by_type
|
|
||||||
{
|
|
||||||
/// Default constructor.
|
|
||||||
by_type ();
|
|
||||||
|
|
||||||
/// Copy constructor.
|
|
||||||
by_type (const by_type& other);
|
|
||||||
|
|
||||||
/// The symbol type as needed by the constructor.
|
|
||||||
typedef token_type kind_type;
|
|
||||||
|
|
||||||
/// Constructor from (external) token numbers.
|
|
||||||
by_type (kind_type t);
|
|
||||||
|
|
||||||
/// Record that this symbol is empty.
|
|
||||||
void clear ();
|
|
||||||
|
|
||||||
/// Steal the symbol type from \a that.
|
|
||||||
void move (by_type& that);
|
|
||||||
|
|
||||||
/// The (internal) type number (corresponding to \a type).
|
|
||||||
/// \a empty when empty.
|
|
||||||
symbol_number_type type_get () const;
|
|
||||||
|
|
||||||
/// The token.
|
|
||||||
token_type token () const;
|
|
||||||
|
|
||||||
/// The symbol type.
|
|
||||||
/// \a empty_symbol when empty.
|
|
||||||
/// An int, not token_number_type, to be able to store empty_symbol.
|
|
||||||
int type;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// "External" symbols: returned by the scanner.
|
|
||||||
typedef basic_symbol<by_type> symbol_type;
|
|
||||||
]])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_public_types_define(hh|cc)
|
|
||||||
# -----------------------------
|
|
||||||
# Provide the implementation needed by the public types.
|
|
||||||
m4_define([b4_public_types_define],
|
|
||||||
[ b4_inline([$1])b4_parser_class_name[::syntax_error::syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m)
|
|
||||||
: std::runtime_error (m)]b4_locations_if([
|
|
||||||
, location (l)])[
|
|
||||||
{}
|
|
||||||
|
|
||||||
// basic_symbol.
|
|
||||||
template <typename Base>
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()
|
|
||||||
: value ()]b4_locations_if([
|
|
||||||
, location ()])[
|
|
||||||
{}
|
|
||||||
|
|
||||||
template <typename Base>
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (YY_RVREF (basic_symbol) other)
|
|
||||||
: Base (YY_MOVE (other))
|
|
||||||
, value (]b4_variant_if([], [YY_MOVE (other.value)]))b4_locations_if([
|
|
||||||
, location (YY_MOVE (other.location))])[
|
|
||||||
{]b4_variant_if([
|
|
||||||
b4_symbol_variant([other.type_get ()], [value], [YY_MOVE_OR_COPY],
|
|
||||||
[YY_MOVE (other.value)])])[
|
|
||||||
}
|
|
||||||
|
|
||||||
]b4_variant_if([[
|
|
||||||
// Implementation of basic_symbol constructor for each type.
|
|
||||||
]b4_type_foreach([b4_basic_symbol_constructor_define])], [[
|
|
||||||
/// Constructor for valueless symbols.
|
|
||||||
template <typename Base>
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
|
||||||
[typename Base::kind_type t],
|
|
||||||
b4_locations_if([YY_MOVE_REF (location_type) l]))[)
|
|
||||||
: Base (t)
|
|
||||||
, value ()]b4_locations_if([
|
|
||||||
, location (l)])[
|
|
||||||
{}
|
|
||||||
|
|
||||||
template <typename Base>
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
|
||||||
[typename Base::kind_type t],
|
|
||||||
[YY_RVREF (semantic_type) v],
|
|
||||||
b4_locations_if([YY_RVREF (location_type) l]))[)
|
|
||||||
: Base (t)
|
|
||||||
, value (]b4_variant_if([], [YY_MOVE (v)])[)]b4_locations_if([
|
|
||||||
, location (YY_MOVE (l))])[
|
|
||||||
{]b4_variant_if([[
|
|
||||||
(void) v;
|
|
||||||
]b4_symbol_variant([this->type_get ()], [value], [YY_MOVE_OR_COPY], [YY_MOVE (v)])])[}]])[
|
|
||||||
|
|
||||||
template <typename Base>
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::~basic_symbol ()
|
|
||||||
{
|
|
||||||
clear ();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Base>
|
|
||||||
void
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::clear ()
|
|
||||||
{]b4_variant_if([[
|
|
||||||
// User destructor.
|
|
||||||
symbol_number_type yytype = this->type_get ();
|
|
||||||
basic_symbol<Base>& yysym = *this;
|
|
||||||
(void) yysym;
|
|
||||||
switch (yytype)
|
|
||||||
{
|
|
||||||
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
|
||||||
[ default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Type destructor.
|
|
||||||
]b4_symbol_variant([[yytype]], [[value]], [[template destroy]])])[
|
|
||||||
Base::clear ();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Base>
|
|
||||||
bool
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::empty () const
|
|
||||||
{
|
|
||||||
return Base::type_get () == empty_symbol;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Base>
|
|
||||||
void
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::move (basic_symbol& s)
|
|
||||||
{
|
|
||||||
super_type::move (s);
|
|
||||||
]b4_variant_if([b4_symbol_variant([this->type_get ()], [value], [move],
|
|
||||||
[YY_MOVE (s.value)])],
|
|
||||||
[value = YY_MOVE (s.value);])[]b4_locations_if([
|
|
||||||
location = YY_MOVE (s.location);])[
|
|
||||||
}
|
|
||||||
|
|
||||||
// by_type.
|
|
||||||
]b4_inline([$1])b4_parser_class_name[::by_type::by_type ()
|
|
||||||
: type (empty_symbol)
|
|
||||||
{}
|
|
||||||
|
|
||||||
]b4_inline([$1])b4_parser_class_name[::by_type::by_type (const by_type& other)
|
|
||||||
: type (other.type)
|
|
||||||
{}
|
|
||||||
|
|
||||||
]b4_inline([$1])b4_parser_class_name[::by_type::by_type (token_type t)
|
|
||||||
: type (yytranslate_ (t))
|
|
||||||
{}
|
|
||||||
|
|
||||||
]b4_inline([$1])[void
|
|
||||||
]b4_parser_class_name[::by_type::clear ()
|
|
||||||
{
|
|
||||||
type = empty_symbol;
|
|
||||||
}
|
|
||||||
|
|
||||||
]b4_inline([$1])[void
|
|
||||||
]b4_parser_class_name[::by_type::move (by_type& that)
|
|
||||||
{
|
|
||||||
type = that.type;
|
|
||||||
that.clear ();
|
|
||||||
}
|
|
||||||
|
|
||||||
]b4_inline([$1])[int
|
|
||||||
]b4_parser_class_name[::by_type::type_get () const
|
|
||||||
{
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
]b4_token_ctor_if([[
|
|
||||||
]b4_inline([$1])b4_parser_class_name[::token_type
|
|
||||||
]b4_parser_class_name[::by_type::token () const
|
|
||||||
{
|
|
||||||
// YYTOKNUM[NUM] -- (External) token number corresponding to the
|
|
||||||
// (internal) symbol number NUM (which must be that of a token). */
|
|
||||||
static
|
|
||||||
const ]b4_int_type_for([b4_toknum])[
|
|
||||||
yytoken_number_[] =
|
|
||||||
{
|
|
||||||
]b4_toknum[
|
|
||||||
};
|
|
||||||
return static_cast<token_type> (yytoken_number_[type]);
|
|
||||||
}
|
|
||||||
]])[]dnl
|
|
||||||
|
|
||||||
b4_symbol_constructor_define])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_symbol_constructor_declare
|
|
||||||
# b4_symbol_constructor_define
|
|
||||||
# -----------------------------
|
|
||||||
# Declare/define symbol constructors for all the value types.
|
|
||||||
# Use at class-level. Redefined in variant.hh.
|
|
||||||
m4_define([b4_symbol_constructor_declare], [])
|
|
||||||
m4_define([b4_symbol_constructor_define], [])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_yytranslate_define(cc|hh)
|
|
||||||
# ----------------------------
|
|
||||||
# Define yytranslate_. Sometimes used in the header file ($1=hh),
|
|
||||||
# sometimes in the cc file.
|
|
||||||
m4_define([b4_yytranslate_define],
|
|
||||||
[[ // Symbol number corresponding to token number t.
|
|
||||||
]b4_inline([$1])b4_parser_class_name[::token_number_type
|
|
||||||
]b4_parser_class_name[::yytranslate_ (]b4_token_ctor_if([token_type],
|
|
||||||
[int])[ t)
|
|
||||||
{
|
|
||||||
static
|
|
||||||
const token_number_type
|
|
||||||
translate_table[] =
|
|
||||||
{
|
|
||||||
]b4_translate[
|
|
||||||
};
|
|
||||||
const unsigned user_token_number_max_ = ]b4_user_token_number_max[;
|
|
||||||
const token_number_type undef_token_ = ]b4_undef_token_number[;
|
|
||||||
|
|
||||||
if (static_cast<int> (t) <= yyeof_)
|
|
||||||
return yyeof_;
|
|
||||||
else if (static_cast<unsigned> (t) <= user_token_number_max_)
|
|
||||||
return translate_table[t];
|
|
||||||
else
|
|
||||||
return undef_token_;
|
|
||||||
}
|
|
||||||
]])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_lhs_value([TYPE])
|
# b4_lhs_value([TYPE])
|
||||||
# --------------------
|
# --------------------
|
||||||
# Expansion of $<TYPE>$.
|
# Expansion of $<TYPE>$.
|
||||||
m4_define([b4_lhs_value],
|
m4_define([b4_lhs_value],
|
||||||
[b4_symbol_value([yyval], [$1])])
|
[(yyval[]m4_ifval([$1], [.$1]))])
|
||||||
|
|
||||||
|
|
||||||
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
|
# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
|
||||||
@@ -512,8 +110,7 @@ m4_define([b4_lhs_value],
|
|||||||
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
||||||
# symbols on RHS.
|
# symbols on RHS.
|
||||||
m4_define([b4_rhs_value],
|
m4_define([b4_rhs_value],
|
||||||
[b4_symbol_value([yysemantic_stack_@{($1) - ($2)@}], [$3])])
|
[(yysemantic_stack_@{($1) - ($2)@}m4_ifval([$3], [.$3]))])
|
||||||
|
|
||||||
|
|
||||||
# b4_lhs_location()
|
# b4_lhs_location()
|
||||||
# -----------------
|
# -----------------
|
||||||
@@ -550,63 +147,24 @@ m4_define([b4_parse_param_decl_1],
|
|||||||
# Extra initialisations of the constructor.
|
# Extra initialisations of the constructor.
|
||||||
m4_define([b4_parse_param_cons],
|
m4_define([b4_parse_param_cons],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[
|
[
|
||||||
b4_cc_constructor_calls(b4_parse_param)])])
|
b4_cc_constructor_calls(b4_parse_param)])])
|
||||||
m4_define([b4_cc_constructor_calls],
|
m4_define([b4_cc_constructor_calls],
|
||||||
[m4_map_sep([b4_cc_constructor_call], [,
|
[m4_map_sep([b4_cc_constructor_call], [,
|
||||||
], [$@])])
|
], [$@])])
|
||||||
m4_define([b4_cc_constructor_call],
|
m4_define([b4_cc_constructor_call],
|
||||||
[$2 ($2_yyarg)])
|
[$2 ($2_yyarg)])
|
||||||
|
|
||||||
# b4_parse_param_vars
|
# b4_parse_param_vars
|
||||||
# -------------------
|
# -------------------
|
||||||
# Extra instance variables.
|
# Extra instance variables.
|
||||||
m4_define([b4_parse_param_vars],
|
m4_define([b4_parse_param_vars],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[
|
[
|
||||||
// User arguments.
|
/* User arguments. */
|
||||||
b4_cc_var_decls(b4_parse_param)])])
|
b4_cc_var_decls(b4_parse_param)])])
|
||||||
m4_define([b4_cc_var_decls],
|
m4_define([b4_cc_var_decls],
|
||||||
[m4_map_sep([b4_cc_var_decl], [
|
[m4_map_sep([b4_cc_var_decl], [
|
||||||
], [$@])])
|
], [$@])])
|
||||||
m4_define([b4_cc_var_decl],
|
m4_define([b4_cc_var_decl],
|
||||||
[ $1;])
|
[ $1;])
|
||||||
|
|
||||||
|
|
||||||
## ---------##
|
|
||||||
## Values. ##
|
|
||||||
## ---------##
|
|
||||||
|
|
||||||
# b4_yylloc_default_define
|
|
||||||
# ------------------------
|
|
||||||
# Define YYLLOC_DEFAULT.
|
|
||||||
m4_define([b4_yylloc_default_define],
|
|
||||||
[[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
|
||||||
If N is 0, then set CURRENT to the empty location which ends
|
|
||||||
the previous symbol: RHS[0] (always defined). */
|
|
||||||
|
|
||||||
# ifndef YYLLOC_DEFAULT
|
|
||||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
|
||||||
do \
|
|
||||||
if (N) \
|
|
||||||
{ \
|
|
||||||
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
|
||||||
(Current).end = YYRHSLOC (Rhs, N).end; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
|
||||||
} \
|
|
||||||
while (/*CONSTCOND*/ false)
|
|
||||||
# endif
|
|
||||||
]])
|
|
||||||
|
|
||||||
## -------- ##
|
|
||||||
## Checks. ##
|
|
||||||
## -------- ##
|
|
||||||
|
|
||||||
b4_token_ctor_if([b4_variant_if([],
|
|
||||||
[b4_fatal_at(b4_percent_define_get_loc(api.token.constructor),
|
|
||||||
[cannot use '%s' without '%s'],
|
|
||||||
[%define api.token.constructor],
|
|
||||||
[%define api.value.type variant]))])])
|
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
-*- Autoconf -*-
|
|
||||||
|
|
||||||
# Common code for C-like languages (C, C++, Java, etc.)
|
|
||||||
|
|
||||||
# Copyright (C) 2012-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# _b4_comment(TEXT, OPEN, CONTINUE, END)
|
|
||||||
# --------------------------------------
|
|
||||||
# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines.
|
|
||||||
# Avoid adding indentation to the first line, as the indentation comes
|
|
||||||
# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]).
|
|
||||||
#
|
|
||||||
# Prefix all the output lines with PREFIX.
|
|
||||||
m4_define([_b4_comment],
|
|
||||||
[$2[]m4_bpatsubst(m4_expand([[$1]]), [
|
|
||||||
\(.\)], [
|
|
||||||
$3\1])$4])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_comment(TEXT, [PREFIX])
|
|
||||||
# --------------------------
|
|
||||||
# Put TEXT in comment. Prefix all the output lines with PREFIX.
|
|
||||||
m4_define([b4_comment],
|
|
||||||
[_b4_comment([$1], [$2/* ], [$2 ], [ */])])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# _b4_dollar_dollar(VALUE, FIELD, DEFAULT-FIELD)
|
|
||||||
# ----------------------------------------------
|
|
||||||
# If FIELD (or DEFAULT-FIELD) is non-null, return "VALUE.FIELD",
|
|
||||||
# otherwise just VALUE. Be sure to pass "(VALUE)" is VALUE is a
|
|
||||||
# pointer.
|
|
||||||
m4_define([_b4_dollar_dollar],
|
|
||||||
[b4_symbol_value([$1],
|
|
||||||
m4_if([$2], [[]],
|
|
||||||
[[$3]], [[$2]]))])
|
|
||||||
|
|
||||||
# b4_dollar_pushdef(VALUE-POINTER, DEFAULT-FIELD, LOCATION)
|
|
||||||
# b4_dollar_popdef
|
|
||||||
# ---------------------------------------------------------
|
|
||||||
# Define b4_dollar_dollar for VALUE and DEFAULT-FIELD,
|
|
||||||
# and b4_at_dollar for LOCATION.
|
|
||||||
m4_define([b4_dollar_pushdef],
|
|
||||||
[m4_pushdef([b4_dollar_dollar],
|
|
||||||
[_b4_dollar_dollar([$1], m4_dquote($][1), [$2])])dnl
|
|
||||||
m4_pushdef([b4_at_dollar], [$3])dnl
|
|
||||||
])
|
|
||||||
m4_define([b4_dollar_popdef],
|
|
||||||
[m4_popdef([b4_at_dollar])dnl
|
|
||||||
m4_popdef([b4_dollar_dollar])dnl
|
|
||||||
])
|
|
||||||
+1
-3
@@ -1,9 +1,7 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# C skeleton dispatching for Bison.
|
# C skeleton dispatching for Bison.
|
||||||
|
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
||||||
# Copyright (C) 2006-2007, 2009-2015, 2018 Free Software Foundation,
|
|
||||||
# Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1304
-1233
File diff suppressed because it is too large
Load Diff
+176
-147
@@ -1,6 +1,8 @@
|
|||||||
# C++ GLR skeleton for Bison
|
-*- C -*-
|
||||||
|
|
||||||
# Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
|
# C++ GLR skeleton for Bison
|
||||||
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
|
||||||
|
# Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +29,7 @@
|
|||||||
#
|
#
|
||||||
# The additional arguments are stored as members of the parser
|
# The additional arguments are stored as members of the parser
|
||||||
# object, yyparser. The C routines need to carry yyparser
|
# object, yyparser. The C routines need to carry yyparser
|
||||||
# throughout the C parser; that's easy: make yyparser an
|
# throughout the C parser; that easy: just let yyparser become an
|
||||||
# additional parse-param. But because the C++ skeleton needs to
|
# additional parse-param. But because the C++ skeleton needs to
|
||||||
# know the "real" original parse-param, we save them
|
# know the "real" original parse-param, we save them
|
||||||
# (b4_parse_param_orig). Note that b4_parse_param is overquoted
|
# (b4_parse_param_orig). Note that b4_parse_param is overquoted
|
||||||
@@ -37,17 +39,22 @@
|
|||||||
# The locations
|
# The locations
|
||||||
#
|
#
|
||||||
# We use location.cc just like lalr1.cc, but because glr.c stores
|
# We use location.cc just like lalr1.cc, but because glr.c stores
|
||||||
# the locations in a union, the position and location classes
|
# the locations in a (C++) union, the position and location classes
|
||||||
# must not have a constructor. Therefore, contrary to lalr1.cc, we
|
# must not have a constructor. Therefore, contrary to lalr1.cc, we
|
||||||
# must not define "b4_location_constructors". As a consequence the
|
# must not define "b4_location_constructors". As a consequence the
|
||||||
# user must initialize the first positions (in particular the
|
# user must initialize the first positions (in particular the
|
||||||
# filename member).
|
# filename member).
|
||||||
|
|
||||||
# We require a pure interface.
|
# We require a pure interface using locations.
|
||||||
|
m4_define([b4_locations_flag], [1])
|
||||||
m4_define([b4_pure_flag], [1])
|
m4_define([b4_pure_flag], [1])
|
||||||
|
|
||||||
|
# The header is mandatory.
|
||||||
|
b4_defines_if([],
|
||||||
|
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
|
||||||
|
|
||||||
m4_include(b4_pkgdatadir/[c++.m4])
|
m4_include(b4_pkgdatadir/[c++.m4])
|
||||||
b4_bison_locations_if([m4_include(b4_pkgdatadir/[location.cc])])
|
m4_include(b4_pkgdatadir/[location.cc])
|
||||||
|
|
||||||
m4_define([b4_parser_class_name],
|
m4_define([b4_parser_class_name],
|
||||||
[b4_percent_define_get([[parser_class_name]])])
|
[b4_percent_define_get([[parser_class_name]])])
|
||||||
@@ -55,109 +62,71 @@ m4_define([b4_parser_class_name],
|
|||||||
# Save the parse parameters.
|
# Save the parse parameters.
|
||||||
m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
|
m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
|
||||||
|
|
||||||
# b4_parse_param_wrap
|
|
||||||
# -------------------
|
|
||||||
# New ones.
|
|
||||||
m4_ifset([b4_parse_param],
|
|
||||||
[m4_define([b4_parse_param_wrap],
|
|
||||||
[[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]],]
|
|
||||||
m4_defn([b4_parse_param]))],
|
|
||||||
[m4_define([b4_parse_param_wrap],
|
|
||||||
[[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]]])
|
|
||||||
])
|
|
||||||
|
|
||||||
|
# b4_yy_symbol_print_generate
|
||||||
# b4_yy_symbol_print_define
|
# ---------------------------
|
||||||
# -------------------------
|
|
||||||
# Bypass the default implementation to generate the "yy_symbol_print"
|
# Bypass the default implementation to generate the "yy_symbol_print"
|
||||||
# and "yy_symbol_value_print" functions.
|
# and "yy_symbol_value_print" functions.
|
||||||
m4_define([b4_yy_symbol_print_define],
|
m4_define([b4_yy_symbol_print_generate],
|
||||||
[[
|
[[
|
||||||
/*--------------------.
|
/*--------------------.
|
||||||
| Print this symbol. |
|
| Print this symbol. |
|
||||||
`--------------------*/
|
`--------------------*/
|
||||||
|
|
||||||
]b4_function_define([yy_symbol_print],
|
]b4_c_ansi_function_def([yy_symbol_print],
|
||||||
[static void],
|
[static void],
|
||||||
[[FILE *], []],
|
[[FILE *], []],
|
||||||
[[int yytype], [yytype]],
|
[[int yytype], [yytype]],
|
||||||
[[const ]b4_namespace_ref::b4_parser_class_name[::semantic_type *yyvaluep],
|
[[const b4_namespace_ref::b4_parser_class_name::semantic_type *yyvaluep],
|
||||||
[yyvaluep]][]dnl
|
[yyvaluep]],
|
||||||
b4_locations_if([,
|
[[const b4_namespace_ref::b4_parser_class_name::location_type *yylocationp],
|
||||||
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
|
[yylocationp]],
|
||||||
[yylocationp]]]),
|
|
||||||
b4_parse_param)[
|
b4_parse_param)[
|
||||||
{
|
{
|
||||||
]b4_parse_param_use[]dnl
|
]b4_parse_param_use[]dnl
|
||||||
[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_locations_if([, yylocationp])[);
|
[ yyparser.yy_symbol_print_ (yytype, yyvaluep]b4_locations_if([, yylocationp])[);
|
||||||
}
|
}
|
||||||
]])[
|
]])
|
||||||
|
|
||||||
# Hijack the initial action to initialize the locations.
|
|
||||||
]b4_bison_locations_if([m4_define([b4_initial_action],
|
|
||||||
[yylloc.initialize ();]m4_ifdef([b4_initial_action], [
|
|
||||||
m4_defn([b4_initial_action])]))])[
|
|
||||||
|
|
||||||
# Hijack the post prologue to insert early definition of YYLLOC_DEFAULT
|
# Declare yyerror.
|
||||||
# and declaration of yyerror.
|
m4_append([b4_post_prologue],
|
||||||
]m4_append([b4_post_prologue],
|
[b4_syncline([@oline@], [@ofile@])
|
||||||
[b4_syncline([@oline@], [@ofile@])[
|
|
||||||
]b4_yylloc_default_define[
|
b4_c_ansi_function_decl([yyerror],
|
||||||
#define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc)
|
[static void],
|
||||||
]b4_function_declare([yyerror],
|
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||||
[static void],b4_locations_if([
|
|
||||||
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
|
|
||||||
[yylocationp]],])
|
|
||||||
b4_parse_param,
|
b4_parse_param,
|
||||||
[[const char* msg], [msg]])])
|
[[const char* msg], [msg]])])
|
||||||
|
|
||||||
|
|
||||||
#undef yynerrs
|
# Define yyerror.
|
||||||
#undef yychar
|
|
||||||
#undef yylval]b4_locations_if([
|
|
||||||
#undef yylloc])
|
|
||||||
|
|
||||||
m4_if(b4_prefix, [yy], [],
|
|
||||||
[[/* Substitute the variable and function names. */
|
|
||||||
#define yyparse ]b4_prefix[parse
|
|
||||||
#define yylex ]b4_prefix[lex
|
|
||||||
#define yyerror ]b4_prefix[error
|
|
||||||
#define yydebug ]b4_prefix[debug
|
|
||||||
]]b4_pure_if([], [[
|
|
||||||
#define yylval ]b4_prefix[lval
|
|
||||||
#define yychar ]b4_prefix[char
|
|
||||||
#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[
|
|
||||||
#define yylloc ]b4_prefix[lloc]])]))
|
|
||||||
|
|
||||||
# Hijack the epilogue to define implementations (yyerror, parser member
|
|
||||||
# functions etc.).
|
|
||||||
m4_append([b4_epilogue],
|
m4_append([b4_epilogue],
|
||||||
[b4_syncline([@oline@], [@ofile@])[
|
[b4_syncline([@oline@], [@ofile@])[
|
||||||
|
|
||||||
/*------------------.
|
/*------------------.
|
||||||
| Report an error. |
|
| Report an error. |
|
||||||
`------------------*/
|
`------------------*/
|
||||||
|
|
||||||
]b4_function_define([yyerror],
|
]b4_c_ansi_function_def([yyerror],
|
||||||
[static void],b4_locations_if([
|
[static void],
|
||||||
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp],
|
[[b4_namespace_ref::b4_parser_class_name::location_type *yylocationp], [yylocationp]],
|
||||||
[yylocationp]],])
|
|
||||||
b4_parse_param,
|
b4_parse_param,
|
||||||
[[const char* msg], [msg]])[
|
[[const char* msg], [msg]])[
|
||||||
{
|
{
|
||||||
]b4_parse_param_use[]dnl
|
]b4_parse_param_use[]dnl
|
||||||
[ yyparser.error (]b4_locations_if([[*yylocationp, ]])[msg);
|
[ yyparser.error (*yylocationp, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
]dnl In this section, the parse params are the original parse_params.
|
]dnl In this section, the parse param are the original parse_params.
|
||||||
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||||
[ /// Build a parser object.
|
[ /// Build a parser object.
|
||||||
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
||||||
:])[
|
:])[
|
||||||
#if ]b4_api_PREFIX[DEBUG
|
#if YYDEBUG
|
||||||
]m4_ifset([b4_parse_param], [ ], [ :])[yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false),
|
||||||
|
yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
||||||
#endif]b4_parse_param_cons[
|
#endif]b4_parse_param_cons[
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -172,34 +141,35 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
return ::yyparse (*this]b4_user_args[);
|
return ::yyparse (*this]b4_user_args[);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ]b4_api_PREFIX[DEBUG
|
#if YYDEBUG
|
||||||
/*--------------------.
|
/*--------------------.
|
||||||
| Print this symbol. |
|
| Print this symbol. |
|
||||||
`--------------------*/
|
`--------------------*/
|
||||||
|
|
||||||
void
|
inline void
|
||||||
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
|
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep]b4_locations_if([[,
|
const semantic_type* yyvaluep, const location_type* yylocationp)
|
||||||
const location_type* yylocationp]])[)
|
{
|
||||||
{]b4_locations_if([[
|
/* Pacify ``unused variable'' warnings. */
|
||||||
YYUSE (yylocationp);]])[
|
|
||||||
YYUSE (yyvaluep);
|
YYUSE (yyvaluep);
|
||||||
std::ostream& yyoutput = debug_stream ();
|
YYUSE (yylocationp);
|
||||||
std::ostream& yyo = yyoutput;
|
switch (yytype)
|
||||||
YYUSE (yyo);
|
{
|
||||||
]b4_symbol_actions([printer])[
|
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
|
||||||
|
[ default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
|
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep]b4_locations_if([[,
|
const semantic_type* yyvaluep, const location_type* yylocationp)
|
||||||
const location_type* yylocationp]])[)
|
|
||||||
{
|
{
|
||||||
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
|
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
|
||||||
<< ' ' << yytname[yytype] << " ("]b4_locations_if([[
|
<< ' ' << yytname[yytype] << " ("
|
||||||
<< *yylocationp << ": "]])[;
|
<< *yylocationp << ": ";
|
||||||
yy_symbol_value_print_ (yytype, yyvaluep]b4_locations_if([[, yylocationp]])[);
|
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
|
||||||
*yycdebug_ << ')';
|
*yycdebug_ << ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,49 +189,109 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
]b4_parser_class_name[::debug_level_type
|
]b4_parser_class_name[::debug_level_type
|
||||||
]b4_parser_class_name[::debug_level () const
|
]b4_parser_class_name[::debug_level () const
|
||||||
{
|
{
|
||||||
return yydebug;
|
return yydebug_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::set_debug_level (debug_level_type l)
|
]b4_parser_class_name[::set_debug_level (debug_level_type l)
|
||||||
{
|
{
|
||||||
// Actually, it is yydebug which is really used.
|
yydebug_ = l;
|
||||||
yydebug = l;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
]m4_popdef([b4_parse_param])dnl
|
]m4_popdef([b4_parse_param])dnl
|
||||||
b4_namespace_close
|
b4_namespace_close[
|
||||||
|
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
# Let glr.c believe that the user arguments include the parser itself.
|
||||||
|
m4_ifset([b4_parse_param],
|
||||||
|
[m4_pushdef([b4_parse_param],
|
||||||
|
m4_dquote([[[b4_namespace_ref::b4_parser_class_name& yyparser], [[yyparser]]],]
|
||||||
|
m4_defn([b4_parse_param])))],
|
||||||
|
[m4_pushdef([b4_parse_param],
|
||||||
|
[[[[b4_namespace_ref::b4_parser_class_name& yyparser], [[yyparser]]]]])
|
||||||
])
|
])
|
||||||
|
m4_include(b4_pkgdatadir/[glr.c])
|
||||||
|
m4_popdef([b4_parse_param])
|
||||||
|
|
||||||
|
m4_divert_push(0)
|
||||||
|
@output(b4_spec_defines_file@)
|
||||||
|
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||||
|
[2002, 2003, 2004, 2005, 2006])[
|
||||||
|
|
||||||
|
/* C++ GLR parser skeleton written by Akim Demaille. */
|
||||||
|
|
||||||
|
#ifndef PARSER_HEADER_H
|
||||||
|
# define PARSER_HEADER_H
|
||||||
|
|
||||||
|
]b4_percent_code_get([[requires]])[
|
||||||
|
|
||||||
# b4_shared_declarations(hh|cc)
|
|
||||||
# -----------------------------
|
|
||||||
# Declaration that might either go into the header (if --defines, $1 = hh)
|
|
||||||
# or in the implementation file.
|
|
||||||
m4_define([b4_shared_declarations],
|
|
||||||
[m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|
||||||
b4_percent_code_get([[requires]])[
|
|
||||||
#include <iostream>
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
]m4_ifdef([b4_location_file],
|
/* Using locations. */
|
||||||
[[# include ]b4_location_include])[
|
#define YYLSP_NEEDED ]b4_locations_flag[
|
||||||
|
|
||||||
]b4_null_define[
|
|
||||||
|
|
||||||
]b4_YYDEBUG_define[
|
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
]b4_bison_locations_if([m4_ifndef([b4_location_file],
|
class position;
|
||||||
[b4_location_define])])[
|
class location;
|
||||||
|
]b4_namespace_close[
|
||||||
|
|
||||||
|
#include "location.hh"
|
||||||
|
|
||||||
|
/* Enabling traces. */
|
||||||
|
#ifndef YYDEBUG
|
||||||
|
# define YYDEBUG ]b4_debug_flag[
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||||
|
If N is 0, then set CURRENT to the empty location which ends
|
||||||
|
the previous symbol: RHS[0] (always defined). */
|
||||||
|
|
||||||
|
#ifndef YYLLOC_DEFAULT
|
||||||
|
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||||
|
do \
|
||||||
|
if (N) \
|
||||||
|
{ \
|
||||||
|
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
||||||
|
(Current).end = YYRHSLOC (Rhs, N).end; \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
||||||
|
} \
|
||||||
|
while (/*CONSTCOND*/ 0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
]b4_namespace_open[
|
||||||
/// A Bison parser.
|
/// A Bison parser.
|
||||||
class ]b4_parser_class_name[
|
class ]b4_parser_class_name[
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
]b4_public_types_declare[
|
/// Symbol semantic values.
|
||||||
|
#ifndef YYSTYPE
|
||||||
|
]m4_ifdef([b4_stype],
|
||||||
|
[ union semantic_type
|
||||||
|
{
|
||||||
|
b4_user_stype
|
||||||
|
};],
|
||||||
|
[m4_if(b4_tag_seen_flag, 0,
|
||||||
|
[[ typedef int semantic_type;]],
|
||||||
|
[[ typedef YYSTYPE semantic_type;]])])[
|
||||||
|
#else
|
||||||
|
typedef YYSTYPE semantic_type;
|
||||||
|
#endif
|
||||||
|
/// Symbol locations.
|
||||||
|
typedef ]b4_percent_define_get([[location_type]])[ location_type;
|
||||||
|
/// Tokens.
|
||||||
|
struct token
|
||||||
|
{
|
||||||
|
]b4_token_enums(b4_tokens)[
|
||||||
|
};
|
||||||
|
/// Token type.
|
||||||
|
typedef token::yytokentype token_type;
|
||||||
|
|
||||||
/// Build a parser object.
|
/// Build a parser object.
|
||||||
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
||||||
@@ -283,66 +313,65 @@ b4_percent_code_get([[requires]])[
|
|||||||
/// Set the current debugging level.
|
/// Set the current debugging level.
|
||||||
void set_debug_level (debug_level_type l);
|
void set_debug_level (debug_level_type l);
|
||||||
|
|
||||||
public:
|
private:
|
||||||
/// Report a syntax error.]b4_locations_if([[
|
|
||||||
/// \param loc where the syntax error is found.]])[
|
|
||||||
/// \param msg a description of the syntax error.
|
|
||||||
virtual void error (]b4_locations_if([[const location_type& loc, ]])[const std::string& msg);
|
|
||||||
|
|
||||||
# if ]b4_api_PREFIX[DEBUG
|
public:
|
||||||
|
/// Report a syntax error.
|
||||||
|
/// \param loc where the syntax error is found.
|
||||||
|
/// \param msg a description of the syntax error.
|
||||||
|
virtual void error (const location_type& loc, const std::string& msg);
|
||||||
|
private:
|
||||||
|
|
||||||
|
#if YYDEBUG
|
||||||
public:
|
public:
|
||||||
/// \brief Report a symbol value on the debug stream.
|
/// \brief Report a symbol value on the debug stream.
|
||||||
/// \param yytype The token type.
|
/// \param yytype The token type.
|
||||||
/// \param yyvaluep Its semantic value.]b4_locations_if([[
|
/// \param yyvaluep Its semantic value.
|
||||||
/// \param yylocationp Its location.]])[
|
/// \param yylocationp Its location.
|
||||||
virtual void yy_symbol_value_print_ (int yytype,
|
virtual void yy_symbol_value_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep]b4_locations_if([[,
|
const semantic_type* yyvaluep,
|
||||||
const location_type* yylocationp]])[);
|
const location_type* yylocationp);
|
||||||
/// \brief Report a symbol on the debug stream.
|
/// \brief Report a symbol on the debug stream.
|
||||||
/// \param yytype The token type.
|
/// \param yytype The token type.
|
||||||
/// \param yyvaluep Its semantic value.]b4_locations_if([[
|
/// \param yyvaluep Its semantic value.
|
||||||
/// \param yylocationp Its location.]])[
|
/// \param yylocationp Its location.
|
||||||
virtual void yy_symbol_print_ (int yytype,
|
virtual void yy_symbol_print_ (int yytype,
|
||||||
const semantic_type* yyvaluep]b4_locations_if([[,
|
const semantic_type* yyvaluep,
|
||||||
const location_type* yylocationp]])[);
|
const location_type* yylocationp);
|
||||||
private:
|
private:
|
||||||
// Debugging.
|
/* Debugging. */
|
||||||
|
int yydebug_;
|
||||||
std::ostream* yycdebug_;
|
std::ostream* yycdebug_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/// \brief Reclaim the memory associated to a symbol.
|
||||||
|
/// \param yymsg Why this token is reclaimed.
|
||||||
|
/// \param yytype The symbol type.
|
||||||
|
/// \param yyvaluep Its semantic value.
|
||||||
|
/// \param yylocationp Its location.
|
||||||
|
inline void yydestruct_ (const char* yymsg,
|
||||||
|
int yytype,
|
||||||
|
semantic_type* yyvaluep,
|
||||||
|
location_type* yylocationp);
|
||||||
|
|
||||||
]b4_parse_param_vars[
|
]b4_parse_param_vars[
|
||||||
};
|
};
|
||||||
|
|
||||||
]dnl Redirections for glr.c.
|
]dnl Redirections for glr.c.
|
||||||
b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
||||||
[b4_token_defines])
|
[b4_token_defines(b4_tokens)])
|
||||||
[
|
[
|
||||||
#ifndef ]b4_api_PREFIX[STYPE
|
#ifndef YYSTYPE
|
||||||
# define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type
|
# define YYSTYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type
|
||||||
#endif
|
#endif
|
||||||
#ifndef ]b4_api_PREFIX[LTYPE
|
#ifndef YYLTYPE
|
||||||
# define ]b4_api_PREFIX[LTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type
|
# define YYLTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
]b4_percent_code_get([[provides]])[
|
|
||||||
]m4_popdef([b4_parse_param])dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
b4_defines_if(
|
]b4_percent_code_get([[provides]])[]dnl
|
||||||
[b4_output_begin([b4_spec_defines_file])
|
|
||||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
|
||||||
[2002-2015, 2018])[
|
|
||||||
|
|
||||||
// C++ GLR parser skeleton written by Akim Demaille.
|
[#endif /* ! defined PARSER_HEADER_H */]
|
||||||
|
m4_divert_pop(0)
|
||||||
]b4_cpp_guard_open([b4_spec_defines_file])[
|
|
||||||
]b4_shared_declarations[
|
|
||||||
]b4_cpp_guard_close([b4_spec_defines_file])[
|
|
||||||
]b4_output_end])
|
|
||||||
|
|
||||||
# Let glr.c (and b4_shared_declarations) believe that the user
|
|
||||||
# arguments include the parser itself.
|
|
||||||
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_wrap]))
|
|
||||||
m4_include(b4_pkgdatadir/[glr.c])
|
|
||||||
m4_popdef([b4_parse_param])
|
|
||||||
|
|||||||
+1
-2
@@ -1,8 +1,7 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# Java skeleton dispatching for Bison.
|
# Java skeleton dispatching for Bison.
|
||||||
|
# Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
# Copyright (C) 2007, 2009-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+57
-126
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Java language support for Bison
|
# Java language support for Bison
|
||||||
|
|
||||||
# Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc.
|
# Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,24 +17,12 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
m4_include(b4_pkgdatadir/[c-like.m4])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_list2(LIST1, LIST2)
|
|
||||||
# ----------------------
|
|
||||||
# Join two lists with a comma if necessary.
|
|
||||||
m4_define([b4_list2],
|
|
||||||
[$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_percent_define_get3(DEF, PRE, POST, NOT)
|
|
||||||
# -------------------------------------------
|
|
||||||
# Expand to the value of DEF surrounded by PRE and POST if it's %define'ed,
|
|
||||||
# otherwise NOT.
|
|
||||||
m4_define([b4_percent_define_get3],
|
|
||||||
[m4_ifval(m4_quote(b4_percent_define_get([$1])),
|
|
||||||
[$2[]b4_percent_define_get([$1])[]$3], [$4])])
|
|
||||||
|
|
||||||
|
# b4_comment(TEXT)
|
||||||
|
# ----------------
|
||||||
|
m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
||||||
|
], [
|
||||||
|
]) */])
|
||||||
|
|
||||||
|
|
||||||
# b4_flag_value(BOOLEAN-FLAG)
|
# b4_flag_value(BOOLEAN-FLAG)
|
||||||
@@ -56,20 +44,6 @@ m4_define([b4_abstract_if],
|
|||||||
[b4_percent_define_flag_if([abstract], [$1], [$2])])
|
[b4_percent_define_flag_if([abstract], [$1], [$2])])
|
||||||
|
|
||||||
|
|
||||||
# b4_final_if(TRUE, FALSE)
|
|
||||||
# ---------------------------
|
|
||||||
b4_percent_define_default([[final]], [[false]])
|
|
||||||
m4_define([b4_final_if],
|
|
||||||
[b4_percent_define_flag_if([final], [$1], [$2])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_strictfp_if(TRUE, FALSE)
|
|
||||||
# ---------------------------
|
|
||||||
b4_percent_define_default([[strictfp]], [[false]])
|
|
||||||
m4_define([b4_strictfp_if],
|
|
||||||
[b4_percent_define_flag_if([strictfp], [$1], [$2])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_lexer_if(TRUE, FALSE)
|
# b4_lexer_if(TRUE, FALSE)
|
||||||
# ------------------------
|
# ------------------------
|
||||||
m4_define([b4_lexer_if],
|
m4_define([b4_lexer_if],
|
||||||
@@ -79,7 +53,10 @@ m4_define([b4_lexer_if],
|
|||||||
# b4_identification
|
# b4_identification
|
||||||
# -----------------
|
# -----------------
|
||||||
m4_define([b4_identification],
|
m4_define([b4_identification],
|
||||||
[ /** Version number for the Bison executable that generated this parser. */
|
[/** Always <tt>true</tt>, identifies Bison output. */
|
||||||
|
public static final boolean bison = true;
|
||||||
|
|
||||||
|
/** Version number for the Bison executable that generated this parser. */
|
||||||
public static final String bisonVersion = "b4_version";
|
public static final String bisonVersion = "b4_version";
|
||||||
|
|
||||||
/** Name of the skeleton that generated this parser. */
|
/** Name of the skeleton that generated this parser. */
|
||||||
@@ -98,12 +75,12 @@ m4_define([b4_identification],
|
|||||||
m4_define([b4_int_type],
|
m4_define([b4_int_type],
|
||||||
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
|
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
|
||||||
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
||||||
[int])])
|
[int])])
|
||||||
|
|
||||||
# b4_int_type_for(NAME)
|
# b4_int_type_for(NAME)
|
||||||
# ---------------------
|
# ---------------------
|
||||||
# Return the smallest int type able to handle numbers ranging from
|
# Return the smallest int type able to handle numbers ranging from
|
||||||
# 'NAME_min' to 'NAME_max' (included).
|
# `NAME_min' to `NAME_max' (included).
|
||||||
m4_define([b4_int_type_for],
|
m4_define([b4_int_type_for],
|
||||||
[b4_int_type($1_min, $1_max)])
|
[b4_int_type($1_min, $1_max)])
|
||||||
|
|
||||||
@@ -112,45 +89,27 @@ m4_define([b4_int_type_for],
|
|||||||
m4_define([b4_null], [null])
|
m4_define([b4_null], [null])
|
||||||
|
|
||||||
|
|
||||||
# b4_typed_parser_table_define(TYPE, NAME, DATA, COMMENT)
|
|
||||||
# -------------------------------------------------------
|
|
||||||
m4_define([b4_typed_parser_table_define],
|
|
||||||
[m4_ifval([$4], [b4_comment([$4])
|
|
||||||
])dnl
|
|
||||||
[private static final ]$1[ yy$2_[] = yy$2_init();
|
|
||||||
private static final ]$1[[] yy$2_init()
|
|
||||||
{
|
|
||||||
return new ]$1[[]
|
|
||||||
{
|
|
||||||
]$3[
|
|
||||||
};
|
|
||||||
}]])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_integral_parser_table_define(NAME, DATA, COMMENT)
|
|
||||||
#-----------------------------------------------------
|
|
||||||
m4_define([b4_integral_parser_table_define],
|
|
||||||
[b4_typed_parser_table_define([b4_int_type_for([$2])], [$1], [$2], [$3])])
|
|
||||||
|
|
||||||
|
|
||||||
## ------------------------- ##
|
## ------------------------- ##
|
||||||
## Assigning token numbers. ##
|
## Assigning token numbers. ##
|
||||||
## ------------------------- ##
|
## ------------------------- ##
|
||||||
|
|
||||||
# b4_token_enum(TOKEN-NUM)
|
# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
|
||||||
# ------------------------
|
# ---------------------------------------
|
||||||
# Output the definition of this token as an enum.
|
# Output the definition of this token as an enum.
|
||||||
m4_define([b4_token_enum],
|
m4_define([b4_token_enum],
|
||||||
[b4_token_format([ /** Token number, to be returned by the scanner. */
|
[ /** Token number, to be returned by the scanner. */
|
||||||
static final int %s = %s;
|
public static final int $1 = $2;
|
||||||
], [$1])])
|
])
|
||||||
|
|
||||||
# b4_token_enums
|
|
||||||
# --------------
|
# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
|
||||||
|
# -----------------------------------------------------
|
||||||
# Output the definition of the tokens (if there are) as enums.
|
# Output the definition of the tokens (if there are) as enums.
|
||||||
m4_define([b4_token_enums],
|
m4_define([b4_token_enums],
|
||||||
[b4_any_token_visible_if([/* Tokens. */
|
[m4_if([$@], [[]], [],
|
||||||
b4_symbol_foreach([b4_token_enum])])])
|
[/* Tokens. */
|
||||||
|
m4_map([b4_token_enum], [$@])])
|
||||||
|
])
|
||||||
|
|
||||||
# b4-case(ID, CODE)
|
# b4-case(ID, CODE)
|
||||||
# -----------------
|
# -----------------
|
||||||
@@ -161,57 +120,29 @@ m4_define([b4_case], [ case $1:
|
|||||||
break;
|
break;
|
||||||
])
|
])
|
||||||
|
|
||||||
# b4_predicate_case(LABEL, CONDITIONS)
|
|
||||||
# ------------------------------------
|
|
||||||
m4_define([b4_predicate_case], [ case $1:
|
|
||||||
if (! ($2)) YYERROR;
|
|
||||||
break;
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
## -------- ##
|
|
||||||
## Checks. ##
|
|
||||||
## -------- ##
|
|
||||||
|
|
||||||
b4_percent_define_check_kind([[api.value.type]], [code], [deprecated])
|
|
||||||
|
|
||||||
b4_percent_define_check_kind([[annotations]], [code], [deprecated])
|
|
||||||
b4_percent_define_check_kind([[extends]], [code], [deprecated])
|
|
||||||
b4_percent_define_check_kind([[implements]], [code], [deprecated])
|
|
||||||
b4_percent_define_check_kind([[init_throws]], [code], [deprecated])
|
|
||||||
b4_percent_define_check_kind([[lex_throws]], [code], [deprecated])
|
|
||||||
b4_percent_define_check_kind([[parser_class_name]], [code], [deprecated])
|
|
||||||
b4_percent_define_check_kind([[throws]], [code], [deprecated])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Default values. ##
|
## Default values. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
m4_define([b4_yystype], [b4_percent_define_get([[api.value.type]])])
|
m4_define([b4_yystype], [b4_percent_define_get([[stype]])])
|
||||||
b4_percent_define_default([[api.value.type]], [[Object]])
|
b4_percent_define_default([[stype]], [[Object]])])
|
||||||
|
|
||||||
# %name-prefix
|
m4_define_default([[b4_prefix]], [[YY]])])
|
||||||
m4_define_default([b4_prefix], [[YY]])
|
b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser])])
|
||||||
|
|
||||||
b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser])
|
|
||||||
m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])])
|
m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])])
|
||||||
|
|
||||||
b4_percent_define_default([[lex_throws]], [[java.io.IOException]])
|
b4_percent_define_default([[lex_throws]], [[java.io.IOException]])])
|
||||||
m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])])
|
m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])])
|
||||||
|
|
||||||
b4_percent_define_default([[throws]], [])
|
b4_percent_define_default([[throws]], [b4_lex_throws])])
|
||||||
m4_define([b4_throws], [b4_percent_define_get([[throws]])])
|
m4_define([b4_throws], [b4_percent_define_get([[throws]])])
|
||||||
|
|
||||||
b4_percent_define_default([[init_throws]], [])
|
b4_percent_define_default([[location_type]], [Location])])
|
||||||
m4_define([b4_init_throws], [b4_percent_define_get([[init_throws]])])
|
m4_define([b4_location_type], [b4_percent_define_get([[location_type]])])
|
||||||
|
|
||||||
b4_percent_define_default([[api.location.type]], [Location])
|
b4_percent_define_default([[position_type]], [Position])])
|
||||||
m4_define([b4_location_type], [b4_percent_define_get([[api.location.type]])])
|
m4_define([b4_position_type], [b4_percent_define_get([[position_type]])])
|
||||||
|
|
||||||
b4_percent_define_default([[api.position.type]], [Position])
|
|
||||||
m4_define([b4_position_type], [b4_percent_define_get([[api.position.type]])])
|
|
||||||
|
|
||||||
|
|
||||||
## ----------------- ##
|
## ----------------- ##
|
||||||
@@ -257,24 +188,24 @@ m4_define([b4_rhs_location],
|
|||||||
# it to be single quoted. Same for b4_parse_param.
|
# it to be single quoted. Same for b4_parse_param.
|
||||||
|
|
||||||
# TODO: should be in bison.m4
|
# TODO: should be in bison.m4
|
||||||
m4_define_default([b4_lex_param], [[]])
|
m4_define_default([b4_lex_param], [[]]))
|
||||||
m4_define([b4_lex_param], b4_lex_param)
|
m4_define([b4_lex_param], b4_lex_param))
|
||||||
m4_define([b4_parse_param], b4_parse_param)
|
m4_define([b4_parse_param], b4_parse_param))
|
||||||
|
|
||||||
# b4_lex_param_decl
|
# b4_lex_param_decl
|
||||||
# -----------------
|
# -------------------
|
||||||
# Extra formal arguments of the constructor.
|
# Extra formal arguments of the constructor.
|
||||||
m4_define([b4_lex_param_decl],
|
m4_define([b4_lex_param_decl],
|
||||||
[m4_ifset([b4_lex_param],
|
[m4_ifset([b4_lex_param],
|
||||||
[b4_remove_comma([$1],
|
[b4_remove_comma([$1],
|
||||||
b4_param_decls(b4_lex_param))],
|
b4_param_decls(b4_lex_param))],
|
||||||
[$1])])
|
[$1])])
|
||||||
|
|
||||||
m4_define([b4_param_decls],
|
m4_define([b4_param_decls],
|
||||||
[m4_map([b4_param_decl], [$@])])
|
[m4_map([b4_param_decl], [$@])])
|
||||||
m4_define([b4_param_decl], [, $1])
|
m4_define([b4_param_decl], [, $1])
|
||||||
|
|
||||||
m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
m4_define([b4_remove_comma], [m4_ifval($1, [$1, ], [])m4_shiftn(2, $@)])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -284,21 +215,21 @@ m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
|||||||
m4_define([b4_parse_param_decl],
|
m4_define([b4_parse_param_decl],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[b4_remove_comma([$1],
|
[b4_remove_comma([$1],
|
||||||
b4_param_decls(b4_parse_param))],
|
b4_param_decls(b4_parse_param))],
|
||||||
[$1])])
|
[$1])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# b4_lex_param_call
|
# b4_lex_param_call
|
||||||
# -----------------
|
# -------------------
|
||||||
# Delegating the lexer parameters to the lexer constructor.
|
# Delegating the lexer parameters to the lexer constructor.
|
||||||
m4_define([b4_lex_param_call],
|
m4_define([b4_lex_param_call],
|
||||||
[m4_ifset([b4_lex_param],
|
[m4_ifset([b4_lex_param],
|
||||||
[b4_remove_comma([$1],
|
[b4_remove_comma([$1],
|
||||||
b4_param_calls(b4_lex_param))],
|
b4_param_calls(b4_lex_param))],
|
||||||
[$1])])
|
[$1])])
|
||||||
m4_define([b4_param_calls],
|
m4_define([b4_param_calls],
|
||||||
[m4_map([b4_param_call], [$@])])
|
[m4_map([b4_param_call], [$@])])
|
||||||
m4_define([b4_param_call], [, $2])
|
m4_define([b4_param_call], [, $2])
|
||||||
|
|
||||||
|
|
||||||
@@ -308,13 +239,13 @@ m4_define([b4_param_call], [, $2])
|
|||||||
# Extra initialisations of the constructor.
|
# Extra initialisations of the constructor.
|
||||||
m4_define([b4_parse_param_cons],
|
m4_define([b4_parse_param_cons],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[b4_constructor_calls(b4_parse_param)])])
|
[b4_constructor_calls(b4_parse_param)])])
|
||||||
|
|
||||||
m4_define([b4_constructor_calls],
|
m4_define([b4_constructor_calls],
|
||||||
[m4_map([b4_constructor_call], [$@])])
|
[m4_map([b4_constructor_call], [$@])])
|
||||||
m4_define([b4_constructor_call],
|
m4_define([b4_constructor_call],
|
||||||
[this.$2 = $2;
|
[this.$2 = $2;
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -323,15 +254,15 @@ m4_define([b4_constructor_call],
|
|||||||
# Extra instance variables.
|
# Extra instance variables.
|
||||||
m4_define([b4_parse_param_vars],
|
m4_define([b4_parse_param_vars],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[
|
[
|
||||||
/* User arguments. */
|
/* User arguments. */
|
||||||
b4_var_decls(b4_parse_param)])])
|
b4_var_decls(b4_parse_param)])])
|
||||||
|
|
||||||
m4_define([b4_var_decls],
|
m4_define([b4_var_decls],
|
||||||
[m4_map_sep([b4_var_decl], [
|
[m4_map_sep([b4_var_decl], [
|
||||||
], [$@])])
|
], [$@])])
|
||||||
m4_define([b4_var_decl],
|
m4_define([b4_var_decl],
|
||||||
[ protected final $1;])
|
[ protected final $1;])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -339,4 +270,4 @@ m4_define([b4_var_decl],
|
|||||||
# -----------------------
|
# -----------------------
|
||||||
# Expand to either an empty string or "throws THROWS".
|
# Expand to either an empty string or "throws THROWS".
|
||||||
m4_define([b4_maybe_throws],
|
m4_define([b4_maybe_throws],
|
||||||
[m4_ifval($1, [throws $1])])
|
[m4_ifval($1, [throws $1])])
|
||||||
|
|||||||
+791
-844
File diff suppressed because it is too large
Load Diff
+374
-570
File diff suppressed because it is too large
Load Diff
@@ -1,45 +0,0 @@
|
|||||||
## Copyright (C) 2002, 2005-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
## This program is free software: you can redistribute it and/or modify
|
|
||||||
## it under the terms of the GNU General Public License as published by
|
|
||||||
## the Free Software Foundation, either version 3 of the License, or
|
|
||||||
## (at your option) any later version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful,
|
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
## GNU General Public License for more details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License
|
|
||||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
dist_pkgdata_DATA = \
|
|
||||||
data/README \
|
|
||||||
data/bison.m4 \
|
|
||||||
data/c++-skel.m4 \
|
|
||||||
data/c++.m4 \
|
|
||||||
data/c-like.m4 \
|
|
||||||
data/c-skel.m4 \
|
|
||||||
data/c.m4 \
|
|
||||||
data/glr.c \
|
|
||||||
data/glr.cc \
|
|
||||||
data/java-skel.m4 \
|
|
||||||
data/java.m4 \
|
|
||||||
data/lalr1.cc \
|
|
||||||
data/lalr1.java \
|
|
||||||
data/location.cc \
|
|
||||||
data/stack.hh \
|
|
||||||
data/variant.hh \
|
|
||||||
data/yacc.c
|
|
||||||
|
|
||||||
m4sugardir = $(pkgdatadir)/m4sugar
|
|
||||||
dist_m4sugar_DATA = \
|
|
||||||
data/m4sugar/foreach.m4 \
|
|
||||||
data/m4sugar/m4sugar.m4
|
|
||||||
|
|
||||||
xsltdir = $(pkgdatadir)/xslt
|
|
||||||
dist_xslt_DATA = \
|
|
||||||
data/xslt/bison.xsl \
|
|
||||||
data/xslt/xml2dot.xsl \
|
|
||||||
data/xslt/xml2text.xsl \
|
|
||||||
data/xslt/xml2xhtml.xsl
|
|
||||||
+111
-199
@@ -1,6 +1,7 @@
|
|||||||
# C++ skeleton for Bison
|
# C++ skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
|
||||||
|
# Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,147 +16,110 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
m4_pushdef([b4_copyright_years],
|
# We do want M4 expansion after # for CPP macros.
|
||||||
[2002-2015, 2018])
|
m4_changecom()
|
||||||
|
m4_divert_push(0)dnl
|
||||||
|
@output(b4_dir_prefix[]position.hh@)
|
||||||
|
b4_copyright([Positions for Bison parsers in C++],
|
||||||
|
[2002, 2003, 2004, 2005, 2006])[
|
||||||
|
|
||||||
|
/**
|
||||||
|
** \file position.hh
|
||||||
|
** Define the ]b4_namespace_ref[::position class.
|
||||||
|
*/
|
||||||
|
|
||||||
# b4_position_file
|
#ifndef BISON_POSITION_HH
|
||||||
# ----------------
|
# define BISON_POSITION_HH
|
||||||
# Name of the file containing the position class, if we want this file.
|
|
||||||
b4_defines_if([b4_required_version_if([302], [],
|
|
||||||
[m4_define([b4_position_file], [position.hh])])])])
|
|
||||||
|
|
||||||
|
# include <iostream>
|
||||||
|
# include <string>
|
||||||
|
# include <algorithm>
|
||||||
|
|
||||||
# b4_location_file
|
]b4_namespace_open[
|
||||||
# ----------------
|
/// Abstract a position.
|
||||||
# Name of the file containing the position/location class,
|
|
||||||
# if we want this file.
|
|
||||||
b4_percent_define_check_file([b4_location_file],
|
|
||||||
[[api.location.file]],
|
|
||||||
b4_defines_if([[location.hh]]))
|
|
||||||
|
|
||||||
# b4_location_include
|
|
||||||
# -------------------
|
|
||||||
# If location.hh is to be generated, the name under which should it be
|
|
||||||
# included.
|
|
||||||
#
|
|
||||||
# b4_location_path
|
|
||||||
# ----------------
|
|
||||||
# The path to use for the CPP guard.
|
|
||||||
m4_ifdef([b4_location_file],
|
|
||||||
[m4_define([b4_location_include],
|
|
||||||
[b4_percent_define_get([[api.location.include]],
|
|
||||||
["b4_location_file"])])
|
|
||||||
m4_define([b4_location_path],
|
|
||||||
b4_percent_define_get([[api.location.include]],
|
|
||||||
["b4_dir_prefix[]b4_location_file"]))
|
|
||||||
m4_define([b4_location_path],
|
|
||||||
m4_substr(m4_defn([b4_location_path]), 1, m4_eval(m4_len(m4_defn([b4_location_path])) - 2)))
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# b4_location_define
|
|
||||||
# ------------------
|
|
||||||
# Define the position and location classes.
|
|
||||||
m4_define([b4_location_define],
|
|
||||||
[[ /// Abstract a position.
|
|
||||||
class position
|
class position
|
||||||
{
|
{
|
||||||
public:]m4_ifdef([b4_location_constructors], [[
|
public:
|
||||||
|
]m4_ifdef([b4_location_constructors], [
|
||||||
/// Construct a position.
|
/// Construct a position.
|
||||||
explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
|
position ()
|
||||||
unsigned l = ]b4_location_initial_line[u,
|
: filename (0), line (]b4_location_initial_line[), column (]b4_location_initial_column[)
|
||||||
unsigned c = ]b4_location_initial_column[u)
|
{
|
||||||
: filename (f)
|
}
|
||||||
, line (l)
|
|
||||||
, column (c)
|
|
||||||
{}
|
|
||||||
|
|
||||||
]])[
|
])[
|
||||||
/// Initialization.
|
/// Initialization.
|
||||||
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULLPTR,
|
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
|
||||||
unsigned l = ]b4_location_initial_line[u,
|
|
||||||
unsigned c = ]b4_location_initial_column[u)
|
|
||||||
{
|
{
|
||||||
filename = fn;
|
filename = fn;
|
||||||
line = l;
|
line = ]b4_location_initial_line[;
|
||||||
column = c;
|
column = ]b4_location_initial_column[;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \name Line and Column related manipulators
|
/** \name Line and Column related manipulators
|
||||||
** \{ */
|
** \{ */
|
||||||
|
public:
|
||||||
/// (line related) Advance to the COUNT next lines.
|
/// (line related) Advance to the COUNT next lines.
|
||||||
void lines (int count = 1)
|
inline void lines (int count = 1)
|
||||||
{
|
{
|
||||||
if (count)
|
column = ]b4_location_initial_column[;
|
||||||
{
|
line += count;
|
||||||
column = ]b4_location_initial_column[u;
|
|
||||||
line = add_ (line, count, ]b4_location_initial_line[);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// (column related) Advance to the COUNT next columns.
|
/// (column related) Advance to the COUNT next columns.
|
||||||
void columns (int count = 1)
|
inline void columns (int count = 1)
|
||||||
{
|
{
|
||||||
column = add_ (column, count, ]b4_location_initial_column[);
|
column = std::max (]b4_location_initial_column[u, column + count);
|
||||||
}
|
}
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
|
public:
|
||||||
/// File name to which this position refers.
|
/// File name to which this position refers.
|
||||||
]b4_percent_define_get([[filename_type]])[* filename;
|
]b4_percent_define_get([[filename_type]])[* filename;
|
||||||
/// Current line number.
|
/// Current line number.
|
||||||
unsigned line;
|
unsigned int line;
|
||||||
/// Current column number.
|
/// Current column number.
|
||||||
unsigned column;
|
unsigned int column;
|
||||||
|
|
||||||
private:
|
|
||||||
/// Compute max (min, lhs+rhs).
|
|
||||||
static unsigned add_ (unsigned lhs, int rhs, int min)
|
|
||||||
{
|
|
||||||
return static_cast<unsigned> (std::max (min,
|
|
||||||
static_cast<int> (lhs) + rhs));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Add \a width columns, in place.
|
/// Add and assign a position.
|
||||||
inline position&
|
inline const position&
|
||||||
operator+= (position& res, int width)
|
operator+= (position& res, const int width)
|
||||||
{
|
{
|
||||||
res.columns (width);
|
res.columns (width);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add \a width columns.
|
/// Add two position objects.
|
||||||
inline position
|
inline const position
|
||||||
operator+ (position res, int width)
|
operator+ (const position& begin, const int width)
|
||||||
{
|
{
|
||||||
|
position res = begin;
|
||||||
return res += width;
|
return res += width;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Subtract \a width columns, in place.
|
/// Add and assign a position.
|
||||||
inline position&
|
inline const position&
|
||||||
operator-= (position& res, int width)
|
operator-= (position& res, const int width)
|
||||||
{
|
{
|
||||||
return res += -width;
|
return res += -width;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Subtract \a width columns.
|
/// Add two position objects.
|
||||||
inline position
|
inline const position
|
||||||
operator- (position res, int width)
|
operator- (const position& begin, const int width)
|
||||||
{
|
{
|
||||||
return res -= width;
|
return begin + -width;
|
||||||
}
|
}
|
||||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||||
/// Compare two position objects.
|
/// Compare two position objects.
|
||||||
inline bool
|
inline bool
|
||||||
operator== (const position& pos1, const position& pos2)
|
operator== (const position& pos1, const position& pos2)
|
||||||
{
|
{
|
||||||
return (pos1.line == pos2.line
|
return
|
||||||
&& pos1.column == pos2.column
|
(pos1.filename == pos2.filename
|
||||||
&& (pos1.filename == pos2.filename
|
|| pos1.filename && pos2.filename && *pos1.filename == *pos2.filename)
|
||||||
|| (pos1.filename && pos2.filename
|
&& pos1.line == pos2.line && pos1.column == pos2.column;
|
||||||
&& *pos1.filename == *pos2.filename)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compare two position objects.
|
/// Compare two position objects.
|
||||||
@@ -169,47 +133,50 @@ m4_define([b4_location_define],
|
|||||||
** \param ostr the destination output stream
|
** \param ostr the destination output stream
|
||||||
** \param pos a reference to the position to redirect
|
** \param pos a reference to the position to redirect
|
||||||
*/
|
*/
|
||||||
template <typename YYChar>
|
inline std::ostream&
|
||||||
std::basic_ostream<YYChar>&
|
operator<< (std::ostream& ostr, const position& pos)
|
||||||
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
|
|
||||||
{
|
{
|
||||||
if (pos.filename)
|
if (pos.filename)
|
||||||
ostr << *pos.filename << ':';
|
ostr << *pos.filename << ':';
|
||||||
return ostr << pos.line << '.' << pos.column;
|
return ostr << pos.line << '.' << pos.column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
]b4_namespace_close[
|
||||||
|
#endif // not BISON_POSITION_HH]
|
||||||
|
@output(b4_dir_prefix[]location.hh@)
|
||||||
|
b4_copyright([Locations for Bison parsers in C++],
|
||||||
|
[2002, 2003, 2004, 2005, 2006])[
|
||||||
|
|
||||||
|
/**
|
||||||
|
** \file location.hh
|
||||||
|
** Define the ]b4_namespace_ref[::location class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BISON_LOCATION_HH
|
||||||
|
# define BISON_LOCATION_HH
|
||||||
|
|
||||||
|
# include <iostream>
|
||||||
|
# include <string>
|
||||||
|
# include "position.hh"
|
||||||
|
|
||||||
|
]b4_namespace_open[
|
||||||
|
|
||||||
/// Abstract a location.
|
/// Abstract a location.
|
||||||
class location
|
class location
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
]m4_ifdef([b4_location_constructors], [
|
]m4_ifdef([b4_location_constructors], [
|
||||||
/// Construct a location from \a b to \a e.
|
/// Construct a location.
|
||||||
location (const position& b, const position& e)
|
location ()
|
||||||
: begin (b)
|
: begin (), end ()
|
||||||
, end (e)
|
{
|
||||||
{}
|
}
|
||||||
|
|
||||||
/// Construct a 0-width location in \a p.
|
|
||||||
explicit location (const position& p = position ())
|
|
||||||
: begin (p)
|
|
||||||
, end (p)
|
|
||||||
{}
|
|
||||||
|
|
||||||
/// Construct a 0-width location in \a f, \a l, \a c.
|
|
||||||
explicit location (]b4_percent_define_get([[filename_type]])[* f,
|
|
||||||
unsigned l = ]b4_location_initial_line[u,
|
|
||||||
unsigned c = ]b4_location_initial_column[u)
|
|
||||||
: begin (f, l, c)
|
|
||||||
, end (f, l, c)
|
|
||||||
{}
|
|
||||||
|
|
||||||
])[
|
])[
|
||||||
/// Initialization.
|
/// Initialization.
|
||||||
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
|
inline void initialize (]b4_percent_define_get([[filename_type]])[* fn)
|
||||||
unsigned l = ]b4_location_initial_line[u,
|
|
||||||
unsigned c = ]b4_location_initial_column[u)
|
|
||||||
{
|
{
|
||||||
begin.initialize (f, l, c);
|
begin.initialize (fn);
|
||||||
end = begin;
|
end = begin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,19 +184,19 @@ m4_define([b4_location_define],
|
|||||||
** \{ */
|
** \{ */
|
||||||
public:
|
public:
|
||||||
/// Reset initial location to final location.
|
/// Reset initial location to final location.
|
||||||
void step ()
|
inline void step ()
|
||||||
{
|
{
|
||||||
begin = end;
|
begin = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extend the current location to the COUNT next columns.
|
/// Extend the current location to the COUNT next columns.
|
||||||
void columns (int count = 1)
|
inline void columns (unsigned int count = 1)
|
||||||
{
|
{
|
||||||
end += count;
|
end += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extend the current location to the COUNT next lines.
|
/// Extend the current location to the COUNT next lines.
|
||||||
void lines (int count = 1)
|
inline void lines (unsigned int count = 1)
|
||||||
{
|
{
|
||||||
end.lines (count);
|
end.lines (count);
|
||||||
}
|
}
|
||||||
@@ -243,42 +210,27 @@ m4_define([b4_location_define],
|
|||||||
position end;
|
position end;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Join two locations, in place.
|
/// Join two location objects to create a location.
|
||||||
inline location& operator+= (location& res, const location& end)
|
inline const location operator+ (const location& begin, const location& end)
|
||||||
{
|
{
|
||||||
|
location res = begin;
|
||||||
res.end = end.end;
|
res.end = end.end;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Join two locations.
|
/// Add two location objects.
|
||||||
inline location operator+ (location res, const location& end)
|
inline const location operator+ (const location& begin, unsigned int width)
|
||||||
{
|
|
||||||
return res += end;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Add \a width columns to the end position, in place.
|
|
||||||
inline location& operator+= (location& res, int width)
|
|
||||||
{
|
{
|
||||||
|
location res = begin;
|
||||||
res.columns (width);
|
res.columns (width);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add \a width columns to the end position.
|
/// Add and assign a location.
|
||||||
inline location operator+ (location res, int width)
|
inline location& operator+= (location& res, unsigned int width)
|
||||||
{
|
{
|
||||||
return res += width;
|
res.columns (width);
|
||||||
}
|
return res;
|
||||||
|
|
||||||
/// Subtract \a width columns to the end position, in place.
|
|
||||||
inline location& operator-= (location& res, int width)
|
|
||||||
{
|
|
||||||
return res += -width;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Subtract \a width columns to the end position.
|
|
||||||
inline location operator- (location res, int width)
|
|
||||||
{
|
|
||||||
return res -= width;
|
|
||||||
}
|
}
|
||||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||||
/// Compare two location objects.
|
/// Compare two location objects.
|
||||||
@@ -301,63 +253,23 @@ m4_define([b4_location_define],
|
|||||||
**
|
**
|
||||||
** Avoid duplicate information.
|
** Avoid duplicate information.
|
||||||
*/
|
*/
|
||||||
template <typename YYChar>
|
inline std::ostream& operator<< (std::ostream& ostr, const location& loc)
|
||||||
std::basic_ostream<YYChar>&
|
|
||||||
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
|
|
||||||
{
|
{
|
||||||
unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
|
position last = loc.end - 1;
|
||||||
ostr << loc.begin;
|
ostr << loc.begin;
|
||||||
if (loc.end.filename
|
if (last.filename
|
||||||
&& (!loc.begin.filename
|
&& (!loc.begin.filename
|
||||||
|| *loc.begin.filename != *loc.end.filename))
|
|| *loc.begin.filename != *last.filename))
|
||||||
ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col;
|
ostr << '-' << last;
|
||||||
else if (loc.begin.line < loc.end.line)
|
else if (loc.begin.line != last.line)
|
||||||
ostr << '-' << loc.end.line << '.' << end_col;
|
ostr << '-' << last.line << '.' << last.column;
|
||||||
else if (loc.begin.column < end_col)
|
else if (loc.begin.column != last.column)
|
||||||
ostr << '-' << end_col;
|
ostr << '-' << last.column;
|
||||||
return ostr;
|
return ostr;
|
||||||
}
|
}
|
||||||
]])
|
|
||||||
|
|
||||||
|
|
||||||
m4_ifdef([b4_position_file], [[
|
|
||||||
]b4_output_begin([b4_dir_prefix], [b4_position_file])[
|
|
||||||
// Starting with Bison 3.2, this file is useless: the structure it
|
|
||||||
// used to define is now defined in "]b4_location_file[".
|
|
||||||
//
|
|
||||||
// To get rid of this file:
|
|
||||||
// 1. add 'require "3.2"' (or newer) to your grammar file
|
|
||||||
// 2. remove references to this file from your build system
|
|
||||||
// 3. if you used to include it, include "]b4_location_file[" instead.
|
|
||||||
|
|
||||||
#include ]b4_location_include[
|
|
||||||
]b4_output_end[
|
|
||||||
]])
|
|
||||||
|
|
||||||
|
|
||||||
m4_ifdef([b4_location_file], [[
|
|
||||||
]b4_output_begin([b4_dir_prefix], [b4_location_file])[
|
|
||||||
]b4_copyright([Locations for Bison parsers in C++])[
|
|
||||||
|
|
||||||
/**
|
|
||||||
** \file ]b4_location_path[
|
|
||||||
** Define the ]b4_namespace_ref[::location class.
|
|
||||||
*/
|
|
||||||
|
|
||||||
]b4_cpp_guard_open([b4_location_path])[
|
|
||||||
|
|
||||||
# include <algorithm> // std::max
|
|
||||||
# include <iostream>
|
|
||||||
# include <string>
|
|
||||||
|
|
||||||
]b4_null_define[
|
|
||||||
|
|
||||||
]b4_namespace_open[
|
|
||||||
]b4_location_define[
|
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
]b4_cpp_guard_close([b4_location_path])[
|
|
||||||
]b4_output_end[
|
|
||||||
]])
|
|
||||||
|
|
||||||
|
#endif // not BISON_LOCATION_HH]
|
||||||
m4_popdef([b4_copyright_years])
|
m4_divert_pop(0)
|
||||||
|
m4_changecom([#])
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
../../submodules/autoconf/lib/m4sugar/foreach.m4
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
../../submodules/autoconf/lib/m4sugar/m4sugar.m4
|
|
||||||
File diff suppressed because it is too large
Load Diff
-146
@@ -1,146 +0,0 @@
|
|||||||
# C++ skeleton for Bison
|
|
||||||
|
|
||||||
# Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
|
|
||||||
# b4_stack_file
|
|
||||||
# -------------
|
|
||||||
# Name of the file containing the stack class, if we want this file.
|
|
||||||
b4_defines_if([b4_required_version_if([302], [],
|
|
||||||
[m4_define([b4_stack_file], [stack.hh])])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_stack_define
|
|
||||||
# ---------------
|
|
||||||
m4_define([b4_stack_define],
|
|
||||||
[[ /// A stack with random access from its top.
|
|
||||||
template <class T, class S = std::vector<T> >
|
|
||||||
class stack
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// Hide our reversed order.
|
|
||||||
typedef typename S::reverse_iterator iterator;
|
|
||||||
typedef typename S::const_reverse_iterator const_iterator;
|
|
||||||
typedef typename S::size_type size_type;
|
|
||||||
|
|
||||||
stack ()
|
|
||||||
{
|
|
||||||
seq_.reserve (200);
|
|
||||||
}
|
|
||||||
|
|
||||||
stack (size_type n)
|
|
||||||
: seq_ (n)
|
|
||||||
{}
|
|
||||||
|
|
||||||
/// Random access.
|
|
||||||
///
|
|
||||||
/// Index 0 returns the topmost element.
|
|
||||||
T&
|
|
||||||
operator[] (size_type i)
|
|
||||||
{
|
|
||||||
return seq_[seq_.size () - 1 - i];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Random access.
|
|
||||||
///
|
|
||||||
/// Index 0 returns the topmost element.
|
|
||||||
const T&
|
|
||||||
operator[] (size_type i) const
|
|
||||||
{
|
|
||||||
return seq_[seq_.size () - 1 - i];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Steal the contents of \a t.
|
|
||||||
///
|
|
||||||
/// Close to move-semantics.
|
|
||||||
void
|
|
||||||
push (YY_MOVE_REF (T) t)
|
|
||||||
{
|
|
||||||
seq_.push_back (T ());
|
|
||||||
operator[](0).move (t);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
pop (size_type n = 1)
|
|
||||||
{
|
|
||||||
for (; n; --n)
|
|
||||||
seq_.pop_back ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
clear ()
|
|
||||||
{
|
|
||||||
seq_.clear ();
|
|
||||||
}
|
|
||||||
|
|
||||||
size_type
|
|
||||||
size () const
|
|
||||||
{
|
|
||||||
return seq_.size ();
|
|
||||||
}
|
|
||||||
|
|
||||||
const_iterator
|
|
||||||
begin () const
|
|
||||||
{
|
|
||||||
return seq_.rbegin ();
|
|
||||||
}
|
|
||||||
|
|
||||||
const_iterator
|
|
||||||
end () const
|
|
||||||
{
|
|
||||||
return seq_.rend ();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
stack (const stack&);
|
|
||||||
stack& operator= (const stack&);
|
|
||||||
/// The wrapped container.
|
|
||||||
S seq_;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Present a slice of the top of a stack.
|
|
||||||
template <class T, class S = stack<T> >
|
|
||||||
class slice
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef typename S::size_type size_type;
|
|
||||||
slice (const S& stack, size_type range)
|
|
||||||
: stack_ (stack)
|
|
||||||
, range_ (range)
|
|
||||||
{}
|
|
||||||
|
|
||||||
const T&
|
|
||||||
operator[] (size_type i) const
|
|
||||||
{
|
|
||||||
return stack_[range_ - i];
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
const S& stack_;
|
|
||||||
size_type range_;
|
|
||||||
};
|
|
||||||
]])
|
|
||||||
|
|
||||||
m4_ifdef([b4_stack_file],
|
|
||||||
[b4_output_begin([b4_dir_prefix], [b4_stack_file])[
|
|
||||||
// Starting with Bison 3.2, this file is useless: the structure it
|
|
||||||
// used to define is now defined with the parser itself.
|
|
||||||
//
|
|
||||||
// To get rid of this file:
|
|
||||||
// 1. add 'require "3.2"' (or newer) to your grammar file
|
|
||||||
// 2. remove references to this file from your build system.
|
|
||||||
]b4_output_end[
|
|
||||||
]])
|
|
||||||
-379
@@ -1,379 +0,0 @@
|
|||||||
# C++ skeleton for Bison
|
|
||||||
|
|
||||||
# Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
|
|
||||||
## --------- ##
|
|
||||||
## variant. ##
|
|
||||||
## --------- ##
|
|
||||||
|
|
||||||
# b4_symbol_variant(YYTYPE, YYVAL, ACTION, [ARGS])
|
|
||||||
# ------------------------------------------------
|
|
||||||
# Run some ACTION ("build", or "destroy") on YYVAL of symbol type
|
|
||||||
# YYTYPE.
|
|
||||||
m4_define([b4_symbol_variant],
|
|
||||||
[m4_pushdef([b4_dollar_dollar],
|
|
||||||
[$2.$3< $][3 > (m4_shift3($@))])dnl
|
|
||||||
switch ($1)
|
|
||||||
{
|
|
||||||
b4_type_foreach([_b4_type_action])[]dnl
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
m4_popdef([b4_dollar_dollar])dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# _b4_char_sizeof_counter
|
|
||||||
# -----------------------
|
|
||||||
# A counter used by _b4_char_sizeof_dummy to create fresh symbols.
|
|
||||||
m4_define([_b4_char_sizeof_counter],
|
|
||||||
[0])
|
|
||||||
|
|
||||||
# _b4_char_sizeof_dummy
|
|
||||||
# ---------------------
|
|
||||||
# At each call return a new C++ identifier.
|
|
||||||
m4_define([_b4_char_sizeof_dummy],
|
|
||||||
[m4_define([_b4_char_sizeof_counter], m4_incr(_b4_char_sizeof_counter))dnl
|
|
||||||
dummy[]_b4_char_sizeof_counter])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_char_sizeof(SYMBOL-NUMS)
|
|
||||||
# ---------------------------
|
|
||||||
# To be mapped on the list of type names to produce:
|
|
||||||
#
|
|
||||||
# char dummy1[sizeof (type_name_1)];
|
|
||||||
# char dummy2[sizeof (type_name_2)];
|
|
||||||
#
|
|
||||||
# for defined type names.
|
|
||||||
m4_define([b4_char_sizeof],
|
|
||||||
[b4_symbol_if([$1], [has_type],
|
|
||||||
[
|
|
||||||
m4_map([ b4_symbol_tag_comment], [$@])dnl
|
|
||||||
char _b4_char_sizeof_dummy@{sizeof (b4_symbol([$1], [type]))@};
|
|
||||||
])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_variant_includes
|
|
||||||
# -------------------
|
|
||||||
# The needed includes for variants support.
|
|
||||||
m4_define([b4_variant_includes],
|
|
||||||
[b4_parse_assert_if([[#include <typeinfo>]])[
|
|
||||||
#ifndef YYASSERT
|
|
||||||
# include <cassert>
|
|
||||||
# define YYASSERT assert
|
|
||||||
#endif
|
|
||||||
]])
|
|
||||||
|
|
||||||
# b4_variant_define
|
|
||||||
# -----------------
|
|
||||||
# Define "variant".
|
|
||||||
m4_define([b4_variant_define],
|
|
||||||
[[ /// A char[S] buffer to store and retrieve objects.
|
|
||||||
///
|
|
||||||
/// Sort of a variant, but does not keep track of the nature
|
|
||||||
/// of the stored data, since that knowledge is available
|
|
||||||
/// via the current state.
|
|
||||||
template <size_t S>
|
|
||||||
struct variant
|
|
||||||
{
|
|
||||||
/// Type of *this.
|
|
||||||
typedef variant<S> self_type;
|
|
||||||
|
|
||||||
/// Empty construction.
|
|
||||||
variant ()
|
|
||||||
: yybuffer_ ()]b4_parse_assert_if([
|
|
||||||
, yytypeid_ (YY_NULLPTR)])[
|
|
||||||
{}
|
|
||||||
|
|
||||||
/// Construct and fill.
|
|
||||||
template <typename T>
|
|
||||||
variant (YY_RVREF (T) t)]b4_parse_assert_if([
|
|
||||||
: yytypeid_ (&typeid (T))])[
|
|
||||||
{
|
|
||||||
YYASSERT (sizeof (T) <= S);
|
|
||||||
new (yyas_<T> ()) T (YY_MOVE (t));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Destruction, allowed only if empty.
|
|
||||||
~variant ()
|
|
||||||
{]b4_parse_assert_if([
|
|
||||||
YYASSERT (!yytypeid_);
|
|
||||||
])[}
|
|
||||||
|
|
||||||
/// Instantiate an empty \a T in here.
|
|
||||||
template <typename T>
|
|
||||||
T&
|
|
||||||
build ()
|
|
||||||
{]b4_parse_assert_if([
|
|
||||||
YYASSERT (!yytypeid_);
|
|
||||||
YYASSERT (sizeof (T) <= S);
|
|
||||||
yytypeid_ = & typeid (T);])[
|
|
||||||
return *new (yyas_<T> ()) T ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Instantiate a \a T in here from \a t.
|
|
||||||
template <typename T>
|
|
||||||
T&
|
|
||||||
build (const T& t)
|
|
||||||
{]b4_parse_assert_if([
|
|
||||||
YYASSERT (!yytypeid_);
|
|
||||||
YYASSERT (sizeof (T) <= S);
|
|
||||||
yytypeid_ = & typeid (T);])[
|
|
||||||
return *new (yyas_<T> ()) T (t);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Accessor to a built \a T.
|
|
||||||
template <typename T>
|
|
||||||
T&
|
|
||||||
as ()
|
|
||||||
{]b4_parse_assert_if([
|
|
||||||
YYASSERT (yytypeid_);
|
|
||||||
YYASSERT (*yytypeid_ == typeid (T));
|
|
||||||
YYASSERT (sizeof (T) <= S);])[
|
|
||||||
return *yyas_<T> ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Const accessor to a built \a T (for %printer).
|
|
||||||
template <typename T>
|
|
||||||
const T&
|
|
||||||
as () const
|
|
||||||
{]b4_parse_assert_if([
|
|
||||||
YYASSERT (yytypeid_);
|
|
||||||
YYASSERT (*yytypeid_ == typeid (T));
|
|
||||||
YYASSERT (sizeof (T) <= S);])[
|
|
||||||
return *yyas_<T> ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Swap the content with \a other, of same type.
|
|
||||||
///
|
|
||||||
/// Both variants must be built beforehand, because swapping the actual
|
|
||||||
/// data requires reading it (with as()), and this is not possible on
|
|
||||||
/// unconstructed variants: it would require some dynamic testing, which
|
|
||||||
/// should not be the variant's responsibility.
|
|
||||||
/// Swapping between built and (possibly) non-built is done with
|
|
||||||
/// variant::move ().
|
|
||||||
template <typename T>
|
|
||||||
void
|
|
||||||
swap (self_type& other)
|
|
||||||
{]b4_parse_assert_if([
|
|
||||||
YYASSERT (yytypeid_);
|
|
||||||
YYASSERT (*yytypeid_ == *other.yytypeid_);])[
|
|
||||||
std::swap (as<T> (), other.as<T> ());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Move the content of \a other to this.
|
|
||||||
///
|
|
||||||
/// Destroys \a other.
|
|
||||||
template <typename T>
|
|
||||||
void
|
|
||||||
move (self_type& other)
|
|
||||||
{
|
|
||||||
build<T> ();
|
|
||||||
# if defined __cplusplus && 201103L <= __cplusplus
|
|
||||||
as<T> () = YY_MOVE (other.as<T> ());
|
|
||||||
# else
|
|
||||||
swap<T> (other);
|
|
||||||
# endif
|
|
||||||
other.destroy<T> ();
|
|
||||||
}
|
|
||||||
|
|
||||||
# if defined __cplusplus && 201103L <= __cplusplus
|
|
||||||
/// Move the content of \a other to this.
|
|
||||||
template <typename T>
|
|
||||||
void
|
|
||||||
move (self_type&& other)
|
|
||||||
{
|
|
||||||
build<T> ();
|
|
||||||
as<T> () = YY_MOVE (other.as<T> ());
|
|
||||||
other.destroy<T> ();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Copy the content of \a other to this.
|
|
||||||
template <typename T>
|
|
||||||
void
|
|
||||||
copy (const self_type& other)
|
|
||||||
{
|
|
||||||
build<T> (other.as<T> ());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Destroy the stored \a T.
|
|
||||||
template <typename T>
|
|
||||||
void
|
|
||||||
destroy ()
|
|
||||||
{
|
|
||||||
as<T> ().~T ();]b4_parse_assert_if([
|
|
||||||
yytypeid_ = YY_NULLPTR;])[
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
/// Prohibit blind copies.
|
|
||||||
self_type& operator= (const self_type&);
|
|
||||||
variant (const self_type&);
|
|
||||||
|
|
||||||
/// Accessor to raw memory as \a T.
|
|
||||||
template <typename T>
|
|
||||||
T*
|
|
||||||
yyas_ ()
|
|
||||||
{
|
|
||||||
void *yyp = yybuffer_.yyraw;
|
|
||||||
return static_cast<T*> (yyp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Const accessor to raw memory as \a T.
|
|
||||||
template <typename T>
|
|
||||||
const T*
|
|
||||||
yyas_ () const
|
|
||||||
{
|
|
||||||
const void *yyp = yybuffer_.yyraw;
|
|
||||||
return static_cast<const T*> (yyp);
|
|
||||||
}
|
|
||||||
|
|
||||||
union
|
|
||||||
{
|
|
||||||
/// Strongest alignment constraints.
|
|
||||||
long double yyalign_me;
|
|
||||||
/// A buffer large enough to store any of the semantic values.
|
|
||||||
char yyraw[S];
|
|
||||||
} yybuffer_;]b4_parse_assert_if([
|
|
||||||
|
|
||||||
/// Whether the content is built: if defined, the name of the stored type.
|
|
||||||
const std::type_info *yytypeid_;])[
|
|
||||||
};
|
|
||||||
]])
|
|
||||||
|
|
||||||
|
|
||||||
## -------------------------- ##
|
|
||||||
## Adjustments for variants. ##
|
|
||||||
## -------------------------- ##
|
|
||||||
|
|
||||||
|
|
||||||
# b4_value_type_declare
|
|
||||||
# ---------------------
|
|
||||||
# Declare semantic_type.
|
|
||||||
m4_define([b4_value_type_declare],
|
|
||||||
[[ /// An auxiliary type to compute the largest semantic type.
|
|
||||||
union union_type
|
|
||||||
{]b4_type_foreach([b4_char_sizeof])[};
|
|
||||||
|
|
||||||
/// Symbol semantic values.
|
|
||||||
typedef variant<sizeof (union_type)> semantic_type;][]dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# How the semantic value is extracted when using variants.
|
|
||||||
|
|
||||||
# b4_symbol_value(VAL, [TYPE])
|
|
||||||
# ----------------------------
|
|
||||||
m4_define([b4_symbol_value],
|
|
||||||
[m4_ifval([$2],
|
|
||||||
[$1.as< $2 > ()],
|
|
||||||
[$1])])
|
|
||||||
|
|
||||||
# b4_symbol_value_template(VAL, [TYPE])
|
|
||||||
# -------------------------------------
|
|
||||||
# Same as b4_symbol_value, but used in a template method.
|
|
||||||
m4_define([b4_symbol_value_template],
|
|
||||||
[m4_ifval([$2],
|
|
||||||
[$1.template as< $2 > ()],
|
|
||||||
[$1])])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ------------- ##
|
|
||||||
## make_SYMBOL. ##
|
|
||||||
## ------------- ##
|
|
||||||
|
|
||||||
|
|
||||||
# _b4_symbol_constructor_declare(SYMBOL-NUMBER)
|
|
||||||
# ---------------------------------------------
|
|
||||||
# Declare the overloaded version of make_symbol for the (common) type of
|
|
||||||
# these SYMBOL-NUMBERS. Use at class-level.
|
|
||||||
m4_define([_b4_symbol_constructor_declare],
|
|
||||||
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
|
|
||||||
[ static
|
|
||||||
symbol_type
|
|
||||||
make_[]_b4_symbol([$1], [id]) (dnl
|
|
||||||
b4_join(b4_symbol_if([$1], [has_type],
|
|
||||||
[YY_COPY (b4_symbol([$1], [type])) v]),
|
|
||||||
b4_locations_if([YY_COPY (location_type) l])));
|
|
||||||
|
|
||||||
])])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_symbol_constructor_declare
|
|
||||||
# -----------------------------
|
|
||||||
# Declare symbol constructors for all the value types.
|
|
||||||
# Use at class-level.
|
|
||||||
m4_define([b4_symbol_constructor_declare],
|
|
||||||
[ // Symbol constructors declarations.
|
|
||||||
b4_symbol_foreach([_b4_symbol_constructor_declare])])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# _b4_symbol_constructor_define(SYMBOL-NUMBER)
|
|
||||||
# --------------------------------------------
|
|
||||||
# Define symbol constructor for this SYMBOL-NUMBER.
|
|
||||||
m4_define([_b4_symbol_constructor_define],
|
|
||||||
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
|
|
||||||
[ inline
|
|
||||||
b4_parser_class_name::symbol_type
|
|
||||||
b4_parser_class_name::make_[]_b4_symbol([$1], [id]) (dnl
|
|
||||||
b4_join(b4_symbol_if([$1], [has_type],
|
|
||||||
[YY_COPY (b4_symbol([$1], [type])) v]),
|
|
||||||
b4_locations_if([YY_COPY (location_type) l])))
|
|
||||||
{
|
|
||||||
return symbol_type (b4_join([token::b4_symbol([$1], [id])],
|
|
||||||
b4_symbol_if([$1], [has_type], [YY_MOVE (v)]),
|
|
||||||
b4_locations_if([YY_MOVE (l)])));
|
|
||||||
}
|
|
||||||
|
|
||||||
])])])
|
|
||||||
|
|
||||||
|
|
||||||
# b4_basic_symbol_constructor_declare
|
|
||||||
# -----------------------------------
|
|
||||||
# Generate a constructor declaration for basic_symbol from given type.
|
|
||||||
m4_define([b4_basic_symbol_constructor_declare],
|
|
||||||
[[ basic_symbol (]b4_join(
|
|
||||||
[typename Base::kind_type t],
|
|
||||||
b4_symbol_if([$1], [has_type], [YY_RVREF (b4_symbol([$1], [type])) v]),
|
|
||||||
b4_locations_if([YY_RVREF (location_type) l]))[);
|
|
||||||
]])
|
|
||||||
|
|
||||||
# b4_basic_symbol_constructor_define
|
|
||||||
# ----------------------------------
|
|
||||||
# Generate a constructor implementation for basic_symbol from given type.
|
|
||||||
m4_define([b4_basic_symbol_constructor_define],
|
|
||||||
[[ template <typename Base>
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
|
||||||
[typename Base::kind_type t],
|
|
||||||
b4_symbol_if([$1], [has_type], [YY_RVREF (b4_symbol([$1], [type])) v]),
|
|
||||||
b4_locations_if([YY_RVREF (location_type) l]))[)
|
|
||||||
: Base (t)]b4_symbol_if([$1], [has_type], [
|
|
||||||
, value (YY_MOVE (v))])[]b4_locations_if([
|
|
||||||
, location (YY_MOVE (l))])[
|
|
||||||
{}
|
|
||||||
|
|
||||||
]])
|
|
||||||
|
|
||||||
# b4_symbol_constructor_define
|
|
||||||
# ----------------------------
|
|
||||||
# Define the overloaded versions of make_symbol for all the value types.
|
|
||||||
m4_define([b4_symbol_constructor_define],
|
|
||||||
[ // Implementation of make_symbol for each symbol type.
|
|
||||||
b4_symbol_foreach([_b4_symbol_constructor_define])])
|
|
||||||
+2
-13
@@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
bison.xsl - common templates for Bison XSLT.
|
bison.xsl - common templates for Bison XSLT.
|
||||||
|
$Id$
|
||||||
|
|
||||||
Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc.
|
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -90,16 +91,4 @@
|
|||||||
<xsl:value-of select="string-length(translate($conflict-data, 's', ''))"/>
|
<xsl:value-of select="string-length(translate($conflict-data, 's', ''))"/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="space">
|
|
||||||
<xsl:param name="repeat">0</xsl:param>
|
|
||||||
<xsl:param name="fill" select="' '"/>
|
|
||||||
<xsl:if test="number($repeat) >= 1">
|
|
||||||
<xsl:call-template name="space">
|
|
||||||
<xsl:with-param name="repeat" select="$repeat - 1"/>
|
|
||||||
<xsl:with-param name="fill" select="$fill"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:value-of select="$fill"/>
|
|
||||||
</xsl:if>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|||||||
+24
-218
@@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||||
|
$Id$
|
||||||
|
|
||||||
Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc.
|
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -35,31 +36,11 @@
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="bison-xml-report">
|
<xsl:template match="bison-xml-report">
|
||||||
<xsl:text>// Generated by GNU Bison </xsl:text>
|
<xsl:apply-templates select="automaton"/>
|
||||||
<xsl:value-of select="@version"/>
|
|
||||||
<xsl:text>. </xsl:text>
|
|
||||||
<xsl:text>// Report bugs to <</xsl:text>
|
|
||||||
<xsl:value-of select="@bug-report"/>
|
|
||||||
<xsl:text>>. </xsl:text>
|
|
||||||
<xsl:text>// Home page: <</xsl:text>
|
|
||||||
<xsl:value-of select="@url"/>
|
|
||||||
<xsl:text>>. </xsl:text>
|
|
||||||
<xsl:apply-templates select="automaton">
|
|
||||||
<xsl:with-param name="filename" select="filename"/>
|
|
||||||
</xsl:apply-templates>
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="automaton">
|
<xsl:template match="automaton">
|
||||||
<xsl:param name="filename"/>
|
<xsl:text>digraph Automaton { </xsl:text>
|
||||||
<xsl:text>digraph "</xsl:text>
|
|
||||||
<xsl:call-template name="escape">
|
|
||||||
<xsl:with-param name="subject" select="$filename"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:text>" {
|
|
||||||
node [fontname = courier, shape = box, colorscheme = paired6]
|
|
||||||
edge [fontname = courier]
|
|
||||||
|
|
||||||
</xsl:text>
|
|
||||||
<xsl:apply-templates select="state"/>
|
<xsl:apply-templates select="state"/>
|
||||||
<xsl:text>} </xsl:text>
|
<xsl:text>} </xsl:text>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
@@ -68,87 +49,11 @@
|
|||||||
<xsl:call-template name="output-node">
|
<xsl:call-template name="output-node">
|
||||||
<xsl:with-param name="number" select="@number"/>
|
<xsl:with-param name="number" select="@number"/>
|
||||||
<xsl:with-param name="label">
|
<xsl:with-param name="label">
|
||||||
|
<xsl:value-of select="@number"/>
|
||||||
<xsl:apply-templates select="itemset/item"/>
|
<xsl:apply-templates select="itemset/item"/>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:apply-templates select="actions/transitions"/>
|
<xsl:apply-templates select="actions/transitions"/>
|
||||||
<xsl:apply-templates select="actions/reductions">
|
|
||||||
<xsl:with-param name="staten">
|
|
||||||
<xsl:value-of select="@number"/>
|
|
||||||
</xsl:with-param>
|
|
||||||
</xsl:apply-templates>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="actions/reductions">
|
|
||||||
<xsl:param name="staten"/>
|
|
||||||
<xsl:for-each select='reduction'>
|
|
||||||
<!-- These variables are needed because the current context can't be
|
|
||||||
refered to directly in XPath expressions. -->
|
|
||||||
<xsl:variable name="rul">
|
|
||||||
<xsl:value-of select="@rule"/>
|
|
||||||
</xsl:variable>
|
|
||||||
<xsl:variable name="ena">
|
|
||||||
<xsl:value-of select="@enabled"/>
|
|
||||||
</xsl:variable>
|
|
||||||
<!-- The foreach's body is protected by this, so that we are actually
|
|
||||||
going to iterate once per reduction rule, and not per lookahead. -->
|
|
||||||
<xsl:if test='not(preceding-sibling::*[@rule=$rul and @enabled=$ena])'>
|
|
||||||
<xsl:variable name="rule">
|
|
||||||
<xsl:choose>
|
|
||||||
<!-- The acceptation state is refered to as 'accept' in the XML, but
|
|
||||||
just as '0' in the DOT. -->
|
|
||||||
<xsl:when test="@rule='accept'">
|
|
||||||
<xsl:text>0</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:value-of select="@rule"/>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:variable>
|
|
||||||
|
|
||||||
<!-- The edge's beginning -->
|
|
||||||
<xsl:call-template name="reduction-edge-start">
|
|
||||||
<xsl:with-param name="state" select="$staten"/>
|
|
||||||
<xsl:with-param name="rule" select="$rule"/>
|
|
||||||
<xsl:with-param name="enabled" select="@enabled"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
|
|
||||||
<!-- The edge's tokens -->
|
|
||||||
<!-- Don't show labels for the default action. In other cases, there will
|
|
||||||
always be at least one token, so 'label="[]"' will not occur. -->
|
|
||||||
<xsl:if test='$rule!=0 and not(../reduction[@enabled=$ena and @rule=$rule and @symbol="$default"])'>
|
|
||||||
<xsl:text>label="[</xsl:text>
|
|
||||||
<xsl:for-each select='../reduction[@enabled=$ena and @rule=$rule]'>
|
|
||||||
<xsl:call-template name="escape">
|
|
||||||
<xsl:with-param name="subject" select="@symbol"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:if test="position() != last ()">
|
|
||||||
<xsl:text>, </xsl:text>
|
|
||||||
</xsl:if>
|
|
||||||
</xsl:for-each>
|
|
||||||
<xsl:text>]", </xsl:text>
|
|
||||||
</xsl:if>
|
|
||||||
|
|
||||||
<!-- The edge's end -->
|
|
||||||
<xsl:text>style=solid] </xsl:text>
|
|
||||||
|
|
||||||
<!-- The diamond representing the reduction -->
|
|
||||||
<xsl:call-template name="reduction-node">
|
|
||||||
<xsl:with-param name="state" select="$staten"/>
|
|
||||||
<xsl:with-param name="rule" select="$rule"/>
|
|
||||||
<xsl:with-param name="color">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test='@enabled="true"'>
|
|
||||||
<xsl:text>3</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:text>5</xsl:text>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:with-param>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:if>
|
|
||||||
</xsl:for-each>
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="actions/transitions">
|
<xsl:template match="actions/transitions">
|
||||||
@@ -156,53 +61,20 @@
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="item">
|
<xsl:template match="item">
|
||||||
<xsl:param name="prev-rule-number"
|
|
||||||
select="preceding-sibling::item[1]/@rule-number"/>
|
|
||||||
<xsl:apply-templates select="key('bison:ruleByNumber', @rule-number)">
|
<xsl:apply-templates select="key('bison:ruleByNumber', @rule-number)">
|
||||||
<xsl:with-param name="point" select="@point"/>
|
<xsl:with-param name="point" select="@point"/>
|
||||||
<xsl:with-param name="num" select="@rule-number"/>
|
|
||||||
<xsl:with-param name="prev-lhs"
|
|
||||||
select="key('bison:ruleByNumber', $prev-rule-number)/lhs[text()]"
|
|
||||||
/>
|
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
<xsl:apply-templates select="lookaheads"/>
|
<xsl:apply-templates select="lookaheads"/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="rule">
|
<xsl:template match="rule">
|
||||||
<xsl:param name="point"/>
|
<xsl:param name="point"/>
|
||||||
<xsl:param name="num"/>
|
|
||||||
<xsl:param name="prev-lhs"/>
|
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:choose>
|
<xsl:value-of select="lhs"/>
|
||||||
<xsl:when test="$num < 10">
|
<xsl:text> -></xsl:text>
|
||||||
<xsl:text> </xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:when test="$num < 100">
|
|
||||||
<xsl:text> </xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:text></xsl:text>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:value-of select="$num"/>
|
|
||||||
<xsl:text> </xsl:text>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$prev-lhs = lhs[text()]">
|
|
||||||
<xsl:call-template name="lpad">
|
|
||||||
<xsl:with-param name="str" select="'|'"/>
|
|
||||||
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:value-of select="lhs"/>
|
|
||||||
<xsl:text>:</xsl:text>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:if test="$point = 0">
|
<xsl:if test="$point = 0">
|
||||||
<xsl:text> .</xsl:text>
|
<xsl:text> .</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
|
||||||
<!-- RHS -->
|
|
||||||
<xsl:for-each select="rhs/symbol|rhs/empty">
|
<xsl:for-each select="rhs/symbol|rhs/empty">
|
||||||
<xsl:apply-templates select="."/>
|
<xsl:apply-templates select="."/>
|
||||||
<xsl:if test="$point = position()">
|
<xsl:if test="$point = position()">
|
||||||
@@ -216,12 +88,10 @@
|
|||||||
<xsl:value-of select="."/>
|
<xsl:value-of select="."/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="empty">
|
<xsl:template match="empty"/>
|
||||||
<xsl:text> %empty</xsl:text>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="lookaheads">
|
<xsl:template match="lookaheads">
|
||||||
<xsl:text> [</xsl:text>
|
<xsl:text>[</xsl:text>
|
||||||
<xsl:apply-templates select="symbol"/>
|
<xsl:apply-templates select="symbol"/>
|
||||||
<xsl:text>]</xsl:text>
|
<xsl:text>]</xsl:text>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
@@ -233,70 +103,26 @@
|
|||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="reduction-edge-start">
|
|
||||||
<xsl:param name="state"/>
|
|
||||||
<xsl:param name="rule"/>
|
|
||||||
<xsl:param name="enabled"/>
|
|
||||||
|
|
||||||
<xsl:text> </xsl:text>
|
|
||||||
<xsl:value-of select="$state"/>
|
|
||||||
<xsl:text> -> "</xsl:text>
|
|
||||||
<xsl:value-of select="$state"/>
|
|
||||||
<xsl:text>R</xsl:text>
|
|
||||||
<xsl:value-of select="$rule"/>
|
|
||||||
<xsl:if test='$enabled = "false"'>
|
|
||||||
<xsl:text>d</xsl:text>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:text>" [</xsl:text>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template name="reduction-node">
|
|
||||||
<xsl:param name="state"/>
|
|
||||||
<xsl:param name="rule"/>
|
|
||||||
<xsl:param name="color"/>
|
|
||||||
|
|
||||||
<xsl:text> "</xsl:text>
|
|
||||||
<xsl:value-of select="$state"/>
|
|
||||||
<xsl:text>R</xsl:text>
|
|
||||||
<xsl:value-of select="$rule"/>
|
|
||||||
<xsl:if test="$color = 5">
|
|
||||||
<xsl:text>d</xsl:text>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:text>" [label="</xsl:text>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$rule = 0">
|
|
||||||
<xsl:text>Acc", fillcolor=1</xsl:text>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:text>R</xsl:text>
|
|
||||||
<xsl:value-of select="$rule"/>
|
|
||||||
<xsl:text>", fillcolor=</xsl:text>
|
|
||||||
<xsl:value-of select="$color"/>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:text>, shape=diamond, style=filled] </xsl:text>
|
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template match="transition">
|
<xsl:template match="transition">
|
||||||
<xsl:call-template name="output-edge">
|
<xsl:call-template name="output-edge">
|
||||||
<xsl:with-param name="src" select="../../../@number"/>
|
<xsl:with-param name="src" select="../../../@number"/>
|
||||||
<xsl:with-param name="dst" select="@state"/>
|
<xsl:with-param name="dst" select="@state"/>
|
||||||
<xsl:with-param name="style">
|
<xsl:with-param name="style">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="@symbol = 'error'">
|
<xsl:when test="@symbol = 'error'">
|
||||||
<xsl:text>dotted</xsl:text>
|
<xsl:text>dotted</xsl:text>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:when test="@type = 'shift'">
|
<xsl:when test="@type = 'shift'">
|
||||||
<xsl:text>solid</xsl:text>
|
<xsl:text>solid</xsl:text>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:text>dashed</xsl:text>
|
<xsl:text>dashed</xsl:text>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
<xsl:with-param name="label">
|
<xsl:with-param name="label">
|
||||||
<xsl:if test="not(@symbol = 'error')">
|
<xsl:if test="not(@symbol = 'error')">
|
||||||
<xsl:value-of select="@symbol"/>
|
<xsl:value-of select="@symbol"/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
@@ -308,13 +134,10 @@
|
|||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:value-of select="$number"/>
|
<xsl:value-of select="$number"/>
|
||||||
<xsl:text> [label="</xsl:text>
|
<xsl:text> [label="</xsl:text>
|
||||||
<xsl:text>State </xsl:text>
|
|
||||||
<xsl:value-of select="$number"/>
|
|
||||||
<xsl:text>\n</xsl:text>
|
|
||||||
<xsl:call-template name="escape">
|
<xsl:call-template name="escape">
|
||||||
<xsl:with-param name="subject" select="$label"/>
|
<xsl:with-param name="subject" select="$label"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:text>\l"] </xsl:text>
|
<xsl:text>"] </xsl:text>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="output-edge">
|
<xsl:template name="output-edge">
|
||||||
@@ -355,7 +178,7 @@
|
|||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
<xsl:with-param name="search" select="' '"/>
|
<xsl:with-param name="search" select="' '"/>
|
||||||
<xsl:with-param name="replace" select="'\l'"/>
|
<xsl:with-param name="replace" select="'\n'"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
@@ -374,28 +197,11 @@
|
|||||||
<xsl:with-param name="search" select="$search"/>
|
<xsl:with-param name="search" select="$search"/>
|
||||||
<xsl:with-param name="replace" select="$replace"/>
|
<xsl:with-param name="replace" select="$replace"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$subject"/>
|
<xsl:value-of select="$subject"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
|
||||||
|
|
||||||
<xsl:template name="lpad">
|
|
||||||
<xsl:param name="str" select="''"/>
|
|
||||||
<xsl:param name="pad" select="0"/>
|
|
||||||
<xsl:variable name="diff" select="$pad - string-length($str)" />
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="$diff < 0">
|
|
||||||
<xsl:value-of select="$str"/>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:call-template name="space">
|
|
||||||
<xsl:with-param name="repeat" select="$diff"/>
|
|
||||||
</xsl:call-template>
|
|
||||||
<xsl:value-of select="$str"/>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|||||||
+41
-23
@@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
xml2text.xsl - transform Bison XML Report into plain text.
|
xml2text.xsl - transform Bison XML Report into plain text.
|
||||||
|
$Id$
|
||||||
|
|
||||||
Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc.
|
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -230,7 +231,7 @@
|
|||||||
<xsl:template match="automaton/state">
|
<xsl:template match="automaton/state">
|
||||||
<xsl:param name="pad"/>
|
<xsl:param name="pad"/>
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:text>State </xsl:text>
|
<xsl:text>state </xsl:text>
|
||||||
<xsl:value-of select="@number"/>
|
<xsl:value-of select="@number"/>
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:apply-templates select="itemset/item">
|
<xsl:apply-templates select="itemset/item">
|
||||||
@@ -253,9 +254,9 @@
|
|||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:apply-templates select="transition[@type = $type]">
|
<xsl:apply-templates select="transition[@type = $type]">
|
||||||
<xsl:with-param name="pad">
|
<xsl:with-param name="pad">
|
||||||
<xsl:call-template name="max-width-symbol">
|
<xsl:call-template name="max-width-symbol">
|
||||||
<xsl:with-param name="node" select="transition[@type = $type]"/>
|
<xsl:with-param name="node" select="transition[@type = $type]"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
@@ -266,9 +267,9 @@
|
|||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:apply-templates select="error">
|
<xsl:apply-templates select="error">
|
||||||
<xsl:with-param name="pad">
|
<xsl:with-param name="pad">
|
||||||
<xsl:call-template name="max-width-symbol">
|
<xsl:call-template name="max-width-symbol">
|
||||||
<xsl:with-param name="node" select="error"/>
|
<xsl:with-param name="node" select="error"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
@@ -279,9 +280,9 @@
|
|||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:apply-templates select="reduction">
|
<xsl:apply-templates select="reduction">
|
||||||
<xsl:with-param name="pad">
|
<xsl:with-param name="pad">
|
||||||
<xsl:call-template name="max-width-symbol">
|
<xsl:call-template name="max-width-symbol">
|
||||||
<xsl:with-param name="node" select="reduction"/>
|
<xsl:with-param name="node" select="reduction"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
@@ -290,7 +291,7 @@
|
|||||||
<xsl:template match="item">
|
<xsl:template match="item">
|
||||||
<xsl:param name="pad"/>
|
<xsl:param name="pad"/>
|
||||||
<xsl:param name="prev-rule-number"
|
<xsl:param name="prev-rule-number"
|
||||||
select="preceding-sibling::item[1]/@rule-number"/>
|
select="preceding-sibling::item[1]/@rule-number"/>
|
||||||
<xsl:apply-templates
|
<xsl:apply-templates
|
||||||
select="key('bison:ruleByNumber', current()/@rule-number)"
|
select="key('bison:ruleByNumber', current()/@rule-number)"
|
||||||
>
|
>
|
||||||
@@ -329,14 +330,14 @@
|
|||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$itemset != 'true' and $prev-lhs = lhs[text()]">
|
<xsl:when test="$itemset != 'true' and $prev-lhs = lhs[text()]">
|
||||||
<xsl:call-template name="lpad">
|
<xsl:call-template name="lpad">
|
||||||
<xsl:with-param name="str" select="'|'"/>
|
<xsl:with-param name="str" select="'|'"/>
|
||||||
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
|
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:when test="$itemset = 'true' and $prev-lhs = lhs[text()]">
|
<xsl:when test="$itemset = 'true' and $prev-lhs = lhs[text()]">
|
||||||
<xsl:call-template name="lpad">
|
<xsl:call-template name="lpad">
|
||||||
<xsl:with-param name="str" select="'|'"/>
|
<xsl:with-param name="str" select="'|'"/>
|
||||||
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
|
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 1"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
@@ -350,7 +351,12 @@
|
|||||||
<xsl:if test="position() = $point + 1">
|
<xsl:if test="position() = $point + 1">
|
||||||
<xsl:text> .</xsl:text>
|
<xsl:text> .</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:apply-templates select="."/>
|
<xsl:if test="$itemset = 'true' and name(.) != 'empty'">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="$itemset != 'true'">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:if>
|
||||||
<xsl:if test="position() = last() and position() = $point">
|
<xsl:if test="position() = last() and position() = $point">
|
||||||
<xsl:text> .</xsl:text>
|
<xsl:text> .</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
@@ -368,7 +374,7 @@
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="empty">
|
<xsl:template match="empty">
|
||||||
<xsl:text> %empty</xsl:text>
|
<xsl:text> /* empty */</xsl:text>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="lookaheads">
|
<xsl:template match="lookaheads">
|
||||||
@@ -437,7 +443,7 @@
|
|||||||
<xsl:value-of select="@rule"/>
|
<xsl:value-of select="@rule"/>
|
||||||
<xsl:text> (</xsl:text>
|
<xsl:text> (</xsl:text>
|
||||||
<xsl:value-of
|
<xsl:value-of
|
||||||
select="key('bison:ruleByNumber', current()/@rule)/lhs[text()]"/>
|
select="key('bison:ruleByNumber', current()/@rule)/lhs[text()]"/>
|
||||||
<xsl:text>)</xsl:text>
|
<xsl:text>)</xsl:text>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
@@ -474,9 +480,9 @@
|
|||||||
<xsl:variable name="longest">
|
<xsl:variable name="longest">
|
||||||
<xsl:for-each select="$node">
|
<xsl:for-each select="$node">
|
||||||
<xsl:sort data-type="number" select="string-length(@symbol)"
|
<xsl:sort data-type="number" select="string-length(@symbol)"
|
||||||
order="descending"/>
|
order="descending"/>
|
||||||
<xsl:if test="position() = 1">
|
<xsl:if test="position() = 1">
|
||||||
<xsl:value-of select="string-length(@symbol)"/>
|
<xsl:value-of select="string-length(@symbol)"/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
@@ -493,7 +499,7 @@
|
|||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:call-template name="space">
|
<xsl:call-template name="space">
|
||||||
<xsl:with-param name="repeat" select="$diff"/>
|
<xsl:with-param name="repeat" select="$diff"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:value-of select="$str"/>
|
<xsl:value-of select="$str"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
@@ -511,12 +517,24 @@
|
|||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$str"/>
|
<xsl:value-of select="$str"/>
|
||||||
<xsl:call-template name="space">
|
<xsl:call-template name="space">
|
||||||
<xsl:with-param name="repeat" select="$diff"/>
|
<xsl:with-param name="repeat" select="$diff"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template name="space">
|
||||||
|
<xsl:param name="repeat">0</xsl:param>
|
||||||
|
<xsl:param name="fill" select="' '"/>
|
||||||
|
<xsl:if test="number($repeat) >= 1">
|
||||||
|
<xsl:call-template name="space">
|
||||||
|
<xsl:with-param name="repeat" select="$repeat - 1"/>
|
||||||
|
<xsl:with-param name="fill" select="$fill"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:value-of select="$fill"/>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template name="line-wrap">
|
<xsl:template name="line-wrap">
|
||||||
<xsl:param name="line-length"/> <!-- required -->
|
<xsl:param name="line-length"/> <!-- required -->
|
||||||
<xsl:param name="first-line-length" select="$line-length"/>
|
<xsl:param name="first-line-length" select="$line-length"/>
|
||||||
|
|||||||
+77
-72
@@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||||
|
$Id$
|
||||||
|
|
||||||
Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
|
|
||||||
@@ -31,33 +32,32 @@
|
|||||||
<xsl:import href="bison.xsl"/>
|
<xsl:import href="bison.xsl"/>
|
||||||
|
|
||||||
<xsl:output method="xml" encoding="UTF-8"
|
<xsl:output method="xml" encoding="UTF-8"
|
||||||
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
|
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
|
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
|
||||||
indent="yes"/>
|
indent="yes"/>
|
||||||
|
|
||||||
<xsl:template match="/">
|
<xsl:template match="/">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
|
||||||
<title>
|
<title>
|
||||||
<xsl:value-of select="bison-xml-report/filename"/>
|
<xsl:value-of select="bison-xml-report/filename"/>
|
||||||
<xsl:text> - GNU Bison XML Automaton Report</xsl:text>
|
<xsl:text> - GNU Bison XML Automaton Report</xsl:text>
|
||||||
</title>
|
</title>
|
||||||
<style type="text/css"><![CDATA[
|
<style type="text/css"><![CDATA[
|
||||||
body {
|
body {
|
||||||
font-family: "Nimbus Sans L", Arial, sans-serif;
|
font-family: "Nimbus Sans L", Arial, sans-serif;
|
||||||
font-size: 9pt;
|
font-size: 9pt;
|
||||||
}
|
}
|
||||||
a:link {
|
a:link {
|
||||||
color: #1f00ff;
|
color: #1f00ff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
a:visited {
|
a:visited {
|
||||||
color: #1f00ff;
|
color: #1f00ff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
a:hover {
|
a:hover {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
#menu a {
|
#menu a {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
@@ -110,21 +110,21 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="#reductions">Reductions</a>
|
<a href="#reductions">Reductions</a>
|
||||||
<ul class="lower-alpha">
|
<ul class="lower-alpha">
|
||||||
<li><a href="#nonterminals_useless_in_grammar">Nonterminals useless in grammar</a></li>
|
<li><a href="#nonterminals_useless_in_grammar">Nonterminals useless in grammar</a></li>
|
||||||
<li><a href="#terminals_unused_in_grammar">Terminals unused in grammar</a></li>
|
<li><a href="#terminals_unused_in_grammar">Terminals unused in grammar</a></li>
|
||||||
<li><a href="#rules_useless_in_grammar">Rules useless in grammar</a></li>
|
<li><a href="#rules_useless_in_grammar">Rules useless in grammar</a></li>
|
||||||
<xsl:if test="grammar/rules/rule[@usefulness='useless-in-parser']">
|
<xsl:if test="grammar/rules/rule[@usefulness='useless-in-parser']">
|
||||||
<li><a href="#rules_useless_in_parser">Rules useless in parser due to conflicts</a></li>
|
<li><a href="#rules_useless_in_parser">Rules useless in parser due to conflicts</a></li>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#conflicts">Conflicts</a></li>
|
<li><a href="#conflicts">Conflicts</a></li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#grammar">Grammar</a>
|
<a href="#grammar">Grammar</a>
|
||||||
<ul class="lower-alpha">
|
<ul class="lower-alpha">
|
||||||
<li><a href="#grammar">Itemset</a></li>
|
<li><a href="#grammar">Itemset</a></li>
|
||||||
<li><a href="#terminals">Terminal symbols</a></li>
|
<li><a href="#terminals">Terminal symbols</a></li>
|
||||||
<li><a href="#nonterminals">Nonterminal symbols</a></li>
|
<li><a href="#nonterminals">Nonterminal symbols</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#automaton">Automaton</a></li>
|
<li><a href="#automaton">Automaton</a></li>
|
||||||
@@ -155,9 +155,9 @@
|
|||||||
<xsl:if test="nonterminal[@usefulness='useless-in-grammar']">
|
<xsl:if test="nonterminal[@usefulness='useless-in-grammar']">
|
||||||
<p class="pre">
|
<p class="pre">
|
||||||
<xsl:for-each select="nonterminal[@usefulness='useless-in-grammar']">
|
<xsl:for-each select="nonterminal[@usefulness='useless-in-grammar']">
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
</p>
|
</p>
|
||||||
@@ -174,9 +174,9 @@
|
|||||||
<p class="pre">
|
<p class="pre">
|
||||||
<xsl:for-each select="terminal[@usefulness='unused-in-grammar']">
|
<xsl:for-each select="terminal[@usefulness='unused-in-grammar']">
|
||||||
<xsl:sort select="@symbol-number" data-type="number"/>
|
<xsl:sort select="@symbol-number" data-type="number"/>
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
</p>
|
</p>
|
||||||
@@ -382,7 +382,7 @@
|
|||||||
<h3>
|
<h3>
|
||||||
<a>
|
<a>
|
||||||
<xsl:attribute name="name">
|
<xsl:attribute name="name">
|
||||||
<xsl:value-of select="concat('state_', @number)"/>
|
<xsl:value-of select="concat('state_', @number)"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
</a>
|
</a>
|
||||||
<xsl:text>state </xsl:text>
|
<xsl:text>state </xsl:text>
|
||||||
@@ -411,9 +411,9 @@
|
|||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:apply-templates select="transition[@type = $type]">
|
<xsl:apply-templates select="transition[@type = $type]">
|
||||||
<xsl:with-param name="pad">
|
<xsl:with-param name="pad">
|
||||||
<xsl:call-template name="max-width-symbol">
|
<xsl:call-template name="max-width-symbol">
|
||||||
<xsl:with-param name="node" select="transition[@type = $type]"/>
|
<xsl:with-param name="node" select="transition[@type = $type]"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
@@ -424,9 +424,9 @@
|
|||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:apply-templates select="error">
|
<xsl:apply-templates select="error">
|
||||||
<xsl:with-param name="pad">
|
<xsl:with-param name="pad">
|
||||||
<xsl:call-template name="max-width-symbol">
|
<xsl:call-template name="max-width-symbol">
|
||||||
<xsl:with-param name="node" select="error"/>
|
<xsl:with-param name="node" select="error"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
@@ -437,9 +437,9 @@
|
|||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<xsl:apply-templates select="reduction">
|
<xsl:apply-templates select="reduction">
|
||||||
<xsl:with-param name="pad">
|
<xsl:with-param name="pad">
|
||||||
<xsl:call-template name="max-width-symbol">
|
<xsl:call-template name="max-width-symbol">
|
||||||
<xsl:with-param name="node" select="reduction"/>
|
<xsl:with-param name="node" select="reduction"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:with-param>
|
</xsl:with-param>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
@@ -448,7 +448,7 @@
|
|||||||
<xsl:template match="item">
|
<xsl:template match="item">
|
||||||
<xsl:param name="pad"/>
|
<xsl:param name="pad"/>
|
||||||
<xsl:param name="prev-rule-number"
|
<xsl:param name="prev-rule-number"
|
||||||
select="preceding-sibling::item[1]/@rule-number"/>
|
select="preceding-sibling::item[1]/@rule-number"/>
|
||||||
<xsl:apply-templates
|
<xsl:apply-templates
|
||||||
select="key('bison:ruleByNumber', current()/@rule-number)"
|
select="key('bison:ruleByNumber', current()/@rule-number)"
|
||||||
>
|
>
|
||||||
@@ -478,7 +478,7 @@
|
|||||||
<xsl:if test="$itemset != 'true'">
|
<xsl:if test="$itemset != 'true'">
|
||||||
<a>
|
<a>
|
||||||
<xsl:attribute name="name">
|
<xsl:attribute name="name">
|
||||||
<xsl:value-of select="concat('rule_', @number)"/>
|
<xsl:value-of select="concat('rule_', @number)"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
</a>
|
</a>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
@@ -487,19 +487,19 @@
|
|||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$itemset = 'true'">
|
<xsl:when test="$itemset = 'true'">
|
||||||
<a>
|
<a>
|
||||||
<xsl:attribute name="href">
|
<xsl:attribute name="href">
|
||||||
<xsl:value-of select="concat('#rule_', @number)"/>
|
<xsl:value-of select="concat('#rule_', @number)"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
<xsl:call-template name="lpad">
|
<xsl:call-template name="lpad">
|
||||||
<xsl:with-param name="str" select="string(@number)"/>
|
<xsl:with-param name="str" select="string(@number)"/>
|
||||||
<xsl:with-param name="pad" select="number($pad)"/>
|
<xsl:with-param name="pad" select="number($pad)"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</a>
|
</a>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:call-template name="lpad">
|
<xsl:call-template name="lpad">
|
||||||
<xsl:with-param name="str" select="string(@number)"/>
|
<xsl:with-param name="str" select="string(@number)"/>
|
||||||
<xsl:with-param name="pad" select="number($pad)"/>
|
<xsl:with-param name="pad" select="number($pad)"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
@@ -509,19 +509,19 @@
|
|||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$itemset != 'true' and $prev-lhs = lhs[text()]">
|
<xsl:when test="$itemset != 'true' and $prev-lhs = lhs[text()]">
|
||||||
<xsl:call-template name="lpad">
|
<xsl:call-template name="lpad">
|
||||||
<xsl:with-param name="str" select="'|'"/>
|
<xsl:with-param name="str" select="'|'"/>
|
||||||
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
|
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:when test="$itemset = 'true' and $prev-lhs = lhs[text()]">
|
<xsl:when test="$itemset = 'true' and $prev-lhs = lhs[text()]">
|
||||||
<xsl:call-template name="lpad">
|
<xsl:call-template name="lpad">
|
||||||
<xsl:with-param name="str" select="'|'"/>
|
<xsl:with-param name="str" select="'|'"/>
|
||||||
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
|
<xsl:with-param name="pad" select="number(string-length(lhs[text()])) + 2"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<span class="i">
|
<span class="i">
|
||||||
<xsl:value-of select="lhs"/>
|
<xsl:value-of select="lhs"/>
|
||||||
</span>
|
</span>
|
||||||
<xsl:text> →</xsl:text>
|
<xsl:text> →</xsl:text>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
@@ -533,7 +533,12 @@
|
|||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<span class="point">.</span>
|
<span class="point">.</span>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:apply-templates select="."/>
|
<xsl:if test="$itemset = 'true' and name(.) != 'empty'">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="$itemset != 'true'">
|
||||||
|
<xsl:apply-templates select="."/>
|
||||||
|
</xsl:if>
|
||||||
<xsl:if test="position() = last() and position() = $point">
|
<xsl:if test="position() = last() and position() = $point">
|
||||||
<xsl:text> </xsl:text>
|
<xsl:text> </xsl:text>
|
||||||
<span class="point">.</span>
|
<span class="point">.</span>
|
||||||
@@ -559,7 +564,7 @@
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="empty">
|
<xsl:template match="empty">
|
||||||
<xsl:text> %empty</xsl:text>
|
<xsl:text> ε</xsl:text>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="lookaheads">
|
<xsl:template match="lookaheads">
|
||||||
@@ -585,18 +590,18 @@
|
|||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="@type = 'shift'">
|
<xsl:when test="@type = 'shift'">
|
||||||
<a>
|
<a>
|
||||||
<xsl:attribute name="href">
|
<xsl:attribute name="href">
|
||||||
<xsl:value-of select="concat('#state_', @state)"/>
|
<xsl:value-of select="concat('#state_', @state)"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
<xsl:value-of select="concat('shift, and go to state ', @state)"/>
|
<xsl:value-of select="concat('shift, and go to state ', @state)"/>
|
||||||
</a>
|
</a>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:when test="@type = 'goto'">
|
<xsl:when test="@type = 'goto'">
|
||||||
<a>
|
<a>
|
||||||
<xsl:attribute name="href">
|
<xsl:attribute name="href">
|
||||||
<xsl:value-of select="concat('#state_', @state)"/>
|
<xsl:value-of select="concat('#state_', @state)"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
<xsl:value-of select="concat('go to state ', @state)"/>
|
<xsl:value-of select="concat('go to state ', @state)"/>
|
||||||
</a>
|
</a>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
@@ -633,10 +638,10 @@
|
|||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<a>
|
<a>
|
||||||
<xsl:attribute name="href">
|
<xsl:attribute name="href">
|
||||||
<xsl:value-of select="concat('#rule_', @rule)"/>
|
<xsl:value-of select="concat('#rule_', @rule)"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
<xsl:value-of select="concat('reduce using rule ', @rule)"/>
|
<xsl:value-of select="concat('reduce using rule ', @rule)"/>
|
||||||
</a>
|
</a>
|
||||||
<xsl:text> (</xsl:text>
|
<xsl:text> (</xsl:text>
|
||||||
<xsl:value-of
|
<xsl:value-of
|
||||||
@@ -683,9 +688,9 @@
|
|||||||
<xsl:variable name="longest">
|
<xsl:variable name="longest">
|
||||||
<xsl:for-each select="$node">
|
<xsl:for-each select="$node">
|
||||||
<xsl:sort data-type="number" select="string-length(@symbol)"
|
<xsl:sort data-type="number" select="string-length(@symbol)"
|
||||||
order="descending"/>
|
order="descending"/>
|
||||||
<xsl:if test="position() = 1">
|
<xsl:if test="position() = 1">
|
||||||
<xsl:value-of select="string-length(@symbol)"/>
|
<xsl:value-of select="string-length(@symbol)"/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
@@ -702,7 +707,7 @@
|
|||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:call-template name="space">
|
<xsl:call-template name="space">
|
||||||
<xsl:with-param name="repeat" select="$diff"/>
|
<xsl:with-param name="repeat" select="$diff"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:value-of select="$str"/>
|
<xsl:value-of select="$str"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
@@ -720,7 +725,7 @@
|
|||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$str"/>
|
<xsl:value-of select="$str"/>
|
||||||
<xsl:call-template name="space">
|
<xsl:call-template name="space">
|
||||||
<xsl:with-param name="repeat" select="$diff"/>
|
<xsl:with-param name="repeat" select="$diff"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
|||||||
+861
-1039
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||||
# Requires GNU sed
|
# Requires GNU sed
|
||||||
|
|
||||||
## Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
## Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+4
-4
@@ -1,6 +1,6 @@
|
|||||||
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
||||||
|
|
||||||
Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
=======================
|
=======================
|
||||||
|
|
||||||
The DJGPP port of Bison offers LFN and SFN support depending on which
|
The DJGPP port of Bison offers LFN and SFN support depending on which
|
||||||
OS it is running. If LFN support is available or not is determined at
|
OS it is running. If LFN support is available or not is determinated at
|
||||||
run time. If LFN support is available (DOS session under Win9X, Win2K,
|
run time. If LFN support is available (DOS session under Win9X, Win2K,
|
||||||
WinXP, etc.) the standard posix file name extensions will be used.
|
WinXP, etc.) the standard posix file name extensions will be used.
|
||||||
These are: y.tab.c, y.tab.c++, y.tab.h, y.output, etc. If only SFN
|
These are: y.tab.c, y.tab.c++, y.tab.h, y.output, etc. If only SFN
|
||||||
@@ -84,7 +84,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
some more work to unpack, if LFN support is not available. If LFN is
|
some more work to unpack, if LFN support is not available. If LFN is
|
||||||
available then you can extract the source files from the archive with
|
available then you can extract the source files from the archive with
|
||||||
any unzip program and proceed to the paragraph 3.3, below. Any file
|
any unzip program and proceed to the paragraph 3.3, below. Any file
|
||||||
name issue will be handled by the DJGPP configuration files.
|
name issue will be handled by the the DJGPP configuration files.
|
||||||
To unpack the source distribution on SFN systems, first, you MUST use
|
To unpack the source distribution on SFN systems, first, you MUST use
|
||||||
the `djunpack' batch file to unzip the package. That is because some
|
the `djunpack' batch file to unzip the package. That is because some
|
||||||
file names in the official distributions need to be changed to avoid
|
file names in the official distributions need to be changed to avoid
|
||||||
@@ -179,7 +179,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
This will install the products into your DJGPP installation tree given
|
This will install the products into your DJGPP installation tree given
|
||||||
by the default prefix "/dev/env/DJDIR". If you prefer to install them
|
by the default prefix "/dev/env/DJDIR". If you prefer to install them
|
||||||
into some other directory you will have to set prefix to the appropriate
|
into some other directory you will have to set prefix to the appropiate
|
||||||
value:
|
value:
|
||||||
make install prefix=z:/some/other/place
|
make install prefix=z:/some/other/place
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -4,7 +4,7 @@ Rem Configure Bison for DJGPP.
|
|||||||
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
||||||
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
||||||
|
|
||||||
Rem Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
Rem Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Rem This program is free software: you can redistribute it and/or modify
|
Rem This program is free software: you can redistribute it and/or modify
|
||||||
Rem it under the terms of the GNU General Public License as published by
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
@@ -80,10 +80,10 @@ goto NextArgument
|
|||||||
if "%1" == "no-dep" goto NextArgument
|
if "%1" == "no-dep" goto NextArgument
|
||||||
if "%1" == "no-DEP" goto NextArgument
|
if "%1" == "no-DEP" goto NextArgument
|
||||||
if "%1" == "NO-DEP" goto NextArgument
|
if "%1" == "NO-DEP" goto NextArgument
|
||||||
if "%1" == "dep" goto DependecyTracking
|
if "%1" == "dep" goto DependecyTraking
|
||||||
if "%1" == "DEP" goto DependecyTracking
|
if "%1" == "DEP" goto DependecyTraking
|
||||||
goto LibiconvPrefixOption
|
goto LibiconvPrefixOption
|
||||||
:DependecyTracking
|
:DependecyTraking
|
||||||
if "%1" == "dep" set DEPENDENCY_TRACKING=enabled
|
if "%1" == "dep" set DEPENDENCY_TRACKING=enabled
|
||||||
if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled
|
if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled
|
||||||
if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv
|
if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv
|
||||||
@@ -290,7 +290,7 @@ if errorlevel 1 goto SedError2
|
|||||||
mv -f config.hin %XSRC%/lib/config.hin
|
mv -f config.hin %XSRC%/lib/config.hin
|
||||||
|
|
||||||
|
|
||||||
Rem Fixing illicit testsuite file name.
|
Rem Fixing ilicit testsuite file name.
|
||||||
test -f %XSRC%/tests/c++.at
|
test -f %XSRC%/tests/c++.at
|
||||||
if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at
|
if not errorlevel 1 mv -f %XSRC%/tests/c++.at %XSRC%/tests/cxx.at
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ sed -f %XSRC%/djgpp/testsuite.sed %XSRC%/tests/testsuite.org > testsuite.tmp
|
|||||||
if errorlevel 1 goto SedError3
|
if errorlevel 1 goto SedError3
|
||||||
mv -f ./testsuite.tmp %XSRC%/tests/testsuite
|
mv -f ./testsuite.tmp %XSRC%/tests/testsuite
|
||||||
|
|
||||||
Rem Fixing illicit calc++ file names in the calc++ directory.
|
Rem Fixing ilicit calc++ file names in the calc++ directory.
|
||||||
test -d %XSRC%/examples/calc++
|
test -d %XSRC%/examples/calc++
|
||||||
if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx
|
if not errorlevel 1 mv -f %XSRC%/examples/calc++ %XSRC%/examples/calcxx
|
||||||
test -d %XSRC%/examples/calcxx
|
test -d %XSRC%/examples/calcxx
|
||||||
@@ -471,7 +471,7 @@ redir -e /dev/null rm %XSRC%/po/stamp-cat-id
|
|||||||
|
|
||||||
Rem Update the arguments file for the configure script.
|
Rem Update the arguments file for the configure script.
|
||||||
Rem We prefer without-included-gettext because libintl.a from gettext package
|
Rem We prefer without-included-gettext because libintl.a from gettext package
|
||||||
Rem is the only one that is guaranteed to have been ported to DJGPP.
|
Rem is the only one that is garanteed to have been ported to DJGPP.
|
||||||
echo --enable-nls --without-included-gettext >> args
|
echo --enable-nls --without-included-gettext >> args
|
||||||
goto ConfigurePackage
|
goto ConfigurePackage
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@
|
|||||||
# Sed script for additional DJGPP specific editing
|
# Sed script for additional DJGPP specific editing
|
||||||
# of the configure script generated by autoconf 2.62.
|
# of the configure script generated by autoconf 2.62.
|
||||||
|
|
||||||
# Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
# Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
# This is the config.site file for configuring GNU packages
|
# This is the config.site file for configuring GNU packages
|
||||||
# which are to be built with DJGPP tools.
|
# which are to be built with DJGPP tools.
|
||||||
|
|
||||||
# Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
# Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# sed script for DJGPP specific editing of config.hin
|
# sed script for DJGPP specific editing of config.hin
|
||||||
|
|
||||||
# Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
# Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ Rem This batch file unpacks the Bison distribution while simultaneously
|
|||||||
Rem renaming some of the files whose names are invalid on DOS or conflict
|
Rem renaming some of the files whose names are invalid on DOS or conflict
|
||||||
Rem with other file names after truncation to DOS 8+3 namespace.
|
Rem with other file names after truncation to DOS 8+3 namespace.
|
||||||
Rem
|
Rem
|
||||||
Rem Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
Rem Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
Rem
|
Rem
|
||||||
Rem This program is free software: you can redistribute it and/or modify
|
Rem This program is free software: you can redistribute it and/or modify
|
||||||
Rem it under the terms of the GNU General Public License as published by
|
Rem it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
## Copyright (C) 2008-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
## This program is free software: you can redistribute it and/or modify
|
|
||||||
## it under the terms of the GNU General Public License as published by
|
|
||||||
## the Free Software Foundation, either version 3 of the License, or
|
|
||||||
## (at your option) any later version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful,
|
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
## GNU General Public License for more details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License
|
|
||||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
EXTRA_DIST += \
|
|
||||||
djgpp/Makefile.maint \
|
|
||||||
djgpp/README.in \
|
|
||||||
djgpp/config.bat \
|
|
||||||
djgpp/config.sed \
|
|
||||||
djgpp/config.site \
|
|
||||||
djgpp/config_h.sed \
|
|
||||||
djgpp/djunpack.bat \
|
|
||||||
djgpp/fnchange.lst \
|
|
||||||
djgpp/subpipe.c \
|
|
||||||
djgpp/subpipe.h \
|
|
||||||
djgpp/testsuite.sed
|
|
||||||
+8
-8
@@ -1,6 +1,6 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
|
|
||||||
Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -60,7 +60,7 @@ static char tmp_file_name[2][L_tmpnam];
|
|||||||
do { \
|
do { \
|
||||||
close ((fd)); \
|
close ((fd)); \
|
||||||
if (unlink ((name))) \
|
if (unlink ((name))) \
|
||||||
error (EXIT_FAILURE, 0, _("removing of '%s' failed"), (name)); \
|
error (EXIT_FAILURE, 0, _("removing of `%s' failed"), (name)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
@@ -231,17 +231,17 @@ end_of_output_subpipe(pid_t pid, int fd[2])
|
|||||||
{
|
{
|
||||||
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
||||||
error(EXIT_FAILURE, 0, _("subsidiary program '%s' interrupted"), program);
|
error(EXIT_FAILURE, 0, _("subsidiary program `%s' interrupted"), program);
|
||||||
}
|
}
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
|
||||||
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
|
||||||
error(EXIT_FAILURE, 0, _(errno == ENOENT
|
error(EXIT_FAILURE, 0, _(errno == ENOENT
|
||||||
? "subsidiary program '%s' not found"
|
? "subsidiary program `%s' not found"
|
||||||
: status < 1
|
: status < 1
|
||||||
? "subsidiary program '%s' failed"
|
? "subsidiary program `%s' failed"
|
||||||
: "subsidiary program '%s' failed (status=%i, errno=%i)"), program, status, errno);
|
: "subsidiary program `%s' failed (status=%i, errno=%i)"), program, status, errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -283,9 +283,9 @@ reap_subpipe(pid_t pid, char const *program)
|
|||||||
free(arguments);
|
free(arguments);
|
||||||
|
|
||||||
if (unlink(tmp_file_name[0]))
|
if (unlink(tmp_file_name[0]))
|
||||||
error(EXIT_FAILURE, 0, _("removing of '%s' failed"), tmp_file_name[0]);
|
error(EXIT_FAILURE, 0, _("removing of `%s' failed"), tmp_file_name[0]);
|
||||||
if (unlink(tmp_file_name[1]))
|
if (unlink(tmp_file_name[1]))
|
||||||
error(EXIT_FAILURE, 0, _("removing of '%s' failed"), tmp_file_name[1]);
|
error(EXIT_FAILURE, 0, _("removing of `%s' failed"), tmp_file_name[1]);
|
||||||
|
|
||||||
if (dup2(old_stdin, STDIN_FILENO) < 0)
|
if (dup2(old_stdin, STDIN_FILENO) < 0)
|
||||||
error(EXIT_FAILURE, 0, "restore of bison's stdin failed");
|
error(EXIT_FAILURE, 0, "restore of bison's stdin failed");
|
||||||
|
|||||||
+1
-2
@@ -1,6 +1,5 @@
|
|||||||
/* Subprocesses with pipes.
|
/* Subprocesses with pipes.
|
||||||
|
Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
Copyright (C) 2005-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@
|
|||||||
# Sed script for additional DJGPP specific editing
|
# Sed script for additional DJGPP specific editing
|
||||||
# of the testsuite script generated by autoconf 2.61.
|
# of the testsuite script generated by autoconf 2.61.
|
||||||
|
|
||||||
# Copyright (C) 2007-2015, 2018 Free Software Foundation, Inc.
|
|
||||||
|
# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
Makefile
|
||||||
|
bison.aux
|
||||||
|
bison.cp
|
||||||
|
bison.cps
|
||||||
|
bison.dvi
|
||||||
|
bison.fn
|
||||||
|
bison.html
|
||||||
|
bison.ky
|
||||||
|
bison.log
|
||||||
|
bison.pdf
|
||||||
|
bison.pg
|
||||||
|
bison.ps
|
||||||
|
bison.toc
|
||||||
|
bison.tp
|
||||||
|
bison.vr
|
||||||
|
cross-options.texi
|
||||||
|
Makefile.in
|
||||||
|
refcard.dvi
|
||||||
|
refcard.log
|
||||||
|
refcard.ps
|
||||||
|
*.info*
|
||||||
|
stamp-vti
|
||||||
|
version.texi
|
||||||
|
yacc.1
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/*~
|
|
||||||
/.dirstamp
|
|
||||||
/bison.1
|
|
||||||
/bison.aux
|
|
||||||
/bison.cp
|
|
||||||
/bison.cps
|
|
||||||
/bison.dvi
|
|
||||||
/bison.fn
|
|
||||||
/bison.help
|
|
||||||
/bison.html
|
|
||||||
/bison.info
|
|
||||||
/bison.ky
|
|
||||||
/bison.log
|
|
||||||
/bison.pdf
|
|
||||||
/bison.pg
|
|
||||||
/bison.ps
|
|
||||||
/bison.toc
|
|
||||||
/bison.tp
|
|
||||||
/bison.vr
|
|
||||||
/cross-options.texi
|
|
||||||
/fdl.texi
|
|
||||||
/gendocs_template
|
|
||||||
/gpl-3.0.texi
|
|
||||||
/refcard.dvi
|
|
||||||
/refcard.log
|
|
||||||
/refcard.ps
|
|
||||||
/stamp-vti
|
|
||||||
/version.texi
|
|
||||||
/yacc.1
|
|
||||||
/gendocs_template_min
|
|
||||||
+569
-1800
File diff suppressed because it is too large
Load Diff
+130
@@ -0,0 +1,130 @@
|
|||||||
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||||
|
## Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
AM_MAKEINFOFLAGS = --no-split
|
||||||
|
info_TEXINFOS = bison.texinfo
|
||||||
|
bison_TEXINFOS = $(srcdir)/cross-options.texi gpl-3.0.texi fdl.texi
|
||||||
|
|
||||||
|
CLEANFILES = bison.fns
|
||||||
|
CLEANDIRS = *.t2d
|
||||||
|
clean-local:
|
||||||
|
rm -rf $(CLEANDIRS)
|
||||||
|
|
||||||
|
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
||||||
|
$(srcdir)/cross-options.texi: $(top_srcdir)/src/getargs.c $(CROSS_OPTIONS_PL)
|
||||||
|
-rm -f $@ $@.tmp
|
||||||
|
cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) bison
|
||||||
|
$(top_builddir)/src/bison --help | perl $(CROSS_OPTIONS_PL) >$@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
MAINTAINERCLEANFILES = $(srcdir)/cross-options.texi
|
||||||
|
|
||||||
|
## ---------- ##
|
||||||
|
## Ref card. ##
|
||||||
|
## ---------- ##
|
||||||
|
|
||||||
|
EXTRA_DIST = refcard.tex
|
||||||
|
CLEANFILES += refcard.dvi refcard.log refcard.ps
|
||||||
|
|
||||||
|
refcard.dvi: refcard.tex
|
||||||
|
tex refcard.tex
|
||||||
|
|
||||||
|
refcard.ps: refcard.dvi
|
||||||
|
|
||||||
|
|
||||||
|
## ----------- ##
|
||||||
|
## Man Pages. ##
|
||||||
|
## ----------- ##
|
||||||
|
|
||||||
|
dist_man_MANS = $(srcdir)/bison.1
|
||||||
|
|
||||||
|
EXTRA_DIST += $(dist_man_MANS:.1=.x) common.x
|
||||||
|
MAINTAINERCLEANFILES += $(dist_man_MANS)
|
||||||
|
|
||||||
|
# Depend on configure.ac to get version number changes.
|
||||||
|
common_dep = $(top_srcdir)/configure.ac $(srcdir)/common.x
|
||||||
|
srcsrcdir = $(top_srcdir)/bin
|
||||||
|
$(srcdir)/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c
|
||||||
|
|
||||||
|
# Output from --help and --version that must not appear in the man page.
|
||||||
|
neutralize = \
|
||||||
|
perl -0777 -pi -e 's/\.PP\nId:.*\n//g'
|
||||||
|
|
||||||
|
# Differences to ignore when comparing the man page (the date).
|
||||||
|
remove_time_stamp = \
|
||||||
|
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
|
||||||
|
|
||||||
|
MOSTLYCLEANFILES = $(srcdir)/*.t
|
||||||
|
|
||||||
|
SUFFIXES = .x .1
|
||||||
|
|
||||||
|
PREPATH = $(top_builddir)/src
|
||||||
|
.x.1:
|
||||||
|
@program=`expr "/$*" : '.*/\(.*\)'` && \
|
||||||
|
save_IFS=$IFS; \
|
||||||
|
IFS=$(PATH_SEPARATOR); \
|
||||||
|
for dir in $(PREPATH); do \
|
||||||
|
IFS=$save_IFS; \
|
||||||
|
echo cd $$dir '&&' $(MAKE) $(AM_MAKEFLAGS) $$program && \
|
||||||
|
(cd $$dir && $(MAKE) $(AM_MAKEFLAGS) $$program) || exit; \
|
||||||
|
done
|
||||||
|
@echo "Updating man page $@"
|
||||||
|
PATH="$(PREPATH)$(PATH_SEPARATOR)$$PATH"; \
|
||||||
|
export PATH; \
|
||||||
|
$(HELP2MAN) \
|
||||||
|
--include=$*.x \
|
||||||
|
--include=$(srcdir)/common.x \
|
||||||
|
--output=$@.t `echo '$*' | sed 's,.*/,,'`
|
||||||
|
$(neutralize) $@.t
|
||||||
|
if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
|
||||||
|
$(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
|
||||||
|
touch $@; \
|
||||||
|
else \
|
||||||
|
mv $@.t $@; \
|
||||||
|
fi
|
||||||
|
rm -f $@*.t
|
||||||
|
|
||||||
|
nodist_man_MANS = yacc.1
|
||||||
|
|
||||||
|
## -------------- ##
|
||||||
|
## Doxygenation. ##
|
||||||
|
## -------------- ##
|
||||||
|
|
||||||
|
DOXYGEN = doxygen
|
||||||
|
|
||||||
|
.PHONY: doc html
|
||||||
|
|
||||||
|
doc: html
|
||||||
|
|
||||||
|
html-local: Doxyfile
|
||||||
|
$(DOXYGEN)
|
||||||
|
|
||||||
|
edit = sed -e "s|@ID@|$$Id|" \
|
||||||
|
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
|
||||||
|
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
|
||||||
|
-e 's,@top_builddir\@,$(top_builddir),g' \
|
||||||
|
-e 's,@top_srcdir\@,$(top_srcdir),g'
|
||||||
|
|
||||||
|
EXTRA_DIST += Doxyfile.in
|
||||||
|
CLEANFILES += Doxyfile
|
||||||
|
# Sed is used to generate Doxyfile from Doxyfile.in instead of
|
||||||
|
# configure, because the former is way faster than the latter.
|
||||||
|
# Moreover, this file is updated whenever ChangeLog is touched: using
|
||||||
|
# sed instead of configure saves us a lot of time.
|
||||||
|
Doxyfile: $(top_srcdir)/ChangeLog $(srcdir)/Doxyfile.in
|
||||||
|
Id=`grep '^\$$Id' $(top_srcdir)/ChangeLog`; \
|
||||||
|
$(edit) $(srcdir)/Doxyfile.in >Doxyfile
|
||||||
|
|
||||||
|
CLEANDIRS += html latex
|
||||||
+197
@@ -0,0 +1,197 @@
|
|||||||
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
|
||||||
|
.TH BISON "1" "March 2008" "bison 2.3a+" "User Commands"
|
||||||
|
.SH NAME
|
||||||
|
bison \- GNU Project parser generator (yacc replacement)
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B bison
|
||||||
|
[\fIOPTION\fR]... \fIFILE\fR
|
||||||
|
.SH 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 .
|
||||||
|
.PP
|
||||||
|
Input files should follow the
|
||||||
|
.I yacc
|
||||||
|
convention of ending in
|
||||||
|
.BR .y .
|
||||||
|
Unlike
|
||||||
|
.IR 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++).
|
||||||
|
For instance, a grammar description file named
|
||||||
|
.B parse.yxx
|
||||||
|
would produce the generated parser in a file named
|
||||||
|
.BR parse.tab.cxx ,
|
||||||
|
instead of
|
||||||
|
.IR yacc 's
|
||||||
|
.B y.tab.c
|
||||||
|
or old
|
||||||
|
.I Bison
|
||||||
|
version's
|
||||||
|
.BR parse.tab.c .
|
||||||
|
.PP
|
||||||
|
This description of the options that can be given to
|
||||||
|
.I bison
|
||||||
|
is adapted from the node
|
||||||
|
.B Invocation
|
||||||
|
in the
|
||||||
|
.B bison.texinfo
|
||||||
|
manual, which should be taken as authoritative.
|
||||||
|
.PP
|
||||||
|
.I Bison
|
||||||
|
supports both traditional single-letter options and mnemonic long
|
||||||
|
option names. Long option names are indicated with
|
||||||
|
.B \-\-
|
||||||
|
instead of
|
||||||
|
.BR \- .
|
||||||
|
Abbreviations for option names are allowed as long as they
|
||||||
|
are unique. When a long option takes an argument, like
|
||||||
|
.BR \-\-file-prefix ,
|
||||||
|
connect the option name and the argument with
|
||||||
|
.BR = .
|
||||||
|
.PP
|
||||||
|
Generate LALR(1) and GLR parsers.
|
||||||
|
.PP
|
||||||
|
Mandatory arguments to long options are mandatory for short options too.
|
||||||
|
The same is true for optional arguments.
|
||||||
|
.SS "Operation modes:"
|
||||||
|
.TP
|
||||||
|
\fB\-h\fR, \fB\-\-help\fR
|
||||||
|
display this help and exit
|
||||||
|
.TP
|
||||||
|
\fB\-V\fR, \fB\-\-version\fR
|
||||||
|
output version information and exit
|
||||||
|
.TP
|
||||||
|
\fB\-\-print\-localedir\fR
|
||||||
|
output directory containing locale\-dependent data
|
||||||
|
.TP
|
||||||
|
\fB\-\-print\-datadir\fR
|
||||||
|
output directory containing skeletons and XSLT
|
||||||
|
.TP
|
||||||
|
\fB\-y\fR, \fB\-\-yacc\fR
|
||||||
|
emulate POSIX Yacc
|
||||||
|
.TP
|
||||||
|
\fB\-W\fR, \fB\-\-warnings\fR=\fI[CATEGORY]\fR
|
||||||
|
report the warnings falling in CATEGORY
|
||||||
|
.SS "Parser:"
|
||||||
|
.TP
|
||||||
|
\fB\-L\fR, \fB\-\-language\fR=\fILANGUAGE\fR
|
||||||
|
specify the output programming language
|
||||||
|
.TP
|
||||||
|
\fB\-S\fR, \fB\-\-skeleton\fR=\fIFILE\fR
|
||||||
|
specify the skeleton to use
|
||||||
|
.TP
|
||||||
|
\fB\-t\fR, \fB\-\-debug\fR
|
||||||
|
instrument the parser for debugging
|
||||||
|
.TP
|
||||||
|
\fB\-\-locations\fR
|
||||||
|
enable locations computation
|
||||||
|
.TP
|
||||||
|
\fB\-p\fR, \fB\-\-name\-prefix\fR=\fIPREFIX\fR
|
||||||
|
prepend PREFIX to the external symbols
|
||||||
|
.TP
|
||||||
|
\fB\-l\fR, \fB\-\-no\-lines\fR
|
||||||
|
don't generate `#line' directives
|
||||||
|
.TP
|
||||||
|
\fB\-k\fR, \fB\-\-token\-table\fR
|
||||||
|
include a table of token names
|
||||||
|
.SS "Output:"
|
||||||
|
.TP
|
||||||
|
\fB\-\-defines\fR[=\fIFILE\fR]
|
||||||
|
also produce a header file
|
||||||
|
.TP
|
||||||
|
\fB\-d\fR
|
||||||
|
likewise but cannot specify FILE (for POSIX Yacc)
|
||||||
|
.TP
|
||||||
|
\fB\-r\fR, \fB\-\-report\fR=\fITHINGS\fR
|
||||||
|
also produce details on the automaton
|
||||||
|
.TP
|
||||||
|
\fB\-\-report\-file\fR=\fIFILE\fR
|
||||||
|
write report to FILE
|
||||||
|
.TP
|
||||||
|
\fB\-v\fR, \fB\-\-verbose\fR
|
||||||
|
same as `\-\-report=state'
|
||||||
|
.TP
|
||||||
|
\fB\-b\fR, \fB\-\-file\-prefix\fR=\fIPREFIX\fR
|
||||||
|
specify a PREFIX for output files
|
||||||
|
.TP
|
||||||
|
\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
|
||||||
|
leave output to FILE
|
||||||
|
.TP
|
||||||
|
\fB\-g\fR, \fB\-\-graph\fR[=\fIFILE\fR]
|
||||||
|
also output a graph of the automaton
|
||||||
|
.TP
|
||||||
|
\fB\-x\fR, \fB\-\-xml\fR[=\fIFILE\fR]
|
||||||
|
also output an XML report of the automaton
|
||||||
|
(the XML schema is experimental)
|
||||||
|
.SS "Warning categories include:"
|
||||||
|
.TP
|
||||||
|
`midrule\-values'
|
||||||
|
unset or unused midrule values
|
||||||
|
.TP
|
||||||
|
`yacc'
|
||||||
|
incompatibilities with POSIX YACC
|
||||||
|
.TP
|
||||||
|
`all'
|
||||||
|
all the warnings
|
||||||
|
.TP
|
||||||
|
`no\-CATEGORY'
|
||||||
|
turn off warnings in CATEGORY
|
||||||
|
.TP
|
||||||
|
`none'
|
||||||
|
turn off all the warnings
|
||||||
|
.TP
|
||||||
|
`error'
|
||||||
|
treat warnings as errors
|
||||||
|
.SS "THINGS is a list of comma separated words that can include:"
|
||||||
|
.TP
|
||||||
|
`state'
|
||||||
|
describe the states
|
||||||
|
.TP
|
||||||
|
`itemset'
|
||||||
|
complete the core item sets with their closure
|
||||||
|
.TP
|
||||||
|
`lookahead'
|
||||||
|
explicitly associate lookahead tokens to items
|
||||||
|
.TP
|
||||||
|
`solved'
|
||||||
|
describe shift/reduce conflicts solving
|
||||||
|
.TP
|
||||||
|
`all'
|
||||||
|
include all the above information
|
||||||
|
.TP
|
||||||
|
`none'
|
||||||
|
disable the report
|
||||||
|
.SH AUTHOR
|
||||||
|
Written by Robert Corbett and Richard Stallman.
|
||||||
|
.SH "REPORTING BUGS"
|
||||||
|
Report bugs to <bug\-[email protected]>.
|
||||||
|
.SH COPYRIGHT
|
||||||
|
Copyright \(co 2007 Free Software Foundation, Inc.
|
||||||
|
.br
|
||||||
|
This is free software; see the source for copying conditions. There is NO
|
||||||
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
.BR lex (1),
|
||||||
|
.BR flex (1),
|
||||||
|
.BR yacc (1).
|
||||||
|
.PP
|
||||||
|
The full documentation for
|
||||||
|
.B bison
|
||||||
|
is maintained as a Texinfo manual. If the
|
||||||
|
.B info
|
||||||
|
and
|
||||||
|
.B bison
|
||||||
|
programs are properly installed at your site, the command
|
||||||
|
.IP
|
||||||
|
.B info bison
|
||||||
|
.PP
|
||||||
|
should give you access to the complete manual.
|
||||||
+2808
-6422
File diff suppressed because it is too large
Load Diff
+1
-6
@@ -39,7 +39,7 @@ This description of the options that can be given to
|
|||||||
is adapted from the node
|
is adapted from the node
|
||||||
.B Invocation
|
.B Invocation
|
||||||
in the
|
in the
|
||||||
.B bison.texi
|
.B bison.texinfo
|
||||||
manual, which should be taken as authoritative.
|
manual, which should be taken as authoritative.
|
||||||
.PP
|
.PP
|
||||||
.I Bison
|
.I Bison
|
||||||
@@ -53,8 +53,3 @@ are unique. When a long option takes an argument, like
|
|||||||
.BR \-\-file-prefix ,
|
.BR \-\-file-prefix ,
|
||||||
connect the option name and the argument with
|
connect the option name and the argument with
|
||||||
.BR = .
|
.BR = .
|
||||||
|
|
||||||
[see also]
|
|
||||||
.BR lex (1),
|
|
||||||
.BR flex (1),
|
|
||||||
.BR yacc (1).
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
[see also]
|
||||||
|
.BR lex (1),
|
||||||
|
.BR flex (1),
|
||||||
|
.BR yacc (1).
|
||||||
+451
@@ -0,0 +1,451 @@
|
|||||||
|
@c The GNU Free Documentation License.
|
||||||
|
@center Version 1.2, November 2002
|
||||||
|
|
||||||
|
@c This file is intended to be included within another document,
|
||||||
|
@c hence no sectioning command or @node.
|
||||||
|
|
||||||
|
@display
|
||||||
|
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
|
||||||
|
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
|
||||||
|
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
|
||||||
|
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
|
||||||
|
format, @acronym{SGML} or @acronym{XML} using a publicly available
|
||||||
|
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
|
||||||
|
PostScript or @acronym{PDF} designed for human modification. Examples
|
||||||
|
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
|
||||||
|
@acronym{JPG}. Opaque formats include proprietary formats that can be
|
||||||
|
read and edited only by proprietary word processors, @acronym{SGML} or
|
||||||
|
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
|
||||||
|
not generally available, and the machine-generated @acronym{HTML},
|
||||||
|
PostScript or @acronym{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.
|
||||||
|
|
||||||
|
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 for under this License. Any other attempt to
|
||||||
|
copy, modify, sublicense or distribute the Document is void, and will
|
||||||
|
automatically terminate your rights under this License. However,
|
||||||
|
parties who have received copies, or rights, from you under this
|
||||||
|
License will not have their licenses terminated so long as such
|
||||||
|
parties remain in full compliance.
|
||||||
|
|
||||||
|
@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{http://www.gnu.org/copyleft/}.
|
||||||
|
|
||||||
|
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.
|
||||||
|
@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.2
|
||||||
|
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:
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
digraph "reduce.y"
|
|
||||||
{
|
|
||||||
node [fontname=courier shape=box]
|
|
||||||
edge [fontname=courier]
|
|
||||||
|
|
||||||
1 [label="State 1\n 3 a: \"0\" . [\".\"]\l 4 b: \"0\" . [\";\"]\l"]
|
|
||||||
1 -> "1R3" [label="" style=solid]
|
|
||||||
"1R3" [style=filled shape=diamond fillcolor=yellowgreen label="R3"]
|
|
||||||
1 -> "1R4" [label="[\";\"]" style=solid]
|
|
||||||
"1R4" [style=filled shape=diamond fillcolor=yellowgreen label="R4"]
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
.------------------.
|
|
||||||
| State 1 |
|
|
||||||
| 3 a: "0" . [";"] |
|
|
||||||
| 4 b: "0" . ["."] |
|
|
||||||
`------------------'
|
|
||||||
/ \
|
|
||||||
/ \ ["."]
|
|
||||||
/ \
|
|
||||||
v v
|
|
||||||
/ \ / \
|
|
||||||
/ R \ / R \
|
|
||||||
(green) \ 3 / \ 4 / (green)
|
|
||||||
\ / \ /
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
digraph "shift.y"
|
|
||||||
{
|
|
||||||
node [fontname=courier shape=box]
|
|
||||||
edge [fontname=courier]
|
|
||||||
|
|
||||||
3 [label="State 3\n 1 exp: a . \".\"\l"]
|
|
||||||
3 -> 6 [style=solid label="\".\""]
|
|
||||||
6 [label="State 6\n 1 exp: a \".\" .\l"]
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
.----------------.
|
|
||||||
| State 3 |
|
|
||||||
| 1 exp: a . ";" |
|
|
||||||
`----------------'
|
|
||||||
|
|
|
||||||
| ";"
|
|
||||||
|
|
|
||||||
v
|
|
||||||
.----------------.
|
|
||||||
| State 6 |
|
|
||||||
| 1 exp: a ";" . |
|
|
||||||
`----------------'
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
// Generated by GNU Bison 2.6.90.
|
|
||||||
// Report bugs to <[email protected]>.
|
|
||||||
// Home page: <http://www.gnu.org/software/bison/>.
|
|
||||||
|
|
||||||
digraph "/tmp/fo.y"
|
|
||||||
{
|
|
||||||
node [fontname = courier, shape = box, colorscheme = paired6]
|
|
||||||
edge [fontname = courier]
|
|
||||||
|
|
||||||
0 [label="State 0\n\l 0 $accept: . exp $end\l 1 exp: . a \";\"\l 2 | . b \".\"\l 3 a: . \"0\"\l 4 b: . \"0\"\l"]
|
|
||||||
0 -> 1 [style=solid label="\"0\""]
|
|
||||||
0 -> 2 [style=dashed label="exp"]
|
|
||||||
0 -> 3 [style=dashed label="a"]
|
|
||||||
0 -> 4 [style=dashed label="b"]
|
|
||||||
1 [label="State 1\n\l 3 a: \"0\" . [\";\"]\l 4 b: \"0\" . [\".\"]\l"]
|
|
||||||
1 -> "1R3" [style=solid]
|
|
||||||
"1R3" [label="R3", fillcolor=3, shape=diamond, style=filled]
|
|
||||||
1 -> "1R4" [label="[\".\"]", style=solid]
|
|
||||||
"1R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
|
|
||||||
2 [label="State 2\n\l 0 $accept: exp . $end\l"]
|
|
||||||
2 -> 5 [style=solid label="$end"]
|
|
||||||
3 [label="State 3\n\l 1 exp: a . \";\"\l"]
|
|
||||||
3 -> 6 [style=solid label="\";\""]
|
|
||||||
4 [label="State 4\n\l 2 exp: b . \".\"\l"]
|
|
||||||
4 -> 7 [style=solid label="\".\""]
|
|
||||||
5 [label="State 5\n\l 0 $accept: exp $end .\l"]
|
|
||||||
5 -> "5R0" [style=solid]
|
|
||||||
"5R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
|
|
||||||
6 [label="State 6\n\l 1 exp: a \";\" .\l"]
|
|
||||||
6 -> "6R1" [style=solid]
|
|
||||||
"6R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
|
|
||||||
7 [label="State 7\n\l 2 exp: b \".\" .\l"]
|
|
||||||
7 -> "7R2" [style=solid]
|
|
||||||
"7R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
This file is a stub, not used by the documentation. If you feel like
|
|
||||||
contributing ASCII art for example.gv, please step forward!
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
%%
|
|
||||||
exp: a ";" | b ".";
|
|
||||||
a: "0";
|
|
||||||
b: "0";
|
|
||||||
@@ -0,0 +1,717 @@
|
|||||||
|
@c The GNU General Public License.
|
||||||
|
@center Version 3, 29 June 2007
|
||||||
|
|
||||||
|
@c This file is intended to be included within another document,
|
||||||
|
@c hence no sectioning command or @node.
|
||||||
|
|
||||||
|
@display
|
||||||
|
Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies of this
|
||||||
|
license document, but changing it is not allowed.
|
||||||
|
@end display
|
||||||
|
|
||||||
|
@heading Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom
|
||||||
|
to share and change all versions of a program---to make sure it remains
|
||||||
|
free software for all its users. We, the Free Software Foundation,
|
||||||
|
use the GNU General Public License for most of our software; it
|
||||||
|
applies also to any other work released this way by its authors. You
|
||||||
|
can apply it to your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you
|
||||||
|
have certain responsibilities if you distribute copies of the
|
||||||
|
software, or if you modify it: responsibilities to respect the freedom
|
||||||
|
of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too,
|
||||||
|
receive or can get the source code. And you must show them these
|
||||||
|
terms so they know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the
|
||||||
|
manufacturer can do so. This is fundamentally incompatible with the
|
||||||
|
aim of protecting users' freedom to change the software. The
|
||||||
|
systematic pattern of such abuse occurs in the area of products for
|
||||||
|
individuals to use, which is precisely where it is most unacceptable.
|
||||||
|
Therefore, we have designed this version of the GPL to prohibit the
|
||||||
|
practice for those products. If such problems arise substantially in
|
||||||
|
other domains, we stand ready to extend this provision to those
|
||||||
|
domains in future versions of the GPL, as needed to protect the
|
||||||
|
freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish
|
||||||
|
to avoid the special danger that patents applied to a free program
|
||||||
|
could make it effectively proprietary. To prevent this, the GPL
|
||||||
|
assures that patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
@heading TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
@enumerate 0
|
||||||
|
@item Definitions.
|
||||||
|
|
||||||
|
``This License'' refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
``Copyright'' also means copyright-like laws that apply to other kinds
|
||||||
|
of works, such as semiconductor masks.
|
||||||
|
|
||||||
|
``The Program'' refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as ``you''. ``Licensees'' and
|
||||||
|
``recipients'' may be individuals or organizations.
|
||||||
|
|
||||||
|
To ``modify'' a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of
|
||||||
|
an exact copy. The resulting work is called a ``modified version'' of
|
||||||
|
the earlier work or a work ``based on'' the earlier work.
|
||||||
|
|
||||||
|
A ``covered work'' means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To ``propagate'' a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To ``convey'' a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user
|
||||||
|
through a computer network, with no transfer of a copy, is not
|
||||||
|
conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays ``Appropriate Legal Notices'' to
|
||||||
|
the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
@item Source Code.
|
||||||
|
|
||||||
|
The ``source code'' for a work means the preferred form of the work for
|
||||||
|
making modifications to it. ``Object code'' means any non-source form
|
||||||
|
of a work.
|
||||||
|
|
||||||
|
A ``Standard Interface'' means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The ``System Libraries'' of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
``Major Component'', in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The ``Corresponding Source'' for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users can
|
||||||
|
regenerate automatically from other parts of the Corresponding Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that same
|
||||||
|
work.
|
||||||
|
|
||||||
|
@item Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not convey,
|
||||||
|
without conditions so long as your license otherwise remains in force.
|
||||||
|
You may convey covered works to others for the sole purpose of having
|
||||||
|
them make modifications exclusively for you, or provide you with
|
||||||
|
facilities for running those works, provided that you comply with the
|
||||||
|
terms of this License in conveying all material for which you do not
|
||||||
|
control copyright. Those thus making or running the covered works for
|
||||||
|
you must do so exclusively on your behalf, under your direction and
|
||||||
|
control, on terms that prohibit them from making any copies of your
|
||||||
|
copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under the
|
||||||
|
conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
@item Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such
|
||||||
|
circumvention is effected by exercising rights under this License with
|
||||||
|
respect to the covered work, and you disclaim any intention to limit
|
||||||
|
operation or modification of the work as a means of enforcing, against
|
||||||
|
the work's users, your or third parties' legal rights to forbid
|
||||||
|
circumvention of technological measures.
|
||||||
|
|
||||||
|
@item Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
@item Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these
|
||||||
|
conditions:
|
||||||
|
|
||||||
|
@enumerate a
|
||||||
|
@item
|
||||||
|
The work must carry prominent notices stating that you modified it,
|
||||||
|
and giving a relevant date.
|
||||||
|
|
||||||
|
@item
|
||||||
|
The work must carry prominent notices stating that it is released
|
||||||
|
under this License and any conditions added under section 7. This
|
||||||
|
requirement modifies the requirement in section 4 to ``keep intact all
|
||||||
|
notices''.
|
||||||
|
|
||||||
|
@item
|
||||||
|
You must license the entire work, as a whole, under this License to
|
||||||
|
anyone who comes into possession of a copy. This License will
|
||||||
|
therefore apply, along with any applicable section 7 additional terms,
|
||||||
|
to the whole of the work, and all its parts, regardless of how they
|
||||||
|
are packaged. This License gives no permission to license the work in
|
||||||
|
any other way, but it does not invalidate such permission if you have
|
||||||
|
separately received it.
|
||||||
|
|
||||||
|
@item
|
||||||
|
If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your work
|
||||||
|
need not make them do so.
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
``aggregate'' if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
@item Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms of
|
||||||
|
sections 4 and 5, provided that you also convey the machine-readable
|
||||||
|
Corresponding Source under the terms of this License, in one of these
|
||||||
|
ways:
|
||||||
|
|
||||||
|
@enumerate a
|
||||||
|
@item
|
||||||
|
Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium customarily
|
||||||
|
used for software interchange.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a written
|
||||||
|
offer, valid for at least three years and valid for as long as you
|
||||||
|
offer spare parts or customer support for that product model, to give
|
||||||
|
anyone who possesses the object code either (1) a copy of the
|
||||||
|
Corresponding Source for all the software in the product that is
|
||||||
|
covered by this License, on a durable physical medium customarily used
|
||||||
|
for software interchange, for a price no more than your reasonable
|
||||||
|
cost of physically performing this conveying of source, or (2) access
|
||||||
|
to copy the Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Convey individual copies of the object code with a copy of the written
|
||||||
|
offer to provide the Corresponding Source. This alternative is
|
||||||
|
allowed only occasionally and noncommercially, and only if you
|
||||||
|
received the object code with such an offer, in accord with subsection
|
||||||
|
6b.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Convey the object code by offering access from a designated place
|
||||||
|
(gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to copy
|
||||||
|
the object code is a network server, the Corresponding Source may be
|
||||||
|
on a different server (operated by you or a third party) that supports
|
||||||
|
equivalent copying facilities, provided you maintain clear directions
|
||||||
|
next to the object code saying where to find the Corresponding Source.
|
||||||
|
Regardless of what server hosts the Corresponding Source, you remain
|
||||||
|
obligated to ensure that it is available for as long as needed to
|
||||||
|
satisfy these requirements.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Convey the object code using peer-to-peer transmission, provided you
|
||||||
|
inform other peers where the object code and Corresponding Source of
|
||||||
|
the work are being offered to the general public at no charge under
|
||||||
|
subsection 6d.
|
||||||
|
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A ``User Product'' is either (1) a ``consumer product'', which means any
|
||||||
|
tangible personal property which is normally used for personal,
|
||||||
|
family, or household purposes, or (2) anything designed or sold for
|
||||||
|
incorporation into a dwelling. In determining whether a product is a
|
||||||
|
consumer product, doubtful cases shall be resolved in favor of
|
||||||
|
coverage. For a particular product received by a particular user,
|
||||||
|
``normally used'' refers to a typical or common use of that class of
|
||||||
|
product, regardless of the status of the particular user or of the way
|
||||||
|
in which the particular user actually uses, or expects or is expected
|
||||||
|
to use, the product. A product is a consumer product regardless of
|
||||||
|
whether the product has substantial commercial, industrial or
|
||||||
|
non-consumer uses, unless such uses represent the only significant
|
||||||
|
mode of use of the product.
|
||||||
|
|
||||||
|
``Installation Information'' for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to
|
||||||
|
install and execute modified versions of a covered work in that User
|
||||||
|
Product from a modified version of its Corresponding Source. The
|
||||||
|
information must suffice to ensure that the continued functioning of
|
||||||
|
the modified object code is in no case prevented or interfered with
|
||||||
|
solely because modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or
|
||||||
|
updates for a work that has been modified or installed by the
|
||||||
|
recipient, or for the User Product in which it has been modified or
|
||||||
|
installed. Access to a network may be denied when the modification
|
||||||
|
itself materially and adversely affects the operation of the network
|
||||||
|
or violates the rules and protocols for communication across the
|
||||||
|
network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
@item Additional Terms.
|
||||||
|
|
||||||
|
``Additional permissions'' are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders
|
||||||
|
of that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
@enumerate a
|
||||||
|
@item
|
||||||
|
Disclaiming warranty or limiting liability differently from the terms
|
||||||
|
of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
@item
|
||||||
|
Requiring preservation of specified reasonable legal notices or author
|
||||||
|
attributions in that material or in the Appropriate Legal Notices
|
||||||
|
displayed by works containing it; or
|
||||||
|
|
||||||
|
@item
|
||||||
|
Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
@item
|
||||||
|
Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
@item
|
||||||
|
Declining to grant rights under trademark law for use of some trade
|
||||||
|
names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
@item
|
||||||
|
Requiring indemnification of licensors and authors of that material by
|
||||||
|
anyone who conveys the material (or modified versions of it) with
|
||||||
|
contractual assumptions of liability to the recipient, for any
|
||||||
|
liability that these contractual assumptions directly impose on those
|
||||||
|
licensors and authors.
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered ``further
|
||||||
|
restrictions'' within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions; the
|
||||||
|
above requirements apply either way.
|
||||||
|
|
||||||
|
@item Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
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, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
@item Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or run
|
||||||
|
a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
@item Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An ``entity transaction'' is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
@item Patents.
|
||||||
|
|
||||||
|
A ``contributor'' is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's ``contributor version''.
|
||||||
|
|
||||||
|
A contributor's ``essential patent claims'' are all patent claims owned
|
||||||
|
or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, ``control'' includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a ``patent license'' is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To ``grant'' such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. ``Knowingly relying'' means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is ``discriminatory'' if it does not include within the
|
||||||
|
scope of its coverage, prohibits the exercise of, or is conditioned on
|
||||||
|
the non-exercise of one or more of the rights that are specifically
|
||||||
|
granted under this License. You may not convey a covered work if you
|
||||||
|
are a party to an arrangement with a third party that is in the
|
||||||
|
business of distributing software, under which you make payment to the
|
||||||
|
third party based on the extent of your activity of conveying the
|
||||||
|
work, and under which the third party grants, to any of the parties
|
||||||
|
who would receive the covered work from you, a discriminatory patent
|
||||||
|
license (a) in connection with copies of the covered work conveyed by
|
||||||
|
you (or copies made from those copies), or (b) primarily for and in
|
||||||
|
connection with specific products or compilations that contain the
|
||||||
|
covered work, unless you entered into that arrangement, or that patent
|
||||||
|
license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
@item No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey
|
||||||
|
a covered work so as to satisfy simultaneously your obligations under
|
||||||
|
this License and any other pertinent obligations, then as a
|
||||||
|
consequence you may not convey it at all. For example, if you agree
|
||||||
|
to terms that obligate you to collect a royalty for further conveying
|
||||||
|
from those to whom you convey the Program, the only way you could
|
||||||
|
satisfy both those terms and this License would be to refrain entirely
|
||||||
|
from conveying the Program.
|
||||||
|
|
||||||
|
@item Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
@item Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU General Public 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.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program
|
||||||
|
specifies that a certain numbered version of the GNU General Public
|
||||||
|
License ``or any later version'' applies to it, you have the option of
|
||||||
|
following the terms and conditions either of that numbered version or
|
||||||
|
of any later version published by the Free Software Foundation. If
|
||||||
|
the Program does not specify a version number of the GNU General
|
||||||
|
Public License, you may choose any version ever published by the Free
|
||||||
|
Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future versions
|
||||||
|
of the GNU General Public License can be used, that proxy's public
|
||||||
|
statement of acceptance of a version permanently authorizes you to
|
||||||
|
choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
@item Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
|
||||||
|
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||||
|
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||||
|
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||||
|
CORRECTION.
|
||||||
|
|
||||||
|
@item Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
||||||
|
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||||
|
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
||||||
|
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
||||||
|
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
||||||
|
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||||
|
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
@item Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
@heading END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
@heading How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these
|
||||||
|
terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the ``copyright'' line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
@var{one line to give the program's name and a brief idea of what it does.}
|
||||||
|
Copyright (C) @var{year} @var{name of author}
|
||||||
|
|
||||||
|
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 @url{http://www.gnu.org/licenses/}.
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
@var{program} Copyright (C) @var{year} @var{name of author}
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type @samp{show c} for details.
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
The hypothetical commands @samp{show w} and @samp{show c} should show
|
||||||
|
the appropriate parts of the General Public License. Of course, your
|
||||||
|
program's commands might be different; for a GUI interface, you would
|
||||||
|
use an ``about box''.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a ``copyright disclaimer'' for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
@url{http://www.gnu.org/licenses/}.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your
|
||||||
|
program into proprietary programs. If your program is a subroutine
|
||||||
|
library, you may consider it more useful to permit linking proprietary
|
||||||
|
applications with the library. If this is what you want to do, use
|
||||||
|
the GNU Lesser General Public License instead of this License. But
|
||||||
|
first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
|
||||||
-184
@@ -1,184 +0,0 @@
|
|||||||
## Copyright (C) 2001-2003, 2005-2015, 2018 Free Software Foundation,
|
|
||||||
## Inc.
|
|
||||||
|
|
||||||
## This program is free software: you can redistribute it and/or modify
|
|
||||||
## it under the terms of the GNU General Public License as published by
|
|
||||||
## the Free Software Foundation, either version 3 of the License, or
|
|
||||||
## (at your option) any later version.
|
|
||||||
##
|
|
||||||
## This program is distributed in the hope that it will be useful,
|
|
||||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
## GNU General Public License for more details.
|
|
||||||
##
|
|
||||||
## You should have received a copy of the GNU General Public License
|
|
||||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
AM_MAKEINFOFLAGS = --no-split
|
|
||||||
info_TEXINFOS = doc/bison.texi
|
|
||||||
doc_bison_TEXINFOS = \
|
|
||||||
$(CROSS_OPTIONS_TEXI) \
|
|
||||||
doc/fdl.texi \
|
|
||||||
doc/gpl-3.0.texi
|
|
||||||
|
|
||||||
# Cannot express dependencies directly on file names because of Automake.
|
|
||||||
# Obfuscate with a variable.
|
|
||||||
doc_bison = doc/bison
|
|
||||||
$(doc_bison).dvi: $(FIGS_GV:.gv=.eps)
|
|
||||||
$(doc_bison).info: $(FIGS_GV:.gv=.txt)
|
|
||||||
$(doc_bison).pdf: $(FIGS_GV:.gv=.pdf)
|
|
||||||
$(doc_bison).html: $(FIGS_GV:.gv=.png)
|
|
||||||
|
|
||||||
TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d -I doc
|
|
||||||
CLEANDIRS += doc/bison.t2d
|
|
||||||
|
|
||||||
MOSTLYCLEANFILES += $(top_srcdir)/doc/*.t
|
|
||||||
|
|
||||||
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
|
||||||
CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi
|
|
||||||
$(CROSS_OPTIONS_TEXI): doc/bison.help $(CROSS_OPTIONS_PL)
|
|
||||||
# Create $@~ which is the previous contents. Don't use 'mv' here so
|
|
||||||
# that even if we are interrupted, the file is still available for
|
|
||||||
# diff in the next run. Note that $@ might not exist yet.
|
|
||||||
$(AM_V_GEN){ test ! -f $@ || cat $@; } >$@~
|
|
||||||
$(AM_V_at)test ! -f $@.tmp || rm -f $@.tmp
|
|
||||||
$(AM_V_at)src/bison$(EXEEXT) --help | \
|
|
||||||
$(PERL) $(CROSS_OPTIONS_PL) $(top_srcdir)/src/scan-gram.l >$@.tmp
|
|
||||||
$(AM_V_at)diff -u $@~ $@.tmp || true
|
|
||||||
$(AM_V_at)mv $@.tmp $@
|
|
||||||
MAINTAINERCLEANFILES = $(CROSS_OPTIONS_TEXI)
|
|
||||||
|
|
||||||
## ---------- ##
|
|
||||||
## Ref card. ##
|
|
||||||
## ---------- ##
|
|
||||||
|
|
||||||
EXTRA_DIST += doc/refcard.tex
|
|
||||||
CLEANFILES += doc/refcard.pdf
|
|
||||||
|
|
||||||
doc/refcard.pdf: doc/refcard.tex
|
|
||||||
$(AM_V_GEN) cd doc && pdftex $(abs_top_srcdir)/doc/refcard.tex
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------- ##
|
|
||||||
## doc/bison.help. ##
|
|
||||||
## ---------------- ##
|
|
||||||
|
|
||||||
# Some of our targets (cross-option.texi, bison.1) use "bison --help".
|
|
||||||
# Since we want to ship the generated file to avoid additional
|
|
||||||
# requirements over the user environment, we used not depend on
|
|
||||||
# src/bison itself, but on src/getargs.c and other files. Yet, we
|
|
||||||
# need "bison --help" to work to make help2man happy, so we used to
|
|
||||||
# include "make src/bison" in the commands. Then we may have a
|
|
||||||
# problem with concurrent builds, since one make might be aiming one
|
|
||||||
# of its jobs at compiling src/bison, and another job at generating
|
|
||||||
# the man page. If the latter is faster than the former, then we have
|
|
||||||
# two makes that concurrently try to compile src/bison. Doomed to
|
|
||||||
# failure.
|
|
||||||
#
|
|
||||||
# As a simple scheme to get our way out, make a stamp file,
|
|
||||||
# bison.help, which contains --version then --help. This file can
|
|
||||||
# depend on bison, which ensures its correctness. But update it
|
|
||||||
# *only* if needed (content changes). This way, we avoid useless
|
|
||||||
# compilations of cross-option.texi and bison.1. At the cost of
|
|
||||||
# repeated builds of bison.help.
|
|
||||||
|
|
||||||
EXTRA_DIST += $(top_srcdir)/doc/bison.help
|
|
||||||
if ! CROSS_COMPILING
|
|
||||||
MAINTAINERCLEANFILES += $(top_srcdir)/doc/bison.help
|
|
||||||
$(top_srcdir)/doc/bison.help: src/bison$(EXEEXT)
|
|
||||||
$(AM_V_GEN)src/bison$(EXEEXT) --version >doc/bison.help.tmp
|
|
||||||
$(AM_V_at) src/bison$(EXEEXT) --help >>doc/bison.help.tmp
|
|
||||||
$(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.tmp $@
|
|
||||||
endif ! CROSS_COMPILING
|
|
||||||
|
|
||||||
|
|
||||||
## ----------- ##
|
|
||||||
## Man Pages. ##
|
|
||||||
## ----------- ##
|
|
||||||
|
|
||||||
dist_man_MANS = $(top_srcdir)/doc/bison.1
|
|
||||||
|
|
||||||
EXTRA_DIST += $(dist_man_MANS:.1=.x)
|
|
||||||
MAINTAINERCLEANFILES += $(dist_man_MANS)
|
|
||||||
|
|
||||||
# Differences to ignore when comparing the man page (the date).
|
|
||||||
remove_time_stamp = \
|
|
||||||
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
|
|
||||||
|
|
||||||
# Depend on configure to get version number changes.
|
|
||||||
if ! CROSS_COMPILING
|
|
||||||
MAN_DEPS = doc/bison.help doc/bison.x $(top_srcdir)/configure
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(top_srcdir)/doc/bison.1: $(MAN_DEPS)
|
|
||||||
$(AM_V_GEN)$(HELP2MAN) \
|
|
||||||
--include=$(top_srcdir)/doc/bison.x \
|
|
||||||
--output=$@.t src/bison$(EXEEXT)
|
|
||||||
$(AM_V_at)if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
|
|
||||||
$(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
|
|
||||||
touch $@; \
|
|
||||||
else \
|
|
||||||
mv $@.t $@; \
|
|
||||||
fi
|
|
||||||
$(AM_V_at)rm -f $@*.t
|
|
||||||
|
|
||||||
if ENABLE_YACC
|
|
||||||
nodist_man_MANS = doc/yacc.1
|
|
||||||
endif
|
|
||||||
|
|
||||||
## ----------------------------- ##
|
|
||||||
## Graphviz examples generation. ##
|
|
||||||
## ----------------------------- ##
|
|
||||||
|
|
||||||
CLEANFILES += $(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) $(FIGS_GV:.gv=.png)
|
|
||||||
FIGS_GV = \
|
|
||||||
doc/figs/example.gv \
|
|
||||||
doc/figs/example-reduce.gv doc/figs/example-shift.gv
|
|
||||||
EXTRA_DIST += \
|
|
||||||
$(FIGS_GV) $(FIGS_GV:.gv=.txt) \
|
|
||||||
$(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) $(FIGS_GV:.gv=.png)
|
|
||||||
SUFFIXES += .gv .eps .pdf .png
|
|
||||||
|
|
||||||
.gv.eps:
|
|
||||||
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
|
||||||
$(AM_V_at) $(DOT) -Gmargin=0 -Teps $< >$@.tmp
|
|
||||||
$(AM_V_at) mv $@.tmp $@
|
|
||||||
|
|
||||||
.gv.pdf:
|
|
||||||
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
|
||||||
$(AM_V_at) $(DOT) -Gmargin=0 -Tpdf $< >$@.tmp
|
|
||||||
$(AM_V_at) mv $@.tmp $@
|
|
||||||
|
|
||||||
.gv.png:
|
|
||||||
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
|
||||||
$(AM_V_at) $(DOT) -Gmargin=0 -Tpng $< >$@.tmp
|
|
||||||
$(AM_V_at) mv $@.tmp $@
|
|
||||||
|
|
||||||
## -------------- ##
|
|
||||||
## Doxygenation. ##
|
|
||||||
## -------------- ##
|
|
||||||
|
|
||||||
DOXYGEN = doxygen
|
|
||||||
|
|
||||||
.PHONY: doc html
|
|
||||||
|
|
||||||
doc: html
|
|
||||||
|
|
||||||
html-local: doc/Doxyfile
|
|
||||||
$(AM_V_GEN) $(DOXYGEN) doc/Doxyfile
|
|
||||||
|
|
||||||
edit = sed -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
|
|
||||||
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
|
|
||||||
-e 's,@PERL\@,$(PERL),g' \
|
|
||||||
-e 's,@top_builddir\@,$(top_builddir),g' \
|
|
||||||
-e 's,@top_srcdir\@,$(top_srcdir),g'
|
|
||||||
|
|
||||||
EXTRA_DIST += doc/Doxyfile.in
|
|
||||||
CLEANFILES += doc/Doxyfile
|
|
||||||
# Sed is used to generate Doxyfile from Doxyfile.in instead of
|
|
||||||
# configure, because the former is way faster than the latter.
|
|
||||||
doc/Doxyfile: $(top_srcdir)/doc/Doxyfile.in
|
|
||||||
$(AM_V_GEN) $(edit) $(top_srcdir)/doc/Doxyfile.in >doc/Doxyfile
|
|
||||||
|
|
||||||
CLEANDIRS += doc/html
|
|
||||||
+1
-2
@@ -19,8 +19,7 @@
|
|||||||
\def\finalout{\overfullrule=0pt}
|
\def\finalout{\overfullrule=0pt}
|
||||||
%\finalout
|
%\finalout
|
||||||
|
|
||||||
% Copyright (c) 1998, 2001, 2009-2015, 2018 Free Software Foundation,
|
% Copyright (c) 1998, 2001 Free Software Foundation, Inc.
|
||||||
% Inc.
|
|
||||||
%
|
%
|
||||||
% This file is part of Bison.
|
% This file is part of Bison.
|
||||||
%
|
%
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
bench.pl
|
||||||
@@ -1 +0,0 @@
|
|||||||
/bench.pl
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user