mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-19 15:44:25 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69b22b49d4 | ||
|
|
ec11f08fb3 | ||
|
|
67444a6f0d | ||
|
|
d120a07e6b | ||
|
|
741a58a504 | ||
|
|
d80815ac23 | ||
|
|
0b417c3479 | ||
|
|
77dbdd0d59 | ||
|
|
f8db8fe4d7 | ||
|
|
375eb71489 | ||
|
|
d3a86f7b20 | ||
|
|
29c75ef27f | ||
|
|
628012d830 | ||
|
|
f788ba2ab6 | ||
|
|
53526f31df | ||
|
|
e63811dd86 | ||
|
|
47262c36bb | ||
|
|
1e452b1553 | ||
|
|
ed796869bb | ||
|
|
12c412f6bb | ||
|
|
2663035ea5 | ||
|
|
de7c66ab41 | ||
|
|
feeacc2d57 | ||
|
|
cc10f9ab24 | ||
|
|
1dcd6068dd | ||
|
|
02f16dc799 | ||
|
|
aa21c457f2 | ||
|
|
9f26e6d6b3 | ||
|
|
8d3e782e05 | ||
|
|
1c671bad33 | ||
|
|
88cd9570b6 | ||
|
|
c423ad17e7 | ||
|
|
9114b267a8 | ||
|
|
70c3f3ade5 | ||
|
|
1934304acf | ||
|
|
c8e57e8159 | ||
|
|
1e49f5e1e6 | ||
|
|
49aae94bed | ||
|
|
e191bf7b9f | ||
|
|
f520e150eb | ||
|
|
75db37c564 | ||
|
|
886b503e4b | ||
|
|
a2f0444c6e | ||
|
|
66100b640f | ||
|
|
de5207244b | ||
|
|
cae8132690 | ||
|
|
a1a847bfb5 | ||
|
|
3ac95de01a | ||
|
|
da7af36a13 | ||
|
|
3f25104caf | ||
|
|
6b1933d992 |
+1
-1
@@ -1 +1 @@
|
|||||||
3.3.90
|
3.4.1
|
||||||
|
|||||||
+175
-77
@@ -1,8 +1,7 @@
|
|||||||
# Travis defines and exports CC and CXX *after* we have defined our
|
# Travis defines and exports CC and CXX *after* we have defined our
|
||||||
# environment variables via 'env'. So, do not use 'env' to define
|
# environment variables via 'env'. So, do not use 'env' to define them.
|
||||||
# them. Instead, put their definitions in MATRIX_EVAL, which we eval
|
# Instead, put their definitions in MATRIX_EVAL, which we eval after the
|
||||||
# after the definitions from Travis.
|
# definitions from Travis.
|
||||||
|
|
||||||
language: cpp
|
language: cpp
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -11,8 +10,63 @@ env:
|
|||||||
# See https://github.com/nemequ/icc-travis.
|
# See https://github.com/nemequ/icc-travis.
|
||||||
secure: B3manbbi0anCAGDJTdAa9TlodzRHeiYD87FKmFzS877dPm8Cm0BDvtUhKBUpBvP8+nbHOWFGrgDmLugSZjTGU+mAxtuQpamUFHvinu0BIk3qtjlqouwvbtIqUu8iiZ3Uqu+xKeAANKRy0YVZGLlEb9F3N119tJ/Fxp1p9bXL1qph+CZ25OFbUgZ2s4F+/AyHMUxJlNXKFe3Qean65hC6edhU3zoaKzr/g/wtbhRmcyWbkOa1dJqzr2yKotcPvrnApGhDzgMKFtohg/t7xfMADDVv6sGS5XNpt25Z+MUCmLg4Z9eD7u109jvRV1eu/jgVafqsthWEhXbuMiFgFhKBKGCNZ0dACIfKZSkFZI6FdM7ovJ6aNhSlxZ2169Ybd22rN1UTHeCQWySPcVVOg5taLVpqe+E8Xhnv4hBO5NrzElWwCMLxIdPUSwVStYvtDr8ZytHWzfot50vSnFKIFpTOr9hP4+AJMVmmqJfaJo2MLBft/q2xkztrMv3lQSj3m4+ma9kPDwXIu9uCutjlnhc00jNx9qegi5VfpAjxcG1R+pX4T20az6ByHk/7LPQsANkT31RJq/jAeD9LEuMOy8miha83q4QuvbFaqPK3PY0el/O1LZaXqLsV2aQ0uqH8YX0l4r5NzHdhb+3lYgvpMBO5ytr/EWJiEyNYV518050IUDE=
|
secure: B3manbbi0anCAGDJTdAa9TlodzRHeiYD87FKmFzS877dPm8Cm0BDvtUhKBUpBvP8+nbHOWFGrgDmLugSZjTGU+mAxtuQpamUFHvinu0BIk3qtjlqouwvbtIqUu8iiZ3Uqu+xKeAANKRy0YVZGLlEb9F3N119tJ/Fxp1p9bXL1qph+CZ25OFbUgZ2s4F+/AyHMUxJlNXKFe3Qean65hC6edhU3zoaKzr/g/wtbhRmcyWbkOa1dJqzr2yKotcPvrnApGhDzgMKFtohg/t7xfMADDVv6sGS5XNpt25Z+MUCmLg4Z9eD7u109jvRV1eu/jgVafqsthWEhXbuMiFgFhKBKGCNZ0dACIfKZSkFZI6FdM7ovJ6aNhSlxZ2169Ybd22rN1UTHeCQWySPcVVOg5taLVpqe+E8Xhnv4hBO5NrzElWwCMLxIdPUSwVStYvtDr8ZytHWzfot50vSnFKIFpTOr9hP4+AJMVmmqJfaJo2MLBft/q2xkztrMv3lQSj3m4+ma9kPDwXIu9uCutjlnhc00jNx9qegi5VfpAjxcG1R+pX4T20az6ByHk/7LPQsANkT31RJq/jAeD9LEuMOy8miha83q4QuvbFaqPK3PY0el/O1LZaXqLsV2aQ0uqH8YX0l4r5NzHdhb+3lYgvpMBO5ytr/EWJiEyNYV518050IUDE=
|
||||||
|
|
||||||
matrix:
|
# 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:
|
||||||
|
- compile
|
||||||
|
- test
|
||||||
|
|
||||||
|
# The 'test' jobs do not need the repo at all, only the 'compile'
|
||||||
|
# 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:
|
include:
|
||||||
|
- stage: "compile"
|
||||||
|
git:
|
||||||
|
clone: true
|
||||||
|
dist: bionic
|
||||||
|
script:
|
||||||
|
- sudo apt-get install -qq autoconf automake autopoint flex gettext graphviz help2man m4 texinfo
|
||||||
|
- autoconf --version
|
||||||
|
- automake --version
|
||||||
|
- autopoint --version
|
||||||
|
- dot -V
|
||||||
|
- gettext --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
|
||||||
|
|
||||||
|
- ./bootstrap
|
||||||
|
# gnulib-po/Makefile.in.in is about Gettext 0.20, which is not available in bionic. So it will break here. Override it. Don't use autopoint, which sends some other files in the past.
|
||||||
|
- cp po/Makefile.in.in gnulib-po
|
||||||
|
|
||||||
|
- ./configure --enable-gcc-warnings || { cat config.log && false; }
|
||||||
|
- make -j2
|
||||||
|
- make -j2 dist
|
||||||
|
- 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 'test' 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.
|
||||||
|
- sftp -b - [email protected] <<< "put $dist"$'\n'"ln -s $dist bison-$TRAVIS_BUILD_NUMBER.tar.xz"
|
||||||
|
|
||||||
## ------- ##
|
## ------- ##
|
||||||
## First. ##
|
## First. ##
|
||||||
## ------- ##
|
## ------- ##
|
||||||
@@ -20,53 +74,52 @@ matrix:
|
|||||||
# Start with three completely different environments, to get
|
# Start with three completely different environments, to get
|
||||||
# errors asap.
|
# errors asap.
|
||||||
|
|
||||||
- name: "GCC 7 -O3"
|
- name: "GCC 8 -O3"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: bionic
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
packages:
|
||||||
- g++-7
|
- g++-8
|
||||||
env:
|
env:
|
||||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'"
|
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8 && CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'"
|
||||||
|
|
||||||
# ASAN is time consuming, and we timeout the 50min granted by
|
# ASAN is time consuming, and we timeout the 50min granted by
|
||||||
# Travis if we run all the tests in on go. Run in two parts.
|
# Travis if we run all the tests in one go. Run in two parts.
|
||||||
- name: "Clang 7 libc++ and ASAN part 1"
|
- name: "Clang 8 libc++ and ASAN part 1"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: bionic
|
||||||
addons:
|
addons: &clang8
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- llvm-toolchain-xenial-7
|
- llvm-toolchain-bionic-8
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
packages:
|
packages:
|
||||||
- clang-7
|
- clang-8
|
||||||
- libc++-7-dev
|
- libc++-8-dev
|
||||||
- libc++abi-7-dev
|
- libc++abi-8-dev
|
||||||
env:
|
env:
|
||||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||||
- MATRIX_EVAL="PART=1 CC='clang-7 -fsanitize=address' CXX='clang++-7 -fsanitize=address -stdlib=libc++'"
|
- MATRIX_EVAL="PART=1 CC='clang-8 -fsanitize=address' CXX='clang++-8 -fsanitize=address -stdlib=libc++'"
|
||||||
|
|
||||||
- name: "Clang 7 libc++ and ASAN part 2"
|
- name: "Clang 8 libc++ and ASAN part 2"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: bionic
|
||||||
addons:
|
addons: *clang8
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- llvm-toolchain-xenial-7
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- clang-7
|
|
||||||
- libc++-7-dev
|
|
||||||
- libc++abi-7-dev
|
|
||||||
env:
|
env:
|
||||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||||
- MATRIX_EVAL="PART=2 CC='clang-7 -fsanitize=address' CXX='clang++-7 -fsanitize=address -stdlib=libc++'"
|
- MATRIX_EVAL="PART=2 CC='clang-8 -fsanitize=address' CXX='clang++-8 -fsanitize=address -stdlib=libc++'"
|
||||||
|
|
||||||
- name: "ICC"
|
- name: "ICC"
|
||||||
|
stage: test
|
||||||
|
# We need the build-aux/install-icc.sh script.
|
||||||
|
git:
|
||||||
|
clone: true
|
||||||
|
submodules: false
|
||||||
|
depth: 1
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
env:
|
env:
|
||||||
@@ -81,25 +134,30 @@ matrix:
|
|||||||
## GCC. ##
|
## GCC. ##
|
||||||
## ----- ##
|
## ----- ##
|
||||||
|
|
||||||
#- name: "GCC 8 with sanitizers"
|
- name: "GCC 7 with sanitizers"
|
||||||
# os: linux
|
os: linux
|
||||||
# dist: xenial
|
dist: bionic
|
||||||
# addons:
|
addons:
|
||||||
# apt:
|
apt:
|
||||||
# sources:
|
packages:
|
||||||
# - ubuntu-toolchain-r-test
|
- g++-7
|
||||||
# packages:
|
env:
|
||||||
# - g++-8
|
- MATRIX_EVAL="CC='gcc-7 -fsanitize=undefined,address -fno-omit-frame-pointer' CXX='g++-7 -fsanitize=undefined,address -fno-omit-frame-pointer'"
|
||||||
# env:
|
- PART=1
|
||||||
# # Can't use UBSAN: I get:
|
|
||||||
# # configure:4951: gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer conftest.c
|
- name: "GCC 7"
|
||||||
# # /usr/bin/ld: unrecognized option '--push-state' (on trusty)
|
stage: test
|
||||||
# # /usr/bin/ld: unrecognized option '--push-state--no-as-needed' (on xenial)
|
os: linux
|
||||||
# #
|
dist: bionic
|
||||||
# # https://stackoverflow.com/questions/50024731/ suggests using the gold linker.
|
addons:
|
||||||
# - MATRIX_EVAL="CC='gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer' CXX='g++-8 -fsanitize=undefined,address -fno-omit-frame-pointer'"
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-7
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
|
||||||
|
|
||||||
- name: "GCC 6"
|
- name: "GCC 6"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -112,6 +170,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
|
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
|
||||||
|
|
||||||
- name: "GCC 5"
|
- name: "GCC 5"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -124,6 +183,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
|
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
|
||||||
|
|
||||||
- name: "GCC 4.9"
|
- name: "GCC 4.9"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -136,6 +196,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
|
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
|
||||||
|
|
||||||
- name: "GCC 4.8"
|
- name: "GCC 4.8"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -148,6 +209,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC=gcc-4.8 && CXX=g++-4.8"
|
- MATRIX_EVAL="CC=gcc-4.8 && CXX=g++-4.8"
|
||||||
|
|
||||||
- name: "GCC 4.7"
|
- name: "GCC 4.7"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -160,6 +222,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC=gcc-4.7 && CXX=g++-4.7"
|
- MATRIX_EVAL="CC=gcc-4.7 && CXX=g++-4.7"
|
||||||
|
|
||||||
- name: "GCC 4.6"
|
- name: "GCC 4.6"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -175,7 +238,25 @@ matrix:
|
|||||||
## Clang. ##
|
## Clang. ##
|
||||||
## ------- ##
|
## ------- ##
|
||||||
|
|
||||||
|
- name: "Clang 7 -O3 and libc++"
|
||||||
|
stage: test
|
||||||
|
os: linux
|
||||||
|
dist: bionic
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-bionic-7
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- clang-7
|
||||||
|
- libc++-7-dev
|
||||||
|
- libc++abi-7-dev
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=clang-7 && CXX='clang++-7 -stdlib=libc++'"
|
||||||
|
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||||
|
|
||||||
- name: "Clang 6 -O3 and libc++"
|
- name: "Clang 6 -O3 and libc++"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -191,6 +272,7 @@ matrix:
|
|||||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||||
|
|
||||||
- name: "Clang 5"
|
- name: "Clang 5"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -204,6 +286,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC='clang-5.0' CXX='clang++-5.0'"
|
- MATRIX_EVAL="CC='clang-5.0' CXX='clang++-5.0'"
|
||||||
|
|
||||||
- name: "Clang 4"
|
- name: "Clang 4"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -216,6 +299,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
|
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
|
||||||
|
|
||||||
- name: "Clang 3.9"
|
- name: "Clang 3.9"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -228,6 +312,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
|
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
|
||||||
|
|
||||||
- name: "Clang 3.8"
|
- name: "Clang 3.8"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -241,6 +326,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
|
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
|
||||||
|
|
||||||
- name: "CLang 3.7"
|
- name: "CLang 3.7"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -254,6 +340,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7"
|
- MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7"
|
||||||
|
|
||||||
- name: "Clang 3.6"
|
- name: "Clang 3.6"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -267,6 +354,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6"
|
- MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6"
|
||||||
|
|
||||||
- name: "Clang 3.5"
|
- name: "Clang 3.5"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
addons:
|
addons:
|
||||||
@@ -280,6 +368,7 @@ matrix:
|
|||||||
- MATRIX_EVAL="CC=clang-3.5 && CXX=clang++-3.5"
|
- MATRIX_EVAL="CC=clang-3.5 && CXX=clang++-3.5"
|
||||||
|
|
||||||
- name: "Clang 3.4"
|
- name: "Clang 3.4"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
# Not available on Xenial.
|
# Not available on Xenial.
|
||||||
dist: trusty
|
dist: trusty
|
||||||
@@ -290,9 +379,10 @@ matrix:
|
|||||||
env:
|
env:
|
||||||
# No versioned name installed, but beware that Travis installs
|
# No versioned name installed, but beware that Travis installs
|
||||||
# a more modern clang earlier in the default PATH.
|
# a more modern clang earlier in the default PATH.
|
||||||
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++ && GETTEXT_VERSION=0.18.3'
|
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++'
|
||||||
|
|
||||||
- name: "Clang 3.3"
|
- name: "Clang 3.3"
|
||||||
|
stage: test
|
||||||
os: linux
|
os: linux
|
||||||
# Not available on Xenial.
|
# Not available on Xenial.
|
||||||
dist: trusty
|
dist: trusty
|
||||||
@@ -302,54 +392,62 @@ matrix:
|
|||||||
- clang-3.3
|
- clang-3.3
|
||||||
env:
|
env:
|
||||||
# See comment for 3.4.
|
# See comment for 3.4.
|
||||||
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++ && GETTEXT_VERSION=0.18.3'
|
- MATRIX_EVAL='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
|
||||||
|
|
||||||
before_install:
|
# Applies only to the jobs that don't have a 'script', i.e., applies to all the 'test' jobs, but not the 'compile' one.
|
||||||
|
script:
|
||||||
- eval "$MATRIX_EVAL"
|
- eval "$MATRIX_EVAL"
|
||||||
- env
|
# Beware not too leak $SSH_PRIVATE_KEY.
|
||||||
- sudo apt-get update -qq
|
# - env
|
||||||
- sudo apt-get install -qq autoconf automake autopoint doxygen flex gettext graphviz help2man m4 texinfo
|
- sudo apt-get install -qq doxygen flex m4
|
||||||
|
# Install and activate ICC.
|
||||||
- if [[ $CC == "icc" ]]; then build-aux/install-icc.sh; fi
|
- if [[ $CC == "icc" ]]; then build-aux/install-icc.sh; fi
|
||||||
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
||||||
# Install and activate dmd
|
# Install and activate dmd.
|
||||||
- mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh
|
- mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh
|
||||||
- source $(source ~/dlang/install.sh dmd -a)
|
- source $(source ~/dlang/install.sh dmd -a)
|
||||||
- autoconf --version
|
|
||||||
- automake --version
|
|
||||||
- autopoint --version
|
|
||||||
- $CC --version
|
- $CC --version
|
||||||
- $CXX --version
|
- $CXX --version
|
||||||
- dmd --version
|
- dmd --version
|
||||||
- doxygen --version
|
- doxygen --version
|
||||||
- flex --version
|
- flex --version
|
||||||
- gettext --version
|
|
||||||
- dot -V
|
|
||||||
- help2man --version
|
|
||||||
- ld --version
|
- ld --version
|
||||||
- m4 --version
|
- m4 --version
|
||||||
- makeinfo --version
|
|
||||||
|
|
||||||
script:
|
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
||||||
- git tag -l
|
|
||||||
# For some reasons, sometimes the checkout does not have any tags,
|
|
||||||
# so `git describe` fails, so bootstrap fails.
|
|
||||||
- git describe || git tag v3.0 -m "Fake version 3.0."
|
|
||||||
- git describe
|
|
||||||
# Unset this variable, otherwise, Java programs' stderr is cluttered
|
# Unset this variable, otherwise, Java programs' stderr is cluttered
|
||||||
# with `Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m`, which makes
|
# with `Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m`, which makes
|
||||||
# the test suite fail.
|
# the test suite fail.
|
||||||
- unset _JAVA_OPTIONS
|
- unset _JAVA_OPTIONS
|
||||||
- if [[ $GETTEXT_VERSION ]]; then sed -i -re "s/(AM_GNU_GETTEXT_VERSION).*/\1([$GETTEXT_VERSION])/" configure.ac; fi
|
|
||||||
- ./bootstrap
|
# Fail fast from now on.
|
||||||
# For some reason, gnulib-po/Makefile.in.in is about Gettext 0.19, so it will break here. Override it.
|
- set -e
|
||||||
- if [[ $GETTEXT_VERSION ]]; then autopoint --force; fi
|
- sftp [email protected]:bison-$TRAVIS_BUILD_NUMBER.tar.xz
|
||||||
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
- tar xf bison-$TRAVIS_BUILD_NUMBER.tar.xz
|
||||||
- ./configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
|
- 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
|
- 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-1} = 1; then make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat test-suite.log && cat tests/testsuite.log && false; }; fi
|
||||||
- if test ${PART-1} = 1; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { 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
|
- if test ${PART-2} = 2; then make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- if [[ $CC == "icc" ]]; then uninstall_intel_software; fi
|
- uninstall_intel_software || true
|
||||||
|
|||||||
@@ -1,21 +1,45 @@
|
|||||||
GNU Bison NEWS
|
GNU Bison NEWS
|
||||||
|
|
||||||
* Noteworthy changes in release 3.3.91 (2019-05-12) [beta]
|
* Noteworthy changes in release 3.4.2 (2019-09-12) [stable]
|
||||||
|
|
||||||
** Bug fixes
|
** Bug fixes
|
||||||
|
|
||||||
Portability issues were fixed.
|
In some cases, when warnings are disabled, bison could emit tons of white
|
||||||
|
spaces as diagnostics.
|
||||||
|
|
||||||
* Noteworthy changes in release 3.3.90 (2019-04-28) [beta]
|
When running out of memory, bison could crash (found by fuzzing).
|
||||||
|
|
||||||
|
When defining twice the EOF token, bison would crash.
|
||||||
|
|
||||||
|
New warnings from recent compilers have been addressed in the generated
|
||||||
|
parsers (yacc.c, glr.c, glr.cc).
|
||||||
|
|
||||||
|
When lone carriage-return characters appeared in the input file,
|
||||||
|
diagnostics could hang forever.
|
||||||
|
|
||||||
|
* Noteworthy changes in release 3.4.1 (2019-05-22) [stable]
|
||||||
|
|
||||||
|
** Bug fixes
|
||||||
|
|
||||||
|
Portability fixes.
|
||||||
|
|
||||||
|
* Noteworthy changes in release 3.4 (2019-05-19) [stable]
|
||||||
|
|
||||||
|
** Deprecated features
|
||||||
|
|
||||||
|
The %pure-parser directive is deprecated in favor of '%define api.pure'
|
||||||
|
since Bison 2.3b (2008-05-27), but no warning was issued; there is one
|
||||||
|
now. Note that since Bison 2.7 you are strongly encouraged to use
|
||||||
|
'%define api.pure full' instead of '%define api.pure'.
|
||||||
|
|
||||||
** New features
|
** New features
|
||||||
|
|
||||||
*** Colored diagnostics
|
*** Colored diagnostics
|
||||||
|
|
||||||
As an experimental feature, Bison now generates colored diagnostics,
|
As an experimental feature, diagnostics are now colored, controlled by the
|
||||||
controlled by the new options --color and --style.
|
new options --color and --style.
|
||||||
|
|
||||||
Install the libtextstyle library before configuring Bison to use them.
|
To use them, install the libtextstyle library before configuring Bison.
|
||||||
It is available from
|
It is available from
|
||||||
|
|
||||||
https://alpha.gnu.org/gnu/gettext/
|
https://alpha.gnu.org/gnu/gettext/
|
||||||
@@ -31,12 +55,13 @@ GNU Bison NEWS
|
|||||||
|
|
||||||
To customize the styles, create a CSS file similar to
|
To customize the styles, create a CSS file similar to
|
||||||
|
|
||||||
/* black-and-white.css */
|
/* bison-bw.css */
|
||||||
.warning { }
|
.warning { }
|
||||||
.error { font-weight: 800; text-decoration: underline; }
|
.error { font-weight: 800; text-decoration: underline; }
|
||||||
.note { }
|
.note { }
|
||||||
|
|
||||||
then invoke bison with --style=black-and-white.css.
|
then invoke bison with --style=bison-bw.css, or set the BISON_STYLE
|
||||||
|
environment variable to "bison-bw.css".
|
||||||
|
|
||||||
*** Disabling output
|
*** Disabling output
|
||||||
|
|
||||||
@@ -3620,7 +3645,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
LocalWords: redeclaration sval fcaret reentrant XSLT xsl Wmaybe yyvsp Tedi
|
LocalWords: redeclaration sval fcaret reentrant XSLT xsl Wmaybe yyvsp Tedi
|
||||||
LocalWords: pragmas noreturn untyped Rozenman unexpanded Wojciech Polak
|
LocalWords: pragmas noreturn untyped Rozenman unexpanded Wojciech Polak
|
||||||
LocalWords: Alexandre MERCHANTABILITY yytype emplace ptr automove lvalues
|
LocalWords: Alexandre MERCHANTABILITY yytype emplace ptr automove lvalues
|
||||||
LocalWords: nonterminal yy args Pragma dereference yyformat rhs docdir
|
LocalWords: nonterminal yy args Pragma dereference yyformat rhs docdir bw
|
||||||
LocalWords: Redeclarations rpcalc Autoconf YFLAGS Makefiles PROG DECL num
|
LocalWords: Redeclarations rpcalc Autoconf YFLAGS Makefiles PROG DECL num
|
||||||
LocalWords: Heimbigner AST src ast Makefile srcdir MinGW xxlex XXSTYPE
|
LocalWords: Heimbigner AST src ast Makefile srcdir MinGW xxlex XXSTYPE
|
||||||
LocalWords: XXLTYPE strictfp IDEs ffixit fdiagnostics parseable fixits
|
LocalWords: XXLTYPE strictfp IDEs ffixit fdiagnostics parseable fixits
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ Bruce Lilly [email protected]
|
|||||||
Bruno Haible [email protected]
|
Bruno Haible [email protected]
|
||||||
Charles-Henri de Boysson [email protected]
|
Charles-Henri de Boysson [email protected]
|
||||||
Christian Burger [email protected]
|
Christian Burger [email protected]
|
||||||
|
Clément Démoulins [email protected]
|
||||||
Colin Daley [email protected]
|
Colin Daley [email protected]
|
||||||
Cris Bailiff [email protected]
|
Cris Bailiff [email protected]
|
||||||
Cris van Pelt [email protected]
|
Cris van Pelt [email protected]
|
||||||
@@ -88,15 +89,18 @@ Jonathan Fabrizio [email protected]
|
|||||||
Jonathan Nieder [email protected]
|
Jonathan Nieder [email protected]
|
||||||
Josh Soref [email protected]
|
Josh Soref [email protected]
|
||||||
Juan Manuel Guerrero [email protected]
|
Juan Manuel Guerrero [email protected]
|
||||||
|
Karl Berry [email protected]
|
||||||
Kees Zeelenberg [email protected]
|
Kees Zeelenberg [email protected]
|
||||||
Keith Browne [email protected]
|
Keith Browne [email protected]
|
||||||
Ken Moffat [email protected]
|
Ken Moffat [email protected]
|
||||||
Kiyoshi Kanazawa [email protected]
|
Kiyoshi Kanazawa [email protected]
|
||||||
Laurent Mascherpa [email protected]
|
Laurent Mascherpa [email protected]
|
||||||
|
László Várady [email protected]
|
||||||
Lie Yan [email protected]
|
Lie Yan [email protected]
|
||||||
Magnus Fromreide [email protected]
|
Magnus Fromreide [email protected]
|
||||||
Marc Autret [email protected]
|
Marc Autret [email protected]
|
||||||
Marc Mendiola [email protected]
|
Marc Mendiola [email protected]
|
||||||
|
Marc Schönefeld [email protected]
|
||||||
Mark Boyall [email protected]
|
Mark Boyall [email protected]
|
||||||
Martin Jacobs [email protected]
|
Martin Jacobs [email protected]
|
||||||
Martin Mokrejs [email protected]
|
Martin Mokrejs [email protected]
|
||||||
@@ -117,6 +121,7 @@ Mike Sullivan [email protected]
|
|||||||
Nate Guerin [email protected]
|
Nate Guerin [email protected]
|
||||||
Neil Booth [email protected]
|
Neil Booth [email protected]
|
||||||
Nelson H. F. Beebe [email protected]
|
Nelson H. F. Beebe [email protected]
|
||||||
|
neok m4700 [email protected]
|
||||||
Nick Bowler [email protected]
|
Nick Bowler [email protected]
|
||||||
Nicolas Bedon [email protected]
|
Nicolas Bedon [email protected]
|
||||||
Nicolas Burrus [email protected]
|
Nicolas Burrus [email protected]
|
||||||
@@ -178,6 +183,7 @@ Tom Tromey [email protected]
|
|||||||
Tommy Nordgren [email protected]
|
Tommy Nordgren [email protected]
|
||||||
Troy A. Johnson [email protected]
|
Troy A. Johnson [email protected]
|
||||||
Tys Lefering [email protected]
|
Tys Lefering [email protected]
|
||||||
|
Uxio Prego [email protected]
|
||||||
Valentin Tolmer [email protected]
|
Valentin Tolmer [email protected]
|
||||||
wcventure [email protected]
|
wcventure [email protected]
|
||||||
Victor Khomenko [email protected]
|
Victor Khomenko [email protected]
|
||||||
@@ -194,6 +200,7 @@ Wwp [email protected]
|
|||||||
xolodho [email protected]
|
xolodho [email protected]
|
||||||
Zack Weinberg [email protected]
|
Zack Weinberg [email protected]
|
||||||
長田偉伸 [email protected]
|
長田偉伸 [email protected]
|
||||||
|
江 祖铭 [email protected]
|
||||||
|
|
||||||
Many people are not named here because we lost track of them. We
|
Many people are not named here because we lost track of them. We
|
||||||
thank them! Please, help us keeping this list up to date.
|
thank them! Please, help us keeping this list up to date.
|
||||||
|
|||||||
+2
-1
@@ -25,7 +25,7 @@ gnulib_modules='
|
|||||||
error extensions fdl fopen-safer
|
error extensions fdl fopen-safer
|
||||||
getopt-gnu
|
getopt-gnu
|
||||||
gettext-h git-version-gen gitlog-to-changelog
|
gettext-h git-version-gen gitlog-to-changelog
|
||||||
gpl-3.0 hash inttypes isnan javacomp-script
|
gpl-3.0 inttypes isnan javacomp-script
|
||||||
javaexec-script
|
javaexec-script
|
||||||
ldexpl
|
ldexpl
|
||||||
libtextstyle-optional
|
libtextstyle-optional
|
||||||
@@ -48,6 +48,7 @@ gnulib_modules='
|
|||||||
xalloc
|
xalloc
|
||||||
xalloc-die
|
xalloc-die
|
||||||
xconcat-filename
|
xconcat-filename
|
||||||
|
xhash
|
||||||
xlist
|
xlist
|
||||||
xmemdup0
|
xmemdup0
|
||||||
xstrndup
|
xstrndup
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ $LEX_IS_FLEX || test "X$LEX" = X: || {
|
|||||||
AC_MSG_WARN([bypassing lex because flex is required])
|
AC_MSG_WARN([bypassing lex because flex is required])
|
||||||
LEX=:
|
LEX=:
|
||||||
}
|
}
|
||||||
|
AM_CONDITIONAL([FLEX_WORKS], [$LEX_IS_FLEX])
|
||||||
AM_CONDITIONAL([FLEX_CXX_WORKS],
|
AM_CONDITIONAL([FLEX_CXX_WORKS],
|
||||||
[$LEX_IS_FLEX && test $bison_cv_cxx_works = yes])
|
[$LEX_IS_FLEX && test $bison_cv_cxx_works = yes])
|
||||||
AC_PROG_YACC
|
AC_PROG_YACC
|
||||||
@@ -296,4 +297,15 @@ AC_SUBST([GCC])
|
|||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
po/Makefile.in
|
po/Makefile.in
|
||||||
doc/yacc.1])
|
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
|
AC_OUTPUT
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/* Default styling rules for Bison when doing terminal output.
|
||||||
|
Copyright (C) 2019 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. */
|
||||||
|
|
||||||
|
.warning { color: purple; }
|
||||||
|
.error { color: red; }
|
||||||
|
.note { color: cyan; }
|
||||||
|
/* Semantic values in Bison's own parser traces. */
|
||||||
|
.value { color: green; }
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
/* CSS style for Bison's diagnostics.
|
|
||||||
|
|
||||||
This is an experimental feature. The class names may change in the
|
|
||||||
future. */
|
|
||||||
|
|
||||||
.warning { color: purple; }
|
|
||||||
.error { color: red; }
|
|
||||||
.note { color: cyan; }
|
|
||||||
/* Semantic values in Bison's parser traces. */
|
|
||||||
.value { color: green; }
|
|
||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
dist_pkgdata_DATA = \
|
dist_pkgdata_DATA = \
|
||||||
data/README.md \
|
data/README.md \
|
||||||
data/diagnostics.css
|
data/bison-default.css
|
||||||
|
|
||||||
skeletonsdir = $(pkgdatadir)/skeletons
|
skeletonsdir = $(pkgdatadir)/skeletons
|
||||||
dist_skeletons_DATA = \
|
dist_skeletons_DATA = \
|
||||||
|
|||||||
@@ -545,7 +545,9 @@ m4_if(b4_skeleton, ["yacc.c"],
|
|||||||
# endif
|
# endif
|
||||||
]])dnl
|
]])dnl
|
||||||
b4_percent_code_get([[pre-printer]])dnl
|
b4_percent_code_get([[pre-printer]])dnl
|
||||||
|
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||||
b4_symbol_actions([printer])
|
b4_symbol_actions([printer])
|
||||||
|
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||||
b4_percent_code_get([[post-printer]])dnl
|
b4_percent_code_get([[post-printer]])dnl
|
||||||
[}
|
[}
|
||||||
|
|
||||||
|
|||||||
@@ -1094,17 +1094,20 @@ yyinitStateSet (yyGLRStateSet* yyset)
|
|||||||
{
|
{
|
||||||
yyset->yysize = 1;
|
yyset->yysize = 1;
|
||||||
yyset->yycapacity = 16;
|
yyset->yycapacity = 16;
|
||||||
yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
|
yyset->yystates
|
||||||
|
= (yyGLRState**) YYMALLOC (yyset->yycapacity * sizeof yyset->yystates[0]);
|
||||||
if (! yyset->yystates)
|
if (! yyset->yystates)
|
||||||
return yyfalse;
|
return yyfalse;
|
||||||
yyset->yystates[0] = YY_NULLPTR;
|
yyset->yystates[0] = YY_NULLPTR;
|
||||||
yyset->yylookaheadNeeds =
|
yyset->yylookaheadNeeds
|
||||||
(yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]);
|
= (yybool*) YYMALLOC (yyset->yycapacity * sizeof yyset->yylookaheadNeeds[0]);
|
||||||
if (! yyset->yylookaheadNeeds)
|
if (! yyset->yylookaheadNeeds)
|
||||||
{
|
{
|
||||||
YYFREE (yyset->yystates);
|
YYFREE (yyset->yystates);
|
||||||
return yyfalse;
|
return yyfalse;
|
||||||
}
|
}
|
||||||
|
memset (yyset->yylookaheadNeeds,
|
||||||
|
0, yyset->yycapacity * sizeof yyset->yylookaheadNeeds[0]);
|
||||||
return yytrue;
|
return yytrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -459,9 +459,6 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
[#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
|
[#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
|
||||||
]b4_yylloc_default_define])[
|
]b4_yylloc_default_define])[
|
||||||
|
|
||||||
// Suppress unused-variable warnings by "using" E.
|
|
||||||
#define YYUSE(E) ((void) (E))
|
|
||||||
|
|
||||||
// Enable debugging if requested.
|
// Enable debugging if requested.
|
||||||
#if ]b4_api_PREFIX[DEBUG
|
#if ]b4_api_PREFIX[DEBUG
|
||||||
|
|
||||||
|
|||||||
+23
-15
@@ -2,10 +2,8 @@
|
|||||||
@comment %**start of header
|
@comment %**start of header
|
||||||
@setfilename bison.info
|
@setfilename bison.info
|
||||||
@documentencoding UTF-8
|
@documentencoding UTF-8
|
||||||
@documentlanguage en
|
|
||||||
@include version.texi
|
@include version.texi
|
||||||
@settitle Bison @value{VERSION}
|
@settitle Bison @value{VERSION}
|
||||||
@setchapternewpage odd
|
|
||||||
|
|
||||||
@tex
|
@tex
|
||||||
\gdef\rgbWarning{0.50 0 0.50}
|
\gdef\rgbWarning{0.50 0 0.50}
|
||||||
@@ -58,6 +56,7 @@
|
|||||||
@c This edition has been formatted so that you can format and print it in
|
@c This edition has been formatted so that you can format and print it in
|
||||||
@c the smallbook format.
|
@c the smallbook format.
|
||||||
@c @smallbook
|
@c @smallbook
|
||||||
|
@c @setchapternewpage odd
|
||||||
|
|
||||||
@c Set following if you want to document %default-prec and %no-default-prec.
|
@c Set following if you want to document %default-prec and %no-default-prec.
|
||||||
@c This feature is experimental and may change in future Bison versions.
|
@c This feature is experimental and may change in future Bison versions.
|
||||||
@@ -11733,15 +11732,21 @@ symbol_type (int token, const int&, const location_type&);
|
|||||||
symbol_type (int token, const location_type&);
|
symbol_type (int token, const location_type&);
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
Correct matching between token types and value types is checked via
|
||||||
which should be used in a Flex-scanner as follows.
|
@code{assert}; for instance, @samp{symbol_type (ID, 42)} would abort. Named
|
||||||
|
constructors are preferable (see below), as they offer better type safety
|
||||||
|
(for instance @samp{make_ID (42)} would not even compile), but symbol_type
|
||||||
|
constructors may help when token types are discovered at run-time, e.g.,
|
||||||
|
|
||||||
@example
|
@example
|
||||||
%%
|
@group
|
||||||
[a-z]+ return yy::parser::symbol_type (TOK_IDENTIFIER, yytext, loc);
|
[a-z]+ @{
|
||||||
[0-9]+ return yy::parser::symbol_type (TOK_INTEGER, text_to_int (yytext), loc);
|
if (auto i = lookup_keyword (yytext))
|
||||||
":" return yy::parser::symbol_type (':', loc);
|
return yy::parser::symbol_type (i, loc);
|
||||||
<<EOF>> return yy::parser::symbol_type (0, loc);
|
else
|
||||||
|
return yy::parser::make_ID (yytext, loc);
|
||||||
|
@}
|
||||||
|
@end group
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@sp 1
|
@sp 1
|
||||||
@@ -12416,8 +12421,8 @@ You can create documentation for generated parsers using Javadoc.
|
|||||||
|
|
||||||
Contrary to C parsers, Java parsers do not use global variables; the state
|
Contrary to C parsers, Java parsers do not use global variables; the state
|
||||||
of the parser is always local to an instance of the parser class.
|
of the parser is always local to an instance of the parser class.
|
||||||
Therefore, all Java parsers are ``pure'', and the @code{%pure-parser} and
|
Therefore, all Java parsers are ``pure'', and the @code{%define api.pure}
|
||||||
@code{%define api.pure} directives do nothing when used in Java.
|
directive does nothing when used in Java.
|
||||||
|
|
||||||
Push parsers are currently unsupported in Java and @code{%define
|
Push parsers are currently unsupported in Java and @code{%define
|
||||||
api.push-pull} have no effect.
|
api.push-pull} have no effect.
|
||||||
@@ -14473,7 +14478,7 @@ London, Department of Computer Science, TR-00-12 (December 2000).
|
|||||||
@c LocalWords: YYENABLE bindtextdomain Makefile DEFS CPPFLAGS DBISON DeRemer
|
@c LocalWords: YYENABLE bindtextdomain Makefile DEFS CPPFLAGS DBISON DeRemer
|
||||||
@c LocalWords: autoreconf Pennello multisets nondeterminism Generalised baz ACM
|
@c LocalWords: autoreconf Pennello multisets nondeterminism Generalised baz ACM
|
||||||
@c LocalWords: redeclare automata Dparse localedir datadir XSLT midrule Wno
|
@c LocalWords: redeclare automata Dparse localedir datadir XSLT midrule Wno
|
||||||
@c LocalWords: multitable headitem hh basename Doxygen fno filename
|
@c LocalWords: multitable headitem hh basename Doxygen fno filename gdef
|
||||||
@c LocalWords: doxygen ival sval deftypemethod deallocate pos deftypemethodx
|
@c LocalWords: doxygen ival sval deftypemethod deallocate pos deftypemethodx
|
||||||
@c LocalWords: Ctor defcv defcvx arg accessors arithmetics CPP ifndef CALCXX
|
@c LocalWords: Ctor defcv defcvx arg accessors arithmetics CPP ifndef CALCXX
|
||||||
@c LocalWords: lexer's calcxx bool LPAREN RPAREN deallocation cerrno climits
|
@c LocalWords: lexer's calcxx bool LPAREN RPAREN deallocation cerrno climits
|
||||||
@@ -14494,14 +14499,17 @@ London, Department of Computer Science, TR-00-12 (December 2000).
|
|||||||
@c LocalWords: errorVerbose subtype subtypes Wmidrule midrule's src rvalues
|
@c LocalWords: errorVerbose subtype subtypes Wmidrule midrule's src rvalues
|
||||||
@c LocalWords: automove evolutions Wother Wconflicts PNG lookaheads Acc sep
|
@c LocalWords: automove evolutions Wother Wconflicts PNG lookaheads Acc sep
|
||||||
@c LocalWords: xsltproc XSL xsl xhtml html num Wprecedence Werror fcaret gv
|
@c LocalWords: xsltproc XSL xsl xhtml html num Wprecedence Werror fcaret gv
|
||||||
@c LocalWords: fdiagnostics setlocale nullptr ast srcdir copyable iff drv
|
@c LocalWords: fdiagnostics setlocale nullptr ast srcdir iff drv rgbWarning
|
||||||
@c LocalWords: deftypefunx pragma Wnull dereference Wdocumentation elif ish
|
@c LocalWords: deftypefunx pragma Wnull dereference Wdocumentation elif ish
|
||||||
@c LocalWords: Wdeprecated Wregister noinput yyloc yypos PODs sstream Wsign
|
@c LocalWords: Wdeprecated Wregister noinput yyloc yypos PODs sstream Wsign
|
||||||
@c LocalWords: typename emplace Wconversion Wshorten yacchack reentrancy
|
@c LocalWords: typename emplace Wconversion Wshorten yacchack reentrancy
|
||||||
@c LocalWords: Relocatability exprs fixit Wyacc parseable fixits ffixit
|
@c LocalWords: Relocatability exprs fixit Wyacc parseable fixits ffixit svg
|
||||||
@c LocalWords: DNDEBUG cstring Wzero workalike POPL workalikes byacc UCB
|
@c LocalWords: DNDEBUG cstring Wzero workalike POPL workalikes byacc UCB
|
||||||
@c LocalWords: Penello's Penello Byson Byson's Corbett's CSD TOPLAS PDP
|
@c LocalWords: Penello's Penello Byson Byson's Corbett's CSD TOPLAS PDP
|
||||||
@c LocalWords: Beazley's goyacc ocamlyacc SIGACT SIGPLAN
|
@c LocalWords: Beazley's goyacc ocamlyacc SIGACT SIGPLAN colorWarning
|
||||||
|
@c LocalWords: setcolor rgbError colorError rgbNotice colorNotice derror
|
||||||
|
@c LocalWords: colorOff maincolor inlineraw darkviolet darkcyan dwarning
|
||||||
|
@c LocalWords: dnotice copyable
|
||||||
|
|
||||||
@c Local Variables:
|
@c Local Variables:
|
||||||
@c ispell-dictionary: "american"
|
@c ispell-dictionary: "american"
|
||||||
|
|||||||
@@ -19,15 +19,17 @@ lexcalcdir = $(docdir)/%D%
|
|||||||
## Calc. ##
|
## Calc. ##
|
||||||
## ------ ##
|
## ------ ##
|
||||||
|
|
||||||
check_PROGRAMS += %D%/lexcalc
|
if FLEX_WORKS
|
||||||
TESTS += %D%/lexcalc.test
|
check_PROGRAMS += %D%/lexcalc
|
||||||
EXTRA_DIST += %D%/lexcalc.test
|
TESTS += %D%/lexcalc.test
|
||||||
nodist_%C%_lexcalc_SOURCES = %D%/parse.y %D%/parse.h %D%/scan.l
|
nodist_%C%_lexcalc_SOURCES = %D%/parse.y %D%/parse.h %D%/scan.l
|
||||||
|
# Don't use gnulib's system headers.
|
||||||
|
%C%_lexcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||||
|
endif FLEX_WORKS
|
||||||
|
|
||||||
%D%/parse.c: $(dependencies)
|
%D%/parse.c: $(dependencies)
|
||||||
|
|
||||||
# Don't use gnulib's system headers.
|
EXTRA_DIST += %D%/lexcalc.test
|
||||||
%C%_lexcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
|
||||||
|
|
||||||
dist_lexcalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md
|
dist_lexcalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md
|
||||||
CLEANFILES += %D%/parse.[ch] %D%/scan.c %D%/parse.output
|
CLEANFILES += %D%/parse.[ch] %D%/scan.c %D%/parse.output
|
||||||
CLEANDIRS += %D%/*.dSYM
|
CLEANDIRS += %D%/*.dSYM
|
||||||
|
|||||||
@@ -19,11 +19,15 @@ reccalcdir = $(docdir)/%D%
|
|||||||
## Calc. ##
|
## Calc. ##
|
||||||
## ------ ##
|
## ------ ##
|
||||||
|
|
||||||
check_PROGRAMS += %D%/reccalc
|
if FLEX_WORKS
|
||||||
TESTS += %D%/reccalc.test
|
check_PROGRAMS += %D%/reccalc
|
||||||
EXTRA_DIST += %D%/reccalc.test %D%/scan.l
|
TESTS += %D%/reccalc.test
|
||||||
nodist_%C%_reccalc_SOURCES = %D%/parse.y %D%/scan.h %D%/scan.c
|
nodist_%C%_reccalc_SOURCES = %D%/parse.y %D%/scan.h %D%/scan.c
|
||||||
BUILT_SOURCES += $(nodist_%C%_reccalc_SOURCES)
|
BUILT_SOURCES += $(nodist_%C%_reccalc_SOURCES)
|
||||||
|
# Don't use gnulib's system headers.
|
||||||
|
%C%_reccalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||||
|
endif FLEX_WORKS
|
||||||
|
|
||||||
%D%/parse.c: $(dependencies)
|
%D%/parse.c: $(dependencies)
|
||||||
|
|
||||||
# Tell Make that parse.o depends on scan.h, so that scan.h is built
|
# Tell Make that parse.o depends on scan.h, so that scan.h is built
|
||||||
@@ -41,12 +45,11 @@ DASH = -
|
|||||||
$(AM_V_LEX)rm -f $@ $@.tmp
|
$(AM_V_LEX)rm -f $@ $@.tmp
|
||||||
$(AM_V_at)$(MKDIR_P) %D%
|
$(AM_V_at)$(MKDIR_P) %D%
|
||||||
$(AM_V_at)touch $@.tmp
|
$(AM_V_at)touch $@.tmp
|
||||||
$(AM_V_at) $(LEX) -o %D%/scan.c --header-file=%D%/scan.h $<
|
$(AM_V_at)$(LEX) -o%D%/scan.c --header-file=%D%/scan.h $(srcdir)/%D%/scan.l
|
||||||
$(AM_V_at)mv $@.tmp $@
|
$(AM_V_at)mv $@.tmp $@
|
||||||
|
|
||||||
# Don't use gnulib's system headers.
|
|
||||||
%C%_reccalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
|
||||||
|
|
||||||
|
EXTRA_DIST += %D%/reccalc.test %D%/scan.l
|
||||||
dist_reccalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md
|
dist_reccalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md
|
||||||
CLEANFILES += %D%/parse.[ch] %D%/parse.output %D%/scan.[ch] %D%/*.stamp
|
CLEANFILES += %D%/parse.[ch] %D%/parse.output %D%/scan.[ch] %D%/*.stamp
|
||||||
CLEANDIRS += %D%/*.dSYM
|
CLEANDIRS += %D%/*.dSYM
|
||||||
|
|||||||
+2
-2
@@ -27,10 +27,10 @@ EXTRA_DIST += %D%/calc.test
|
|||||||
|
|
||||||
%D%/calc.d: %D%/calc.y $(dependencies)
|
%D%/calc.d: %D%/calc.y $(dependencies)
|
||||||
$(AM_V_GEN)$(MKDIR_P) %D%
|
$(AM_V_GEN)$(MKDIR_P) %D%
|
||||||
$(AM_V_at)$(BISON) $< -o $@
|
$(AM_V_at)$(BISON) $(srcdir)/%D%/calc.y -o $@
|
||||||
|
|
||||||
%D%/calc: %D%/calc.d
|
%D%/calc: %D%/calc.d
|
||||||
$(AM_V_GEN) $(DC) $(DCFLAGS) -of$@ $<
|
$(AM_V_GEN) $(DC) $(DCFLAGS) -of$@ %D%/calc.d
|
||||||
|
|
||||||
dist_d_DATA = %D%/calc.y %D%/Makefile %D%/README.md
|
dist_d_DATA = %D%/calc.y %D%/Makefile %D%/README.md
|
||||||
CLEANFILES += %D%/calc %D%/calc.[do]
|
CLEANFILES += %D%/calc %D%/calc.[do]
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ EXTRA_DIST += %D%/Calc.test
|
|||||||
|
|
||||||
%D%/Calc.java: %D%/Calc.y $(dependencies)
|
%D%/Calc.java: %D%/Calc.y $(dependencies)
|
||||||
$(AM_V_GEN)$(MKDIR_P) %D%
|
$(AM_V_GEN)$(MKDIR_P) %D%
|
||||||
$(AM_V_at)$(BISON) $< -o $@
|
$(AM_V_at)$(BISON) $(srcdir)/%D%/Calc.y -o $@
|
||||||
|
|
||||||
%D%/Calc.class: %D%/Calc.java
|
%D%/Calc.class: %D%/Calc.java
|
||||||
$(AM_V_GEN) $(SHELL) $(top_builddir)/javacomp.sh $<
|
$(AM_V_GEN) $(SHELL) $(top_builddir)/javacomp.sh %D%/Calc.java
|
||||||
|
|
||||||
dist_java_DATA = %D%/Calc.y %D%/Makefile %D%/README.md
|
dist_java_DATA = %D%/Calc.y %D%/Makefile %D%/README.md
|
||||||
CLEANFILES += %D%/*.class %D%/Calc.java
|
CLEANFILES += %D%/*.class %D%/Calc.java
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@
|
|||||||
## which guarantees that parse.y is indeed shipped.
|
## which guarantees that parse.y is indeed shipped.
|
||||||
|
|
||||||
dist_noinst_SCRIPTS = %D%/extexi %D%/test
|
dist_noinst_SCRIPTS = %D%/extexi %D%/test
|
||||||
TEST_LOG_COMPILER = $(top_srcdir)/%D%/test
|
TEST_LOG_COMPILER = $(SHELL) $(top_srcdir)/%D%/test
|
||||||
|
|
||||||
AM_CXXFLAGS = \
|
AM_CXXFLAGS = \
|
||||||
$(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
|
$(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
|
||||||
|
|||||||
+1
-1
Submodule gnulib updated: 03752516b2...672663aca3
@@ -1,9 +1,12 @@
|
|||||||
/*.gmo
|
/*.gmo
|
||||||
/*.po
|
/*.po
|
||||||
/LINGUAS
|
/LINGUAS
|
||||||
|
/Makefile
|
||||||
|
/Makefile.in
|
||||||
/Makefile.in.in
|
/Makefile.in.in
|
||||||
/Makevars
|
/Makevars
|
||||||
/Makevars.template
|
/Makevars.template
|
||||||
|
/POTFILES
|
||||||
/POTFILES.in
|
/POTFILES.in
|
||||||
/Rules-quot
|
/Rules-quot
|
||||||
/bison-gnulib.pot
|
/bison-gnulib.pot
|
||||||
|
|||||||
@@ -321,3 +321,4 @@
|
|||||||
/assure.h
|
/assure.h
|
||||||
/fsync.c
|
/fsync.c
|
||||||
/textstyle.in.h
|
/textstyle.in.h
|
||||||
|
/xhash.c
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ m4_define([_BISON_CXXSTD_11_snippet],
|
|||||||
for (int r: std::set<int>{1, 2})
|
for (int r: std::set<int>{1, 2})
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GCC 4.8.2 on Solaris 11.3 does not support to_string.
|
||||||
|
auto e = std::to_string(42);
|
||||||
])
|
])
|
||||||
|
|
||||||
m4_define([_BISON_CXXSTD_14_snippet],
|
m4_define([_BISON_CXXSTD_14_snippet],
|
||||||
|
|||||||
+18
-22
@@ -63,8 +63,6 @@ typedef enum
|
|||||||
/** For each warning type, its severity. */
|
/** For each warning type, its severity. */
|
||||||
static severity warnings_flag[warnings_size];
|
static severity warnings_flag[warnings_size];
|
||||||
|
|
||||||
static unsigned *indent_ptr = NULL;
|
|
||||||
|
|
||||||
styled_ostream_t errstream = NULL;
|
styled_ostream_t errstream = NULL;
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -255,14 +253,13 @@ complain_init_color (void)
|
|||||||
|| color_mode == color_html
|
|| color_mode == color_html
|
||||||
|| (color_mode == color_tty && isatty (STDERR_FILENO)))
|
|| (color_mode == color_tty && isatty (STDERR_FILENO)))
|
||||||
{
|
{
|
||||||
style_file_prepare ("BISON_DIAGNOSTICS_STYLE", NULL,
|
style_file_prepare ("BISON_STYLE", "BISON_STYLEDIR", pkgdatadir (),
|
||||||
pkgdatadir (),
|
"bison-default.css");
|
||||||
"diagnostics.css");
|
|
||||||
/* As a fallback, use the default in the current directory. */
|
/* As a fallback, use the default in the current directory. */
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
if ((style_file_name == NULL || stat (style_file_name, &statbuf) < 0)
|
if ((style_file_name == NULL || stat (style_file_name, &statbuf) < 0)
|
||||||
&& stat ("diagnostics.css", &statbuf) == 0)
|
&& stat ("bison-default.css", &statbuf) == 0)
|
||||||
style_file_name = "diagnostics.css";
|
style_file_name = "bison-default.css";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* No styling. */
|
/* No styling. */
|
||||||
@@ -387,6 +384,7 @@ warnings_print_categories (warnings warn_flags, FILE *out)
|
|||||||
*
|
*
|
||||||
* \param loc the location, defaulting to the current file,
|
* \param loc the location, defaulting to the current file,
|
||||||
* or the program name.
|
* or the program name.
|
||||||
|
* \param indent optional indentation for the error message.
|
||||||
* \param flags the category for this message.
|
* \param flags the category for this message.
|
||||||
* \param sever to decide the prefix to put before the message
|
* \param sever to decide the prefix to put before the message
|
||||||
* (e.g., "warning").
|
* (e.g., "warning").
|
||||||
@@ -398,8 +396,8 @@ warnings_print_categories (warnings warn_flags, FILE *out)
|
|||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
error_message (const location *loc, warnings flags, severity sever,
|
error_message (const location *loc, unsigned *indent, warnings flags,
|
||||||
const char *message, va_list args)
|
severity sever, const char *message, va_list args)
|
||||||
{
|
{
|
||||||
unsigned pos = 0;
|
unsigned pos = 0;
|
||||||
|
|
||||||
@@ -409,15 +407,14 @@ error_message (const location *loc, warnings flags, severity sever,
|
|||||||
pos += fprintf (stderr, "%s", current_file ? current_file : program_name);
|
pos += fprintf (stderr, "%s", current_file ? current_file : program_name);
|
||||||
pos += fprintf (stderr, ": ");
|
pos += fprintf (stderr, ": ");
|
||||||
|
|
||||||
if (indent_ptr)
|
if (indent)
|
||||||
{
|
{
|
||||||
if (*indent_ptr)
|
if (*indent)
|
||||||
sever = severity_disabled;
|
sever = severity_disabled;
|
||||||
if (!*indent_ptr)
|
if (!*indent)
|
||||||
*indent_ptr = pos;
|
*indent = pos;
|
||||||
else if (*indent_ptr > pos)
|
else if (*indent > pos)
|
||||||
fprintf (stderr, "%*s", *indent_ptr - pos, "");
|
fprintf (stderr, "%*s", *indent - pos, "");
|
||||||
indent_ptr = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* style = severity_style (sever);
|
const char* style = severity_style (sever);
|
||||||
@@ -452,8 +449,8 @@ error_message (const location *loc, warnings flags, severity sever,
|
|||||||
/** Raise a complaint (fatal error, error or just warning). */
|
/** Raise a complaint (fatal error, error or just warning). */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
complains (const location *loc, warnings flags, const char *message,
|
complains (const location *loc, unsigned *indent, warnings flags,
|
||||||
va_list args)
|
const char *message, va_list args)
|
||||||
{
|
{
|
||||||
severity s = warning_severity (flags);
|
severity s = warning_severity (flags);
|
||||||
if ((flags & complaint) && complaint_status < status_complaint)
|
if ((flags & complaint) && complaint_status < status_complaint)
|
||||||
@@ -463,7 +460,7 @@ complains (const location *loc, warnings flags, const char *message,
|
|||||||
{
|
{
|
||||||
if (severity_error <= s && ! complaint_status)
|
if (severity_error <= s && ! complaint_status)
|
||||||
complaint_status = status_warning_as_error;
|
complaint_status = status_warning_as_error;
|
||||||
error_message (loc, flags, s, message, args);
|
error_message (loc, indent, flags, s, message, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & fatal)
|
if (flags & fatal)
|
||||||
@@ -475,7 +472,7 @@ complain (location const *loc, warnings flags, const char *message, ...)
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start (args, message);
|
va_start (args, message);
|
||||||
complains (loc, flags, message, args);
|
complains (loc, NULL, flags, message, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -484,9 +481,8 @@ complain_indent (location const *loc, warnings flags, unsigned *indent,
|
|||||||
const char *message, ...)
|
const char *message, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
indent_ptr = indent;
|
|
||||||
va_start (args, message);
|
va_start (args, message);
|
||||||
complains (loc, flags, message, args);
|
complains (loc, indent, flags, message, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+42
-25
@@ -229,7 +229,13 @@ location_caret (location loc, const char *style, FILE *out)
|
|||||||
|
|
||||||
/* Advance to the line's position, keeping track of the offset. */
|
/* Advance to the line's position, keeping track of the offset. */
|
||||||
while (caret_info.line < loc.start.line)
|
while (caret_info.line < loc.start.line)
|
||||||
caret_info.line += getc (caret_info.source) == '\n';
|
{
|
||||||
|
int c = getc (caret_info.source);
|
||||||
|
if (c == EOF)
|
||||||
|
/* Something is wrong, that line number does not exist. */
|
||||||
|
return;
|
||||||
|
caret_info.line += c == '\n';
|
||||||
|
}
|
||||||
caret_info.offset = ftell (caret_info.source);
|
caret_info.offset = ftell (caret_info.source);
|
||||||
|
|
||||||
/* Read the actual line. Don't update the offset, so that we keep a pointer
|
/* Read the actual line. Don't update the offset, so that we keep a pointer
|
||||||
@@ -238,32 +244,43 @@ location_caret (location loc, const char *style, FILE *out)
|
|||||||
int c = getc (caret_info.source);
|
int c = getc (caret_info.source);
|
||||||
if (c != EOF)
|
if (c != EOF)
|
||||||
{
|
{
|
||||||
|
bool single_line = loc.start.line == loc.end.line;
|
||||||
/* Quote the file (at most the first line in the case of
|
/* Quote the file (at most the first line in the case of
|
||||||
multiline locations). */
|
multiline locations). */
|
||||||
fprintf (out, "%5d | ", loc.start.line);
|
|
||||||
bool single_line = loc.start.line == loc.end.line;
|
|
||||||
/* Consider that single point location (with equal boundaries)
|
|
||||||
actually denote the character that they follow. */
|
|
||||||
int byte_end = loc.end.byte +
|
|
||||||
(single_line && loc.start.byte == loc.end.byte);
|
|
||||||
/* Byte number. */
|
|
||||||
int byte = 1;
|
|
||||||
while (c != EOF && c != '\n')
|
|
||||||
{
|
|
||||||
if (byte == loc.start.byte)
|
|
||||||
begin_use_class (style, out);
|
|
||||||
fputc (c, out);
|
|
||||||
c = getc (caret_info.source);
|
|
||||||
++byte;
|
|
||||||
if (single_line
|
|
||||||
? byte == byte_end
|
|
||||||
: c == '\n' || c == EOF)
|
|
||||||
end_use_class (style, out);
|
|
||||||
}
|
|
||||||
putc ('\n', out);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
/* Print the carets with the same indentation as above. */
|
fprintf (out, "%5d | ", loc.start.line);
|
||||||
|
/* Consider that single point location (with equal boundaries)
|
||||||
|
actually denote the character that they follow. */
|
||||||
|
int byte_end = loc.end.byte +
|
||||||
|
(single_line && loc.start.byte == loc.end.byte);
|
||||||
|
/* Byte number. */
|
||||||
|
int byte = 1;
|
||||||
|
/* Whether we opened the style. If the line is not as
|
||||||
|
expected (maybe the file was changed since the scanner
|
||||||
|
ran), we might reach the end before we actually saw the
|
||||||
|
opening column. */
|
||||||
|
bool opened = false;
|
||||||
|
while (c != EOF && c != '\n')
|
||||||
|
{
|
||||||
|
if (byte == loc.start.byte)
|
||||||
|
{
|
||||||
|
begin_use_class (style, out);
|
||||||
|
opened = true;
|
||||||
|
}
|
||||||
|
fputc (c, out);
|
||||||
|
c = getc (caret_info.source);
|
||||||
|
++byte;
|
||||||
|
if (opened
|
||||||
|
&& (single_line
|
||||||
|
? byte == byte_end
|
||||||
|
: c == '\n' || c == EOF))
|
||||||
|
end_use_class (style, out);
|
||||||
|
}
|
||||||
|
putc ('\n', out);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Print the carets with the same indentation as above. */
|
||||||
|
{
|
||||||
fprintf (out, " | %*s", loc.start.column - 1, "");
|
fprintf (out, " | %*s", loc.start.column - 1, "");
|
||||||
begin_use_class (style, out);
|
begin_use_class (style, out);
|
||||||
putc ('^', out);
|
putc ('^', out);
|
||||||
@@ -275,8 +292,8 @@ location_caret (location loc, const char *style, FILE *out)
|
|||||||
for (int i = loc.start.column + 1; i < len; ++i)
|
for (int i = loc.start.column + 1; i < len; ++i)
|
||||||
putc ('~', out);
|
putc ('~', out);
|
||||||
end_use_class (style, out);
|
end_use_class (style, out);
|
||||||
|
putc ('\n', out);
|
||||||
}
|
}
|
||||||
putc ('\n', out);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -126,8 +126,8 @@ muscle_init (void)
|
|||||||
/* Initialize the muscle obstack. */
|
/* Initialize the muscle obstack. */
|
||||||
obstack_init (&muscle_obstack);
|
obstack_init (&muscle_obstack);
|
||||||
|
|
||||||
muscle_table = hash_initialize (HT_INITIAL_CAPACITY, NULL, hash_muscle,
|
muscle_table = hash_xinitialize (HT_INITIAL_CAPACITY, NULL, hash_muscle,
|
||||||
hash_compare_muscles, muscle_entry_free);
|
hash_compare_muscles, muscle_entry_free);
|
||||||
|
|
||||||
/* Version and input file. */
|
/* Version and input file. */
|
||||||
MUSCLE_INSERT_STRING ("version", VERSION);
|
MUSCLE_INSERT_STRING ("version", VERSION);
|
||||||
|
|||||||
+364
-338
File diff suppressed because it is too large
Load Diff
+37
-34
@@ -1,4 +1,4 @@
|
|||||||
/* A Bison parser, made by GNU Bison 3.3.2.153-f5a4-dirty. */
|
/* A Bison parser, made by GNU Bison 3.4.1.26-d17af. */
|
||||||
|
|
||||||
/* Bison interface for Yacc-like parsers in C
|
/* Bison interface for Yacc-like parsers in C
|
||||||
|
|
||||||
@@ -108,32 +108,33 @@ extern int gram_debug;
|
|||||||
PERCENT_NO_LINES = 285,
|
PERCENT_NO_LINES = 285,
|
||||||
PERCENT_NONDETERMINISTIC_PARSER = 286,
|
PERCENT_NONDETERMINISTIC_PARSER = 286,
|
||||||
PERCENT_OUTPUT = 287,
|
PERCENT_OUTPUT = 287,
|
||||||
PERCENT_REQUIRE = 288,
|
PERCENT_PURE_PARSER = 288,
|
||||||
PERCENT_SKELETON = 289,
|
PERCENT_REQUIRE = 289,
|
||||||
PERCENT_START = 290,
|
PERCENT_SKELETON = 290,
|
||||||
PERCENT_TOKEN_TABLE = 291,
|
PERCENT_START = 291,
|
||||||
PERCENT_VERBOSE = 292,
|
PERCENT_TOKEN_TABLE = 292,
|
||||||
PERCENT_YACC = 293,
|
PERCENT_VERBOSE = 293,
|
||||||
BRACED_CODE = 294,
|
PERCENT_YACC = 294,
|
||||||
BRACED_PREDICATE = 295,
|
BRACED_CODE = 295,
|
||||||
BRACKETED_ID = 296,
|
BRACED_PREDICATE = 296,
|
||||||
CHAR = 297,
|
BRACKETED_ID = 297,
|
||||||
COLON = 298,
|
CHAR = 298,
|
||||||
EPILOGUE = 299,
|
COLON = 299,
|
||||||
EQUAL = 300,
|
EPILOGUE = 300,
|
||||||
ID = 301,
|
EQUAL = 301,
|
||||||
ID_COLON = 302,
|
ID = 302,
|
||||||
PERCENT_PERCENT = 303,
|
ID_COLON = 303,
|
||||||
PIPE = 304,
|
PERCENT_PERCENT = 304,
|
||||||
PROLOGUE = 305,
|
PIPE = 305,
|
||||||
SEMICOLON = 306,
|
PROLOGUE = 306,
|
||||||
TAG = 307,
|
SEMICOLON = 307,
|
||||||
TAG_ANY = 308,
|
TAG = 308,
|
||||||
TAG_NONE = 309,
|
TAG_ANY = 309,
|
||||||
INT = 310,
|
TAG_NONE = 310,
|
||||||
PERCENT_PARAM = 311,
|
INT = 311,
|
||||||
PERCENT_UNION = 312,
|
PERCENT_PARAM = 312,
|
||||||
PERCENT_EMPTY = 313
|
PERCENT_UNION = 313,
|
||||||
|
PERCENT_EMPTY = 314
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -159,9 +160,9 @@ union GRAM_STYPE
|
|||||||
/* "integer" */
|
/* "integer" */
|
||||||
int INT;
|
int INT;
|
||||||
/* int.opt */
|
/* int.opt */
|
||||||
int yytype_80;
|
int yytype_81;
|
||||||
/* named_ref.opt */
|
/* named_ref.opt */
|
||||||
named_ref* yytype_92;
|
named_ref* yytype_93;
|
||||||
/* "%param" */
|
/* "%param" */
|
||||||
param_type PERCENT_PARAM;
|
param_type PERCENT_PARAM;
|
||||||
/* token_decl */
|
/* token_decl */
|
||||||
@@ -177,7 +178,7 @@ union GRAM_STYPE
|
|||||||
/* string_as_id */
|
/* string_as_id */
|
||||||
symbol* string_as_id;
|
symbol* string_as_id;
|
||||||
/* string_as_id.opt */
|
/* string_as_id.opt */
|
||||||
symbol* yytype_99;
|
symbol* yytype_100;
|
||||||
/* generic_symlist */
|
/* generic_symlist */
|
||||||
symbol_list* generic_symlist;
|
symbol_list* generic_symlist;
|
||||||
/* generic_symlist_item */
|
/* generic_symlist_item */
|
||||||
@@ -187,15 +188,15 @@ union GRAM_STYPE
|
|||||||
/* token_decls */
|
/* token_decls */
|
||||||
symbol_list* token_decls;
|
symbol_list* token_decls;
|
||||||
/* token_decl.1 */
|
/* token_decl.1 */
|
||||||
symbol_list* yytype_78;
|
symbol_list* yytype_79;
|
||||||
/* token_decls_for_prec */
|
/* token_decls_for_prec */
|
||||||
symbol_list* token_decls_for_prec;
|
symbol_list* token_decls_for_prec;
|
||||||
/* token_decl_for_prec.1 */
|
/* token_decl_for_prec.1 */
|
||||||
symbol_list* yytype_82;
|
symbol_list* yytype_83;
|
||||||
/* symbol_decls */
|
/* symbol_decls */
|
||||||
symbol_list* symbol_decls;
|
symbol_list* symbol_decls;
|
||||||
/* symbol_decl.1 */
|
/* symbol_decl.1 */
|
||||||
symbol_list* yytype_85;
|
symbol_list* yytype_86;
|
||||||
/* "%error-verbose" */
|
/* "%error-verbose" */
|
||||||
uniqstr PERCENT_ERROR_VERBOSE;
|
uniqstr PERCENT_ERROR_VERBOSE;
|
||||||
/* "%<flag>" */
|
/* "%<flag>" */
|
||||||
@@ -204,6 +205,8 @@ union GRAM_STYPE
|
|||||||
uniqstr PERCENT_FILE_PREFIX;
|
uniqstr PERCENT_FILE_PREFIX;
|
||||||
/* "%name-prefix" */
|
/* "%name-prefix" */
|
||||||
uniqstr PERCENT_NAME_PREFIX;
|
uniqstr PERCENT_NAME_PREFIX;
|
||||||
|
/* "%pure-parser" */
|
||||||
|
uniqstr PERCENT_PURE_PARSER;
|
||||||
/* "%yacc" */
|
/* "%yacc" */
|
||||||
uniqstr PERCENT_YACC;
|
uniqstr PERCENT_YACC;
|
||||||
/* "[identifier]" */
|
/* "[identifier]" */
|
||||||
@@ -215,7 +218,7 @@ union GRAM_STYPE
|
|||||||
/* "<tag>" */
|
/* "<tag>" */
|
||||||
uniqstr TAG;
|
uniqstr TAG;
|
||||||
/* tag.opt */
|
/* tag.opt */
|
||||||
uniqstr yytype_72;
|
uniqstr yytype_73;
|
||||||
/* tag */
|
/* tag */
|
||||||
uniqstr tag;
|
uniqstr tag;
|
||||||
/* variable */
|
/* variable */
|
||||||
|
|||||||
+19
-1
@@ -94,6 +94,9 @@
|
|||||||
static void handle_name_prefix (location const *loc,
|
static void handle_name_prefix (location const *loc,
|
||||||
char const *directive, char const *value);
|
char const *directive, char const *value);
|
||||||
|
|
||||||
|
/* Handle a %pure-parser directive. */
|
||||||
|
static void handle_pure_parser (location const *loc, char const *directive);
|
||||||
|
|
||||||
/* Handle a %require directive. */
|
/* Handle a %require directive. */
|
||||||
static void handle_require (location const *loc, char const *version);
|
static void handle_require (location const *loc, char const *version);
|
||||||
|
|
||||||
@@ -181,6 +184,7 @@
|
|||||||
PERCENT_NONDETERMINISTIC_PARSER
|
PERCENT_NONDETERMINISTIC_PARSER
|
||||||
"%nondeterministic-parser"
|
"%nondeterministic-parser"
|
||||||
PERCENT_OUTPUT "%output"
|
PERCENT_OUTPUT "%output"
|
||||||
|
PERCENT_PURE_PARSER "%pure-parser"
|
||||||
PERCENT_REQUIRE "%require"
|
PERCENT_REQUIRE "%require"
|
||||||
PERCENT_SKELETON "%skeleton"
|
PERCENT_SKELETON "%skeleton"
|
||||||
PERCENT_START "%start"
|
PERCENT_START "%start"
|
||||||
@@ -219,7 +223,7 @@
|
|||||||
%type <uniqstr>
|
%type <uniqstr>
|
||||||
BRACKETED_ID ID ID_COLON
|
BRACKETED_ID ID ID_COLON
|
||||||
PERCENT_ERROR_VERBOSE PERCENT_FILE_PREFIX PERCENT_FLAG PERCENT_NAME_PREFIX
|
PERCENT_ERROR_VERBOSE PERCENT_FILE_PREFIX PERCENT_FLAG PERCENT_NAME_PREFIX
|
||||||
PERCENT_YACC
|
PERCENT_PURE_PARSER PERCENT_YACC
|
||||||
TAG tag tag.opt variable
|
TAG tag tag.opt variable
|
||||||
%printer { fputs ($$, yyo); } <uniqstr>
|
%printer { fputs ($$, yyo); } <uniqstr>
|
||||||
%printer { fprintf (yyo, "[%s]", $$); } BRACKETED_ID
|
%printer { fprintf (yyo, "[%s]", $$); } BRACKETED_ID
|
||||||
@@ -343,6 +347,7 @@ prologue_declaration:
|
|||||||
| "%nondeterministic-parser" { nondeterministic_parser = true; }
|
| "%nondeterministic-parser" { nondeterministic_parser = true; }
|
||||||
| "%output" STRING { spec_outfile = $2; }
|
| "%output" STRING { spec_outfile = $2; }
|
||||||
| "%param" { current_param = $1; } params { current_param = param_none; }
|
| "%param" { current_param = $1; } params { current_param = param_none; }
|
||||||
|
| "%pure-parser" { handle_pure_parser (&@$, $1); }
|
||||||
| "%require" STRING { handle_require (&@2, $2); }
|
| "%require" STRING { handle_require (&@2, $2); }
|
||||||
| "%skeleton" STRING { handle_skeleton (&@2, $2); }
|
| "%skeleton" STRING { handle_skeleton (&@2, $2); }
|
||||||
| "%token-table" { token_table_flag = true; }
|
| "%token-table" { token_table_flag = true; }
|
||||||
@@ -910,6 +915,7 @@ handle_file_prefix (location const *loc,
|
|||||||
deprecated_directive (dir_loc, directive, "%file-prefix");
|
deprecated_directive (dir_loc, directive, "%file-prefix");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_name_prefix (location const *loc,
|
handle_name_prefix (location const *loc,
|
||||||
char const *directive, char const *value)
|
char const *directive, char const *value)
|
||||||
@@ -944,6 +950,16 @@ handle_name_prefix (location const *loc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
handle_pure_parser (location const *loc, char const *directive)
|
||||||
|
{
|
||||||
|
bison_directive (loc, directive);
|
||||||
|
deprecated_directive (loc, directive, "%define api.pure");
|
||||||
|
muscle_percent_define_insert ("api.pure", *loc, muscle_keyword, "",
|
||||||
|
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_require (location const *loc, char const *version)
|
handle_require (location const *loc, char const *version)
|
||||||
{
|
{
|
||||||
@@ -1006,6 +1022,7 @@ handle_skeleton (location const *loc, char const *skel)
|
|||||||
skeleton_arg (skeleton_user, grammar_prio, *loc);
|
skeleton_arg (skeleton_user, grammar_prio, *loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_yacc (location const *loc, char const *directive)
|
handle_yacc (location const *loc, char const *directive)
|
||||||
{
|
{
|
||||||
@@ -1026,6 +1043,7 @@ handle_yacc (location const *loc, char const *directive)
|
|||||||
deprecated_directive (loc, directive, "%fixed-output-files");
|
deprecated_directive (loc, directive, "%fixed-output-files");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gram_error (location const *loc, char const *msg)
|
gram_error (location const *loc, char const *msg)
|
||||||
{
|
{
|
||||||
|
|||||||
+4
-2
@@ -252,7 +252,6 @@ eqopt ({sp}=)?
|
|||||||
"%prec" return PERCENT_PREC;
|
"%prec" return PERCENT_PREC;
|
||||||
"%precedence" return BISON_DIRECTIVE (PRECEDENCE);
|
"%precedence" return BISON_DIRECTIVE (PRECEDENCE);
|
||||||
"%printer" return BISON_DIRECTIVE (PRINTER);
|
"%printer" return BISON_DIRECTIVE (PRINTER);
|
||||||
"%pure-parser" RETURN_PERCENT_FLAG ("api.pure");
|
|
||||||
"%require" return BISON_DIRECTIVE (REQUIRE);
|
"%require" return BISON_DIRECTIVE (REQUIRE);
|
||||||
"%right" return PERCENT_RIGHT;
|
"%right" return PERCENT_RIGHT;
|
||||||
"%skeleton" return BISON_DIRECTIVE (SKELETON);
|
"%skeleton" return BISON_DIRECTIVE (SKELETON);
|
||||||
@@ -265,6 +264,10 @@ eqopt ({sp}=)?
|
|||||||
"%verbose" return BISON_DIRECTIVE (VERBOSE);
|
"%verbose" return BISON_DIRECTIVE (VERBOSE);
|
||||||
"%yacc" RETURN_VALUE (PERCENT_YACC, uniqstr_new (yytext));
|
"%yacc" RETURN_VALUE (PERCENT_YACC, uniqstr_new (yytext));
|
||||||
|
|
||||||
|
/* Deprecated since Bison 2.3b (2008-05-27), but the warning is
|
||||||
|
issued only since Bison 3.4. */
|
||||||
|
"%pure"[-_]"parser" RETURN_VALUE (PERCENT_PURE_PARSER, uniqstr_new (yytext));
|
||||||
|
|
||||||
/* Deprecated since Bison 3.0 (2013-07-25), but the warning is
|
/* Deprecated since Bison 3.0 (2013-07-25), but the warning is
|
||||||
issued only since Bison 3.3. */
|
issued only since Bison 3.3. */
|
||||||
"%error-verbose" RETURN_VALUE (PERCENT_ERROR_VERBOSE, uniqstr_new (yytext));
|
"%error-verbose" RETURN_VALUE (PERCENT_ERROR_VERBOSE, uniqstr_new (yytext));
|
||||||
@@ -282,7 +285,6 @@ eqopt ({sp}=)?
|
|||||||
"%no"[-_]"default"[-_]"prec" DEPRECATED ("%no-default-prec");
|
"%no"[-_]"default"[-_]"prec" DEPRECATED ("%no-default-prec");
|
||||||
"%no"[-_]"lines" DEPRECATED ("%no-lines");
|
"%no"[-_]"lines" DEPRECATED ("%no-lines");
|
||||||
"%output"{eqopt} DEPRECATED ("%output");
|
"%output"{eqopt} DEPRECATED ("%output");
|
||||||
"%pure"[-_]"parser" DEPRECATED ("%pure-parser");
|
|
||||||
"%token"[-_]"table" DEPRECATED ("%token-table");
|
"%token"[-_]"table" DEPRECATED ("%token-table");
|
||||||
|
|
||||||
"%"{id} {
|
"%"{id} {
|
||||||
|
|||||||
+5
-5
@@ -359,11 +359,11 @@ state_hasher (void const *s, size_t tablesize)
|
|||||||
void
|
void
|
||||||
state_hash_new (void)
|
state_hash_new (void)
|
||||||
{
|
{
|
||||||
state_table = hash_initialize (HT_INITIAL_CAPACITY,
|
state_table = hash_xinitialize (HT_INITIAL_CAPACITY,
|
||||||
NULL,
|
NULL,
|
||||||
state_hasher,
|
state_hasher,
|
||||||
state_comparator,
|
state_comparator,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+18
-12
@@ -462,7 +462,13 @@ symbol_class_set (symbol *sym, symbol_class class, location loc, bool declaring)
|
|||||||
if (declaring)
|
if (declaring)
|
||||||
{
|
{
|
||||||
if (s->status == declared)
|
if (s->status == declared)
|
||||||
complain (&loc, Wother, _("symbol %s redeclared"), sym->tag);
|
{
|
||||||
|
unsigned i = 0;
|
||||||
|
complain (&loc, Wother, _("symbol %s redeclared"), sym->tag);
|
||||||
|
i += SUB_INDENT;
|
||||||
|
complain_indent (&sym->location, Wother, &i,
|
||||||
|
_("previous declaration"));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
s->status = declared;
|
s->status = declared;
|
||||||
}
|
}
|
||||||
@@ -489,7 +495,7 @@ symbol_user_token_number_set (symbol *sym, int user_token_number, location loc)
|
|||||||
{
|
{
|
||||||
*user_token_numberp = user_token_number;
|
*user_token_numberp = user_token_number;
|
||||||
/* User defined $end token? */
|
/* User defined $end token? */
|
||||||
if (user_token_number == 0)
|
if (user_token_number == 0 && !endtoken)
|
||||||
{
|
{
|
||||||
endtoken = sym->content->symbol;
|
endtoken = sym->content->symbol;
|
||||||
/* It is always mapped to 0, so it was already counted in
|
/* It is always mapped to 0, so it was already counted in
|
||||||
@@ -773,16 +779,16 @@ hash_semantic_type_hasher (void const *m, size_t tablesize)
|
|||||||
void
|
void
|
||||||
symbols_new (void)
|
symbols_new (void)
|
||||||
{
|
{
|
||||||
symbol_table = hash_initialize (HT_INITIAL_CAPACITY,
|
symbol_table = hash_xinitialize (HT_INITIAL_CAPACITY,
|
||||||
NULL,
|
NULL,
|
||||||
hash_symbol_hasher,
|
hash_symbol_hasher,
|
||||||
hash_symbol_comparator,
|
hash_symbol_comparator,
|
||||||
symbol_free);
|
symbol_free);
|
||||||
semantic_type_table = hash_initialize (HT_INITIAL_CAPACITY,
|
semantic_type_table = hash_xinitialize (HT_INITIAL_CAPACITY,
|
||||||
NULL,
|
NULL,
|
||||||
hash_semantic_type_hasher,
|
hash_semantic_type_hasher,
|
||||||
hash_semantic_type_comparator,
|
hash_semantic_type_comparator,
|
||||||
free);
|
free);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -157,11 +157,11 @@ hash_uniqstr (void const *m, size_t tablesize)
|
|||||||
void
|
void
|
||||||
uniqstrs_new (void)
|
uniqstrs_new (void)
|
||||||
{
|
{
|
||||||
uniqstrs_table = hash_initialize (HT_INITIAL_CAPACITY,
|
uniqstrs_table = hash_xinitialize (HT_INITIAL_CAPACITY,
|
||||||
NULL,
|
NULL,
|
||||||
hash_uniqstr,
|
hash_uniqstr,
|
||||||
hash_compare_uniqstr,
|
hash_compare_uniqstr,
|
||||||
free);
|
free);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1870,7 +1870,7 @@ AT_DATA_GRAMMAR([input.y],
|
|||||||
[[
|
[[
|
||||||
%define parse.error verbose
|
%define parse.error verbose
|
||||||
%debug
|
%debug
|
||||||
%pure-parser
|
%define api.pure
|
||||||
%code {
|
%code {
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
|
|||||||
+1
-1
@@ -313,7 +313,7 @@ AT_DATA_GRAMMAR([list.y],
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined __cplusplus && 201103L <= __cplusplus
|
#if defined __cplusplus && 201103L <= __cplusplus
|
||||||
string (string&& s)
|
string (string&& s) noexcept
|
||||||
: val_(std::move(s.val_))
|
: val_(std::move(s.val_))
|
||||||
{
|
{
|
||||||
s.val_.clear();
|
s.val_.clear();
|
||||||
|
|||||||
+73
-4
@@ -35,17 +35,23 @@ AT_BISON_OPTION_PUSHDEFS
|
|||||||
|
|
||||||
AT_DATA_GRAMMAR([[input.y]], [$2])
|
AT_DATA_GRAMMAR([[input.y]], [$2])
|
||||||
|
|
||||||
AT_DATA([experr.orig], [$4])
|
# For some reason, literal ^M in the input are removed and don't end
|
||||||
|
# in `input.y`. So use the two-character ^M represent it, and let
|
||||||
|
# Perl insert real CR characters.
|
||||||
|
AT_CHECK([perl -pi -e 's{\^M}{\r}gx' input.y])
|
||||||
|
|
||||||
|
AT_DATA([experr], [$4])
|
||||||
|
|
||||||
|
AT_CHECK([LC_ALL=en_US.UTF-8 bison -fcaret --color=debug -Wall input.y], [$3], [], [experr])
|
||||||
|
|
||||||
# When no style, same messages, but without style.
|
# When no style, same messages, but without style.
|
||||||
AT_CHECK([perl -p -e 's{</?\w+>}{}g' <experr.orig >experr])
|
AT_CHECK([perl -pi -e 's{(</?\w+>)}{ $[]1 eq "<tag>" ? $[]1 : "" }ge' experr])
|
||||||
|
|
||||||
# Cannot use AT_BISON_CHECK easily as we need to change the
|
# Cannot use AT_BISON_CHECK easily as we need to change the
|
||||||
# environment.
|
# environment.
|
||||||
# FIXME: Enhance AT_BISON_CHECK.
|
# FIXME: Enhance AT_BISON_CHECK.
|
||||||
AT_CHECK([LC_ALL=en_US.UTF-8 bison -fcaret -Wall input.y], [$3], [], [experr])
|
AT_CHECK([LC_ALL=en_US.UTF-8 bison -fcaret -Wall input.y], [$3], [], [experr])
|
||||||
|
|
||||||
AT_CHECK([cp experr.orig experr])
|
|
||||||
AT_CHECK([LC_ALL=en_US.UTF-8 bison -fcaret --color=debug -Wall input.y], [$3], [], [experr])
|
|
||||||
|
|
||||||
AT_BISON_OPTION_POPDEFS
|
AT_BISON_OPTION_POPDEFS
|
||||||
|
|
||||||
@@ -67,18 +73,33 @@ exp: %empty;
|
|||||||
[[input.y:9.12-14: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
[[input.y:9.12-14: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
||||||
9 | %token FOO <warning>FOO</warning> FOO
|
9 | %token FOO <warning>FOO</warning> FOO
|
||||||
| <warning>^~~</warning>
|
| <warning>^~~</warning>
|
||||||
|
input.y:9.8-10: previous declaration
|
||||||
|
9 | %token <note>FOO</note> FOO FOO
|
||||||
|
| <note>^~~</note>
|
||||||
input.y:9.16-18: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
input.y:9.16-18: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
||||||
9 | %token FOO FOO <warning>FOO</warning>
|
9 | %token FOO FOO <warning>FOO</warning>
|
||||||
| <warning>^~~</warning>
|
| <warning>^~~</warning>
|
||||||
|
input.y:9.8-10: previous declaration
|
||||||
|
9 | %token <note>FOO</note> FOO FOO
|
||||||
|
| <note>^~~</note>
|
||||||
input.y:10.8-10: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
input.y:10.8-10: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
||||||
10 | %token <warning>FOO</warning> FOO FOO
|
10 | %token <warning>FOO</warning> FOO FOO
|
||||||
| <warning>^~~</warning>
|
| <warning>^~~</warning>
|
||||||
|
input.y:9.8-10: previous declaration
|
||||||
|
9 | %token <note>FOO</note> FOO FOO
|
||||||
|
| <note>^~~</note>
|
||||||
input.y:10.13-15: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
input.y:10.13-15: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
||||||
10 | %token FOO <warning>FOO</warning> FOO
|
10 | %token FOO <warning>FOO</warning> FOO
|
||||||
| <warning>^~~</warning>
|
| <warning>^~~</warning>
|
||||||
|
input.y:9.8-10: previous declaration
|
||||||
|
9 | %token <note>FOO</note> FOO FOO
|
||||||
|
| <note>^~~</note>
|
||||||
input.y:10.18-20: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
input.y:10.18-20: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
||||||
10 | %token FOO FOO <warning>FOO</warning>
|
10 | %token FOO FOO <warning>FOO</warning>
|
||||||
| <warning>^~~</warning>
|
| <warning>^~~</warning>
|
||||||
|
input.y:9.8-10: previous declaration
|
||||||
|
9 | %token <note>FOO</note> FOO FOO
|
||||||
|
| <note>^~~</note>
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
|
||||||
@@ -240,5 +261,53 @@ input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
## ----------------- ##
|
||||||
|
## Carriage return. ##
|
||||||
|
## ----------------- ##
|
||||||
|
|
||||||
|
# Carriage-return used to count as a newline in the scanner, and not
|
||||||
|
# in diagnostics. Resulting in all sort of nice bugs.
|
||||||
|
|
||||||
|
AT_TEST([[Carriage return]],
|
||||||
|
[[^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M
|
||||||
|
%token "
|
||||||
|
%%
|
||||||
|
]],
|
||||||
|
[1],
|
||||||
|
[[input.y:37.8-38.0: <error>error:</error> missing '"' at end of line
|
||||||
|
input.y:37.8-38.0: <error>error:</error> syntax error, unexpected string, expecting char or identifier or <tag>
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m4_popdef([AT_TEST])
|
m4_popdef([AT_TEST])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## -------------------------------------- ##
|
||||||
|
## Indentation with message suppression. ##
|
||||||
|
## -------------------------------------- ##
|
||||||
|
|
||||||
|
AT_SETUP([[Indentation with message suppression]])
|
||||||
|
|
||||||
|
# https://lists.gnu.org/archive/html/bug-bison/2019-08/msg00002.html
|
||||||
|
|
||||||
|
AT_DATA([[input.y]],
|
||||||
|
[[%define api.pure
|
||||||
|
%pure-parser
|
||||||
|
%error-verbose
|
||||||
|
%%
|
||||||
|
exp : '0'
|
||||||
|
]])
|
||||||
|
|
||||||
|
AT_BISON_CHECK([[-fcaret -Wno-other input.y]], [0], [],
|
||||||
|
[[input.y:2.1-12: warning: deprecated directive, use '%define api.pure' [-Wdeprecated]
|
||||||
|
2 | %pure-parser
|
||||||
|
| ^~~~~~~~~~~~
|
||||||
|
input.y:3.1-14: warning: deprecated directive, use '%define parse.error verbose' [-Wdeprecated]
|
||||||
|
3 | %error-verbose
|
||||||
|
| ^~~~~~~~~~~~~~
|
||||||
|
]])
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
|
|||||||
+41
-4
@@ -615,6 +615,44 @@ AT_CHECK_UNUSED_VALUES([1], [1])
|
|||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
|
## ------------------- ##
|
||||||
|
## Symbol redeclared. ##
|
||||||
|
## ------------------- ##
|
||||||
|
|
||||||
|
AT_SETUP([Symbol redeclared])
|
||||||
|
|
||||||
|
AT_DATA([[input.y]],
|
||||||
|
[[%token FOO FOO
|
||||||
|
%token BAR 12 BAR 12
|
||||||
|
%token EOF 0 EOF 0
|
||||||
|
%%
|
||||||
|
exp: FOO BAR
|
||||||
|
]])
|
||||||
|
|
||||||
|
AT_BISON_CHECK([-fcaret input.y], [0], [],
|
||||||
|
[[input.y:1.12-14: warning: symbol FOO redeclared [-Wother]
|
||||||
|
1 | %token FOO FOO
|
||||||
|
| ^~~
|
||||||
|
input.y:1.8-10: previous declaration
|
||||||
|
1 | %token FOO FOO
|
||||||
|
| ^~~
|
||||||
|
input.y:2.15-17: warning: symbol BAR redeclared [-Wother]
|
||||||
|
2 | %token BAR 12 BAR 12
|
||||||
|
| ^~~
|
||||||
|
input.y:2.8-10: previous declaration
|
||||||
|
2 | %token BAR 12 BAR 12
|
||||||
|
| ^~~
|
||||||
|
input.y:3.14-16: warning: symbol EOF redeclared [-Wother]
|
||||||
|
3 | %token EOF 0 EOF 0
|
||||||
|
| ^~~
|
||||||
|
input.y:3.8-10: previous declaration
|
||||||
|
3 | %token EOF 0 EOF 0
|
||||||
|
| ^~~
|
||||||
|
]])
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
## --------------------------- ##
|
## --------------------------- ##
|
||||||
## Symbol class redefinition. ##
|
## Symbol class redefinition. ##
|
||||||
## --------------------------- ##
|
## --------------------------- ##
|
||||||
@@ -2556,8 +2594,8 @@ input.y:23.1-9: warning: deprecated directive: '%no_lines', use '%no-lines' [-Wd
|
|||||||
fix-it:"input.y":{23:1-23:10}:"%no-lines"
|
fix-it:"input.y":{23:1-23:10}:"%no-lines"
|
||||||
input.y:24.1-9: warning: deprecated directive: '%output =', use '%output' [-Wdeprecated]
|
input.y:24.1-9: warning: deprecated directive: '%output =', use '%output' [-Wdeprecated]
|
||||||
fix-it:"input.y":{24:1-24:10}:"%output"
|
fix-it:"input.y":{24:1-24:10}:"%output"
|
||||||
input.y:25.1-12: warning: deprecated directive: '%pure_parser', use '%pure-parser' [-Wdeprecated]
|
input.y:25.1-12: warning: deprecated directive: '%pure_parser', use '%define api.pure' [-Wdeprecated]
|
||||||
fix-it:"input.y":{25:1-25:13}:"%pure-parser"
|
fix-it:"input.y":{25:1-25:13}:"%define api.pure"
|
||||||
input.y:26.1-12: warning: deprecated directive: '%token_table', use '%token-table' [-Wdeprecated]
|
input.y:26.1-12: warning: deprecated directive: '%token_table', use '%token-table' [-Wdeprecated]
|
||||||
fix-it:"input.y":{26:1-26:13}:"%token-table"
|
fix-it:"input.y":{26:1-26:13}:"%token-table"
|
||||||
input.y:27.1-14: warning: %define variable 'parse.error' redefined [-Wother]
|
input.y:27.1-14: warning: %define variable 'parse.error' redefined [-Wother]
|
||||||
@@ -2603,7 +2641,7 @@ AT_CHECK([sed -e '1,8d' input.y], [],
|
|||||||
%no-default-prec
|
%no-default-prec
|
||||||
%no-lines
|
%no-lines
|
||||||
%output "output.c"
|
%output "output.c"
|
||||||
%pure-parser
|
%define api.pure
|
||||||
%token-table
|
%token-table
|
||||||
%glr-parser
|
%glr-parser
|
||||||
%%
|
%%
|
||||||
@@ -2678,7 +2716,6 @@ AT_DATA_GRAMMAR([[input.y]],
|
|||||||
%no-default-prec
|
%no-default-prec
|
||||||
%no-lines
|
%no-lines
|
||||||
%output "foo"
|
%output "foo"
|
||||||
%pure-parser
|
|
||||||
%token-table
|
%token-table
|
||||||
%% exp : '0'
|
%% exp : '0'
|
||||||
]])
|
]])
|
||||||
|
|||||||
+1
-1
@@ -85,7 +85,7 @@ $(TESTSUITE): $(TESTSUITE_AT)
|
|||||||
## -------------------- ##
|
## -------------------- ##
|
||||||
|
|
||||||
# Move into %D%/ so that testsuite.dir etc. be created there.
|
# Move into %D%/ so that testsuite.dir etc. be created there.
|
||||||
RUN_TESTSUITE = $(TESTSUITE) -C %D% $(TESTSUITEFLAGS)
|
RUN_TESTSUITE = $(SHELL) $(TESTSUITE) -C %D% $(TESTSUITEFLAGS)
|
||||||
check_SCRIPTS += $(BISON) %D%/atconfig %D%/atlocal
|
check_SCRIPTS += $(BISON) %D%/atconfig %D%/atlocal
|
||||||
RUN_TESTSUITE_deps = all $(TESTSUITE) $(check_SCRIPTS)
|
RUN_TESTSUITE_deps = all $(TESTSUITE) $(check_SCRIPTS)
|
||||||
|
|
||||||
|
|||||||
+4
-5
@@ -397,19 +397,18 @@ AT_BISON_OPTION_POPDEFS
|
|||||||
# unnecessarily escaped here even though it would need to be if encoded in a
|
# unnecessarily escaped here even though it would need to be if encoded in a
|
||||||
# C-string literal. Also notice that unnecessary escaping, such as "\?", from
|
# C-string literal. Also notice that unnecessary escaping, such as "\?", from
|
||||||
# the user specification is eliminated.
|
# the user specification is eliminated.
|
||||||
AT_BISON_CHECK([-o input.c input.y], [[0]], [[]],
|
|
||||||
[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
|
|
||||||
input.y:22.16-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
|
|
||||||
]])
|
|
||||||
|
|
||||||
AT_BISON_CHECK([-fcaret -o input.c input.y], [[0]], [[]],
|
AT_BISON_CHECK([-fcaret -o input.c input.y], [[0]], [[]],
|
||||||
[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
|
[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
|
||||||
22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||||
| ^~~~~~~
|
| ^~~~~~~
|
||||||
|
input.y:21.8-14: previous declaration
|
||||||
|
21 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||||
|
| ^~~~~~~
|
||||||
input.y:22.16-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
|
input.y:22.16-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
|
||||||
22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_COMPILE([input])
|
AT_COMPILE([input])
|
||||||
|
|
||||||
# Checking the error message here guarantees that yytname, which does contain
|
# Checking the error message here guarantees that yytname, which does contain
|
||||||
|
|||||||
@@ -90,7 +90,17 @@ m4_define([_AT_SYNCLINES_COMPILE],
|
|||||||
# syncline.c:4:2: error: #error "4"
|
# syncline.c:4:2: error: #error "4"
|
||||||
# #error "4"
|
# #error "4"
|
||||||
# ^~~~~
|
# ^~~~~
|
||||||
|
#
|
||||||
|
# GCC 9 displays a left-hand margin with the line number:
|
||||||
|
#
|
||||||
|
# syncline.c: In function 'foo':
|
||||||
|
# syncline.c:4:2: error: #error "4"
|
||||||
|
# 4 | #error "4"
|
||||||
|
# | ^~~~~
|
||||||
AT_CHECK([[$PERL -p -0777 - stderr <<\EOF
|
AT_CHECK([[$PERL -p -0777 - stderr <<\EOF
|
||||||
|
# Remove left-hand margin.
|
||||||
|
s/^[\d ]{6}\| //gm;
|
||||||
|
|
||||||
# 1. Remove useless lines.
|
# 1. Remove useless lines.
|
||||||
|
|
||||||
# distcc clutter.
|
# distcc clutter.
|
||||||
|
|||||||
Reference in New Issue
Block a user