mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-08 10:15:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf31619762 | ||
|
|
31a743b2bb | ||
|
|
48b43d9d83 | ||
|
|
4b9e71f993 | ||
|
|
16cd214585 | ||
|
|
f2c7ab2c1f | ||
|
|
2c377512c2 | ||
|
|
74c3b26d85 | ||
|
|
72ab1d45d2 | ||
|
|
d9302e4b73 | ||
|
|
f1394282f0 | ||
|
|
d8b1af2801 | ||
|
|
445cb4e989 | ||
|
|
f40703a29a | ||
|
|
e348b12ae0 | ||
|
|
ba6f6bf90f | ||
|
|
d9af6cc62f | ||
|
|
ab30845981 | ||
|
|
0b3870c112 | ||
|
|
e92a5d5bae | ||
|
|
02cbcfc577 | ||
|
|
8c67836b58 | ||
|
|
cae30a7df4 | ||
|
|
9fb2ad6738 | ||
|
|
8bce355d7c | ||
|
|
ae7c7ada67 | ||
|
|
9e42f7b625 | ||
|
|
f87fc33f87 | ||
|
|
7ba81a101f | ||
|
|
9190f3e726 | ||
|
|
330de47708 | ||
|
|
bb84601097 | ||
|
|
9a96ccfa20 | ||
|
|
6051d37287 | ||
|
|
2aec1bc1de | ||
|
|
c6e1f6235a | ||
|
|
ab6fbb02ad | ||
|
|
f2632e420f | ||
|
|
19f01e885f | ||
|
|
6792619fa8 | ||
|
|
645ff8cdee | ||
|
|
a726df0b44 | ||
|
|
ce209526ed | ||
|
|
b94bf14aac | ||
|
|
2a4426474d | ||
|
|
9022c575cc | ||
|
|
dae9263b7b | ||
|
|
cdd11a9322 | ||
|
|
da7ab9b7b0 | ||
|
|
0899b02570 | ||
|
|
0f23d6d25b | ||
|
|
47cef7a2ff | ||
|
|
7972022dac | ||
|
|
ea4f4c4c1b | ||
|
|
d97207ad77 | ||
|
|
3068221b53 | ||
|
|
6f0d1fd89d | ||
|
|
6526f6dbf7 | ||
|
|
817e461c23 | ||
|
|
c4e3dae3ac | ||
|
|
8cedc168fa | ||
|
|
3b14996787 | ||
|
|
041cad1677 | ||
|
|
31478b7ab7 | ||
|
|
e957bbb7d4 | ||
|
|
b5f513ef2c | ||
|
|
3afa674b1d | ||
|
|
ac481f3b08 | ||
|
|
010c94a243 | ||
|
|
d37a7c45b3 | ||
|
|
d63e24071f | ||
|
|
afd36419df | ||
|
|
6918b5fcc9 | ||
|
|
38e616f0f5 | ||
|
|
db433e9db8 | ||
|
|
870f12c270 | ||
|
|
e0a53a7f4a | ||
|
|
27c1ceb8da | ||
|
|
8f5d3a2dd5 | ||
|
|
adfd774c80 | ||
|
|
057194c61e | ||
|
|
a6f622cd50 | ||
|
|
2b8ce46775 | ||
|
|
19553c4e06 | ||
|
|
b1722803ec | ||
|
|
6f5e0eea04 | ||
|
|
e4ad4676be | ||
|
|
7b50efe542 | ||
|
|
cf90ca5d46 | ||
|
|
e373aad966 | ||
|
|
3e4c37cf7b | ||
|
|
dfaa776005 | ||
|
|
aecd294cb0 | ||
|
|
52eddd8c33 | ||
|
|
60403d1bc1 | ||
|
|
dd9f12de60 | ||
|
|
6085f203e1 | ||
|
|
7a360eeaed | ||
|
|
af550e2927 | ||
|
|
78632bbcdc | ||
|
|
483c899a17 |
+12
@@ -0,0 +1,12 @@
|
||||
Makefile
|
||||
config.cache
|
||||
config.h
|
||||
config.log
|
||||
config.status
|
||||
stamp-h*
|
||||
bison-*
|
||||
patches
|
||||
*.patch *.log log patches applied
|
||||
*.prj
|
||||
releases
|
||||
autom4te.cache
|
||||
@@ -1,2 +0,0 @@
|
||||
*.at diff=autotest
|
||||
*.texi diff=texinfo
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
# To use this gitconfig file, run
|
||||
#
|
||||
# git config --local include.path ../.gitconfig
|
||||
#
|
||||
# It adds an `[include]` section in .git/config.
|
||||
# See <https://git-scm.com/docs/git-config#_includes>.
|
||||
|
||||
[diff "autotest"]
|
||||
xfuncname = "^((m4_define|m4_pushdef|AT_SETUP).*)$"
|
||||
|
||||
[diff "texinfo"]
|
||||
xfuncname = "^@node .*$"
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
*.a
|
||||
*.bak
|
||||
*.diff
|
||||
*.exe
|
||||
*.log
|
||||
*.o
|
||||
*.orig
|
||||
*.out
|
||||
*.output
|
||||
*.pdf
|
||||
*.rej
|
||||
*.stamp
|
||||
*.tmp
|
||||
*.trs
|
||||
*~
|
||||
.deps/
|
||||
.dirstamp
|
||||
/*.cache
|
||||
/*.flc
|
||||
/*.prj
|
||||
/.tarball-version
|
||||
/.version
|
||||
/ABOUT-NLS
|
||||
/COPYING
|
||||
/ChangeLog
|
||||
/GNUmakefile
|
||||
/INSTALL
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/README-release
|
||||
/_*
|
||||
/aclocal.m4
|
||||
/bison-*
|
||||
/build-aux/move-if-change
|
||||
/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.8.2
|
||||
@@ -1 +0,0 @@
|
||||
patch_list='Bison Patches <[email protected]>'
|
||||
-575
@@ -1,575 +0,0 @@
|
||||
version: ~> 1.0
|
||||
|
||||
# If the language is set to C or C++, Travis defines and exports CC
|
||||
# and CXX *after* we have defined our environment variables via 'env'.
|
||||
language: minimal
|
||||
|
||||
# Run in two steps:
|
||||
# 1. Build the tarball
|
||||
# On a modern distro, with all the needed dependencies, including the whole git history.
|
||||
# 2. Check it on various environments.
|
||||
# Less dependencies, and little git content (we would like to have none, but it's not
|
||||
# an option on Travis).
|
||||
stages:
|
||||
- dist
|
||||
- check
|
||||
|
||||
# The 'check' jobs do not need the repo at all, only the 'dist'
|
||||
# does. Let's save time, bandwith, energy, and polar bears.
|
||||
git:
|
||||
clone: false
|
||||
|
||||
# matrix.include and jobs.include are aliases
|
||||
# (https://docs.travis-ci.com/user/conditional-builds-stages-jobs/).
|
||||
jobs:
|
||||
include:
|
||||
- stage: dist
|
||||
name: "Make dist"
|
||||
git:
|
||||
clone: true
|
||||
dist: bionic
|
||||
script:
|
||||
- sudo apt-get install -qq autoconf automake autopoint flex gettext gperf graphviz help2man m4 texinfo
|
||||
- autoconf --version
|
||||
- automake --version
|
||||
- autopoint --version
|
||||
- dot -V
|
||||
- gettext --version
|
||||
- gperf --version
|
||||
- help2man --version
|
||||
- makeinfo --version
|
||||
- m4 --version
|
||||
|
||||
# Travis makes a shallow clone, but we need it in full to build the ChangeLog and apply the fixes in git-log-fix.
|
||||
- git fetch --unshallow || true
|
||||
- git submodule update --init --recursive
|
||||
|
||||
# As of 2021-08, we don't have Autoconf 2.71 on Ubuntu.
|
||||
- sed -i 's/AC_PREREQ(\[2\.71])/AC_PREREQ([2.69])/g' configure.ac
|
||||
- ./bootstrap
|
||||
- ./configure --enable-gcc-warnings || { cat config.log && false; }
|
||||
- make -j2
|
||||
- make -j2 dist-xz
|
||||
# Can help understanding why we get "dirty" tarballs.
|
||||
- git status
|
||||
- git diff
|
||||
- dist=$(echo bison*.xz)
|
||||
|
||||
# Unfortunately we cannot deterministically know the name of the tarball without the full
|
||||
# git history (because git describe --abbrev=4 may use more than 4 characters if there are
|
||||
# conflicts).
|
||||
#
|
||||
# So for the sake of the 'check' jobs (that don't even have the repo at all), also expose this
|
||||
# tarball on a name that only depends on the Travis build number.
|
||||
#
|
||||
# Without -b -, exit status is always 0.
|
||||
#
|
||||
# If we rerun a job that was already uploaded, 'ln -s' will fail: remove beforehand.
|
||||
- sftp -b - [email protected] <<< "put $dist"$'\n'"-rm bison-$TRAVIS_BUILD_NUMBER.tar.xz"$'\n'"ln -s $dist bison-$TRAVIS_BUILD_NUMBER.tar.xz"
|
||||
|
||||
## ------- ##
|
||||
## First. ##
|
||||
## ------- ##
|
||||
|
||||
# Start with three completely different environments, to get errors asap.
|
||||
|
||||
- name: "GCC 11 -O3"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons: &gcc11
|
||||
apt:
|
||||
sources:
|
||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
packages: g++-11
|
||||
env:
|
||||
- CC=gcc-11
|
||||
- CXX=g++-11
|
||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||
|
||||
# ASAN is time consuming, and we timeout the 50min granted by
|
||||
# Travis if we run all the tests in one go. Run in two parts.
|
||||
- name: "Clang 11 libc++ and ASAN part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons: &clang11
|
||||
apt:
|
||||
sources:
|
||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
packages:
|
||||
- clang-11
|
||||
- libc++-11-dev
|
||||
- libc++abi-11-dev
|
||||
env:
|
||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||
- CC='clang-11 -fsanitize=address'
|
||||
- CXX='clang++-11 -fsanitize=address -stdlib=libc++'
|
||||
- PART=1
|
||||
|
||||
- name: "Clang 11 libc++ and ASAN part 2"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons: *clang11
|
||||
env:
|
||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||
- CC='clang-11 -fsanitize=address'
|
||||
- CXX='clang++-11 -fsanitize=address -stdlib=libc++'
|
||||
- PART=2
|
||||
|
||||
# See https://github.com/simd-everywhere/simde/blob/master/.travis.yml
|
||||
# and https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-render-linux/top/configure-your-system.html.
|
||||
- name: "ICC"
|
||||
stage: check
|
||||
os: linux
|
||||
compiler: icc
|
||||
env:
|
||||
- CC=icc
|
||||
- CXX=icpc
|
||||
install:
|
||||
- source /opt/intel/oneapi/compiler/latest/env/vars.sh
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'deb https://apt.repos.intel.com/oneapi all main'
|
||||
key_url: 'https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB'
|
||||
packages:
|
||||
- intel-oneapi-icc
|
||||
|
||||
- name: "ARM64: GCC 11 -O2 part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
arch: arm64
|
||||
dist: bionic
|
||||
addons: *gcc11
|
||||
env:
|
||||
- CC=gcc-11
|
||||
- CXX=g++-11
|
||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O2 CXXFLAGS=-O2'
|
||||
- PART=1
|
||||
|
||||
- name: "PPC64le: GCC 11 -O2 part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
arch: ppc64le
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
packages: g++-11
|
||||
env:
|
||||
- CC=gcc-11
|
||||
- CXX=g++-11
|
||||
- CONFIGUREFLAGS='CFLAGS=-O2 CXXFLAGS=-O2'
|
||||
- PART=1
|
||||
|
||||
- name: "s390x: GCC 11 -O2 part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
arch: s390x
|
||||
dist: bionic
|
||||
addons: *gcc11
|
||||
env:
|
||||
- CC=gcc-11
|
||||
- CXX=g++-11
|
||||
- CONFIGUREFLAGS='CFLAGS=-O2 CXXFLAGS=-O2'
|
||||
- PART=1
|
||||
|
||||
## ----- ##
|
||||
## GCC. ##
|
||||
## ----- ##
|
||||
|
||||
- name: "GCC 10 with sanitizers part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
packages: g++-10
|
||||
env:
|
||||
- CC='gcc-10 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
||||
- CXX='g++-10 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
||||
- CONFIGUREFLAGS='CFLAGS=-O1 CXXFLAGS=-O1'
|
||||
- PART=1
|
||||
|
||||
# With glr2.cc, we run out of time with the full test suite.
|
||||
- name: "GCC 9 part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
packages: g++-9
|
||||
env:
|
||||
- CC=gcc-9
|
||||
- CXX=g++-9
|
||||
- PART=1
|
||||
|
||||
# With glr2.cc, we run out of time with the full test suite.
|
||||
- name: "GCC 8 part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
packages: g++-8
|
||||
env:
|
||||
- CC=gcc-8
|
||||
- CXX=g++-8
|
||||
- PART=1
|
||||
|
||||
- name: "GCC 7"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
packages: g++-7
|
||||
env:
|
||||
- CC=gcc-7
|
||||
- CXX=g++-7
|
||||
|
||||
- name: "GCC 6"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-6
|
||||
env:
|
||||
- CC=gcc-6
|
||||
- CXX=g++-6
|
||||
|
||||
- name: "GCC 5"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-5
|
||||
env:
|
||||
- CC=gcc-5
|
||||
- CXX=g++-5
|
||||
|
||||
- name: "GCC 4.9"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-4.9
|
||||
env:
|
||||
- CC=gcc-4.9
|
||||
- CXX=g++-4.9
|
||||
|
||||
- name: "GCC 4.8"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-4.8
|
||||
env:
|
||||
- CC=gcc-4.8
|
||||
- CXX=g++-4.8
|
||||
|
||||
- name: "GCC 4.7"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-4.7
|
||||
env:
|
||||
- CC=gcc-4.7
|
||||
- CXX=g++-4.7
|
||||
|
||||
- name: "GCC 4.6"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-4.6
|
||||
env:
|
||||
- CC=gcc-4.6
|
||||
- CXX=g++-4.6
|
||||
|
||||
## ------- ##
|
||||
## Clang. ##
|
||||
## ------- ##
|
||||
|
||||
- name: "Clang 10 -O3, libc++, part 1"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
packages:
|
||||
- clang-10
|
||||
- libc++-10-dev
|
||||
- libc++abi-10-dev
|
||||
env:
|
||||
- CC='clang-10'
|
||||
- CXX='clang++-10 -stdlib=libc++'
|
||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||
- PART=1
|
||||
|
||||
- name: "Clang 9 and libc++"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
packages:
|
||||
- clang-9
|
||||
- libc++-9-dev
|
||||
- libc++abi-9-dev
|
||||
env:
|
||||
- CC='clang-9'
|
||||
- CXX='clang++-9 -stdlib=libc++'
|
||||
|
||||
- name: "Clang 8 and libc++"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-8
|
||||
- libc++-8-dev
|
||||
- libc++abi-8-dev
|
||||
env:
|
||||
- CC=clang-8
|
||||
- CXX='clang++-8 -stdlib=libc++'
|
||||
|
||||
- name: "Clang 7 and libc++"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-7
|
||||
- libc++-7-dev
|
||||
- libc++abi-7-dev
|
||||
env:
|
||||
- CC=clang-7
|
||||
- CXX='clang++-7 -stdlib=libc++'
|
||||
|
||||
- name: "Clang 6 and libc++"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-xenial-6.0
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- clang-6.0
|
||||
- libc++-dev
|
||||
env:
|
||||
- CC=clang-6.0
|
||||
- CXX='clang++-6.0 -stdlib=libc++'
|
||||
|
||||
- name: "Clang 5"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources: llvm-toolchain-xenial-5.0
|
||||
packages:
|
||||
- clang-5.0
|
||||
- libc++-dev
|
||||
env:
|
||||
- CC='clang-5.0'
|
||||
- CXX='clang++-5.0'
|
||||
|
||||
- name: "Clang 4"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources: llvm-toolchain-xenial-4.0
|
||||
packages: clang-4.0
|
||||
env:
|
||||
- CC=clang-4.0
|
||||
- CXX=clang++-4.0
|
||||
|
||||
- name: "Clang 3.9"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources: llvm-toolchain-xenial-3.9
|
||||
packages: clang-3.9
|
||||
env:
|
||||
- CC=clang-3.9
|
||||
- CXX=clang++-3.9
|
||||
|
||||
- name: "Clang 3.8"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
packages: clang-3.8
|
||||
env:
|
||||
- CC=clang-3.8
|
||||
- CXX=clang++-3.8
|
||||
|
||||
- name: "CLang 3.7"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.7
|
||||
packages: clang-3.7
|
||||
env:
|
||||
- CC=clang-3.7
|
||||
- CXX=clang++-3.7
|
||||
|
||||
- name: "Clang 3.6"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.6
|
||||
packages: clang-3.6
|
||||
env:
|
||||
- CC=clang-3.6
|
||||
- CXX=clang++-3.6
|
||||
|
||||
- name: "Clang 3.5"
|
||||
stage: check
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.5
|
||||
packages: clang-3.5
|
||||
env:
|
||||
- CC=clang-3.5
|
||||
- CXX=clang++-3.5
|
||||
|
||||
- name: "Clang 3.4"
|
||||
stage: check
|
||||
os: linux
|
||||
# Not available on Xenial.
|
||||
dist: trusty
|
||||
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.
|
||||
- CC=/usr/bin/clang
|
||||
- CXX=/usr/bin/clang++
|
||||
|
||||
- name: "Clang 3.3"
|
||||
stage: check
|
||||
os: linux
|
||||
# Not available on Xenial.
|
||||
dist: trusty
|
||||
addons:
|
||||
apt:
|
||||
packages: clang-3.3
|
||||
env:
|
||||
# See comment for 3.4.
|
||||
- CC=/usr/bin/clang
|
||||
- CXX=/usr/bin/clang++
|
||||
|
||||
## From https://docs.gitlab.com/ce/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor.
|
||||
## Applies to Travis too. Applied to all the 'script's (of all the jobs).
|
||||
before_script:
|
||||
- 'which ssh-agent || ( sudo apt-get install openssh-client -y )'
|
||||
- eval "$(ssh-agent -s)"
|
||||
# $SSH_PRIVATE_KEY is multiline. Use $'...' to register its value: $'-----BEGIN OPENSSH PRIVATE KEY-----\nXXXXX...\n...==\n-----END OPENSSH PRIVATE KEY-----'.
|
||||
- echo "$SSH_PRIVATE_KEY" >/tmp/key.id_rsa
|
||||
- chmod 600 /tmp/key.id_rsa
|
||||
- ssh-add /tmp/key.id_rsa </dev/null
|
||||
- mkdir -p ~/.ssh
|
||||
- chmod 700 ~/.ssh
|
||||
- echo '|1|bpc51UGxoDZjCPiwRlCStW32trI=|rfh6mLoLZv/vAvOVrpZXI1hTLxg= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIR+ckMoJTNXHvAQLHWSfrRnrNJGW2ZR6kr5pBVDGCkz1v1RcQ5rleq0NAt9kS3v4hgnuLiEVnK7KDRzcEH3ikc=' >>~/.ssh/known_hosts
|
||||
- chmod 600 ~/.ssh/known_hosts
|
||||
|
||||
# Applies only to the jobs that don't have a 'script', i.e., applies to all the 'check' jobs, but not the 'dist' one.
|
||||
script:
|
||||
# Beware not too leak $SSH_PRIVATE_KEY.
|
||||
# - env
|
||||
- sudo apt-get install -qq doxygen flex m4
|
||||
# Install and activate dmd.
|
||||
- mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh
|
||||
- source $(source ~/dlang/install.sh dmd -a) || true
|
||||
|
||||
- $CC --version
|
||||
- $CXX --version
|
||||
- dmd --version || true
|
||||
- doxygen --version
|
||||
- flex --version
|
||||
- ld --version
|
||||
- m4 --version
|
||||
|
||||
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
||||
# Unset this variable, otherwise, Java programs' stderr is cluttered
|
||||
# with `Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m`, which makes
|
||||
# the test suite fail.
|
||||
- unset _JAVA_OPTIONS
|
||||
|
||||
# Fail fast from now on.
|
||||
- set -e
|
||||
- sftp [email protected]:bison-$TRAVIS_BUILD_NUMBER.tar.xz
|
||||
- tar xf bison-$TRAVIS_BUILD_NUMBER.tar.xz
|
||||
- dir=$(tar tf bison-$TRAVIS_BUILD_NUMBER.tar.xz | sed 1q)
|
||||
- cd $dir
|
||||
- mkdir _build
|
||||
- cd _build
|
||||
- ../configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
|
||||
- make -j2 $MAKE_ARGS
|
||||
- if test ${PART-1} = 1; then make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat test-suite.log && cat tests/testsuite.log && false; }; fi
|
||||
- if test ${PART-2} = 2; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||
- if test ${PART-2} = 2; then make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||
@@ -1,3 +0,0 @@
|
||||
data/glr.c
|
||||
data/yacc.c
|
||||
lib/yyerror.c
|
||||
@@ -1 +0,0 @@
|
||||
doc/bison.texinfo
|
||||
@@ -1,6 +0,0 @@
|
||||
COPYING
|
||||
^bootstrap$
|
||||
^doc/fdl\.texi$
|
||||
^doc/gpl-3\.0\.texi$
|
||||
^doc/yacc\.1\.in$
|
||||
^src/parse-gram\.h$
|
||||
@@ -0,0 +1,324 @@
|
||||
Notes on the Free Translation Project
|
||||
*************************************
|
||||
|
||||
Free software is going international! The Free Translation Project
|
||||
is a way to get maintainers of free software, translators, and users all
|
||||
together, so that will gradually become able to speak many languages.
|
||||
A few packages already provide translations for their messages.
|
||||
|
||||
If you found this `ABOUT-NLS' file inside a distribution, you may
|
||||
assume that the distributed package does use GNU `gettext' internally,
|
||||
itself available at your nearest GNU archive site. But you do _not_
|
||||
need to install GNU `gettext' prior to configuring, installing or using
|
||||
this package with messages translated.
|
||||
|
||||
Installers will find here some useful hints. These notes also
|
||||
explain how users should proceed for getting the programs to use the
|
||||
available translations. They tell how people wanting to contribute and
|
||||
work at translations should contact the appropriate team.
|
||||
|
||||
When reporting bugs in the `intl/' directory or bugs which may be
|
||||
related to internationalization, you should tell about the version of
|
||||
`gettext' which is used. The information can be found in the
|
||||
`intl/VERSION' file, in internationalized packages.
|
||||
|
||||
Quick configuration advice
|
||||
==========================
|
||||
|
||||
If you want to exploit the full power of internationalization, you
|
||||
should configure it using
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to force usage of internationalizing routines provided within this
|
||||
package, despite the existence of internationalizing capabilities in the
|
||||
operating system where this package is being installed. So far, only
|
||||
the `gettext' implementation in the GNU C library version 2 provides as
|
||||
many features (such as locale alias, message inheritance, automatic
|
||||
charset conversion or plural form handling) as the implementation here.
|
||||
It is also not possible to offer this additional functionality on top
|
||||
of a `catgets' implementation. Future versions of GNU `gettext' will
|
||||
very likely convey even more functionality. So it might be a good idea
|
||||
to change to GNU `gettext' as soon as possible.
|
||||
|
||||
So you need _not_ provide this option if you are using GNU libc 2 or
|
||||
you have installed a recent copy of the GNU gettext package with the
|
||||
included `libintl'.
|
||||
|
||||
INSTALL Matters
|
||||
===============
|
||||
|
||||
Some packages are "localizable" when properly installed; the
|
||||
programs they contain can be made to speak your own native language.
|
||||
Most such packages use GNU `gettext'. Other packages have their own
|
||||
ways to internationalization, predating GNU `gettext'.
|
||||
|
||||
By default, this package will be installed to allow translation of
|
||||
messages. It will automatically detect whether the system already
|
||||
provides the GNU `gettext' functions. If not, the GNU `gettext' own
|
||||
library will be used. This library is wholly contained within this
|
||||
package, usually in the `intl/' subdirectory, so prior installation of
|
||||
the GNU `gettext' package is _not_ required. Installers may use
|
||||
special options at configuration time for changing the default
|
||||
behaviour. The commands:
|
||||
|
||||
./configure --with-included-gettext
|
||||
./configure --disable-nls
|
||||
|
||||
will respectively bypass any pre-existing `gettext' to use the
|
||||
internationalizing routines provided within this package, or else,
|
||||
_totally_ disable translation of messages.
|
||||
|
||||
When you already have GNU `gettext' installed on your system and run
|
||||
configure without an option for your new package, `configure' will
|
||||
probably detect the previously built and installed `libintl.a' file and
|
||||
will decide to use this. This might be not what is desirable. You
|
||||
should use the more recent version of the GNU `gettext' library. I.e.
|
||||
if the file `intl/VERSION' shows that the library which comes with this
|
||||
package is more recent, you should use
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to prevent auto-detection.
|
||||
|
||||
The configuration process will not test for the `catgets' function
|
||||
and therefore it will not be used. The reason is that even an
|
||||
emulation of `gettext' on top of `catgets' could not provide all the
|
||||
extensions of the GNU `gettext' library.
|
||||
|
||||
Internationalized packages have usually many `po/LL.po' files, where
|
||||
LL gives an ISO 639 two-letter code identifying the language. Unless
|
||||
translations have been forbidden at `configure' time by using the
|
||||
`--disable-nls' switch, all available translations are installed
|
||||
together with the package. However, the environment variable `LINGUAS'
|
||||
may be set, prior to configuration, to limit the installed set.
|
||||
`LINGUAS' should then contain a space separated list of two-letter
|
||||
codes, stating which languages are allowed.
|
||||
|
||||
Using This Package
|
||||
==================
|
||||
|
||||
As a user, if your language has been installed for this package, you
|
||||
only have to set the `LANG' environment variable to the appropriate
|
||||
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
|
||||
and `CC' is an ISO 3166 two-letter country code. For example, let's
|
||||
suppose that you speak German and live in Germany. At the shell
|
||||
prompt, merely execute `setenv LANG de_DE' (in `csh'),
|
||||
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
|
||||
This can be done from your `.login' or `.profile' file, once and for
|
||||
all.
|
||||
|
||||
You might think that the country code specification is redundant.
|
||||
But in fact, some languages have dialects in different countries. For
|
||||
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
|
||||
country code serves to distinguish the dialects.
|
||||
|
||||
Not all programs have translations for all languages. By default, an
|
||||
English message is shown in place of a nonexistent translation. If you
|
||||
understand other languages, you can set up a priority list of languages.
|
||||
This is done through a different environment variable, called
|
||||
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
|
||||
for the purpose of message handling, but you still need to have `LANG'
|
||||
set to the primary language; this is required by other parts of the
|
||||
system libraries. For example, some Swedish users who would rather
|
||||
read translations in German than English for when Swedish is not
|
||||
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
|
||||
|
||||
In the `LANGUAGE' environment variable, but not in the `LANG'
|
||||
environment variable, `LL_CC' combinations can be abbreviated as `LL'
|
||||
to denote the language's main dialect. For example, `de' is equivalent
|
||||
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
|
||||
(Portuguese as spoken in Portugal) in this context.
|
||||
|
||||
Translating Teams
|
||||
=================
|
||||
|
||||
For the Free Translation Project to be a success, we need interested
|
||||
people who like their own language and write it well, and who are also
|
||||
able to synergize with other translators speaking the same language.
|
||||
Each translation team has its own mailing list. The up-to-date list of
|
||||
teams can be found at the Free Translation Project's homepage,
|
||||
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
|
||||
area.
|
||||
|
||||
If you'd like to volunteer to _work_ at translating messages, you
|
||||
should become a member of the translating team for your own language.
|
||||
The subscribing address is _not_ the same as the list itself, it has
|
||||
`-request' appended. For example, speakers of Swedish can send a
|
||||
message to `[email protected]', having this message body:
|
||||
|
||||
subscribe
|
||||
|
||||
Keep in mind that team members are expected to participate
|
||||
_actively_ in translations, or at solving translational difficulties,
|
||||
rather than merely lurking around. If your team does not exist yet and
|
||||
you want to start one, or if you are unsure about what to do or how to
|
||||
get started, please write to `[email protected]' to reach the
|
||||
coordinator for all translator teams.
|
||||
|
||||
The English team is special. It works at improving and uniformizing
|
||||
the terminology in use. Proven linguistic skill are praised more than
|
||||
programming skill, here.
|
||||
|
||||
Available Packages
|
||||
==================
|
||||
|
||||
Languages are not equally supported in all packages. The following
|
||||
matrix shows the current state of internationalization, as of September
|
||||
2001. The matrix shows, in regard of each package, for which languages
|
||||
PO files have been submitted to translation coordination, with a
|
||||
translation percentage of at least 50%.
|
||||
|
||||
Ready PO files bg cs da de el en eo es et fi fr gl he hr id it ja
|
||||
+----------------------------------------------------+
|
||||
a2ps | [] [] [] |
|
||||
bash | [] [] [] [] |
|
||||
bfd | |
|
||||
binutils | [] |
|
||||
bison | [] [] [] [] [] |
|
||||
clisp | [] [] [] [] |
|
||||
cpio | [] [] [] [] [] |
|
||||
diffutils | [] [] [] [] [] [] [] |
|
||||
enscript | [] [] |
|
||||
error | [] [] |
|
||||
fetchmail | |
|
||||
fileutils | [] [] [] [] [] [] [] [] |
|
||||
findutils | [] [] [] [] [] [] [] [] |
|
||||
flex | [] [] [] |
|
||||
freetype | |
|
||||
gas | |
|
||||
gawk | [] [] |
|
||||
gcal | |
|
||||
gcc | |
|
||||
gettext | [] [] [] [] [] [] [] [] [] [] |
|
||||
gnupg | [] [] [] [] [] [] [] |
|
||||
gprof | |
|
||||
grep | [] [] [] [] [] [] [] [] |
|
||||
hello | [] [] [] [] [] [] [] [] [] [] [] |
|
||||
id-utils | [] [] [] |
|
||||
indent | [] [] [] [] [] |
|
||||
jpilot | [] |
|
||||
kbd | |
|
||||
ld | [] |
|
||||
libc | [] [] [] [] [] [] [] [] |
|
||||
lilypond | [] |
|
||||
lynx | [] [] [] [] |
|
||||
m4 | [] [] [] [] [] [] [] [] |
|
||||
make | [] [] [] [] [] [] |
|
||||
mysecretdiary | [] |
|
||||
nano | [] [] [] |
|
||||
opcodes | |
|
||||
parted | [] [] [] |
|
||||
ptx | [] [] [] [] [] [] [] |
|
||||
python | |
|
||||
recode | [] [] [] [] [] [] [] [] [] |
|
||||
sed | [] [] [] [] [] [] [] [] [] [] [] [] |
|
||||
sh-utils | [] [] [] [] [] [] [] [] [] [] |
|
||||
sharutils | [] [] [] [] [] [] [] [] |
|
||||
sketch | |
|
||||
soundtracker | [] [] [] |
|
||||
sp | |
|
||||
tar | [] [] [] [] [] [] [] [] |
|
||||
texinfo | [] [] [] [] [] [] |
|
||||
textutils | [] [] [] [] [] [] [] [] |
|
||||
util-linux | [] [] |
|
||||
wdiff | [] [] [] |
|
||||
wget | [] [] [] [] [] [] [] [] [] [] |
|
||||
+----------------------------------------------------+
|
||||
bg cs da de el en eo es et fi fr gl he hr id it ja
|
||||
0 14 24 32 11 1 8 23 13 1 33 22 4 0 7 9 18
|
||||
|
||||
ko lv nb nl nn no pl pt pt_BR ru sk sl sv tr uk zh
|
||||
+----------------------------------------------------+
|
||||
a2ps | [] [] [] | 6
|
||||
bash | | 4
|
||||
bfd | | 0
|
||||
binutils | | 1
|
||||
bison | [] | 6
|
||||
clisp | [] | 5
|
||||
cpio | [] [] [] [] [] | 10
|
||||
diffutils | [] [] [] [] | 11
|
||||
enscript | [] [] [] | 5
|
||||
error | [] [] | 4
|
||||
fetchmail | | 0
|
||||
fileutils | [] [] [] [] [] [] [] [] [] | 17
|
||||
findutils | [] [] [] [] [] [] [] [] | 16
|
||||
flex | [] [] [] | 6
|
||||
freetype | | 0
|
||||
gas | | 0
|
||||
gawk | [] | 3
|
||||
gcal | | 0
|
||||
gcc | | 0
|
||||
gettext | [] [] [] [] [] [] [] [] | 18
|
||||
gnupg | [] [] [] | 10
|
||||
gprof | | 0
|
||||
grep | [] [] [] [] | 12
|
||||
hello | [] [] [] [] [] [] [] [] [] [] [] | 22
|
||||
id-utils | [] [] [] | 6
|
||||
indent | [] [] [] [] [] [] [] | 12
|
||||
jpilot | | 1
|
||||
kbd | [] | 1
|
||||
ld | | 1
|
||||
libc | [] [] [] [] [] [] [] [] | 16
|
||||
lilypond | [] [] | 3
|
||||
lynx | [] [] [] [] | 8
|
||||
m4 | [] [] [] [] | 12
|
||||
make | [] [] [] [] [] [] | 12
|
||||
mysecretdiary | | 1
|
||||
nano | [] | 4
|
||||
opcodes | [] | 1
|
||||
parted | [] [] | 5
|
||||
ptx | [] [] [] [] [] [] [] [] | 15
|
||||
python | | 0
|
||||
recode | [] [] [] [] | 13
|
||||
sed | [] [] [] [] [] [] [] | 19
|
||||
sh-utils | [] [] [] [] [] [] [] [] [] [] [] | 21
|
||||
sharutils | [] [] [] | 11
|
||||
sketch | | 0
|
||||
soundtracker | | 3
|
||||
sp | | 0
|
||||
tar | [] [] [] [] [] [] [] | 15
|
||||
texinfo | [] | 7
|
||||
textutils | [] [] [] [] [] [] [] [] | 16
|
||||
util-linux | [] [] | 4
|
||||
wdiff | [] [] [] [] | 7
|
||||
wget | [] [] [] [] [] [] [] | 17
|
||||
+----------------------------------------------------+
|
||||
33 teams ko lv nb nl nn no pl pt pt_BR ru sk sl sv tr uk zh
|
||||
53 domains 9 1 6 20 0 6 17 1 13 25 10 11 23 21 2 2 387
|
||||
|
||||
Some counters in the preceding matrix are higher than the number of
|
||||
visible blocks let us expect. This is because a few extra PO files are
|
||||
used for implementing regional variants of languages, or language
|
||||
dialects.
|
||||
|
||||
For a PO file in the matrix above to be effective, the package to
|
||||
which it applies should also have been internationalized and
|
||||
distributed as such by its maintainer. There might be an observable
|
||||
lag between the mere existence a PO file and its wide availability in a
|
||||
distribution.
|
||||
|
||||
If September 2001 seems to be old, you may fetch a more recent copy
|
||||
of this `ABOUT-NLS' file on most GNU archive sites. The most
|
||||
up-to-date matrix with full percentage details can be found at
|
||||
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
|
||||
|
||||
Using `gettext' in new packages
|
||||
===============================
|
||||
|
||||
If you are writing a freely available program and want to
|
||||
internationalize it you are welcome to use GNU `gettext' in your
|
||||
package. Of course you have to respect the GNU Library General Public
|
||||
License which covers the use of the GNU `gettext' library. This means
|
||||
in particular that even non-free programs can use `libintl' as a shared
|
||||
library, whereas only free software can use `libintl' as a static
|
||||
library or use modified versions of `libintl'.
|
||||
|
||||
Once the sources are changed appropriately and the setup can handle
|
||||
to use of `gettext' the only thing missing are the translations. The
|
||||
Free Translation Project is also available for packages which are not
|
||||
developed inside the GNU project. Therefore the information given above
|
||||
applies also for every other Free Software Project. Contact
|
||||
`[email protected]' to make the `.pot' files available to
|
||||
the translation teams.
|
||||
|
||||
@@ -5,39 +5,4 @@ Bison was written primarily by Robert Corbett.
|
||||
Richard Stallman made it Yacc-compatible.
|
||||
|
||||
Wilfred Hansen of Carnegie Mellon University added multicharacter
|
||||
string literals and other features (Bison 1.25, 1995).
|
||||
|
||||
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-2022, 2025-2026 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 <https://www.gnu.org/licenses/>.
|
||||
string literals and other features.
|
||||
|
||||
@@ -1,626 +1,285 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
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
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) 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.
|
||||
this service 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.
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
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.
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. 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.
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
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.
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
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.
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. 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.
|
||||
|
||||
1. 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.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. 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.
|
||||
|
||||
4. 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.
|
||||
|
||||
5. 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:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) 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".
|
||||
|
||||
c) 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.
|
||||
|
||||
d) 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.
|
||||
|
||||
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.
|
||||
|
||||
6. 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:
|
||||
|
||||
a) 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.
|
||||
|
||||
b) 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.
|
||||
|
||||
c) 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.
|
||||
|
||||
d) 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.
|
||||
|
||||
e) 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.
|
||||
|
||||
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.
|
||||
|
||||
7. 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:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) 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
|
||||
|
||||
c) 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
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) 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.
|
||||
|
||||
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.
|
||||
|
||||
8. 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.
|
||||
|
||||
9. 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.
|
||||
|
||||
10. 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.
|
||||
|
||||
11. 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
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program 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.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
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.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
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.
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
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.
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body 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
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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.
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this 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.
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
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.
|
||||
NO WARRANTY
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
|
||||
|
||||
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.
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE 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.
|
||||
|
||||
16. 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.
|
||||
|
||||
17. 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 OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
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
|
||||
@@ -628,15 +287,15 @@ 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
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -645,30 +304,37 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
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:
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `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".
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
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
|
||||
<https://www.gnu.org/licenses/>.
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
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
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This 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 Library General
|
||||
Public License instead of this License.
|
||||
|
||||
-26740
File diff suppressed because it is too large
Load Diff
+32
@@ -0,0 +1,32 @@
|
||||
# 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.
|
||||
|
||||
# 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.
|
||||
SHELL = /bin/sh
|
||||
|
||||
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)
|
||||
|
||||
include Makefile
|
||||
include $(srcdir)/Makefile.maint
|
||||
|
||||
else
|
||||
|
||||
all:
|
||||
@echo There seems to be no Makefile in this directory.
|
||||
@echo "You must run ./configure before running \`make'."
|
||||
@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,231 @@
|
||||
Copyright 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. (Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.)
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You only need
|
||||
`configure.ac' if you want to change it or regenerate `configure' using
|
||||
a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. Run `./configure --help'
|
||||
for details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for variables by setting
|
||||
them in the environment. You can do that on the command line like this:
|
||||
|
||||
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not support the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a
|
||||
time in the source code directory. After you have installed the
|
||||
package for one architecture, use `make distclean' before reconfiguring
|
||||
for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it cannot guess the host type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the host
|
||||
platform (i.e., that on which the generated programs will eventually be
|
||||
run) with `--host=TYPE'. In this case, you should also specify the
|
||||
build platform with `--build=TYPE', because, in this case, it may not
|
||||
be possible to guess the build platform (it sometimes involves
|
||||
compiling and running simple test programs, and this can't be done if
|
||||
the compiler is a cross compiler).
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
will cause the specified gcc to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
+19
-139
@@ -1,150 +1,30 @@
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
AUTOMAKE_OPTIONS = 1.5 check-news readme-alpha dist-bzip2
|
||||
|
||||
# Copyright (C) 2001-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = po runtime-po gnulib-po .
|
||||
SUBDIRS = config intl po lib src doc m4 tests
|
||||
|
||||
# Files installed for use by Automake.
|
||||
aclocaldir = @aclocaldir@
|
||||
aclocal_DATA = m4/bison-i18n.m4
|
||||
EXTRA_DIST = REFERENCES configure.bat OChangeLog Makefile.maint GNUmakefile
|
||||
|
||||
EXTRA_DIST = .prev-version .version cfg.mk PACKAGING \
|
||||
ChangeLog-1998 ChangeLog-2012 ChangeLog
|
||||
DISTCLEANFILES = intl/libintl.h
|
||||
|
||||
dist_doc_DATA = AUTHORS COPYING NEWS README THANKS TODO
|
||||
|
||||
# Let generated files (e.g., from examples/) depend on this variable,
|
||||
# to make sure they are regenerated when there are changes in Bison.
|
||||
#
|
||||
# Don't depend on $(BISON) otherwise we would rebuild these files
|
||||
# in srcdir, including during distcheck, which is forbidden.
|
||||
dependencies = $(BISON_IN) $(src_bison_SOURCES) $(dist_skeletons_DATA)
|
||||
## ---------------------------- ##
|
||||
## Customizing Makefile.maint. ##
|
||||
## ---------------------------- ##
|
||||
|
||||
## Running the bison from this tarball. To generate our own parser,
|
||||
## but also to run the tests. Of course, you ought to keep a sane
|
||||
## version of Bison nearby...
|
||||
BISON = $(top_builddir)/tests/bison
|
||||
BISON_IN = $(top_srcdir)/tests/bison.in
|
||||
YACC = $(BISON) -o y.tab.c
|
||||
AM_YFLAGS_WITH_LINES = --defines -Werror -Wall,dangling-alias --report=all
|
||||
AM_YFLAGS = $(AM_YFLAGS_WITH_LINES) --no-lines
|
||||
move_if_change = $(srcdir)/config/move-if-change
|
||||
prev_version_file = $(srcdir)/config/prev-version.txt
|
||||
release_archive_dir = releases
|
||||
|
||||
# Initialization before completion by local.mk's.
|
||||
AM_CFLAGS = $(WARN_CFLAGS)
|
||||
# Find builddir/src/scan-code.c etc. For some reason "-I./lib"
|
||||
# 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 =
|
||||
check_SCRIPTS =
|
||||
dist_TESTS =
|
||||
noinst_LIBRARIES =
|
||||
# Uploading betas.
|
||||
hosts = alpha
|
||||
alpha_host = alpha.gnu.org
|
||||
alpha_url_dir = gnu/bison
|
||||
|
||||
include build-aux/local.mk
|
||||
include data/local.mk
|
||||
include doc/local.mk
|
||||
include etc/local.mk
|
||||
include examples/local.mk
|
||||
include lib/local.mk
|
||||
include src/local.mk
|
||||
include tests/local.mk
|
||||
# Files to update automatically.
|
||||
wget_files = $(srcdir)/config/config.guess $(srcdir)/config/config.sub \
|
||||
$(srcdir)/config/texinfo.tex
|
||||
|
||||
clean-local:
|
||||
rm -rf $(CLEANDIRS)
|
||||
|
||||
.PHONY: gitsort
|
||||
gitsort:
|
||||
cd $(srcdir) \
|
||||
&& for i in $$(git ls-files '*.gitignore' | grep -v doc); do \
|
||||
LC_ALL=C sort $$i -o $$i; \
|
||||
done
|
||||
|
||||
# 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 gen-synclines
|
||||
echo $(VERSION) > $(distdir)/.tarball-version
|
||||
|
||||
# When generating a release, include the #lines in Bison's parser. Do it
|
||||
# only if needed. In particular, distcheck runs dist with read-only
|
||||
# sources, so don't try to update src/parse-gram.c: we don't have the
|
||||
# permissions.
|
||||
.PHONY: gen-synclines
|
||||
gen-synclines:
|
||||
cd $(distdir) && \
|
||||
if ! grep '#line' src/parse-gram.c >/dev/null 2>&1; then \
|
||||
$(abs_top_builddir)/tests/bison \
|
||||
$(AM_YFLAGS_WITH_LINES) src/parse-gram.y \
|
||||
-o src/parse-gram.c; \
|
||||
fi
|
||||
|
||||
.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
|
||||
|
||||
# Useful to debug.
|
||||
.c.i:
|
||||
$(CC) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -o $@ -E $<
|
||||
|
||||
.PHONY: codespell
|
||||
CODESPELL = codespell
|
||||
codespell:
|
||||
$(AM_V_GEN) cd $(srcdir) \
|
||||
&& $(CODESPELL) \
|
||||
--regex "[\\w\\-'’\`]+\+*" \
|
||||
--ignore-words-list "ba,circularly,cloneable,copyable,define'd,dout,froms,iff,ifset,od,ois" \
|
||||
$$(git ls-files data doc lib src tests)
|
||||
cvs_files = $(srcdir)/config/missing
|
||||
|
||||
+466
@@ -0,0 +1,466 @@
|
||||
# Makefile.in generated automatically by automake 1.5a from Makefile.am.
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = .
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = @program_transform_name@
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
|
||||
EXEEXT = @EXEEXT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
AMTAR = @AMTAR@
|
||||
AWK = @AWK@
|
||||
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
DEPDIR = @DEPDIR@
|
||||
GENCAT = @GENCAT@
|
||||
GLIBC21 = @GLIBC21@
|
||||
GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLBISON = @INTLBISON@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
M4 = @M4@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
PACKAGE = @PACKAGE@
|
||||
POFILES = @POFILES@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
U = @U@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
install_sh = @install_sh@
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.5 check-news readme-alpha dist-bzip2
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = config intl po lib src doc m4 tests
|
||||
|
||||
EXTRA_DIST = REFERENCES configure.bat OChangeLog Makefile.maint GNUmakefile
|
||||
|
||||
DISTCLEANFILES = intl/libintl.h
|
||||
|
||||
move_if_change = $(srcdir)/config/move-if-change
|
||||
prev_version_file = $(srcdir)/config/prev-version.txt
|
||||
release_archive_dir = releases
|
||||
|
||||
# Uploading betas.
|
||||
hosts = alpha
|
||||
alpha_host = alpha.gnu.org
|
||||
alpha_url_dir = gnu/bison
|
||||
|
||||
# Files to update automatically.
|
||||
wget_files = $(srcdir)/config/config.guess $(srcdir)/config/config.sub \
|
||||
$(srcdir)/config/texinfo.tex
|
||||
|
||||
|
||||
cvs_files = $(srcdir)/config/missing
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = intl/Makefile
|
||||
DIST_SOURCES =
|
||||
|
||||
RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
|
||||
uninstall-info-recursive all-recursive install-data-recursive \
|
||||
install-exec-recursive installdirs-recursive install-recursive \
|
||||
uninstall-recursive check-recursive installcheck-recursive
|
||||
DIST_COMMON = README ././stamp-h.in ./stamp-h.in ABOUT-NLS AUTHORS \
|
||||
COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS \
|
||||
README-alpha THANKS aclocal.m4 config.hin configure \
|
||||
configure.in
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && \
|
||||
CONFIG_HEADERS= CONFIG_LINKS= \
|
||||
CONFIG_FILES=$@ $(SHELL) ./config.status
|
||||
|
||||
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
$(ACLOCAL_M4): configure.in m4/c-bs-a.m4 m4/codeset.m4 m4/dmalloc.m4 m4/error.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/m4.m4 m4/malloc.m4 m4/mbrtowc.m4 m4/mbstate_t.m4 m4/prereq.m4 m4/progtest.m4 m4/realloc.m4 m4/strerror_r.m4 m4/warning.m4
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
config.h: stamp-h
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h; \
|
||||
$(MAKE) stamp-h; \
|
||||
else :; fi
|
||||
stamp-h: $(srcdir)/config.hin $(top_builddir)/config.status
|
||||
@rm -f stamp-h stamp-hT
|
||||
@echo timestamp > stamp-hT 2> /dev/null
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES= CONFIG_HEADERS=config.h:config.hin \
|
||||
$(SHELL) ./config.status
|
||||
@mv stamp-hT stamp-h
|
||||
$(srcdir)/config.hin: $(srcdir)/./stamp-h.in
|
||||
@if test ! -f $@; then \
|
||||
rm -f $(srcdir)/./stamp-h.in; \
|
||||
$(MAKE) $(srcdir)/./stamp-h.in; \
|
||||
else :; fi
|
||||
$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
@rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT
|
||||
@echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status
|
||||
uninstall-info-am:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique $(LISP)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)config.hin$$unique$(LISP)$$tags" \
|
||||
|| etags $(ETAGS_ARGS) $$tags config.hin $$unique $(LISP)
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = .
|
||||
# Avoid unsightly `./'.
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
|
||||
GZIP_ENV = --best
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" >/dev/null; \
|
||||
then :; else \
|
||||
echo "NEWS not updated; not releasing" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkinstalldirs) $(distdir)/./. $(distdir)/intl $(distdir)/po $(distdir)/tests
|
||||
@for file in $(DISTFILES); do \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
$(mkinstalldirs) "$(distdir)/$$dir"; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pR $$d/$$file $(distdir) \
|
||||
|| exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
for subdir in $(SUBDIRS); do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" \
|
||||
distdir=../$(distdir)/$$subdir \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
$(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
|
||||
&& cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
|
||||
--with-included-gettext \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
find $$dc_install_base -type f -print ; \
|
||||
exit 1; } >&2 ) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distclean \
|
||||
&& rm -f $(distdir).tar.gz \
|
||||
&& (test `find . -type f -print | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left after distclean:" ; \
|
||||
find . -type f -print ; \
|
||||
exit 1; } >&2 )
|
||||
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
|
||||
@echo "$(distdir).tar.gz is ready for distribution" | \
|
||||
sed 'h;s/./=/g;p;x;p;x'
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f config.status config.cache config.log
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
|
||||
clean-generic clean-recursive dist dist-all dist-bzip2 \
|
||||
dist-gzip distcheck distclean distclean-generic distclean-hdr \
|
||||
distclean-recursive distclean-tags distdir dvi dvi-am \
|
||||
dvi-recursive info info-am info-recursive install install-am \
|
||||
install-data install-data-am install-data-recursive \
|
||||
install-exec install-exec-am install-exec-recursive \
|
||||
install-info install-info-am install-info-recursive install-man \
|
||||
install-recursive install-strip installcheck installcheck-am \
|
||||
installdirs installdirs-am installdirs-recursive \
|
||||
maintainer-clean maintainer-clean-generic \
|
||||
maintainer-clean-recursive mostlyclean mostlyclean-generic \
|
||||
mostlyclean-recursive tags tags-recursive uninstall \
|
||||
uninstall-am uninstall-info-am uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
+346
@@ -0,0 +1,346 @@
|
||||
# -*-Makefile-*-
|
||||
# This Makefile fragment is shared between fileutils, sh-utils, textutils,
|
||||
# CPPI, Bison, and Autoconf.
|
||||
|
||||
## Copyright 2001 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 2, 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, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
## 02111-1307, USA.
|
||||
|
||||
# Do not save the original name or timestamp in the .tar.gz file.
|
||||
GZIP_ENV = '--no-name --best'
|
||||
|
||||
CVS = cvs
|
||||
|
||||
prev_version_file ?= .prev-version
|
||||
|
||||
THIS_VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
||||
PREV_VERSION := $(shell cat $(prev_version_file))
|
||||
PREV_VERSION_REGEXP := $(shell echo $(PREV_VERSION)|sed 's/\./\\./g')
|
||||
|
||||
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
|
||||
tag-this-version = $(subst .,_,$(VERSION))
|
||||
tag-prev-version = $(subst .,_,$(PREV_VERSION))
|
||||
this-cvs-tag = $(tag-package)-$(tag-this-version)
|
||||
prev-cvs-tag = $(tag-package)-$(tag-prev-version)
|
||||
my_distdir = $(PACKAGE)-$(VERSION)
|
||||
|
||||
# Old releases are stored here.
|
||||
# Used for diffs and xdeltas.
|
||||
release_archive_dir ?= ../release
|
||||
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Updating files. ##
|
||||
## ---------------- ##
|
||||
|
||||
WGET = wget
|
||||
ftp-gnu = ftp://ftp.gnu.org/gnu
|
||||
|
||||
# Use mv, if you don't have/want move-if-change.
|
||||
move_if_change ?= move-if-change
|
||||
|
||||
# ------------------- #
|
||||
# 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) -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)/config.guess $(srcdir)/config.sub \
|
||||
$(srcdir)/src/ansi2knr.c \
|
||||
$(srcdir)/doc/texinfo.tex
|
||||
wget-targets = $(patsubst %, get-%, $(wget_files))
|
||||
|
||||
config.guess-url_prefix = $(ftp-gnu)/config/
|
||||
config.sub-url_prefix = $(ftp-gnu)/config/
|
||||
|
||||
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
|
||||
|
||||
texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
|
||||
|
||||
standards.texi-url_prefix = $(ftp-gnu)/GNUinfo/
|
||||
make-stds.texi-url_prefix = $(ftp-gnu)/GNUinfo/
|
||||
|
||||
target = $(patsubst get-%, %, $@)
|
||||
url = $($(notdir $(target))-url_prefix)$(notdir $(target))
|
||||
|
||||
.PHONY: $(wget-targets)
|
||||
$(wget-targets):
|
||||
$(WGET) $(url) -O $(target).t \
|
||||
&& $(move_if_change) $(target).t $(target)
|
||||
|
||||
.PHONY: wget-update
|
||||
wget-update: $(wget-targets)
|
||||
|
||||
|
||||
# Updating tools via CVS.
|
||||
cvs_files ?= depcomp missing
|
||||
cvs-targets = $(patsubst %, get-%, $(cvs_files))
|
||||
|
||||
automake_repo = :pserver:[email protected]:/cvs/automake
|
||||
.PHONY: $(cvs-targets)
|
||||
$(cvs-targets):
|
||||
$(CVS) -d $(automake_repo) co -p automake/lib/$(notdir $(target)) \
|
||||
>$(target).t \
|
||||
&& $(move_if_change) $(target).t $(target);
|
||||
|
||||
.PHONY: cvs-update
|
||||
cvs-update: $(cvs-targets)
|
||||
|
||||
|
||||
# --------------------- #
|
||||
# Updating everything. #
|
||||
# --------------------- #
|
||||
|
||||
.PHONY: update
|
||||
update: wget-update cvs-update po-update
|
||||
|
||||
|
||||
|
||||
## --------------- ##
|
||||
## Sanity checks. ##
|
||||
## --------------- ##
|
||||
|
||||
# Checks that don't require cvs. Run `changelog-check' last as
|
||||
# previous test may reveal problems requiring new ChangeLog entries.
|
||||
local-check: po-check copyright-check writable-files changelog-check
|
||||
|
||||
changelog-check:
|
||||
if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# Verify that all source files using _() are listed in po/POTFILES.in.
|
||||
po-check:
|
||||
if test -f po/POTFILES.in; then \
|
||||
grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
|
||||
grep -E -l '\b_\(' lib/*.c src/*.c | sort > $@-2; \
|
||||
diff -u $@-1 $@-2 || exit 1; \
|
||||
rm -f $@-1 $@-2; \
|
||||
fi
|
||||
|
||||
# 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 || :
|
||||
|
||||
# Make sure that the copyright date in lib/version-etc.c is up to date.
|
||||
copyright-check:
|
||||
@if test -f lib/version-etc.c; then \
|
||||
grep 'N_("Copyright (C) $(shell date +%Y) Free' lib/version-etc.c \
|
||||
>/dev/null \
|
||||
|| { echo 'out of date copyright in $<; 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
|
||||
|
||||
|
||||
|
||||
## -------------- ##
|
||||
## Making dists. ##
|
||||
## -------------- ##
|
||||
|
||||
|
||||
# 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 \
|
||||
AUTOM4TE=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.
|
||||
t=./=test
|
||||
my-distcheck: writable-files po-check
|
||||
-rm -rf $(t)
|
||||
mkdir $(t)
|
||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
||||
cd $(t)/$(distdir) \
|
||||
&& ./configure --disable-nls \
|
||||
&& $(MAKE) CFLAGS='-Wformat -Werror' \
|
||||
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 "========================"
|
||||
|
||||
# This must be the same name on both hosts.
|
||||
# Make it a symlink that points to the right place.
|
||||
real_dir = fetish-ftp
|
||||
|
||||
url_dir_list = $(foreach x,$(hosts),ftp://$($(x)_host)/$($(x)_url_dir))
|
||||
|
||||
tgz-md5 = $(shell md5sum < $(my_distdir).tar.gz|sed 's/ -//')
|
||||
tgz-sha1 = $(shell sha1sum < $(my_distdir).tar.gz|sed 's/ -//')
|
||||
bz2-md5 = $(shell md5sum < $(my_distdir).tar.bz2|sed 's/ -//')
|
||||
bz2-sha1 = $(shell sha1sum < $(my_distdir).tar.bz2|sed 's/ -//')
|
||||
tgz-size = $(shell du --human $(my_distdir).tar.gz|sed 's/\([Mk]\).*/ \1B/')
|
||||
bz2-size = $(shell du --human $(my_distdir).tar.bz2|sed 's/\([Mk]\).*/ \1B/')
|
||||
xd-size = $(shell du --human $(xd-delta)|sed 's/\([Mk]\).*/ \1B/')
|
||||
|
||||
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) -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
|
||||
|
||||
GZIP = gzip
|
||||
BZIP2 = bzip2
|
||||
$(my_distdir).tar.bz2: $(my_distdir).tar.gz
|
||||
$(GZIP) -dc $< > $(my_distdir).tar
|
||||
rm -f $@
|
||||
$(BZIP2) -9 $(my_distdir).tar
|
||||
|
||||
rel-files = $(xd-delta) $(distdir).tar.bz2 $(distdir).tar.gz
|
||||
announcement: NEWS ChangeLog $(rel-files)
|
||||
@( \
|
||||
echo Subject: $(my_distdir) released; \
|
||||
echo; \
|
||||
echo FIXME: put comments here; \
|
||||
echo; \
|
||||
for url in $(url_dir_list); do \
|
||||
echo " $$url/$(my_distdir).tar.gz ($(tgz-size))"; \
|
||||
echo " $$url/$(my_distdir).tar.bz2 ($(bz2-size))"; \
|
||||
done; \
|
||||
echo; \
|
||||
echo And here are xdelta-style diffs; \
|
||||
echo; \
|
||||
for url in $(url_dir_list); do \
|
||||
echo " $$url/$(xd-delta) ($(xd-size))"; \
|
||||
done; \
|
||||
echo; \
|
||||
echo "Here are the MD5 and SHA1 signatures for the compressed tar files:"; \
|
||||
echo; \
|
||||
echo "$(tgz-md5) $(my_distdir).tar.gz"; \
|
||||
echo "$(bz2-md5) $(my_distdir).tar.bz2"; \
|
||||
echo "$(tgz-sha1) $(my_distdir).tar.gz"; \
|
||||
echo "$(bz2-sha1) $(my_distdir).tar.bz2"; \
|
||||
echo; \
|
||||
echo NEWS:; \
|
||||
sed -n "/$(THIS_VERSION_REGEXP)[]:]/,/$(PREV_VERSION_REGEXP)[]:]/p" NEWS \
|
||||
| grep -v '^\['; \
|
||||
echo; \
|
||||
echo ChangeLog entries:; \
|
||||
find . -name ChangeLog -maxdepth 2 \
|
||||
| xargs $(CVS) diff -up -r$(prev-cvs-tag) -rHEAD \
|
||||
| sed -n 's/^+//p' \
|
||||
| perl -ne 'm!^\+\+ (\./)?! or print,next;' \
|
||||
-e 'print "\n"."*"x70 ."\n"; s///; print; print "*"x70 ."\n"'; \
|
||||
)
|
||||
|
||||
define emit-rsync-commands
|
||||
echo =====================================
|
||||
echo =====================================
|
||||
echo 'for host in $(a_host) $(b_host); do \'
|
||||
echo ' rsync -e ssh --pro -av $(xd-delta) $(my_distdir).tar.bz2 \'
|
||||
echo ' $(my_distdir).tar.gz $$host:$(real_dir); done'
|
||||
echo '# send the /tmp/announcement e-mail'
|
||||
echo =====================================
|
||||
echo =====================================
|
||||
endef
|
||||
|
||||
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
|
||||
xdelta delta -9 $^ $@ || :
|
||||
|
||||
alpha:
|
||||
$(MAKE) cvs-dist
|
||||
$(MAKE) $(xd-delta)
|
||||
$(MAKE) -s announcement > /tmp/announce-$(my_distdir)
|
||||
ln $(rel-files) $(release_archive_dir)
|
||||
chmod a-w $(rel-files)
|
||||
echo $(VERSION) > $(prev_version_file)
|
||||
$(CVS) ci -m. $(prev_version_file)
|
||||
@$(emit-rsync-commands)
|
||||
@@ -140,7 +140,7 @@
|
||||
1996-05-12 Jim Meyering <[email protected]>
|
||||
|
||||
* 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]>
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
Packaging hints for binary package distributors
|
||||
===============================================
|
||||
|
||||
Although the source of the bison package comes as a single package,
|
||||
in distributions of binary packages the installed files should
|
||||
be split into two packages:
|
||||
|
||||
bison-runtime
|
||||
Contents: Runtime libraries and programs.
|
||||
Audience: Anyone who wants to run internationalized programs
|
||||
that contain Bison-generated parsers.
|
||||
|
||||
bison
|
||||
Contents: Tools and documentation for developers that use Bison.
|
||||
Audience: Anyone who wants to develop programs that use parsers.
|
||||
Dependencies: requires bison-runtime.
|
||||
|
||||
The 'bison-runtime' binary package is much smaller than the 'bison'
|
||||
binary package. It should be included in any distribution that
|
||||
contains localized programs that use the diagnostics contained in
|
||||
Bison-generated parsers.
|
||||
|
||||
If you want to install both packages at the same time, you simply do
|
||||
at the toplevel directory:
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
After installation, the file
|
||||
|
||||
$prefix/share/locale/*/LC_MESSAGES/bison-runtime.mo
|
||||
|
||||
belongs to the bison-runtime package; all other installed files belong
|
||||
to the bison package.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2005, 2009-2015, 2018-2022, 2025-2026 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 <https://www.gnu.org/licenses/>.
|
||||
@@ -1,135 +1,24 @@
|
||||
GNU Bison is a general-purpose parser generator that converts an annotated
|
||||
context-free grammar into a deterministic LR or generalized LR (GLR) parser
|
||||
employing LALR(1) parser tables. Bison can also generate IELR(1) or
|
||||
canonical LR(1) parser tables. Once you are proficient with Bison, you can
|
||||
use it to develop a wide range of language parsers, from those used in
|
||||
simple desk calculators to complex programming languages.
|
||||
This directory contains the Bison parser generator.
|
||||
|
||||
Bison is upward compatible with Yacc: all properly-written Yacc grammars
|
||||
work with Bison with no change. Anyone familiar with Yacc should be able to
|
||||
use Bison with little trouble. You need to be fluent in C, C++, D or Java
|
||||
programming in order to use Bison.
|
||||
See the file INSTALL for compilation and installation instructions.
|
||||
See the file doc/FAQ for frequently asked questions.
|
||||
|
||||
Bison and the parsers it generates are portable, they do not require any
|
||||
specific compilers.
|
||||
It was once true that, when installing Bison on Sequent (or Pyramid?)
|
||||
systems, you had to be in the Berkeley universe. This may no longer
|
||||
be true; we have no way to tell.
|
||||
|
||||
GNU Bison's home page is https://gnu.org/software/bison/.
|
||||
On VMS, you will probably have to create Makefile from Makefile.in by
|
||||
hand. Remember to do `SET COMMAND BISON' to install the data in
|
||||
`BISON.CLD'.
|
||||
|
||||
# Installation
|
||||
## Build from git
|
||||
The [README-hacking.md file](README-hacking.md) is about building, modifying
|
||||
and checking Bison. See its "Working from the Repository" section to build
|
||||
Bison from the git repo. Roughly, run:
|
||||
VMS and MS-DOS builds are probably broken right now. If you are able
|
||||
to build Bison on either platform and you need to make changes to do
|
||||
so, please submit those changes as a bug report.
|
||||
|
||||
$ git submodule update --init
|
||||
$ ./bootstrap
|
||||
|
||||
then proceed with the usual `configure && make` steps.
|
||||
|
||||
## Build from tarball
|
||||
See the [INSTALL file](INSTALL) for generic compilation and installation
|
||||
instructions.
|
||||
|
||||
Bison requires GNU m4 1.4.6 or later. See
|
||||
https://ftp.gnu.org/gnu/m4/m4-1.4.6.tar.gz.
|
||||
|
||||
## Running a non installed bison
|
||||
Once you ran `make`, you might want to toy with this fresh bison before
|
||||
installing it. In that case, do not use `src/bison`: it would use the
|
||||
*installed* files (skeletons, etc.), not the local ones. Use `tests/bison`.
|
||||
|
||||
## Colored diagnostics
|
||||
As an experimental feature, diagnostics are now colored, controlled by the
|
||||
`--color` and `--style` options.
|
||||
|
||||
To use them, install the libtextstyle library, 0.20.5 or newer, before
|
||||
configuring Bison. It is available from https://alpha.gnu.org/gnu/gettext/,
|
||||
for instance https://alpha.gnu.org/gnu/gettext/libtextstyle-0.20.5.tar.gz,
|
||||
or as part of Gettext 0.21 or newer, for instance
|
||||
https://ftp.gnu.org/gnu/gettext/gettext-0.21.tar.gz.
|
||||
|
||||
The option --color supports the following arguments:
|
||||
- always, yes: Enable colors.
|
||||
- never, no: Disable colors.
|
||||
- auto, tty (default): Enable colors if the output device is a tty.
|
||||
|
||||
To customize the styles, create a CSS file, say `bison-bw.css`, similar to
|
||||
|
||||
/* bison-bw.css */
|
||||
.warning { }
|
||||
.error { font-weight: 800; text-decoration: underline; }
|
||||
.note { }
|
||||
|
||||
then invoke bison with `--style=bison-bw.css`, or set the `BISON_STYLE`
|
||||
environment variable to `bison-bw.css`.
|
||||
|
||||
In some diagnostics, bison uses libtextstyle to emit special escapes to
|
||||
generate clickable hyperlinks. The environment variable
|
||||
`NO_TERM_HYPERLINKS` can be used to suppress them. This may be useful for
|
||||
terminal emulators which produce garbage output when they receive the escape
|
||||
sequence for a hyperlink. Currently (as of 2020), this affects some versions
|
||||
of emacs, guake, konsole, lxterminal, rxvt, yakuake.
|
||||
|
||||
## Relocatability
|
||||
If you pass `--enable-relocatable` to `configure`, Bison is relocatable.
|
||||
|
||||
A relocatable program can be moved or copied to a different location on the
|
||||
file system. It can also be used through mount points for network sharing.
|
||||
It is possible to make symlinks to the installed and moved programs, and
|
||||
invoke them through the symlink.
|
||||
|
||||
See "Enabling Relocatability" in the documentation.
|
||||
|
||||
## Internationalization
|
||||
Bison supports two catalogs: one for Bison itself (i.e., for the
|
||||
maintainer-side parser generation), and one for the generated parsers (i.e.,
|
||||
for the user-side parser execution). The requirements between 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
|
||||
https://lists.gnu.org/r/bug-bison/2009-08/msg00006.html for more
|
||||
details.
|
||||
|
||||
# Questions
|
||||
See the section FAQ in the documentation (doc/bison.info) for frequently
|
||||
asked questions. The documentation is also available in 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 not
|
||||
answer them, please send mail to <[email protected]>.
|
||||
|
||||
# Bug reports
|
||||
Please send bug reports to <[email protected]>. Be sure to include the
|
||||
version number from `bison --version`, and a complete, self-contained test
|
||||
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.
|
||||
If you have questions about using Bison which the documentation does
|
||||
not answer, send mail to [email protected].
|
||||
|
||||
<!--
|
||||
|
||||
LocalWords: parsers ngettext Texinfo pdf html YYYY ZZZZ ispell american md
|
||||
LocalWords: MERCHANTABILITY GLR LALR IELR submodule init README src bw
|
||||
LocalWords: Relocatability symlinks symlink
|
||||
|
||||
Local Variables:
|
||||
mode: markdown
|
||||
fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018-2022,
|
||||
2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU bison, the GNU Compiler Compiler.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
||||
Texts. A copy of the license is included in the "GNU Free
|
||||
Documentation License" file as part of this distribution.
|
||||
|
||||
-->
|
||||
|
||||
+6
-20
@@ -7,25 +7,11 @@ The documentation still needs more work. Suggestions welcome.
|
||||
Patches even more welcome.
|
||||
|
||||
Please send comments and problem reports about this test release to
|
||||
<[email protected]>. This program will get better only if you report
|
||||
[email protected]. This program will get better only if you report
|
||||
the problems you encounter.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2015, 2018-2022, 2025-2026 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 <https://www.gnu.org/licenses/>.
|
||||
Please, *do not package this*, *do not distribute it* widely, it is
|
||||
not ready for full scale use. Because it is not fully functional, if
|
||||
you distribute this package, we will be buried under bug reports from
|
||||
panicked users. We don't have time to spend on this, and nor do the
|
||||
users.
|
||||
|
||||
@@ -1,679 +0,0 @@
|
||||
This file attempts to describe the rules to use when hacking Bison.
|
||||
Don't put this file into the distribution.
|
||||
|
||||
Everything related to the development of Bison is on Savannah:
|
||||
https://savannah.gnu.org/projects/bison/.
|
||||
|
||||
|
||||
Working from the Repository
|
||||
===========================
|
||||
|
||||
These notes intend to help people working on the checked-out sources. These
|
||||
requirements do not apply when building from a distribution tarball.
|
||||
|
||||
## Requirements
|
||||
|
||||
We've opted to keep only the highest-level sources in the repository. This
|
||||
eases our maintenance burden, (fewer merges etc.), but imposes more
|
||||
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
|
||||
tools we depend upon, including:
|
||||
|
||||
- Autoconf <https://www.gnu.org/software/autoconf/>
|
||||
- Automake <https://www.gnu.org/software/automake/>
|
||||
- Flex <https://www.gnu.org/software/flex/>
|
||||
- Gettext <https://www.gnu.org/software/gettext/>
|
||||
- Gperf <https://www.gnu.org/software/gperf/>
|
||||
- Graphviz <https://www.graphviz.org>
|
||||
- Gzip <https://www.gnu.org/software/gzip/>
|
||||
- Help2man <https://www.gnu.org/software/help2man/>
|
||||
- Perl <https://www.cpan.org/>
|
||||
- Rsync <https://rsync.samba.org/>
|
||||
- Tar <https://www.gnu.org/software/tar/>
|
||||
- Texinfo <https://www.gnu.org/software/texinfo/>
|
||||
|
||||
Valgrind <https://www.valgrind.org/> is also highly recommended, if it
|
||||
supports your architecture.
|
||||
|
||||
If you're using a GNU/Linux distribution, the easiest way to install the
|
||||
above packages depends on your system. The following shell command should
|
||||
work for Debian-based systems such as Ubuntu:
|
||||
|
||||
sudo apt-get install \
|
||||
autoconf automake autopoint flex gperf graphviz help2man texinfo valgrind
|
||||
|
||||
Bison is written using Bison grammars, so there are bootstrapping issues.
|
||||
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 this
|
||||
package from the repository. For the record, you will find all the relevant
|
||||
information on https://savannah.gnu.org/git/?group=bison.
|
||||
|
||||
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 extracted
|
||||
from other source packages:
|
||||
|
||||
$ ./bootstrap
|
||||
|
||||
Bootstrapping updates the submodules to the versions registered in the
|
||||
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:
|
||||
AC_PROG_GNU_M4`), you are likely to have forgotten the submodule
|
||||
initialization part. To recover from it, run `git reset --hard HEAD`, and
|
||||
restart with the submodule initialization. Otherwise, there you are! Just
|
||||
|
||||
$ ./configure
|
||||
$ make
|
||||
$ make check
|
||||
|
||||
At this point, there should be no difference between your local copy, and
|
||||
the master copy:
|
||||
|
||||
$ git diff
|
||||
|
||||
should output no difference.
|
||||
|
||||
Enjoy!
|
||||
|
||||
## Updating
|
||||
|
||||
If you have git at version 1.8.2 or later, the command
|
||||
|
||||
$ git submodule update --recursive --remote
|
||||
|
||||
will be useful for updating to the latest version of all submodules.
|
||||
|
||||
Under earlier versions, use of submodules make things somewhat different
|
||||
because git does not yet support recursive operations: submodules must be
|
||||
taken care of explicitly.
|
||||
|
||||
### 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 commit ...
|
||||
|
||||
For a suggestion of what gnulib commit might be stable enough for a formal
|
||||
release, see the ChangeLog in the latest gnulib snapshot at
|
||||
https://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.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Bison is self-hosted: its parser is generated by Bison. We don't force
|
||||
ourselves to use the previous release of Bison, we use the current git
|
||||
master for several reasons:
|
||||
- dogfooding: let Bison be its first user
|
||||
- monitoring: seeing the diff on the generated parsers with git is very
|
||||
helpful, as it allows to see easily the impact of the changes on a real
|
||||
case parser.
|
||||
|
||||
If you are unlucky the generated files, src/parse-gram.[ch], may be older
|
||||
than their source, src/parse-gram.y. And your current version of Bison
|
||||
might not be able to grok it. In that case, first refresh the generated
|
||||
files:
|
||||
|
||||
$ touch src/parse-gram.[ch]
|
||||
|
||||
Then proceed.
|
||||
|
||||
In case you wrecked your current copy of the parser, get back the previous
|
||||
version, compile bison, then force it to recreate the files:
|
||||
|
||||
$ git checkout HEAD^ src/parse-gram.[ch]
|
||||
$ make -C _build
|
||||
$ touch src/parse-gram.y
|
||||
$ make -C _build
|
||||
|
||||
|
||||
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.
|
||||
|
||||
## Vocabulary
|
||||
- "lookahead", not "look-ahead".
|
||||
- "midrule", not "mid-rule".
|
||||
- "nonterminal", not "variable" or "non-terminal" or "non terminal".
|
||||
Abbreviated as "nterm".
|
||||
- "shift/reduce" and "reduce/reduce", not "shift-reduce" or "shift reduce",
|
||||
etc.
|
||||
|
||||
## Syntax Highlighting
|
||||
It's quite nice to be in C++ mode when editing lalr1.cc for instance.
|
||||
However tools such as Emacs will be fooled by the fact that braces and
|
||||
parens do not nest, as in `[[}]]`. As a consequence you might be misguided
|
||||
by its visual pairing to parens. The m4-mode is safer. Unfortunately the
|
||||
m4-mode is also fooled by `#` which is sees as a comment, stops pairing with
|
||||
parens/brackets that are inside...
|
||||
|
||||
## Implementation Notes
|
||||
There are several places with interesting details about the implementation:
|
||||
- [Understanding C parsers generated by GNU
|
||||
Bison](https://www.cs.uic.edu/~spopuri/cparser.html) by Satya Kiran Popuri,
|
||||
is a wonderful piece of work that explains the implementation of Bison,
|
||||
- [src/gram.h](src/gram.h) documents the way the grammar is represented
|
||||
- [src/tables.h](src/tables.h) documents the generated tables
|
||||
- [data/README.md](data/README.md) contains details about the m4 implementation
|
||||
|
||||
## Coding Style
|
||||
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.
|
||||
|
||||
Prefer `res` as the name of the local variable that will be "return"ed by
|
||||
the function.
|
||||
|
||||
In writing arithmetic comparisons, use "<" and "<=" rather than ">" and ">="
|
||||
<https://public-inbox.org/git/7vfyw7yebj.fsf_-_@assigned-by-dhcp.cox.net/>.
|
||||
|
||||
### Bison
|
||||
Follow the GNU Coding Standards.
|
||||
|
||||
Don't reinvent the wheel: we use gnulib, which features many components.
|
||||
Actually, Bison has legacy code that we should replace with gnulib modules
|
||||
(e.g., many ad hoc implementations of lists).
|
||||
|
||||
#### Includes
|
||||
The `#include` directives follow an order:
|
||||
- first section for *.c files is `<config.h>`. Don't include it in header
|
||||
files
|
||||
- then, for *.c files, the corresponding *.h file
|
||||
- then possibly the `"system.h"` header
|
||||
- then the system headers.
|
||||
Consider headers from `lib/` like system headers (i.e., `#include
|
||||
<verify.h>`, not `#include "verify.h"`).
|
||||
- then headers from src/ with double quotes (`#include "getargs.h"`).
|
||||
|
||||
Keep headers sorted alphabetically in each section.
|
||||
|
||||
See also the [Header
|
||||
files](https://www.gnu.org/software/gnulib/manual/html_node/Header-files.html)
|
||||
and the [Implementation
|
||||
files](https://www.gnu.org/software/gnulib/manual/html_node/Implementation-files.html#Implementation-files)
|
||||
nodes of the gnulib documentation.
|
||||
|
||||
Some source files are in the build tree (e.g., `src/scan-gram.c` made from
|
||||
`src/scan-gram.l`). For them to find the headers from `src/`, we actually
|
||||
use `#include "src/getargs.h"` instead of `#include "getargs.h"`---that
|
||||
saves us from additional `-I` flags.
|
||||
|
||||
### Skeletons
|
||||
We try to use the "typical" coding style for each language.
|
||||
|
||||
#### CPP
|
||||
We indent the CPP directives this way:
|
||||
|
||||
```
|
||||
#if FOO
|
||||
# if BAR
|
||||
# define BAZ
|
||||
# endif
|
||||
#endif
|
||||
```
|
||||
|
||||
Don't indent with leading spaces in the skeletons (it's OK in the grammar
|
||||
files though, e.g., in `%code {...}` blocks).
|
||||
|
||||
On occasions, use `cppi -c` to see where we stand. We don't aim at full
|
||||
correctness: depending `-d`, some bits can be in the *.c file, or the *.h
|
||||
file within the double-inclusion cpp-guards. In that case, favor the case
|
||||
of the *.h file, but don't waste time on this.
|
||||
|
||||
Don't hesitate to leave a comment on the `#endif` (e.g., `#endif /* FOO
|
||||
*/`), especially for long blocks.
|
||||
|
||||
There is no consistency on `! defined` vs. `!defined`. The day gnulib
|
||||
decides, we'll follow them.
|
||||
|
||||
#### C/C++
|
||||
Follow the GNU Coding Standards.
|
||||
|
||||
The `glr.c` skeleton was implemented with `camlCase`. We are migrating it
|
||||
to `snake_case`. Because we are gradually standardizing the code, it is
|
||||
currently inconsistent.
|
||||
|
||||
Use `YYFOO` and `yyfoo` for entities that are exposed to the user. They are
|
||||
part of our contract with the users wrt backward compatibility.
|
||||
|
||||
Use `YY_FOO` and `yy_foo` for private matters. Users should not use them,
|
||||
we are free to change them without fear of backward compatibility issues.
|
||||
|
||||
Use `*_t` for types, especially for `yy*_t` in which case we shouldn't worry
|
||||
about the C standard introducing such a name.
|
||||
|
||||
#### C++
|
||||
Follow the [C++ Core
|
||||
Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines).
|
||||
The [Google ones](https://google.github.io/styleguide/cppguide.html) may be
|
||||
interesting too.
|
||||
|
||||
Our enumerators, such as the kinds (symbol and token kinds), should be lower
|
||||
case, but it was too late to follow that track for token kinds, and symbol
|
||||
kind enumerators are made to be consistent with them.
|
||||
|
||||
Use `*_type` for type aliases. Use `foo_get()` and `foo_set(v)` for
|
||||
accessors, or simply `foo()` and `foo(v)`.
|
||||
|
||||
Use the `yy` prefix for private stuff, but there's no need for it in the
|
||||
public API. The `yy` prefix is already taken care of via the namespace.
|
||||
|
||||
#### Java
|
||||
We follow the [Java Code
|
||||
Conventions](https://www.oracle.com/technetwork/java/codeconventions-150003.pdf)
|
||||
and [Google Java Style
|
||||
Guide](https://google.github.io/styleguide/javaguide.html). Unfortunately
|
||||
at some point some GNU Coding Style was installed in Java, but it's an
|
||||
error. So we should for instance stop putting spaces in function calls.
|
||||
Because we are standardizing the code, it is currently inconsistent. Treat
|
||||
acronyms as words: `YYLacStack`, not `YYLACStack`.
|
||||
|
||||
Use a 2-space indentation (Google) rather than 4 (Oracle).
|
||||
|
||||
Don't use the `yy` prefix for public members: `getExpectedTokens`, not
|
||||
`yyexpectedTokens` or `yygetExpectedTokens`. Keep the `yy` prefix though
|
||||
for private details.
|
||||
|
||||
## Commit Messages
|
||||
Imitate the style we use. Use `git log` to get sources of inspiration.
|
||||
|
||||
If the changes have a small impact on Bison's generated parser, embed these
|
||||
changes in the commit itself. If the impact is large, first push all the
|
||||
changes except those about src/parse-gram.[ch], and then another commit
|
||||
named "regen" which is only about them.
|
||||
|
||||
## Debugging
|
||||
Bison supports tracing of its various steps, via the `--trace` option.
|
||||
Since it is not meant for the end user, it is not displayed by `bison
|
||||
--help`, nor is it documented in the manual. Instead, run `bison
|
||||
--trace=help`.
|
||||
|
||||
## Documentation
|
||||
Use `@option` for options and options with their argument if they have no
|
||||
space (e.g., `@option{-Dfoo=bar}`). However, use `@samp` elsewhere (e.g.,
|
||||
`@samp{-I foo}`).
|
||||
|
||||
|
||||
Test Suite
|
||||
==========
|
||||
|
||||
## make check
|
||||
Consume without moderation. It is composed of two kinds of tests: the
|
||||
examples, and the main test suite.
|
||||
|
||||
### The Examples
|
||||
In examples/, there is a number of ready-to-use examples (see
|
||||
[examples/README.md](examples/README.md)). These examples have small test
|
||||
suites run by `make check`. The test results are in local `*.log` files
|
||||
(e.g., `$build/examples/c/calc/calc.log`).
|
||||
|
||||
To check only the examples, run `make check-examples`. To check just one
|
||||
example,
|
||||
|
||||
make check-examples TESTS='examples/c/bistromathic/bistromathic.test'
|
||||
|
||||
### The Main Test Suite
|
||||
The main test suite, in tests/, is written on top of GNU Autotest, which is
|
||||
part of Autoconf. Run `info autoconf 'Using Autotest'` to read the
|
||||
documentation, not only about how to write tests, but also where are the
|
||||
logs, how to read them etc.
|
||||
|
||||
The main test suite generates a log for each test (e.g.,
|
||||
`$build/tests/testsuite.dir/004/testsuite.log` for test #4), and a main log
|
||||
file in `$build/tests/testsuite.log`. The latter is meant for end users: it
|
||||
contains lots of details that should help diagnosing issues, including build
|
||||
issues. The per-test logs are more convenient when working locally.
|
||||
|
||||
#### TESTSUITEFLAGS
|
||||
To run just the main test suite, run `make check-tests`.
|
||||
|
||||
The default is for `make check-tests` 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.
|
||||
|
||||
1. Using -j, in a make-like fashion, for example:
|
||||
|
||||
$ make check-tests TESTSUITEFLAGS='-j8'
|
||||
|
||||
When using GNU Make, TESTSUITEFLAGS defaults to the -jN passed to it, so you
|
||||
may simply run
|
||||
|
||||
$ make check-tests -j8
|
||||
|
||||
2. Running only the tests of a certain category. See
|
||||
[tests/README.md](tests/README.md#keywords) for the list of categories.
|
||||
|
||||
To get a list of all the tests (and their keywords for -k), run
|
||||
|
||||
$ ./tests/testsuite -l
|
||||
|
||||
To run a specific set of tests, use -k (for "keyword"). For example:
|
||||
|
||||
$ make check-tests TESTSUITEFLAGS='-k c++'
|
||||
|
||||
Both can be combined.
|
||||
|
||||
$ make check-tests TESTSUITEFLAGS='-j8 -k c++'
|
||||
|
||||
To rerun the tests that failed:
|
||||
|
||||
$ make recheck -j5
|
||||
|
||||
#### Updating the Expectations
|
||||
Sometimes some changes have a large impact on the test suite (e.g., when we
|
||||
added the `[-Wother]` part to all the warnings). Part of the update can be
|
||||
done with a crude tool: `build-aux/update-test`.
|
||||
|
||||
Once you ran the test suite, and therefore have many `testsuite.log` files,
|
||||
run `make update-tests`. Or, by hand, from the *source* tree:
|
||||
|
||||
$ ./build-aux/update-test $build/tests/testsuite.dir/*/testsuite.log
|
||||
|
||||
where `$build` would be your build tree. This will hopefully update most
|
||||
tests. Re-run the test suite. It might be interesting to run `update-test`
|
||||
again, since some early failures may stop latter tests from being run. Yet
|
||||
at some point, you'll have to fix remaining issues by hand...
|
||||
|
||||
|
||||
## Running Java parsers
|
||||
Use the `javaexec.sh` script. For instance to run the parser of test case
|
||||
504:
|
||||
|
||||
$ sh ./_build/javaexec.sh -cp ./_build/tests/testsuite.dir/504 Calc
|
||||
|
||||
## Using Sanitizers
|
||||
Address sanitizer (ASAN) and undefined-behavior sanitizer (UBSAN) are very
|
||||
useful. Here's one way to set them up with GCC 10 on Mac Ports
|
||||
|
||||
1. Configure with
|
||||
```
|
||||
$ ./configure -C --enable-gcc-warnings \
|
||||
CPPFLAGS='-isystem /opt/local/include' \
|
||||
CC='gcc-mp-10 -fsanitize=address -fsanitize=undefined' \
|
||||
CFLAGS='-ggdb' \
|
||||
CXX='g++-mp-10.0 -fsanitize=address -fsanitize=undefined' \
|
||||
CXXFLAGS='-ggdb' \
|
||||
LDFLAGS='-L/opt/local/lib'
|
||||
```
|
||||
|
||||
2. Compile
|
||||
|
||||
3. Generate debug symbols:
|
||||
|
||||
```
|
||||
$ dsymutil src/bison
|
||||
```
|
||||
|
||||
4. Run the tests with leak detection enabled
|
||||
(`ASAN_OPTIONS=detect_leaks=1`). E.g. for counterexamples:
|
||||
```
|
||||
$ make check-tests TESTSUITEFLAGS='-j5 -k cex' ASAN_OPTIONS=detect_leaks=1
|
||||
```
|
||||
|
||||
5. You might need a suppression file. See
|
||||
https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer#suppressions.
|
||||
With G++ on a Mac, you might need a suppression file (say `leak.supp`)
|
||||
that contains:
|
||||
|
||||
```
|
||||
leak:std::clog
|
||||
```
|
||||
|
||||
and pass the additional flags
|
||||
`LSAN_OPTIONS=suppressions=$PWD/leak.supp,print_suppressions=0`
|
||||
|
||||
6. To run the debugger, you might want something like this:
|
||||
```
|
||||
$ YYDEBUG=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 \
|
||||
LSAN_OPTIONS=suppressions=$PWD/leak.supp,print_suppressions=0 \
|
||||
ASAN_OPTIONS=detect_leaks=1 \
|
||||
lldb -- ./_build/tests/testsuite.dir/712/glr-regr2a ./_build/tests/testsuite.dir/712/input1.txt
|
||||
```
|
||||
|
||||
In lldb to set a break on ubsan, try `rbreak ^__ubsan_handle_`.
|
||||
|
||||
## 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
|
||||
(<https://lists.gnu.org/r/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.
|
||||
|
||||
## gnulib
|
||||
To run tests on gnulib components (e.g., on bitset):
|
||||
|
||||
cd gnulib
|
||||
./gnulib-tool --test bitset-tests
|
||||
|
||||
possibly within a specified environment:
|
||||
|
||||
CC='gcc-mp-8 -fsanitize=undefined' ./gnulib-tool --test bitset-tests
|
||||
|
||||
To be able to run the tests several times, and to use symlinks instead of
|
||||
copies so that one can update the origin gnulib directory and immediately
|
||||
re-run the tests, run:
|
||||
|
||||
./gnulib-tool --symlink --create-test --dir=/tmp/gnutest bitset-tests
|
||||
cd /tmp/gnutest
|
||||
./configure -C CC='gcc-mp-8 -fsanitize=undefined' CFLAGS='-ggdb'
|
||||
make check
|
||||
|
||||
|
||||
## Docker
|
||||
|
||||
Running old compilers is not very easy. Docker can be used for some of
|
||||
them. Have a look at .travis.yml for setups. Move the tarball in `/tmp`
|
||||
and run, for instance:
|
||||
|
||||
```
|
||||
docker run -v /tmp:/tmp -it ubuntu:xenial
|
||||
```
|
||||
|
||||
This way, the host and guest machines share `/tmp`.
|
||||
|
||||
### GCC 4.6
|
||||
On Ubuntu Xenial.
|
||||
|
||||
```
|
||||
apt-get update
|
||||
apt-get install software-properties-common
|
||||
apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
|
||||
apt-get update
|
||||
apt-get install -y gcc-4.6 g++-4.6 m4 make
|
||||
```
|
||||
|
||||
## Stow
|
||||
|
||||
If you want to install several versions of Bison using GNU Stow, do
|
||||
something like this:
|
||||
|
||||
```
|
||||
for v in 3.7 3.7.1
|
||||
do
|
||||
cd /tmp
|
||||
wget https://ftp.gnu.org/gnu/bison/bison-$v.tar.xz
|
||||
tar xf bison-$v.tar.xz
|
||||
cd bison-$v
|
||||
./configure --prefix /usr/local/stow/bison-$v
|
||||
make -j4
|
||||
sudo make install
|
||||
done
|
||||
```
|
||||
|
||||
Release Procedure
|
||||
=================
|
||||
|
||||
See the [README-release file](README-release), created when the package is
|
||||
bootstrapped.
|
||||
|
||||
<!--
|
||||
|
||||
Copyright (C) 2002-2005, 2007-2015, 2018-2022, 2025-2026 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
Local Variables:
|
||||
mode: markdown
|
||||
fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
LocalWords: Automake Autoconf Gettext Gzip Rsync Valgrind gnulib submodules
|
||||
LocalWords: submodule init cd distcheck ChangeLog valgrind sigreturn sudo
|
||||
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 Graphviz Texinfo autoconf jN
|
||||
LocalWords: automake autopoint graphviz texinfo PROG Wother parsers YYFOO
|
||||
LocalWords: TESTSUITEFLAGS deprec struct gnulib's getopt config ggdb yyfoo
|
||||
LocalWords: bitset fsanitize symlink CFLAGS MERCHANTABILITY ispell wrt YY
|
||||
LocalWords: american Administrivia camlCase yy accessors namespace src hoc
|
||||
LocalWords: getExpectedTokens yyexpectedTokens yygetExpectedTokens parens
|
||||
LocalWords: regen dogfooding Autotest testsuite getargs CPP BAZ endif cppi
|
||||
LocalWords: cpp javaexec cp Calc ASAN UBSAN CPPFLAGS isystem CXX cex Gperf
|
||||
LocalWords: CXXFLAGS LDFLAGS dsymutil gperf
|
||||
|
||||
-->
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
From phr Tue Jul 8 10:36:19 1986
|
||||
Date: Tue, 8 Jul 86 00:52:24 EDT
|
||||
From: phr (Paul Rubin)
|
||||
To: riferguson%[email protected], tower
|
||||
Subject: Re: Bison documentation?
|
||||
|
||||
The main difference between Bison and Yacc that I know of is that
|
||||
Bison supports the @N construction, which gives you access to
|
||||
the starting and ending line number and character number associated
|
||||
with any of the symbols in the current rule.
|
||||
|
||||
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
|
||||
conflicts.
|
||||
|
||||
The differences in the algorithms stem mainly from the horrible
|
||||
kludges that Johnson had to perpetrate to make Yacc fit in a PDP-11.
|
||||
|
||||
Also, Bison uses a faster but less space-efficient encoding for the
|
||||
parse tables (see Corbett's PhD thesis from Berkeley, "Static
|
||||
Semantics in Compiler Error Recovery", June 1985, Report No. UCB/CSD
|
||||
85/251), and more modern technique for generating the lookahead sets.
|
||||
(See "Efficient Construction of LALR(1) Lookahead Sets" by F. DeRemer
|
||||
and A. Pennello, in ACM TOPLS Vol 4 No 4, October 1982. Their
|
||||
technique is the standard one now.)
|
||||
|
||||
paul rubin
|
||||
free software foundation
|
||||
|
||||
|
||||
@@ -1,262 +1,32 @@
|
||||
Bison was originally written by Robert Corbett. It would not be what
|
||||
it is today without the invaluable help of these people:
|
||||
|
||||
Aaro Koskinen aaro.koskinen@iki.fi
|
||||
Аскар Сафин [email protected]
|
||||
Adam Sampson [email protected]
|
||||
Adrian Vogelsgesang avogelsgesang@tableau.com
|
||||
Ahcheong Lee [email protected]
|
||||
Airy Andre [email protected]
|
||||
Akim Demaille [email protected]
|
||||
Albert Chin-A-Young [email protected]
|
||||
Alexander Belopolsky [email protected]
|
||||
Alexandre Duret-Lutz [email protected]
|
||||
Andre da Costa Barros [email protected]
|
||||
Andreas Damm adamm@onica.com
|
||||
Andreas Schwab [email protected]
|
||||
Andrei Malashkin [email protected]
|
||||
Andrew Suffield [email protected].net
|
||||
Angelo Borsotti [email protected]
|
||||
Anthony Heading [email protected]
|
||||
Antonio Silva Correia amsilvacorreia@hotmail.com
|
||||
Arnold Robbins arnold@skeeve.com
|
||||
Art Haas [email protected]
|
||||
Arthur Schwarz [email protected]
|
||||
Askar Safin safinaskar@mail.ru
|
||||
Balázs Scheidler [email protected]
|
||||
Baron Schwartz [email protected]
|
||||
Ben Pfaff [email protected]
|
||||
Benoit Perrot [email protected]
|
||||
Bernd Edlinger [email protected]
|
||||
Bernd Kiefer [email protected]
|
||||
Bert Deknuydt [email protected]
|
||||
Bill Allombert [email protected]
|
||||
Bob Rossi [email protected]
|
||||
Brandon Lucia [email protected]
|
||||
Brooks Moses [email protected]
|
||||
Bruce Lilly [email protected]
|
||||
Bruno Belanyi [email protected]
|
||||
Bruno Haible [email protected]
|
||||
Charles-Henri de Boysson [email protected]
|
||||
Christian Burger [email protected]
|
||||
Clément Démoulins [email protected]
|
||||
Colin Daley [email protected]
|
||||
Cris Bailiff [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]
|
||||
Daniela Becker [email protected]
|
||||
David Barto [email protected]
|
||||
David J. MacKenzie [email protected]
|
||||
David Kastrup [email protected]
|
||||
David Michael [email protected]
|
||||
Dengke Du [email protected]
|
||||
Denis Excoffier [email protected]
|
||||
Dennis Clarke [email protected]
|
||||
Derek Clegg [email protected]
|
||||
Derek M. Jones [email protected]
|
||||
Di-an Jan [email protected]
|
||||
Dick Streefland [email protected]
|
||||
Didier Godefroy [email protected]
|
||||
Don Macpherson [email protected]
|
||||
Dwight Guth [email protected]
|
||||
Efi Fogel [email protected]
|
||||
Enrico Scholz [email protected]
|
||||
Eric Blake [email protected]
|
||||
Eric S. Raymond [email protected]
|
||||
Étienne Renault [email protected]
|
||||
Evan Lavelle [email protected]
|
||||
Evan Nemerson [email protected]
|
||||
Evgeny Stambulchik [email protected]
|
||||
Fabrice Bauzac [email protected]
|
||||
Ferdinand Thiessen [email protected]
|
||||
Florian Krohm [email protected]
|
||||
Frank Heckenbach [email protected]
|
||||
Frans Englich [email protected]
|
||||
Gabriel Rassoul [email protected]
|
||||
Gary L Peskin [email protected]
|
||||
Gavin Smith [email protected]
|
||||
Georg Sauthoff [email protected]
|
||||
George Neuner [email protected]
|
||||
Gilles Espinasse [email protected]
|
||||
Giorgos Pap [email protected]
|
||||
Goran Uddeborg [email protected]
|
||||
Guido Trentalancia [email protected]
|
||||
H. Merijn Brand [email protected]
|
||||
Hans Åberg [email protected]
|
||||
Horst Von Brand [email protected]
|
||||
Jacob L. Mandelson [email protected]
|
||||
Jan Nieuwenhuizen [email protected]
|
||||
Jannick [email protected]
|
||||
Jeff Hammond [email protected]
|
||||
Jerry Quinn [email protected]
|
||||
Jesse Thilo [email protected]
|
||||
Jim Kent [email protected]
|
||||
Jim Meyering [email protected]
|
||||
Joel E. Denny [email protected]
|
||||
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]
|
||||
Karl Berry [email protected]
|
||||
Kees Zeelenberg [email protected]
|
||||
Keith Browne [email protected]
|
||||
Ken Moffat [email protected]
|
||||
Kiyoshi Kanazawa [email protected]
|
||||
Lars Maier [email protected]
|
||||
Lars Wendler [email protected]
|
||||
László Várady [email protected]
|
||||
Laurent Mascherpa [email protected]
|
||||
Lie Yan [email protected]
|
||||
Maarten De Braekeleer [email protected]
|
||||
Magnus Fromreide [email protected]
|
||||
Marc Autret [email protected]
|
||||
Marc Mendiola [email protected]
|
||||
Marc Schönefeld [email protected]
|
||||
Mark Boyall [email protected]
|
||||
Marko Mäkelä [email protected]
|
||||
Martin Blais [email protected]
|
||||
Martin Jacobs [email protected]
|
||||
Martin Mokrejs [email protected]
|
||||
Martin Nylin [email protected]
|
||||
Matt Kraai [email protected]
|
||||
Matt Rosing [email protected]
|
||||
Maxim Prohorenko [email protected]
|
||||
Michael Catanzaro [email protected]
|
||||
Michael Felt [email protected]
|
||||
Michael Hayes [email protected]
|
||||
Michael Raskin [email protected]
|
||||
Michał Majchrowicz [email protected]
|
||||
Michel d'Hooge [email protected]
|
||||
Michiel De Wilde [email protected]
|
||||
Mickael Labau [email protected]
|
||||
Mike Castle [email protected]
|
||||
Mike Frysinger [email protected]
|
||||
Mike Sullivan [email protected]
|
||||
Nate Guerin [email protected]
|
||||
Neil Booth [email protected]
|
||||
Nelson H. F. Beebe [email protected]
|
||||
neok m4700 [email protected]
|
||||
Nick Bowler [email protected]
|
||||
Nicolas Bedon [email protected]
|
||||
Nicolas Burrus [email protected]
|
||||
Nicolas Tisserand [email protected]
|
||||
Nikita Popov [email protected]
|
||||
Nikki Valen [email protected]
|
||||
Noah Friedman [email protected]
|
||||
Odd Arild Olsen [email protected]
|
||||
Oleg Smolsky [email protected]
|
||||
Oleksii Taran [email protected]
|
||||
Oliver Mangold [email protected]
|
||||
Paolo Bonzini [email protected]
|
||||
Paolo Simone Gasparello [email protected]
|
||||
Pascal Bart [email protected]
|
||||
Patrice Dumas [email protected]
|
||||
Paul Eggert [email protected]
|
||||
Paul Hilfinger [email protected]
|
||||
Per Allansson [email protected]
|
||||
Peter Eisentraut [email protected]
|
||||
Peter Fales [email protected]
|
||||
Peter Hamorsky [email protected]
|
||||
Peter Simons [email protected]
|
||||
Petr Machata [email protected]
|
||||
Pho [email protected]
|
||||
Piotr Gackiewicz [email protected]
|
||||
Piotr Marcińczyk [email protected]
|
||||
Pramod Kumbhar [email protected]
|
||||
Quentin Hocquet [email protected]
|
||||
Quoc Peyrot [email protected]
|
||||
R Blake [email protected]
|
||||
Raja R Harinath [email protected]
|
||||
Ralf Wildenhues [email protected]
|
||||
Rich Wilson [email protected]
|
||||
Richard Stallman [email protected]
|
||||
Rici Lake [email protected]
|
||||
Rob Conde [email protected]
|
||||
Rob Vermaas [email protected]
|
||||
Robert Anisko [email protected]
|
||||
Robert Yang [email protected]
|
||||
Roland Levillain [email protected]
|
||||
Ryan [email protected]
|
||||
Satya Kiran Popuri [email protected]
|
||||
Sebastian Setzer [email protected]
|
||||
Sebastien Fricker [email protected]
|
||||
Sébastien Villemot [email protected]
|
||||
Sergei Steshenko [email protected]
|
||||
Shura [email protected]
|
||||
Simon Sobisch [email protected]
|
||||
Stefano Lattarini [email protected]
|
||||
Stephen Cameron [email protected]
|
||||
Steve Murphy [email protected]
|
||||
Suhwan Song [email protected]
|
||||
Sum Wu [email protected]
|
||||
Théophile Ranquet [email protected]
|
||||
Thiru Ramakrishnan [email protected]
|
||||
Thomas Jahns [email protected]
|
||||
Thomas Petazzoni [email protected]
|
||||
Tim Josling [email protected]
|
||||
Tim Landscheidt [email protected]
|
||||
Tim Van Holder [email protected]
|
||||
Tobias Frost [email protected]
|
||||
Todd Freed [email protected]
|
||||
Tom Kramer [email protected]
|
||||
Tom Lane [email protected]
|
||||
Tom Tromey [email protected]
|
||||
Tomasz Kłoczko [email protected]
|
||||
Tommy Nordgren [email protected]
|
||||
Troy A. Johnson [email protected]
|
||||
Tys Lefering [email protected]
|
||||
Uxio Prego [email protected]
|
||||
Valentin Tolmer [email protected]
|
||||
wcventure [email protected]
|
||||
Victor Khomenko [email protected]
|
||||
Victor Zverovich [email protected]
|
||||
Vin Shelton [email protected]
|
||||
W.C.A. Wijngaards [email protected]
|
||||
Wayne Green [email protected]
|
||||
Wei Song [email protected]
|
||||
Wojciech Polak [email protected]
|
||||
Wolfgang S. Kechel [email protected]
|
||||
Wolfgang Thaller [email protected]
|
||||
Wolfram Wagner [email protected]
|
||||
Wwp [email protected]
|
||||
xolodho [email protected]
|
||||
Yuichiro Kaneko [email protected]
|
||||
Yuriy Solodkyy [email protected]
|
||||
Zack Weinberg [email protected]
|
||||
江 祖铭 [email protected]
|
||||
長田偉伸 [email protected]
|
||||
马俊 [email protected]
|
||||
Airy Andre Airy.Andre@edf.fr
|
||||
Akim Demaille [email protected]
|
||||
Albert Chin-A-Young [email protected]
|
||||
Alexander Belopolsky alexb@rentec.com
|
||||
Daniel Hagerty [email protected]
|
||||
David J. MacKenzie [email protected]
|
||||
Fabrice Bauzac [email protected]
|
||||
Hans Aberg [email protected]
|
||||
Jesse Thilo [email protected]
|
||||
Jim Meyering [email protected]
|
||||
Juan Manuel Guerrero [email protected]
|
||||
Keith Browne kbrowne@legato.com
|
||||
Laurent Mascherpa [email protected]
|
||||
Marc Autret [email protected]
|
||||
Neil Booth NeilB@earthling.net
|
||||
Noah Friedman [email protected]
|
||||
Pascal Bart [email protected]
|
||||
Paul Eggert eggert@twinsun.com
|
||||
Piotr Gackiewicz gacek@intertel.com.pl
|
||||
Richard Stallman [email protected]
|
||||
Robert Anisko [email protected]
|
||||
Shura debil_urod@ngs.ru
|
||||
|
||||
Many people are not named here because we lost track of them. We
|
||||
thank them! Please, help us keeping this list up to date.
|
||||
|
||||
Local Variables:
|
||||
mode: text
|
||||
coding: utf-8
|
||||
End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2000-2015, 2018-2022, 2025-2026 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -1,727 +0,0 @@
|
||||
* Soon
|
||||
** yyerror_range in GLR
|
||||
It seems useless that it is based on glr_stack_item, it should be doable
|
||||
with location only.
|
||||
|
||||
** scan-code
|
||||
The default case is scanning char-per-char.
|
||||
|
||||
/* By default, grow the string obstack with the input. */
|
||||
.|\n STRING_GROW ();
|
||||
|
||||
make it more eager?
|
||||
|
||||
** Missing tests
|
||||
commit 2c294c132528ede23d8ae4959783a67e9ff05ac5
|
||||
Author: Vincent Imbimbo <[email protected]>
|
||||
Date: Sat Jan 23 13:25:18 2021 -0500
|
||||
|
||||
cex: fix state-item pruning
|
||||
|
||||
See https://lists.gnu.org/r/bug-bison/2021-01/msg00002.html
|
||||
|
||||
** pos_set_set
|
||||
The current approach is correct, but with poor performances. Bitsets need
|
||||
to support 'assign' and 'shift'. And instead of extending POS_SET just for
|
||||
the out-of-range new values, we need something like doubling the size.
|
||||
|
||||
** glr
|
||||
There is no test with "Parse on stack %ld rejected by rule %d" in it.
|
||||
|
||||
** yyrline etc.
|
||||
Clarify that rule numbers in the skeletons are 1-based.
|
||||
|
||||
** Macros in C++
|
||||
There are many macros that should obey api.prefix: YY_CPLUSPLUS, YY_MOVE,
|
||||
etc.
|
||||
|
||||
** yyerrok in Java
|
||||
And add tests in calc.at, to prepare work for D.
|
||||
|
||||
** YYERROR and yynerrs
|
||||
We are missing some cases. Write a test case, and check all the skeletons.
|
||||
|
||||
** Cex
|
||||
*** Improve gnulib
|
||||
Don't do this (counterexample.c):
|
||||
|
||||
// This is the fastest way to get the tail node from the gl_list API.
|
||||
gl_list_node_t
|
||||
list_get_end (gl_list_t list)
|
||||
{
|
||||
gl_list_node_t sentinel = gl_list_add_last (list, NULL);
|
||||
gl_list_node_t res = gl_list_previous_node (list, sentinel);
|
||||
gl_list_remove_node (list, sentinel);
|
||||
return res;
|
||||
}
|
||||
|
||||
*** Ambiguous rewriting
|
||||
If the user is stupid enough to have equal rules, then the derivations are
|
||||
harder to read:
|
||||
|
||||
Reduce/reduce conflict on tokens $end, "+", "⊕":
|
||||
2 exp: exp "+" exp .
|
||||
3 exp: exp "+" exp .
|
||||
Example exp "+" exp •
|
||||
First derivation exp ::=[ exp "+" exp • ]
|
||||
Example exp "+" exp •
|
||||
Second derivation exp ::=[ exp "+" exp • ]
|
||||
|
||||
Do we care about this? In color, we use twice the same color here, but we
|
||||
could try to use the same color for the same rule.
|
||||
|
||||
*** XML reports
|
||||
Show the counterexamples. This is going to be really hard and/or painful.
|
||||
Unless we play it dumb (little structure).
|
||||
|
||||
** Bistromathic
|
||||
- How about not evaluating incomplete lines when the text is not finished
|
||||
(as shells do).
|
||||
|
||||
** Questions
|
||||
*** Java
|
||||
- Should i18n be part of the Lexer? Currently it's a static method of
|
||||
Lexer.
|
||||
|
||||
- is there a migration path that would allow to use TokenKinds in
|
||||
yylex?
|
||||
|
||||
- define the tokens as an enum too.
|
||||
|
||||
- promote YYEOF rather than EOF.
|
||||
|
||||
** YYerror
|
||||
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob;f=gettext-runtime/intl/plural.y;h=a712255af4f2f739c93336d4ff6556d932a426a5;hb=HEAD
|
||||
|
||||
should be updated to not use YYERRCODE. Returning an undef token is good
|
||||
enough.
|
||||
|
||||
** Java
|
||||
*** calc.at
|
||||
Stop hard-coding "Calc". Adjust local.at (look for FIXME).
|
||||
|
||||
** doc
|
||||
I feel it's ugly to use the GNU style to declare functions in the doc. It
|
||||
generates tons of white space in the page, and may contribute to bad page
|
||||
breaks.
|
||||
|
||||
** consistency
|
||||
token vs terminal.
|
||||
|
||||
** api.token.raw
|
||||
The YYUNDEFTOK could be assigned a semantic value so that yyerror could be
|
||||
used to report invalid lexemes.
|
||||
|
||||
** push parsers
|
||||
Consider deprecating impure push parsers. They add a lot of complexity, for
|
||||
a bad feature. On the other hand, that would make it much harder to sit
|
||||
push parsers on top of pull parser. Which is currently not relevant, since
|
||||
push parsers are measurably slower.
|
||||
|
||||
** %define parse.error formatted
|
||||
How about pushing Bistromathic's yyreport_syntax_error as another standard
|
||||
way to generate the error message, and leave to the user the task of
|
||||
providing the message formats? Currently in bistro, it reads:
|
||||
|
||||
const char *
|
||||
error_format_string (int argc)
|
||||
{
|
||||
switch (argc)
|
||||
{
|
||||
default: /* Avoid compiler warnings. */
|
||||
case 0: return _("%@: syntax error");
|
||||
case 1: return _("%@: syntax error: unexpected %u");
|
||||
// TRANSLATORS: '%@' is a location in a file, '%u' is an
|
||||
// "unexpected token", and '%0e', '%1e'... are expected tokens
|
||||
// at this point.
|
||||
//
|
||||
// For instance on the expression "1 + * 2", you'd get
|
||||
//
|
||||
// 1.5: syntax error: expected - or ( or number or function or variable before *
|
||||
case 2: return _("%@: syntax error: expected %0e before %u");
|
||||
case 3: return _("%@: syntax error: expected %0e or %1e before %u");
|
||||
case 4: return _("%@: syntax error: expected %0e or %1e or %2e before %u");
|
||||
case 5: return _("%@: syntax error: expected %0e or %1e or %2e or %3e before %u");
|
||||
case 6: return _("%@: syntax error: expected %0e or %1e or %2e or %3e or %4e before %u");
|
||||
case 7: return _("%@: syntax error: expected %0e or %1e or %2e or %3e or %4e or %5e before %u");
|
||||
case 8: return _("%@: syntax error: expected %0e or %1e or %2e or %3e or %4e or %5e or %6e before %u");
|
||||
}
|
||||
}
|
||||
|
||||
The message would have to be generated in a string, and pushed to yyerror.
|
||||
Which will be a pain in the neck in yacc.c.
|
||||
|
||||
If we want to do that, we should think very carefully about the syntax of
|
||||
the format string.
|
||||
|
||||
** yyclearin does not invoke the lookahead token's %destructor
|
||||
https://lists.gnu.org/r/bug-bison/2018-02/msg00000.html
|
||||
Rici:
|
||||
|
||||
> Modifying yyclearin so that it calls yydestruct seems like the simplest
|
||||
> solution to this issue, but it is conceivable that such a change would
|
||||
> break programs which already perform some kind of workaround in order to
|
||||
> destruct the lookahead symbol. So it might be necessary to use some kind of
|
||||
> compatibility %define, or to create a new replacement macro with a
|
||||
> different name such as yydiscardin.
|
||||
>
|
||||
> At a minimum, the fact that yyclearin does not invoke the %destructor
|
||||
> should be highlighted in the documentation, since it is not at all obvious.
|
||||
|
||||
** Issues in i18n
|
||||
|
||||
Les catégories d'avertissements incluent :
|
||||
conflicts-sr conflits S/R (activé par défaut)
|
||||
conflicts-rr conflits R/R (activé par défaut)
|
||||
dangling-alias l'alias chaîne n'est pas attaché à un symbole
|
||||
deprecated construction obsolète
|
||||
empty-rule règle vide sans %empty
|
||||
midrule-values valeurs de règle intermédiaire non définies ou inutilisées
|
||||
precedence priorité et associativité inutiles
|
||||
yacc incompatibilités avec POSIX Yacc
|
||||
other tous les autres avertissements (activé par défaut)
|
||||
all tous les avertissements sauf « dangling-alias » et « yacc »
|
||||
no-CATEGORY désactiver les avertissements dans CATEGORIE
|
||||
none désactiver tous les avertissements
|
||||
error[=CATEGORY] traiter les avertissements comme des erreurs
|
||||
|
||||
Line -1 and -3 should mention CATEGORIE, not CATEGORY.
|
||||
|
||||
* Bison 3.9
|
||||
** Rewrite glr.cc (currently glr2.cc)
|
||||
*** custom error messages
|
||||
|
||||
*** Remove jumps
|
||||
We can probably replace setjmp/longjmp with exceptions. That would help
|
||||
tremendously other languages such as D and Java that probably have no
|
||||
similar feature. If we remove jumps, we probably no longer need _Noreturn,
|
||||
so simplify `b4_attribute_define([noreturn])` into `b4_attribute_define`.
|
||||
|
||||
After discussing with Valentin, it was decided that it's better to stay with
|
||||
jumps, since in some places exceptions are ruled out from C++.
|
||||
|
||||
*** Coding style
|
||||
Move to our coding conventions. In particular names such as yy_glr_stack,
|
||||
not yyGLRStack.
|
||||
|
||||
*** yydebug
|
||||
It should be a member of the parser object, see lalr1.cc. Let the parser
|
||||
object decide what the debug stream is, rather than open coding std::cerr.
|
||||
|
||||
*** Avoid pointers
|
||||
There are many places where pointers should be replaced with references.
|
||||
Some occurrences were fixed, but now some have improper names:
|
||||
|
||||
-yygetToken (int *yycharp, ]b4_namespace_ref[::]b4_parser_class[& yyparser][]b4_pure_if([, glr_stack* yystackp])[]b4_user_formals[)
|
||||
+yygetToken (int& yycharp, ]b4_namespace_ref[::]b4_parser_class[& yyparser][]b4_pure_if([, glr_stack* yystackp])[]b4_user_formals[)
|
||||
|
||||
yycharp is no longer a Pointer. And yystackp should probably also be a reference.
|
||||
|
||||
*** parse.assert
|
||||
Currently all the assertions are enabled. Once we are confident in glr2.cc,
|
||||
let parse.assert use the same approach as in lalr1.cc.
|
||||
|
||||
*** debug_stream
|
||||
Stop using std::cerr everywhere.
|
||||
|
||||
*** glr.c
|
||||
When glr2.cc fully replaces glr.cc, get rid of the glr.cc scaffolding in
|
||||
glr.c.
|
||||
|
||||
* Chains
|
||||
** Unit rules / Injection rules (Akim Demaille)
|
||||
Maybe we could expand unit rules (or "injections", see
|
||||
https://homepages.cwi.nl/~daybuild/daily-books/syntax/2-sdf/sdf.html), i.e.,
|
||||
transform
|
||||
|
||||
exp: arith | bool;
|
||||
arith: exp '+' exp;
|
||||
bool: exp '&' exp;
|
||||
|
||||
into
|
||||
|
||||
exp: exp '+' exp | exp '&' exp;
|
||||
|
||||
when there are no actions. This can significantly speed up some grammars.
|
||||
I can't find the papers. In particular the book 'LR parsing: Theory and
|
||||
Practice' is impossible to find, but according to 'Parsing Techniques: a
|
||||
Practical Guide', it includes information about this issue. Does anybody
|
||||
have it?
|
||||
|
||||
** clean up (Akim Demaille)
|
||||
Do not work on these items now, as I (Akim) have branches with a lot of
|
||||
changes in this area (hitting several files), and no desire to have to fix
|
||||
conflicts. Addressing these items will happen after my branches have been
|
||||
merged.
|
||||
|
||||
*** lalr.c
|
||||
Introduce a goto struct, and use it in place of from_state/to_state.
|
||||
Rename states1 as path, length as pathlen.
|
||||
Introduce inline functions for things such as nullable[*rp - ntokens]
|
||||
where we need to map from symbol number to nterm number.
|
||||
|
||||
There are probably a significant part of the relations management that
|
||||
should be migrated on top of a bitsetv.
|
||||
|
||||
*** closure
|
||||
It should probably take a "state*" instead of two arguments.
|
||||
|
||||
*** traces
|
||||
The "automaton" and "set" categories are not so useful. We should probably
|
||||
introduce lr(0) and lalr, just the way we have ielr categories. The
|
||||
"closure" function is too verbose, it should probably have its own category.
|
||||
|
||||
"set" can still be used for summarizing the important sets. That would make
|
||||
tests easy to maintain.
|
||||
|
||||
*** complain.*
|
||||
Rename these guys as "diagnostics.*" (or "diagnose.*"), since that's the
|
||||
name they have in GCC, clang, etc. Likewise for the complain_* series of
|
||||
functions.
|
||||
|
||||
*** ritem
|
||||
states/nstates, rules/nrules, ..., ritem/nritems
|
||||
Fix the latter.
|
||||
|
||||
*** m4: slot, type, type_tag
|
||||
The meaning of type_tag varies depending on api.value.type. We should avoid
|
||||
that and using clear definitions with stable semantics.
|
||||
|
||||
* D programming language
|
||||
There's a number of features that are missing, here sorted in _suggested_
|
||||
order of implementation.
|
||||
|
||||
When copying code from other skeletons, keep the comments exactly as they
|
||||
are. Keep the same variable names. If you change the wording in one place,
|
||||
do it in the others too. In other words: make sure to keep the
|
||||
maintenance *simple* by avoiding any gratuitous difference.
|
||||
|
||||
** CI
|
||||
Check when gdc and ldc.
|
||||
|
||||
** GLR Parser
|
||||
This is very ambitious. That's the final boss. There are currently no
|
||||
"clean" implementation to get inspiration from.
|
||||
|
||||
glr.c is very clean but:
|
||||
- is low-level C
|
||||
- is a different skeleton from yacc.c
|
||||
|
||||
glr.cc is (currently) an ugly hack: a C++ shell around glr.c. Valentin
|
||||
Tolmer is currently rewriting glr.cc to be clean C++, but he is not
|
||||
finished. There will be a lot a common code between lalr1.cc and glr.cc, so
|
||||
eventually I would like them to be fused into a single skeleton, supporting
|
||||
both deterministic and generalized parsing.
|
||||
|
||||
It would be great for D to also support this.
|
||||
|
||||
The basic ideas of GLR are explained here:
|
||||
|
||||
https://www.codeproject.com/Articles/5259825/GLR-Parsing-in-Csharp-How-to-Use-The-Most-Powerful
|
||||
|
||||
* Better error messages
|
||||
The users are not provided with enough tools to forge their error messages.
|
||||
See for instance "Is there an option to change the message produced by
|
||||
YYERROR_VERBOSE?" by Simon Sobisch, on bison-help.
|
||||
|
||||
See also
|
||||
https://www.cs.tufts.edu/~nr/cs257/archive/clinton-jefferey/lr-error-messages.pdf
|
||||
https://research.swtch.com/yyerror
|
||||
http://gallium.inria.fr/~fpottier/publis/fpottier-reachability-cc2016.pdf
|
||||
|
||||
* Modernization
|
||||
Fix data/skeletons/yacc.c so that it defines YYPTRDIFF_T properly for modern
|
||||
and older C++ compilers. Currently the code defaults to defining it to
|
||||
'long' for non-GCC compilers, but it should use the proper C++ magic to
|
||||
define it to the same type as the C ptrdiff_t type.
|
||||
|
||||
* Completion
|
||||
Several features are not available in all the back-ends.
|
||||
|
||||
- push parsers: glr.c, glr.cc, lalr1.cc (not very difficult)
|
||||
- token constructors: Java, C, D (a bit difficult)
|
||||
- glr: D, Java (super difficult)
|
||||
|
||||
* Bugs
|
||||
** Autotest has quotation issues
|
||||
tests/input.at:1730:AT_SETUP([%define errors])
|
||||
|
||||
->
|
||||
|
||||
$ ./tests/testsuite -l | grep errors | sed q
|
||||
38: input.at:1730 errors
|
||||
|
||||
* Short term
|
||||
** Better design for diagnostics
|
||||
The current implementation of diagnostics is ad hoc, it grew organically.
|
||||
It works as a series of calls to several functions, with dependency of the
|
||||
latter calls on the former. For instance:
|
||||
|
||||
complain (&sym->location,
|
||||
sym->content->status == needed ? complaint : Wother,
|
||||
_("symbol %s is used, but is not defined as a token"
|
||||
" and has no rules; did you mean %s?"),
|
||||
quote_n (0, sym->tag),
|
||||
quote_n (1, best->tag));
|
||||
if (feature_flag & feature_caret)
|
||||
location_caret_suggestion (sym->location, best->tag, stderr);
|
||||
|
||||
We should rewrite this in a more FP way:
|
||||
|
||||
1. build a rich structure that denotes the (complete) diagnostic.
|
||||
"Complete" in the sense that it also contains the suggestions, the list
|
||||
of possible matches, etc.
|
||||
|
||||
2. send this to the pretty-printing routine. The diagnostic structure
|
||||
should be sufficient so that we can generate all the 'format' of
|
||||
diagnostics, including the fixits.
|
||||
|
||||
If properly done, this diagnostic module can be detached from Bison and be
|
||||
put in gnulib. It could be used, for instance, for errors caught by
|
||||
xgettext.
|
||||
|
||||
There's certainly already something alike in GCC. At least that's the
|
||||
impression I get from reading the "-fdiagnostics-format=FORMAT" part of this
|
||||
page:
|
||||
|
||||
https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html
|
||||
|
||||
** 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
|
||||
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
|
||||
print{,-xml} counterpart. We would very much like to re-use the pretty format
|
||||
of states from .output for the graphs, etc.
|
||||
|
||||
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
|
||||
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
|
||||
user semantic actions for why this is necessary. */
|
||||
yytoken = yytranslate_ (yychar);
|
||||
|
||||
|
||||
** Get rid of fake #lines [Bison: ...]
|
||||
Possibly as simple as checking whether the column number is nonnegative.
|
||||
|
||||
I have seen messages like the following from GCC.
|
||||
|
||||
<built-in>:0: fatal error: opening dependency file .deps/libltdl/argz.Tpo: No such file or directory
|
||||
|
||||
|
||||
** 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).
|
||||
|
||||
* Various
|
||||
** Rewrite glr.cc in C++ (Valentin Tolmer)
|
||||
As a matter of fact, it would be very interesting to see how much we can
|
||||
share between lalr1.cc and glr.cc. Most of the skeletons should be common.
|
||||
It would be a very nice source of inspiration for the other languages.
|
||||
|
||||
Valentin Tolmer is working on this.
|
||||
|
||||
* 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.
|
||||
|
||||
(Some time later): it's also very nice to have three stacks: it's more dense
|
||||
as we don't lose bits to padding. For instance the typical stack for states
|
||||
will use 8 bits, while it is likely to consume 32 bits in a struct.
|
||||
|
||||
We need trustworthy benchmarks for Bison, for all our backends. Akim has a
|
||||
few things scattered around; we need to put them in the repo, and make them
|
||||
more useful.
|
||||
|
||||
* 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
|
||||
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
|
||||
part of $default. Should we make the two reductions explicit, or just
|
||||
keep $default? See the following point.
|
||||
|
||||
** Disabled Reductions
|
||||
See 'tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
|
||||
what we want to do.
|
||||
|
||||
** Documentation
|
||||
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
|
||||
undocumented ''features''. Maybe an empty action ought to be
|
||||
presented too. Shall we try to make a single grammar with all these
|
||||
features, or should we have several very small grammars?
|
||||
|
||||
* Extensions
|
||||
** More languages?
|
||||
Well, only if there is really some demand for it.
|
||||
|
||||
*** PHP
|
||||
https://github.com/scfc/bison-php/blob/master/data/lalr1.php
|
||||
|
||||
*** Python
|
||||
https://lists.gnu.org/r/bison-patches/2013-09/msg00000.html and following
|
||||
|
||||
** Multiple start symbols
|
||||
Revert a70e75b8a41755ab96ab211a0ea111ac68a4aadd.
|
||||
Revert tests: disable "Multistart reports".
|
||||
|
||||
Would be very useful when parsing closely related languages. The idea is to
|
||||
declare several start symbols, for instance
|
||||
|
||||
%start stmt expr
|
||||
%%
|
||||
stmt: ...
|
||||
expr: ...
|
||||
|
||||
and to generate parse(), parse_stmt() and parse_expr(). Technically, the
|
||||
above grammar would be transformed into
|
||||
|
||||
%start yy_start
|
||||
%token YY_START_STMT YY_START_EXPR
|
||||
%%
|
||||
yy_start: YY_START_STMT stmt | YY_START_EXPR expr
|
||||
|
||||
so that there are no new conflicts in the grammar (as would undoubtedly
|
||||
happen with yy_start: stmt | expr). Then adjust the skeletons so that this
|
||||
initial token (YY_START_STMT, YY_START_EXPR) be shifted first in the
|
||||
corresponding parse function.
|
||||
|
||||
*** Number of useless symbols
|
||||
AT_TEST(
|
||||
[[%start exp;
|
||||
exp: exp;]],
|
||||
[[input.y: warning: 2 nonterminals useless in grammar [-Wother]
|
||||
input.y: warning: 2 rules useless in grammar [-Wother]
|
||||
input.y:2.8-10: error: start symbol exp does not derive any sentence]])
|
||||
|
||||
We should say "1 nonterminal": the other one is $accept, which should not
|
||||
participate in the count.
|
||||
|
||||
*** Tokens
|
||||
Do we want to disallow terminal start symbols? The limitation is not
|
||||
technical. Can it be useful to someone to "parse" a token?
|
||||
|
||||
** %include
|
||||
This is a popular demand. We already made many changes in the parser that
|
||||
should make this reasonably easy to implement.
|
||||
|
||||
Bruce Mardle <[email protected]>
|
||||
https://lists.gnu.org/r/bison-patches/2015-09/msg00000.html
|
||||
|
||||
However, there are many other things to do before having such a feature,
|
||||
because I don't want a % equivalent to #include (which we all learned to
|
||||
hate). I want something that builds "modules" of grammars, and assembles
|
||||
them together, paying attention to keep separate bits separated, in pseudo
|
||||
name spaces.
|
||||
|
||||
** Push parsers
|
||||
There is demand for push parsers in C++.
|
||||
|
||||
** Generate code instead of tables
|
||||
This is certainly quite a lot of work. See
|
||||
https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.50.4539.
|
||||
|
||||
** $-1
|
||||
We should find a means to provide an access to values deep in the
|
||||
stack. For instance, instead of
|
||||
|
||||
baz: qux { $$ = $<foo>-1 + $<bar>0 + $1; }
|
||||
|
||||
we should be able to have:
|
||||
|
||||
foo($foo) bar($bar) baz($bar): qux($qux) { $baz = $foo + $bar + $qux; }
|
||||
|
||||
Or something like this.
|
||||
|
||||
** %if and the like
|
||||
It should be possible to have %if/%else/%endif. The implementation is
|
||||
not clear: should it be lexical or syntactic. Vadim Maslow thinks it
|
||||
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
|
||||
to avoid falling into another CPP mistake.
|
||||
|
||||
(Later): I'm sure there's actually good case for this. People who need that
|
||||
feature can use m4/cpp on top of Bison. I don't think it is worth the
|
||||
trouble in Bison itself.
|
||||
|
||||
** XML Output
|
||||
There are couple of available extensions of Bison targeting some XML
|
||||
output. Some day we should consider including them. One issue is
|
||||
that they seem to be quite orthogonal to the parsing technique, and
|
||||
seem to depend mostly on the possibility to have some code triggered
|
||||
for each reduction. As a matter of fact, such hooks could also be
|
||||
used to generate the yydebug traces. Some generic scheme probably
|
||||
exists in there.
|
||||
|
||||
XML output for GNU Bison and gcc
|
||||
http://www.cs.may.ie/~jpower/Research/bisonXML/
|
||||
|
||||
XML output for GNU Bison
|
||||
http://yaxx.sourceforge.net/
|
||||
|
||||
* Coding system independence
|
||||
Paul notes:
|
||||
|
||||
Currently Bison assumes 8-bit bytes (i.e. that UCHAR_MAX is
|
||||
255). It also assumes that the 8-bit character encoding is
|
||||
the same for the invocation of 'bison' as it is for the
|
||||
invocation of 'cc', but this is not necessarily true when
|
||||
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
|
||||
addressing (unless we find a gung-ho volunteer for EBCDIC or
|
||||
PDP-10 ports :-) but they should probably be documented
|
||||
somewhere.
|
||||
|
||||
More importantly, Bison does not currently allow NUL bytes in
|
||||
tokens, either via escapes (e.g., "x\0y") or via a NUL byte in
|
||||
the source code. This should get fixed.
|
||||
|
||||
* Broken options?
|
||||
** %token-table
|
||||
** Skeleton strategy
|
||||
Must we keep %token-table?
|
||||
|
||||
* Precedence
|
||||
|
||||
** Partial order
|
||||
It is unfortunate that there is a total order for precedence. It
|
||||
makes it impossible to have modular precedence information. We should
|
||||
move to partial orders (sounds like series/parallel orders to me).
|
||||
|
||||
This is a prerequisite for modules.
|
||||
|
||||
* Pre and post actions.
|
||||
From: Florian Krohm <[email protected]>
|
||||
Subject: YYACT_EPILOGUE
|
||||
To: [email protected]
|
||||
X-Sent: 1 week, 4 days, 14 hours, 38 minutes, 11 seconds ago
|
||||
|
||||
The other day I had the need for explicitly building the parse tree. I
|
||||
used %locations for that and defined YYLLOC_DEFAULT to call a function
|
||||
that returns the tree node for the production. Easy. But I also needed
|
||||
to assign the S-attribute to the tree node. That cannot be done in
|
||||
YYLLOC_DEFAULT, because it is invoked before the action is executed.
|
||||
The way I solved this was to define a macro YYACT_EPILOGUE that would
|
||||
be invoked after the action. For reasons of symmetry I also added
|
||||
YYACT_PROLOGUE. Although I had no use for that I can envision how it
|
||||
might come in handy for debugging purposes.
|
||||
All is needed is to add
|
||||
|
||||
#if YYLSP_NEEDED
|
||||
YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen, yyloc, (yylsp - yylen));
|
||||
#else
|
||||
YYACT_EPILOGUE (yyval, (yyvsp - yylen), yylen);
|
||||
#endif
|
||||
|
||||
at the proper place to bison.simple. Ditto for YYACT_PROLOGUE.
|
||||
|
||||
I was wondering what you think about adding YYACT_PROLOGUE/EPILOGUE
|
||||
to bison. If you're interested, I'll work on a patch.
|
||||
|
||||
* Better graphics
|
||||
Equip the parser with a means to create the (visual) parse tree.
|
||||
|
||||
|
||||
-----
|
||||
|
||||
# LocalWords: Cex gnulib gl Bistromathic TokenKinds yylex enum YYEOF EOF
|
||||
# LocalWords: YYerror gettext af hb YYERRCODE undef calc FIXME dev yyerror
|
||||
# LocalWords: Autoconf YYUNDEFTOK lexemes parsers Bistromathic's yyreport
|
||||
# LocalWords: const argc yacc yyclearin lookahead destructor Rici incluent
|
||||
# LocalWords: yydestruct yydiscardin catégories d'avertissements sr activé
|
||||
# LocalWords: conflits défaut rr l'alias chaîne n'est attaché un symbole
|
||||
# LocalWords: obsolète règle vide midrule valeurs de intermédiaire ou avec
|
||||
# LocalWords: définies inutilisées priorité associativité inutiles POSIX
|
||||
# LocalWords: incompatibilités tous les autres avertissements sauf dans rp
|
||||
# LocalWords: désactiver CATEGORIE traiter comme des erreurs glr Akim bool
|
||||
# LocalWords: Demaille arith lalr goto struct pathlen nullable ntokens lr
|
||||
# LocalWords: nterm bitsetv ielr ritem nstates nrules nritems yysymbol EQ
|
||||
# LocalWords: SymbolKind YYEMPTY YYUNDEF YYTNAME NUM yyntokens yytname sed
|
||||
# LocalWords: nonterminals yykind yycode YYNAMES yynames init getName conv
|
||||
# LocalWords: TokenKind ival yychar yylval yylexer Tolmer hoc
|
||||
# LocalWords: Sobisch YYPTRDIFF ptrdiff Autotest toknum yytoknum
|
||||
# LocalWords: sym Wother stderr FP fixits xgettext fdiagnostics Graphviz
|
||||
# LocalWords: graphviz VCG bitset xml bw maint yytoken YYABORT deps
|
||||
# LocalWords: YYACCEPT yytranslate nonnegative destructors yyerrlab repo
|
||||
# LocalWords: backends stmt expr yy Mardle baz qux Vadim Maslow CPP cpp
|
||||
# LocalWords: yydebug gcc UCHAR EBCDIC gung PDP NUL Pre Florian Krohm utf
|
||||
# LocalWords: YYACT YYLLOC YYLSP yyval yyvsp yylen yyloc yylsp endif
|
||||
# LocalWords: ispell american
|
||||
|
||||
Local Variables:
|
||||
mode: outline
|
||||
coding: utf-8
|
||||
fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2001-2004, 2006, 2008-2015, 2018-2022, 2025-2026 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
||||
Texts. A copy of the license is included in the "GNU Free
|
||||
Documentation License" file as part of this distribution.
|
||||
Vendored
+1535
File diff suppressed because it is too large
Load Diff
-39
@@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Convenience script for regenerating all autogeneratable files that are
|
||||
# omitted from the version control repository. In particular, this script
|
||||
# also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files
|
||||
# with new versions of autoconf or automake.
|
||||
|
||||
# Copyright (C) 2003-2026 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Originally written by Paul Eggert. The canonical version of this
|
||||
# script is maintained as top/autogen.sh in gnulib. However, to be
|
||||
# useful to your package, you should place a copy of it under version
|
||||
# control in the top-level directory of your package. The intent is
|
||||
# that all customization can be done with a bootstrap.conf file also
|
||||
# maintained in your version control; gnulib comes with a template
|
||||
# build-aux/bootstrap.conf to get you started.
|
||||
#
|
||||
# Alternatively, you can use an autogen.sh script that is specific
|
||||
# to your package.
|
||||
|
||||
me="$0"
|
||||
medir=`dirname "$me"`
|
||||
|
||||
# Read the function library and the configuration.
|
||||
. "$medir"/bootstrap-funclib.sh
|
||||
|
||||
autogen "$@"
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Convenience script for fetching auxiliary files that are omitted from
|
||||
# the version control repository of this package.
|
||||
|
||||
# Copyright (C) 2003-2026 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Originally written by Paul Eggert. The canonical version of this
|
||||
# script is maintained as top/autopull.sh in gnulib. However, to be
|
||||
# useful to your package, you should place a copy of it under version
|
||||
# control in the top-level directory of your package. The intent is
|
||||
# that all customization can be done with a bootstrap.conf file also
|
||||
# maintained in your version control; gnulib comes with a template
|
||||
# build-aux/bootstrap.conf to get you started.
|
||||
#
|
||||
# Alternatively, you can use an autopull.sh script that is specific
|
||||
# to your package.
|
||||
|
||||
me="$0"
|
||||
medir=`dirname "$me"`
|
||||
|
||||
# Read the function library and the configuration.
|
||||
. "$medir"/bootstrap-funclib.sh
|
||||
|
||||
autopull "$@"
|
||||
@@ -1,246 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Bootstrap this package from checked-out sources.
|
||||
|
||||
scriptversion=2025-06-10.02; # UTC
|
||||
|
||||
# Copyright (C) 2003-2026 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Originally written by Paul Eggert. The canonical version of this
|
||||
# script is maintained as top/bootstrap in gnulib. However, to be
|
||||
# useful to your package, you should place a copy of it under version
|
||||
# control in the top-level directory of your package. The intent is
|
||||
# that all customization can be done with a bootstrap.conf file also
|
||||
# maintained in your version control; gnulib comes with a template
|
||||
# build-aux/bootstrap.conf to get you started.
|
||||
|
||||
# Please report bugs or propose patches to [email protected].
|
||||
|
||||
me="$0"
|
||||
medir=`dirname "$me"`
|
||||
|
||||
# Read the function library and the configuration.
|
||||
. "$medir"/bootstrap-funclib.sh
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $me [OPTION]...
|
||||
Bootstrap this package from the checked-out sources.
|
||||
|
||||
Optional environment variables:
|
||||
GNULIB_SRCDIR Specifies the local directory where gnulib
|
||||
sources reside. Use this if you already
|
||||
have gnulib sources on your machine, and
|
||||
you want to use these sources.
|
||||
GNULIB_REFDIR Specifies the local directory where a gnulib
|
||||
repository (with a .git subdirectory) resides.
|
||||
Use this if you already have gnulib sources
|
||||
and history on your machine, and do not want
|
||||
to waste your bandwidth downloading them again.
|
||||
Only used for phase 1 (--pull).
|
||||
GNULIB_URL URL of the gnulib repository. The default is
|
||||
$default_gnulib_url,
|
||||
which is Gnulib's upstream repository.
|
||||
Only used for phase 1 (--pull).
|
||||
|
||||
Options:
|
||||
|
||||
--pull Do phase 1: Pull files from the network.
|
||||
--gen Do phase 2: Generate files from local files
|
||||
(no network access).
|
||||
(The default is to do both phases.)
|
||||
|
||||
--gnulib-srcdir=DIRNAME Specifies the local directory where gnulib
|
||||
sources reside. Use this if you already
|
||||
have gnulib sources on your machine, and
|
||||
you want to use these sources. Defaults
|
||||
to \$GNULIB_SRCDIR.
|
||||
--gnulib-refdir=DIRNAME Specifies the local directory where a gnulib
|
||||
repository (with a .git subdirectory) resides.
|
||||
Use this if you already have gnulib sources
|
||||
and history on your machine, and do not want
|
||||
to waste your bandwidth downloading them again.
|
||||
Defaults to \$GNULIB_REFDIR.
|
||||
Only used for phase 1 (--pull).
|
||||
|
||||
--bootstrap-sync If this bootstrap script is not identical to
|
||||
the version in the local gnulib sources,
|
||||
update this script, and then restart it with
|
||||
/bin/sh or the shell \$CONFIG_SHELL.
|
||||
--no-bootstrap-sync Do not check whether bootstrap is out of sync.
|
||||
|
||||
--copy Copy files instead of creating symbolic links.
|
||||
Only used for phase 2 (--gen).
|
||||
--force Attempt to bootstrap even if the sources seem
|
||||
not to have been checked out.
|
||||
--no-git Do not use git to update gnulib. Requires that
|
||||
\$GNULIB_SRCDIR or the --gnulib-srcdir option
|
||||
points to a gnulib repository with the correct
|
||||
revision.
|
||||
Only used for phase 1 (--pull).
|
||||
--skip-po Do not download *.po files.
|
||||
Only used for phase 1 (--pull).
|
||||
EOF
|
||||
bootstrap_print_option_usage_hook
|
||||
cat <<EOF
|
||||
If the file bootstrap.conf exists in the same directory as this script, its
|
||||
contents are read as shell variables to configure the bootstrap.
|
||||
|
||||
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
||||
are honored.
|
||||
|
||||
Gnulib sources can be fetched in various ways:
|
||||
|
||||
* If GNULIB_SRCDIR is set (either as an environment variable or via the
|
||||
--gnulib-srcdir option), then sources are fetched from that local
|
||||
directory. If it is a git repository and the configuration variable
|
||||
GNULIB_REVISION is set in bootstrap.conf, then that revision is
|
||||
checked out.
|
||||
|
||||
* Otherwise, if this package is in a git repository with a 'gnulib'
|
||||
submodule configured, then that submodule is initialized and updated
|
||||
and sources are fetched from there. If GNULIB_REFDIR is set (either
|
||||
as an environment variable or via the --gnulib-refdir option) and is
|
||||
a git repository, then it is used as a reference.
|
||||
|
||||
* Otherwise, if the 'gnulib' directory does not exist, Gnulib sources
|
||||
are cloned into that directory using git from \$GNULIB_URL, defaulting
|
||||
to $default_gnulib_url; if GNULIB_REFDIR is set and is a git repository
|
||||
its contents may be used to accelerate the process.
|
||||
If the configuration variable GNULIB_REVISION is set in bootstrap.conf,
|
||||
then that revision is checked out.
|
||||
|
||||
* Otherwise, the existing Gnulib sources in the 'gnulib' directory are
|
||||
used. If it is a git repository and the configuration variable
|
||||
GNULIB_REVISION is set in bootstrap.conf, then that revision is
|
||||
checked out.
|
||||
|
||||
If you maintain a package and want to pin a particular revision of the
|
||||
Gnulib sources that has been tested with your package, then there are
|
||||
two possible approaches: either configure a 'gnulib' submodule with the
|
||||
appropriate revision, or set GNULIB_REVISION (and if necessary
|
||||
GNULIB_URL) in bootstrap.conf.
|
||||
|
||||
Running without arguments will suffice in most cases.
|
||||
EOF
|
||||
}
|
||||
|
||||
# Parse options.
|
||||
|
||||
# Whether to pull and generate.
|
||||
pull=false
|
||||
gen=false
|
||||
|
||||
# Whether to use copies instead of symlinks.
|
||||
copy=false
|
||||
|
||||
# Use git to update gnulib sources
|
||||
use_git=true
|
||||
|
||||
for option
|
||||
do
|
||||
case $option in
|
||||
--help)
|
||||
usage
|
||||
exit;;
|
||||
--version)
|
||||
set -e
|
||||
echo "bootstrap $scriptversion lib $scriptlibversion"
|
||||
echo "$copyright"
|
||||
exit 0
|
||||
;;
|
||||
--pull)
|
||||
pull=true;;
|
||||
--gen)
|
||||
gen=true;;
|
||||
--gnulib-srcdir=*)
|
||||
GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
|
||||
--gnulib-refdir=*)
|
||||
GNULIB_REFDIR=${option#--gnulib-refdir=};;
|
||||
--skip-po)
|
||||
SKIP_PO=t;;
|
||||
--force)
|
||||
checkout_only_file=;;
|
||||
--copy)
|
||||
copy=true;;
|
||||
--bootstrap-sync)
|
||||
bootstrap_sync=true;;
|
||||
--no-bootstrap-sync)
|
||||
bootstrap_sync=false;;
|
||||
--no-git)
|
||||
use_git=false;;
|
||||
*)
|
||||
bootstrap_option_hook $option || die "$option: unknown option";;
|
||||
esac
|
||||
done
|
||||
|
||||
# Default is to do both.
|
||||
$pull || $gen || pull=true gen=true
|
||||
|
||||
$use_git || test -n "$GNULIB_SRCDIR" \
|
||||
|| die "Error: --no-git requires \$GNULIB_SRCDIR environment variable" \
|
||||
"or --gnulib-srcdir option"
|
||||
test -z "$GNULIB_SRCDIR" || test -d "$GNULIB_SRCDIR" \
|
||||
|| die "Error: \$GNULIB_SRCDIR environment variable or --gnulib-srcdir" \
|
||||
"option is specified, but does not denote a directory"
|
||||
|
||||
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
||||
die "Bootstrapping from a non-checked-out distribution is risky."
|
||||
fi
|
||||
|
||||
check_build_prerequisites $use_git
|
||||
|
||||
if $bootstrap_sync; then
|
||||
prepare_GNULIB_SRCDIR
|
||||
upgrade_bootstrap "$@"
|
||||
# Since we have now upgraded if needed, no need to try it a second time below.
|
||||
bootstrap_sync=false
|
||||
fi
|
||||
|
||||
echo "$0: Bootstrapping from checked-out $package sources..."
|
||||
|
||||
# Pass GNULIB_SRCDIR and GNULIB_REFDIR to any subsidiary commands that care.
|
||||
export GNULIB_SRCDIR
|
||||
export GNULIB_REFDIR
|
||||
|
||||
if $pull && { $use_git || test -z "$SKIP_PO"; }; then
|
||||
autopull \
|
||||
`if $bootstrap_sync; then
|
||||
echo ' --bootstrap-sync'
|
||||
else
|
||||
echo ' --no-bootstrap-sync'
|
||||
fi` \
|
||||
`if test -z "$checkout_only_file"; then echo ' --force'; fi` \
|
||||
`if ! $use_git; then echo ' --no-git'; fi` \
|
||||
`if test -n "$SKIP_PO"; then echo ' --skip-po'; fi` \
|
||||
|| die "could not fetch auxiliary files"
|
||||
fi
|
||||
|
||||
if $gen; then
|
||||
autogen \
|
||||
`if $copy; then echo ' --copy'; fi` \
|
||||
`if test -z "$checkout_only_file"; then echo ' --force'; fi` \
|
||||
|| die "could not generate auxiliary files"
|
||||
fi
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# Local Variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%Y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
File diff suppressed because it is too large
Load Diff
-126
@@ -1,126 +0,0 @@
|
||||
# Bootstrap configuration.
|
||||
|
||||
# Copyright (C) 2006-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# gnulib modules used by this package.
|
||||
gnulib_modules='
|
||||
argmatch array-list assert assure attribute
|
||||
bitsetv
|
||||
calloc-posix close closeout config-h c-strcase c-strtod
|
||||
configmake
|
||||
dirname
|
||||
error execute extensions
|
||||
fopen-safer fstrcmp
|
||||
getopt-gnu
|
||||
gettext-h git-version-gen gitlog-to-changelog
|
||||
gpl-3.0 intprops inttypes isnan javacomp-script
|
||||
hash-map
|
||||
javaexec-script
|
||||
ldexpl
|
||||
libtextstyle-optional
|
||||
linked-list
|
||||
malloc-gnu
|
||||
mcel-prefer
|
||||
mbfile mbswidth
|
||||
obstack
|
||||
obstack-printf
|
||||
perror progname
|
||||
quote quotearg
|
||||
rbtreehash-list
|
||||
readline
|
||||
readme-release
|
||||
realloc-posix
|
||||
relocatable-prog relocatable-script
|
||||
rename
|
||||
spawn-pipe stdbool stpcpy stpncpy strdup-posix strerror strverscmp
|
||||
sys_ioctl
|
||||
termios
|
||||
timevar
|
||||
unicodeio unistd unistd-safer unlink unlocked-io
|
||||
update-copyright unsetenv verify
|
||||
warnings
|
||||
winsz-ioctl
|
||||
winsz-termios
|
||||
xalloc
|
||||
xalloc-die
|
||||
xconcat-filename
|
||||
xhash
|
||||
xlist
|
||||
xmap xmemdup0
|
||||
xstrndup
|
||||
|
||||
fprintf-posix printf-posix snprintf-posix sprintf-posix
|
||||
vsnprintf-posix vsprintf-posix
|
||||
'
|
||||
|
||||
checkout_only_file=README-hacking.md
|
||||
|
||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
|
||||
--from-code=UTF-8\\\
|
||||
--flag=asprintf:2:c-format\\\
|
||||
--flag=complain:3:c-format\\\
|
||||
--flag=complain_indent:4:c-format\\\
|
||||
--flag=unexpected_end:2:c-format\\\
|
||||
'
|
||||
XGETTEXT_OPTIONS_RUNTIME=$XGETTEXT_OPTIONS'\\\
|
||||
--keyword=YY_ \\\
|
||||
'
|
||||
|
||||
gnulib_tool_option_extras="\
|
||||
--automake-subdir\
|
||||
--automake-subdir-tests\
|
||||
--avoid=mbiterf\
|
||||
--conditional-dependencies\
|
||||
--makefile-name=gnulib.mk\
|
||||
--po-base=gnulib-po\
|
||||
--po-domain=bison\
|
||||
--symlink\
|
||||
"
|
||||
|
||||
gnulib_extra_files="$gnulib_extra_files build-aux/move-if-change"
|
||||
|
||||
gnulib_extra_files="$gnulib_extra_files build-aux/epsf.tex"
|
||||
|
||||
bootstrap_post_import_hook()
|
||||
{
|
||||
# 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
|
||||
|
||||
# Bison currently uses Gettext 0.19, but the gnulib-po module
|
||||
# imports files from more recent versions of Gettext that are not
|
||||
# yet available widely enough (e.g., not in bionic, used by the CI).
|
||||
# Work around this. Don't use autopoint, which sends some other
|
||||
# files in the past.
|
||||
cp po/Makefile.in.in gnulib-po
|
||||
}
|
||||
|
||||
# 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
|
||||
@@ -1,29 +0,0 @@
|
||||
/announce-gen
|
||||
/compile
|
||||
/config.guess
|
||||
/config.libpath
|
||||
/config.rpath
|
||||
/config.sub
|
||||
/depcomp
|
||||
/do-release-commit-and-tag
|
||||
/epsf.tex
|
||||
/gendocs.sh
|
||||
/git-version-gen
|
||||
/gitlog-to-changelog
|
||||
/gnu-web-doc-update
|
||||
/gnupload
|
||||
/install-reloc
|
||||
/install-sh
|
||||
/javacomp.sh.in
|
||||
/javaexec.sh.in
|
||||
/libtool-reloc
|
||||
/mdate-sh
|
||||
/missing
|
||||
/reloc-ldflags
|
||||
/relocatable.sh.in
|
||||
/test-driver
|
||||
/texinfo.tex
|
||||
/update-copyright
|
||||
/useless-if-before-free
|
||||
/vc-list-files
|
||||
/ylwrap
|
||||
@@ -1,65 +0,0 @@
|
||||
# Copyright (C) 2012-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# 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,62 +0,0 @@
|
||||
# Copyright (C) 2012-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# 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
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
# Generate a release announcement message.
|
||||
|
||||
# Copyright (C) 2007-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Written by Akim Demaille.
|
||||
|
||||
use warnings;
|
||||
use 5.005;
|
||||
use strict;
|
||||
|
||||
my %option;
|
||||
my %directive;
|
||||
my $scanner = `grep -i '"%[a-z]' $ARGV[0]`;
|
||||
$scanner =~ s/"\[-_\]"/-/g;
|
||||
while (<STDIN>)
|
||||
{
|
||||
if (/^\s* # Initial spaces.
|
||||
(?:(-\w),\s+)? # $1: $short: Possible short option.
|
||||
(--[-\w]+) # $2: $long: Mandatory long option.
|
||||
(\[?) # $3: $opt: '[' iff the argument is optional.
|
||||
(?:=(\S+))? # $4: $arg: Possible argument name.
|
||||
\s # Spaces.
|
||||
/x)
|
||||
{
|
||||
my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
|
||||
$short = '' if ! defined $short;
|
||||
$short = '-d' if $long eq '--defines' && ! $short;
|
||||
my $dir = '%' . substr($long, 2);
|
||||
if (index ($scanner, "\"$dir\"") < 0)
|
||||
{
|
||||
if ($long eq '--force-define') { $dir = '%define'; }
|
||||
else { $dir = ''; }
|
||||
}
|
||||
if ($arg)
|
||||
{
|
||||
# if $opt, $arg contains the closing ].
|
||||
substr ($arg, -1) = ''
|
||||
if $opt eq '[';
|
||||
$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]')
|
||||
{
|
||||
# -D/-F do not add quotes to the argument.
|
||||
$dir_arg =
|
||||
$dir eq "%define"
|
||||
? '@var{name} [@var{value}]'
|
||||
: '@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)
|
||||
{
|
||||
# Couldn't find a means to escape @ in the format (for @item, @tab), so
|
||||
# pass it as a literal to print.
|
||||
format STDOUT =
|
||||
@item @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @tab @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @tab @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
{
|
||||
'@', '@option{' . $long . '}',
|
||||
'@', $option{$long} ? ('@option{' . $option{$long} . '}') : '',
|
||||
'@', $directive{$long} ? ('@code{' . $directive{$long} . '}') : ''
|
||||
}
|
||||
.
|
||||
write;
|
||||
}
|
||||
@@ -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,24 +0,0 @@
|
||||
## Copyright (C) 2000-2015, 2018-2022, 2025-2026 Free Software
|
||||
## Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation, either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
EXTRA_DIST += \
|
||||
build-aux/Darwin.valgrind \
|
||||
build-aux/Linux.valgrind \
|
||||
build-aux/cross-options.pl \
|
||||
build-aux/epsf.tex \
|
||||
build-aux/move-if-change \
|
||||
build-aux/prev-version.txt \
|
||||
build-aux/update-b4-copyright
|
||||
@@ -1 +0,0 @@
|
||||
2.0
|
||||
@@ -1,153 +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-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# 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 <https://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,50 +0,0 @@
|
||||
#!/usr/bin/perl -0777 -pi
|
||||
|
||||
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
||||
|
||||
# Copyright (C) 2010-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# 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 <https://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,122 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
# Update expectations in an Autotest test suite.
|
||||
|
||||
# Copyright (C) 2019-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Written by Akim Demaille.
|
||||
|
||||
# usage:
|
||||
#
|
||||
# update-test _build/8d/tests/testsuite.dir/*/testsuite.log
|
||||
#
|
||||
# from your source tree.
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
|
||||
|
||||
def getargs():
|
||||
p = argparse.ArgumentParser(description='Update test cases.')
|
||||
opt = p.add_argument
|
||||
opt('logs', metavar='log', nargs='+', type=str, default=None,
|
||||
help='log files to process')
|
||||
opt('-v', '--verbose', action='store_true',
|
||||
help='Be verbose')
|
||||
return p.parse_args()
|
||||
|
||||
args = getargs()
|
||||
subst = dict()
|
||||
|
||||
|
||||
def trace(*args_):
|
||||
if args.verbose:
|
||||
print(*args_)
|
||||
|
||||
|
||||
def contents(file):
|
||||
'''The contents of a file.'''
|
||||
trace(file)
|
||||
f = open(file)
|
||||
return f.read()
|
||||
|
||||
|
||||
def diff_to_re(match):
|
||||
'''Convert a portion of patch into a regex substitution to perform.
|
||||
No longer used, we now use the expected/effective parts.
|
||||
'''
|
||||
frm = []
|
||||
to = []
|
||||
is_diff = False
|
||||
for l in match.group(1).splitlines():
|
||||
print(l)
|
||||
# t in [-+ ]
|
||||
t = l[0]
|
||||
l = l[1:]
|
||||
if t in ['-', ' ']:
|
||||
is_diff = True
|
||||
frm.append(l)
|
||||
if t in ['+', ' ']:
|
||||
is_diff = True
|
||||
to.append(l)
|
||||
if is_diff:
|
||||
# Do not run s//SOMETHING/g (with an emty pattern), that won't
|
||||
# work well...
|
||||
if frm == []:
|
||||
trace("no from for", match.group(1))
|
||||
return
|
||||
frm = "\n".join(frm)
|
||||
to = "\n".join(to)
|
||||
subst[frm] = to
|
||||
|
||||
|
||||
def update(at_file, logfile):
|
||||
test = contents(at_file)
|
||||
if os.path.isfile(logfile):
|
||||
trace("LOG: ", logfile)
|
||||
l = contents(logfile)
|
||||
trace("LOG: ", l)
|
||||
global subst
|
||||
subst = {}
|
||||
re.sub(r'(?:^@@.*\n)((?:^[-+ ].*\n)+)',
|
||||
diff_to_re, l, flags = re.MULTILINE)
|
||||
print(subst)
|
||||
if subst:
|
||||
# Turn "subst{frm} -> to" into a large RE.
|
||||
frm = '|'.join([re.escape(x) for x in subst])
|
||||
trace("FROM:", frm)
|
||||
test = re.sub("(" + frm + ")",
|
||||
lambda m: subst[m.group(1)],
|
||||
test, flags=re.MULTILINE)
|
||||
open(at_file, 'w').write(test)
|
||||
|
||||
|
||||
def process(logfile):
|
||||
log = contents(logfile)
|
||||
# Look for the file to update.
|
||||
m = re.search(r'^\d+\. ([\-\+\w]+\.at):\d+: ', log, re.MULTILINE)
|
||||
if not m:
|
||||
trace("no diff found:", logfile)
|
||||
return
|
||||
at_file = 'tests/' + m.group(1)
|
||||
print(at_file)
|
||||
update(at_file, logfile)
|
||||
|
||||
for logfile in args.logs:
|
||||
trace("FILE:", logfile)
|
||||
if os.path.isdir(logfile):
|
||||
logfile = os.path.join(logfile, 'testsuite.log')
|
||||
process(logfile)
|
||||
@@ -1,179 +0,0 @@
|
||||
## Customize maint.mk -*- makefile -*-
|
||||
## Copyright (C) 2008-2015, 2018-2022, 2025-2026 Free Software
|
||||
## Foundation, Inc.
|
||||
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation, either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# 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
|
||||
|
||||
# By default, propagate -j from make to Bison's test suite.
|
||||
TESTSUITEFLAGS = $(filter -j%,$(MAKEFLAGS))
|
||||
|
||||
# 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_indent
|
||||
|
||||
# The local directory containing the checked-out copy of gnulib used in
|
||||
# this release. Used solely to get a date for the "announcement" target.
|
||||
gnulib_dir = $(srcdir)/gnulib
|
||||
|
||||
bootstrap-tools = autoconf,automake,flex,gettext,gnulib
|
||||
|
||||
announcement_Cc_ = \
|
||||
[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. ##
|
||||
## -------------------- ##
|
||||
|
||||
# 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))
|
||||
# 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. ##
|
||||
## -------------------------- ##
|
||||
|
||||
# po-check: we use gnulib-po, so we don't need/want them in our POTFILE.
|
||||
generated_files =
|
||||
|
||||
exclude = \
|
||||
$(foreach a,$(1),$(eval $(subst $$,$$$$,exclude_file_name_regexp--sc_$(a))))
|
||||
|
||||
$(call exclude, \
|
||||
bindtextdomain=^lib/main.c$$ \
|
||||
cast_of_argument_to_free=^src/muscle-tab.c$$ \
|
||||
error_message_uppercase=etc/bench.pl.in$$ \
|
||||
file_system=^doc/Doxyfile.in$$ \
|
||||
po_check=^tests|(^po/POTFILES.in|.md)$$ \
|
||||
preprocessor_indentation=^data/|^lib/|^src/parse-gram.[ch]$$ \
|
||||
program_name=^lib/main.c$$ \
|
||||
prohibit_always-defined_macros=^data/skeletons/yacc.c$$ \
|
||||
prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \
|
||||
prohibit_always-defined_macros+=?|^tests/regression.at$$ \
|
||||
prohibit_atoi_atof=^(doc|etc|examples|tests)/ \
|
||||
prohibit_doubled_word=^tests/named-refs.at$$ \
|
||||
prohibit_magic_number_exit=^doc/bison.texi$$ \
|
||||
prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \
|
||||
prohibit_strcmp=^doc/bison\.texi|examples|tests \
|
||||
prohibit_tab_based_indentation=install-icc.sh|\.(am|mk)$$|^\.git|tests/input.at|Makefile$$ \
|
||||
require_config_h=^(lib/yyerror|data/skeletons/(glr|yacc))\.c$$ \
|
||||
require_config_h_first=^(lib/yyerror|data/skeletons/(glr|yacc))\.c$$ \
|
||||
space_before_open_paren=^data/skeletons/ \
|
||||
two_space_separator_in_usage=^(bootstrap|build-aux/install-icc.sh) \
|
||||
unmarked_diagnostics=^(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
|
||||
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
*.t
|
||||
@@ -0,0 +1,2 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
EXTRA_DIST = move-if-change prev-version.txt
|
||||
@@ -0,0 +1,221 @@
|
||||
# Makefile.in generated automatically by automake 1.5a from Makefile.am.
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = @program_transform_name@
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
|
||||
EXEEXT = @EXEEXT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
AMTAR = @AMTAR@
|
||||
AWK = @AWK@
|
||||
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
DEPDIR = @DEPDIR@
|
||||
GENCAT = @GENCAT@
|
||||
GLIBC21 = @GLIBC21@
|
||||
GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLBISON = @INTLBISON@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
M4 = @M4@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
PACKAGE = @PACKAGE@
|
||||
POFILES = @POFILES@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
U = @U@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
install_sh = @install_sh@
|
||||
|
||||
EXTRA_DIST = move-if-change prev-version.txt
|
||||
subdir = config
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
DIST_COMMON = Makefile.am Makefile.in config.guess config.sub depcomp \
|
||||
install-sh mdate-sh missing mkinstalldirs texinfo.tex
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu config/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && \
|
||||
CONFIG_HEADERS= CONFIG_LINKS= \
|
||||
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
|
||||
uninstall-info-am:
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
$(mkinstalldirs) "$(distdir)/$$dir"; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pR $$d/$$file $(distdir) \
|
||||
|| exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
|
||||
installdirs:
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic distclean \
|
||||
distclean-generic distdir dvi dvi-am info info-am install \
|
||||
install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic uninstall uninstall-am uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
+1308
File diff suppressed because it is too large
Load Diff
+1413
File diff suppressed because it is too large
Load Diff
Executable
+411
@@ -0,0 +1,411 @@
|
||||
#! /bin/sh
|
||||
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
# Copyright 1999, 2000 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 2, 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <[email protected]>.
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
# `libtool' can also be set to `yes' or `no'.
|
||||
|
||||
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. This file always lives in the current directory.
|
||||
# Also, the AIX compiler puts `$object:' at the start of each line;
|
||||
# $object doesn't have directory information.
|
||||
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
outname="$stripped.o"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 AIX compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
|
||||
tmpdepfile1="$object.d"
|
||||
tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile1"; then
|
||||
tmpdepfile="$tmpdepfile1"
|
||||
else
|
||||
tmpdepfile="$tmpdepfile2"
|
||||
fi
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a space and a tab in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*) # this is libtool, let us make it quiet
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
case "$arg" in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
;;
|
||||
esac
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
# X makedepend
|
||||
(
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in no)
|
||||
set ""; shift
|
||||
cleared=yes
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift;;
|
||||
-*)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tail +3 "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*)
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
case $arg in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
;;
|
||||
esac
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
"$@" -E |
|
||||
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*)
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
case $arg in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
;;
|
||||
esac
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+251
@@ -0,0 +1,251 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
Executable
+97
@@ -0,0 +1,97 @@
|
||||
#!/bin/sh
|
||||
# Get modification time of a file or directory and pretty-print it.
|
||||
# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# written by Ulrich Drepper <[email protected]>, June 1995
|
||||
#
|
||||
# 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 2, 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, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Prevent date giving response in another language.
|
||||
LANG=C
|
||||
export LANG
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
LC_TIME=C
|
||||
export LC_TIME
|
||||
|
||||
# Get the extended ls output of the file or directory.
|
||||
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
|
||||
if ls -L /dev/null 1>/dev/null 2>&1; then
|
||||
set - x`ls -L -l -d $1`
|
||||
else
|
||||
set - x`ls -l -d $1`
|
||||
fi
|
||||
# The month is at least the fourth argument
|
||||
# (3 shifts here, the next inside the loop).
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
|
||||
# Find the month. Next argument is day, followed by the year or time.
|
||||
month=
|
||||
until test $month
|
||||
do
|
||||
shift
|
||||
case $1 in
|
||||
Jan) month=January; nummonth=1;;
|
||||
Feb) month=February; nummonth=2;;
|
||||
Mar) month=March; nummonth=3;;
|
||||
Apr) month=April; nummonth=4;;
|
||||
May) month=May; nummonth=5;;
|
||||
Jun) month=June; nummonth=6;;
|
||||
Jul) month=July; nummonth=7;;
|
||||
Aug) month=August; nummonth=8;;
|
||||
Sep) month=September; nummonth=9;;
|
||||
Oct) month=October; nummonth=10;;
|
||||
Nov) month=November; nummonth=11;;
|
||||
Dec) month=December; nummonth=12;;
|
||||
esac
|
||||
done
|
||||
|
||||
day=$2
|
||||
|
||||
# Here we have to deal with the problem that the ls output gives either
|
||||
# the time of day or the year.
|
||||
case $3 in
|
||||
*:*) set `date`; eval year=\$$#
|
||||
case $2 in
|
||||
Jan) nummonthtod=1;;
|
||||
Feb) nummonthtod=2;;
|
||||
Mar) nummonthtod=3;;
|
||||
Apr) nummonthtod=4;;
|
||||
May) nummonthtod=5;;
|
||||
Jun) nummonthtod=6;;
|
||||
Jul) nummonthtod=7;;
|
||||
Aug) nummonthtod=8;;
|
||||
Sep) nummonthtod=9;;
|
||||
Oct) nummonthtod=10;;
|
||||
Nov) nummonthtod=11;;
|
||||
Dec) nummonthtod=12;;
|
||||
esac
|
||||
# For the first six month of the year the time notation can also
|
||||
# be used for files modified in the last year.
|
||||
if (expr $nummonth \> $nummonthtod) > /dev/null;
|
||||
then
|
||||
year=`expr $year - 1`
|
||||
fi;;
|
||||
*) year=$3;;
|
||||
esac
|
||||
|
||||
# The result.
|
||||
echo $day $month $year
|
||||
Executable
+336
@@ -0,0 +1,336 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <[email protected]>, 1996.
|
||||
|
||||
# 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 2, 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case "$1" in
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing 0.4 - GNU automake"
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aclocal)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1Help2man' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
|
||||
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
|
||||
# We have makeinfo, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||
fi
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar ${1+"$@"} && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar ${1+"$@"} && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case "$firstarg" in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" ${1+"$@"} && exit 0
|
||||
;;
|
||||
esac
|
||||
case "$firstarg" in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" ${1+"$@"} && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequirements for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+101
@@ -0,0 +1,101 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <[email protected]>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
# $Id$
|
||||
|
||||
errstatus=0
|
||||
dirmode=""
|
||||
|
||||
usage="\
|
||||
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
|
||||
|
||||
# process command line arguments
|
||||
while test $# -gt 0 ; do
|
||||
case "${1}" in
|
||||
-h | --help | --h* ) # -h for help
|
||||
echo "${usage}" 1>&2; exit 0 ;;
|
||||
-m ) # -m PERM arg
|
||||
shift
|
||||
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
|
||||
dirmode="${1}"
|
||||
shift ;;
|
||||
-- ) shift; break ;; # stop option processing
|
||||
-* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
|
||||
* ) break ;; # first non-opt arg
|
||||
esac
|
||||
done
|
||||
|
||||
for file
|
||||
do
|
||||
if test -d "$file"; then
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
|
||||
case $dirmode in
|
||||
'')
|
||||
if mkdir -p -- . 2>/dev/null; then
|
||||
echo "mkdir -p -- $*"
|
||||
exec mkdir -p -- "$@"
|
||||
fi ;;
|
||||
*)
|
||||
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
|
||||
echo "mkdir -m $dirmode -p -- $*"
|
||||
exec mkdir -m "$dirmode" -p -- "$@"
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
for file
|
||||
do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d
|
||||
do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
else
|
||||
if test ! -z "$dirmode"; then
|
||||
echo "chmod $dirmode $pathcomp"
|
||||
|
||||
lasterr=""
|
||||
chmod "$dirmode" "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -z "$lasterr"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 3
|
||||
# End:
|
||||
# mkinstalldirs ends here
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
# Like mv $1 $2, but if the files are the same, just delete $1.
|
||||
# Status is 0 if $2 is changed, 1 otherwise.
|
||||
if
|
||||
test -r $2
|
||||
then
|
||||
if
|
||||
cmp -s $1 $2
|
||||
then
|
||||
echo $2 is unchanged
|
||||
rm -f $1
|
||||
else
|
||||
mv -f $1 $2
|
||||
fi
|
||||
else
|
||||
mv -f $1 $2
|
||||
fi
|
||||
@@ -0,0 +1 @@
|
||||
1.29c
|
||||
+6288
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
-372
@@ -1,372 +0,0 @@
|
||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2001-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
AC_PREREQ([2.71])
|
||||
m4_pattern_forbid([^_?(gl_[A-Z]|AX_|BISON_)])
|
||||
m4_pattern_allow([^BISON_USE_NLS$])
|
||||
|
||||
AC_INIT([GNU Bison],
|
||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||
[[email protected]],
|
||||
[],
|
||||
[https://www.gnu.org/software/bison/])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2026])
|
||||
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
|
||||
[The copyright year for this package])
|
||||
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# When we move to Automake 1.16, simplify examples/c/reccalc/local.mk.
|
||||
# Our CI build the packages on Bionic, which has only Automake 1.15.
|
||||
#
|
||||
# We want gnits strictness only when rolling a stable release. For
|
||||
# release candidates, we use version strings like 2.4.3_rc1, but gnits
|
||||
# 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.15 dist-lzip 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.
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
|
||||
# Gnulib (early checks).
|
||||
gl_EARLY
|
||||
|
||||
# Gnulib uses '#pragma GCC diagnostic push' to silence some
|
||||
# warnings, but older gcc doesn't support this.
|
||||
AC_CACHE_CHECK([whether pragma GCC diagnostic push works],
|
||||
[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([20])
|
||||
BISON_CXXSTD([2b])
|
||||
AM_CONDITIONAL([ENABLE_CXX11], [test x"$CXX11_CXXFLAGS" != x])
|
||||
AM_CONDITIONAL([ENABLE_CXX14], [test x"$CXX14_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) ;;
|
||||
*) AC_MSG_ERROR([invalid value for --gcc-warnings: $enable_gcc_warnings]);;
|
||||
esac],
|
||||
[enable_gcc_warnings=no])
|
||||
AM_CONDITIONAL([ENABLE_GCC_WARNINGS], [test "$enable_gcc_warnings" = yes])
|
||||
if test "$enable_gcc_warnings" = yes; then
|
||||
# -Wno-tautological-constant-out-of-range-compare for Clang 3.3 and
|
||||
# 3.4 on GNU/Linux that choke on intprops.h's INT_MULTIPLY_WRAPV,
|
||||
# etc.
|
||||
#
|
||||
# ICC: -wr188
|
||||
#
|
||||
# 1669 warnings warnings_default =
|
||||
# ../src/complain.c(318): error #188: enumerated type mixed with another type
|
||||
# 1670 Wconflicts_sr | Wconflicts_rr | Wdeprecated | Wother;
|
||||
# 1671 ^
|
||||
# 1672
|
||||
# 1673../src/complain.c(393): error #188: enumerated type mixed with another type
|
||||
# 1674 warnings w = 1 << wbit;
|
||||
# 1675 ^
|
||||
#
|
||||
# ICC: -wr3179
|
||||
#
|
||||
# char const *usefulness
|
||||
# = rule_useless_in_grammar_p (&rules[r]) ? "useless-in-grammar"
|
||||
# : rule_useless_in_parser_p (&rules[r]) ? "useless-in-parser"
|
||||
# : "useful";
|
||||
#
|
||||
# gives
|
||||
#
|
||||
# error #3179: deprecated conversion of string literal to char* (should be const char*)
|
||||
#
|
||||
# ICC: -wr2259 (that's in C, in spite of what the error messages which seems to be about C++).
|
||||
# error #2259: non-pointer conversion from "int" to "yybool={signed char}" may lose significant bits
|
||||
# yybool yynormal YY_ATTRIBUTE_UNUSED = yystackp->yysplitPoint == YY_NULLPTR;
|
||||
# ^
|
||||
warn_common='-Wall -Wextra
|
||||
-Wcast-align -Wchar-subscripts
|
||||
-fparse-all-comments -Wdocumentation
|
||||
-Wformat -Wimplicit-fallthrough -Wmismatched-dealloc -Wnull-dereference
|
||||
-Wno-sign-compare -Wno-tautological-constant-out-of-range-compare
|
||||
-Wpointer-arith -Wshadow -Wstrict-aliasing
|
||||
-Wunused-but-set-variable
|
||||
-Wwrite-strings
|
||||
-wr188 -wr2259 -wr3179'
|
||||
warn_c='-Wbad-function-cast
|
||||
-Wmissing-prototypes
|
||||
-Wstrict-prototypes'
|
||||
warn_cxx='-Wextra-semi -Wnoexcept -Wsubobject-linkage
|
||||
-Wold-style-cast -Wundefined-func-template
|
||||
-Wweak-vtables'
|
||||
# Warnings for the test suite only.
|
||||
#
|
||||
# -fno-color-diagnostics: Clang's use of colors in the error
|
||||
# messages is confusing the tests looking at the compiler's output
|
||||
# (e.g., synclines.at).
|
||||
#
|
||||
# -Wno-keyword-macro: We use the "#define private public" dirty
|
||||
# trick in the test suite to check some private implementation
|
||||
# details for lalr1.cc.
|
||||
warn_tests='-Wundef -pedantic -Wconversion
|
||||
-Wdeprecated -Wsign-compare -Wsign-conversion
|
||||
-Wtautological-constant-out-of-range-compare
|
||||
-fno-color-diagnostics
|
||||
-Wno-keyword-macro'
|
||||
|
||||
|
||||
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])
|
||||
# Accept this warning only if it is not too touchy (e.g., clang 3.3
|
||||
# and 3.4).
|
||||
gl_WARN_ADD([-Wunreachable-code], [WARN_CFLAGS],
|
||||
[AC_LANG_PROGRAM([],
|
||||
[[if (sizeof (long) < sizeof (int)) return 1;]])])
|
||||
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.
|
||||
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 -Wincompatible-pointer-types;
|
||||
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
|
||||
# Accept this warning only if it is not too touchy (e.g., clang 3.3
|
||||
# and 3.4).
|
||||
gl_WARN_ADD([-Wunreachable-code], [WARN_CXXFLAGS],
|
||||
[AC_LANG_PROGRAM([],
|
||||
[[if (sizeof (long) < sizeof (int)) return 1;]])])
|
||||
gl_WARN_ADD([-Wzero-as-null-pointer-constant], [WARN_CXXFLAGS],
|
||||
[AC_LANG_PROGRAM([], [nullptr])])
|
||||
# Before GCC6, the pragmas don't work well enough to neutralize
|
||||
# this warning.
|
||||
gl_WARN_ADD([-Wuseless-cast], [WARN_CXXFLAGS],
|
||||
[AC_LANG_PROGRAM([], [
|
||||
#if defined __GNUC__ && ! defined __ICC && ! defined __clang__ && __GNUC__ < 6
|
||||
syntax error
|
||||
#endif
|
||||
])])
|
||||
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
|
||||
# Too many compilers complain about Flex generated code.
|
||||
gl_WARN_ADD([-Wno-error], [FLEX_SCANNER_CXXFLAGS])
|
||||
# Clang++ deprecates compiling C.
|
||||
gl_WARN_ADD([-Wno-deprecated], [WNO_DEPRECATED_CXXFLAGS])
|
||||
CXXFLAGS=$save_CXXFLAGS
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
|
||||
AH_VERBATIM([FORTIFY_SOURCE],
|
||||
[/* Enable compile-time and run-time bounds-checking, and some warnings,
|
||||
without upsetting glibc 2.15+. */
|
||||
#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
|
||||
# define _FORTIFY_SOURCE 2
|
||||
#endif
|
||||
])
|
||||
AC_DEFINE([GNULIB_PORTCHECK], [1], [Enable some gnulib portability checks.])
|
||||
fi
|
||||
|
||||
|
||||
BISON_TEST_FOR_WORKING_C_COMPILER
|
||||
BISON_C_COMPILER_POSIXLY_CORRECT
|
||||
BISON_TEST_FOR_WORKING_CXX_COMPILER
|
||||
BISON_CXX_COMPILER_POSIXLY_CORRECT
|
||||
|
||||
# D.
|
||||
AC_CHECK_PROGS([DC], [dmd])
|
||||
AC_CHECK_PROGS([DCFLAGS], [-g])
|
||||
AM_CONDITIONAL([ENABLE_D], [test x"$DC" != x])
|
||||
|
||||
# Java.
|
||||
gt_JAVACOMP([1.7], [1.7])
|
||||
gt_JAVAEXEC
|
||||
AM_CONDITIONAL([ENABLE_JAVA], [test x"$CONF_JAVAC" != x && test x"$CONF_JAVA" != x])
|
||||
|
||||
|
||||
AC_ARG_ENABLE([yacc],
|
||||
[AS_HELP_STRING([--disable-yacc],
|
||||
[do not build a yacc command or an -ly library])],
|
||||
, [enable_yacc=yes])
|
||||
AM_CONDITIONAL([ENABLE_YACC], [test "$enable_yacc" = yes])
|
||||
AC_CONFIG_FILES([src/yacc], [chmod +x src/yacc])
|
||||
|
||||
# Checks for programs.
|
||||
AM_MISSING_PROG([DOT], [dot])
|
||||
AC_PROG_LEX
|
||||
if ! "$LEX_IS_FLEX" || test "X$LEX" = X:; then
|
||||
AC_MSG_WARN([bypassing lex because flex is required])
|
||||
LEX=:
|
||||
fi
|
||||
AM_CONDITIONAL([FLEX_WORKS], [$LEX_IS_FLEX && $FLEX_SUPPORTS_HEADER_OPT])
|
||||
AM_CONDITIONAL([FLEX_CXX_WORKS],
|
||||
[$LEX_IS_FLEX && $FLEX_SUPPORTS_HEADER_OPT && test $bison_cv_cxx_works = yes])
|
||||
AC_PROG_YACC
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_GNU_M4
|
||||
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
|
||||
AC_DEFINE_UNQUOTED([M4_GNU_OPTION], ["$M4_GNU"], [Define to "-g" if GNU M4
|
||||
supports -g, otherwise to "".])
|
||||
AC_PATH_PROG([PERL], [perl])
|
||||
AM_MISSING_PROG([HELP2MAN], [help2man])
|
||||
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||
AC_SUBST([XSLTPROC])
|
||||
|
||||
# Checks for header files.
|
||||
AC_CHECK_HEADERS_ONCE([locale.h])
|
||||
|
||||
# Checks for compiler characteristics.
|
||||
AC_C_INLINE
|
||||
|
||||
# Gnulib (later checks). Putting them here rather than right after
|
||||
# gl_EARLY avoids some redundant checks.
|
||||
gl_INIT
|
||||
|
||||
# We want ostream_printf and hyperlink support.
|
||||
gl_LIBTEXTSTYLE_OPTIONAL([0.20.5])
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS_ONCE([setlocale])
|
||||
|
||||
# Gettext.
|
||||
# We use gnulib, which is only guaranteed to work properly with the
|
||||
# latest Gettext.
|
||||
AM_GNU_GETTEXT([external], [need-ngettext])
|
||||
AM_GNU_GETTEXT_VERSION([0.19])
|
||||
BISON_I18N
|
||||
AC_CONFIG_FILES([gnulib-po/Makefile.in])
|
||||
|
||||
# Internationalized parsers.
|
||||
AC_CONFIG_FILES([runtime-po/Makefile.in])
|
||||
# Autoconf macros for packages using internationalized parsers.
|
||||
aclocaldir='${datadir}/aclocal'
|
||||
AC_SUBST([aclocaldir])
|
||||
|
||||
# Create the benchmark script.
|
||||
AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl])
|
||||
|
||||
# Initialize the test suite.
|
||||
AC_CONFIG_TESTDIR(tests)
|
||||
AC_CONFIG_FILES([tests/atlocal])
|
||||
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
||||
|
||||
AC_CHECK_PROGS([VALGRIND], [valgrind])
|
||||
# Use something simpler that $host_os to select our suppression file.
|
||||
uname=`uname`
|
||||
case $VALGRIND:$uname in
|
||||
'':*) ;;
|
||||
*:Darwin)
|
||||
# See README-hacking.md.
|
||||
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])
|
||||
|
||||
# Build bistromathic if we have the lib and both readline/readline.h
|
||||
# and readline/history.h.
|
||||
AM_CONDITIONAL([ENABLE_BISTROMATHIC],
|
||||
[test "$gl_cv_lib_readline" != no &&
|
||||
test "$ac_cv_header_readline_readline_h" = yes &&
|
||||
test "$ac_cv_header_readline_history_h" = yes])
|
||||
|
||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||
# Needed by tests/atlocal.in.
|
||||
AC_SUBST([GCC])
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
po/Makefile.in
|
||||
doc/yacc.1])
|
||||
|
||||
# Fix LIBOBJS to give the Makefile the right file names. Otherwise
|
||||
# compilation works, but with unexpected file names, so clean rules don't
|
||||
# remove the actual files and distcheck fails.
|
||||
AC_CONFIG_COMMANDS_PRE([
|
||||
case $am__api_version in
|
||||
1.14*|1.15*) gl_LIBOBJS=`echo "$gl_LIBOBJS" | sed -e 's, lib/, lib/lib_libbison_a-,g'`;;
|
||||
*) gl_LIBOBJS=`echo "$gl_LIBOBJS" | sed -e 's, lib/, lib/libbison_a-,g'`;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
@@ -0,0 +1,28 @@
|
||||
@echo off
|
||||
echo Configuring bison for go32
|
||||
rem This batch file assumes a unix-type "sed" program
|
||||
|
||||
echo # Makefile generated by "configure.bat"> Makefile
|
||||
echo all.dos : bison >> Makefile
|
||||
|
||||
if exist config.sed del config.sed
|
||||
|
||||
echo "s/@srcdir@/./g ">> config.sed
|
||||
echo "s/@CC@/gcc/g ">> config.sed
|
||||
echo "s/@INSTALL@//g ">> config.sed
|
||||
echo "s/@INSTALL_PROGRAM@//g ">> config.sed
|
||||
echo "s/@INSTALL_DATA@//g ">> config.sed
|
||||
echo "s/@DEFS@/-DHAVE_STRERROR/g ">> config.sed
|
||||
echo "s/@LIBS@//g ">> config.sed
|
||||
echo "s/@ALLOCA@//g ">> config.sed
|
||||
|
||||
echo "/^bison[ ]*:/,/-o/ { ">> config.sed
|
||||
echo " s/ \$(CC)/ >bison.rf/ ">> config.sed
|
||||
echo " /-o/ a\ ">> config.sed
|
||||
echo " $(CC) @bison.rf ">> config.sed
|
||||
echo "} ">> config.sed
|
||||
|
||||
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
|
||||
sed -f config2.sed Makefile.in >> Makefile
|
||||
del config.sed
|
||||
del config2.sed
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||
#
|
||||
# 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 2 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA
|
||||
|
||||
# We need a recent Autoconf to run a recent Autotest.
|
||||
AC_PREREQ(2.52e)
|
||||
|
||||
AC_INIT([GNU Bison], [1.29d], [[email protected]])
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
|
||||
AM_INIT_AUTOMAKE([bison], [1.29d])
|
||||
AM_CONFIG_HEADER(config.h:config.hin)
|
||||
|
||||
# Initialize the test suite.
|
||||
AC_CONFIG_TESTDIR(tests)
|
||||
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_MINIX
|
||||
AC_ISC_POSIX
|
||||
AM_PROG_CC_STDC
|
||||
AC_PROG_RANLIB
|
||||
# GNU M4 is needed to build the testsuite.
|
||||
BISON_AC_PROG_GNU_M4
|
||||
if test "$ac_cv_prog_gnu_m4" != yes; then
|
||||
missing_dir=`cd $ac_aux_dir && pwd`
|
||||
M4="$missing_dir/missing m4"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(gcc-warnings,
|
||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
||||
[case "${enableval}" in
|
||||
yes|no) ;;
|
||||
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
|
||||
esac],
|
||||
[enableval=no])
|
||||
if test "${enableval}" = yes; then
|
||||
BISON_WARNING(-Wall)
|
||||
BISON_WARNING(-W)
|
||||
BISON_WARNING(-Wbad-function-cast)
|
||||
BISON_WARNING(-Wcast-align)
|
||||
BISON_WARNING(-Wcast-qual)
|
||||
BISON_WARNING(-Wformat)
|
||||
BISON_WARNING(-Wmissing-declarations)
|
||||
BISON_WARNING(-Wmissing-prototypes)
|
||||
BISON_WARNING(-Wnested-externs)
|
||||
BISON_WARNING(-Wshadow)
|
||||
BISON_WARNING(-Wstrict-prototypes)
|
||||
BISON_WARNING(-Wwrite-strings)
|
||||
CFLAGS="$CFLAGS $WARNING_CFLAGS"
|
||||
fi
|
||||
|
||||
# Checks for libraries.
|
||||
AC_DEFINE([_GNU_SOURCE],1,[Define to 1 for GNU C library extensions.])
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(ctype.h locale.h memory.h stdlib.h string.h unistd.h)
|
||||
|
||||
# Checks for typedefs.
|
||||
|
||||
# Checks for structures.
|
||||
|
||||
# Checks for compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AM_C_PROTOTYPES
|
||||
|
||||
# Checks for library functions.
|
||||
AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(mkstemp setlocale)
|
||||
AC_CHECK_DECLS([stpcpy, strndup, strnlen, memchr])
|
||||
AC_REPLACE_FUNCS(stpcpy strndup strnlen strspn memchr)
|
||||
jm_FUNC_MALLOC
|
||||
jm_FUNC_REALLOC
|
||||
jm_PREREQ_QUOTEARG
|
||||
jm_PREREQ_ERROR
|
||||
AM_WITH_DMALLOC
|
||||
|
||||
ALL_LINGUAS="de es et fr ja nl tr ru"
|
||||
AM_GNU_GETTEXT
|
||||
|
||||
# This is necessary so that .o files in LIBOBJS are also built via
|
||||
# the ANSI2KNR-filtering rules.
|
||||
LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
|
||||
AC_SUBST(LIBOBJS)
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
config/Makefile
|
||||
intl/Makefile po/Makefile.in
|
||||
lib/Makefile src/Makefile doc/Makefile
|
||||
m4/Makefile
|
||||
tests/Makefile])
|
||||
-228
@@ -1,228 +0,0 @@
|
||||
This directory contains data needed by Bison.
|
||||
|
||||
# Directory Content
|
||||
## Skeletons
|
||||
Bison skeletons: the general shapes of the different parser kinds, that are
|
||||
specialized for specific grammars by the bison program.
|
||||
|
||||
Currently, the supported skeletons are:
|
||||
|
||||
- yacc.c
|
||||
It used to be named bison.simple: it corresponds to C Yacc
|
||||
compatible LALR(1) parsers.
|
||||
|
||||
- lalr1.cc
|
||||
Produces a C++ parser class.
|
||||
|
||||
- lalr1.java
|
||||
Produces a Java parser class.
|
||||
|
||||
- glr.c
|
||||
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. Because the
|
||||
interface between skeletons and the bison program is not finished, *we are
|
||||
not bound to it*. In particular, Bison is not mature enough for us to
|
||||
consider that "foreign skeletons" are 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.
|
||||
|
||||
# Implementation Notes About the Skeletons
|
||||
|
||||
"Skeleton" in Bison parlance means "backend": a skeleton is fed by the bison
|
||||
executable with LR tables, facts about the symbols, etc. and they generate
|
||||
the output (say parser.cc, parser.hh, location.hh, etc.). They are only in
|
||||
charge of generating the parser and its auxiliary files, they do not
|
||||
generate the XML output, the parser.output reports, nor the graphical
|
||||
rendering.
|
||||
|
||||
The bits of information passing from bison to the backend is named
|
||||
"muscles". Muscles are passed to M4 via its standard input: it's a set of
|
||||
m4 definitions. To see them, use `--trace=muscles`.
|
||||
|
||||
Except for muscles, whose names are generated by bison, the skeletons have
|
||||
no constraint at all on the macro names: there is no technical/theoretical
|
||||
limitation, as long as you generate the output, you can do what you want.
|
||||
However, of course, that would be a bad idea if, say, the C and C++
|
||||
skeletons used different approaches and had completely different
|
||||
implementations. That would be a maintenance nightmare.
|
||||
|
||||
Below, we document some of the macros that we use in several of the
|
||||
skeletons. If you are to write a new skeleton, please, implement them for
|
||||
your language. Overall, be sure to follow the same patterns as the existing
|
||||
skeletons.
|
||||
|
||||
## Vocabulary
|
||||
|
||||
We use "formal arguments", or "formals" for short, to denote the declared
|
||||
parameters of a function (e.g., `int argc, const char **argv`). Yes, this
|
||||
is somewhat contradictory with `param` in the `%param` directives.
|
||||
|
||||
We use "effective arguments", or "args" for short, to denote the values
|
||||
passed in function calls (e.g., `argc, argv`).
|
||||
|
||||
## Symbols
|
||||
|
||||
### `b4_symbol(NUM, FIELD)`
|
||||
In order to unify the handling of the various aspects of symbols (tag, type
|
||||
name, whether terminal, etc.), bison.exe defines one macro per (token,
|
||||
field), where field can `has_id`, `id`, etc.: see
|
||||
`prepare_symbol_definitions()` in `src/output.c`.
|
||||
|
||||
NUM can be:
|
||||
- `empty` to denote the "empty" pseudo-symbol when it exists,
|
||||
- `eof`, `error`, or `undef`
|
||||
- a symbol number.
|
||||
|
||||
FIELD can be:
|
||||
|
||||
- `has_id`: 0 or 1
|
||||
Whether the symbol has an `id`.
|
||||
|
||||
- `id`: string (e.g., `exp`, `NUM`, or `TOK_NUM` with api.token.prefix)
|
||||
If `has_id`, the name of the token kind (prefixed by api.token.prefix if
|
||||
defined), otherwise empty. Guaranteed to be usable as a C identifier.
|
||||
This is used to define the token kind (i.e., the enum used by the return
|
||||
value of yylex). Should be named `token_kind`.
|
||||
|
||||
- `tag`: string
|
||||
A human readable representation of the symbol. Can be `'foo'`,
|
||||
`'foo.id'`, `'"foo"'` etc.
|
||||
|
||||
- `code`: integer
|
||||
The token code associated to the token kind `id`.
|
||||
The external number as used by yylex. Can be ASCII code when a character,
|
||||
some number chosen by bison, or some user number in the case of `%token
|
||||
FOO <NUM>`. Corresponds to `yychar` in `yacc.c`.
|
||||
|
||||
- `is_token`: 0 or 1
|
||||
Whether this is a terminal symbol.
|
||||
|
||||
- `kind_base`: string (e.g., `YYSYMBOL_exp`, `YYSYMBOL_NUM`)
|
||||
The base of the symbol kind, i.e., the enumerator of this symbol (token or
|
||||
nonterminal) which is mapped to its `number`.
|
||||
|
||||
- `kind`: string
|
||||
Same as `kind_base`, but possibly with a prefix in some languages. E.g.,
|
||||
EOF's `kind_base` and `kind` are `YYSYMBOL_YYEOF` in C, but are
|
||||
`S_YYEMPTY` and `symbol_kind::S_YYEMPTY` in C++.
|
||||
|
||||
- `number`: integer
|
||||
The code associated to the `kind`.
|
||||
The internal number (computed from the external number by yytranslate).
|
||||
Corresponds to yytoken in yacc.c. This is the same number that serves as
|
||||
key in b4_symbol(NUM, FIELD).
|
||||
|
||||
In bison, symbols are first assigned increasing numbers in order of
|
||||
appearance (but tokens first, then nterms). After grammar reduction,
|
||||
unused nterms are then renumbered to appear last (i.e., first tokens, then
|
||||
used nterms and finally unused nterms). This final number NUM is the one
|
||||
contained in this field, and it is the one used as key in `b4_symbol(NUM,
|
||||
FIELD)`.
|
||||
|
||||
The code of the rule actions, however, is emitted before we know what
|
||||
symbols are unused, so they use the original numbers. To avoid confusion,
|
||||
they actually use "orig NUM" instead of just "NUM". bison also emits
|
||||
definitions for `b4_symbol(orig NUM, number)` that map from original
|
||||
numbers to the new ones. `b4_symbol` actually resolves `orig NUM` in the
|
||||
other case, i.e., `b4_symbol(orig 42, tag)` would return the tag of the
|
||||
symbols whose original number was 42.
|
||||
|
||||
- `has_type`: 0, 1
|
||||
Whether has a semantic value.
|
||||
|
||||
- `type_tag`: string
|
||||
When api.value.type=union, the generated name for the union member.
|
||||
yytype_INT etc. for symbols that has_id, otherwise yytype_1 etc.
|
||||
|
||||
- `type`: string
|
||||
If it has a semantic value, its type tag, or, if variant are used,
|
||||
its type.
|
||||
In the case of api.value.type=union, type is the real type (e.g. int).
|
||||
|
||||
- `slot`: string
|
||||
If it has a semantic value, the name of the union member (i.e., bounces to
|
||||
either `type_tag` or `type`). It would be better to fix our mess and
|
||||
always use `type` for the true type of the member, and `type_tag` for the
|
||||
name of the union member.
|
||||
|
||||
- `has_printer`: 0, 1
|
||||
- `printer`: string
|
||||
- `printer_file`: string
|
||||
- `printer_line`: integer
|
||||
- `printer_loc`: location
|
||||
If the symbol has a printer, everything about it.
|
||||
|
||||
- `has_destructor`, `destructor`, `destructor_file`, `destructor_line`, `destructor_loc`
|
||||
Likewise.
|
||||
|
||||
### `b4_symbol_value(VAL, [SYMBOL-NUM], [TYPE-TAG])`
|
||||
Expansion of $$, $1, $<TYPE-TAG>3, etc.
|
||||
|
||||
The semantic value from a given VAL.
|
||||
- `VAL`: some semantic value storage (typically a union). e.g., `yylval`
|
||||
- `SYMBOL-NUM`: the symbol number from which we extract the type tag.
|
||||
- `TYPE-TAG`, the user forced the `<TYPE-TAG>`.
|
||||
|
||||
The result can be used safely, it is put in parens to avoid nasty precedence
|
||||
issues.
|
||||
|
||||
### `b4_lhs_value(SYMBOL-NUM, [TYPE])`
|
||||
Expansion of `$$` or `$<TYPE>$`, for symbol `SYMBOL-NUM`.
|
||||
|
||||
### `b4_rhs_data(RULE-LENGTH, POS)`
|
||||
The data corresponding to the symbol `#POS`, where the current rule has
|
||||
`RULE-LENGTH` symbols on RHS.
|
||||
|
||||
### `b4_rhs_value(RULE-LENGTH, POS, SYMBOL-NUM, [TYPE])`
|
||||
Expansion of `$<TYPE>POS`, where the current rule has `RULE-LENGTH` symbols
|
||||
on RHS.
|
||||
|
||||
<!--
|
||||
|
||||
Local Variables:
|
||||
mode: markdown
|
||||
fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2002, 2008-2015, 2018-2022, 2025-2026 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
-->
|
||||
@@ -1,61 +0,0 @@
|
||||
/* Default styling rules for Bison when doing terminal output.
|
||||
Copyright (C) 2019-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This is an experimental feature. The class names may change in the
|
||||
future. */
|
||||
|
||||
/* Diagnostics. */
|
||||
.warning { color: purple; }
|
||||
.error { color: red; }
|
||||
.note { color: cyan; }
|
||||
|
||||
.fixit-insert { color: green; }
|
||||
|
||||
/* Semantic values in Bison's own parser traces. */
|
||||
.value { color: green; }
|
||||
|
||||
/* "Sections" in traces (--trace). */
|
||||
.trace0 { color: green; }
|
||||
|
||||
/* Syntax error messages. */
|
||||
.expected { color: green; }
|
||||
.unexpected { color: red; }
|
||||
|
||||
|
||||
/* Counterexamples. */
|
||||
|
||||
/* Cex: point in rule. */
|
||||
.cex-dot { color: red; }
|
||||
|
||||
/* Cex: coloring various rules. */
|
||||
.cex-0 { color: yellow; }
|
||||
.cex-1 { color: green; }
|
||||
.cex-2 { color: blue; }
|
||||
.cex-3 { color: purple; }
|
||||
.cex-4 { color: violet; }
|
||||
.cex-5 { color: orange; }
|
||||
.cex-6 { color: brown; }
|
||||
.cex-7 { color: mauve; }
|
||||
.cex-8 { color: #013220; } /* Dark green. */
|
||||
.cex-9 { color: #e75480; } /* Dark pink. */
|
||||
.cex-10 { color: cyan; }
|
||||
.cex-11 { color: orange; }
|
||||
|
||||
/* Cex: derivation rewriting steps. */
|
||||
.cex-step { font-style: italic; }
|
||||
|
||||
/* Cex: leaves of a derivation. */
|
||||
.cex-leaf { font-weight: 600; }
|
||||
@@ -1,58 +0,0 @@
|
||||
## Copyright (C) 2002, 2005-2015, 2018-2022, 2025-2026 Free Software
|
||||
## Foundation, Inc.
|
||||
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation, either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
dist_pkgdata_DATA = \
|
||||
data/README.md \
|
||||
data/bison-default.css
|
||||
|
||||
skeletonsdir = $(pkgdatadir)/skeletons
|
||||
dist_skeletons_DATA = \
|
||||
data/skeletons/bison.m4 \
|
||||
data/skeletons/c++-skel.m4 \
|
||||
data/skeletons/c++.m4 \
|
||||
data/skeletons/c-like.m4 \
|
||||
data/skeletons/c-skel.m4 \
|
||||
data/skeletons/c.m4 \
|
||||
data/skeletons/glr.c \
|
||||
data/skeletons/glr.cc \
|
||||
data/skeletons/glr2.cc \
|
||||
data/skeletons/java-skel.m4 \
|
||||
data/skeletons/java.m4 \
|
||||
data/skeletons/lalr1.cc \
|
||||
data/skeletons/lalr1.java \
|
||||
data/skeletons/location.cc \
|
||||
data/skeletons/stack.hh \
|
||||
data/skeletons/traceon.m4 \
|
||||
data/skeletons/variant.hh \
|
||||
data/skeletons/yacc.c
|
||||
|
||||
# Experimental support for the D language.
|
||||
dist_skeletons_DATA += \
|
||||
data/skeletons/d-skel.m4 \
|
||||
data/skeletons/d.m4 \
|
||||
data/skeletons/lalr1.d
|
||||
|
||||
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
|
||||
@@ -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
@@ -1,27 +0,0 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C++ skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
b4_glr_if( [m4_define([b4_used_skeleton], [b4_skeletonsdir/[glr.cc]])])
|
||||
b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_skeletonsdir/[glr.cc]])])
|
||||
|
||||
m4_define_default([b4_used_skeleton], [b4_skeletonsdir/[lalr1.cc]])
|
||||
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
|
||||
|
||||
m4_include(b4_used_skeleton)
|
||||
@@ -1,778 +0,0 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# 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++])])
|
||||
|
||||
b4_percent_define_default([[api.symbol.prefix]], [[S_]])
|
||||
|
||||
m4_include(b4_skeletonsdir/[c.m4])
|
||||
|
||||
b4_percent_define_check_kind([api.namespace], [code], [deprecated])
|
||||
b4_percent_define_check_kind([api.parser.class], [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],
|
||||
[#if defined __cplusplus
|
||||
# define YY_CPLUSPLUS __cplusplus
|
||||
#else
|
||||
# define YY_CPLUSPLUS 199711L
|
||||
#endif
|
||||
|
||||
// Support move semantics when possible.
|
||||
#if 201103L <= YY_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
|
||||
|
||||
// Support noexcept when possible.
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
# define YY_NOEXCEPT noexcept
|
||||
# define YY_NOTHROW
|
||||
#else
|
||||
# define YY_NOEXCEPT
|
||||
# define YY_NOTHROW throw ()
|
||||
#endif
|
||||
|
||||
// Support constexpr when possible.
|
||||
#if 201703 <= YY_CPLUSPLUS
|
||||
# define YY_CONSTEXPR constexpr
|
||||
#else
|
||||
# define YY_CONSTEXPR
|
||||
#endif[]dnl
|
||||
])
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
## ---------------- ##
|
||||
|
||||
b4_percent_define_default([[api.parser.class]], [[parser]])
|
||||
|
||||
# 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([[api.filename.type]], [[const std::string]])
|
||||
# Make it a warning for those who used betas of Bison 3.0.
|
||||
b4_percent_define_default([[api.namespace]], m4_defn([b4_prefix]))
|
||||
|
||||
b4_percent_define_default([[define_location_comparison]],
|
||||
[m4_if(b4_percent_define_get([[filename_type]]),
|
||||
[std::string], [[true]], [[false]])])
|
||||
|
||||
|
||||
|
||||
## ----------- ##
|
||||
## Namespace. ##
|
||||
## ----------- ##
|
||||
|
||||
m4_define([b4_namespace_ref], [b4_percent_define_get([[api.namespace]])])
|
||||
|
||||
|
||||
# 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.
|
||||
# b4_namespace_open would open an anonymous namespace and thus establish
|
||||
# internal linkage. This would compile. However, it's cryptic, and internal
|
||||
# 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
|
||||
# internal linkage somehow, surely we can find a cleaner approach.
|
||||
m4_if(m4_bregexp(b4_namespace_ref, [^[ ]*$]), [-1], [],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
|
||||
[[namespace reference is empty]])])
|
||||
|
||||
# Instead of assuming the C++ compiler will do it, Bison should reject any
|
||||
# invalid b4_namespace_ref that would be converted to a valid
|
||||
# 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
|
||||
# in future releases without risking breaking any existing user grammars.
|
||||
# Specifically, don't allow empty names as b4_namespace_open would just convert
|
||||
# those into anonymous namespaces, and that might tempt some users.
|
||||
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*::]), [-1], [],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
|
||||
[[namespace reference has consecutive "::"]])])
|
||||
m4_if(m4_bregexp(b4_namespace_ref, [::[ ]*$]), [-1], [],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[api.namespace]]),
|
||||
[[namespace reference has a trailing "::"]])])
|
||||
|
||||
m4_define([b4_namespace_open],
|
||||
[b4_user_code([b4_percent_define_get_syncline([[api.namespace]])dnl
|
||||
[namespace ]m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref),
|
||||
[^\(.\)[ ]*::], [\1])),
|
||||
[::], [ { namespace ])[ {]])])
|
||||
|
||||
m4_define([b4_namespace_close],
|
||||
[b4_user_code([b4_percent_define_get_syncline([[api.namespace]])dnl
|
||||
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(b4_namespace_ref[ ]),
|
||||
[^\(.\)[ ]*\(::\)?\([^][:]\|:[^:]\)*],
|
||||
[\1])),
|
||||
[::\([^][:]\|:[^:]\)*], [} ])[} // ]b4_namespace_ref])])
|
||||
|
||||
|
||||
## ------------- ##
|
||||
## Token kinds. ##
|
||||
## ------------- ##
|
||||
|
||||
|
||||
# b4_token_enums
|
||||
# --------------
|
||||
# Output the definition of the token kinds.
|
||||
m4_define([b4_token_enums],
|
||||
[[enum token_kind_type
|
||||
{
|
||||
]b4_symbol([-2], [id])[ = -2,
|
||||
]b4_symbol_foreach([b4_token_enum])dnl
|
||||
[ };]dnl
|
||||
])
|
||||
|
||||
|
||||
|
||||
## -------------- ##
|
||||
## Symbol kinds. ##
|
||||
## -------------- ##
|
||||
|
||||
# b4_declare_symbol_enum
|
||||
# ----------------------
|
||||
# The definition of the symbol internal numbers as an enum.
|
||||
# Defining YYEMPTY here is important: it forces the compiler
|
||||
# to use a signed type, which matters for yytoken.
|
||||
m4_define([b4_declare_symbol_enum],
|
||||
[[enum symbol_kind_type
|
||||
{
|
||||
YYNTOKENS = ]b4_tokens_number[, ///< Number of tokens.
|
||||
]b4_symbol(empty, kind_base)[ = -2,
|
||||
]b4_symbol_foreach([ b4_symbol_enum])dnl
|
||||
[ };]])
|
||||
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
## Semantic Values. ##
|
||||
## ----------------- ##
|
||||
|
||||
|
||||
|
||||
# b4_value_type_declare
|
||||
# ---------------------
|
||||
# Declare value_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]])[ value_type;]],
|
||||
[m4_bmatch(b4_percent_define_get([[api.value.type]]),
|
||||
[union\|union-directive],
|
||||
[[ union value_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],
|
||||
[b4_glr2_cc_if(
|
||||
[b4_value_type_declare],
|
||||
[[#ifdef ]b4_api_PREFIX[STYPE
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC message "bison: do not #define ]b4_api_PREFIX[STYPE in C++, use %define api.value.type"
|
||||
# endif
|
||||
typedef ]b4_api_PREFIX[STYPE value_type;
|
||||
#else
|
||||
]b4_value_type_declare[
|
||||
#endif
|
||||
/// Backward compatibility (Bison 3.8).
|
||||
typedef value_type semantic_type;
|
||||
]])[]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)
|
||||
: std::runtime_error (m)]b4_locations_if([
|
||||
, location (l)])[
|
||||
{}
|
||||
|
||||
syntax_error (const syntax_error& s)
|
||||
: std::runtime_error (s.what ())]b4_locations_if([
|
||||
, location (s.location)])[
|
||||
{}
|
||||
|
||||
~syntax_error () YY_NOEXCEPT YY_NOTHROW;]b4_locations_if([
|
||||
|
||||
location_type location;])[
|
||||
};
|
||||
|
||||
/// Token kinds.
|
||||
struct token
|
||||
{
|
||||
]b4_token_enums[]b4_glr2_cc_if([], [[
|
||||
/// Backward compatibility alias (Bison 3.6).
|
||||
typedef token_kind_type yytokentype;]])[
|
||||
};
|
||||
|
||||
/// Token kind, as returned by yylex.
|
||||
typedef token::token_kind_type token_kind_type;]b4_glr2_cc_if([], [[
|
||||
|
||||
/// Backward compatibility alias (Bison 3.6).
|
||||
typedef token_kind_type token_type;]])[
|
||||
|
||||
/// Symbol kinds.
|
||||
struct symbol_kind
|
||||
{
|
||||
]b4_declare_symbol_enum[
|
||||
};
|
||||
|
||||
/// (Internal) symbol kind.
|
||||
typedef symbol_kind::symbol_kind_type symbol_kind_type;
|
||||
|
||||
/// The number of tokens.
|
||||
static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS;
|
||||
]])
|
||||
|
||||
|
||||
# b4_symbol_type_define
|
||||
# ---------------------
|
||||
# Define symbol_type, the external type for symbols used for symbol
|
||||
# constructors.
|
||||
m4_define([b4_symbol_type_define],
|
||||
[[ /// A complete symbol.
|
||||
///
|
||||
/// Expects its Base type to provide access to the symbol kind
|
||||
/// via kind ().
|
||||
///
|
||||
/// 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 () YY_NOEXCEPT
|
||||
: value ()]b4_locations_if([
|
||||
, location ()])[
|
||||
{}
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
/// Move constructor.
|
||||
basic_symbol (basic_symbol&& that)
|
||||
: Base (std::move (that))
|
||||
, value (]b4_variant_if([], [std::move (that.value)]))b4_locations_if([
|
||||
, location (std::move (that.location))])[
|
||||
{]b4_variant_if([
|
||||
b4_symbol_variant([this->kind ()], [value], [move],
|
||||
[std::move (that.value)])
|
||||
])[}
|
||||
#endif
|
||||
|
||||
/// Copy constructor.
|
||||
basic_symbol (const basic_symbol& that);]b4_variant_if([[
|
||||
|
||||
/// Constructors for typed symbols.
|
||||
]b4_type_foreach([b4_basic_symbol_constructor_define], [
|
||||
])], [[
|
||||
/// 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 (value_type) v]b4_locations_if([,
|
||||
YY_RVREF (location_type) l])[);
|
||||
]])[
|
||||
/// Destroy the symbol.
|
||||
~basic_symbol ()
|
||||
{
|
||||
clear ();
|
||||
}
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
/// Copy assignment.
|
||||
basic_symbol& operator= (const basic_symbol& that)
|
||||
{
|
||||
Base::operator= (that);]b4_variant_if([[
|
||||
]b4_symbol_variant([this->kind ()], [value], [copy],
|
||||
[that.value])], [[
|
||||
value = that.value]])[;]b4_locations_if([[
|
||||
location = that.location;]])[
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// Move assignment.
|
||||
basic_symbol& operator= (basic_symbol&& that)
|
||||
{
|
||||
Base::operator= (std::move (that));]b4_variant_if([[
|
||||
]b4_symbol_variant([this->kind ()], [value], [move],
|
||||
[std::move (that.value)])], [[
|
||||
value = std::move (that.value)]])[;]b4_locations_if([[
|
||||
location = std::move (that.location);]])[
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Destroy contents, and record that is empty.
|
||||
void clear () YY_NOEXCEPT
|
||||
{]b4_variant_if([[
|
||||
// User destructor.
|
||||
symbol_kind_type yykind = this->kind ();
|
||||
basic_symbol<Base>& yysym = *this;
|
||||
(void) yysym;
|
||||
switch (yykind)
|
||||
{
|
||||
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
||||
[ default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Value type destructor.
|
||||
]b4_symbol_variant([[yykind]], [[value]], [[template destroy]])])[
|
||||
Base::clear ();
|
||||
}
|
||||
|
||||
]b4_parse_error_bmatch(
|
||||
[custom\|detailed],
|
||||
[[ /// The user-facing name of this symbol.
|
||||
const char *name () const YY_NOEXCEPT
|
||||
{
|
||||
return ]b4_parser_class[::symbol_name (this->kind ());
|
||||
}]],
|
||||
[simple],
|
||||
[[#if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
/// The user-facing name of this symbol.
|
||||
const char *name () const YY_NOEXCEPT
|
||||
{
|
||||
return ]b4_parser_class[::symbol_name (this->kind ());
|
||||
}
|
||||
#endif // #if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
]],
|
||||
[verbose],
|
||||
[[ /// The user-facing name of this symbol.
|
||||
std::string name () const YY_NOEXCEPT
|
||||
{
|
||||
return ]b4_parser_class[::symbol_name (this->kind ());
|
||||
}]])[]b4_glr2_cc_if([], [[
|
||||
|
||||
/// Backward compatibility (Bison 3.6).
|
||||
symbol_kind_type type_get () const YY_NOEXCEPT;]])[
|
||||
|
||||
/// Whether empty.
|
||||
bool empty () const YY_NOEXCEPT;
|
||||
|
||||
/// Destructive move, \a s is emptied into this.
|
||||
void move (basic_symbol& s);
|
||||
|
||||
/// The semantic value.
|
||||
value_type value;]b4_locations_if([
|
||||
|
||||
/// The location.
|
||||
location_type location;])[
|
||||
|
||||
private:
|
||||
#if YY_CPLUSPLUS < 201103L
|
||||
/// Assignment operator.
|
||||
basic_symbol& operator= (const basic_symbol& that);
|
||||
#endif
|
||||
};
|
||||
|
||||
/// Type access provider for token (enum) based symbols.
|
||||
struct by_kind
|
||||
{
|
||||
/// The symbol kind as needed by the constructor.
|
||||
typedef token_kind_type kind_type;
|
||||
|
||||
/// Default constructor.
|
||||
by_kind () YY_NOEXCEPT;
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
/// Move constructor.
|
||||
by_kind (by_kind&& that) YY_NOEXCEPT;
|
||||
#endif
|
||||
|
||||
/// Copy constructor.
|
||||
by_kind (const by_kind& that) YY_NOEXCEPT;
|
||||
|
||||
/// Constructor from (external) token numbers.
|
||||
by_kind (kind_type t) YY_NOEXCEPT;
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
/// Copy assignment.
|
||||
by_kind& operator= (const by_kind& that);
|
||||
|
||||
/// Move assignment.
|
||||
by_kind& operator= (by_kind&& that);
|
||||
#endif
|
||||
|
||||
/// Record that this symbol is empty.
|
||||
void clear () YY_NOEXCEPT;
|
||||
|
||||
/// Steal the symbol kind from \a that.
|
||||
void move (by_kind& that);
|
||||
|
||||
/// The (internal) type number (corresponding to \a type).
|
||||
/// \a empty when empty.
|
||||
symbol_kind_type kind () const YY_NOEXCEPT;]b4_glr2_cc_if([], [[
|
||||
|
||||
/// Backward compatibility (Bison 3.6).
|
||||
symbol_kind_type type_get () const YY_NOEXCEPT;]])[
|
||||
|
||||
/// The symbol kind.
|
||||
/// \a ]b4_symbol_prefix[YYEMPTY when empty.
|
||||
symbol_kind_type kind_;
|
||||
};]b4_glr2_cc_if([], [[
|
||||
|
||||
/// Backward compatibility for a private implementation detail (Bison 3.6).
|
||||
typedef by_kind by_type;]])[
|
||||
|
||||
/// "External" symbols: returned by the scanner.
|
||||
struct symbol_type : basic_symbol<by_kind>
|
||||
{]b4_variant_if([[
|
||||
/// Superclass.
|
||||
typedef basic_symbol<by_kind> super_type;
|
||||
|
||||
/// Empty symbol.
|
||||
symbol_type () YY_NOEXCEPT {}
|
||||
|
||||
/// Constructor for valueless symbols, and symbols from each type.
|
||||
]b4_type_foreach([_b4_symbol_constructor_define])dnl
|
||||
])[};
|
||||
]])
|
||||
|
||||
|
||||
# b4_public_types_define(hh|cc)
|
||||
# -----------------------------
|
||||
# Provide the implementation needed by the public types.
|
||||
m4_define([b4_public_types_define],
|
||||
[[ // basic_symbol.
|
||||
template <typename Base>
|
||||
]b4_parser_class[::basic_symbol<Base>::basic_symbol (const basic_symbol& that)
|
||||
: Base (that)
|
||||
, value (]b4_variant_if([], [that.value]))b4_locations_if([
|
||||
, location (that.location)])[
|
||||
{]b4_variant_if([
|
||||
b4_symbol_variant([this->kind ()], [value], [copy],
|
||||
[YY_MOVE (that.value)])
|
||||
])[}
|
||||
|
||||
]b4_variant_if([], [[
|
||||
/// Constructor for valueless symbols.
|
||||
template <typename Base>
|
||||
]b4_parser_class[::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[::basic_symbol<Base>::basic_symbol (]b4_join(
|
||||
[typename Base::kind_type t],
|
||||
[YY_RVREF (value_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->kind ()], [value], [YY_MOVE_OR_COPY], [YY_MOVE (v)])])[}]])[
|
||||
|
||||
]b4_glr2_cc_if([], [[
|
||||
template <typename Base>
|
||||
]b4_parser_class[::symbol_kind_type
|
||||
]b4_parser_class[::basic_symbol<Base>::type_get () const YY_NOEXCEPT
|
||||
{
|
||||
return this->kind ();
|
||||
}
|
||||
]])[
|
||||
|
||||
template <typename Base>
|
||||
bool
|
||||
]b4_parser_class[::basic_symbol<Base>::empty () const YY_NOEXCEPT
|
||||
{
|
||||
return this->kind () == ]b4_symbol(empty, kind)[;
|
||||
}
|
||||
|
||||
template <typename Base>
|
||||
void
|
||||
]b4_parser_class[::basic_symbol<Base>::move (basic_symbol& s)
|
||||
{
|
||||
super_type::move (s);
|
||||
]b4_variant_if([b4_symbol_variant([this->kind ()], [value], [move],
|
||||
[YY_MOVE (s.value)])],
|
||||
[value = YY_MOVE (s.value);])[]b4_locations_if([
|
||||
location = YY_MOVE (s.location);])[
|
||||
}
|
||||
|
||||
// by_kind.
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind () YY_NOEXCEPT
|
||||
: kind_ (]b4_symbol(empty, kind)[)
|
||||
{}
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT
|
||||
: kind_ (that.kind_)
|
||||
{
|
||||
that.clear ();
|
||||
}
|
||||
#endif
|
||||
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT
|
||||
: kind_ (that.kind_)
|
||||
{}
|
||||
|
||||
]b4_inline([$1])b4_parser_class[::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT
|
||||
: kind_ (yytranslate_ (t))
|
||||
{}
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
]b4_inline([$1])]b4_parser_class[::by_kind&
|
||||
b4_parser_class[::by_kind::by_kind::operator= (const by_kind& that)
|
||||
{
|
||||
kind_ = that.kind_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
]b4_inline([$1])]b4_parser_class[::by_kind&
|
||||
b4_parser_class[::by_kind::by_kind::operator= (by_kind&& that)
|
||||
{
|
||||
kind_ = that.kind_;
|
||||
that.clear ();
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
]b4_inline([$1])[void
|
||||
]b4_parser_class[::by_kind::clear () YY_NOEXCEPT
|
||||
{
|
||||
kind_ = ]b4_symbol(empty, kind)[;
|
||||
}
|
||||
|
||||
]b4_inline([$1])[void
|
||||
]b4_parser_class[::by_kind::move (by_kind& that)
|
||||
{
|
||||
kind_ = that.kind_;
|
||||
that.clear ();
|
||||
}
|
||||
|
||||
]b4_inline([$1])[]b4_parser_class[::symbol_kind_type
|
||||
]b4_parser_class[::by_kind::kind () const YY_NOEXCEPT
|
||||
{
|
||||
return kind_;
|
||||
}
|
||||
|
||||
]b4_glr2_cc_if([], [[
|
||||
]b4_inline([$1])[]b4_parser_class[::symbol_kind_type
|
||||
]b4_parser_class[::by_kind::type_get () const YY_NOEXCEPT
|
||||
{
|
||||
return this->kind ();
|
||||
}
|
||||
]])[
|
||||
]])
|
||||
|
||||
|
||||
# b4_token_constructor_define
|
||||
# ----------------------------
|
||||
# Define make_FOO for all the token kinds.
|
||||
# Use at class-level. Redefined in variant.hh.
|
||||
m4_define([b4_token_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],
|
||||
[ b4_inline([$1])b4_parser_class[::symbol_kind_type
|
||||
]b4_parser_class[::yytranslate_ (int t) YY_NOEXCEPT
|
||||
{
|
||||
]b4_api_token_raw_if(
|
||||
[[ return static_cast<symbol_kind_type> (t);]],
|
||||
[[ // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
|
||||
// TOKEN-NUM as returned by yylex.
|
||||
static
|
||||
const ]b4_int_type_for([b4_translate])[
|
||||
translate_table[] =
|
||||
{
|
||||
]b4_translate[
|
||||
};
|
||||
// Last valid token kind.
|
||||
const int code_max = ]b4_code_max[;
|
||||
|
||||
if (t <= 0)
|
||||
return symbol_kind::]b4_symbol_prefix[YYEOF;
|
||||
else if (t <= code_max)
|
||||
return static_cast <symbol_kind_type> (translate_table[t]);
|
||||
else
|
||||
return symbol_kind::]b4_symbol_prefix[YYUNDEF;]])[
|
||||
}
|
||||
]])
|
||||
|
||||
|
||||
# b4_lhs_value([TYPE])
|
||||
# --------------------
|
||||
m4_define([b4_lhs_value],
|
||||
[b4_symbol_value([yyval], [$1])])
|
||||
|
||||
|
||||
# b4_rhs_value(RULE-LENGTH, POS, [TYPE])
|
||||
# --------------------------------------
|
||||
# FIXME: Dead code.
|
||||
m4_define([b4_rhs_value],
|
||||
[b4_symbol_value([yysemantic_stack_@{($1) - ($2)@}], [$3])])
|
||||
|
||||
|
||||
# b4_lhs_location()
|
||||
# -----------------
|
||||
# Expansion of @$.
|
||||
m4_define([b4_lhs_location],
|
||||
[(yyloc)])
|
||||
|
||||
|
||||
# b4_rhs_location(RULE-LENGTH, POS)
|
||||
# ---------------------------------
|
||||
# Expansion of @POS, where the current rule has RULE-LENGTH symbols
|
||||
# on RHS.
|
||||
m4_define([b4_rhs_location],
|
||||
[(yylocation_stack_@{($1) - ($2)@})])
|
||||
|
||||
|
||||
# b4_parse_param_decl
|
||||
# -------------------
|
||||
# Extra formal arguments of the constructor.
|
||||
# Change the parameter names from "foo" into "foo_yyarg", so that
|
||||
# there is no collision bw the user chosen attribute name, and the
|
||||
# argument name in the constructor.
|
||||
m4_define([b4_parse_param_decl],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])])
|
||||
|
||||
m4_define([b4_parse_param_decl_1],
|
||||
[$1_yyarg])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_cons
|
||||
# -------------------
|
||||
# Extra initialisations of the constructor.
|
||||
m4_define([b4_parse_param_cons],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[
|
||||
b4_cc_constructor_calls(b4_parse_param)])])
|
||||
m4_define([b4_cc_constructor_calls],
|
||||
[m4_map_sep([b4_cc_constructor_call], [,
|
||||
], [$@])])
|
||||
m4_define([b4_cc_constructor_call],
|
||||
[$2 ($2_yyarg)])
|
||||
|
||||
# b4_parse_param_vars
|
||||
# -------------------
|
||||
# Extra instance variables.
|
||||
m4_define([b4_parse_param_vars],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[
|
||||
// User arguments.
|
||||
b4_cc_var_decls(b4_parse_param)])])
|
||||
m4_define([b4_cc_var_decls],
|
||||
[m4_map_sep([b4_cc_var_decl], [
|
||||
], [$@])])
|
||||
m4_define([b4_cc_var_decl],
|
||||
[ $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 (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,73 +0,0 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# Common code for C-like languages (C, C++, Java, etc.)
|
||||
|
||||
# Copyright (C) 2012-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# _b4_comment(TEXT, OPEN, CONTINUE, END)
|
||||
# --------------------------------------
|
||||
# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines.
|
||||
# Avoid adding indentation to the first line, as the indentation comes
|
||||
# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]).
|
||||
# Turn "*/" in TEXT into "* /" so that we don't unexpectedly close
|
||||
# the comments before its end.
|
||||
#
|
||||
# Prefix all the output lines with PREFIX.
|
||||
m4_define([_b4_comment],
|
||||
[$2[]b4_gsub(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, SYMBOL-NUM, FIELD, DEFAULT-FIELD)
|
||||
# ----------------------------------------------------------
|
||||
# If FIELD (or DEFAULT-FIELD) is non-null, return "VALUE.FIELD",
|
||||
# otherwise just VALUE. Be sure to pass "(VALUE)" if VALUE is a
|
||||
# pointer.
|
||||
m4_define([_b4_dollar_dollar],
|
||||
[b4_symbol_value([$1],
|
||||
[$2],
|
||||
m4_if([$3], [[]],
|
||||
[[$4]], [[$3]]))])
|
||||
|
||||
# b4_dollar_pushdef(VALUE-POINTER, SYMBOL-NUM, [TYPE_TAG], LOCATION)
|
||||
# b4_dollar_popdef
|
||||
# ------------------------------------------------------------------
|
||||
# Define b4_dollar_dollar for VALUE-POINTER and DEFAULT-FIELD,
|
||||
# and b4_at_dollar for LOCATION.
|
||||
m4_define([b4_dollar_pushdef],
|
||||
[m4_pushdef([b4_dollar_dollar],
|
||||
[_b4_dollar_dollar([$1], [$2], m4_dquote($][1), [$3])])dnl
|
||||
m4_pushdef([b4_at_dollar], [$4])dnl
|
||||
])
|
||||
m4_define([b4_dollar_popdef],
|
||||
[m4_popdef([b4_at_dollar])dnl
|
||||
m4_popdef([b4_dollar_dollar])dnl
|
||||
])
|
||||
@@ -1,27 +0,0 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# C skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
b4_glr_if( [m4_define([b4_used_skeleton], [b4_skeletonsdir/[glr.c]])])
|
||||
b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_skeletonsdir/[glr.c]])])
|
||||
|
||||
m4_define_default([b4_used_skeleton], [b4_skeletonsdir/[yacc.c]])
|
||||
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
|
||||
|
||||
m4_include(b4_used_skeleton)
|
||||
-1125
File diff suppressed because it is too large
Load Diff
@@ -1,26 +0,0 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# D skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2018-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
b4_glr_if( [b4_complain([%%glr-parser not supported for D])])
|
||||
b4_nondeterministic_if([b4_complain([%%nondeterministic-parser not supported for D])])
|
||||
|
||||
m4_define_default([b4_used_skeleton], [b4_skeletonsdir/[lalr1.d]])
|
||||
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
|
||||
|
||||
m4_include(b4_used_skeleton)
|
||||
@@ -1,627 +0,0 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# D language support for Bison
|
||||
|
||||
# Copyright (C) 2018-2022, 2025-2026 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
m4_include(b4_skeletonsdir/[c-like.m4])
|
||||
|
||||
|
||||
# b4_symbol_action(SYMBOL-NUM, ACTION)
|
||||
# ------------------------------------
|
||||
# Run the action ACTION ("destructor" or "printer") for SYMBOL-NUM.
|
||||
m4_define([b4_symbol_action],
|
||||
[b4_symbol_if([$1], [has_$2],
|
||||
[b4_dollar_pushdef([yyval],
|
||||
[$1],
|
||||
[],
|
||||
[yyloc])dnl
|
||||
_b4_symbol_case([$1])[]dnl
|
||||
b4_syncline([b4_symbol([$1], [$2_line])], [b4_symbol([$1], [$2_file])])dnl
|
||||
b4_symbol([$1], [$2])
|
||||
b4_syncline([@oline@], [@ofile@])dnl
|
||||
break;
|
||||
|
||||
b4_dollar_popdef[]dnl
|
||||
])])
|
||||
|
||||
|
||||
# b4_use(EXPR)
|
||||
# ------------
|
||||
# Pacify the compiler about some maybe unused value.
|
||||
m4_define([b4_use],
|
||||
[])
|
||||
|
||||
|
||||
# b4_sync_start(LINE, FILE)
|
||||
# -------------------------
|
||||
m4_define([b4_sync_start], [[#]line $1 $2])
|
||||
|
||||
|
||||
# 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_percent_define_if_get2(ARG1, ARG2, DEF, NOT)
|
||||
# -----------------------------------------------
|
||||
# Expand to the value of DEF if ARG1 or ARG2 are %define'ed,
|
||||
# otherwise NOT.
|
||||
m4_define([b4_percent_define_if_get2],
|
||||
[m4_ifval(m4_quote(b4_percent_define_get([$1])),
|
||||
[$3], [m4_ifval(m4_quote(b4_percent_define_get([$2])),
|
||||
[$3], [$4])])])
|
||||
|
||||
# b4_percent_define_class_before_interface(CLASS, INTERFACE)
|
||||
# ----------------------------------------------------------
|
||||
# Expand to a ', ' if both a class and an interface have been %define'ed
|
||||
m4_define([b4_percent_define_class_before_interface],
|
||||
[m4_ifval(m4_quote(b4_percent_define_get([$1])),
|
||||
[m4_ifval(m4_quote(b4_percent_define_get([$2])),
|
||||
[, ])])])
|
||||
|
||||
|
||||
# b4_flag_value(BOOLEAN-FLAG)
|
||||
# ---------------------------
|
||||
m4_define([b4_flag_value], [b4_flag_if([$1], [true], [false])])
|
||||
|
||||
|
||||
# b4_parser_class_declaration
|
||||
# ---------------------------
|
||||
# The declaration of the parser class ("class YYParser"), with all its
|
||||
# qualifiers/annotations.
|
||||
b4_percent_define_default([[api.parser.abstract]], [[false]])
|
||||
b4_percent_define_default([[api.parser.final]], [[false]])
|
||||
b4_percent_define_default([[api.parser.public]], [[false]])
|
||||
|
||||
m4_define([b4_parser_class_declaration],
|
||||
[b4_percent_define_get3([api.parser.annotations], [], [ ])dnl
|
||||
b4_percent_define_flag_if([api.parser.public], [public ])dnl
|
||||
b4_percent_define_flag_if([api.parser.abstract], [abstract ])dnl
|
||||
b4_percent_define_flag_if([api.parser.final], [final ])dnl
|
||||
[class ]b4_parser_class[]dnl
|
||||
b4_percent_define_if_get2([api.parser.extends], [api.parser.implements], [ : ])dnl
|
||||
b4_percent_define_get([api.parser.extends])dnl
|
||||
b4_percent_define_class_before_interface([api.parser.extends], [api.parser.implements])dnl
|
||||
b4_percent_define_get([api.parser.implements])])
|
||||
|
||||
|
||||
# b4_lexer_if(TRUE, FALSE)
|
||||
# ------------------------
|
||||
m4_define([b4_lexer_if],
|
||||
[b4_percent_code_ifdef([[lexer]], [$1], [$2])])
|
||||
|
||||
|
||||
# b4_position_type_if(TRUE, FALSE)
|
||||
# --------------------------------
|
||||
m4_define([b4_position_type_if],
|
||||
[b4_percent_define_ifdef([[position_type]], [$1], [$2])])
|
||||
|
||||
|
||||
# b4_location_type_if(TRUE, FALSE)
|
||||
# --------------------------------
|
||||
m4_define([b4_location_type_if],
|
||||
[b4_percent_define_ifdef([[location_type]], [$1], [$2])])
|
||||
|
||||
|
||||
# b4_identification
|
||||
# -----------------
|
||||
m4_define([b4_identification],
|
||||
[[/** Version number for the Bison executable that generated this parser. */
|
||||
public static immutable string yy_bison_version = "]b4_version_string[";
|
||||
|
||||
/** Name of the skeleton that generated this parser. */
|
||||
public static immutable string yy_bison_skeleton = ]b4_skeleton[;
|
||||
]])
|
||||
|
||||
|
||||
## ------------ ##
|
||||
## Data types. ##
|
||||
## ------------ ##
|
||||
|
||||
# b4_int_type(MIN, MAX)
|
||||
# ---------------------
|
||||
# Return the smallest int type able to handle numbers ranging from
|
||||
# MIN to MAX (included).
|
||||
m4_define([b4_int_type],
|
||||
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
|
||||
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
||||
[int])])
|
||||
|
||||
# b4_int_type_for(NAME)
|
||||
# ---------------------
|
||||
# Return the smallest int type able to handle numbers ranging from
|
||||
# `NAME_min' to `NAME_max' (included).
|
||||
m4_define([b4_int_type_for],
|
||||
[b4_int_type($1_min, $1_max)])
|
||||
|
||||
# b4_null
|
||||
# -------
|
||||
m4_define([b4_null], [null])
|
||||
|
||||
|
||||
# b4_integral_parser_table_define(NAME, DATA, COMMENT)
|
||||
#-----------------------------------------------------
|
||||
# Define "yy<TABLE-NAME>" whose contents is CONTENT.
|
||||
m4_define([b4_integral_parser_table_define],
|
||||
[m4_ifvaln([$3], [b4_comment([$3], [ ])])dnl
|
||||
private static immutable b4_int_type_for([$2])[[]] yy$1_ =
|
||||
@{
|
||||
$2
|
||||
@};dnl
|
||||
])
|
||||
|
||||
|
||||
## ------------- ##
|
||||
## Token kinds. ##
|
||||
## ------------- ##
|
||||
|
||||
m4_define([b4_symbol(-2, id)], [[YYEMPTY]])
|
||||
b4_percent_define_default([[api.token.raw]], [[true]])
|
||||
|
||||
# b4_token_enum(TOKEN-NAME, TOKEN-NUMBER)
|
||||
# ---------------------------------------
|
||||
# Output the definition of this token as an enum.
|
||||
m4_define([b4_token_enum],
|
||||
[b4_token_format([ %s = %s,
|
||||
], [$1])])
|
||||
|
||||
# b4_token_enums
|
||||
# --------------
|
||||
# Output the definition of the tokens as enums.
|
||||
m4_define([b4_token_enums],
|
||||
[/* Token kinds. */
|
||||
public enum TokenKind {
|
||||
]b4_symbol(empty, id)[ = -2,
|
||||
b4_symbol_foreach([b4_token_enum])dnl
|
||||
}
|
||||
])
|
||||
|
||||
# b4_symbol_translate(STRING)
|
||||
# ---------------------------
|
||||
# Used by "bison" in the array of symbol names to mark those that
|
||||
# require translation.
|
||||
m4_define([b4_symbol_translate],
|
||||
[[_($1)]])
|
||||
|
||||
|
||||
# _b4_token_constructor_define(SYMBOL-NUM)
|
||||
# ----------------------------------------
|
||||
# Define Symbol.FOO for SYMBOL-NUM.
|
||||
m4_define([_b4_token_constructor_define],
|
||||
[b4_token_visible_if([$1],
|
||||
[[
|
||||
static auto ]b4_symbol([$1], [id])[(]b4_symbol_if([$1], [has_type],
|
||||
[b4_union_if([b4_symbol([$1], [type]],
|
||||
[[typeof(YYSemanticType.]b4_symbol([$1], [type])[]])) [val]])dnl
|
||||
[]b4_locations_if([b4_symbol_if([$1], [has_type], [[, ]])[Location l]])[)
|
||||
{
|
||||
return Symbol(TokenKind.]b4_symbol([$1], [id])[]b4_symbol_if([$1], [has_type],
|
||||
[[, val]])[]b4_locations_if([[, l]])[);
|
||||
}]])])
|
||||
|
||||
# b4_token_constructor_define
|
||||
# ---------------------------
|
||||
# Define Symbol.FOO for each token kind FOO.
|
||||
m4_define([b4_token_constructor_define],
|
||||
[[
|
||||
/* Implementation of token constructors for each symbol type visible to
|
||||
* the user. The code generates static methods that have the same names
|
||||
* as the TokenKinds.
|
||||
*/]b4_symbol_foreach([_b4_token_constructor_define])dnl
|
||||
])
|
||||
|
||||
## -------------- ##
|
||||
## Symbol kinds. ##
|
||||
## -------------- ##
|
||||
|
||||
# b4_symbol_kind(NUM)
|
||||
# -------------------
|
||||
m4_define([b4_symbol_kind],
|
||||
[SymbolKind.b4_symbol_kind_base($@)])
|
||||
|
||||
|
||||
# b4_symbol_enum(SYMBOL-NUM)
|
||||
# --------------------------
|
||||
# Output the definition of this symbol as an enum.
|
||||
m4_define([b4_symbol_enum],
|
||||
[m4_format([ %-30s %s],
|
||||
m4_format([[%s = %s,]],
|
||||
b4_symbol([$1], [kind_base]),
|
||||
[$1]),
|
||||
[b4_symbol_tag_comment([$1])])])
|
||||
|
||||
|
||||
# b4_declare_symbol_enum
|
||||
# ----------------------
|
||||
# The definition of the symbol internal numbers as an enum.
|
||||
# Defining YYEMPTY here is important: it forces the compiler
|
||||
# to use a signed type, which matters for yytoken.
|
||||
m4_define([b4_declare_symbol_enum],
|
||||
[[ /* Symbol kinds. */
|
||||
struct SymbolKind
|
||||
{
|
||||
enum
|
||||
{
|
||||
]b4_symbol(empty, kind_base)[ = -2, /* No symbol. */
|
||||
]b4_symbol_foreach([b4_symbol_enum])dnl
|
||||
[ }
|
||||
|
||||
private int yycode_;
|
||||
alias yycode_ this;
|
||||
|
||||
this(int code)
|
||||
{
|
||||
yycode_ = code;
|
||||
}
|
||||
|
||||
/* Return YYSTR after stripping away unnecessary quotes and
|
||||
backslashes, so that it's suitable for yyerror. The heuristic is
|
||||
that double-quoting is unnecessary unless the string contains an
|
||||
apostrophe, a comma, or backslash (other than backslash-backslash).
|
||||
YYSTR is taken from yytname. */
|
||||
final void toString(void delegate(const(char)[]) sink) const
|
||||
{
|
||||
immutable string[] yy_sname = @{
|
||||
]b4_symbol_names[
|
||||
@};]b4_has_translations_if([[
|
||||
/* YYTRANSLATABLE[SYMBOL-NUM] -- Whether YY_SNAME[SYMBOL-NUM] is
|
||||
internationalizable. */
|
||||
immutable ]b4_int_type_for([b4_translatable])[[] yytranslatable = @{
|
||||
]b4_translatable[
|
||||
@};]])[
|
||||
|
||||
sink.formattedWrite!"%s"(yy_sname[yycode_]);
|
||||
}
|
||||
}
|
||||
]])
|
||||
|
||||
|
||||
# b4_case(ID, CODE, [COMMENTS])
|
||||
# -----------------------------
|
||||
m4_define([b4_case], [ case $1:m4_ifval([$3], [ b4_comment([$3])])
|
||||
$2
|
||||
break;])
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
## ---------------- ##
|
||||
|
||||
m4_define([b4_yystype], [b4_percent_define_get([[stype]])])
|
||||
b4_percent_define_default([[stype]], [[YYSemanticType]])])
|
||||
|
||||
# %name-prefix
|
||||
m4_define_default([b4_prefix], [[YY]])
|
||||
|
||||
b4_percent_define_default([[api.parser.class]], [b4_prefix[]Parser])])
|
||||
m4_define([b4_parser_class], [b4_percent_define_get([[api.parser.class]])])
|
||||
|
||||
#b4_percent_define_default([[location_type]], [Location])])
|
||||
m4_define([b4_location_type], b4_percent_define_ifdef([[location_type]],[b4_percent_define_get([[location_type]])],[YYLocation]))
|
||||
|
||||
#b4_percent_define_default([[position_type]], [Position])])
|
||||
m4_define([b4_position_type], b4_percent_define_ifdef([[position_type]],[b4_percent_define_get([[position_type]])],[YYPosition]))
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## api.value.type. ##
|
||||
## ---------------- ##
|
||||
|
||||
|
||||
# ---------------------- #
|
||||
# api.value.type=union. #
|
||||
# ---------------------- #
|
||||
|
||||
# b4_symbol_type_register(SYMBOL-NUM)
|
||||
# -----------------------------------
|
||||
# Symbol SYMBOL-NUM has a type (for union) instead of a type-tag.
|
||||
# Extend the definition of %union's body (b4_union_members) with a
|
||||
# field of that type, and extend the symbol's "type" field to point to
|
||||
# the field name, instead of the type name.
|
||||
m4_define([b4_symbol_type_register],
|
||||
[m4_define([b4_symbol($1, type_tag)],
|
||||
[b4_symbol_if([$1], [has_id],
|
||||
[b4_symbol([$1], [id])],
|
||||
[yykind_[]b4_symbol([$1], [number])])])dnl
|
||||
m4_append([b4_union_members],
|
||||
m4_expand([m4_format([ %-40s %s],
|
||||
m4_expand([b4_symbol([$1], [type]) b4_symbol([$1], [type_tag]);]),
|
||||
[b4_symbol_tag_comment([$1])])]))
|
||||
])
|
||||
|
||||
|
||||
# b4_type_define_tag(SYMBOL1-NUM, ...)
|
||||
# ------------------------------------
|
||||
# For the batch of symbols SYMBOL1-NUM... (which all have the same
|
||||
# type), enhance the %union definition for each of them, and set
|
||||
# there "type" field to the field tag name, instead of the type name.
|
||||
m4_define([b4_type_define_tag],
|
||||
[b4_symbol_if([$1], [has_type],
|
||||
[m4_map([b4_symbol_type_register], [$@])])
|
||||
])
|
||||
|
||||
|
||||
# b4_symbol_value_union(VAL, SYMBOL-NUM, [TYPE])
|
||||
# ----------------------------------------------
|
||||
# Same of b4_symbol_value, but when api.value.type=union.
|
||||
m4_define([b4_symbol_value_union],
|
||||
[m4_ifval([$3],
|
||||
[(*($3*)(&$1))],
|
||||
[m4_ifval([$2],
|
||||
[b4_symbol_if([$2], [has_type],
|
||||
[($1.b4_symbol([$2], [type_tag]))],
|
||||
[$1])],
|
||||
[$1])])])
|
||||
|
||||
|
||||
# b4_value_type_setup_union
|
||||
# -------------------------
|
||||
# Setup support for api.value.type=union. Symbols are defined with a
|
||||
# type instead of a union member name: build the corresponding union,
|
||||
# and give the symbols their tag.
|
||||
m4_define([b4_value_type_setup_union],
|
||||
[m4_define([b4_union_members])
|
||||
b4_type_foreach([b4_type_define_tag])
|
||||
m4_copy_force([b4_symbol_value_union], [b4_symbol_value])
|
||||
])
|
||||
|
||||
|
||||
# _b4_value_type_setup_keyword
|
||||
# ----------------------------
|
||||
# api.value.type is defined with a keyword/string syntax. Check if
|
||||
# that is properly defined, and prepare its use.
|
||||
m4_define([_b4_value_type_setup_keyword],
|
||||
[b4_percent_define_check_values([[[[api.value.type]],
|
||||
[[none]],
|
||||
[[union]],
|
||||
[[union-directive]],
|
||||
[[yystype]]]])dnl
|
||||
m4_case(b4_percent_define_get([[api.value.type]]),
|
||||
[union], [b4_value_type_setup_union])])
|
||||
|
||||
|
||||
# b4_value_type_setup
|
||||
# -------------------
|
||||
# Check if api.value.type is properly defined, and possibly prepare
|
||||
# its use.
|
||||
b4_define_silent([b4_value_type_setup],
|
||||
[
|
||||
# Define default value.
|
||||
b4_percent_define_ifdef([[api.value.type]], [],
|
||||
[# %union => api.value.type=union-directive
|
||||
m4_ifdef([b4_union_members],
|
||||
[m4_define([b4_percent_define_kind(api.value.type)], [keyword])
|
||||
m4_define([b4_percent_define(api.value.type)], [union-directive])],
|
||||
[# no tag seen => api.value.type={int}
|
||||
m4_if(b4_tag_seen_flag, 0,
|
||||
[m4_define([b4_percent_define_kind(api.value.type)], [code])
|
||||
m4_define([b4_percent_define(api.value.type)], [int])],
|
||||
[# otherwise api.value.type=yystype
|
||||
m4_define([b4_percent_define_kind(api.value.type)], [keyword])
|
||||
m4_define([b4_percent_define(api.value.type)], [yystype])])])])
|
||||
|
||||
# Set up.
|
||||
m4_bmatch(b4_percent_define_get_kind([[api.value.type]]),
|
||||
[keyword], [_b4_value_type_setup_keyword])
|
||||
])
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
## Semantic Values. ##
|
||||
## ----------------- ##
|
||||
|
||||
|
||||
# b4_symbol_value(VAL, [SYMBOL-NUM], [TYPE-TAG])
|
||||
# ----------------------------------------------
|
||||
# See README. FIXME: factor in c-like?
|
||||
m4_define([b4_symbol_value],
|
||||
[m4_ifval([$3],
|
||||
[($1.$3)],
|
||||
[m4_ifval([$2],
|
||||
[b4_symbol_if([$2], [has_type],
|
||||
[($1.b4_symbol([$2], [type]))],
|
||||
[$1])],
|
||||
[$1])])])
|
||||
|
||||
# b4_lhs_value(SYMBOL-NUM, [TYPE])
|
||||
# --------------------------------
|
||||
# See README.
|
||||
m4_define([b4_lhs_value],
|
||||
[b4_symbol_value([yyval], [$1], [$2])])
|
||||
|
||||
|
||||
# b4_rhs_value(RULE-LENGTH, POS, SYMBOL-NUM, [TYPE])
|
||||
# --------------------------------------------------
|
||||
# See README.
|
||||
#
|
||||
# In this simple implementation, %token and %type have class names
|
||||
# between the angle brackets.
|
||||
m4_define([b4_rhs_value],
|
||||
[b4_symbol_value([(yystack.valueAt (b4_subtract([$1], [$2])))], [$3], [$4])])
|
||||
|
||||
|
||||
# b4_lhs_location()
|
||||
# -----------------
|
||||
# Expansion of @$.
|
||||
m4_define([b4_lhs_location],
|
||||
[(yyloc)])
|
||||
|
||||
|
||||
# b4_rhs_location(RULE-LENGTH, POS)
|
||||
# ---------------------------------
|
||||
# Expansion of @POS, where the current rule has RULE-LENGTH symbols
|
||||
# on RHS.
|
||||
m4_define([b4_rhs_location],
|
||||
[yystack.locationAt (b4_subtract($@))])
|
||||
|
||||
|
||||
# b4_lex_param
|
||||
# b4_parse_param
|
||||
# --------------
|
||||
# If defined, b4_lex_param arrives double quoted, but below we prefer
|
||||
# it to be single quoted. Same for b4_parse_param.
|
||||
|
||||
# TODO: should be in bison.m4
|
||||
m4_define_default([b4_lex_param], [[]]))
|
||||
m4_define([b4_lex_param], b4_lex_param))
|
||||
m4_define([b4_parse_param], b4_parse_param))
|
||||
|
||||
# b4_lex_param_decl
|
||||
# -------------------
|
||||
# Extra formal arguments of the constructor.
|
||||
m4_define([b4_lex_param_decl],
|
||||
[m4_ifset([b4_lex_param],
|
||||
[b4_remove_comma([$1],
|
||||
b4_param_decls(b4_lex_param))],
|
||||
[$1])])
|
||||
|
||||
m4_define([b4_param_decls],
|
||||
[m4_map([b4_param_decl], [$@])])
|
||||
m4_define([b4_param_decl], [, $1])
|
||||
|
||||
m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_decl
|
||||
# -------------------
|
||||
# Extra formal arguments of the constructor.
|
||||
m4_define([b4_parse_param_decl],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[b4_remove_comma([$1],
|
||||
b4_param_decls(b4_parse_param))],
|
||||
[$1])])
|
||||
|
||||
|
||||
|
||||
# b4_lex_param_call
|
||||
# -------------------
|
||||
# Delegating the lexer parameters to the lexer constructor.
|
||||
m4_define([b4_lex_param_call],
|
||||
[m4_ifset([b4_lex_param],
|
||||
[b4_remove_comma([$1],
|
||||
b4_param_calls(b4_lex_param))],
|
||||
[$1])])
|
||||
m4_define([b4_param_calls],
|
||||
[m4_map([b4_param_call], [$@])])
|
||||
m4_define([b4_param_call], [, $2])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_cons
|
||||
# -------------------
|
||||
# Extra initialisations of the constructor.
|
||||
m4_define([b4_parse_param_cons],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[b4_constructor_calls(b4_parse_param)])])
|
||||
|
||||
m4_define([b4_constructor_calls],
|
||||
[m4_map([b4_constructor_call], [$@])])
|
||||
m4_define([b4_constructor_call],
|
||||
[this.$2 = $2;
|
||||
])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_vars
|
||||
# -------------------
|
||||
# Extra instance variables.
|
||||
m4_define([b4_parse_param_vars],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[
|
||||
/* User arguments. */
|
||||
b4_var_decls(b4_parse_param)])])
|
||||
|
||||
m4_define([b4_var_decls],
|
||||
[m4_map_sep([b4_var_decl], [
|
||||
], [$@])])
|
||||
m4_define([b4_var_decl],
|
||||
[ protected $1;])
|
||||
|
||||
|
||||
# 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],
|
||||
[[
|
||||
alias Symbol = ]b4_parser_class[.Symbol;
|
||||
alias Value = ]b4_yystype[;]b4_locations_if([[
|
||||
alias Location = ]b4_location_type[;
|
||||
alias Position = ]b4_position_type[;]b4_push_if([[
|
||||
alias PUSH_MORE = ]b4_parser_class[.YYPUSH_MORE;
|
||||
alias ABORT = ]b4_parser_class[.YYABORT;
|
||||
alias ACCEPT = ]b4_parser_class[.YYACCEPT;]])[]])[
|
||||
]])
|
||||
|
||||
|
||||
# b4_basic_symbol_constructor_define
|
||||
# ----------------------------------
|
||||
# Create Symbol struct constructors for all the visible types.
|
||||
m4_define([b4_basic_symbol_constructor_define],
|
||||
[b4_token_visible_if([$1],
|
||||
[[ this(TokenKind token]b4_symbol_if([$1], [has_type],
|
||||
[[, ]b4_union_if([], [[typeof(YYSemanticType.]])b4_symbol([$1], [type])dnl
|
||||
[]b4_union_if([], [[) ]])[ val]])[]b4_locations_if([[, Location loc]])[)
|
||||
{
|
||||
kind = yytranslate_(token);]b4_union_if([b4_symbol_if([$1], [has_type], [[
|
||||
static foreach (member; __traits(allMembers, YYSemanticType))
|
||||
{
|
||||
static if (is(typeof(mixin("value_." ~ member)) == ]b4_symbol([$1], [type])[))
|
||||
{
|
||||
mixin("value_." ~ member ~ " = val;");
|
||||
}
|
||||
}]])], [b4_symbol_if([$1], [has_type], [[
|
||||
value_.]b4_symbol([$1], [type])[ = val;]])])[]b4_locations_if([
|
||||
location_ = loc;])[
|
||||
}
|
||||
]])])
|
||||
|
||||
|
||||
# b4_symbol_type_define
|
||||
# ---------------------
|
||||
# Define symbol_type, the external type for symbols used for symbol
|
||||
# constructors.
|
||||
m4_define([b4_symbol_type_define],
|
||||
[[
|
||||
/**
|
||||
* A complete symbol
|
||||
*/
|
||||
struct Symbol
|
||||
{
|
||||
private SymbolKind kind;
|
||||
private Value value_;]b4_locations_if([[
|
||||
private Location location_;]])[
|
||||
|
||||
]b4_type_foreach([b4_basic_symbol_constructor_define])[
|
||||
SymbolKind token() { return kind; }
|
||||
Value value() { return value_; }]b4_locations_if([[
|
||||
Location location() { return location_; }]])[
|
||||
]b4_token_ctor_if([b4_token_constructor_define])[
|
||||
}
|
||||
]])
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,398 +0,0 @@
|
||||
# C++ GLR skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# This skeleton produces a C++ class that encapsulates a C glr parser.
|
||||
# This is in order to reduce the maintenance burden. The glr.c
|
||||
# skeleton is clean and pure enough so that there are no real
|
||||
# problems. The C++ interface is the same as that of lalr1.cc. In
|
||||
# fact, glr.c can replace yacc.c without the user noticing any
|
||||
# difference, and similarly for glr.cc replacing lalr1.cc.
|
||||
#
|
||||
# The passing of parse-params
|
||||
#
|
||||
# The additional arguments are stored as members of the parser
|
||||
# object, yyparser. The C routines need to carry yyparser
|
||||
# throughout the C parser; that's easy: make yyparser an
|
||||
# additional parse-param. But because the C++ skeleton needs to
|
||||
# know the "real" original parse-param, we save them
|
||||
# (b4_parse_param_orig). Note that b4_parse_param is overquoted
|
||||
# (and c.m4 strips one level of quotes). This is a PITA, and
|
||||
# explains why there are so many levels of quotes.
|
||||
#
|
||||
# The locations
|
||||
#
|
||||
# We use location.cc just like lalr1.cc, but because glr.c stores
|
||||
# the locations in a union, the position and location classes
|
||||
# must not have a constructor. Therefore, contrary to lalr1.cc, we
|
||||
# must not define "b4_location_constructors". As a consequence the
|
||||
# user must initialize the first positions (in particular the
|
||||
# filename member).
|
||||
|
||||
# We require a pure interface.
|
||||
m4_define([b4_pure_flag], [1])
|
||||
|
||||
m4_include(b4_skeletonsdir/[c++.m4])
|
||||
b4_bison_locations_if([m4_include(b4_skeletonsdir/[location.cc])])
|
||||
|
||||
m4_define([b4_parser_class],
|
||||
[b4_percent_define_get([[api.parser.class]])])
|
||||
|
||||
# Save the parse parameters.
|
||||
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[& yyparser], [[yyparser]]],]
|
||||
m4_defn([b4_parse_param]))],
|
||||
[m4_define([b4_parse_param_wrap],
|
||||
[[b4_namespace_ref::b4_parser_class[& yyparser], [[yyparser]]]])
|
||||
])
|
||||
|
||||
|
||||
# b4_yy_symbol_print_define
|
||||
# -------------------------
|
||||
# Bypass the default implementation to generate the "yy_symbol_print"
|
||||
# and "yy_symbol_value_print" functions.
|
||||
m4_define([b4_yy_symbol_print_define],
|
||||
[[/*--------------------.
|
||||
| Print this symbol. |
|
||||
`--------------------*/
|
||||
|
||||
static void
|
||||
yy_symbol_print (FILE *, ]b4_namespace_ref::b4_parser_class[::symbol_kind_type yytoken,
|
||||
const ]b4_namespace_ref::b4_parser_class[::value_type *yyvaluep]b4_locations_if([[,
|
||||
const ]b4_namespace_ref::b4_parser_class[::location_type *yylocationp]])[]b4_user_formals[)
|
||||
{
|
||||
]b4_parse_param_use[]dnl
|
||||
[ yyparser.yy_symbol_print_ (yytoken, 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 declare yyerror.
|
||||
]m4_append([b4_post_prologue],
|
||||
[b4_syncline([@oline@], [@ofile@])dnl
|
||||
[static void
|
||||
yyerror (]b4_locations_if([[const ]b4_namespace_ref::b4_parser_class[::location_type *yylocationp,
|
||||
]])[]m4_ifset([b4_parse_param], [b4_formals(b4_parse_param),
|
||||
])[const char* msg);]])[
|
||||
|
||||
# Inserted before the epilogue to define implementations (yyerror, parser member
|
||||
# functions etc.).
|
||||
]m4_define([b4_glr_cc_pre_epilogue],
|
||||
[b4_syncline([@oline@], [@ofile@])dnl
|
||||
[
|
||||
/*------------------.
|
||||
| Report an error. |
|
||||
`------------------*/
|
||||
|
||||
static void
|
||||
yyerror (]b4_locations_if([[const ]b4_namespace_ref::b4_parser_class[::location_type *yylocationp,
|
||||
]])[]m4_ifset([b4_parse_param], [b4_formals(b4_parse_param),
|
||||
])[const char* msg)
|
||||
{
|
||||
]b4_parse_param_use[]dnl
|
||||
[ yyparser.error (]b4_locations_if([[*yylocationp, ]])[msg);
|
||||
}
|
||||
|
||||
|
||||
]b4_namespace_open[
|
||||
]dnl In this section, the parse params are the original parse_params.
|
||||
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||
[ /// Build a parser object.
|
||||
]b4_parser_class::b4_parser_class[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
|
||||
:])[
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
]m4_ifset([b4_parse_param], [ ], [ :])[yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[
|
||||
#endif]b4_parse_param_cons[
|
||||
{}
|
||||
|
||||
]b4_parser_class::~b4_parser_class[ ()
|
||||
{}
|
||||
|
||||
]b4_parser_class[::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
|
||||
{}
|
||||
|
||||
int
|
||||
]b4_parser_class[::operator() ()
|
||||
{
|
||||
return parse ();
|
||||
}
|
||||
|
||||
int
|
||||
]b4_parser_class[::parse ()
|
||||
{
|
||||
return ::yy_parse_impl (*this]b4_user_args[);
|
||||
}
|
||||
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
/*--------------------.
|
||||
| Print this symbol. |
|
||||
`--------------------*/
|
||||
|
||||
void
|
||||
]b4_parser_class[::yy_symbol_value_print_ (symbol_kind_type yykind,
|
||||
const value_type* yyvaluep]b4_locations_if([[,
|
||||
const location_type* yylocationp]])[) const
|
||||
{]b4_locations_if([[
|
||||
YY_USE (yylocationp);]])[
|
||||
YY_USE (yyvaluep);
|
||||
std::ostream& yyo = debug_stream ();
|
||||
std::ostream& yyoutput = yyo;
|
||||
YY_USE (yyoutput);
|
||||
]b4_symbol_actions([printer])[
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
]b4_parser_class[::yy_symbol_print_ (symbol_kind_type yykind,
|
||||
const value_type* yyvaluep]b4_locations_if([[,
|
||||
const location_type* yylocationp]])[) const
|
||||
{
|
||||
*yycdebug_ << (yykind < YYNTOKENS ? "token" : "nterm")
|
||||
<< ' ' << yysymbol_name (yykind) << " ("]b4_locations_if([[
|
||||
<< *yylocationp << ": "]])[;
|
||||
yy_symbol_value_print_ (yykind, yyvaluep]b4_locations_if([[, yylocationp]])[);
|
||||
*yycdebug_ << ')';
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
]b4_parser_class[::debug_stream () const
|
||||
{
|
||||
return *yycdebug_;
|
||||
}
|
||||
|
||||
void
|
||||
]b4_parser_class[::set_debug_stream (std::ostream& o)
|
||||
{
|
||||
yycdebug_ = &o;
|
||||
}
|
||||
|
||||
|
||||
]b4_parser_class[::debug_level_type
|
||||
]b4_parser_class[::debug_level () const
|
||||
{
|
||||
return yydebug;
|
||||
}
|
||||
|
||||
void
|
||||
]b4_parser_class[::set_debug_level (debug_level_type l)
|
||||
{
|
||||
// Actually, it is yydebug which is really used.
|
||||
yydebug = l;
|
||||
}
|
||||
|
||||
#endif
|
||||
]m4_popdef([b4_parse_param])dnl
|
||||
b4_namespace_close[]dnl
|
||||
])
|
||||
|
||||
|
||||
m4_define([b4_define_symbol_kind],
|
||||
[m4_format([#define %-15s %s],
|
||||
b4_symbol($][1, kind_base),
|
||||
b4_namespace_ref[::]b4_parser_class[::symbol_kind::]b4_symbol($1, kind_base))
|
||||
])
|
||||
|
||||
# b4_glr_cc_setup
|
||||
# ---------------
|
||||
# Setup redirections for glr.c: Map the names used in c.m4 to the ones used
|
||||
# in c++.m4.
|
||||
m4_define([b4_glr_cc_setup],
|
||||
[[]b4_attribute_define[
|
||||
]b4_null_define[
|
||||
|
||||
// This skeleton is based on C, yet compiles it as C++.
|
||||
// So expect warnings about C style casts.
|
||||
#if defined __clang__ && 306 <= __clang_major__ * 100 + __clang_minor__
|
||||
# pragma clang diagnostic ignored "-Wold-style-cast"
|
||||
#elif defined __GNUC__ && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
|
||||
# pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||
#endif
|
||||
|
||||
// On MacOS, PTRDIFF_MAX is defined as long long, which Clang's
|
||||
// -pedantic reports as being a C++11 extension.
|
||||
#if defined __APPLE__ && YY_CPLUSPLUS < 201103L \
|
||||
&& defined __clang__ && 4 <= __clang_major__
|
||||
# pragma clang diagnostic ignored "-Wc++11-long-long"
|
||||
#endif
|
||||
|
||||
#undef ]b4_symbol(empty, [id])[
|
||||
#define ]b4_symbol(empty, [id])[ ]b4_namespace_ref[::]b4_parser_class[::token::]b4_symbol(empty, [id])[
|
||||
#undef ]b4_symbol(eof, [id])[
|
||||
#define ]b4_symbol(eof, [id])[ ]b4_namespace_ref[::]b4_parser_class[::token::]b4_symbol(eof, [id])[
|
||||
#undef ]b4_symbol(error, [id])[
|
||||
#define ]b4_symbol(error, [id])[ ]b4_namespace_ref[::]b4_parser_class[::token::]b4_symbol(error, [id])[
|
||||
|
||||
#ifndef ]b4_api_PREFIX[STYPE
|
||||
# define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class[::value_type
|
||||
#endif
|
||||
#ifndef ]b4_api_PREFIX[LTYPE
|
||||
# define ]b4_api_PREFIX[LTYPE ]b4_namespace_ref[::]b4_parser_class[::location_type
|
||||
#endif
|
||||
|
||||
typedef ]b4_namespace_ref[::]b4_parser_class[::symbol_kind_type yysymbol_kind_t;
|
||||
|
||||
// Expose C++ symbol kinds to C.
|
||||
]b4_define_symbol_kind(-2)dnl
|
||||
b4_symbol_foreach([b4_define_symbol_kind])])[
|
||||
]])
|
||||
|
||||
|
||||
m4_define([b4_undef_symbol_kind],
|
||||
[[#undef ]b4_symbol($1, kind_base)[
|
||||
]])
|
||||
|
||||
|
||||
# b4_glr_cc_cleanup
|
||||
# -----------------
|
||||
# Remove redirections for glr.c.
|
||||
m4_define([b4_glr_cc_cleanup],
|
||||
[[#undef ]b4_symbol(empty, [id])[
|
||||
#undef ]b4_symbol(eof, [id])[
|
||||
#undef ]b4_symbol(error, [id])[
|
||||
|
||||
]b4_undef_symbol_kind(-2)dnl
|
||||
b4_symbol_foreach([b4_undef_symbol_kind])dnl
|
||||
])
|
||||
|
||||
|
||||
# b4_shared_declarations(hh|cc)
|
||||
# -----------------------------
|
||||
# Declaration that might either go into the header (if --header, $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>
|
||||
|
||||
]b4_cxx_portability[
|
||||
]m4_ifdef([b4_location_include],
|
||||
[[# include ]b4_location_include])[
|
||||
]b4_variant_if([b4_variant_includes])[
|
||||
|
||||
// Whether we are compiled with exception support.
|
||||
#ifndef YY_EXCEPTIONS
|
||||
# if defined __GNUC__ && !defined __EXCEPTIONS
|
||||
# define YY_EXCEPTIONS 0
|
||||
# else
|
||||
# define YY_EXCEPTIONS 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
]b4_YYDEBUG_define[
|
||||
|
||||
]b4_namespace_open[
|
||||
|
||||
]b4_bison_locations_if([m4_ifndef([b4_location_file],
|
||||
[b4_location_define])])[
|
||||
|
||||
/// A Bison parser.
|
||||
class ]b4_parser_class[
|
||||
{
|
||||
public:
|
||||
]b4_public_types_declare[
|
||||
|
||||
/// Build a parser object.
|
||||
]b4_parser_class[ (]b4_parse_param_decl[);
|
||||
virtual ~]b4_parser_class[ ();
|
||||
|
||||
/// Parse. An alias for parse ().
|
||||
/// \returns 0 iff parsing succeeded.
|
||||
int operator() ();
|
||||
|
||||
/// Parse.
|
||||
/// \returns 0 iff parsing succeeded.
|
||||
virtual int parse ();
|
||||
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
/// The current debugging stream.
|
||||
std::ostream& debug_stream () const;
|
||||
/// Set the current debugging stream.
|
||||
void set_debug_stream (std::ostream &);
|
||||
|
||||
/// Type for debugging levels.
|
||||
typedef int debug_level_type;
|
||||
/// The current debugging level.
|
||||
debug_level_type debug_level () const;
|
||||
/// Set the current debugging level.
|
||||
void set_debug_level (debug_level_type l);
|
||||
#endif
|
||||
|
||||
/// 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:
|
||||
/// \brief Report a symbol value on the debug stream.
|
||||
/// \param yykind The symbol kind.
|
||||
/// \param yyvaluep Its semantic value.]b4_locations_if([[
|
||||
/// \param yylocationp Its location.]])[
|
||||
virtual void yy_symbol_value_print_ (symbol_kind_type yykind,
|
||||
const value_type* yyvaluep]b4_locations_if([[,
|
||||
const location_type* yylocationp]])[) const;
|
||||
/// \brief Report a symbol on the debug stream.
|
||||
/// \param yykind The symbol kind.
|
||||
/// \param yyvaluep Its semantic value.]b4_locations_if([[
|
||||
/// \param yylocationp Its location.]])[
|
||||
virtual void yy_symbol_print_ (symbol_kind_type yykind,
|
||||
const value_type* yyvaluep]b4_locations_if([[,
|
||||
const location_type* yylocationp]])[) const;
|
||||
private:
|
||||
/// Debug stream.
|
||||
std::ostream* yycdebug_;
|
||||
#endif
|
||||
|
||||
]b4_parse_param_vars[
|
||||
};
|
||||
|
||||
]b4_namespace_close[
|
||||
|
||||
]b4_percent_code_get([[provides]])[
|
||||
]m4_popdef([b4_parse_param])dnl
|
||||
])[
|
||||
|
||||
]b4_header_if(
|
||||
[b4_output_begin([b4_spec_header_file])
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
[2002-2015, 2018-2022, 2025-2026])[
|
||||
// C++ GLR parser skeleton written by Akim Demaille.
|
||||
|
||||
]b4_disclaimer[
|
||||
]b4_cpp_guard_open([b4_spec_mapped_header_file])[
|
||||
]b4_shared_declarations[
|
||||
]b4_cpp_guard_close([b4_spec_mapped_header_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_skeletonsdir/[glr.c])
|
||||
m4_popdef([b4_parse_param])
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,27 +0,0 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# Java skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2007, 2009-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
b4_glr_if( [b4_complain([%%glr-parser not supported for Java])])
|
||||
b4_nondeterministic_if([b4_complain([%%nondeterministic-parser not supported for Java])])
|
||||
|
||||
m4_define_default([b4_used_skeleton], [b4_skeletonsdir/[lalr1.java]])
|
||||
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
|
||||
|
||||
m4_include(b4_used_skeleton)
|
||||
@@ -1,503 +0,0 @@
|
||||
-*- Autoconf -*-
|
||||
|
||||
# Java language support for Bison
|
||||
|
||||
# Copyright (C) 2007-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
m4_include(b4_skeletonsdir/[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_flag_value(BOOLEAN-FLAG)
|
||||
# ---------------------------
|
||||
m4_define([b4_flag_value], [b4_flag_if([$1], [true], [false])])
|
||||
|
||||
|
||||
# b4_parser_class_declaration
|
||||
# ---------------------------
|
||||
# The declaration of the parser class ("class YYParser"), with all its
|
||||
# qualifiers/annotations.
|
||||
b4_percent_define_default([[api.parser.abstract]], [[false]])
|
||||
b4_percent_define_default([[api.parser.final]], [[false]])
|
||||
b4_percent_define_default([[api.parser.public]], [[false]])
|
||||
b4_percent_define_default([[api.parser.strictfp]], [[false]])
|
||||
|
||||
m4_define([b4_parser_class_declaration],
|
||||
[b4_percent_define_get3([api.parser.annotations], [], [ ])dnl
|
||||
b4_percent_define_flag_if([api.parser.public], [public ])dnl
|
||||
b4_percent_define_flag_if([api.parser.abstract], [abstract ])dnl
|
||||
b4_percent_define_flag_if([api.parser.final], [final ])dnl
|
||||
b4_percent_define_flag_if([api.parser.strictfp], [strictfp ])dnl
|
||||
[class ]b4_parser_class[]dnl
|
||||
b4_percent_define_get3([api.parser.extends], [ extends ])dnl
|
||||
b4_percent_define_get3([api.parser.implements], [ implements ])])
|
||||
|
||||
|
||||
# b4_lexer_if(TRUE, FALSE)
|
||||
# ------------------------
|
||||
m4_define([b4_lexer_if],
|
||||
[b4_percent_code_ifdef([[lexer]], [$1], [$2])])
|
||||
|
||||
|
||||
# b4_identification
|
||||
# -----------------
|
||||
m4_define([b4_identification],
|
||||
[[ /** Version number for the Bison executable that generated this parser. */
|
||||
public static final String bisonVersion = "]b4_version_string[";
|
||||
|
||||
/** Name of the skeleton that generated this parser. */
|
||||
public static final String bisonSkeleton = ]b4_skeleton[;
|
||||
]])
|
||||
|
||||
|
||||
## ------------ ##
|
||||
## Data types. ##
|
||||
## ------------ ##
|
||||
|
||||
# b4_int_type(MIN, MAX)
|
||||
# ---------------------
|
||||
# Return the smallest int type able to handle numbers ranging from
|
||||
# MIN to MAX (included).
|
||||
m4_define([b4_int_type],
|
||||
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
|
||||
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
||||
[int])])
|
||||
|
||||
# b4_int_type_for(NAME)
|
||||
# ---------------------
|
||||
# Return the smallest int type able to handle numbers ranging from
|
||||
# 'NAME_min' to 'NAME_max' (included).
|
||||
m4_define([b4_int_type_for],
|
||||
[b4_int_type($1_min, $1_max)])
|
||||
|
||||
# b4_null
|
||||
# -------
|
||||
m4_define([b4_null], [null])
|
||||
|
||||
|
||||
# b4_typed_parser_table_define(TYPE, NAME, DATA, COMMENT)
|
||||
# -------------------------------------------------------
|
||||
# We use intermediate functions (e.g., yypact_init) to work around the
|
||||
# 64KB limit for JVM methods. See
|
||||
# https://lists.gnu.org/r/help-bison/2008-11/msg00004.html.
|
||||
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])])
|
||||
|
||||
|
||||
## ------------- ##
|
||||
## Token kinds. ##
|
||||
## ------------- ##
|
||||
|
||||
|
||||
# b4_token_enum(TOKEN-NUM)
|
||||
# ------------------------
|
||||
# Output the definition of this token as an enum.
|
||||
m4_define([b4_token_enum],
|
||||
[b4_token_visible_if([$1],
|
||||
[m4_format([[ /** Token %s, to be returned by the scanner. */
|
||||
static final int %s = %s%s;
|
||||
]],
|
||||
b4_symbol([$1], [tag]),
|
||||
b4_symbol([$1], [id]),
|
||||
b4_symbol([$1], b4_api_token_raw_if([[number]], [[code]])))])])
|
||||
|
||||
|
||||
# b4_token_enums
|
||||
# --------------
|
||||
# Output the definition of the tokens (if there are) as enums.
|
||||
m4_define([b4_token_enums],
|
||||
[b4_any_token_visible_if([ /* Token kinds. */
|
||||
b4_symbol_foreach([b4_token_enum])])])
|
||||
|
||||
|
||||
|
||||
## -------------- ##
|
||||
## Symbol kinds. ##
|
||||
## -------------- ##
|
||||
|
||||
|
||||
# b4_symbol_kind(NUM)
|
||||
# -------------------
|
||||
m4_define([b4_symbol_kind],
|
||||
[SymbolKind.b4_symbol_kind_base($@)])
|
||||
|
||||
|
||||
# b4_symbol_enum(SYMBOL-NUM)
|
||||
# --------------------------
|
||||
# Output the definition of this symbol as an enum.
|
||||
m4_define([b4_symbol_enum],
|
||||
[m4_format([ %-30s %s],
|
||||
m4_format([[%s(%s)%s]],
|
||||
b4_symbol([$1], [kind_base]),
|
||||
[$1],
|
||||
m4_if([$1], b4_last_symbol, [[;]], [[,]])),
|
||||
[b4_symbol_tag_comment([$1])])])
|
||||
|
||||
|
||||
# b4_declare_symbol_enum
|
||||
# ----------------------
|
||||
# The definition of the symbol internal numbers as an enum.
|
||||
m4_define([b4_declare_symbol_enum],
|
||||
[[ public enum SymbolKind
|
||||
{
|
||||
]b4_symbol_foreach([b4_symbol_enum])[
|
||||
|
||||
private final int yycode_;
|
||||
|
||||
SymbolKind (int n) {
|
||||
this.yycode_ = n;
|
||||
}
|
||||
|
||||
private static final SymbolKind[] values_ = {
|
||||
]m4_map_args_sep([b4_symbol_kind(], [)], [,
|
||||
], b4_symbol_numbers)[
|
||||
};
|
||||
|
||||
static final SymbolKind get(int code) {
|
||||
return values_[code];
|
||||
}
|
||||
|
||||
public final int getCode() {
|
||||
return this.yycode_;
|
||||
}
|
||||
|
||||
]b4_parse_error_bmatch(
|
||||
[simple\|verbose],
|
||||
[[ /* Return YYSTR after stripping away unnecessary quotes and
|
||||
backslashes, so that it's suitable for yyerror. The heuristic is
|
||||
that double-quoting is unnecessary unless the string contains an
|
||||
apostrophe, a comma, or backslash (other than backslash-backslash).
|
||||
YYSTR is taken from yytname. */
|
||||
private static String yytnamerr_(String yystr)
|
||||
{
|
||||
if (yystr.charAt (0) == '"')
|
||||
{
|
||||
StringBuffer yyr = new StringBuffer();
|
||||
strip_quotes: for (int i = 1; i < yystr.length(); i++)
|
||||
switch (yystr.charAt(i))
|
||||
{
|
||||
case '\'':
|
||||
case ',':
|
||||
break strip_quotes;
|
||||
|
||||
case '\\':
|
||||
if (yystr.charAt(++i) != '\\')
|
||||
break strip_quotes;
|
||||
/* Fall through. */
|
||||
default:
|
||||
yyr.append(yystr.charAt(i));
|
||||
break;
|
||||
|
||||
case '"':
|
||||
return yyr.toString();
|
||||
}
|
||||
}
|
||||
return yystr;
|
||||
}
|
||||
|
||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
First, the terminals, then, starting at \a YYNTOKENS_, nonterminals. */
|
||||
]b4_typed_parser_table_define([String], [tname], [b4_tname])[
|
||||
|
||||
/* The user-facing name of this symbol. */
|
||||
public final String getName() {
|
||||
return yytnamerr_(yytname_[yycode_]);
|
||||
}
|
||||
]],
|
||||
[custom\|detailed],
|
||||
[[ /* YYNAMES_[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
First, the terminals, then, starting at \a YYNTOKENS_, nonterminals. */
|
||||
]b4_typed_parser_table_define([String], [names], [b4_symbol_names])[
|
||||
|
||||
/* The user-facing name of this symbol. */
|
||||
public final String getName() {
|
||||
return yynames_[yycode_];
|
||||
}]])[
|
||||
};
|
||||
]])])
|
||||
|
||||
|
||||
|
||||
# b4_case(ID, CODE, [COMMENTS])
|
||||
# -----------------------------
|
||||
# We need to fool Java's stupid unreachable code detection.
|
||||
m4_define([b4_case],
|
||||
[ case $1:m4_ifval([$3], [ b4_comment([$3])])
|
||||
if (yyn == $1)
|
||||
$2;
|
||||
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([[api.parser.class]], [code], [deprecated])
|
||||
b4_percent_define_check_kind([[throws]], [code], [deprecated])
|
||||
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
## ---------------- ##
|
||||
|
||||
m4_define([b4_yystype], [b4_percent_define_get([[api.value.type]])])
|
||||
b4_percent_define_default([[api.value.type]], [[Object]])
|
||||
b4_percent_define_default([[api.symbol.prefix]], [[S_]])
|
||||
|
||||
# b4_api_prefix, b4_api_PREFIX
|
||||
# ----------------------------
|
||||
# Corresponds to %define api.prefix
|
||||
b4_percent_define_default([[api.prefix]], [[YY]])
|
||||
m4_define([b4_api_prefix],
|
||||
[b4_percent_define_get([[api.prefix]])])
|
||||
m4_define([b4_api_PREFIX],
|
||||
[m4_toupper(b4_api_prefix)])
|
||||
|
||||
# b4_prefix
|
||||
# ---------
|
||||
# If the %name-prefix is not given, it is api.prefix.
|
||||
m4_define_default([b4_prefix], [b4_api_prefix])
|
||||
|
||||
b4_percent_define_default([[api.parser.class]], [b4_prefix[]Parser])
|
||||
m4_define([b4_parser_class], [b4_percent_define_get([[api.parser.class]])])
|
||||
|
||||
b4_percent_define_default([[lex_throws]], [[java.io.IOException]])
|
||||
m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])])
|
||||
|
||||
b4_percent_define_default([[throws]], [])
|
||||
m4_define([b4_throws], [b4_percent_define_get([[throws]])])
|
||||
|
||||
b4_percent_define_default([[init_throws]], [])
|
||||
m4_define([b4_init_throws], [b4_percent_define_get([[init_throws]])])
|
||||
|
||||
b4_percent_define_default([[api.location.type]], [Location])
|
||||
m4_define([b4_location_type], [b4_percent_define_get([[api.location.type]])])
|
||||
|
||||
b4_percent_define_default([[api.position.type]], [Position])
|
||||
m4_define([b4_position_type], [b4_percent_define_get([[api.position.type]])])
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
## Semantic Values. ##
|
||||
## ----------------- ##
|
||||
|
||||
|
||||
# b4_symbol_translate(STRING)
|
||||
# ---------------------------
|
||||
# Used by "bison" in the array of symbol names to mark those that
|
||||
# require translation.
|
||||
m4_define([b4_symbol_translate],
|
||||
[[i18n($1)]])
|
||||
|
||||
|
||||
# b4_trans(STRING)
|
||||
# ----------------
|
||||
# Translate a string if i18n is enabled. Avoid collision with b4_translate.
|
||||
m4_define([b4_trans],
|
||||
[b4_has_translations_if([i18n($1)], [$1])])
|
||||
|
||||
|
||||
|
||||
# b4_symbol_value(VAL, [SYMBOL-NUM], [TYPE-TAG])
|
||||
# ----------------------------------------------
|
||||
# See README.
|
||||
m4_define([b4_symbol_value],
|
||||
[m4_ifval([$3],
|
||||
[(($3)($1))],
|
||||
[m4_ifval([$2],
|
||||
[b4_symbol_if([$2], [has_type],
|
||||
[((b4_symbol([$2], [type]))($1))],
|
||||
[$1])],
|
||||
[$1])])])
|
||||
|
||||
|
||||
# b4_lhs_value([SYMBOL-NUM], [TYPE])
|
||||
# ----------------------------------
|
||||
# See README.
|
||||
m4_define([b4_lhs_value], [yyval])
|
||||
|
||||
|
||||
# b4_rhs_data(RULE-LENGTH, POS)
|
||||
# -----------------------------
|
||||
# See README.
|
||||
m4_define([b4_rhs_data],
|
||||
[yystack.valueAt (b4_subtract($@))])
|
||||
|
||||
# b4_rhs_value(RULE-LENGTH, POS, SYMBOL-NUM, [TYPE])
|
||||
# --------------------------------------------------
|
||||
# See README.
|
||||
#
|
||||
# In this simple implementation, %token and %type have class names
|
||||
# between the angle brackets.
|
||||
m4_define([b4_rhs_value],
|
||||
[b4_symbol_value([b4_rhs_data([$1], [$2])], [$3], [$4])])
|
||||
|
||||
|
||||
# b4_lhs_location()
|
||||
# -----------------
|
||||
# Expansion of @$.
|
||||
m4_define([b4_lhs_location],
|
||||
[(yyloc)])
|
||||
|
||||
|
||||
# b4_rhs_location(RULE-LENGTH, POS)
|
||||
# ---------------------------------
|
||||
# Expansion of @POS, where the current rule has RULE-LENGTH symbols
|
||||
# on RHS.
|
||||
m4_define([b4_rhs_location],
|
||||
[yystack.locationAt (b4_subtract($@))])
|
||||
|
||||
|
||||
# b4_lex_param
|
||||
# b4_parse_param
|
||||
# --------------
|
||||
# If defined, b4_lex_param arrives double quoted, but below we prefer
|
||||
# it to be single quoted. Same for b4_parse_param.
|
||||
|
||||
# TODO: should be in bison.m4
|
||||
m4_define_default([b4_lex_param], [[]])
|
||||
m4_define([b4_lex_param], b4_lex_param)
|
||||
m4_define([b4_parse_param], b4_parse_param)
|
||||
|
||||
# b4_lex_param_decl
|
||||
# -----------------
|
||||
# Extra formal arguments of the constructor.
|
||||
m4_define([b4_lex_param_decl],
|
||||
[m4_ifset([b4_lex_param],
|
||||
[b4_remove_comma([$1],
|
||||
b4_param_decls(b4_lex_param))],
|
||||
[$1])])
|
||||
|
||||
m4_define([b4_param_decls],
|
||||
[m4_map([b4_param_decl], [$@])])
|
||||
m4_define([b4_param_decl], [, $1])
|
||||
|
||||
m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_decl
|
||||
# -------------------
|
||||
# Extra formal arguments of the constructor.
|
||||
m4_define([b4_parse_param_decl],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[b4_remove_comma([$1],
|
||||
b4_param_decls(b4_parse_param))],
|
||||
[$1])])
|
||||
|
||||
|
||||
|
||||
# b4_lex_param_call
|
||||
# -----------------
|
||||
# Delegating the lexer parameters to the lexer constructor.
|
||||
m4_define([b4_lex_param_call],
|
||||
[m4_ifset([b4_lex_param],
|
||||
[b4_remove_comma([$1],
|
||||
b4_param_calls(b4_lex_param))],
|
||||
[$1])])
|
||||
m4_define([b4_param_calls],
|
||||
[m4_map([b4_param_call], [$@])])
|
||||
m4_define([b4_param_call], [, $2])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_cons
|
||||
# -------------------
|
||||
# Extra initialisations of the constructor.
|
||||
m4_define([b4_parse_param_cons],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[b4_constructor_calls(b4_parse_param)])])
|
||||
|
||||
m4_define([b4_constructor_calls],
|
||||
[m4_map([b4_constructor_call], [$@])])
|
||||
m4_define([b4_constructor_call],
|
||||
[this.$2 = $2;
|
||||
])
|
||||
|
||||
|
||||
|
||||
# b4_parse_param_vars
|
||||
# -------------------
|
||||
# Extra instance variables.
|
||||
m4_define([b4_parse_param_vars],
|
||||
[m4_ifset([b4_parse_param],
|
||||
[
|
||||
/* User arguments. */
|
||||
b4_var_decls(b4_parse_param)])])
|
||||
|
||||
m4_define([b4_var_decls],
|
||||
[m4_map_sep([b4_var_decl], [
|
||||
], [$@])])
|
||||
m4_define([b4_var_decl],
|
||||
[ protected final $1;])
|
||||
|
||||
|
||||
|
||||
# b4_maybe_throws(THROWS)
|
||||
# -----------------------
|
||||
# Expand to either an empty string or "throws THROWS".
|
||||
m4_define([b4_maybe_throws],
|
||||
[m4_ifval($1, [ throws $1])])
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,381 +0,0 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2015, 2018-2022, 2025-2026])
|
||||
|
||||
|
||||
# b4_location_file
|
||||
# ----------------
|
||||
# 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_header_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_mapped_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_position_file
|
||||
# ----------------
|
||||
# Name of the file containing the position class, if we want this file.
|
||||
b4_header_if(
|
||||
[b4_required_version_if(
|
||||
[30200], [],
|
||||
[m4_ifdef([b4_location_file],
|
||||
[m4_define([b4_position_file], [position.hh])])])])
|
||||
|
||||
|
||||
|
||||
# b4_location_define
|
||||
# ------------------
|
||||
# Define the position and location classes.
|
||||
m4_define([b4_location_define],
|
||||
[[ /// A point in a source file.
|
||||
class position
|
||||
{
|
||||
public:
|
||||
/// Type for file name.
|
||||
typedef ]b4_percent_define_get([[api.filename.type]])[ filename_type;
|
||||
/// Type for line and column numbers.
|
||||
typedef int counter_type;
|
||||
]m4_ifdef([b4_location_constructors], [[
|
||||
/// Construct a position.
|
||||
explicit position (filename_type* f = YY_NULLPTR,
|
||||
counter_type l = ]b4_location_initial_line[,
|
||||
counter_type c = ]b4_location_initial_column[)
|
||||
: filename (f)
|
||||
, line (l)
|
||||
, column (c)
|
||||
{}
|
||||
|
||||
]])[
|
||||
/// Initialization.
|
||||
void initialize (filename_type* fn = YY_NULLPTR,
|
||||
counter_type l = ]b4_location_initial_line[,
|
||||
counter_type c = ]b4_location_initial_column[)
|
||||
{
|
||||
filename = fn;
|
||||
line = l;
|
||||
column = c;
|
||||
}
|
||||
|
||||
/** \name Line and Column related manipulators
|
||||
** \{ */
|
||||
/// (line related) Advance to the COUNT next lines.
|
||||
void lines (counter_type count = 1)
|
||||
{
|
||||
if (count)
|
||||
{
|
||||
column = ]b4_location_initial_column[;
|
||||
line = add_ (line, count, ]b4_location_initial_line[);
|
||||
}
|
||||
}
|
||||
|
||||
/// (column related) Advance to the COUNT next columns.
|
||||
void columns (counter_type count = 1)
|
||||
{
|
||||
column = add_ (column, count, ]b4_location_initial_column[);
|
||||
}
|
||||
/** \} */
|
||||
|
||||
/// File name to which this position refers.
|
||||
filename_type* filename;
|
||||
/// Current line number.
|
||||
counter_type line;
|
||||
/// Current column number.
|
||||
counter_type column;
|
||||
|
||||
private:
|
||||
/// Compute max (min, lhs+rhs).
|
||||
static counter_type add_ (counter_type lhs, counter_type rhs, counter_type min)
|
||||
{
|
||||
return lhs + rhs < min ? min : lhs + rhs;
|
||||
}
|
||||
};
|
||||
|
||||
/// Add \a width columns, in place.
|
||||
inline position&
|
||||
operator+= (position& res, position::counter_type width)
|
||||
{
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Add \a width columns.
|
||||
inline position
|
||||
operator+ (position res, position::counter_type width)
|
||||
{
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns, in place.
|
||||
inline position&
|
||||
operator-= (position& res, position::counter_type width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns.
|
||||
inline position
|
||||
operator- (position res, position::counter_type width)
|
||||
{
|
||||
return res -= width;
|
||||
}
|
||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||
/// Compare two position objects.
|
||||
inline bool
|
||||
operator== (const position& pos1, const position& pos2)
|
||||
{
|
||||
return (pos1.line == pos2.line
|
||||
&& pos1.column == pos2.column
|
||||
&& (pos1.filename == pos2.filename
|
||||
|| (pos1.filename && pos2.filename
|
||||
&& *pos1.filename == *pos2.filename)));
|
||||
}
|
||||
|
||||
/// Compare two position objects.
|
||||
inline bool
|
||||
operator!= (const position& pos1, const position& pos2)
|
||||
{
|
||||
return !(pos1 == pos2);
|
||||
}
|
||||
]])[
|
||||
/** \brief Intercept output stream redirection.
|
||||
** \param ostr the destination output stream
|
||||
** \param pos a reference to the position to redirect
|
||||
*/
|
||||
template <typename YYChar>
|
||||
std::basic_ostream<YYChar>&
|
||||
operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
|
||||
{
|
||||
if (pos.filename)
|
||||
ostr << *pos.filename << ':';
|
||||
return ostr << pos.line << '.' << pos.column;
|
||||
}
|
||||
|
||||
/// Two points in a source file.
|
||||
class location
|
||||
{
|
||||
public:
|
||||
/// Type for file name.
|
||||
typedef position::filename_type filename_type;
|
||||
/// Type for line and column numbers.
|
||||
typedef position::counter_type counter_type;
|
||||
]m4_ifdef([b4_location_constructors], [
|
||||
/// Construct a location from \a b to \a e.
|
||||
location (const position& b, const position& e)
|
||||
: begin (b)
|
||||
, 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 (filename_type* f,
|
||||
counter_type l = ]b4_location_initial_line[,
|
||||
counter_type c = ]b4_location_initial_column[)
|
||||
: begin (f, l, c)
|
||||
, end (f, l, c)
|
||||
{}
|
||||
|
||||
])[
|
||||
/// Initialization.
|
||||
void initialize (filename_type* f = YY_NULLPTR,
|
||||
counter_type l = ]b4_location_initial_line[,
|
||||
counter_type c = ]b4_location_initial_column[)
|
||||
{
|
||||
begin.initialize (f, l, c);
|
||||
end = begin;
|
||||
}
|
||||
|
||||
/** \name Line and Column related manipulators
|
||||
** \{ */
|
||||
public:
|
||||
/// Reset initial location to final location.
|
||||
void step ()
|
||||
{
|
||||
begin = end;
|
||||
}
|
||||
|
||||
/// Extend the current location to the COUNT next columns.
|
||||
void columns (counter_type count = 1)
|
||||
{
|
||||
end += count;
|
||||
}
|
||||
|
||||
/// Extend the current location to the COUNT next lines.
|
||||
void lines (counter_type count = 1)
|
||||
{
|
||||
end.lines (count);
|
||||
}
|
||||
/** \} */
|
||||
|
||||
|
||||
public:
|
||||
/// Beginning of the located region.
|
||||
position begin;
|
||||
/// End of the located region.
|
||||
position end;
|
||||
};
|
||||
|
||||
/// Join two locations, in place.
|
||||
inline location&
|
||||
operator+= (location& res, const location& end)
|
||||
{
|
||||
res.end = end.end;
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Join two locations.
|
||||
inline location
|
||||
operator+ (location res, const location& end)
|
||||
{
|
||||
return res += end;
|
||||
}
|
||||
|
||||
/// Add \a width columns to the end position, in place.
|
||||
inline location&
|
||||
operator+= (location& res, location::counter_type width)
|
||||
{
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Add \a width columns to the end position.
|
||||
inline location
|
||||
operator+ (location res, location::counter_type width)
|
||||
{
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns to the end position, in place.
|
||||
inline location&
|
||||
operator-= (location& res, location::counter_type width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns to the end position.
|
||||
inline location
|
||||
operator- (location res, location::counter_type width)
|
||||
{
|
||||
return res -= width;
|
||||
}
|
||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||
/// Compare two location objects.
|
||||
inline bool
|
||||
operator== (const location& loc1, const location& loc2)
|
||||
{
|
||||
return loc1.begin == loc2.begin && loc1.end == loc2.end;
|
||||
}
|
||||
|
||||
/// Compare two location objects.
|
||||
inline bool
|
||||
operator!= (const location& loc1, const location& loc2)
|
||||
{
|
||||
return !(loc1 == loc2);
|
||||
}
|
||||
]])[
|
||||
/** \brief Intercept output stream redirection.
|
||||
** \param ostr the destination output stream
|
||||
** \param loc a reference to the location to redirect
|
||||
**
|
||||
** Avoid duplicate information.
|
||||
*/
|
||||
template <typename YYChar>
|
||||
std::basic_ostream<YYChar>&
|
||||
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
|
||||
{
|
||||
location::counter_type end_col
|
||||
= 0 < loc.end.column ? loc.end.column - 1 : 0;
|
||||
ostr << loc.begin;
|
||||
if (loc.end.filename
|
||||
&& (!loc.begin.filename
|
||||
|| *loc.begin.filename != *loc.end.filename))
|
||||
ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col;
|
||||
else if (loc.begin.line < loc.end.line)
|
||||
ostr << '-' << loc.end.line << '.' << end_col;
|
||||
else if (loc.begin.column < end_col)
|
||||
ostr << '-' << end_col;
|
||||
return ostr;
|
||||
}
|
||||
]])
|
||||
|
||||
|
||||
m4_ifdef([b4_position_file], [[
|
||||
]b4_output_begin([b4_dir_prefix], [b4_position_file])[
|
||||
]b4_generated_by[
|
||||
// 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 <iostream>
|
||||
# include <string>
|
||||
|
||||
]b4_null_define[
|
||||
|
||||
]b4_namespace_open[
|
||||
]b4_location_define[
|
||||
]b4_namespace_close[
|
||||
]b4_cpp_guard_close([b4_location_path])[
|
||||
]b4_output_end[
|
||||
]])
|
||||
|
||||
|
||||
m4_popdef([b4_copyright_years])
|
||||
@@ -1,158 +0,0 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# b4_stack_file
|
||||
# -------------
|
||||
# Name of the file containing the stack class, if we want this file.
|
||||
b4_header_if([b4_required_version_if([30200], [],
|
||||
[m4_define([b4_stack_file], [stack.hh])])])
|
||||
|
||||
|
||||
# b4_stack_define
|
||||
# ---------------
|
||||
m4_define([b4_stack_define],
|
||||
[[ /// A stack with random access from its top.
|
||||
template <typename T, typename S = std::vector<T> >
|
||||
class stack
|
||||
{
|
||||
public:
|
||||
// Hide our reversed order.
|
||||
typedef typename S::iterator iterator;
|
||||
typedef typename S::const_iterator const_iterator;
|
||||
typedef typename S::size_type size_type;
|
||||
typedef typename std::ptrdiff_t index_type;
|
||||
|
||||
stack (size_type n = 200) YY_NOEXCEPT
|
||||
: seq_ (n)
|
||||
{}
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
/// Non copyable.
|
||||
stack (const stack&) = delete;
|
||||
/// Non copyable.
|
||||
stack& operator= (const stack&) = delete;
|
||||
#endif
|
||||
|
||||
/// Random access.
|
||||
///
|
||||
/// Index 0 returns the topmost element.
|
||||
const T&
|
||||
operator[] (index_type i) const
|
||||
{
|
||||
return seq_[size_type (size () - 1 - i)];
|
||||
}
|
||||
|
||||
/// Random access.
|
||||
///
|
||||
/// Index 0 returns the topmost element.
|
||||
T&
|
||||
operator[] (index_type i)
|
||||
{
|
||||
return seq_[size_type (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);
|
||||
}
|
||||
|
||||
/// Pop elements from the stack.
|
||||
void
|
||||
pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
|
||||
{
|
||||
for (; 0 < n; --n)
|
||||
seq_.pop_back ();
|
||||
}
|
||||
|
||||
/// Pop all elements from the stack.
|
||||
void
|
||||
clear () YY_NOEXCEPT
|
||||
{
|
||||
seq_.clear ();
|
||||
}
|
||||
|
||||
/// Number of elements on the stack.
|
||||
index_type
|
||||
size () const YY_NOEXCEPT
|
||||
{
|
||||
return index_type (seq_.size ());
|
||||
}
|
||||
|
||||
/// Iterator on top of the stack (going downwards).
|
||||
const_iterator
|
||||
begin () const YY_NOEXCEPT
|
||||
{
|
||||
return seq_.begin ();
|
||||
}
|
||||
|
||||
/// Bottom of the stack.
|
||||
const_iterator
|
||||
end () const YY_NOEXCEPT
|
||||
{
|
||||
return seq_.end ();
|
||||
}
|
||||
|
||||
/// Present a slice of the top of a stack.
|
||||
class slice
|
||||
{
|
||||
public:
|
||||
slice (const stack& stack, index_type range) YY_NOEXCEPT
|
||||
: stack_ (stack)
|
||||
, range_ (range)
|
||||
{}
|
||||
|
||||
const T&
|
||||
operator[] (index_type i) const
|
||||
{
|
||||
return stack_[range_ - i];
|
||||
}
|
||||
|
||||
private:
|
||||
const stack& stack_;
|
||||
index_type range_;
|
||||
};
|
||||
|
||||
private:
|
||||
#if YY_CPLUSPLUS < 201103L
|
||||
/// Non copyable.
|
||||
stack (const stack&);
|
||||
/// Non copyable.
|
||||
stack& operator= (const stack&);
|
||||
#endif
|
||||
/// The wrapped container.
|
||||
S seq_;
|
||||
};
|
||||
]])
|
||||
|
||||
m4_ifdef([b4_stack_file],
|
||||
[b4_output_begin([b4_dir_prefix], [b4_stack_file])[
|
||||
]b4_generated_by[
|
||||
// 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[
|
||||
]])
|
||||
@@ -1,2 +0,0 @@
|
||||
dnl GNU M4 treats -dV in a position-independent manner.
|
||||
m4_debugmode(V)m4_traceon()dnl
|
||||
@@ -1,526 +0,0 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2022, 2025-2026 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
## --------- ##
|
||||
## variant. ##
|
||||
## --------- ##
|
||||
|
||||
# b4_assert
|
||||
# ---------
|
||||
# The name of YY_ASSERT.
|
||||
m4_define([b4_assert],
|
||||
[b4_api_PREFIX[]_ASSERT])
|
||||
|
||||
|
||||
# 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 ]b4_assert[
|
||||
# include <cassert>
|
||||
# define ]b4_assert[ assert
|
||||
#endif
|
||||
]])])
|
||||
|
||||
|
||||
|
||||
## -------------------------- ##
|
||||
## Adjustments for variants. ##
|
||||
## -------------------------- ##
|
||||
|
||||
|
||||
# b4_value_type_declare
|
||||
# ---------------------
|
||||
# Define value_type.
|
||||
m4_define([b4_value_type_declare],
|
||||
[[ /// A 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 parser state.
|
||||
class value_type
|
||||
{
|
||||
public:
|
||||
/// Type of *this.
|
||||
typedef value_type self_type;
|
||||
|
||||
/// Empty construction.
|
||||
value_type () YY_NOEXCEPT
|
||||
: yyraw_ ()]b4_parse_assert_if([
|
||||
, yytypeid_ (YY_NULLPTR)])[
|
||||
{}
|
||||
|
||||
/// Construct and fill.
|
||||
template <typename T>
|
||||
value_type (YY_RVREF (T) t)]b4_parse_assert_if([
|
||||
: yytypeid_ (&typeid (T))])[
|
||||
{]b4_parse_assert_if([[
|
||||
]b4_assert[ (sizeof (T) <= size);]])[
|
||||
new (yyas_<T> ()) T (YY_MOVE (t));
|
||||
}
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
/// Non copyable.
|
||||
value_type (const self_type&) = delete;
|
||||
/// Non copyable.
|
||||
self_type& operator= (const self_type&) = delete;
|
||||
#endif
|
||||
|
||||
/// Destruction, allowed only if empty.
|
||||
~value_type () YY_NOEXCEPT
|
||||
{]b4_parse_assert_if([
|
||||
]b4_assert[ (!yytypeid_);
|
||||
])[}
|
||||
|
||||
# if 201103L <= YY_CPLUSPLUS
|
||||
/// Instantiate a \a T in here from \a t.
|
||||
template <typename T, typename... U>
|
||||
T&
|
||||
emplace (U&&... u)
|
||||
{]b4_parse_assert_if([[
|
||||
]b4_assert[ (!yytypeid_);
|
||||
]b4_assert[ (sizeof (T) <= size);
|
||||
yytypeid_ = & typeid (T);]])[
|
||||
return *new (yyas_<T> ()) T (std::forward <U>(u)...);
|
||||
}
|
||||
# else
|
||||
/// Instantiate an empty \a T in here.
|
||||
template <typename T>
|
||||
T&
|
||||
emplace ()
|
||||
{]b4_parse_assert_if([[
|
||||
]b4_assert[ (!yytypeid_);
|
||||
]b4_assert[ (sizeof (T) <= size);
|
||||
yytypeid_ = & typeid (T);]])[
|
||||
return *new (yyas_<T> ()) T ();
|
||||
}
|
||||
|
||||
/// Instantiate a \a T in here from \a t.
|
||||
template <typename T>
|
||||
T&
|
||||
emplace (const T& t)
|
||||
{]b4_parse_assert_if([[
|
||||
]b4_assert[ (!yytypeid_);
|
||||
]b4_assert[ (sizeof (T) <= size);
|
||||
yytypeid_ = & typeid (T);]])[
|
||||
return *new (yyas_<T> ()) T (t);
|
||||
}
|
||||
# endif
|
||||
|
||||
/// Instantiate an empty \a T in here.
|
||||
/// Obsolete, use emplace.
|
||||
template <typename T>
|
||||
T&
|
||||
build ()
|
||||
{
|
||||
return emplace<T> ();
|
||||
}
|
||||
|
||||
/// Instantiate a \a T in here from \a t.
|
||||
/// Obsolete, use emplace.
|
||||
template <typename T>
|
||||
T&
|
||||
build (const T& t)
|
||||
{
|
||||
return emplace<T> (t);
|
||||
}
|
||||
|
||||
/// Accessor to a built \a T.
|
||||
template <typename T>
|
||||
T&
|
||||
as () YY_NOEXCEPT
|
||||
{]b4_parse_assert_if([[
|
||||
]b4_assert[ (yytypeid_);
|
||||
]b4_assert[ (*yytypeid_ == typeid (T));
|
||||
]b4_assert[ (sizeof (T) <= size);]])[
|
||||
return *yyas_<T> ();
|
||||
}
|
||||
|
||||
/// Const accessor to a built \a T (for %printer).
|
||||
template <typename T>
|
||||
const T&
|
||||
as () const YY_NOEXCEPT
|
||||
{]b4_parse_assert_if([[
|
||||
]b4_assert[ (yytypeid_);
|
||||
]b4_assert[ (*yytypeid_ == typeid (T));
|
||||
]b4_assert[ (sizeof (T) <= size);]])[
|
||||
return *yyas_<T> ();
|
||||
}
|
||||
|
||||
/// Swap the content with \a that, 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
|
||||
/// self_type::move ().
|
||||
template <typename T>
|
||||
void
|
||||
swap (self_type& that) YY_NOEXCEPT
|
||||
{]b4_parse_assert_if([[
|
||||
]b4_assert[ (yytypeid_);
|
||||
]b4_assert[ (*yytypeid_ == *that.yytypeid_);]])[
|
||||
std::swap (as<T> (), that.as<T> ());
|
||||
}
|
||||
|
||||
/// Move the content of \a that to this.
|
||||
///
|
||||
/// Destroys \a that.
|
||||
template <typename T>
|
||||
void
|
||||
move (self_type& that)
|
||||
{
|
||||
# if 201103L <= YY_CPLUSPLUS
|
||||
emplace<T> (std::move (that.as<T> ()));
|
||||
# else
|
||||
emplace<T> ();
|
||||
swap<T> (that);
|
||||
# endif
|
||||
that.destroy<T> ();
|
||||
}
|
||||
|
||||
# if 201103L <= YY_CPLUSPLUS
|
||||
/// Move the content of \a that to this.
|
||||
template <typename T>
|
||||
void
|
||||
move (self_type&& that)
|
||||
{
|
||||
emplace<T> (std::move (that.as<T> ()));
|
||||
that.destroy<T> ();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Copy the content of \a that to this.
|
||||
template <typename T>
|
||||
void
|
||||
copy (const self_type& that)
|
||||
{
|
||||
emplace<T> (that.as<T> ());
|
||||
}
|
||||
|
||||
/// Destroy the stored \a T.
|
||||
template <typename T>
|
||||
void
|
||||
destroy ()
|
||||
{
|
||||
as<T> ().~T ();]b4_parse_assert_if([
|
||||
yytypeid_ = YY_NULLPTR;])[
|
||||
}
|
||||
|
||||
private:
|
||||
#if YY_CPLUSPLUS < 201103L
|
||||
/// Non copyable.
|
||||
value_type (const self_type&);
|
||||
/// Non copyable.
|
||||
self_type& operator= (const self_type&);
|
||||
#endif
|
||||
|
||||
/// Accessor to raw memory as \a T.
|
||||
template <typename T>
|
||||
T*
|
||||
yyas_ () YY_NOEXCEPT
|
||||
{
|
||||
void *yyp = yyraw_;
|
||||
return static_cast<T*> (yyp);
|
||||
}
|
||||
|
||||
/// Const accessor to raw memory as \a T.
|
||||
template <typename T>
|
||||
const T*
|
||||
yyas_ () const YY_NOEXCEPT
|
||||
{
|
||||
const void *yyp = yyraw_;
|
||||
return static_cast<const T*> (yyp);
|
||||
}
|
||||
|
||||
/// An auxiliary type to compute the largest semantic type.
|
||||
union union_type
|
||||
{]b4_type_foreach([b4_char_sizeof])[ };
|
||||
|
||||
/// The size of the largest semantic type.
|
||||
enum { size = sizeof (union_type) };
|
||||
|
||||
/// A buffer to store semantic values.
|
||||
union
|
||||
{
|
||||
/// Strongest alignment constraints.
|
||||
long double yyalign_me_;
|
||||
/// A buffer large enough to store any of the semantic values.
|
||||
char yyraw_[size];
|
||||
};]b4_parse_assert_if([
|
||||
|
||||
/// Whether the content is built: if defined, the name of the stored type.
|
||||
const std::type_info *yytypeid_;])[
|
||||
};
|
||||
]])
|
||||
|
||||
|
||||
# How the semantic value is extracted when using variants.
|
||||
|
||||
# b4_symbol_value(VAL, SYMBOL-NUM, [TYPE])
|
||||
# ----------------------------------------
|
||||
# See README.
|
||||
m4_define([b4_symbol_value],
|
||||
[m4_ifval([$3],
|
||||
[$1.as< $3 > ()],
|
||||
[m4_ifval([$2],
|
||||
[b4_symbol_if([$2], [has_type],
|
||||
[$1.as < b4_symbol([$2], [type]) > ()],
|
||||
[$1])],
|
||||
[$1])])])
|
||||
|
||||
# b4_symbol_value_template(VAL, SYMBOL-NUM, [TYPE])
|
||||
# -------------------------------------------------
|
||||
# Same as b4_symbol_value, but used in a template method.
|
||||
m4_define([b4_symbol_value_template],
|
||||
[m4_ifval([$3],
|
||||
[$1.template as< $3 > ()],
|
||||
[m4_ifval([$2],
|
||||
[b4_symbol_if([$2], [has_type],
|
||||
[$1.template as < b4_symbol([$2], [type]) > ()],
|
||||
[$1])],
|
||||
[$1])])])
|
||||
|
||||
|
||||
|
||||
## ------------- ##
|
||||
## make_SYMBOL. ##
|
||||
## ------------- ##
|
||||
|
||||
|
||||
# _b4_includes_tokens(SYMBOL-NUM...)
|
||||
# ----------------------------------
|
||||
# Expands to non-empty iff one of the SYMBOL-NUM denotes
|
||||
# a token.
|
||||
m4_define([_b4_is_token],
|
||||
[b4_symbol_if([$1], [is_token], [1])])
|
||||
m4_define([_b4_includes_tokens],
|
||||
[m4_map([_b4_is_token], [$@])])
|
||||
|
||||
|
||||
# _b4_token_maker_define(SYMBOL-NUM)
|
||||
# ----------------------------------
|
||||
# Declare make_SYMBOL for SYMBOL-NUM. Use at class-level.
|
||||
m4_define([_b4_token_maker_define],
|
||||
[b4_token_visible_if([$1],
|
||||
[#if 201103L <= YY_CPLUSPLUS
|
||||
static
|
||||
symbol_type
|
||||
make_[]_b4_symbol([$1], [id]) (b4_join(
|
||||
b4_symbol_if([$1], [has_type],
|
||||
[b4_symbol([$1], [type]) v]),
|
||||
b4_locations_if([location_type l])))
|
||||
{
|
||||
return symbol_type (b4_join([token::b4_symbol([$1], [id])],
|
||||
b4_symbol_if([$1], [has_type], [std::move (v)]),
|
||||
b4_locations_if([std::move (l)])));
|
||||
}
|
||||
#else
|
||||
static
|
||||
symbol_type
|
||||
make_[]_b4_symbol([$1], [id]) (b4_join(
|
||||
b4_symbol_if([$1], [has_type],
|
||||
[const b4_symbol([$1], [type])& v]),
|
||||
b4_locations_if([const location_type& l])))
|
||||
{
|
||||
return symbol_type (b4_join([token::b4_symbol([$1], [id])],
|
||||
b4_symbol_if([$1], [has_type], [v]),
|
||||
b4_locations_if([l])));
|
||||
}
|
||||
#endif
|
||||
])])
|
||||
|
||||
|
||||
# b4_token_kind(SYMBOL-NUM)
|
||||
# -------------------------
|
||||
# Some tokens don't have an ID.
|
||||
m4_define([b4_token_kind],
|
||||
[b4_symbol_if([$1], [has_id],
|
||||
[token::b4_symbol([$1], [id])],
|
||||
[b4_symbol([$1], [code])])])
|
||||
|
||||
|
||||
# _b4_tok_in(SYMBOL-NUM, ...)
|
||||
# ---------------------------
|
||||
# See b4_tok_in below. The SYMBOL-NUMs... are tokens only.
|
||||
#
|
||||
# We iterate over the tokens to group them by "range" of token numbers (not
|
||||
# symbols numbers!).
|
||||
#
|
||||
# b4_fst is the start of that range.
|
||||
# b4_prev is the previous value.
|
||||
# b4_val is the current value.
|
||||
# If b4_val is the successor of b4_prev in token numbers, update the latter,
|
||||
# otherwise emit the code for range b4_fst .. b4_prev.
|
||||
# $1 is also used as a terminator in the foreach, but it will not be printed.
|
||||
#
|
||||
m4_define([_b4_tok_in],
|
||||
[m4_pushdef([b4_prev], [$1])dnl
|
||||
m4_pushdef([b4_fst], [$1])dnl
|
||||
m4_pushdef([b4_sep], [])dnl
|
||||
m4_foreach([b4_val], m4_dquote(m4_shift($@, $1)),
|
||||
[m4_if(b4_symbol(b4_val, [code]), m4_eval(b4_symbol(b4_prev, [code]) + 1), [],
|
||||
[b4_sep[]m4_if(b4_fst, b4_prev,
|
||||
[tok == b4_token_kind(b4_fst)],
|
||||
[(b4_token_kind(b4_fst) <= tok && tok <= b4_token_kind(b4_prev))])[]dnl
|
||||
m4_define([b4_fst], b4_val)dnl
|
||||
m4_define([b4_sep], [
|
||||
|| ])])dnl
|
||||
m4_define([b4_prev], b4_val)])dnl
|
||||
m4_popdef([b4_sep])dnl
|
||||
m4_popdef([b4_fst])dnl
|
||||
m4_popdef([b4_prev])dnl
|
||||
])
|
||||
|
||||
|
||||
# _b4_filter_tokens(SYMBOL-NUM, ...)
|
||||
# ----------------------------------
|
||||
# Expand as the list of tokens amongst SYMBOL-NUM.
|
||||
m4_define([_b4_filter_tokens],
|
||||
[m4_pushdef([b4_sep])dnl
|
||||
m4_foreach([b4_val], [$@],
|
||||
[b4_symbol_if(b4_val, [is_token], [b4_sep[]b4_val[]m4_define([b4_sep], [,])])])dnl
|
||||
m4_popdef([b4_sep])dnl
|
||||
])
|
||||
|
||||
|
||||
# b4_tok_in(SYMBOL-NUM, ...)
|
||||
# ---------------------------
|
||||
# A C++ conditional that checks that `tok` is a member of this list of symbol
|
||||
# numbers.
|
||||
m4_define([b4_tok_in],
|
||||
[_$0(_b4_filter_tokens($@))])
|
||||
|
||||
|
||||
|
||||
|
||||
# _b4_symbol_constructor_define(SYMBOL-NUM...)
|
||||
# --------------------------------------------
|
||||
# Define a symbol_type constructor common to all the SYMBOL-NUM (they
|
||||
# have the same type). Use at class-level.
|
||||
m4_define([_b4_symbol_constructor_define],
|
||||
[m4_ifval(_b4_includes_tokens($@),
|
||||
[[#if 201103L <= YY_CPLUSPLUS
|
||||
symbol_type (]b4_join(
|
||||
[int tok],
|
||||
b4_symbol_if([$1], [has_type],
|
||||
[b4_symbol([$1], [type]) v]),
|
||||
b4_locations_if([location_type l]))[)
|
||||
: super_type (]b4_join([token_kind_type (tok)],
|
||||
b4_symbol_if([$1], [has_type], [std::move (v)]),
|
||||
b4_locations_if([std::move (l)]))[)
|
||||
#else
|
||||
symbol_type (]b4_join(
|
||||
[int tok],
|
||||
b4_symbol_if([$1], [has_type],
|
||||
[const b4_symbol([$1], [type])& v]),
|
||||
b4_locations_if([const location_type& l]))[)
|
||||
: super_type (]b4_join([token_kind_type (tok)],
|
||||
b4_symbol_if([$1], [has_type], [v]),
|
||||
b4_locations_if([l]))[)
|
||||
#endif
|
||||
{]b4_parse_assert_if([[
|
||||
#if !defined _MSC_VER || defined __clang__
|
||||
]b4_assert[ (]b4_tok_in($@)[);
|
||||
#endif
|
||||
]])[}
|
||||
]])])
|
||||
|
||||
|
||||
# b4_basic_symbol_constructor_define(SYMBOL-NUM)
|
||||
# ----------------------------------------------
|
||||
# Generate a constructor for basic_symbol from given type.
|
||||
m4_define([b4_basic_symbol_constructor_define],
|
||||
[[#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (]b4_join(
|
||||
[typename Base::kind_type t],
|
||||
b4_symbol_if([$1], [has_type], [b4_symbol([$1], [type])&& v]),
|
||||
b4_locations_if([location_type&& l]))[)
|
||||
: Base (t)]b4_symbol_if([$1], [has_type], [
|
||||
, value (std::move (v))])[]b4_locations_if([
|
||||
, location (std::move (l))])[
|
||||
{}
|
||||
#else
|
||||
basic_symbol (]b4_join(
|
||||
[typename Base::kind_type t],
|
||||
b4_symbol_if([$1], [has_type], [const b4_symbol([$1], [type])& v]),
|
||||
b4_locations_if([const location_type& l]))[)
|
||||
: Base (t)]b4_symbol_if([$1], [has_type], [
|
||||
, value (v)])[]b4_locations_if([
|
||||
, location (l)])[
|
||||
{}
|
||||
#endif
|
||||
]])
|
||||
|
||||
|
||||
# b4_token_constructor_define
|
||||
# ---------------------------
|
||||
# Define the overloaded versions of make_FOO for all the token kinds.
|
||||
m4_define([b4_token_constructor_define],
|
||||
[ // Implementation of make_symbol for each token kind.
|
||||
b4_symbol_foreach([_b4_token_maker_define])])
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,106 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
bison.xsl - common templates for Bison XSLT.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2022, 2025-2026 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 <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:bison="https://www.gnu.org/software/bison/">
|
||||
|
||||
<xsl:key
|
||||
name="bison:symbolByName"
|
||||
match="/bison-xml-report/grammar/nonterminals/nonterminal"
|
||||
use="@name"
|
||||
/>
|
||||
<xsl:key
|
||||
name="bison:symbolByName"
|
||||
match="/bison-xml-report/grammar/terminals/terminal"
|
||||
use="@name"
|
||||
/>
|
||||
<xsl:key
|
||||
name="bison:ruleByNumber"
|
||||
match="/bison-xml-report/grammar/rules/rule"
|
||||
use="@number"
|
||||
/>
|
||||
<xsl:key
|
||||
name="bison:ruleByLhs"
|
||||
match="/bison-xml-report/grammar/rules/rule[
|
||||
@usefulness != 'useless-in-grammar']"
|
||||
use="lhs"
|
||||
/>
|
||||
<xsl:key
|
||||
name="bison:ruleByRhs"
|
||||
match="/bison-xml-report/grammar/rules/rule[
|
||||
@usefulness != 'useless-in-grammar']"
|
||||
use="rhs/symbol"
|
||||
/>
|
||||
|
||||
<!-- For the specified state, output: #sr-conflicts,#rr-conflicts -->
|
||||
<xsl:template match="state" mode="bison:count-conflicts">
|
||||
<xsl:variable name="transitions" select="actions/transitions"/>
|
||||
<xsl:variable name="reductions" select="actions/reductions"/>
|
||||
<xsl:variable
|
||||
name="terminals"
|
||||
select="
|
||||
$transitions/transition[@type='shift']/@symbol
|
||||
| $reductions/reduction/@symbol
|
||||
"
|
||||
/>
|
||||
<xsl:variable name="conflict-data">
|
||||
<xsl:for-each select="$terminals">
|
||||
<xsl:variable name="name" select="."/>
|
||||
<xsl:if test="generate-id($terminals[. = $name][1]) = generate-id(.)">
|
||||
<xsl:variable
|
||||
name="shift-count"
|
||||
select="count($transitions/transition[@symbol=$name])"
|
||||
/>
|
||||
<xsl:variable
|
||||
name="reduce-count"
|
||||
select="count($reductions/reduction[@symbol=$name])"
|
||||
/>
|
||||
<xsl:if test="$shift-count > 0 and $reduce-count > 0">
|
||||
<xsl:text>s</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="$reduce-count > 1">
|
||||
<xsl:text>r</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="string-length(translate($conflict-data, 'r', ''))"/>
|
||||
<xsl:text>,</xsl:text>
|
||||
<xsl:value-of select="string-length(translate($conflict-data, 's', ''))"/>
|
||||
</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>
|
||||
@@ -1,402 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2022, 2025-2026 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
Written by Wojciech Polak <polak@gnu.org>.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:bison="https://www.gnu.org/software/bison/">
|
||||
|
||||
<xsl:import href="bison.xsl"/>
|
||||
<xsl:output method="text" encoding="UTF-8" indent="no"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="bison-xml-report"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bison-xml-report">
|
||||
<xsl:text>// Generated by GNU Bison </xsl:text>
|
||||
<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 match="automaton">
|
||||
<xsl:param name="filename"/>
|
||||
<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:text>} </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton/state">
|
||||
<xsl:call-template name="output-node">
|
||||
<xsl:with-param name="number" select="@number"/>
|
||||
<xsl:with-param name="label">
|
||||
<xsl:apply-templates select="itemset/item"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<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
|
||||
referred 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 referred 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 match="actions/transitions">
|
||||
<xsl:apply-templates select="transition"/>
|
||||
</xsl:template>
|
||||
|
||||
<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:with-param name="dot" select="@dot"/>
|
||||
<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 select="lookaheads"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rule">
|
||||
<xsl:param name="dot"/>
|
||||
<xsl:param name="num"/>
|
||||
<xsl:param name="prev-lhs"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$num < 10">
|
||||
<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="$dot = 0">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<!-- RHS -->
|
||||
<xsl:for-each select="rhs/symbol|rhs/empty">
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:if test="$dot = position()">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="symbol">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="empty">
|
||||
<xsl:text> %empty</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads">
|
||||
<xsl:text> [</xsl:text>
|
||||
<xsl:apply-templates select="symbol"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads/symbol">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:if test="position() != last()">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
</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:call-template name="output-edge">
|
||||
<xsl:with-param name="src" select="../../../@number"/>
|
||||
<xsl:with-param name="dst" select="@state"/>
|
||||
<xsl:with-param name="style">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@symbol = 'error'">
|
||||
<xsl:text>dotted</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'shift'">
|
||||
<xsl:text>solid</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>dashed</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="label">
|
||||
<xsl:if test="not(@symbol = 'error')">
|
||||
<xsl:value-of select="@symbol"/>
|
||||
</xsl:if>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="output-node">
|
||||
<xsl:param name="number"/>
|
||||
<xsl:param name="label"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="$number"/>
|
||||
<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:with-param name="subject" select="$label"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text>\l"] </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="output-edge">
|
||||
<xsl:param name="src"/>
|
||||
<xsl:param name="dst"/>
|
||||
<xsl:param name="style"/>
|
||||
<xsl:param name="label"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="$src"/>
|
||||
<xsl:text> -> </xsl:text>
|
||||
<xsl:value-of select="$dst"/>
|
||||
<xsl:text> [style=</xsl:text>
|
||||
<xsl:value-of select="$style"/>
|
||||
<xsl:if test="$label and $label != ''">
|
||||
<xsl:text> label="</xsl:text>
|
||||
<xsl:call-template name="escape">
|
||||
<xsl:with-param name="subject" select="$label"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text>"</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text>] </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="escape">
|
||||
<xsl:param name="subject"/> <!-- required -->
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="subject">
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="subject">
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="subject" select="$subject"/>
|
||||
<xsl:with-param name="search" select="'\'"/>
|
||||
<xsl:with-param name="replace" select="'\\'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="search" select="'"'"/>
|
||||
<xsl:with-param name="replace" select="'\"'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="search" select="' '"/>
|
||||
<xsl:with-param name="replace" select="'\l'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="string-replace">
|
||||
<xsl:param name="subject"/>
|
||||
<xsl:param name="search"/>
|
||||
<xsl:param name="replace"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($subject, $search)">
|
||||
<xsl:variable name="before" select="substring-before($subject, $search)"/>
|
||||
<xsl:variable name="after" select="substring-after($subject, $search)"/>
|
||||
<xsl:value-of select="$before"/>
|
||||
<xsl:value-of select="$replace"/>
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="subject" select="$after"/>
|
||||
<xsl:with-param name="search" select="$search"/>
|
||||
<xsl:with-param name="replace" select="$replace"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$subject"/>
|
||||
</xsl:otherwise>
|
||||
</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:stylesheet>
|
||||
@@ -1,573 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
xml2text.xsl - transform Bison XML Report into plain text.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2022, 2025-2026 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
Written by Wojciech Polak <polak@gnu.org>.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:bison="https://www.gnu.org/software/bison/">
|
||||
|
||||
<xsl:import href="bison.xsl"/>
|
||||
<xsl:output method="text" encoding="UTF-8" indent="no"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="bison-xml-report"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bison-xml-report">
|
||||
<xsl:apply-templates select="grammar" mode="reductions"/>
|
||||
<xsl:apply-templates select="grammar" mode="useless-in-parser"/>
|
||||
<xsl:apply-templates select="automaton" mode="conflicts"/>
|
||||
<xsl:apply-templates select="grammar"/>
|
||||
<xsl:apply-templates select="automaton"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar" mode="reductions">
|
||||
<xsl:apply-templates select="nonterminals" mode="useless-in-grammar"/>
|
||||
<xsl:apply-templates select="terminals" mode="unused-in-grammar"/>
|
||||
<xsl:apply-templates select="rules" mode="useless-in-grammar"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="nonterminals" mode="useless-in-grammar">
|
||||
<xsl:if test="nonterminal[@usefulness='useless-in-grammar']">
|
||||
<xsl:text>Nonterminals useless in grammar </xsl:text>
|
||||
<xsl:for-each select="nonterminal[@usefulness='useless-in-grammar']">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="terminals" mode="unused-in-grammar">
|
||||
<xsl:if test="terminal[@usefulness='unused-in-grammar']">
|
||||
<xsl:text>Terminals unused in grammar </xsl:text>
|
||||
<xsl:for-each select="terminal[@usefulness='unused-in-grammar']">
|
||||
<xsl:sort select="@symbol-number" data-type="number"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rules" mode="useless-in-grammar">
|
||||
<xsl:variable name="set" select="rule[@usefulness='useless-in-grammar']"/>
|
||||
<xsl:if test="$set">
|
||||
<xsl:text>Rules useless in grammar </xsl:text>
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param name="rule-set" select="$set"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar" mode="useless-in-parser">
|
||||
<xsl:variable
|
||||
name="set" select="rules/rule[@usefulness='useless-in-parser']"
|
||||
/>
|
||||
<xsl:if test="$set">
|
||||
<xsl:text>Rules useless in parser due to conflicts </xsl:text>
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param name="rule-set" select="$set"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar">
|
||||
<xsl:text>Grammar </xsl:text>
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param
|
||||
name="rule-set" select="rules/rule[@usefulness!='useless-in-grammar']"
|
||||
/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="terminals"/>
|
||||
<xsl:apply-templates select="nonterminals"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="style-rule-set">
|
||||
<xsl:param name="rule-set"/>
|
||||
<xsl:for-each select="$rule-set">
|
||||
<xsl:apply-templates select=".">
|
||||
<xsl:with-param name="pad" select="'3'"/>
|
||||
<xsl:with-param name="prev-lhs">
|
||||
<xsl:if test="position()>1">
|
||||
<xsl:variable name="position" select="position()"/>
|
||||
<xsl:value-of select="$rule-set[$position - 1]/lhs"/>
|
||||
</xsl:if>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar/terminals">
|
||||
<xsl:text>Terminals, with rules where they appear </xsl:text>
|
||||
<xsl:apply-templates select="terminal"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar/nonterminals">
|
||||
<xsl:text>Nonterminals, with rules where they appear </xsl:text>
|
||||
<xsl:apply-templates select="nonterminal[@usefulness!='useless-in-grammar']"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="terminal">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:call-template name="line-wrap">
|
||||
<xsl:with-param name="first-line-length">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(@name) > 66">0</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="66 - string-length(@name)" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="line-length" select="66" />
|
||||
<xsl:with-param name="text">
|
||||
<xsl:if test="string-length(@type) != 0">
|
||||
<xsl:value-of select="concat(' <', @type, '>')"/>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="concat(' (', @token-number, ')')"/>
|
||||
<xsl:for-each select="key('bison:ruleByRhs', @name)">
|
||||
<xsl:value-of select="concat(' ', @number)"/>
|
||||
</xsl:for-each>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="nonterminal">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:if test="string-length(@type) != 0">
|
||||
<xsl:value-of select="concat(' <', @type, '>')"/>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="concat(' (', @symbol-number, ')')"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:variable name="output">
|
||||
<xsl:call-template name="line-wrap">
|
||||
<xsl:with-param name="line-length" select="66" />
|
||||
<xsl:with-param name="text">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:if test="key('bison:ruleByLhs', @name)">
|
||||
<xsl:text>on@left:</xsl:text>
|
||||
<xsl:for-each select="key('bison:ruleByLhs', @name)">
|
||||
<xsl:value-of select="concat(' ', @number)"/>
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
<xsl:if test="key('bison:ruleByRhs', @name)">
|
||||
<xsl:if test="key('bison:ruleByLhs', @name)">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text>on@right:</xsl:text>
|
||||
<xsl:for-each select="key('bison:ruleByRhs', @name)">
|
||||
<xsl:value-of select="concat(' ', @number)"/>
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="translate($output, '@', ' ')" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton" mode="conflicts">
|
||||
<xsl:variable name="conflict-report">
|
||||
<xsl:apply-templates select="state" mode="conflicts"/>
|
||||
</xsl:variable>
|
||||
<xsl:if test="string-length($conflict-report) != 0">
|
||||
<xsl:value-of select="$conflict-report"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="state" mode="conflicts">
|
||||
<xsl:variable name="conflict-counts">
|
||||
<xsl:apply-templates select="." mode="bison:count-conflicts" />
|
||||
</xsl:variable>
|
||||
<xsl:variable
|
||||
name="sr-count" select="substring-before($conflict-counts, ',')"
|
||||
/>
|
||||
<xsl:variable
|
||||
name="rr-count" select="substring-after($conflict-counts, ',')"
|
||||
/>
|
||||
<xsl:if test="$sr-count > 0 or $rr-count > 0">
|
||||
<xsl:value-of select="concat('State ', @number, ' conflicts:')"/>
|
||||
<xsl:if test="$sr-count > 0">
|
||||
<xsl:value-of select="concat(' ', $sr-count, ' shift/reduce')"/>
|
||||
<xsl:if test="$rr-count > 0">
|
||||
<xsl:value-of select="(',')"/>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
<xsl:if test="$rr-count > 0">
|
||||
<xsl:value-of select="concat(' ', $rr-count, ' reduce/reduce')"/>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="' '"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton">
|
||||
<xsl:apply-templates select="state">
|
||||
<xsl:with-param name="pad" select="'3'"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton/state">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:text>State </xsl:text>
|
||||
<xsl:value-of select="@number"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="itemset/item">
|
||||
<xsl:with-param name="pad" select="$pad"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="actions/transitions">
|
||||
<xsl:with-param name="type" select="'shift'"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="actions/errors"/>
|
||||
<xsl:apply-templates select="actions/reductions"/>
|
||||
<xsl:apply-templates select="actions/transitions">
|
||||
<xsl:with-param name="type" select="'goto'"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="solved-conflicts"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/transitions">
|
||||
<xsl:param name="type"/>
|
||||
<xsl:if test="transition[@type = $type]">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="transition[@type = $type]">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="transition[@type = $type]"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/errors">
|
||||
<xsl:if test="error">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="error">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="error"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/reductions">
|
||||
<xsl:if test="reduction">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="reduction">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="reduction"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:param name="prev-rule-number"
|
||||
select="preceding-sibling::item[1]/@rule-number"/>
|
||||
<xsl:apply-templates
|
||||
select="key('bison:ruleByNumber', current()/@rule-number)"
|
||||
>
|
||||
<xsl:with-param name="itemset" select="'true'"/>
|
||||
<xsl:with-param name="pad" select="$pad"/>
|
||||
<xsl:with-param
|
||||
name="prev-lhs"
|
||||
select="key('bison:ruleByNumber', $prev-rule-number)/lhs[text()]"
|
||||
/>
|
||||
<xsl:with-param name="dot" select="@dot"/>
|
||||
<xsl:with-param name="lookaheads">
|
||||
<xsl:apply-templates select="lookaheads"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rule">
|
||||
<xsl:param name="itemset"/>
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:param name="prev-lhs"/>
|
||||
<xsl:param name="dot"/>
|
||||
<xsl:param name="lookaheads"/>
|
||||
|
||||
<xsl:if test="$itemset != 'true' and not($prev-lhs = lhs[text()])">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="lpad">
|
||||
<xsl:with-param name="str" select="string(@number)"/>
|
||||
<xsl:with-param name="pad" select="number($pad)"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<!-- LHS -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="$itemset != 'true' and $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:when test="$itemset = 'true' and $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>
|
||||
|
||||
<!-- RHS -->
|
||||
<xsl:for-each select="rhs/*">
|
||||
<xsl:if test="position() = $dot + 1">
|
||||
<xsl:text> •</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:if test="position() = last() and position() = $dot">
|
||||
<xsl:text> •</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="$lookaheads">
|
||||
<xsl:value-of select="$lookaheads"/>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="symbol">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="empty">
|
||||
<xsl:text> %empty</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads">
|
||||
<xsl:text> [</xsl:text>
|
||||
<xsl:apply-templates select="symbol"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads/symbol">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:if test="position() != last()">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="transition">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@type = 'shift'">
|
||||
<xsl:text>shift, and go to state </xsl:text>
|
||||
<xsl:value-of select="@state"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'goto'">
|
||||
<xsl:text>go to state </xsl:text>
|
||||
<xsl:value-of select="@state"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="error">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text>error</xsl:text>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="text()"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="reduction">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:if test="@enabled = 'false'">
|
||||
<xsl:text>[</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@rule = 'accept'">
|
||||
<xsl:text>accept</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>reduce using rule </xsl:text>
|
||||
<xsl:value-of select="@rule"/>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of
|
||||
select="key('bison:ruleByNumber', current()/@rule)/lhs[text()]"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="@enabled = 'false'">
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="solved-conflicts">
|
||||
<xsl:if test="resolution">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="resolution"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="resolution">
|
||||
<xsl:text> Conflict between rule </xsl:text>
|
||||
<xsl:value-of select="@rule"/>
|
||||
<xsl:text> and token </xsl:text>
|
||||
<xsl:value-of select="@symbol"/>
|
||||
<xsl:text> resolved as </xsl:text>
|
||||
<xsl:if test="@type = 'error'">
|
||||
<xsl:text>an </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="@type"/>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>). </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="max-width-symbol">
|
||||
<xsl:param name="node"/>
|
||||
<xsl:variable name="longest">
|
||||
<xsl:for-each select="$node">
|
||||
<xsl:sort data-type="number" select="string-length(@symbol)"
|
||||
order="descending"/>
|
||||
<xsl:if test="position() = 1">
|
||||
<xsl:value-of select="string-length(@symbol)"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="$longest"/>
|
||||
</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 name="rpad">
|
||||
<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:value-of select="$str"/>
|
||||
<xsl:call-template name="space">
|
||||
<xsl:with-param name="repeat" select="$diff"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="line-wrap">
|
||||
<xsl:param name="line-length"/> <!-- required -->
|
||||
<xsl:param name="first-line-length" select="$line-length"/>
|
||||
<xsl:param name="text"/> <!-- required -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="normalize-space($text) = ''" />
|
||||
<xsl:when test="string-length($text) <= $first-line-length">
|
||||
<xsl:value-of select="concat($text, ' ')" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="break-pos">
|
||||
<xsl:call-template name="ws-search">
|
||||
<xsl:with-param name="text" select="$text" />
|
||||
<xsl:with-param name="start" select="$first-line-length+1" />
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="substring($text, 1, $break-pos - 1)" />
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="line-wrap">
|
||||
<xsl:with-param name="line-length" select="$line-length" />
|
||||
<xsl:with-param
|
||||
name="text" select="concat(' ', substring($text, $break-pos+1))"
|
||||
/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="ws-search">
|
||||
<xsl:param name="text"/> <!-- required -->
|
||||
<xsl:param name="start"/> <!-- required -->
|
||||
<xsl:variable name="search-text" select="substring($text, $start)" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(contains($search-text, ' '))">
|
||||
<xsl:value-of select="string-length($text)+1" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of
|
||||
select="$start + string-length(substring-before($search-text, ' '))"
|
||||
/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -1,766 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2022, 2025-2026 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
Written by Wojciech Polak <polak@gnu.org>.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:bison="https://www.gnu.org/software/bison/">
|
||||
|
||||
<xsl:import href="bison.xsl"/>
|
||||
|
||||
<xsl:output method="xml" encoding="UTF-8"
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
|
||||
indent="yes"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
||||
<title>
|
||||
<xsl:value-of select="bison-xml-report/filename"/>
|
||||
<xsl:text> - GNU Bison XML Automaton Report</xsl:text>
|
||||
</title>
|
||||
<style type="text/css"><![CDATA[
|
||||
body {
|
||||
font-family: "Nimbus Sans L", Arial, sans-serif;
|
||||
font-size: 9pt;
|
||||
}
|
||||
a:link {
|
||||
color: #1f00ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:visited {
|
||||
color: #1f00ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: red;
|
||||
}
|
||||
#menu a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.i {
|
||||
font-style: italic;
|
||||
}
|
||||
.pre {
|
||||
font-family: monospace;
|
||||
white-space: pre;
|
||||
}
|
||||
ol.decimal {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
ol.lower-alpha {
|
||||
list-style-type: lower-alpha;
|
||||
}
|
||||
.dot {
|
||||
color: #cc0000;
|
||||
}
|
||||
#footer {
|
||||
margin-top: 3.5em;
|
||||
font-size: 7pt;
|
||||
}
|
||||
]]></style>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:apply-templates select="bison-xml-report"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<div id="footer"><hr />This document was generated using
|
||||
<a href="https://www.gnu.org/software/bison/" title="GNU Bison">
|
||||
GNU Bison <xsl:value-of select="/bison-xml-report/@version"/></a>
|
||||
XML Automaton Report.<br />
|
||||
<!-- default copying notice -->
|
||||
Verbatim copying and distribution of this entire page is
|
||||
permitted in any medium, provided this notice is preserved.</div>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bison-xml-report">
|
||||
<h1>GNU Bison XML Automaton Report</h1>
|
||||
<p>
|
||||
input grammar: <span class="i"><xsl:value-of select="filename"/></span>
|
||||
</p>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
<h3>Table of Contents</h3>
|
||||
<ul id="menu">
|
||||
<li>
|
||||
<a href="#reductions">Reductions</a>
|
||||
<ul class="lower-alpha">
|
||||
<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="#rules_useless_in_grammar">Rules useless in grammar</a></li>
|
||||
<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>
|
||||
</xsl:if>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#conflicts">Conflicts</a></li>
|
||||
<li>
|
||||
<a href="#grammar">Grammar</a>
|
||||
<ul class="lower-alpha">
|
||||
<li><a href="#grammar">Itemset</a></li>
|
||||
<li><a href="#terminals">Terminal symbols</a></li>
|
||||
<li><a href="#nonterminals">Nonterminal symbols</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#automaton">Automaton</a></li>
|
||||
</ul>
|
||||
<xsl:apply-templates select="grammar" mode="reductions"/>
|
||||
<xsl:apply-templates select="grammar" mode="useless-in-parser"/>
|
||||
<xsl:apply-templates select="automaton" mode="conflicts"/>
|
||||
<xsl:apply-templates select="grammar"/>
|
||||
<xsl:apply-templates select="automaton"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar" mode="reductions">
|
||||
<h2>
|
||||
<a name="reductions"/>
|
||||
<xsl:text> Reductions</xsl:text>
|
||||
</h2>
|
||||
<xsl:apply-templates select="nonterminals" mode="useless-in-grammar"/>
|
||||
<xsl:apply-templates select="terminals" mode="unused-in-grammar"/>
|
||||
<xsl:apply-templates select="rules" mode="useless-in-grammar"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="nonterminals" mode="useless-in-grammar">
|
||||
<h3>
|
||||
<a name="nonterminals_useless_in_grammar"/>
|
||||
<xsl:text> Nonterminals useless in grammar</xsl:text>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:if test="nonterminal[@usefulness='useless-in-grammar']">
|
||||
<p class="pre">
|
||||
<xsl:for-each select="nonterminal[@usefulness='useless-in-grammar']">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text> </xsl:text>
|
||||
</p>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="terminals" mode="unused-in-grammar">
|
||||
<h3>
|
||||
<a name="terminals_unused_in_grammar"/>
|
||||
<xsl:text> Terminals unused in grammar</xsl:text>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:if test="terminal[@usefulness='unused-in-grammar']">
|
||||
<p class="pre">
|
||||
<xsl:for-each select="terminal[@usefulness='unused-in-grammar']">
|
||||
<xsl:sort select="@symbol-number" data-type="number"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text> </xsl:text>
|
||||
</p>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rules" mode="useless-in-grammar">
|
||||
<h3>
|
||||
<a name="rules_useless_in_grammar"/>
|
||||
<xsl:text> Rules useless in grammar</xsl:text>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:variable name="set" select="rule[@usefulness='useless-in-grammar']"/>
|
||||
<xsl:if test="$set">
|
||||
<p class="pre">
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param name="rule-set" select="$set"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> </xsl:text>
|
||||
</p>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar" mode="useless-in-parser">
|
||||
<xsl:variable
|
||||
name="set" select="rules/rule[@usefulness='useless-in-parser']"
|
||||
/>
|
||||
<xsl:if test="$set">
|
||||
<h2>
|
||||
<a name="rules_useless_in_parser"/>
|
||||
<xsl:text> Rules useless in parser due to conflicts</xsl:text>
|
||||
</h2>
|
||||
<xsl:text> </xsl:text>
|
||||
<p class="pre">
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param name="rule-set" select="$set"/>
|
||||
</xsl:call-template>
|
||||
</p>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar">
|
||||
<h2>
|
||||
<a name="grammar"/>
|
||||
<xsl:text> Grammar</xsl:text>
|
||||
</h2>
|
||||
<xsl:text> </xsl:text>
|
||||
<p class="pre">
|
||||
<xsl:call-template name="style-rule-set">
|
||||
<xsl:with-param name="anchor" select="'true'" />
|
||||
<xsl:with-param
|
||||
name="rule-set" select="rules/rule[@usefulness!='useless-in-grammar']"
|
||||
/>
|
||||
</xsl:call-template>
|
||||
</p>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="terminals"/>
|
||||
<xsl:apply-templates select="nonterminals"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="style-rule-set">
|
||||
<xsl:param name="anchor"/>
|
||||
<xsl:param name="rule-set"/>
|
||||
<xsl:for-each select="$rule-set">
|
||||
<xsl:apply-templates select=".">
|
||||
<xsl:with-param name="anchor" select="$anchor"/>
|
||||
<xsl:with-param name="pad" select="'3'"/>
|
||||
<xsl:with-param name="prev-lhs">
|
||||
<xsl:if test="position()>1">
|
||||
<xsl:variable name="position" select="position()"/>
|
||||
<xsl:value-of select="$rule-set[$position - 1]/lhs"/>
|
||||
</xsl:if>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton" mode="conflicts">
|
||||
<h2>
|
||||
<a name="conflicts"/>
|
||||
<xsl:text> Conflicts</xsl:text>
|
||||
</h2>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:variable name="conflict-report">
|
||||
<xsl:apply-templates select="state" mode="conflicts"/>
|
||||
</xsl:variable>
|
||||
<xsl:if test="string-length($conflict-report) != 0">
|
||||
<p class="pre">
|
||||
<xsl:copy-of select="$conflict-report"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</p>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="state" mode="conflicts">
|
||||
<xsl:variable name="conflict-counts">
|
||||
<xsl:apply-templates select="." mode="bison:count-conflicts" />
|
||||
</xsl:variable>
|
||||
<xsl:variable
|
||||
name="sr-count" select="substring-before($conflict-counts, ',')"
|
||||
/>
|
||||
<xsl:variable
|
||||
name="rr-count" select="substring-after($conflict-counts, ',')"
|
||||
/>
|
||||
<xsl:if test="$sr-count > 0 or $rr-count > 0">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#state_', @number)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="concat('State ', @number)"/>
|
||||
</a>
|
||||
<xsl:text> conflicts:</xsl:text>
|
||||
<xsl:if test="$sr-count > 0">
|
||||
<xsl:value-of select="concat(' ', $sr-count, ' shift/reduce')"/>
|
||||
<xsl:if test="$rr-count > 0">
|
||||
<xsl:value-of select="(',')"/>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
<xsl:if test="$rr-count > 0">
|
||||
<xsl:value-of select="concat(' ', $rr-count, ' reduce/reduce')"/>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="' '"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar/terminals">
|
||||
<h3>
|
||||
<a name="terminals"/>
|
||||
<xsl:text> Terminals, with rules where they appear</xsl:text>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<ul>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="terminal"/>
|
||||
</ul>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="grammar/nonterminals">
|
||||
<h3>
|
||||
<a name="nonterminals"/>
|
||||
<xsl:text> Nonterminals, with rules where they appear</xsl:text>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<ul>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates
|
||||
select="nonterminal[@usefulness!='useless-in-grammar']"
|
||||
/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="terminal">
|
||||
<xsl:text> </xsl:text>
|
||||
<li>
|
||||
<b><xsl:value-of select="@name"/></b>
|
||||
<xsl:if test="string-length(@type) != 0">
|
||||
<xsl:value-of select="concat(' <', @type, '>')"/>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="concat(' (', @token-number, ')')"/>
|
||||
<xsl:for-each select="key('bison:ruleByRhs', @name)">
|
||||
<xsl:apply-templates select="." mode="number-link"/>
|
||||
</xsl:for-each>
|
||||
</li>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="nonterminal">
|
||||
<xsl:text> </xsl:text>
|
||||
<li>
|
||||
<b><xsl:value-of select="@name"/></b>
|
||||
<xsl:if test="string-length(@type) != 0">
|
||||
<xsl:value-of select="concat(' <', @type, '>')"/>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="concat(' (', @symbol-number, ')')"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<ul>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:if test="key('bison:ruleByLhs', @name)">
|
||||
<xsl:text> </xsl:text>
|
||||
<li>
|
||||
<xsl:text>on left:</xsl:text>
|
||||
<xsl:for-each select="key('bison:ruleByLhs', @name)">
|
||||
<xsl:apply-templates select="." mode="number-link"/>
|
||||
</xsl:for-each>
|
||||
</li>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:if test="key('bison:ruleByRhs', @name)">
|
||||
<xsl:text> </xsl:text>
|
||||
<li>
|
||||
<xsl:text>on right:</xsl:text>
|
||||
<xsl:for-each select="key('bison:ruleByRhs', @name)">
|
||||
<xsl:apply-templates select="." mode="number-link"/>
|
||||
</xsl:for-each>
|
||||
</li>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text> </xsl:text>
|
||||
</ul>
|
||||
<xsl:text> </xsl:text>
|
||||
</li>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="rule" mode="number-link">
|
||||
<xsl:text> </xsl:text>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#rule_', @number)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="@number"/>
|
||||
</a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton">
|
||||
<h2>
|
||||
<a name="automaton"/>
|
||||
<xsl:text> Automaton</xsl:text>
|
||||
</h2>
|
||||
<xsl:apply-templates select="state">
|
||||
<xsl:with-param name="pad" select="'3'"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="automaton/state">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<h3>
|
||||
<a>
|
||||
<xsl:attribute name="name">
|
||||
<xsl:value-of select="concat('state_', @number)"/>
|
||||
</xsl:attribute>
|
||||
</a>
|
||||
<xsl:text>State </xsl:text>
|
||||
<xsl:value-of select="@number"/>
|
||||
</h3>
|
||||
<xsl:text> </xsl:text>
|
||||
<p class="pre">
|
||||
<xsl:apply-templates select="itemset/item">
|
||||
<xsl:with-param name="pad" select="$pad"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="actions/transitions">
|
||||
<xsl:with-param name="type" select="'shift'"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="actions/errors"/>
|
||||
<xsl:apply-templates select="actions/reductions"/>
|
||||
<xsl:apply-templates select="actions/transitions">
|
||||
<xsl:with-param name="type" select="'goto'"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="solved-conflicts"/>
|
||||
</p>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/transitions">
|
||||
<xsl:param name="type"/>
|
||||
<xsl:if test="transition[@type = $type]">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="transition[@type = $type]">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="transition[@type = $type]"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/errors">
|
||||
<xsl:if test="error">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="error">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="error"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="actions/reductions">
|
||||
<xsl:if test="reduction">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="reduction">
|
||||
<xsl:with-param name="pad">
|
||||
<xsl:call-template name="max-width-symbol">
|
||||
<xsl:with-param name="node" select="reduction"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:param name="prev-rule-number"
|
||||
select="preceding-sibling::item[1]/@rule-number"/>
|
||||
<xsl:apply-templates
|
||||
select="key('bison:ruleByNumber', current()/@rule-number)"
|
||||
>
|
||||
<xsl:with-param name="itemset" select="'true'"/>
|
||||
<xsl:with-param name="pad" select="$pad"/>
|
||||
<xsl:with-param name="prev-lhs"
|
||||
select="key('bison:ruleByNumber', $prev-rule-number)/lhs[text()]"
|
||||
/>
|
||||
<xsl:with-param name="dot" select="@dot"/>
|
||||
<xsl:with-param name="lookaheads">
|
||||
<xsl:apply-templates select="lookaheads"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
anchor = 'true': define as an <a> anchor.
|
||||
itemset = 'true': show the items.
|
||||
-->
|
||||
<xsl:template match="rule">
|
||||
<xsl:param name="anchor"/>
|
||||
<xsl:param name="itemset"/>
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:param name="prev-lhs"/>
|
||||
<xsl:param name="dot"/>
|
||||
<xsl:param name="lookaheads"/>
|
||||
|
||||
<xsl:if test="$itemset != 'true' and not($prev-lhs = lhs[text()])">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$anchor = 'true'">
|
||||
<a>
|
||||
<xsl:attribute name="name">
|
||||
<xsl:value-of select="concat('rule_', @number)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:call-template name="lpad">
|
||||
<xsl:with-param name="str" select="string(@number)"/>
|
||||
<xsl:with-param name="pad" select="number($pad)"/>
|
||||
</xsl:call-template>
|
||||
</a>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#rule_', @number)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:call-template name="lpad">
|
||||
<xsl:with-param name="str" select="string(@number)"/>
|
||||
<xsl:with-param name="pad" select="number($pad)"/>
|
||||
</xsl:call-template>
|
||||
</a>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<!-- LHS -->
|
||||
<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()])) + 2"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<span class="i">
|
||||
<xsl:value-of select="lhs"/>
|
||||
</span>
|
||||
<xsl:text> →</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!-- RHS -->
|
||||
<xsl:for-each select="rhs/*">
|
||||
<xsl:if test="position() = $dot + 1">
|
||||
<xsl:text> </xsl:text>
|
||||
<span class="dot">•</span>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:if test="position() = last() and position() = $dot">
|
||||
<xsl:text> </xsl:text>
|
||||
<span class="dot">•</span>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="$lookaheads">
|
||||
<xsl:value-of select="$lookaheads"/>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="symbol">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="name(key('bison:symbolByName', .)) = 'nonterminal'">
|
||||
<span class="i"><xsl:value-of select="."/></span>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<b><xsl:value-of select="."/></b>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="empty">
|
||||
<xsl:text> %empty</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads">
|
||||
<xsl:text> [</xsl:text>
|
||||
<xsl:apply-templates select="symbol"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads/symbol">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:if test="position() != last()">
|
||||
<xsl:text>, </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="transition">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@type = 'shift'">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#state_', @state)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="concat('shift, and go to state ', @state)"/>
|
||||
</a>
|
||||
</xsl:when>
|
||||
<xsl:when test="@type = 'goto'">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#state_', @state)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="concat('go to state ', @state)"/>
|
||||
</a>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="error">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text>error</xsl:text>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="text()"/>
|
||||
<xsl:text>)</xsl:text>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="reduction">
|
||||
<xsl:param name="pad"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:call-template name="rpad">
|
||||
<xsl:with-param name="str" select="string(@symbol)"/>
|
||||
<xsl:with-param name="pad" select="number($pad) + 2"/>
|
||||
</xsl:call-template>
|
||||
<xsl:if test="@enabled = 'false'">
|
||||
<xsl:text>[</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@rule = 'accept'">
|
||||
<xsl:text>accept</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#rule_', @rule)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="concat('reduce using rule ', @rule)"/>
|
||||
</a>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of
|
||||
select="key('bison:ruleByNumber', current()/@rule)/lhs[text()]"
|
||||
/>
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="@enabled = 'false'">
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="solved-conflicts">
|
||||
<xsl:if test="resolution">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="resolution"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="resolution">
|
||||
<xsl:text> Conflict between </xsl:text>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat('#rule_', @rule)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="concat('rule ',@rule)"/>
|
||||
</a>
|
||||
<xsl:text> and token </xsl:text>
|
||||
<xsl:value-of select="@symbol"/>
|
||||
<xsl:text> resolved as </xsl:text>
|
||||
<xsl:if test="@type = 'error'">
|
||||
<xsl:text>an </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="@type"/>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>). </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="max-width-symbol">
|
||||
<xsl:param name="node"/>
|
||||
<xsl:variable name="longest">
|
||||
<xsl:for-each select="$node">
|
||||
<xsl:sort data-type="number" select="string-length(@symbol)"
|
||||
order="descending"/>
|
||||
<xsl:if test="position() = 1">
|
||||
<xsl:value-of select="string-length(@symbol)"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="$longest"/>
|
||||
</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 name="rpad">
|
||||
<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:value-of select="$str"/>
|
||||
<xsl:call-template name="space">
|
||||
<xsl:with-param name="repeat" select="$diff"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</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>
|
||||
@@ -0,0 +1,16 @@
|
||||
Makefile
|
||||
bison.aux
|
||||
bison.cp
|
||||
bison.cps
|
||||
bison.dvi
|
||||
bison.fn
|
||||
bison.ky
|
||||
bison.log
|
||||
bison.pg
|
||||
bison.ps
|
||||
bison.toc
|
||||
bison.tp
|
||||
bison.vr
|
||||
refcard.dvi
|
||||
refcard.log
|
||||
refcard.ps
|
||||
@@ -1,26 +0,0 @@
|
||||
# Do not ignore these. The release procedure (web-manual-update)
|
||||
# works in the src tree (even when run from the build tree) and leaves
|
||||
# these files around. Since they take precedence over the files in
|
||||
# the build tree, locally built manuals use obsolete auxiliary files.
|
||||
#
|
||||
# So don't hide them, give the maintainer a chance to clean them.
|
||||
#/bison.aux
|
||||
#/bison.cp
|
||||
#/bison.cps
|
||||
#/bison.toc
|
||||
*.dvi
|
||||
*.ps
|
||||
/bison.1
|
||||
/bison.help
|
||||
/bison.html
|
||||
/bison.info
|
||||
/cross-options.texi
|
||||
/figs/*.eps
|
||||
/figs/*.svg
|
||||
/gendocs_template
|
||||
/gendocs_template_min
|
||||
/gpl-3.0.texi
|
||||
/relocatable.texi
|
||||
/stamp-vti
|
||||
/version.texi
|
||||
/yacc.1
|
||||
-2572
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user