mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-10 11:15:15 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5604903f7a | ||
|
|
678853da7e | ||
|
|
961ea2ac85 | ||
|
|
cc6e5cf854 | ||
|
|
1376a7c6e2 | ||
|
|
1c273826d4 | ||
|
|
4a55a5ea9a | ||
|
|
72f04ca80f | ||
|
|
cca8c73431 | ||
|
|
cb40f5c624 | ||
|
|
6c23b012b9 | ||
|
|
ef88dfba81 | ||
|
|
6e89bc0fd2 | ||
|
|
e3e21cc0d8 | ||
|
|
15ea35019f | ||
|
|
f49684a577 | ||
|
|
044ad1288c | ||
|
|
e3812bb8c3 | ||
|
|
cfcd823e16 | ||
|
|
2f02d9beae | ||
|
|
b638603477 | ||
|
|
e21ff47f5d | ||
|
|
b82b387da9 | ||
|
|
641e326303 | ||
|
|
192e9fdf77 | ||
|
|
a4a3f08c11 | ||
|
|
666df338a7 | ||
|
|
b437b16603 | ||
|
|
b493c173c9 | ||
|
|
aab3feb5a1 | ||
|
|
b7942f2661 | ||
|
|
cefb538ab0 | ||
|
|
26c5f48c1c | ||
|
|
7f921d18dd | ||
|
|
cc3760ef51 | ||
|
|
2f23ca6f65 | ||
|
|
468b68c5cd | ||
|
|
9ed802a026 | ||
|
|
fb554c2804 | ||
|
|
47850d4f58 | ||
|
|
57b035a242 | ||
|
|
1587a5ea9b | ||
|
|
4ab2cf7450 | ||
|
|
7e3a513d88 | ||
|
|
57f64ebbf8 | ||
|
|
c8d997cb5f | ||
|
|
61b8a8def5 | ||
|
|
6990c5bde9 | ||
|
|
27e822abfd | ||
|
|
21ba496083 | ||
|
|
9cf0a97aa9 | ||
|
|
3dec8a4caf | ||
|
|
2cb52c5a91 | ||
|
|
04f3bfc596 | ||
|
|
c67daa9a97 | ||
|
|
2ca8e86f83 | ||
|
|
78bb152a63 | ||
|
|
4d6ff4c5e5 | ||
|
|
9bb5087ad1 | ||
|
|
d29e40a047 | ||
|
|
b10366f296 | ||
|
|
139d065594 | ||
|
|
0d73c39bb7 | ||
|
|
7f01adced9 | ||
|
|
3bad20352c | ||
|
|
cb3bf6493d | ||
|
|
57503e2165 | ||
|
|
b3abe014f2 | ||
|
|
80f3220fea | ||
|
|
fc2040a750 | ||
|
|
d55f240991 | ||
|
|
4f961a706d | ||
|
|
ac203e6c3c | ||
|
|
9141f0b79f | ||
|
|
d57eab87e8 | ||
|
|
bb901beb68 | ||
|
|
fa00c56c17 | ||
|
|
5359c479bc | ||
|
|
20107b77c0 | ||
|
|
5e71eef267 | ||
|
|
472531dc72 | ||
|
|
046f238826 | ||
|
|
9bf06f6963 | ||
|
|
357336d254 | ||
|
|
d4a6c3c58a | ||
|
|
8976e0f567 | ||
|
|
6dca1eb950 | ||
|
|
f8d82ff039 | ||
|
|
9e9e49224f | ||
|
|
8b53f4e022 | ||
|
|
8c87a62308 | ||
|
|
478cb5cf12 | ||
|
|
94f70bd861 | ||
|
|
9b4f0970fe | ||
|
|
869028a66d | ||
|
|
6f92a7f664 | ||
|
|
6a61b6b17e | ||
|
|
a4bf7cdf9e | ||
|
|
9471a5ffe9 | ||
|
|
24c5214ae8 | ||
|
|
2f7097d1b1 | ||
|
|
28369ecb5d | ||
|
|
b92f064e9b | ||
|
|
98f19578aa |
+1
-1
@@ -1 +1 @@
|
||||
3.4.90
|
||||
3.5.3
|
||||
|
||||
+69
-58
@@ -1,14 +1,8 @@
|
||||
# Travis defines and exports CC and CXX *after* we have defined our
|
||||
# environment variables via 'env'. So, do not use 'env' to define them.
|
||||
# Instead, put their definitions in MATRIX_EVAL, which we eval after the
|
||||
# definitions from Travis.
|
||||
language: cpp
|
||||
version: ~> 1.0
|
||||
|
||||
env:
|
||||
global:
|
||||
# ICC serial number.
|
||||
# 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=
|
||||
# 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
|
||||
@@ -87,7 +81,9 @@ jobs:
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
packages: g++-9
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9 && CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'"
|
||||
- CC=gcc-9
|
||||
- CXX=g++-9
|
||||
- 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.
|
||||
@@ -108,7 +104,8 @@ jobs:
|
||||
- libc++abi-9-dev
|
||||
env:
|
||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||
- MATRIX_EVAL="CC='clang-9 -fsanitize=address' CXX='clang++-9 -fsanitize=address -stdlib=libc++'"
|
||||
- CC='clang-9 -fsanitize=address'
|
||||
- CXX='clang++-9 -fsanitize=address -stdlib=libc++'
|
||||
- PART=1
|
||||
|
||||
- name: "Clang 9 libc++ and ASAN part 2"
|
||||
@@ -118,26 +115,26 @@ jobs:
|
||||
addons: *clang9
|
||||
env:
|
||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||
- MATRIX_EVAL="CC='clang-9 -fsanitize=address' CXX='clang++-9 -fsanitize=address -stdlib=libc++'"
|
||||
- CC='clang-9 -fsanitize=address'
|
||||
- CXX='clang++-9 -fsanitize=address -stdlib=libc++'
|
||||
- PART=2
|
||||
|
||||
# Currently no longer works (https://github.com/nemequ/icc-travis/issues/15).
|
||||
# - name: "ICC"
|
||||
# stage: check
|
||||
# # We need the build-aux/install-icc.sh script.
|
||||
# git:
|
||||
# clone: true
|
||||
# submodules: false
|
||||
# depth: 1
|
||||
# os: linux
|
||||
# dist: xenial
|
||||
# env:
|
||||
# # ICC's warnings are often very wrong (e.g., it thinks foo ?
|
||||
# # "bar" : "baz" is char* instead of const char*), so don't try
|
||||
# # to work around the, and obviously, don't die on them.
|
||||
# - MATRIX_EVAL="CC=icc && CXX=icpc"
|
||||
# - MAKE_ARGS='WERROR_CFLAGS= WERROR_CXXFLAGS='
|
||||
|
||||
- name: "ICC"
|
||||
stage: check
|
||||
os: linux
|
||||
compiler: icc
|
||||
env:
|
||||
- CC=icc
|
||||
- CXX=icpc
|
||||
install:
|
||||
- source /opt/intel/inteloneapi/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
|
||||
|
||||
## ----- ##
|
||||
## GCC. ##
|
||||
@@ -150,7 +147,8 @@ jobs:
|
||||
apt:
|
||||
packages: g++-8
|
||||
env:
|
||||
- MATRIX_EVAL="CC='gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer' CXX='g++-8 -fsanitize=undefined,address -fno-omit-frame-pointer'"
|
||||
- CC='gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
||||
- CXX='g++-8 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
||||
- CONFIGUREFLAGS='CFLAGS=-O1 CXXFLAGS=-O1'
|
||||
- PART=1
|
||||
|
||||
@@ -162,7 +160,8 @@ jobs:
|
||||
apt:
|
||||
packages: g++-8
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
|
||||
- CC=gcc-8
|
||||
- CXX=g++-8
|
||||
|
||||
- name: "GCC 7"
|
||||
stage: check
|
||||
@@ -172,7 +171,8 @@ jobs:
|
||||
apt:
|
||||
packages: g++-7
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
|
||||
- CC=gcc-7
|
||||
- CXX=g++-7
|
||||
|
||||
- name: "GCC 6"
|
||||
stage: check
|
||||
@@ -183,7 +183,8 @@ jobs:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-6
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
|
||||
- CC=gcc-6
|
||||
- CXX=g++-6
|
||||
|
||||
- name: "GCC 5"
|
||||
stage: check
|
||||
@@ -194,7 +195,8 @@ jobs:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-5
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
|
||||
- CC=gcc-5
|
||||
- CXX=g++-5
|
||||
|
||||
- name: "GCC 4.9"
|
||||
stage: check
|
||||
@@ -205,7 +207,8 @@ jobs:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-4.9
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
|
||||
- CC=gcc-4.9
|
||||
- CXX=g++-4.9
|
||||
|
||||
- name: "GCC 4.8"
|
||||
stage: check
|
||||
@@ -216,7 +219,8 @@ jobs:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-4.8
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-4.8 && CXX=g++-4.8"
|
||||
- CC=gcc-4.8
|
||||
- CXX=g++-4.8
|
||||
|
||||
- name: "GCC 4.7"
|
||||
stage: check
|
||||
@@ -227,7 +231,8 @@ jobs:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-4.7
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-4.7 && CXX=g++-4.7"
|
||||
- CC=gcc-4.7
|
||||
- CXX=g++-4.7
|
||||
|
||||
- name: "GCC 4.6"
|
||||
stage: check
|
||||
@@ -238,7 +243,8 @@ jobs:
|
||||
sources: ubuntu-toolchain-r-test
|
||||
packages: g++-4.6
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-4.6 && CXX=g++-4.6"
|
||||
- CC=gcc-4.6
|
||||
- CXX=g++-4.6
|
||||
|
||||
## ------- ##
|
||||
## Clang. ##
|
||||
@@ -255,7 +261,8 @@ jobs:
|
||||
- libc++-8-dev
|
||||
- libc++abi-8-dev
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-8 && CXX='clang++-8 -stdlib=libc++'"
|
||||
- CC=clang-8
|
||||
- CXX='clang++-8 -stdlib=libc++'
|
||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||
|
||||
- name: "Clang 7"
|
||||
@@ -269,7 +276,8 @@ jobs:
|
||||
- libc++-7-dev
|
||||
- libc++abi-7-dev
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-7 && CXX='clang++-7 -stdlib=libc++'"
|
||||
- CC=clang-7
|
||||
- CXX='clang++-7 -stdlib=libc++'
|
||||
|
||||
- name: "Clang 6 and libc++"
|
||||
stage: check
|
||||
@@ -284,7 +292,8 @@ jobs:
|
||||
- clang-6.0
|
||||
- libc++-dev
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-6.0 && CXX='clang++-6.0 -stdlib=libc++'"
|
||||
- CC=clang-6.0
|
||||
- CXX='clang++-6.0 -stdlib=libc++'
|
||||
|
||||
- name: "Clang 5"
|
||||
stage: check
|
||||
@@ -297,7 +306,8 @@ jobs:
|
||||
- clang-5.0
|
||||
- libc++-dev
|
||||
env:
|
||||
- MATRIX_EVAL="CC='clang-5.0' CXX='clang++-5.0'"
|
||||
- CC='clang-5.0'
|
||||
- CXX='clang++-5.0'
|
||||
|
||||
- name: "Clang 4"
|
||||
stage: check
|
||||
@@ -308,7 +318,8 @@ jobs:
|
||||
sources: llvm-toolchain-xenial-4.0
|
||||
packages: clang-4.0
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
|
||||
- CC=clang-4.0
|
||||
- CXX=clang++-4.0
|
||||
|
||||
- name: "Clang 3.9"
|
||||
stage: check
|
||||
@@ -319,7 +330,8 @@ jobs:
|
||||
sources: llvm-toolchain-xenial-3.9
|
||||
packages: clang-3.9
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
|
||||
- CC=clang-3.9
|
||||
- CXX=clang++-3.9
|
||||
|
||||
- name: "Clang 3.8"
|
||||
stage: check
|
||||
@@ -332,7 +344,8 @@ jobs:
|
||||
- llvm-toolchain-precise-3.8
|
||||
packages: clang-3.8
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
|
||||
- CC=clang-3.8
|
||||
- CXX=clang++-3.8
|
||||
|
||||
- name: "CLang 3.7"
|
||||
stage: check
|
||||
@@ -345,7 +358,8 @@ jobs:
|
||||
- llvm-toolchain-precise-3.7
|
||||
packages: clang-3.7
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7"
|
||||
- CC=clang-3.7
|
||||
- CXX=clang++-3.7
|
||||
|
||||
- name: "Clang 3.6"
|
||||
stage: check
|
||||
@@ -358,7 +372,8 @@ jobs:
|
||||
- llvm-toolchain-precise-3.6
|
||||
packages: clang-3.6
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6"
|
||||
- CC=clang-3.6
|
||||
- CXX=clang++-3.6
|
||||
|
||||
- name: "Clang 3.5"
|
||||
stage: check
|
||||
@@ -371,7 +386,8 @@ jobs:
|
||||
- llvm-toolchain-precise-3.5
|
||||
packages: clang-3.5
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-3.5 && CXX=clang++-3.5"
|
||||
- CC=clang-3.5
|
||||
- CXX=clang++-3.5
|
||||
|
||||
- name: "Clang 3.4"
|
||||
stage: check
|
||||
@@ -384,7 +400,8 @@ jobs:
|
||||
env:
|
||||
# No versioned name installed, but beware that Travis installs
|
||||
# a more modern clang earlier in the default PATH.
|
||||
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++'
|
||||
- CC=/usr/bin/clang
|
||||
- CXX=/usr/bin/clang++
|
||||
|
||||
- name: "Clang 3.3"
|
||||
stage: check
|
||||
@@ -396,7 +413,8 @@ jobs:
|
||||
packages: clang-3.3
|
||||
env:
|
||||
# See comment for 3.4.
|
||||
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++'
|
||||
- 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).
|
||||
@@ -414,13 +432,9 @@ before_script:
|
||||
|
||||
# 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:
|
||||
- eval "$MATRIX_EVAL"
|
||||
# Beware not too leak $SSH_PRIVATE_KEY.
|
||||
# - env
|
||||
- sudo apt-get install -qq doxygen flex m4
|
||||
# Install and activate ICC.
|
||||
- if [[ $CC == "icc" ]]; then build-aux/install-icc.sh; fi
|
||||
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
||||
# Install and activate dmd.
|
||||
- mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh
|
||||
- source $(source ~/dlang/install.sh dmd -a)
|
||||
@@ -452,6 +466,3 @@ script:
|
||||
- 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
|
||||
|
||||
after_script:
|
||||
- uninstall_intel_software || true
|
||||
|
||||
@@ -24,7 +24,7 @@ and nasty bugs.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1998-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+1
-1
@@ -26733,7 +26733,7 @@
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1987-1988, 1991-2015, 2018-2019 Free Software
|
||||
Copyright (C) 1987-1988, 1991-2015, 2018-2020 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
|
||||
# Copyright (C) 2001-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,8 +1,131 @@
|
||||
GNU Bison NEWS
|
||||
|
||||
* Noteworthy changes in release 3.4.91 (2019-11-20) [beta]
|
||||
* Noteworthy changes in release 3.5.4 (2020-04-05) [stable]
|
||||
|
||||
** New Features
|
||||
** WARNING: Future backward-incompatibilities!
|
||||
|
||||
TL;DR: replace "#define YYERROR_VERBOSE 1" by "%define parse.error verbose".
|
||||
|
||||
Bison 3.6 will no longer support the YYERROR_VERBOSE macro; the parsers
|
||||
that still depend on it will produce Yacc-like error messages (just
|
||||
"syntax error"). It was superseded by the "%error-verbose" directive in
|
||||
Bison 1.875 (2003-01-01). Bison 2.6 (2012-07-19) clearly announced that
|
||||
support for YYERROR_VERBOSE would be removed. Note that since Bison 3.0
|
||||
(2013-07-25), "%error-verbose" is deprecated in favor of "%define
|
||||
parse.error verbose".
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Fix portability issues of the package itself on old compilers.
|
||||
|
||||
Fix api.token.raw support in Java.
|
||||
|
||||
* Noteworthy changes in release 3.5.3 (2020-03-08) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Error messages could quote lines containing zero-width characters (such as
|
||||
\005) with incorrect styling. Fixes for similar issues with unexpectedly
|
||||
short lines (e.g., the file was changed between parsing and diagnosing).
|
||||
|
||||
Several unlikely crashes found by fuzzing have been fixed.
|
||||
|
||||
* Noteworthy changes in release 3.5.2 (2020-02-13) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Portability issues and minor cosmetic issues.
|
||||
|
||||
The lalr1.cc skeleton properly rejects unsupported values for parse.lac
|
||||
(as yacc.c does).
|
||||
|
||||
* Noteworthy changes in release 3.5.1 (2020-01-19) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Portability fixes.
|
||||
|
||||
Fix compiler warnings.
|
||||
|
||||
* Noteworthy changes in release 3.5 (2019-12-11) [stable]
|
||||
|
||||
** Backward incompatible changes
|
||||
|
||||
Lone carriage-return characters (aka \r or ^M) in the grammar files are no
|
||||
longer treated as end-of-lines. This changes the diagnostics, and in
|
||||
particular their locations.
|
||||
|
||||
In C++, line numbers and columns are now represented as 'int' not
|
||||
'unsigned', so that integer overflow on positions is easily checkable via
|
||||
'gcc -fsanitize=undefined' and the like. This affects the API for
|
||||
positions. The default position and location classes now expose
|
||||
'counter_type' (int), used to define line and column numbers.
|
||||
|
||||
** Deprecated features
|
||||
|
||||
The YYPRINT macro, which works only with yacc.c and only for tokens, was
|
||||
obsoleted long ago by %printer, introduced in Bison 1.50 (November 2002).
|
||||
It is deprecated and its support will be removed eventually.
|
||||
|
||||
** New features
|
||||
|
||||
*** Lookahead correction in C++
|
||||
|
||||
Contributed by Adrian Vogelsgesang.
|
||||
|
||||
The C++ deterministic skeleton (lalr1.cc) now supports LAC, via the
|
||||
%define variable parse.lac.
|
||||
|
||||
*** Variable api.token.raw: Optimized token numbers (all skeletons)
|
||||
|
||||
In the generated parsers, tokens have two numbers: the "external" token
|
||||
number as returned by yylex (which starts at 257), and the "internal"
|
||||
symbol number (which starts at 3). Each time yylex is called, a table
|
||||
lookup maps the external token number to the internal symbol number.
|
||||
|
||||
When the %define variable api.token.raw is set, tokens are assigned their
|
||||
internal number, which saves one table lookup per token, and also saves
|
||||
the generation of the mapping table.
|
||||
|
||||
The gain is typically moderate, but in extreme cases (very simple user
|
||||
actions), a 10% improvement can be observed.
|
||||
|
||||
*** Generated parsers use better types for states
|
||||
|
||||
Stacks now use the best integral type for state numbers, instead of always
|
||||
using 15 bits. As a result "small" parsers now have a smaller memory
|
||||
footprint (they use 8 bits), and there is support for large automata (16
|
||||
bits), and extra large (using int, i.e., typically 31 bits).
|
||||
|
||||
*** Generated parsers prefer signed integer types
|
||||
|
||||
Bison skeletons now prefer signed to unsigned integer types when either
|
||||
will do, as the signed types are less error-prone and allow for better
|
||||
checking with 'gcc -fsanitize=undefined'. Also, the types chosen are now
|
||||
portable to unusual machines where char, short and int are all the same
|
||||
width. On non-GNU platforms this may entail including <limits.h> and (if
|
||||
available) <stdint.h> to define integer types and constants.
|
||||
|
||||
*** A skeleton for the D programming language
|
||||
|
||||
For the last few releases, Bison has shipped a stealth experimental
|
||||
skeleton: lalr1.d. It was first contributed by Oliver Mangold, based on
|
||||
Paolo Bonzini's lalr1.java, and was cleaned and improved thanks to
|
||||
H. S. Teoh.
|
||||
|
||||
However, because nobody has committed to improving, testing, and
|
||||
documenting this skeleton, it is not clear that it will be supported in
|
||||
the future.
|
||||
|
||||
The lalr1.d skeleton *is functional*, and works well, as demonstrated in
|
||||
examples/d/calc.d. Please try it, enjoy it, and... commit to support it.
|
||||
|
||||
*** Debug traces in Java
|
||||
|
||||
The Java backend no longer emits code and data for parser tracing if the
|
||||
%define variable parse.trace is not defined.
|
||||
|
||||
** Diagnostics
|
||||
|
||||
*** New diagnostic: -Wdangling-alias
|
||||
|
||||
@@ -53,7 +176,7 @@ GNU Bison NEWS
|
||||
%%
|
||||
expr:
|
||||
|
||||
gives, with -Wyacc
|
||||
gives with -Wyacc
|
||||
|
||||
input.y:2.15-20: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
|
||||
2 | %type <ival> TOKEN1 TOKEN2 't'
|
||||
@@ -65,50 +188,9 @@ GNU Bison NEWS
|
||||
2 | %type <ival> TOKEN1 TOKEN2 't'
|
||||
| ^~~~~~
|
||||
|
||||
* Noteworthy changes in release 3.4.90 (2019-10-29) [beta]
|
||||
|
||||
** Backward incompatible changes
|
||||
|
||||
Lone carriage-return characters (aka \r or ^M) in the grammar files are no
|
||||
longer treated as end-of-lines. This changes the diagnostics, and in
|
||||
particular their locations.
|
||||
|
||||
In C++, line numbers and columns are now represented as 'int' not
|
||||
'unsigned', so that integer overflow on positions is easily checkable via
|
||||
'gcc -fsanitize=undefined' and the like. This affects the API for
|
||||
positions. The default position and location classes now expose
|
||||
'counter_type' (int), used to define line and column numbers.
|
||||
|
||||
** Bug fixes
|
||||
|
||||
In Java, %define api.prefix was ignored. It now behaves as expected.
|
||||
|
||||
** New features
|
||||
|
||||
*** Lookahead correction in C++
|
||||
|
||||
Contributed by Adrian Vogelsgesang.
|
||||
|
||||
The C++ deterministic skeleton (lalr1.cc) now supports LAC, via the
|
||||
%define variable parse.lac.
|
||||
|
||||
*** Variable api.token.raw: Optimized token numbers (all skeletons)
|
||||
|
||||
In the generated parsers, tokens have two numbers: the "external" token
|
||||
number as returned by yylex (which starts at 257), and the "internal"
|
||||
symbol number (which starts at 3). Each time yylex is called, a table
|
||||
lookup maps the external token number to the internal symbol number.
|
||||
|
||||
When the %define variable api.token.raw is set, tokens are assigned their
|
||||
internal number, which saves one table lookup per token, and also saves
|
||||
the generation of the mapping table.
|
||||
|
||||
The gain is typically moderate, but in extreme cases (very simple user
|
||||
actions), a 10% improvement can be observed.
|
||||
|
||||
*** Diagnostics with insertion
|
||||
|
||||
The diagnostics now display suggestion below the underlined source.
|
||||
The diagnostics now display the suggestion below the underlined source.
|
||||
Replacement for undeclared symbols are now also suggested.
|
||||
|
||||
$ cat /tmp/foo.y
|
||||
@@ -149,26 +231,28 @@ GNU Bison NEWS
|
||||
1 | %token FOO …
|
||||
| ^~~
|
||||
|
||||
*** Debug traces in Java
|
||||
** Changes
|
||||
|
||||
The Java backend no longer emits code and data for parser tracing if the
|
||||
%define variable parse.trace is not defined.
|
||||
*** Debugging glr.c and glr.cc
|
||||
|
||||
*** Generated parsers prefer signed integer types
|
||||
The glr.c skeleton always had asserts to check its own behavior (not the
|
||||
user's). These assertions are now under the control of the parse.assert
|
||||
%define variable (disabled by default).
|
||||
|
||||
Bison skeletons now prefer signed to unsigned integer types when either
|
||||
will do, as the signed types are less error-prone and allow for better
|
||||
checking with 'gcc -fsanitize=undefined'. Also, the types chosen are now
|
||||
portable to unusual machines where char, short and int are all the same
|
||||
width. On non-GNU platforms this may entail including <limits.h> and (if
|
||||
available) <stdint.h> to define integer types and constants.
|
||||
*** Clean up
|
||||
|
||||
*** Generated parsers use better types for states
|
||||
Several new compiler warnings in the generated output have been avoided.
|
||||
Some unused features are no longer emitted. Cleaner generated code in
|
||||
general.
|
||||
|
||||
Stacks now use the best integral type for state numbers, instead of always
|
||||
using 15 bits. As a result "small" parsers now have a smaller memory
|
||||
footprint (they use 8 bits), and there is support for large automata (16
|
||||
bits), and extra large (using int, i.e., typically 31 bits).
|
||||
** Bug Fixes
|
||||
|
||||
Portability issues in the test suite.
|
||||
|
||||
In theory, parsers using %nonassoc could crash when reporting verbose
|
||||
error messages. This unlikely bug has been fixed.
|
||||
|
||||
In Java, %define api.prefix was ignored. It now behaves as expected.
|
||||
|
||||
* Noteworthy changes in release 3.4.2 (2019-09-12) [stable]
|
||||
|
||||
@@ -3774,7 +3858,7 @@ Output file does not redefine const for C++.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1995-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Parser Generator.
|
||||
|
||||
@@ -3820,7 +3904,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
LocalWords: Heimbigner AST src ast Makefile srcdir MinGW xxlex XXSTYPE
|
||||
LocalWords: XXLTYPE strictfp IDEs ffixit fdiagnostics parseable fixits
|
||||
LocalWords: Wdeprecated yytext Variadic variadic yyrhs yyphrs RCS README
|
||||
LocalWords: noexcept constexpr ispell american deprecations backend
|
||||
LocalWords: noexcept constexpr ispell american deprecations backend Teoh
|
||||
LocalWords: YYPRINT Mangold Bonzini's Wdangling exVal baz checkable gcc
|
||||
LocalWords: fsanitize Vogelsgesang lis redeclared stdint automata
|
||||
|
||||
Local Variables:
|
||||
ispell-dictionary: "american"
|
||||
|
||||
@@ -36,7 +36,7 @@ to the bison package.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2005, 2009-2015, 2018-2019 Free Software Foundation,
|
||||
Copyright (C) 2002, 2005, 2009-2015, 2018-2020 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
This package contains the GNU Bison parser generator.
|
||||
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.
|
||||
|
||||
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++ or Java
|
||||
programming in order to use Bison.
|
||||
|
||||
Bison and the parsers it generates are portable, they do not require any
|
||||
specific compilers.
|
||||
|
||||
GNU Bison's home page is https://gnu.org/software/bison/.
|
||||
|
||||
# Installation
|
||||
## Build from git
|
||||
@@ -9,8 +24,7 @@ Here are basic installation instructions for a repository checkout:
|
||||
|
||||
then proceed with the usual `configure && make` steps.
|
||||
|
||||
The file README-hacking.md contains all the needed information about
|
||||
building, modifying and checking Bison.
|
||||
The file README-hacking.md is about building, modifying and checking Bison.
|
||||
|
||||
## Build from tarball
|
||||
See the file INSTALL for generic compilation and installation instructions.
|
||||
@@ -18,13 +32,18 @@ See the 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 before configuring Bison. It
|
||||
is available from https://alpha.gnu.org/gnu/gettext/, for instance
|
||||
https://alpha.gnu.org/gnu/gettext/libtextstyle-0.8.tar.gz.
|
||||
https://alpha.gnu.org/pub/gnu/gettext/libtextstyle-0.20.5.tar.gz.
|
||||
|
||||
The option --color supports the following arguments:
|
||||
- always, yes: Enable colors.
|
||||
@@ -81,23 +100,17 @@ that the range specifies every single year in that closed interval.
|
||||
|
||||
<!--
|
||||
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018-2019 Free
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018-2020 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU bison, the GNU Compiler Compiler.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
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.
|
||||
|
||||
Local Variables:
|
||||
mode: markdown
|
||||
@@ -105,7 +118,8 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
LocalWords: parsers ngettext Texinfo pdf html YYYY ZZZZ ispell american
|
||||
LocalWords: MERCHANTABILITY
|
||||
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
|
||||
|
||||
-->
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ the problems you encounter.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2015, 2018-2019 Free Software Foundation,
|
||||
Copyright (C) 2002, 2004, 2009-2015, 2018-2020 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
+54
-29
@@ -34,13 +34,28 @@ Only user visible strings are to be translated: error messages, bits of the
|
||||
assert/abort), and all the --trace output which is meant for the maintainers
|
||||
only.
|
||||
|
||||
## Horizontal tabs
|
||||
## Coding style
|
||||
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 adhoc implementations of lists).
|
||||
|
||||
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.
|
||||
|
||||
## Commit messages
|
||||
Please, imitate the style we use. Use `git log` to get sources of
|
||||
inspiration.
|
||||
|
||||
## 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`.
|
||||
|
||||
# Working from the repository
|
||||
|
||||
@@ -185,29 +200,32 @@ These files don't change very often in Autoconf, so it should be relatively
|
||||
straight-forward to examine the differences in order to decide whether to
|
||||
update.
|
||||
|
||||
# Test suite
|
||||
# Test Suite
|
||||
|
||||
## make check
|
||||
Use liberally.
|
||||
Consume without moderation. It is composed of two kinds of tests: the
|
||||
examples, and the main test suite.
|
||||
|
||||
## 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`.
|
||||
### The Examples
|
||||
In examples/, there is a number of ready-to-use examples (see
|
||||
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`).
|
||||
|
||||
Once you ran the test suite, and therefore have many testsuite.log files,
|
||||
run, from the source tree:
|
||||
### 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.
|
||||
|
||||
$ ./build-aux/update-test _build/tests/testsuite.dir/*/testsuite.log
|
||||
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.
|
||||
|
||||
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...
|
||||
|
||||
## TESTSUITEFLAGS
|
||||
To run just the test suite (not the tests related to the examples), run `make
|
||||
check-local`.
|
||||
#### TESTSUITEFLAGS
|
||||
To run just the main test suite, run `make check-local`.
|
||||
|
||||
The default is for make check-local to run all tests sequentially. This can
|
||||
be very time consuming when checking repeatedly or on slower setups. This
|
||||
@@ -230,6 +248,10 @@ with AT_KEYWORDS([[category]]). Categories include:
|
||||
- java, for java parsers
|
||||
- report, for automaton dumps
|
||||
|
||||
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-local TESTSUITEFLAGS='-k c++'
|
||||
@@ -242,18 +264,21 @@ To rerun the tests that failed:
|
||||
|
||||
$ make recheck -j5
|
||||
|
||||
## Typical errors
|
||||
If the test suite shows failures such as the following one
|
||||
#### 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`.
|
||||
|
||||
.../bison/lib/getopt.h:196:8: error: redefinition of 'struct option'
|
||||
/usr/include/getopt.h:54:8: error: previous definition of 'struct option'
|
||||
Once you ran the test suite, and therefore have many `testsuite.log` files,
|
||||
run, from the source tree:
|
||||
|
||||
it probably means that some file was compiled without
|
||||
`AT_DATA_SOURCE_PROLOGUE`. This error is due to the fact that our -I
|
||||
options pick up gnulib's replacement headers, such as getopt.h, and this
|
||||
will go wrong if config.h was not included first.
|
||||
$ ./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...
|
||||
|
||||
See tests/local.at for details.
|
||||
|
||||
## make maintainer-check-valgrind
|
||||
This target uses valgrind both to check bison, and the generated parsers.
|
||||
@@ -363,7 +388,7 @@ of every year by running `make update-copyright`. However, before a
|
||||
release, it's good to verify that it's actually been run. Besides the
|
||||
copyright statement for each Bison file, check the copyright statements that
|
||||
the skeletons insert into generated parsers, and check all occurrences of
|
||||
PACKAGE_COPYRIGHT_YEAR in configure.ac.
|
||||
`PACKAGE_COPYRIGHT_YEAR` in configure.ac.
|
||||
|
||||
## Update NEWS, commit and tag.
|
||||
See do-release-commit-and-tag in README-release. For a while, we used beta
|
||||
@@ -497,7 +522,7 @@ Push these changes.
|
||||
|
||||
<!--
|
||||
|
||||
Copyright (C) 2002-2005, 2007-2015, 2018-2019 Free Software Foundation,
|
||||
Copyright (C) 2002-2005, 2007-2015, 2018-2020 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
@@ -4,8 +4,9 @@ it is today without the invaluable help of these people:
|
||||
Aaro Koskinen [email protected]
|
||||
Аскар Сафин [email protected]
|
||||
Adam Sampson [email protected]
|
||||
Ahcheong Lee [email protected]
|
||||
Airy Andre [email protected]
|
||||
Akim Demaille akim@lrde.epita.fr
|
||||
Akim Demaille akim@gnu.org
|
||||
Albert Chin-A-Young [email protected]
|
||||
Alexander Belopolsky [email protected]
|
||||
Alexandre Duret-Lutz [email protected]
|
||||
@@ -60,6 +61,8 @@ 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]
|
||||
@@ -79,6 +82,7 @@ Hans Åberg [email protected]
|
||||
Horst Von Brand [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]
|
||||
@@ -128,6 +132,7 @@ Nick Bowler [email protected]
|
||||
Nicolas Bedon [email protected]
|
||||
Nicolas Burrus [email protected]
|
||||
Nicolas Tisserand [email protected]
|
||||
Nikki Valen [email protected]
|
||||
Noah Friedman [email protected]
|
||||
Odd Arild Olsen [email protected]
|
||||
Oleg Smolsky [email protected]
|
||||
@@ -205,8 +210,9 @@ Wwp [email protected]
|
||||
xolodho [email protected]
|
||||
Yuichiro Kaneko [email protected]
|
||||
Zack Weinberg [email protected]
|
||||
長田偉伸 [email protected]
|
||||
江 祖铭 [email protected]
|
||||
長田偉伸 [email protected]
|
||||
马俊 [email protected]
|
||||
|
||||
Many people are not named here because we lost track of them. We
|
||||
thank them! Please, help us keeping this list up to date.
|
||||
@@ -218,7 +224,7 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2000-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Parser Generator.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
* Bison 3.5
|
||||
* Bison 3.6
|
||||
** doc
|
||||
I feel its 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
|
||||
@@ -50,12 +50,72 @@ syntax error, unexpected $end, expecting ↦ or 🎅🐃 or '\n'
|
||||
While at it, we should stop using "$end" by default, in favor of "end of
|
||||
file", or "end of input", whatever. See how lalr1.java does that.
|
||||
|
||||
** consistency
|
||||
token vs terminal, variable vs non terminal.
|
||||
|
||||
** Stop indentation in diagnostics
|
||||
Before Bison 2.7, we printed "flatly" the dependencies in long diagnostics:
|
||||
|
||||
input.y:2.7-12: %type redeclaration for exp
|
||||
input.y:1.7-12: previous declaration
|
||||
|
||||
In Bison 2.7, we indented them
|
||||
|
||||
input.y:2.7-12: error: %type redeclaration for exp
|
||||
input.y:1.7-12: previous declaration
|
||||
|
||||
Later we quoted the source in the diagnostics, and today we have:
|
||||
|
||||
/tmp/foo.y:1.12-14: warning: symbol FOO redeclared [-Wother]
|
||||
1 | %token FOO FOO
|
||||
| ^~~
|
||||
/tmp/foo.y:1.8-10: previous declaration
|
||||
1 | %token FOO FOO
|
||||
| ^~~
|
||||
|
||||
The indentation is no longer helping. We should probably get rid of it, or
|
||||
maybe keep it only when -fno-caret. GCC displays this as a "note":
|
||||
|
||||
$ g++-mp-9 -Wall /tmp/foo.c -c
|
||||
/tmp/foo.c:1:10: error: redefinition of 'int foo'
|
||||
1 | int foo, foo;
|
||||
| ^~~
|
||||
/tmp/foo.c:1:5: note: 'int foo' previously declared here
|
||||
1 | int foo, foo;
|
||||
| ^~~
|
||||
|
||||
Likewise for Clang, contrary to what I believed (because "note:" is written
|
||||
in black, so it doesn't show in my terminal :-)
|
||||
|
||||
$ clang++-mp-8.0 -Wall /tmp/foo.c -c
|
||||
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
|
||||
/tmp/foo.c:1:10: error: redefinition of 'foo'
|
||||
int foo, foo;
|
||||
^
|
||||
/tmp/foo.c:1:5: note: previous definition is here
|
||||
int foo, foo;
|
||||
^
|
||||
1 error generated.
|
||||
|
||||
See also the item "Complaint submessage indentation" below.
|
||||
|
||||
** api.token.raw
|
||||
Maybe we should exhibit the YYUNDEFTOK token. It could also be assigned a
|
||||
semantic value so that yyerror could be used to report invalid lexemes.
|
||||
See also the item "$undefined" below.
|
||||
|
||||
* Bison 3.6
|
||||
** C++
|
||||
Move to int everywhere instead of unsigned? stack_size, etc. The parser
|
||||
itself uses int (for yylen for instance), yet stack is based on size_t.
|
||||
|
||||
Maybe locations should also move to ints.
|
||||
|
||||
Paul Eggert already covered most of this. But before publishing these
|
||||
changes, we need to ask our C++ users if they agree with that change, or if
|
||||
we need some migration path. Could be a %define variable, or simply
|
||||
%require "3.5".
|
||||
|
||||
* Bison 3.7
|
||||
** 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.,
|
||||
@@ -134,51 +194,8 @@ $ ./tests/testsuite -l | grep errors | sed q
|
||||
38: input.at:1730 errors
|
||||
|
||||
* Short term
|
||||
** Stop indentation in diagnostics
|
||||
Before Bison 2.7, we printed "flatly" the dependencies in long diagnostics:
|
||||
|
||||
input.y:2.7-12: %type redeclaration for exp
|
||||
input.y:1.7-12: previous declaration
|
||||
|
||||
In Bison 2.7, we indented them
|
||||
|
||||
input.y:2.7-12: error: %type redeclaration for exp
|
||||
input.y:1.7-12: previous declaration
|
||||
|
||||
Later we quoted the source in the diagnostics, and today we have:
|
||||
|
||||
/tmp/foo.y:1.12-14: warning: symbol FOO redeclared [-Wother]
|
||||
1 | %token FOO FOO
|
||||
| ^~~
|
||||
/tmp/foo.y:1.8-10: previous declaration
|
||||
1 | %token FOO FOO
|
||||
| ^~~
|
||||
|
||||
The indentation is no longer helping. We should probably get rid of it, or
|
||||
maybe keep it only when -fno-caret. GCC displays this as a "note":
|
||||
|
||||
$ g++-mp-9 -Wall /tmp/foo.c -c
|
||||
/tmp/foo.c:1:10: error: redefinition of 'int foo'
|
||||
1 | int foo, foo;
|
||||
| ^~~
|
||||
/tmp/foo.c:1:5: note: 'int foo' previously declared here
|
||||
1 | int foo, foo;
|
||||
| ^~~
|
||||
|
||||
Likewise for Clang, contrary to what I believed (because "note:" is written
|
||||
in black, so it doesn't show in my terminal :-)
|
||||
|
||||
$ clang++-mp-8.0 -Wall /tmp/foo.c -c
|
||||
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
|
||||
/tmp/foo.c:1:10: error: redefinition of 'foo'
|
||||
int foo, foo;
|
||||
^
|
||||
/tmp/foo.c:1:5: note: previous definition is here
|
||||
int foo, foo;
|
||||
^
|
||||
1 error generated.
|
||||
|
||||
See also the item "Complaint submessage indentation" below.
|
||||
** Get rid of YYPRINT and b4_toknum
|
||||
Besides yytoknum is wrong when api.token.raw is defined.
|
||||
|
||||
** Better design for diagnostics
|
||||
The current implementation of diagnostics is adhoc, it grew organically. It
|
||||
@@ -214,20 +231,6 @@ page:
|
||||
|
||||
https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html
|
||||
|
||||
** consistency
|
||||
token vs terminal, variable vs non terminal.
|
||||
|
||||
** C++
|
||||
Move to int everywhere instead of unsigned? stack_size, etc. The parser
|
||||
itself uses int (for yylen for instance), yet stack is based on size_t.
|
||||
|
||||
Maybe locations should also move to ints.
|
||||
|
||||
Paul Eggert already covered most of this. But before publishing these
|
||||
changes, we need to ask our C++ users if they agree with that change, or if
|
||||
we need some migration path. Could be a %define variable, or simply
|
||||
%require "3.5".
|
||||
|
||||
** 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
|
||||
@@ -312,13 +315,8 @@ It would be a very nice source of inspiration for the other languages.
|
||||
Valentin Tolmer is working on this.
|
||||
|
||||
** YYERRCODE
|
||||
Defined to 256, but not used, not documented. Probably the token
|
||||
number for the error token, which POSIX wants to be 256, but which
|
||||
Bison might renumber if the user used number 256. Keep fix and doc?
|
||||
Throw away?
|
||||
|
||||
Also, why don't we output the token name of the error token in the
|
||||
output? It is explicitly skipped:
|
||||
Why don't we output the token name of the error token in the output? It is
|
||||
explicitly skipped:
|
||||
|
||||
/* Skip error token and tokens without identifier. */
|
||||
if (sym != errtoken && id)
|
||||
@@ -600,23 +598,6 @@ 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.
|
||||
|
||||
* Complaint submessage indentation.
|
||||
We already have an implementation that works fairly well for named
|
||||
reference messages, but it would be nice to use it consistently for all
|
||||
submessages from Bison. For example, the "previous definition"
|
||||
submessage or the list of correct values for a %define variable might
|
||||
look better with indentation.
|
||||
|
||||
However, the current implementation makes the assumption that the
|
||||
location printed on the first line is not usually much shorter than the
|
||||
locations printed on the submessage lines that follow. That assumption
|
||||
may not hold true as often for some kinds of submessages especially if
|
||||
we ever support multiple grammar files.
|
||||
|
||||
Here's a proposal for how a new implementation might look:
|
||||
|
||||
http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00086.html
|
||||
|
||||
|
||||
Local Variables:
|
||||
mode: outline
|
||||
@@ -626,7 +607,7 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2001-2004, 2006, 2008-2015, 2018-2019 Free Software
|
||||
Copyright (C) 2001-2004, 2006, 2008-2015, 2018-2020 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -4,7 +4,7 @@ scriptversion=2019-01-04.17; # UTC
|
||||
|
||||
# Bootstrap this package from checked-out sources.
|
||||
|
||||
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Bootstrap configuration.
|
||||
|
||||
# Copyright (C) 2006-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2012-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2012-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2012-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2012-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
#! /usr/bin/env perl
|
||||
|
||||
# Generate a release announcement message.
|
||||
|
||||
# Copyright (C) 2007-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Written by Akim Demaille.
|
||||
|
||||
use warnings;
|
||||
use 5.005;
|
||||
use strict;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2000-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2000-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Update b4_copyright invocations or b4_copyright_years definitions to
|
||||
# include the current year.
|
||||
|
||||
# Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2009-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
||||
|
||||
# Copyright (C) 2010-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2010-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
# Update expectations in an Autotest test suite.
|
||||
|
||||
# Copyright (C) 2019-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Written by Akim Demaille.
|
||||
|
||||
# usage:
|
||||
#
|
||||
# update-test _build/8d/tests/testsuite.dir/*/testsuite.log
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## Customize maint.mk -*- makefile -*-
|
||||
## Copyright (C) 2008-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2008-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
||||
+44
-7
@@ -1,6 +1,6 @@
|
||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2001-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -26,8 +26,10 @@ m4_pattern_allow([^BISON_USE_NLS$])
|
||||
|
||||
AC_INIT([GNU Bison],
|
||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||
[[email protected]])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2019])
|
||||
[[email protected]],
|
||||
[],
|
||||
[https://www.gnu.org/software/bison/])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2020])
|
||||
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
|
||||
[The copyright year for this package])
|
||||
|
||||
@@ -100,12 +102,41 @@ 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.
|
||||
warn_common='-Wall -Wextra -Wcast-align
|
||||
#
|
||||
# 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 -Wnull-dereference
|
||||
-Wno-sign-compare -Wno-tautological-constant-out-of-range-compare
|
||||
-Wpointer-arith -Wshadow
|
||||
-Wwrite-strings'
|
||||
-Wwrite-strings
|
||||
-wr188 -wr2259 -wr3179'
|
||||
warn_c='-Wbad-function-cast -Wstrict-prototypes'
|
||||
warn_cxx='-Wextra-semi -Wnoexcept -Wold-style-cast -Wundefined-func-template
|
||||
-Wweak-vtables'
|
||||
@@ -151,8 +182,6 @@ if test "$enable_gcc_warnings" = yes; then
|
||||
|
||||
# Warnings for the test suite, and maybe for bison if GCC is modern
|
||||
# enough.
|
||||
gl_WARN_ADD([-Wmissing-declarations], [WARN_CFLAGS_TEST])
|
||||
gl_WARN_ADD([-Wmissing-prototypes], [WARN_CFLAGS_TEST])
|
||||
test $lv_cv_gcc_pragma_push_works = yes &&
|
||||
AS_VAR_APPEND([WARN_CFLAGS], [" $WARN_CFLAGS_TEST"])
|
||||
|
||||
@@ -179,6 +208,14 @@ if test "$enable_gcc_warnings" = yes; then
|
||||
[[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;
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2002, 2008-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2008-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Default styling rules for Bison when doing terminal output.
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2019-2020 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2002, 2005-2015, 2018-2019 Free Software Foundation,
|
||||
## Copyright (C) 2002, 2005-2015, 2018-2020 Free Software Foundation,
|
||||
## Inc.
|
||||
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+9
-10
@@ -2,7 +2,7 @@
|
||||
|
||||
# Language-independent M4 Macros for Bison.
|
||||
|
||||
# Copyright (C) 2002, 2004-2015, 2018-2019 Free Software Foundation,
|
||||
# Copyright (C) 2002, 2004-2015, 2018-2020 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -192,7 +192,7 @@ m4_define([b4_error],
|
||||
# @warn(1@)
|
||||
# @warn(1@,2@)
|
||||
m4_define([b4_warn],
|
||||
[b4_error([[warn]], [], [], $@)])
|
||||
[b4_warn_at([], [], $@)])
|
||||
|
||||
# b4_warn_at(START, END, FORMAT, [ARG1], [ARG2], ...)
|
||||
# ---------------------------------------------------
|
||||
@@ -210,7 +210,7 @@ m4_define([b4_warn_at],
|
||||
#
|
||||
# See b4_warn example.
|
||||
m4_define([b4_complain],
|
||||
[b4_error([[complain]], [], [], $@)])
|
||||
[b4_complain_at([], [], $@)])
|
||||
|
||||
# b4_complain_at(START, END, FORMAT, [ARG1], [ARG2], ...)
|
||||
# -------------------------------------------------------
|
||||
@@ -226,8 +226,7 @@ m4_define([b4_complain_at],
|
||||
#
|
||||
# See b4_warn example.
|
||||
m4_define([b4_fatal],
|
||||
[b4_error([[fatal]], [], [], $@)dnl
|
||||
m4_exit(1)])
|
||||
[b4_fatal_at([], [], $@)])
|
||||
|
||||
# b4_fatal_at(START, END, FORMAT, [ARG1], [ARG2], ...)
|
||||
# ----------------------------------------------------
|
||||
@@ -533,9 +532,9 @@ m4_define([b4_any_token_visible_if],
|
||||
# ----------------------------
|
||||
m4_define([b4_token_format],
|
||||
[b4_token_visible_if([$2],
|
||||
[m4_quote(m4_format([$1],
|
||||
[b4_symbol([$2], [id])],
|
||||
[b4_symbol([$2], b4_api_token_raw_if([[number]], [[user_number]]))]))])])
|
||||
[m4_format([[$1]],
|
||||
m4_quote(b4_symbol([$2], [id])),
|
||||
m4_quote(b4_symbol([$2], b4_api_token_raw_if([[number]], [[user_number]]))))])])
|
||||
|
||||
|
||||
## ------- ##
|
||||
@@ -976,8 +975,8 @@ m4_define([b4_percent_code_get],
|
||||
[m4_pushdef([b4_macro_name], [[b4_percent_code(]$1[)]])dnl
|
||||
m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])dnl
|
||||
m4_ifdef(b4_macro_name,
|
||||
[b4_comment([m4_if([$#], [0], [[Unqualified %code]],
|
||||
[["%code ]$1["]])[ blocks.]])
|
||||
[b4_comment(m4_if([$#], [0], [[[Unqualified %code blocks.]]],
|
||||
[[["%code ]$1[" blocks.]]]))
|
||||
b4_user_code([m4_indir(b4_macro_name)])])dnl
|
||||
m4_popdef([b4_macro_name])])
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# C++ skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2015, 2018-2019 Free Software
|
||||
# Copyright (C) 2006-2007, 2009-2015, 2018-2020 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+7
-27
@@ -2,7 +2,7 @@
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -367,9 +367,6 @@ m4_define([b4_symbol_type_define],
|
||||
/// \a empty when empty.
|
||||
symbol_number_type type_get () const YY_NOEXCEPT;
|
||||
|
||||
/// The token.
|
||||
token_type token () const YY_NOEXCEPT;
|
||||
|
||||
/// The symbol type.
|
||||
/// \a empty_symbol when empty.
|
||||
/// An int, not token_number_type, to be able to store empty_symbol.
|
||||
@@ -498,22 +495,7 @@ m4_define([b4_public_types_define],
|
||||
{
|
||||
return type;
|
||||
}
|
||||
]b4_token_ctor_if([[
|
||||
]b4_inline([$1])b4_parser_class[::token_type
|
||||
]b4_parser_class[::by_type::token () const YY_NOEXCEPT
|
||||
{
|
||||
// YYTOKNUM[NUM] -- (External) token number corresponding to the
|
||||
// (internal) symbol number NUM (which must be that of a token). */
|
||||
static
|
||||
const ]b4_int_type_for([b4_toknum])[
|
||||
yytoken_number_[] =
|
||||
{
|
||||
]b4_toknum[
|
||||
};
|
||||
return token_type (yytoken_number_[type]);
|
||||
}
|
||||
]])[]dnl
|
||||
])
|
||||
]])
|
||||
|
||||
|
||||
# b4_token_constructor_define
|
||||
@@ -529,11 +511,10 @@ m4_define([b4_token_constructor_define], [])
|
||||
# sometimes in the cc file.
|
||||
m4_define([b4_yytranslate_define],
|
||||
[ b4_inline([$1])b4_parser_class[::token_number_type
|
||||
]b4_parser_class[::yytranslate_ (]b4_token_ctor_if([token_type],
|
||||
[int])[ t)
|
||||
]b4_parser_class[::yytranslate_ (int t)
|
||||
{
|
||||
]b4_api_token_raw_if(
|
||||
[[ return static_cast<yy::parser::token_number_type> (t);]],
|
||||
[[ return static_cast<token_number_type> (t);]],
|
||||
[[ // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
|
||||
// TOKEN-NUM as returned by yylex.
|
||||
static
|
||||
@@ -543,14 +524,13 @@ m4_define([b4_yytranslate_define],
|
||||
]b4_translate[
|
||||
};
|
||||
const int user_token_number_max_ = ]b4_user_token_number_max[;
|
||||
const token_number_type undef_token_ = ]b4_undef_token_number[;
|
||||
|
||||
if (static_cast<int> (t) <= yyeof_)
|
||||
if (t <= 0)
|
||||
return yyeof_;
|
||||
else if (static_cast<int> (t) <= user_token_number_max_)
|
||||
else if (t <= user_token_number_max_)
|
||||
return translate_table[t];
|
||||
else
|
||||
return undef_token_;]])[
|
||||
return yy_undef_token_;]])[
|
||||
}
|
||||
]])
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Common code for C-like languages (C, C++, Java, etc.)
|
||||
|
||||
# Copyright (C) 2012-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2012-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# C skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2015, 2018-2019 Free Software
|
||||
# Copyright (C) 2006-2007, 2009-2015, 2018-2020 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+17
-5
@@ -2,7 +2,7 @@
|
||||
|
||||
# C M4 Macros for Bison.
|
||||
|
||||
# Copyright (C) 2002, 2004-2015, 2018-2019 Free Software Foundation,
|
||||
# Copyright (C) 2002, 2004-2015, 2018-2020 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -327,11 +327,11 @@ m4_define([b4_attribute_define],
|
||||
|
||||
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
|
||||
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
||||
_Pragma ("GCC diagnostic pop")
|
||||
#else
|
||||
# define YY_INITIAL_VALUE(Value) Value
|
||||
@@ -343,6 +343,18 @@ m4_define([b4_attribute_define],
|
||||
#ifndef YY_INITIAL_VALUE
|
||||
# define YY_INITIAL_VALUE(Value) /* Nothing. */
|
||||
#endif
|
||||
|
||||
#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
|
||||
# define YY_IGNORE_USELESS_CAST_BEGIN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
|
||||
# define YY_IGNORE_USELESS_CAST_END \
|
||||
_Pragma ("GCC diagnostic pop")
|
||||
#endif
|
||||
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
|
||||
# define YY_IGNORE_USELESS_CAST_BEGIN
|
||||
# define YY_IGNORE_USELESS_CAST_END
|
||||
#endif
|
||||
]])
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# D skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# D language support for Bison
|
||||
|
||||
# Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
+172
-158
@@ -2,7 +2,7 @@
|
||||
|
||||
# GLR skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -198,7 +198,7 @@ b4_glr_cc_if([],
|
||||
[b4_defines_if(
|
||||
[b4_output_begin([b4_spec_header_file])
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||
[2002-2015, 2018-2019])[
|
||||
[2002-2015, 2018-2020])[
|
||||
]b4_cpp_guard_open([b4_spec_header_file])[
|
||||
]b4_shared_declarations[
|
||||
]b4_cpp_guard_close([b4_spec_header_file])[
|
||||
@@ -212,7 +212,7 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||
|
||||
b4_output_begin([b4_parser_file_name])
|
||||
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
||||
[2002-2015, 2018-2019])[
|
||||
[2002-2015, 2018-2020])[
|
||||
/* C GLR parser skeleton written by Paul Hilfinger. */
|
||||
|
||||
]b4_disclaimer[
|
||||
@@ -311,15 +311,20 @@ static YYLTYPE yyloc_default][]b4_yyloc_default;])[
|
||||
# define YYLONGJMP(Env, Val) \
|
||||
do { \
|
||||
longjmp (Env, Val); \
|
||||
YYASSERT (0); \
|
||||
YY_ASSERT (0); \
|
||||
} while (yyfalse)
|
||||
#endif
|
||||
|
||||
]b4_attribute_define([noreturn])[
|
||||
|
||||
#ifndef YYASSERT
|
||||
# define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0)))
|
||||
]b4_parse_assert_if([[#ifdef NDEBUG
|
||||
# define YY_ASSERT(E) ((void) (0 && (E)))
|
||||
#else
|
||||
# include <assert.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# define YY_ASSERT(E) assert (E)
|
||||
#endif
|
||||
]],
|
||||
[[#define YY_ASSERT(E) ((void) (0 && (E)))]])[
|
||||
|
||||
/* YYFINAL -- State number of the termination state. */
|
||||
#define YYFINAL ]b4_final_state_number[
|
||||
@@ -470,23 +475,36 @@ typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG;
|
||||
# define YYFPRINTF fprintf
|
||||
# endif
|
||||
|
||||
]b4_yy_location_print_define[
|
||||
# define YY_FPRINTF \
|
||||
YY_IGNORE_USELESS_CAST_BEGIN YY_FPRINTF_
|
||||
|
||||
# define YYDPRINTF(Args) \
|
||||
# define YY_FPRINTF_(Args) \
|
||||
do { \
|
||||
YYFPRINTF Args; \
|
||||
YY_IGNORE_USELESS_CAST_END \
|
||||
} while (0)
|
||||
|
||||
# define YY_DPRINTF \
|
||||
YY_IGNORE_USELESS_CAST_BEGIN YY_DPRINTF_
|
||||
|
||||
# define YY_DPRINTF_(Args) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
YYFPRINTF Args; \
|
||||
YY_IGNORE_USELESS_CAST_END \
|
||||
} while (0)
|
||||
|
||||
]b4_yy_location_print_define[
|
||||
|
||||
]b4_yy_symbol_print_define[
|
||||
|
||||
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
|
||||
do { \
|
||||
if (yydebug) \
|
||||
{ \
|
||||
YYFPRINTF (stderr, "%s ", Title); \
|
||||
YY_FPRINTF ((stderr, "%s ", Title)); \
|
||||
yy_symbol_print (stderr, Type, Value]b4_locuser_args([Location])[); \
|
||||
YYFPRINTF (stderr, "\n"); \
|
||||
YY_FPRINTF ((stderr, "\n")); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@@ -502,7 +520,7 @@ static void yypdumpstack (struct yyGLRStack* yystackp)
|
||||
|
||||
#else /* !]b4_api_PREFIX[DEBUG */
|
||||
|
||||
# define YYDPRINTF(Args)
|
||||
# define YY_DPRINTF(Args) do {} while (yyfalse)
|
||||
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
|
||||
|
||||
#endif /* !]b4_api_PREFIX[DEBUG */
|
||||
@@ -743,10 +761,7 @@ yyMemoryExhausted (yyGLRStack* yystackp)
|
||||
static inline const char*
|
||||
yytokenName (yySymbol yytoken)
|
||||
{
|
||||
if (yytoken == YYEMPTY)
|
||||
return "";
|
||||
|
||||
return yytname[yytoken];
|
||||
return yytoken == YYEMPTY ? "" : yytname[yytoken];
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -786,7 +801,7 @@ yygetToken (int *yycharp][]b4_pure_if([, yyGLRStack* yystackp])[]b4_user_formals
|
||||
]b4_parse_param_use()dnl
|
||||
[ if (*yycharp == YYEMPTY)
|
||||
{
|
||||
YYDPRINTF ((stderr, "Reading a token: "));]b4_glr_cc_if([[
|
||||
YY_DPRINTF ((stderr, "Reading a token: "));]b4_glr_cc_if([[
|
||||
#if YY_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
@@ -796,7 +811,7 @@ yygetToken (int *yycharp][]b4_pure_if([, yyGLRStack* yystackp])[]b4_user_formals
|
||||
}
|
||||
catch (const ]b4_namespace_ref[::]b4_parser_class[::syntax_error& yyexc)
|
||||
{
|
||||
YYDPRINTF ((stderr, "Caught exception: %s\n", yyexc.what()));]b4_locations_if([
|
||||
YY_DPRINTF ((stderr, "Caught exception: %s\n", yyexc.what()));]b4_locations_if([
|
||||
yylloc = yyexc.location;])[
|
||||
yyerror (]b4_lyyerror_args[yyexc.what ());
|
||||
// Map errors caught in the scanner to the undefined token
|
||||
@@ -810,7 +825,7 @@ yygetToken (int *yycharp][]b4_pure_if([, yyGLRStack* yystackp])[]b4_user_formals
|
||||
if (*yycharp <= YYEOF)
|
||||
{
|
||||
*yycharp = yytoken = YYEOF;
|
||||
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
||||
YY_DPRINTF ((stderr, "Now at end of input.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -846,8 +861,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
|
||||
yyGLRStack* yystackp,
|
||||
YYSTYPE* yyvalp]b4_locuser_formals[)
|
||||
{
|
||||
yybool yynormal YY_ATTRIBUTE_UNUSED
|
||||
= YY_CAST (yybool, yystackp->yysplitPoint == YY_NULLPTR);
|
||||
yybool yynormal YY_ATTRIBUTE_UNUSED = yystackp->yysplitPoint == YY_NULLPTR;
|
||||
int yylow;
|
||||
]b4_parse_param_use([yyvalp], [yylocp])dnl
|
||||
[ YYUSE (yyrhslen);
|
||||
@@ -893,7 +907,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
|
||||
}
|
||||
catch (const syntax_error& yyexc)
|
||||
{
|
||||
YYDPRINTF ((stderr, "Caught exception: %s\n", yyexc.what()));]b4_locations_if([
|
||||
YY_DPRINTF ((stderr, "Caught exception: %s\n", yyexc.what()));]b4_locations_if([
|
||||
*yylocp = yyexc.location;])[
|
||||
yyerror (]b4_yyerror_args[yyexc.what ());
|
||||
YYERROR;
|
||||
@@ -947,9 +961,9 @@ yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[)
|
||||
if (yydebug)
|
||||
{
|
||||
if (yys->yysemantics.yyfirstVal)
|
||||
YYFPRINTF (stderr, "%s unresolved", yymsg);
|
||||
YY_FPRINTF ((stderr, "%s unresolved", yymsg));
|
||||
else
|
||||
YYFPRINTF (stderr, "%s incomplete", yymsg);
|
||||
YY_FPRINTF ((stderr, "%s incomplete", yymsg));
|
||||
YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULLPTR, &yys->yyloc);
|
||||
}
|
||||
#endif
|
||||
@@ -982,7 +996,7 @@ yylhsNonterm (yyRuleNum yyrule)
|
||||
static inline yybool
|
||||
yyisDefaultedState (yyStateNum yystate)
|
||||
{
|
||||
return YY_CAST (yybool, yypact_value_is_default (yypact[yystate]));
|
||||
return yypact_value_is_default (yypact[yystate]);
|
||||
}
|
||||
|
||||
/** The default reduction for YYSTATE, assuming it has one. */
|
||||
@@ -1042,13 +1056,13 @@ yyLRgotoState (yyStateNum yystate, yySymbol yysym)
|
||||
static inline yybool
|
||||
yyisShiftAction (int yyaction)
|
||||
{
|
||||
return YY_CAST (yybool, 0 < yyaction);
|
||||
return 0 < yyaction;
|
||||
}
|
||||
|
||||
static inline yybool
|
||||
yyisErrorAction (int yyaction)
|
||||
{
|
||||
return YY_CAST (yybool, yyaction == 0);
|
||||
return yyaction == 0;
|
||||
}
|
||||
|
||||
/* GLRStates */
|
||||
@@ -1078,7 +1092,7 @@ yyaddDeferredAction (yyGLRStack* yystackp, ptrdiff_t yyk, yyGLRState* yystate,
|
||||
{
|
||||
yySemanticOption* yynewOption =
|
||||
&yynewGLRStackItem (yystackp, yyfalse)->yyoption;
|
||||
YYASSERT (!yynewOption->yyisState);
|
||||
YY_ASSERT (!yynewOption->yyisState);
|
||||
yynewOption->yystate = yyrhs;
|
||||
yynewOption->yyrule = yyrule;
|
||||
if (yystackp->yytops.yylookaheadNeeds[yyk])
|
||||
@@ -1259,7 +1273,7 @@ yyundeleteLastStack (yyGLRStack* yystackp)
|
||||
return;
|
||||
yystackp->yytops.yystates[0] = yystackp->yylastDeleted;
|
||||
yystackp->yytops.yysize = 1;
|
||||
YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
|
||||
YY_DPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
|
||||
yystackp->yylastDeleted = YY_NULLPTR;
|
||||
}
|
||||
|
||||
@@ -1273,9 +1287,7 @@ yyremoveDeletes (yyGLRStack* yystackp)
|
||||
if (yystackp->yytops.yystates[yyi] == YY_NULLPTR)
|
||||
{
|
||||
if (yyi == yyj)
|
||||
{
|
||||
YYDPRINTF ((stderr, "Removing dead stacks.\n"));
|
||||
}
|
||||
YY_DPRINTF ((stderr, "Removing dead stacks.\n"));
|
||||
yystackp->yytops.yysize -= 1;
|
||||
}
|
||||
else
|
||||
@@ -1289,10 +1301,8 @@ yyremoveDeletes (yyGLRStack* yystackp)
|
||||
yystackp->yytops.yylookaheadNeeds[yyj] =
|
||||
yystackp->yytops.yylookaheadNeeds[yyi];
|
||||
if (yyj != yyi)
|
||||
{
|
||||
YYDPRINTF ((stderr, "Rename stack %ld -> %ld.\n",
|
||||
YY_CAST (long, yyi), YY_CAST (long, yyj)));
|
||||
}
|
||||
YY_DPRINTF ((stderr, "Rename stack %ld -> %ld.\n",
|
||||
YY_CAST (long, yyi), YY_CAST (long, yyj)));
|
||||
yyj += 1;
|
||||
}
|
||||
yyi += 1;
|
||||
@@ -1328,7 +1338,7 @@ yyglrShiftDefer (yyGLRStack* yystackp, ptrdiff_t yyk, yyStateNum yylrState,
|
||||
ptrdiff_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule)
|
||||
{
|
||||
yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
|
||||
YYASSERT (yynewState->yyisState);
|
||||
YY_ASSERT (yynewState->yyisState);
|
||||
|
||||
yynewState->yylrState = yylrState;
|
||||
yynewState->yyposn = yyposn;
|
||||
@@ -1361,22 +1371,22 @@ yy_reduce_print (yybool yynormal, yyGLRStackItem* yyvsp, ptrdiff_t yyk,
|
||||
int yynrhs = yyrhsLength (yyrule);]b4_locations_if([
|
||||
int yylow = 1;])[
|
||||
int yyi;
|
||||
YYFPRINTF (stderr, "Reducing stack %ld by rule %d (line %d):\n",
|
||||
YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule]);
|
||||
YY_FPRINTF ((stderr, "Reducing stack %ld by rule %d (line %d):\n",
|
||||
YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule]));
|
||||
if (! yynormal)
|
||||
yyfillin (yyvsp, 1, -yynrhs);
|
||||
/* The symbols being reduced. */
|
||||
for (yyi = 0; yyi < yynrhs; yyi++)
|
||||
{
|
||||
YYFPRINTF (stderr, " $%d = ", yyi + 1);
|
||||
YY_FPRINTF ((stderr, " $%d = ", yyi + 1));
|
||||
yy_symbol_print (stderr,
|
||||
yystos[yyvsp[yyi - yynrhs + 1].yystate.yylrState],
|
||||
&yyvsp[yyi - yynrhs + 1].yystate.yysemantics.yysval]b4_locations_if([,
|
||||
&]b4_rhs_location(yynrhs, yyi + 1))[]dnl
|
||||
b4_user_args[);
|
||||
if (!yyvsp[yyi - yynrhs + 1].yystate.yyresolved)
|
||||
YYFPRINTF (stderr, " (unresolved)");
|
||||
YYFPRINTF (stderr, "\n");
|
||||
YY_FPRINTF ((stderr, " (unresolved)"));
|
||||
YY_FPRINTF ((stderr, "\n"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1398,7 +1408,7 @@ yydoAction (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
|
||||
/* Standard special case: single stack. */
|
||||
yyGLRStackItem* yyrhs
|
||||
= YY_REINTERPRET_CAST (yyGLRStackItem*, yystackp->yytops.yystates[yyk]);
|
||||
YYASSERT (yyk == 0);
|
||||
YY_ASSERT (yyk == 0);
|
||||
yystackp->yynextFree -= yynrhs;
|
||||
yystackp->yyspaceLeft += yynrhs;
|
||||
yystackp->yytops.yystates[0] = & yystackp->yynextFree[-1].yystate;
|
||||
@@ -1418,7 +1428,7 @@ yydoAction (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
|
||||
for (yyi = 0; yyi < yynrhs; yyi += 1)
|
||||
{
|
||||
yys = yys->yypred;
|
||||
YYASSERT (yys);
|
||||
YY_ASSERT (yys);
|
||||
}
|
||||
yyupdateSplit (yystackp, yys);
|
||||
yystackp->yytops.yystates[yyk] = yys;
|
||||
@@ -1452,11 +1462,9 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
|
||||
|
||||
YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[);
|
||||
if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULLPTR)
|
||||
{
|
||||
YYDPRINTF ((stderr,
|
||||
"Parse on stack %ld rejected by rule %d (line %d).\n",
|
||||
YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule - 1]));
|
||||
}
|
||||
YY_DPRINTF ((stderr,
|
||||
"Parse on stack %ld rejected by rule %d (line %d).\n",
|
||||
YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule - 1]));
|
||||
if (yyflag != yyok)
|
||||
return yyflag;
|
||||
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyrule], &yysval, &yyloc);
|
||||
@@ -1476,15 +1484,15 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
|
||||
0 < yyn; yyn -= 1)
|
||||
{
|
||||
yys = yys->yypred;
|
||||
YYASSERT (yys);
|
||||
YY_ASSERT (yys);
|
||||
}
|
||||
yyupdateSplit (yystackp, yys);
|
||||
yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
|
||||
YYDPRINTF ((stderr,
|
||||
"Reduced stack %ld by rule %d (line %d); action deferred. "
|
||||
"Now in state %d.\n",
|
||||
YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule - 1],
|
||||
yynewLRState));
|
||||
YY_DPRINTF ((stderr,
|
||||
"Reduced stack %ld by rule %d (line %d); action deferred. "
|
||||
"Now in state %d.\n",
|
||||
YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule - 1],
|
||||
yynewLRState));
|
||||
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
|
||||
if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULLPTR)
|
||||
{
|
||||
@@ -1496,8 +1504,8 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk, yyRuleNum yyrule,
|
||||
{
|
||||
yyaddDeferredAction (yystackp, yyk, yyp, yys0, yyrule);
|
||||
yymarkStackDeleted (yystackp, yyk);
|
||||
YYDPRINTF ((stderr, "Merging stack %ld into stack %ld.\n",
|
||||
YY_CAST (long, yyk), YY_CAST (long, yyi)));
|
||||
YY_DPRINTF ((stderr, "Merging stack %ld into stack %ld.\n",
|
||||
YY_CAST (long, yyk), YY_CAST (long, yyi)));
|
||||
return yyok;
|
||||
}
|
||||
yyp = yyp->yypred;
|
||||
@@ -1514,44 +1522,45 @@ yysplitStack (yyGLRStack* yystackp, ptrdiff_t yyk)
|
||||
{
|
||||
if (yystackp->yysplitPoint == YY_NULLPTR)
|
||||
{
|
||||
YYASSERT (yyk == 0);
|
||||
YY_ASSERT (yyk == 0);
|
||||
yystackp->yysplitPoint = yystackp->yytops.yystates[yyk];
|
||||
}
|
||||
if (yystackp->yytops.yysize >= yystackp->yytops.yycapacity)
|
||||
if (yystackp->yytops.yycapacity <= yystackp->yytops.yysize)
|
||||
{
|
||||
yyGLRState** yynewStates = YY_NULLPTR;
|
||||
yybool* yynewLookaheadNeeds;
|
||||
ptrdiff_t state_size = sizeof yynewStates[0];
|
||||
ptrdiff_t state_size = sizeof yystackp->yytops.yystates[0];
|
||||
ptrdiff_t half_max_capacity = YYSIZEMAX / 2 / state_size;
|
||||
|
||||
if (half_max_capacity < yystackp->yytops.yycapacity)
|
||||
yyMemoryExhausted (yystackp);
|
||||
yystackp->yytops.yycapacity *= 2;
|
||||
|
||||
yynewStates
|
||||
= YY_CAST (yyGLRState**,
|
||||
YYREALLOC (yystackp->yytops.yystates,
|
||||
(YY_CAST (size_t, yystackp->yytops.yycapacity)
|
||||
* sizeof yynewStates[0])));
|
||||
if (yynewStates == YY_NULLPTR)
|
||||
yyMemoryExhausted (yystackp);
|
||||
yystackp->yytops.yystates = yynewStates;
|
||||
{
|
||||
yyGLRState** yynewStates
|
||||
= YY_CAST (yyGLRState**,
|
||||
YYREALLOC (yystackp->yytops.yystates,
|
||||
(YY_CAST (size_t, yystackp->yytops.yycapacity)
|
||||
* sizeof yynewStates[0])));
|
||||
if (yynewStates == YY_NULLPTR)
|
||||
yyMemoryExhausted (yystackp);
|
||||
yystackp->yytops.yystates = yynewStates;
|
||||
}
|
||||
|
||||
yynewLookaheadNeeds
|
||||
= YY_CAST (yybool*,
|
||||
YYREALLOC (yystackp->yytops.yylookaheadNeeds,
|
||||
(YY_CAST (size_t, yystackp->yytops.yycapacity)
|
||||
* sizeof yynewLookaheadNeeds[0])));
|
||||
if (yynewLookaheadNeeds == YY_NULLPTR)
|
||||
yyMemoryExhausted (yystackp);
|
||||
yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
|
||||
{
|
||||
yybool* yynewLookaheadNeeds
|
||||
= YY_CAST (yybool*,
|
||||
YYREALLOC (yystackp->yytops.yylookaheadNeeds,
|
||||
(YY_CAST (size_t, yystackp->yytops.yycapacity)
|
||||
* sizeof yynewLookaheadNeeds[0])));
|
||||
if (yynewLookaheadNeeds == YY_NULLPTR)
|
||||
yyMemoryExhausted (yystackp);
|
||||
yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
|
||||
}
|
||||
}
|
||||
yystackp->yytops.yystates[yystackp->yytops.yysize]
|
||||
= yystackp->yytops.yystates[yyk];
|
||||
yystackp->yytops.yylookaheadNeeds[yystackp->yytops.yysize]
|
||||
= yystackp->yytops.yylookaheadNeeds[yyk];
|
||||
yystackp->yytops.yysize += 1;
|
||||
return yystackp->yytops.yysize-1;
|
||||
return yystackp->yytops.yysize - 1;
|
||||
}
|
||||
|
||||
/** True iff YYY0 and YYY1 represent identical options at the top level.
|
||||
@@ -1585,7 +1594,7 @@ yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1)
|
||||
int yyn;
|
||||
for (yys0 = yyy0->yystate, yys1 = yyy1->yystate,
|
||||
yyn = yyrhsLength (yyy0->yyrule);
|
||||
yyn > 0;
|
||||
0 < yyn;
|
||||
yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1)
|
||||
{
|
||||
if (yys0 == yys1)
|
||||
@@ -1667,7 +1676,7 @@ yyresolveStates (yyGLRState* yys, int yyn,
|
||||
{
|
||||
if (0 < yyn)
|
||||
{
|
||||
YYASSERT (yys->yypred);
|
||||
YY_ASSERT (yys->yypred);
|
||||
YYCHK (yyresolveStates (yys->yypred, yyn-1, yystackp]b4_user_args[));
|
||||
if (! yys->yyresolved)
|
||||
YYCHK (yyresolveValue (yys, yystackp]b4_user_args[));
|
||||
@@ -1738,26 +1747,26 @@ yyreportTree (yySemanticOption* yyx, int yyindent)
|
||||
yystates[0] = yys;
|
||||
|
||||
if (yyx->yystate->yyposn < yys->yyposn + 1)
|
||||
YYFPRINTF (stderr, "%*s%s -> <Rule %d, empty>\n",
|
||||
yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
|
||||
yyx->yyrule - 1);
|
||||
YY_FPRINTF ((stderr, "%*s%s -> <Rule %d, empty>\n",
|
||||
yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
|
||||
yyx->yyrule - 1));
|
||||
else
|
||||
YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %ld .. %ld>\n",
|
||||
yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
|
||||
yyx->yyrule - 1, YY_CAST (long, yys->yyposn + 1),
|
||||
YY_CAST (long, yyx->yystate->yyposn));
|
||||
YY_FPRINTF ((stderr, "%*s%s -> <Rule %d, tokens %ld .. %ld>\n",
|
||||
yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
|
||||
yyx->yyrule - 1, YY_CAST (long, yys->yyposn + 1),
|
||||
YY_CAST (long, yyx->yystate->yyposn)));
|
||||
for (yyi = 1; yyi <= yynrhs; yyi += 1)
|
||||
{
|
||||
if (yystates[yyi]->yyresolved)
|
||||
{
|
||||
if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn)
|
||||
YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
|
||||
yytokenName (yystos[yystates[yyi]->yylrState]));
|
||||
YY_FPRINTF ((stderr, "%*s%s <empty>\n", yyindent+2, "",
|
||||
yytokenName (yystos[yystates[yyi]->yylrState])));
|
||||
else
|
||||
YYFPRINTF (stderr, "%*s%s <tokens %ld .. %ld>\n", yyindent+2, "",
|
||||
yytokenName (yystos[yystates[yyi]->yylrState]),
|
||||
YY_CAST (long, yystates[yyi-1]->yyposn + 1),
|
||||
YY_CAST (long, yystates[yyi]->yyposn));
|
||||
YY_FPRINTF ((stderr, "%*s%s <tokens %ld .. %ld>\n", yyindent+2, "",
|
||||
yytokenName (yystos[yystates[yyi]->yylrState]),
|
||||
YY_CAST (long, yystates[yyi-1]->yyposn + 1),
|
||||
YY_CAST (long, yystates[yyi]->yyposn)));
|
||||
}
|
||||
else
|
||||
yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2);
|
||||
@@ -1773,12 +1782,12 @@ yyreportAmbiguity (yySemanticOption* yyx0,
|
||||
YYUSE (yyx1);
|
||||
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
YYFPRINTF (stderr, "Ambiguity detected.\n");
|
||||
YYFPRINTF (stderr, "Option 1,\n");
|
||||
YY_FPRINTF ((stderr, "Ambiguity detected.\n"));
|
||||
YY_FPRINTF ((stderr, "Option 1,\n"));
|
||||
yyreportTree (yyx0, 2);
|
||||
YYFPRINTF (stderr, "\nOption 2,\n");
|
||||
YY_FPRINTF ((stderr, "\nOption 2,\n"));
|
||||
yyreportTree (yyx1, 2);
|
||||
YYFPRINTF (stderr, "\n");
|
||||
YY_FPRINTF ((stderr, "\n"));
|
||||
#endif
|
||||
|
||||
yyerror (]b4_yyerror_args[YY_("syntax is ambiguous"));
|
||||
@@ -1800,7 +1809,7 @@ yyresolveLocations (yyGLRState *yys1, int yyn1,
|
||||
yyGLRStackItem yyrhsloc[1 + YYMAXRHS];
|
||||
int yynrhs;
|
||||
yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal;
|
||||
YYASSERT (yyoption);
|
||||
YY_ASSERT (yyoption);
|
||||
yynrhs = yyrhsLength (yyoption->yyrule);
|
||||
if (0 < yynrhs)
|
||||
{
|
||||
@@ -1875,7 +1884,7 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
|
||||
yymerge = yyfalse;
|
||||
break;
|
||||
default:
|
||||
/* This cannot happen so it is not worth a YYASSERT (yyfalse),
|
||||
/* This cannot happen so it is not worth a YY_ASSERT (yyfalse),
|
||||
but some compilers complain if the default case is
|
||||
omitted. */
|
||||
break;
|
||||
@@ -1976,9 +1985,10 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
|
||||
while (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
|
||||
{
|
||||
yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState;
|
||||
YYDPRINTF ((stderr, "Stack %ld Entering state %d\n", yyk, yystate));
|
||||
YY_DPRINTF ((stderr, "Stack %ld Entering state %d\n",
|
||||
YY_CAST (long, yyk), yystate));
|
||||
|
||||
YYASSERT (yystate != YYFINAL);
|
||||
YY_ASSERT (yystate != YYFINAL);
|
||||
|
||||
if (yyisDefaultedState (yystate))
|
||||
{
|
||||
@@ -1986,17 +1996,17 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
|
||||
yyRuleNum yyrule = yydefaultAction (yystate);
|
||||
if (yyrule == 0)
|
||||
{
|
||||
YYDPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yyk)));
|
||||
YY_DPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yyk)));
|
||||
yymarkStackDeleted (yystackp, yyk);
|
||||
return yyok;
|
||||
}
|
||||
yyflag = yyglrReduce (yystackp, yyk, yyrule, yyimmediate[yyrule]]b4_user_args[);
|
||||
if (yyflag == yyerr)
|
||||
{
|
||||
YYDPRINTF ((stderr,
|
||||
"Stack %ld dies "
|
||||
"(predicate failure or explicit user error).\n",
|
||||
YY_CAST (long, yyk)));
|
||||
YY_DPRINTF ((stderr,
|
||||
"Stack %ld dies "
|
||||
"(predicate failure or explicit user error).\n",
|
||||
YY_CAST (long, yyk)));
|
||||
yymarkStackDeleted (yystackp, yyk);
|
||||
return yyok;
|
||||
}
|
||||
@@ -2014,8 +2024,8 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
|
||||
{
|
||||
YYRESULTTAG yyflag;
|
||||
ptrdiff_t yynewStack = yysplitStack (yystackp, yyk);
|
||||
YYDPRINTF ((stderr, "Splitting off stack %ld from %ld.\n",
|
||||
YY_CAST (long, yynewStack), YY_CAST (long, yyk)));
|
||||
YY_DPRINTF ((stderr, "Splitting off stack %ld from %ld.\n",
|
||||
YY_CAST (long, yynewStack), YY_CAST (long, yyk)));
|
||||
yyflag = yyglrReduce (yystackp, yynewStack,
|
||||
*yyconflicts,
|
||||
yyimmediate[*yyconflicts]]b4_user_args[);
|
||||
@@ -2024,7 +2034,7 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
|
||||
yyposn]b4_pure_args[));
|
||||
else if (yyflag == yyerr)
|
||||
{
|
||||
YYDPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yynewStack)));
|
||||
YY_DPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yynewStack)));
|
||||
yymarkStackDeleted (yystackp, yynewStack);
|
||||
}
|
||||
else
|
||||
@@ -2036,7 +2046,7 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
|
||||
break;
|
||||
else if (yyisErrorAction (yyaction))
|
||||
{
|
||||
YYDPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yyk)));
|
||||
YY_DPRINTF ((stderr, "Stack %ld dies.\n", YY_CAST (long, yyk)));
|
||||
yymarkStackDeleted (yystackp, yyk);
|
||||
break;
|
||||
}
|
||||
@@ -2046,10 +2056,10 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
|
||||
yyimmediate[-yyaction]]b4_user_args[);
|
||||
if (yyflag == yyerr)
|
||||
{
|
||||
YYDPRINTF ((stderr,
|
||||
"Stack %ld dies "
|
||||
"(predicate failure or explicit user error).\n",
|
||||
YY_CAST (long, yyk)));
|
||||
YY_DPRINTF ((stderr,
|
||||
"Stack %ld dies "
|
||||
"(predicate failure or explicit user error).\n",
|
||||
YY_CAST (long, yyk)));
|
||||
yymarkStackDeleted (yystackp, yyk);
|
||||
break;
|
||||
}
|
||||
@@ -2071,18 +2081,18 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
#else
|
||||
{
|
||||
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
|
||||
ptrdiff_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken));
|
||||
ptrdiff_t yysize = yysize0;
|
||||
yybool yysize_overflow = yyfalse;
|
||||
char* yymsg = YY_NULLPTR;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = YY_NULLPTR;
|
||||
/* Arguments of yyformat. */
|
||||
/* Arguments of yyformat: reported tokens (one for the "unexpected",
|
||||
one per "expected"). */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
"expected"). */
|
||||
/* Actual size of YYARG. */
|
||||
int yycount = 0;
|
||||
/* Cumulated lengths of YYARG. */
|
||||
ptrdiff_t yysize = 0;
|
||||
|
||||
/* There are many possibilities here to consider:
|
||||
- If this state is a consistent state with a default action, then
|
||||
@@ -2110,6 +2120,8 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
if (yytoken != YYEMPTY)
|
||||
{
|
||||
int yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||
ptrdiff_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken));
|
||||
yysize = yysize0;
|
||||
yyarg[yycount++] = yytokenName (yytoken);
|
||||
if (!yypact_value_is_default (yyn))
|
||||
{
|
||||
@@ -2160,7 +2172,9 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
}
|
||||
|
||||
{
|
||||
ptrdiff_t yysz = YY_CAST (ptrdiff_t, strlen (yyformat));
|
||||
/* Don't count the "%s"s in the final size, but reserve room for
|
||||
the terminator. */
|
||||
ptrdiff_t yysz = YY_CAST (ptrdiff_t, strlen (yyformat)) - 2 * yycount + 1;
|
||||
if (YYSIZEMAX - yysize < yysz)
|
||||
yysize_overflow = yytrue;
|
||||
else
|
||||
@@ -2183,8 +2197,8 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyformat++;
|
||||
++yyp;
|
||||
++yyformat;
|
||||
}
|
||||
}
|
||||
yyerror (]b4_lyyerror_args[yymsg);
|
||||
@@ -2321,7 +2335,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
yyGLRStack* const yystackp = &yystack;
|
||||
ptrdiff_t yyposn;
|
||||
|
||||
YYDPRINTF ((stderr, "Starting parse\n"));
|
||||
YY_DPRINTF ((stderr, "Starting parse\n"));
|
||||
|
||||
yychar = YYEMPTY;
|
||||
yylval = yyval_default;]b4_locations_if([
|
||||
@@ -2352,7 +2366,7 @@ b4_dollar_popdef])[]dnl
|
||||
while (yytrue)
|
||||
{
|
||||
yyStateNum yystate = yystack.yytops.yystates[0]->yylrState;
|
||||
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
|
||||
YY_DPRINTF ((stderr, "Entering state %d\n", yystate));
|
||||
if (yystate == YYFINAL)
|
||||
goto yyacceptlab;
|
||||
if (yyisDefaultedState (yystate))
|
||||
@@ -2402,7 +2416,7 @@ b4_dollar_popdef])[]dnl
|
||||
ptrdiff_t yys;
|
||||
|
||||
for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
|
||||
yystackp->yytops.yylookaheadNeeds[yys] = YY_CAST (yybool, yychar != YYEMPTY);
|
||||
yystackp->yytops.yylookaheadNeeds[yys] = yychar != YYEMPTY;
|
||||
|
||||
/* yyprocessOneStack returns one of three things:
|
||||
|
||||
@@ -2432,7 +2446,7 @@ b4_dollar_popdef])[]dnl
|
||||
if (yystack.yytops.yysize == 0)
|
||||
yyFail (&yystack][]b4_lpure_args[, YY_("syntax error"));
|
||||
YYCHK1 (yyresolveStack (&yystack]b4_user_args[));
|
||||
YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));]b4_locations_if([[
|
||||
YY_DPRINTF ((stderr, "Returning to deterministic operation.\n"));]b4_locations_if([[
|
||||
yystack.yyerror_range[1].yystate.yyloc = yylloc;]])[
|
||||
yyreportSyntaxError (&yystack]b4_user_args[);
|
||||
goto yyuser_error;
|
||||
@@ -2453,19 +2467,19 @@ b4_dollar_popdef])[]dnl
|
||||
int yyaction = yygetLRActions (yystate, yytoken_to_shift,
|
||||
&yyconflicts);
|
||||
/* Note that yyconflicts were handled by yyprocessOneStack. */
|
||||
YYDPRINTF ((stderr, "On stack %ld, ", YY_CAST (long, yys)));
|
||||
YY_DPRINTF ((stderr, "On stack %ld, ", YY_CAST (long, yys)));
|
||||
YY_SYMBOL_PRINT ("shifting", yytoken_to_shift, &yylval, &yylloc);
|
||||
yyglrShift (&yystack, yys, yyaction, yyposn,
|
||||
&yylval]b4_locations_if([, &yylloc])[);
|
||||
YYDPRINTF ((stderr, "Stack %ld now in state #%d\n",
|
||||
YY_CAST (long, yys),
|
||||
yystack.yytops.yystates[yys]->yylrState));
|
||||
YY_DPRINTF ((stderr, "Stack %ld now in state #%d\n",
|
||||
YY_CAST (long, yys),
|
||||
yystack.yytops.yystates[yys]->yylrState));
|
||||
}
|
||||
|
||||
if (yystack.yytops.yysize == 1)
|
||||
{
|
||||
YYCHK1 (yyresolveStack (&yystack]b4_user_args[));
|
||||
YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
|
||||
YY_DPRINTF ((stderr, "Returning to deterministic operation.\n"));
|
||||
yycompressStack (&yystack);
|
||||
break;
|
||||
}
|
||||
@@ -2481,7 +2495,7 @@ b4_dollar_popdef])[]dnl
|
||||
goto yyreturn;
|
||||
|
||||
yybuglab:
|
||||
YYASSERT (yyfalse);
|
||||
YY_ASSERT (yyfalse);
|
||||
goto yyabortlab;
|
||||
|
||||
yyabortlab:
|
||||
@@ -2538,19 +2552,19 @@ yy_yypstack (yyGLRState* yys)
|
||||
if (yys->yypred)
|
||||
{
|
||||
yy_yypstack (yys->yypred);
|
||||
YYFPRINTF (stderr, " -> ");
|
||||
YY_FPRINTF ((stderr, " -> "));
|
||||
}
|
||||
YYFPRINTF (stderr, "%d@@%ld", yys->yylrState, YY_CAST (long, yys->yyposn));
|
||||
YY_FPRINTF ((stderr, "%d@@%ld", yys->yylrState, YY_CAST (long, yys->yyposn)));
|
||||
}
|
||||
|
||||
static void
|
||||
yypstates (yyGLRState* yyst)
|
||||
{
|
||||
if (yyst == YY_NULLPTR)
|
||||
YYFPRINTF (stderr, "<null>");
|
||||
YY_FPRINTF ((stderr, "<null>"));
|
||||
else
|
||||
yy_yypstack (yyst);
|
||||
YYFPRINTF (stderr, "\n");
|
||||
YY_FPRINTF ((stderr, "\n"));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2571,39 +2585,39 @@ yypdumpstack (yyGLRStack* yystackp)
|
||||
yyGLRStackItem* yyp;
|
||||
for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1)
|
||||
{
|
||||
YYFPRINTF (stderr, "%3ld. ",
|
||||
YY_CAST (long, yyp - yystackp->yyitems));
|
||||
YY_FPRINTF ((stderr, "%3ld. ",
|
||||
YY_CAST (long, yyp - yystackp->yyitems)));
|
||||
if (*YY_REINTERPRET_CAST (yybool *, yyp))
|
||||
{
|
||||
YYASSERT (yyp->yystate.yyisState);
|
||||
YYASSERT (yyp->yyoption.yyisState);
|
||||
YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %ld, pred: %ld",
|
||||
yyp->yystate.yyresolved, yyp->yystate.yylrState,
|
||||
YY_CAST (long, yyp->yystate.yyposn),
|
||||
YYINDEX (yyp->yystate.yypred));
|
||||
YY_ASSERT (yyp->yystate.yyisState);
|
||||
YY_ASSERT (yyp->yyoption.yyisState);
|
||||
YY_FPRINTF ((stderr, "Res: %d, LR State: %d, posn: %ld, pred: %ld",
|
||||
yyp->yystate.yyresolved, yyp->yystate.yylrState,
|
||||
YY_CAST (long, yyp->yystate.yyposn),
|
||||
YYINDEX (yyp->yystate.yypred)));
|
||||
if (! yyp->yystate.yyresolved)
|
||||
YYFPRINTF (stderr, ", firstVal: %ld",
|
||||
YYINDEX (yyp->yystate.yysemantics.yyfirstVal));
|
||||
YY_FPRINTF ((stderr, ", firstVal: %ld",
|
||||
YYINDEX (yyp->yystate.yysemantics.yyfirstVal)));
|
||||
}
|
||||
else
|
||||
{
|
||||
YYASSERT (!yyp->yystate.yyisState);
|
||||
YYASSERT (!yyp->yyoption.yyisState);
|
||||
YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld",
|
||||
yyp->yyoption.yyrule - 1,
|
||||
YYINDEX (yyp->yyoption.yystate),
|
||||
YYINDEX (yyp->yyoption.yynext));
|
||||
YY_ASSERT (!yyp->yystate.yyisState);
|
||||
YY_ASSERT (!yyp->yyoption.yyisState);
|
||||
YY_FPRINTF ((stderr, "Option. rule: %d, state: %ld, next: %ld",
|
||||
yyp->yyoption.yyrule - 1,
|
||||
YYINDEX (yyp->yyoption.yystate),
|
||||
YYINDEX (yyp->yyoption.yynext)));
|
||||
}
|
||||
YYFPRINTF (stderr, "\n");
|
||||
YY_FPRINTF ((stderr, "\n"));
|
||||
}
|
||||
|
||||
YYFPRINTF (stderr, "Tops:");
|
||||
YY_FPRINTF ((stderr, "Tops:"));
|
||||
{
|
||||
ptrdiff_t yyi;
|
||||
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
|
||||
YYFPRINTF (stderr, "%ld: %ld; ", YY_CAST (long, yyi),
|
||||
YYINDEX (yystackp->yytops.yystates[yyi]));
|
||||
YYFPRINTF (stderr, "\n");
|
||||
YY_FPRINTF ((stderr, "%ld: %ld; ", YY_CAST (long, yyi),
|
||||
YYINDEX (yystackp->yytops.yystates[yyi])));
|
||||
YY_FPRINTF ((stderr, "\n"));
|
||||
}
|
||||
#undef YYINDEX
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# C++ GLR skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -265,6 +265,13 @@ b4_percent_code_get([[requires]])[
|
||||
# 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
|
||||
|
||||
// Whether we are compiled with exception support.
|
||||
#ifndef YY_EXCEPTIONS
|
||||
# if defined __GNUC__ && !defined __EXCEPTIONS
|
||||
@@ -361,7 +368,7 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
||||
b4_defines_if(
|
||||
[b4_output_begin([b4_spec_header_file])
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
[2002-2015, 2018-2019])[
|
||||
[2002-2015, 2018-2020])[
|
||||
// C++ GLR parser skeleton written by Akim Demaille.
|
||||
|
||||
]b4_disclaimer[
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Java skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2007, 2009-2015, 2018-2019 Free Software Foundation,
|
||||
# Copyright (C) 2007, 2009-2015, 2018-2020 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Java language support for Bison
|
||||
|
||||
# Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -109,7 +109,7 @@ m4_define([b4_null], [null])
|
||||
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_ = yy$2_init();
|
||||
private static final ]$1[[] yy$2_init()
|
||||
{
|
||||
return new ]$1[[]
|
||||
@@ -147,18 +147,20 @@ b4_symbol_foreach([b4_token_enum])])])
|
||||
# b4-case(ID, CODE)
|
||||
# -----------------
|
||||
# We need to fool Java's stupid unreachable code detection.
|
||||
m4_define([b4_case], [ case $1:
|
||||
m4_define([b4_case],
|
||||
[ case $1:
|
||||
if (yyn == $1)
|
||||
$2;
|
||||
break;
|
||||
])
|
||||
])
|
||||
|
||||
# b4_predicate_case(LABEL, CONDITIONS)
|
||||
# ------------------------------------
|
||||
m4_define([b4_predicate_case], [ case $1:
|
||||
m4_define([b4_predicate_case],
|
||||
[ case $1:
|
||||
if (! ($2)) YYERROR;
|
||||
break;
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
## -------- ##
|
||||
@@ -361,4 +363,4 @@ m4_define([b4_var_decl],
|
||||
# -----------------------
|
||||
# Expand to either an empty string or "throws THROWS".
|
||||
m4_define([b4_maybe_throws],
|
||||
[m4_ifval($1, [throws $1])])
|
||||
[m4_ifval($1, [ throws $1])])
|
||||
|
||||
+28
-21
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -23,6 +23,7 @@ m4_define([b4_value_type_setup_variant])
|
||||
# Check the value of %define parse.lac, where LAC stands for lookahead
|
||||
# correction.
|
||||
b4_percent_define_default([[parse.lac]], [[none]])
|
||||
b4_percent_define_check_values([[[[parse.lac]], [[full]], [[none]]]])
|
||||
b4_define_flag_if([lac])
|
||||
m4_define([b4_lac_flag],
|
||||
[m4_if(b4_percent_define_get([[parse.lac]]),
|
||||
@@ -143,7 +144,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))])])
|
||||
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2015, 2018-2019])
|
||||
[2002-2015, 2018-2020])
|
||||
|
||||
m4_define([b4_parser_class],
|
||||
[b4_percent_define_get([[api.parser.class]])])
|
||||
@@ -268,7 +269,9 @@ m4_define([b4_shared_declarations],
|
||||
static const ]b4_int_type(b4_table_ninf, b4_table_ninf)[ yytable_ninf_;
|
||||
|
||||
/// Convert a scanner token number \a t to a symbol number.
|
||||
static token_number_type yytranslate_ (]b4_token_ctor_if([token_type], [int])[ t);
|
||||
/// In theory \a t should be a token_type, but character literals
|
||||
/// are valid, yet not members of the token_type enum.
|
||||
static token_number_type yytranslate_ (int t);
|
||||
|
||||
// Tables.
|
||||
]b4_parser_tables_declare[]b4_error_verbose_if([
|
||||
@@ -333,7 +336,8 @@ m4_define([b4_shared_declarations],
|
||||
symbol_number_type type_get () const YY_NOEXCEPT;
|
||||
|
||||
/// The state number used to denote an empty symbol.
|
||||
enum { empty_state = -1 };
|
||||
/// We use the initial state, as it does not have a value.
|
||||
enum { empty_state = 0 };
|
||||
|
||||
/// The state.
|
||||
/// \a empty when empty.
|
||||
@@ -397,6 +401,10 @@ m4_define([b4_shared_declarations],
|
||||
/// Pop \a n symbols from the stack.
|
||||
void yypop_ (int n = 1);
|
||||
|
||||
/// Some specific tokens.
|
||||
static const token_number_type yy_error_token_ = 1;
|
||||
static const token_number_type yy_undef_token_ = ]b4_undef_token_number[;
|
||||
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
@@ -404,8 +412,6 @@ m4_define([b4_shared_declarations],
|
||||
yylast_ = ]b4_last[, ///< Last index in yytable_.
|
||||
yynnts_ = ]b4_nterms_number[, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = ]b4_final_state_number[, ///< Termination state number.
|
||||
yyterror_ = 1,
|
||||
yyerrcode_ = 256,
|
||||
yyntokens_ = ]b4_tokens_number[ ///< Number of tokens.
|
||||
};
|
||||
|
||||
@@ -635,7 +641,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
if (state == empty_state)
|
||||
return empty_symbol;
|
||||
else
|
||||
return yystos_[state];
|
||||
return yystos_[+state];
|
||||
}
|
||||
|
||||
]b4_parser_class[::stack_symbol_type::stack_symbol_type ()
|
||||
@@ -861,7 +867,7 @@ b4_dollar_popdef])[]dnl
|
||||
`-----------*/
|
||||
yybackup:
|
||||
// Try to take a decision without lookahead.
|
||||
yyn = yypact_[yystack_[0].state];
|
||||
yyn = yypact_[+yystack_[0].state];
|
||||
if (yy_pact_value_is_default_ (yyn))
|
||||
goto yydefault;
|
||||
|
||||
@@ -916,7 +922,7 @@ b4_dollar_popdef])[]dnl
|
||||
--yyerrstatus_;
|
||||
|
||||
// Shift the lookahead token.
|
||||
yypush_ ("Shifting", static_cast<state_type> (yyn), YY_MOVE (yyla));]b4_lac_if([[
|
||||
yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla));]b4_lac_if([[
|
||||
yy_lac_discard_ ("shift");]])[
|
||||
goto yynewstate;
|
||||
|
||||
@@ -925,7 +931,7 @@ b4_dollar_popdef])[]dnl
|
||||
| yydefault -- do the default action for the current state. |
|
||||
`-----------------------------------------------------------*/
|
||||
yydefault:
|
||||
yyn = yydefact_[yystack_[0].state];
|
||||
yyn = yydefact_[+yystack_[0].state];
|
||||
if (yyn == 0)
|
||||
goto yyerrlab;
|
||||
goto yyreduce;
|
||||
@@ -1052,11 +1058,11 @@ b4_dollar_popdef])[]dnl
|
||||
stack_symbol_type error_token;
|
||||
for (;;)
|
||||
{
|
||||
yyn = yypact_[yystack_[0].state];
|
||||
yyn = yypact_[+yystack_[0].state];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
yyn += yyterror_;
|
||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||
yyn += yy_error_token_;
|
||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yy_error_token_)
|
||||
{
|
||||
yyn = yytable_[yyn];
|
||||
if (0 < yyn)
|
||||
@@ -1079,7 +1085,7 @@ b4_dollar_popdef])[]dnl
|
||||
|
||||
// Shift the error token.]b4_lac_if([[
|
||||
yy_lac_discard_ ("error recovery");]])[
|
||||
error_token.state = static_cast<state_type> (yyn);
|
||||
error_token.state = state_type (yyn);
|
||||
yypush_ ("Shifting", YY_MOVE (error_token));
|
||||
}
|
||||
goto yynewstate;
|
||||
@@ -1161,13 +1167,13 @@ b4_dollar_popdef])[]dnl
|
||||
state_type top_state = (yylac_stack_.empty ()
|
||||
? yystack_[lac_top].state
|
||||
: yylac_stack_.back ());
|
||||
int yyrule = yypact_[top_state];
|
||||
int yyrule = yypact_[+top_state];
|
||||
if (yy_pact_value_is_default_ (yyrule)
|
||||
|| (yyrule += yytoken) < 0 || yylast_ < yyrule
|
||||
|| yycheck_[yyrule] != yytoken)
|
||||
{
|
||||
// Use the default action.
|
||||
yyrule = yydefact_[top_state];
|
||||
yyrule = yydefact_[+top_state];
|
||||
if (yyrule == 0)
|
||||
{
|
||||
YYCDEBUG << " Err\n";
|
||||
@@ -1330,21 +1336,22 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
|
||||
*/
|
||||
if (!yyla.empty ())
|
||||
{
|
||||
int yytoken = yyla.type_get ();
|
||||
symbol_number_type yytoken = yyla.type_get ();
|
||||
yyarg[yycount++] = yytname_[yytoken];]b4_lac_if([[
|
||||
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
// Execute LAC once. We don't care if it is succesful, we
|
||||
// Execute LAC once. We don't care if it is successful, we
|
||||
// only do it for the sake of debugging output.
|
||||
if (!yy_lac_established_)
|
||||
yy_lac_check_ (yytoken);
|
||||
#endif]])[
|
||||
|
||||
int yyn = yypact_[yystate];
|
||||
int yyn = yypact_[+yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{]b4_lac_if([[
|
||||
for (int yyx = 0; yyx < yyntokens_; ++yyx)
|
||||
if (yyx != yyterror_ && yy_lac_check_(yyx))
|
||||
if (yyx != yy_error_token_ && yyx != yy_undef_token_
|
||||
&& yy_lac_check_ (yyx))
|
||||
{]], [[
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for
|
||||
@@ -1354,7 +1361,7 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
|
||||
if (yycheck_[yyx + yyn] == yyx && yyx != yy_error_token_
|
||||
&& !yy_table_value_is_error_ (yytable_[yyx + yyn]))
|
||||
{]])[
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
|
||||
+82
-94
@@ -1,6 +1,6 @@
|
||||
# D skeleton for Bison -*- autoconf -*-
|
||||
|
||||
# Copyright (C) 2007-2012, 2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2012, 2019-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -20,7 +20,7 @@ m4_include(b4_skeletonsdir/[d.m4])
|
||||
|
||||
b4_output_begin([b4_parser_file_name])
|
||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in D],
|
||||
[2007-2012, 2019])[
|
||||
[2007-2012, 2019-2020])[
|
||||
|
||||
]b4_percent_define_ifdef([package], [module b4_percent_define_get([package]);
|
||||
])[
|
||||
@@ -187,9 +187,6 @@ b4_user_union_members
|
||||
{
|
||||
]b4_identification[
|
||||
|
||||
/** True if verbose error messages are enabled. */
|
||||
public bool errorVerbose = ]b4_flag_value([error_verbose])[;
|
||||
|
||||
]b4_locations_if([[
|
||||
private final ]b4_location_type[ yylloc_from_stack (ref YYStack rhs, int n)
|
||||
{
|
||||
@@ -400,7 +397,8 @@ b4_user_union_members
|
||||
ref ]b4_yystype[ yyvaluep]dnl
|
||||
b4_locations_if([, ref ]b4_location_type[ yylocationp])[)
|
||||
{
|
||||
if (0 < yydebug) {
|
||||
if (0 < yydebug)
|
||||
{
|
||||
string message = s ~ (yytype < yyntokens_ ? " token " : " nterm ")
|
||||
~ yytname_[yytype] ~ " ("]b4_locations_if([
|
||||
~ yylocationp.toString() ~ ": "])[;
|
||||
@@ -619,8 +617,8 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
yyn = yypact_[yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
yyn += yyterror_;
|
||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||
yyn += yy_error_token_;
|
||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yy_error_token_)
|
||||
{
|
||||
yyn = yytable_[yyn];
|
||||
if (0 < yyn)
|
||||
@@ -667,78 +665,74 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
|
||||
// Generate an error message.
|
||||
private final string yysyntax_error (int yystate, int tok)
|
||||
{
|
||||
if (errorVerbose)
|
||||
{]b4_error_verbose_if([[
|
||||
/* There are many possibilities here to consider:
|
||||
- Assume YYFAIL is not used. It's too flawed to consider.
|
||||
See
|
||||
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
|
||||
for details. YYERROR is fine as it does not invoke this
|
||||
function.
|
||||
- If this state is a consistent state with a default action,
|
||||
then the only way this function was invoked is if the
|
||||
default action is an error action. In that case, don't
|
||||
check for expected tokens because there are none.
|
||||
- The only way there can be no lookahead present (in tok) is
|
||||
if this state is a consistent state with a default action.
|
||||
Thus, detecting the absence of a lookahead is sufficient to
|
||||
determine that there is no unexpected or expected token to
|
||||
report. In that case, just report a simple "syntax error".
|
||||
- Don't assume there isn't a lookahead just because this
|
||||
state is a consistent state with a default action. There
|
||||
might have been a previous inconsistent state, consistent
|
||||
state with a non-default action, or user semantic action
|
||||
that manipulated yychar. (However, yychar is currently out
|
||||
of scope during semantic actions.)
|
||||
- Of course, the expected token list depends on states to
|
||||
have correct lookahead information, and it depends on the
|
||||
parser not to perform extra reductions after fetching a
|
||||
lookahead from the scanner and before detecting a syntax
|
||||
error. Thus, state merging (from LALR or IELR) and default
|
||||
reductions corrupt the expected token list. However, the
|
||||
list is correct for canonical LR with one exception: it
|
||||
will still contain any token that will not be accepted due
|
||||
to an error action in a later state.
|
||||
*/
|
||||
if (tok != yyempty_)
|
||||
{
|
||||
/* There are many possibilities here to consider:
|
||||
- Assume YYFAIL is not used. It's too flawed to consider.
|
||||
See
|
||||
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
|
||||
for details. YYERROR is fine as it does not invoke this
|
||||
function.
|
||||
- If this state is a consistent state with a default action,
|
||||
then the only way this function was invoked is if the
|
||||
default action is an error action. In that case, don't
|
||||
check for expected tokens because there are none.
|
||||
- The only way there can be no lookahead present (in tok) is
|
||||
if this state is a consistent state with a default action.
|
||||
Thus, detecting the absence of a lookahead is sufficient to
|
||||
determine that there is no unexpected or expected token to
|
||||
report. In that case, just report a simple "syntax error".
|
||||
- Don't assume there isn't a lookahead just because this
|
||||
state is a consistent state with a default action. There
|
||||
might have been a previous inconsistent state, consistent
|
||||
state with a non-default action, or user semantic action
|
||||
that manipulated yychar. (However, yychar is currently out
|
||||
of scope during semantic actions.)
|
||||
- Of course, the expected token list depends on states to
|
||||
have correct lookahead information, and it depends on the
|
||||
parser not to perform extra reductions after fetching a
|
||||
lookahead from the scanner and before detecting a syntax
|
||||
error. Thus, state merging (from LALR or IELR) and default
|
||||
reductions corrupt the expected token list. However, the
|
||||
list is correct for canonical LR with one exception: it
|
||||
will still contain any token that will not be accepted due
|
||||
to an error action in a later state.
|
||||
*/
|
||||
if (tok != yyempty_)
|
||||
// FIXME: This method of building the message is not compatible
|
||||
// with internationalization.
|
||||
string res = "syntax error, unexpected ";
|
||||
res ~= yytnamerr_ (yytname_[tok]);
|
||||
int yyn = yypact_[yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
// FIXME: This method of building the message is not compatible
|
||||
// with internationalization.
|
||||
string res = "syntax error, unexpected ";
|
||||
res ~= yytnamerr_ (yytname_[tok]);
|
||||
int yyn = yypact_[yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
{
|
||||
/* Start YYX at -YYN if negative to avoid negative
|
||||
indexes in YYCHECK. In other words, skip the first
|
||||
-YYN actions for this state because they are default
|
||||
actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
++count;
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
{
|
||||
res ~= count++ == 0 ? ", expecting " : " or ";
|
||||
res ~= yytnamerr_ (yytname_[x]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
/* Start YYX at -YYN if negative to avoid negative
|
||||
indexes in YYCHECK. In other words, skip the first
|
||||
-YYN actions for this state because they are default
|
||||
actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yy_error_token_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
++count;
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yy_error_token_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
{
|
||||
res ~= count++ == 0 ? ", expecting " : " or ";
|
||||
res ~= yytnamerr_ (yytname_[x]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}]])[
|
||||
return "syntax error";
|
||||
}
|
||||
|
||||
@@ -771,14 +765,6 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
|
||||
]b4_parser_tables_define[
|
||||
|
||||
/* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
|
||||
to YYLEX-NUM. */
|
||||
private static immutable ]b4_int_type_for([b4_toknum])[[]
|
||||
yytoken_number_ =
|
||||
@{
|
||||
]b4_toknum[
|
||||
@};
|
||||
|
||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
First, the terminals, then, starting at \a yyntokens_, nonterminals. */
|
||||
private static immutable string[] yytname_ =
|
||||
@@ -814,36 +800,38 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
}
|
||||
]])[
|
||||
|
||||
private static ]b4_int_type_for([b4_translate])[ yytranslate_ (int t)
|
||||
private static token_number_type yytranslate_ (int t)
|
||||
{
|
||||
]b4_api_token_raw_if(
|
||||
[[ import std.conv : to;
|
||||
return to!byte (t);]],
|
||||
[[ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
||||
immutable ]b4_int_type_for([b4_translate])[[] translate_table =
|
||||
immutable token_number_type[] translate_table =
|
||||
@{
|
||||
]b4_translate[
|
||||
@};
|
||||
|
||||
immutable int user_token_number_max_ = ]b4_user_token_number_max[;
|
||||
immutable token_number_type undef_token_ = ]b4_undef_token_number[;
|
||||
|
||||
if (t <= 0)
|
||||
return YYTokenType.EOF;
|
||||
else if (t <= yyuser_token_number_max_)
|
||||
else if (t <= user_token_number_max_)
|
||||
return translate_table[t];
|
||||
else
|
||||
return yyundef_token_;]])[
|
||||
return undef_token_;]])[
|
||||
}
|
||||
|
||||
alias ]b4_int_type_for([b4_translate])[ token_number_type;
|
||||
|
||||
private static immutable token_number_type yy_error_token_ = 1;
|
||||
|
||||
private static immutable int yylast_ = ]b4_last[;
|
||||
private static immutable int yynnts_ = ]b4_nterms_number[;
|
||||
private static immutable int yyempty_ = -2;
|
||||
private static immutable int yyfinal_ = ]b4_final_state_number[;
|
||||
private static immutable int yyterror_ = 1;
|
||||
private static immutable int yyerrcode_ = 256;
|
||||
private static immutable int yyntokens_ = ]b4_tokens_number[;
|
||||
|
||||
private static immutable int yyuser_token_number_max_ = ]b4_user_token_number_max[;
|
||||
private static immutable int yyundef_token_ = ]b4_undef_token_number[;
|
||||
|
||||
private final struct YYStackElement {
|
||||
int state;
|
||||
]b4_yystype[ value;]b4_locations_if(
|
||||
|
||||
+64
-66
@@ -1,6 +1,6 @@
|
||||
# Java skeleton for Bison -*- autoconf -*-
|
||||
|
||||
# Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -65,8 +65,8 @@ m4_define([b4_define_state],[[
|
||||
int label = YYNEWSTATE;
|
||||
|
||||
/* Error handling. */
|
||||
int yynerrs_ = 0;
|
||||
]b4_locations_if([[/* The location where the error started. */
|
||||
int yynerrs_ = 0;]b4_locations_if([[
|
||||
/* The location where the error started. */
|
||||
]b4_location_type[ yyerrloc = null;
|
||||
|
||||
/* Location. */
|
||||
@@ -78,7 +78,7 @@ m4_define([b4_define_state],[[
|
||||
|
||||
]b4_output_begin([b4_parser_file_name])[
|
||||
]b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
||||
[2007-2015, 2018-2019])[
|
||||
[2007-2015, 2018-2020])[
|
||||
]b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);[
|
||||
]])[
|
||||
]b4_user_pre_prologue[
|
||||
@@ -182,7 +182,7 @@ b4_locations_if([[
|
||||
|
||||
]b4_token_enums[
|
||||
|
||||
]b4_locations_if([[/**
|
||||
]b4_locations_if([[/**
|
||||
* Method to retrieve the beginning position of the last scanned token.
|
||||
* @@return the position at which the last scanned token starts.
|
||||
*/
|
||||
@@ -206,13 +206,13 @@ b4_locations_if([[
|
||||
* ]b4_locations_if([and beginning/ending positions ])[of the token.
|
||||
* @@return the token identifier corresponding to the next token.
|
||||
*/
|
||||
int yylex () ]b4_maybe_throws([b4_lex_throws])[;
|
||||
int yylex ()]b4_maybe_throws([b4_lex_throws])[;
|
||||
|
||||
/**
|
||||
* Entry point for error reporting. Emits an error
|
||||
* ]b4_locations_if([referring to the given location ])[in a user-defined way.
|
||||
*
|
||||
* ]b4_locations_if([[@@param loc The location of the element to which the
|
||||
*]b4_locations_if([[ @@param loc The location of the element to which the
|
||||
* error message is related]])[
|
||||
* @@param msg The string for the error message.
|
||||
*/
|
||||
@@ -224,22 +224,23 @@ b4_locations_if([[
|
||||
]b4_percent_code_get([[lexer]])[
|
||||
}
|
||||
|
||||
]])[/**
|
||||
]])[
|
||||
/**
|
||||
* The object doing lexical analysis for us.
|
||||
*/
|
||||
private Lexer yylexer;
|
||||
|
||||
]b4_parse_param_vars[
|
||||
]b4_parse_param_vars[
|
||||
|
||||
]b4_lexer_if([[
|
||||
/**
|
||||
* Instantiates the Bison-generated parser.
|
||||
*/
|
||||
public ]b4_parser_class (b4_parse_param_decl([b4_lex_param_decl])[) ]b4_maybe_throws([b4_init_throws])[
|
||||
public ]b4_parser_class (b4_parse_param_decl([b4_lex_param_decl])[)]b4_maybe_throws([b4_init_throws])[
|
||||
{
|
||||
]b4_percent_code_get([[init]])[
|
||||
]b4_percent_code_get([[init]])[
|
||||
this.yylexer = new YYLexer(]b4_lex_param_call[);
|
||||
]b4_parse_param_cons[
|
||||
]b4_parse_param_cons[
|
||||
}
|
||||
]])[
|
||||
|
||||
@@ -247,11 +248,11 @@ b4_locations_if([[
|
||||
* Instantiates the Bison-generated parser.
|
||||
* @@param yylexer The scanner that will supply tokens to the parser.
|
||||
*/
|
||||
]b4_lexer_if([[protected]], [[public]]) b4_parser_class[ (]b4_parse_param_decl([[Lexer yylexer]])[) ]b4_maybe_throws([b4_init_throws])[
|
||||
]b4_lexer_if([[protected]], [[public]]) b4_parser_class[ (]b4_parse_param_decl([[Lexer yylexer]])[)]b4_maybe_throws([b4_init_throws])[
|
||||
{
|
||||
]b4_percent_code_get([[init]])[
|
||||
]b4_percent_code_get([[init]])[
|
||||
this.yylexer = yylexer;
|
||||
]b4_parse_param_cons[
|
||||
]b4_parse_param_cons[
|
||||
}
|
||||
|
||||
]b4_parse_trace_if([[
|
||||
@@ -320,8 +321,8 @@ b4_locations_if([[
|
||||
}]])[
|
||||
|
||||
private final class YYStack {
|
||||
private int[] stateStack = new int[16];
|
||||
]b4_locations_if([[private ]b4_location_type[[] locStack = new ]b4_location_type[[16];]])[
|
||||
private int[] stateStack = new int[16];]b4_locations_if([[
|
||||
private ]b4_location_type[[] locStack = new ]b4_location_type[[16];]])[
|
||||
private ]b4_yystype[[] valueStack = new ]b4_yystype[[16];
|
||||
|
||||
public int size = 16;
|
||||
@@ -334,8 +335,7 @@ b4_locations_if([[
|
||||
{
|
||||
int[] newStateStack = new int[size * 2];
|
||||
System.arraycopy (stateStack, 0, newStateStack, 0, height);
|
||||
stateStack = newStateStack;
|
||||
]b4_locations_if([[
|
||||
stateStack = newStateStack;]b4_locations_if([[
|
||||
]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2];
|
||||
System.arraycopy (locStack, 0, newLocStack, 0, height);
|
||||
locStack = newLocStack;]])
|
||||
@@ -347,8 +347,8 @@ b4_locations_if([[
|
||||
size *= 2;
|
||||
}
|
||||
|
||||
stateStack[height] = state;
|
||||
]b4_locations_if([[locStack[height] = loc;]])[
|
||||
stateStack[height] = state;]b4_locations_if([[
|
||||
locStack[height] = loc;]])[
|
||||
valueStack[height] = value;
|
||||
}
|
||||
|
||||
@@ -359,8 +359,8 @@ b4_locations_if([[
|
||||
public final void pop (int num) {
|
||||
// Avoid memory leaks... garbage collection is a white lie!
|
||||
if (0 < num) {
|
||||
java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null);
|
||||
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[
|
||||
java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null);]b4_locations_if([[
|
||||
java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[
|
||||
}
|
||||
height -= num;
|
||||
}
|
||||
@@ -368,8 +368,9 @@ b4_locations_if([[
|
||||
public final int stateAt (int i) {
|
||||
return stateStack[height - i];
|
||||
}
|
||||
]b4_locations_if([[
|
||||
|
||||
]b4_locations_if([[public final ]b4_location_type[ locationAt (int i) {
|
||||
public final ]b4_location_type[ locationAt (int i) {
|
||||
return locStack[height - i];
|
||||
}
|
||||
|
||||
@@ -452,7 +453,7 @@ b4_locations_if([[
|
||||
return yydefgoto_[yysym - yyntokens_];
|
||||
}
|
||||
|
||||
private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[
|
||||
private int yyaction (int yyn, YYStack yystack, int yylen)]b4_maybe_throws([b4_throws])[
|
||||
{
|
||||
/* If YYLEN is nonzero, implement the default value of the action:
|
||||
'$$ = $1'. Otherwise, use the top of the stack.
|
||||
@@ -460,8 +461,8 @@ b4_locations_if([[
|
||||
Otherwise, the following line sets YYVAL to garbage.
|
||||
This behavior is undocumented and Bison
|
||||
users should not rely upon it. */
|
||||
]b4_yystype[ yyval = (0 < yylen) ? yystack.valueAt (yylen - 1) : yystack.valueAt (0);
|
||||
]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[]b4_parse_trace_if([[
|
||||
]b4_yystype[ yyval = (0 < yylen) ? yystack.valueAt (yylen - 1) : yystack.valueAt (0);]b4_locations_if([[
|
||||
]b4_location_type[ yyloc = yylloc (yystack, yylen);]])[]b4_parse_trace_if([[
|
||||
|
||||
yyReducePrint (yyn, yystack);]])[
|
||||
|
||||
@@ -541,29 +542,28 @@ b4_locations_if([[
|
||||
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not
|
||||
* imply that there were no syntax errors.
|
||||
*/
|
||||
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[]])[
|
||||
public boolean parse ()]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[]])[
|
||||
]b4_push_if([
|
||||
/**
|
||||
* Push Parse input from external lexer
|
||||
*
|
||||
* @@param yylextoken current token
|
||||
* @@param yylexval current lval
|
||||
]b4_locations_if([ * @@param yylexloc current position])[
|
||||
* @@param yylexval current lval]b4_locations_if([[
|
||||
* @@param yylexloc current position]])[
|
||||
*
|
||||
* @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt>
|
||||
*/
|
||||
public int push_parse (int yylextoken, b4_yystype yylexval[]b4_locations_if([, b4_location_type yylexloc]))
|
||||
b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])])[
|
||||
{
|
||||
]b4_locations_if([/* @@$. */
|
||||
b4_location_type yyloc;])[
|
||||
public int push_parse (int yylextoken, b4_yystype yylexval[]b4_locations_if([, b4_location_type yylexloc]))b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])])[
|
||||
{]b4_locations_if([[
|
||||
/* @@$. */
|
||||
]b4_location_type[ yyloc;]])[
|
||||
]b4_push_if([],[[
|
||||
]b4_define_state[]b4_parse_trace_if([[
|
||||
yycdebug ("Starting parse\n");]])[
|
||||
yyerrstatus_ = 0;
|
||||
|
||||
/* Initialize the stack. */
|
||||
yystack.push (yystate, yylval ]b4_locations_if([, yylloc])[);
|
||||
yystack.push (yystate, yylval]b4_locations_if([, yylloc])[);
|
||||
]m4_ifdef([b4_initial_action], [
|
||||
b4_dollar_pushdef([yylval], [], [], [yylloc])dnl
|
||||
b4_user_initial_action
|
||||
@@ -706,7 +706,8 @@ b4_dollar_popdef[]dnl
|
||||
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
|
||||
}
|
||||
|
||||
]b4_locations_if([yyerrloc = yylloc;])[
|
||||
]b4_locations_if([[
|
||||
yyerrloc = yylloc;]])[
|
||||
if (yyerrstatus_ == 3)
|
||||
{
|
||||
/* If just tried and failed to reuse lookahead token after an
|
||||
@@ -730,8 +731,8 @@ b4_dollar_popdef[]dnl
|
||||
/*-------------------------------------------------.
|
||||
| errorlab -- error raised explicitly by YYERROR. |
|
||||
`-------------------------------------------------*/
|
||||
case YYERROR:
|
||||
]b4_locations_if([yyerrloc = yystack.locationAt (yylen - 1);])[
|
||||
case YYERROR:]b4_locations_if([[
|
||||
yyerrloc = yystack.locationAt (yylen - 1);]])[
|
||||
/* Do not reclaim the symbols of the rule which action triggered
|
||||
this YYERROR. */
|
||||
yystack.pop (yylen);
|
||||
@@ -751,8 +752,8 @@ b4_dollar_popdef[]dnl
|
||||
yyn = yypact_[yystate];
|
||||
if (!yyPactValueIsDefault (yyn))
|
||||
{
|
||||
yyn += yyterror_;
|
||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||
yyn += yy_error_token_;
|
||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yy_error_token_)
|
||||
{
|
||||
yyn = yytable_[yyn];
|
||||
if (0 < yyn)
|
||||
@@ -765,7 +766,8 @@ b4_dollar_popdef[]dnl
|
||||
if (yystack.height == 0)
|
||||
]b4_push_if([{label = YYABORT; break;}],[return false;])[
|
||||
|
||||
]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
|
||||
]b4_locations_if([[
|
||||
yyerrloc = yystack.locationAt (0);]])[
|
||||
yystack.pop ();
|
||||
yystate = yystack.stateAt (0);]b4_parse_trace_if([[
|
||||
if (0 < yydebug)
|
||||
@@ -776,12 +778,12 @@ b4_dollar_popdef[]dnl
|
||||
/* Leave the switch. */
|
||||
break;
|
||||
|
||||
]b4_locations_if([
|
||||
]b4_locations_if([[
|
||||
/* Muck with the stack to setup for yylloc. */
|
||||
yystack.push (0, null, yylloc);
|
||||
yystack.push (0, null, yyerrloc);
|
||||
yyloc = yylloc (yystack, 2);
|
||||
yystack.pop (2);])[
|
||||
yystack.pop (2);]])[
|
||||
|
||||
/* Shift the error token. */]b4_parse_trace_if([[
|
||||
yySymbolPrint ("Shifting", yystos_[yyn],
|
||||
@@ -823,10 +825,10 @@ b4_dollar_popdef[]dnl
|
||||
this.label = YYNEWSTATE;
|
||||
|
||||
/* Error handling. */
|
||||
this.yynerrs_ = 0;
|
||||
]b4_locations_if([/* The location where the error started. */
|
||||
this.yynerrs_ = 0;]b4_locations_if([[
|
||||
/* The location where the error started. */
|
||||
this.yyerrloc = null;
|
||||
this.yylloc = new b4_location_type (null, null);])[
|
||||
this.yylloc = new ]b4_location_type[ (null, null);]])[
|
||||
|
||||
/* Semantic value of the lookahead. */
|
||||
this.yylval = null;
|
||||
@@ -846,8 +848,7 @@ b4_dollar_popdef[]dnl
|
||||
*
|
||||
* @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt>
|
||||
*/
|
||||
public int push_parse (int yylextoken, b4_yystype yylexval, b4_position_type yylexpos)
|
||||
b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])
|
||||
public int push_parse (int yylextoken, b4_yystype yylexval, b4_position_type yylexpos)b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])
|
||||
{
|
||||
return push_parse (yylextoken, yylexval, new b4_location_type (yylexpos));
|
||||
}
|
||||
@@ -862,7 +863,7 @@ b4_dollar_popdef[]dnl
|
||||
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not
|
||||
* imply that there were no syntax errors.
|
||||
*/
|
||||
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[
|
||||
public boolean parse ()]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[
|
||||
{
|
||||
if (yylexer == null)
|
||||
throw new NullPointerException("Null Lexer");
|
||||
@@ -872,9 +873,9 @@ b4_dollar_popdef[]dnl
|
||||
]b4_yystype[ lval = yylexer.getLVal();
|
||||
]b4_locations_if([dnl
|
||||
b4_location_type yyloc = new b4_location_type (yylexer.getStartPos (),
|
||||
yylexer.getEndPos ());])[
|
||||
]b4_locations_if([status = push_parse(token,lval,yyloc);],[
|
||||
status = push_parse(token,lval);])[
|
||||
yylexer.getEndPos ());])[]b4_locations_if([[
|
||||
status = push_parse(token,lval,yyloc);]], [[
|
||||
status = push_parse(token,lval);]])[
|
||||
} while (status == YYPUSH_MORE);
|
||||
return (status == YYACCEPT);
|
||||
}
|
||||
@@ -931,14 +932,14 @@ b4_dollar_popdef[]dnl
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
if (yycheck_[x + yyn] == x && x != yy_error_token_
|
||||
&& !yyTableValueIsError (yytable_[x + yyn]))
|
||||
++count;
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
if (yycheck_[x + yyn] == x && x != yy_error_token_
|
||||
&& !yyTableValueIsError (yytable_[x + yyn]))
|
||||
{
|
||||
res.append (count++ == 0 ? ", expecting " : " or ");
|
||||
@@ -976,9 +977,6 @@ b4_dollar_popdef[]dnl
|
||||
private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[;
|
||||
|
||||
]b4_parser_tables_define[
|
||||
]b4_integral_parser_table_define([token_number], [b4_toknum],
|
||||
[[YYTOKEN_NUMBER[YYLEX-NUM] -- Internal symbol number corresponding
|
||||
to YYLEX-NUM.]])[
|
||||
|
||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
First, the terminals, then, starting at \a yyntokens_, nonterminals. */
|
||||
@@ -1014,31 +1012,31 @@ b4_dollar_popdef[]dnl
|
||||
private static final ]b4_int_type_for([b4_translate])[ yytranslate_ (int t)
|
||||
]b4_api_token_raw_if(dnl
|
||||
[[ {
|
||||
return t;
|
||||
return (]b4_int_type_for([b4_translate])[) t;
|
||||
}
|
||||
]],
|
||||
[[ {
|
||||
int user_token_number_max_ = ]b4_user_token_number_max[;
|
||||
]b4_int_type_for([b4_translate])[ undef_token_ = ]b4_undef_token_number[;
|
||||
|
||||
if (t <= 0)
|
||||
return Lexer.EOF;
|
||||
else if (t <= yyuser_token_number_max_)
|
||||
else if (t <= user_token_number_max_)
|
||||
return yytranslate_table_[t];
|
||||
else
|
||||
return yyundef_token_;
|
||||
return undef_token_;
|
||||
}
|
||||
]b4_integral_parser_table_define([translate_table], [b4_translate])[
|
||||
]])[
|
||||
|
||||
private static final ]b4_int_type_for([b4_translate])[ yy_error_token_ = 1;
|
||||
|
||||
private static final int yylast_ = ]b4_last[;
|
||||
private static final int yynnts_ = ]b4_nterms_number[;
|
||||
private static final int yyempty_ = -2;
|
||||
private static final int yyfinal_ = ]b4_final_state_number[;
|
||||
private static final int yyterror_ = 1;
|
||||
private static final int yyerrcode_ = 256;
|
||||
private static final int yyntokens_ = ]b4_tokens_number[;
|
||||
|
||||
private static final int yyuser_token_number_max_ = ]b4_user_token_number_max[;
|
||||
private static final int yyundef_token_ = ]b4_undef_token_number[;
|
||||
|
||||
/* User implementation code. */
|
||||
]b4_percent_code_get[]dnl
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -16,7 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2015, 2018-2019])
|
||||
[2002-2015, 2018-2020])
|
||||
|
||||
|
||||
# b4_position_file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
+21
-21
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -72,9 +72,9 @@ m4_map([ b4_symbol_tag_comment], [$@])dnl
|
||||
# The needed includes for variants support.
|
||||
m4_define([b4_variant_includes],
|
||||
[b4_parse_assert_if([[#include <typeinfo>]])[
|
||||
#ifndef YYASSERT
|
||||
#ifndef YY_ASSERT
|
||||
# include <cassert>
|
||||
# define YYASSERT assert
|
||||
# define YY_ASSERT assert
|
||||
#endif
|
||||
]])
|
||||
|
||||
@@ -111,14 +111,14 @@ m4_define([b4_value_type_declare],
|
||||
semantic_type (YY_RVREF (T) t)]b4_parse_assert_if([
|
||||
: yytypeid_ (&typeid (T))])[
|
||||
{
|
||||
YYASSERT (sizeof (T) <= size);
|
||||
YY_ASSERT (sizeof (T) <= size);
|
||||
new (yyas_<T> ()) T (YY_MOVE (t));
|
||||
}
|
||||
|
||||
/// Destruction, allowed only if empty.
|
||||
~semantic_type () YY_NOEXCEPT
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!yytypeid_);
|
||||
YY_ASSERT (!yytypeid_);
|
||||
])[}
|
||||
|
||||
# if 201103L <= YY_CPLUSPLUS
|
||||
@@ -127,8 +127,8 @@ m4_define([b4_value_type_declare],
|
||||
T&
|
||||
emplace (U&&... u)
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!yytypeid_);
|
||||
YYASSERT (sizeof (T) <= size);
|
||||
YY_ASSERT (!yytypeid_);
|
||||
YY_ASSERT (sizeof (T) <= size);
|
||||
yytypeid_ = & typeid (T);])[
|
||||
return *new (yyas_<T> ()) T (std::forward <U>(u)...);
|
||||
}
|
||||
@@ -138,8 +138,8 @@ m4_define([b4_value_type_declare],
|
||||
T&
|
||||
emplace ()
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!yytypeid_);
|
||||
YYASSERT (sizeof (T) <= size);
|
||||
YY_ASSERT (!yytypeid_);
|
||||
YY_ASSERT (sizeof (T) <= size);
|
||||
yytypeid_ = & typeid (T);])[
|
||||
return *new (yyas_<T> ()) T ();
|
||||
}
|
||||
@@ -149,8 +149,8 @@ m4_define([b4_value_type_declare],
|
||||
T&
|
||||
emplace (const T& t)
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!yytypeid_);
|
||||
YYASSERT (sizeof (T) <= size);
|
||||
YY_ASSERT (!yytypeid_);
|
||||
YY_ASSERT (sizeof (T) <= size);
|
||||
yytypeid_ = & typeid (T);])[
|
||||
return *new (yyas_<T> ()) T (t);
|
||||
}
|
||||
@@ -179,9 +179,9 @@ m4_define([b4_value_type_declare],
|
||||
T&
|
||||
as () YY_NOEXCEPT
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (yytypeid_);
|
||||
YYASSERT (*yytypeid_ == typeid (T));
|
||||
YYASSERT (sizeof (T) <= size);])[
|
||||
YY_ASSERT (yytypeid_);
|
||||
YY_ASSERT (*yytypeid_ == typeid (T));
|
||||
YY_ASSERT (sizeof (T) <= size);])[
|
||||
return *yyas_<T> ();
|
||||
}
|
||||
|
||||
@@ -190,9 +190,9 @@ m4_define([b4_value_type_declare],
|
||||
const T&
|
||||
as () const YY_NOEXCEPT
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (yytypeid_);
|
||||
YYASSERT (*yytypeid_ == typeid (T));
|
||||
YYASSERT (sizeof (T) <= size);])[
|
||||
YY_ASSERT (yytypeid_);
|
||||
YY_ASSERT (*yytypeid_ == typeid (T));
|
||||
YY_ASSERT (sizeof (T) <= size);])[
|
||||
return *yyas_<T> ();
|
||||
}
|
||||
|
||||
@@ -208,8 +208,8 @@ m4_define([b4_value_type_declare],
|
||||
void
|
||||
swap (self_type& that) YY_NOEXCEPT
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (yytypeid_);
|
||||
YYASSERT (*yytypeid_ == *that.yytypeid_);])[
|
||||
YY_ASSERT (yytypeid_);
|
||||
YY_ASSERT (*yytypeid_ == *that.yytypeid_);])[
|
||||
std::swap (as<T> (), that.as<T> ());
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ m4_define([_b4_token_constructor_define],
|
||||
b4_symbol_if([$1], [has_type], [std::move (v)]),
|
||||
b4_locations_if([std::move (l)]))[)
|
||||
{
|
||||
YYASSERT (]m4_join([ || ], m4_map_sep([_b4_type_clause], [, ], [$@]))[);
|
||||
YY_ASSERT (]m4_join([ || ], m4_map_sep([_b4_type_clause], [, ], [$@]))[);
|
||||
}
|
||||
#else
|
||||
symbol_type (]b4_join(
|
||||
@@ -413,7 +413,7 @@ m4_define([_b4_token_constructor_define],
|
||||
b4_symbol_if([$1], [has_type], [v]),
|
||||
b4_locations_if([l]))[)
|
||||
{
|
||||
YYASSERT (]m4_join([ || ], m4_map_sep([_b4_type_clause], [, ], [$@]))[);
|
||||
YY_ASSERT (]m4_join([ || ], m4_map_sep([_b4_type_clause], [, ], [$@]))[);
|
||||
}
|
||||
#endif
|
||||
]])])
|
||||
|
||||
+34
-20
@@ -1,11 +1,11 @@
|
||||
# -*- C -*-
|
||||
# Yacc compatible skeleton for Bison
|
||||
|
||||
# Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software
|
||||
# Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[1984, 1989-1990, 2000-2015, 2018-2019])
|
||||
[1984, 1989-1990, 2000-2015, 2018-2020])
|
||||
|
||||
# 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
|
||||
@@ -673,7 +673,7 @@ static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
|
||||
|
||||
/* Error token number */
|
||||
#define YYTERROR 1
|
||||
#define YYERRCODE 256
|
||||
#define YYERRCODE ]b4_symbol(1, user_number)[
|
||||
|
||||
]b4_locations_if([[
|
||||
]b4_yylloc_default_define[
|
||||
@@ -755,7 +755,7 @@ do { \
|
||||
{
|
||||
YYFPRINTF (stderr, " $%d = ", yyi + 1);
|
||||
yy_symbol_print (stderr,
|
||||
yystos[yyssp[yyi + 1 - yynrhs]],
|
||||
yystos[+yyssp[yyi + 1 - yynrhs]],
|
||||
&]b4_rhs_value(yynrhs, yyi + 1)[
|
||||
]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
|
||||
b4_user_args[);
|
||||
@@ -854,8 +854,10 @@ yy_lac_stack_realloc (YYPTRDIFF_T *yycapacity, YYPTRDIFF_T yyadd,
|
||||
*yybottom = yybottom_new;
|
||||
*yycapacity = yyalloc;]m4_if(b4_percent_define_get([[parse.lac.memory-trace]]),
|
||||
[full], [[
|
||||
YY_IGNORE_USELESS_CAST_BEGIN
|
||||
YYDPRINTF ((stderr, "%srealloc to %ld%s", yydebug_prefix,
|
||||
YY_CAST (long, yyalloc), yydebug_suffix));]])[
|
||||
YY_CAST (long, yyalloc), yydebug_suffix));
|
||||
YY_IGNORE_USELESS_CAST_END]])[
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -953,12 +955,12 @@ yy_lac (yy_state_t *yyesa, yy_state_t **yyes,
|
||||
}
|
||||
while (1)
|
||||
{
|
||||
int yyrule = yypact[*yyesp];
|
||||
int yyrule = yypact[+*yyesp];
|
||||
if (yypact_value_is_default (yyrule)
|
||||
|| (yyrule += yytoken) < 0 || YYLAST < yyrule
|
||||
|| yycheck[yyrule] != yytoken)
|
||||
{
|
||||
yyrule = yydefact[*yyesp];
|
||||
yyrule = yydefact[+*yyesp];
|
||||
if (yyrule == 0)
|
||||
{
|
||||
YYDPRINTF ((stderr, " Err\n"));
|
||||
@@ -1012,7 +1014,9 @@ yy_lac (yy_state_t *yyesa, yy_state_t **yyes,
|
||||
if (yyesp == yyes_prev)
|
||||
{
|
||||
yyesp = *yyes;
|
||||
YY_IGNORE_USELESS_CAST_BEGIN
|
||||
*yyesp = YY_CAST (yy_state_t, yystate);
|
||||
YY_IGNORE_USELESS_CAST_END
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1025,7 +1029,9 @@ yy_lac (yy_state_t *yyesa, yy_state_t **yyes,
|
||||
YYDPRINTF ((stderr, "\n"));
|
||||
return 2;
|
||||
}
|
||||
YY_IGNORE_USELESS_CAST_BEGIN
|
||||
*++yyesp = YY_CAST (yy_state_t, yystate);
|
||||
YY_IGNORE_USELESS_CAST_END
|
||||
}
|
||||
YYDPRINTF ((stderr, " G%d", yystate));
|
||||
}
|
||||
@@ -1137,16 +1143,16 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
|
||||
]b4_lac_if([[yy_state_t *yyesa, yy_state_t **yyes,
|
||||
YYPTRDIFF_T *yyes_capacity, ]])[yy_state_t *yyssp, int yytoken)
|
||||
{
|
||||
YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
|
||||
YYPTRDIFF_T yysize = yysize0;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = YY_NULLPTR;
|
||||
/* Arguments of yyformat. */
|
||||
/* Arguments of yyformat: reported tokens (one for the "unexpected",
|
||||
one per "expected"). */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
"expected"). */
|
||||
/* Actual size of YYARG. */
|
||||
int yycount = 0;
|
||||
/* Cumulated lengths of YYARG. */
|
||||
YYPTRDIFF_T yysize = 0;
|
||||
|
||||
/* There are many possibilities here to consider:
|
||||
- If this state is a consistent state with a default action, then
|
||||
@@ -1178,7 +1184,9 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
|
||||
*/
|
||||
if (yytoken != YYEMPTY)
|
||||
{
|
||||
int yyn = yypact[*yyssp];]b4_lac_if([[
|
||||
int yyn = yypact[+*yyssp];
|
||||
YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
|
||||
yysize = yysize0;]b4_lac_if([[
|
||||
YYDPRINTF ((stderr, "Constructing syntax error message\n"));]])[
|
||||
yyarg[yycount++] = yytname[yytoken];
|
||||
if (!yypact_value_is_default (yyn))
|
||||
@@ -1217,8 +1225,8 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
{
|
||||
YYPTRDIFF_T yysize1 = yysize + yytnamerr (YY_NULLPTR,
|
||||
yytname[yyx]);
|
||||
YYPTRDIFF_T yysize1
|
||||
= yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
|
||||
if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
|
||||
yysize = yysize1;
|
||||
else
|
||||
@@ -1249,7 +1257,9 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
|
||||
}
|
||||
|
||||
{
|
||||
YYPTRDIFF_T yysize1 = yysize + yystrlen (yyformat);
|
||||
/* Don't count the "%s"s in the final size, but reserve room for
|
||||
the terminator. */
|
||||
YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
|
||||
if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
|
||||
yysize = yysize1;
|
||||
else
|
||||
@@ -1279,8 +1289,8 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyformat++;
|
||||
++yyp;
|
||||
++yyformat;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -1488,7 +1498,9 @@ yynewstate:
|
||||
yysetstate:
|
||||
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
|
||||
YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
|
||||
*yyssp = YY_CAST (yy_state_t, yystate);
|
||||
YY_IGNORE_USELESS_CAST_BEGIN
|
||||
*yyssp = YY_CAST (yy_state_t, yystate);
|
||||
YY_IGNORE_USELESS_CAST_END
|
||||
|
||||
if (yyss + yystacksize - 1 <= yyssp)
|
||||
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
|
||||
@@ -1548,8 +1560,10 @@ yysetstate:
|
||||
yyvsp = yyvs + yysize - 1;]b4_locations_if([
|
||||
yylsp = yyls + yysize - 1;])[
|
||||
|
||||
YY_IGNORE_USELESS_CAST_BEGIN
|
||||
YYDPRINTF ((stderr, "Stack size increased to %ld\n",
|
||||
YY_CAST (long, yystacksize)));
|
||||
YY_IGNORE_USELESS_CAST_END
|
||||
|
||||
if (yyss + yystacksize - 1 <= yyssp)
|
||||
YYABORT;
|
||||
@@ -1926,7 +1940,7 @@ yyreturn:
|
||||
while (yyssp != yyss)
|
||||
{
|
||||
yydestruct ("Cleanup: popping",
|
||||
yystos[*yyssp], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[);
|
||||
yystos[+*yyssp], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[);
|
||||
YYPOPSTACK (1);
|
||||
}
|
||||
#ifndef yyoverflow
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
bison.xsl - common templates for Bison XSLT.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2text.xsl - transform Bison XML Report into plain text.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||
|
||||
Copyright (C) 2007-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
/bison.help
|
||||
/bison.html
|
||||
/bison.info
|
||||
/bison.info.bak
|
||||
/bison.log
|
||||
/bison.pdf
|
||||
/bison.ps
|
||||
|
||||
+368
-186
File diff suppressed because it is too large
Load Diff
+148
-135
@@ -79,7 +79,7 @@
|
||||
This manual (@value{UPDATED}) is for GNU Bison (version @value{VERSION}),
|
||||
the GNU parser generator.
|
||||
|
||||
Copyright @copyright{} 1988-1993, 1995, 1998-2015, 2018-2019 Free
|
||||
Copyright @copyright{} 1988--1993, 1995, 1998--2015, 2018--2020 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
@quotation
|
||||
@@ -367,9 +367,9 @@ Debugging Your Parser
|
||||
|
||||
Tracing Your Parser
|
||||
|
||||
* Enabling Traces:: Activating run-time trace support
|
||||
* Mfcalc Traces:: Extending @code{mfcalc} to support traces
|
||||
* The YYPRINT Macro:: Obsolete interface for semantic value reports
|
||||
* Enabling Traces:: Activating run-time trace support
|
||||
* Mfcalc Traces:: Extending @code{mfcalc} to support traces
|
||||
* The YYPRINT Macro:: Obsolete interface for semantic value reports
|
||||
|
||||
Invoking Bison
|
||||
|
||||
@@ -2897,25 +2897,25 @@ of line.
|
||||
@cindex Prologue
|
||||
@cindex declarations
|
||||
|
||||
The @var{Prologue} section contains macro definitions and declarations
|
||||
of functions and variables that are used in the actions in the grammar
|
||||
rules. These are copied to the beginning of the parser implementation
|
||||
file so that they precede the definition of @code{yyparse}. You can
|
||||
use @samp{#include} to get the declarations from a header file. If
|
||||
you don't need any C declarations, you may omit the @samp{%@{} and
|
||||
@samp{%@}} delimiters that bracket this section.
|
||||
The @var{Prologue} section contains macro definitions and declarations of
|
||||
functions and variables that are used in the actions in the grammar rules.
|
||||
These are copied to the beginning of the parser implementation file so that
|
||||
they precede the definition of @code{yyparse}. You can use @samp{#include}
|
||||
to get the declarations from a header file. If you don't need any C
|
||||
declarations, you may omit the @samp{%@{} and @samp{%@}} delimiters that
|
||||
bracket this section.
|
||||
|
||||
The @var{Prologue} section is terminated by the first occurrence
|
||||
of @samp{%@}} that is outside a comment, a string literal, or a
|
||||
character constant.
|
||||
The @var{Prologue} section is terminated by the first occurrence of
|
||||
@samp{%@}} that is outside a comment, a string literal, or a character
|
||||
constant.
|
||||
|
||||
You may have more than one @var{Prologue} section, intermixed with the
|
||||
@var{Bison declarations}. This allows you to have C and Bison
|
||||
declarations that refer to each other. For example, the @code{%union}
|
||||
declaration may use types defined in a header file, and you may wish to
|
||||
prototype functions that take arguments of type @code{YYSTYPE}. This
|
||||
can be done with two @var{Prologue} blocks, one before and one after the
|
||||
@code{%union} declaration.
|
||||
@var{Bison declarations}. This allows you to have C and Bison declarations
|
||||
that refer to each other. For example, the @code{%union} declaration may
|
||||
use types defined in a header file, and you may wish to prototype functions
|
||||
that take arguments of type @code{YYSTYPE}. This can be done with two
|
||||
@var{Prologue} blocks, one before and one after the @code{%union}
|
||||
declaration.
|
||||
|
||||
@example
|
||||
@group
|
||||
@@ -2935,20 +2935,18 @@ can be done with two @var{Prologue} blocks, one before and one after the
|
||||
|
||||
@group
|
||||
%@{
|
||||
static void print_token_value (FILE *, int, YYSTYPE);
|
||||
#define YYPRINT(F, N, L) print_token_value (F, N, L)
|
||||
static void print_token (enum yytokentype token, YYSTYPE val);
|
||||
%@}
|
||||
@end group
|
||||
|
||||
@dots{}
|
||||
@end example
|
||||
|
||||
When in doubt, it is usually safer to put prologue code before all
|
||||
Bison declarations, rather than after. For example, any definitions
|
||||
of feature test macros like @code{_GNU_SOURCE} or
|
||||
@code{_POSIX_C_SOURCE} should appear before all Bison declarations, as
|
||||
feature test macros can affect the behavior of Bison-generated
|
||||
@code{#include} directives.
|
||||
When in doubt, it is usually safer to put prologue code before all Bison
|
||||
declarations, rather than after. For example, any definitions of feature
|
||||
test macros like @code{_GNU_SOURCE} or @code{_POSIX_C_SOURCE} should appear
|
||||
before all Bison declarations, as feature test macros can affect the
|
||||
behavior of Bison-generated @code{#include} directives.
|
||||
|
||||
@node Prologue Alternatives
|
||||
@subsection Prologue Alternatives
|
||||
@@ -2960,12 +2958,11 @@ feature test macros can affect the behavior of Bison-generated
|
||||
@findex %code top
|
||||
|
||||
The functionality of @var{Prologue} sections can often be subtle and
|
||||
inflexible. As an alternative, Bison provides a @code{%code}
|
||||
directive with an explicit qualifier field, which identifies the
|
||||
purpose of the code and thus the location(s) where Bison should
|
||||
generate it. For C/C++, the qualifier can be omitted for the default
|
||||
location, or it can be one of @code{requires}, @code{provides},
|
||||
@code{top}. @xref{%code Summary}.
|
||||
inflexible. As an alternative, Bison provides a @code{%code} directive with
|
||||
an explicit qualifier field, which identifies the purpose of the code and
|
||||
thus the location(s) where Bison should generate it. For C/C++, the
|
||||
qualifier can be omitted for the default location, or it can be one of
|
||||
@code{requires}, @code{provides}, @code{top}. @xref{%code Summary}.
|
||||
|
||||
Look again at the example of the previous section:
|
||||
|
||||
@@ -2987,8 +2984,7 @@ Look again at the example of the previous section:
|
||||
|
||||
@group
|
||||
%@{
|
||||
static void print_token_value (FILE *, int, YYSTYPE);
|
||||
#define YYPRINT(F, N, L) print_token_value (F, N, L)
|
||||
static void print_token (enum yytokentype token, YYSTYPE val);
|
||||
%@}
|
||||
@end group
|
||||
|
||||
@@ -3050,8 +3046,7 @@ the same time:
|
||||
|
||||
@group
|
||||
%code @{
|
||||
static void print_token_value (FILE *, int, YYSTYPE);
|
||||
#define YYPRINT(F, N, L) print_token_value (F, N, L)
|
||||
static void print_token (enum yytokentype token, YYSTYPE val);
|
||||
static void trace_token (enum yytokentype token, YYLTYPE loc);
|
||||
@}
|
||||
@end group
|
||||
@@ -3060,21 +3055,20 @@ the same time:
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
In this way, @code{%code top} and the unqualified @code{%code} achieve the same
|
||||
functionality as the two kinds of @var{Prologue} sections, but it's always
|
||||
explicit which kind you intend.
|
||||
Moreover, both kinds are always available even in the absence of @code{%union}.
|
||||
In this way, @code{%code top} and the unqualified @code{%code} achieve the
|
||||
same functionality as the two kinds of @var{Prologue} sections, but it's
|
||||
always explicit which kind you intend. Moreover, both kinds are always
|
||||
available even in the absence of @code{%union}.
|
||||
|
||||
The @code{%code top} block above logically contains two parts. The
|
||||
first two lines before the warning need to appear near the top of the
|
||||
parser implementation file. The first line after the warning is
|
||||
required by @code{YYSTYPE} and thus also needs to appear in the parser
|
||||
implementation file. However, if you've instructed Bison to generate
|
||||
a parser header file (@pxref{Decl Summary, ,%defines}), you probably
|
||||
want that line to appear before the @code{YYSTYPE} definition in that
|
||||
header file as well. The @code{YYLTYPE} definition should also appear
|
||||
in the parser header file to override the default @code{YYLTYPE}
|
||||
definition there.
|
||||
The @code{%code top} block above logically contains two parts. The first
|
||||
two lines before the warning need to appear near the top of the parser
|
||||
implementation file. The first line after the warning is required by
|
||||
@code{YYSTYPE} and thus also needs to appear in the parser implementation
|
||||
file. However, if you've instructed Bison to generate a parser header file
|
||||
(@pxref{Decl Summary, ,%defines}), you probably want that line to appear
|
||||
before the @code{YYSTYPE} definition in that header file as well. The
|
||||
@code{YYLTYPE} definition should also appear in the parser header file to
|
||||
override the default @code{YYLTYPE} definition there.
|
||||
|
||||
In other words, in the @code{%code top} block above, all but the first two
|
||||
lines are dependency code required by the @code{YYSTYPE} and @code{YYLTYPE}
|
||||
@@ -3117,8 +3111,7 @@ Thus, they belong in one or more @code{%code requires}:
|
||||
|
||||
@group
|
||||
%code @{
|
||||
static void print_token_value (FILE *, int, YYSTYPE);
|
||||
#define YYPRINT(F, N, L) print_token_value (F, N, L)
|
||||
static void print_token (enum yytokentype token, YYSTYPE val);
|
||||
static void trace_token (enum yytokentype token, YYLTYPE loc);
|
||||
@}
|
||||
@end group
|
||||
@@ -3197,8 +3190,7 @@ unqualified @code{%code} to a @code{%code provides}:
|
||||
|
||||
@group
|
||||
%code @{
|
||||
static void print_token_value (FILE *, int, YYSTYPE);
|
||||
#define YYPRINT(F, N, L) print_token_value (F, N, L)
|
||||
static void print_token (FILE *file, int token, YYSTYPE val);
|
||||
@}
|
||||
@end group
|
||||
|
||||
@@ -5849,7 +5841,10 @@ states and what is done for each type of lookahead token in that state.
|
||||
|
||||
@deffn {Directive} %yacc
|
||||
Pretend the option @option{--yacc} was given, i.e., imitate Yacc, including
|
||||
its naming conventions. @xref{Tuning the Parser}, for more.
|
||||
its naming conventions. Only makes sense with the @file{yacc.c}
|
||||
skeleton. @xref{Tuning the Parser}, for more.
|
||||
|
||||
Of course @code{%yacc} is a Bison extension@dots{}
|
||||
@end deffn
|
||||
|
||||
|
||||
@@ -6494,9 +6489,12 @@ Obsoleted by @code{api.namespace}
|
||||
@deffn Directive {%define parse.assert}
|
||||
|
||||
@itemize
|
||||
@item Languages(s): C++
|
||||
@item Languages(s): C, C++
|
||||
|
||||
@item Purpose: Issue runtime assertions to catch invalid uses.
|
||||
In C, some important invariants in the implementation of the parser are
|
||||
checked when this option is enabled.
|
||||
|
||||
In C++, when variants are used (@pxref{C++ Variants}), symbols must be
|
||||
constructed and destroyed properly. This option checks these constraints.
|
||||
|
||||
@@ -9976,10 +9974,30 @@ When a Bison grammar compiles properly but parses ``incorrectly'', the
|
||||
|
||||
@node Enabling Traces
|
||||
@subsection Enabling Traces
|
||||
There are several means to enable compilation of trace facilities:
|
||||
There are several means to enable compilation of trace facilities, in
|
||||
decreasing order of preference:
|
||||
|
||||
@table @asis
|
||||
@item the macro @code{YYDEBUG}
|
||||
@item the variable @samp{parse.trace}
|
||||
@findex %define parse.trace
|
||||
Add the @samp{%define parse.trace} directive (@pxref{%define
|
||||
Summary,,parse.trace}), or pass the @option{-Dparse.trace} option
|
||||
(@pxref{Tuning the Parser}). This is a Bison extension. Unless POSIX and
|
||||
Yacc portability matter to you, this is the preferred solution.
|
||||
|
||||
@item the option @option{-t} (POSIX Yacc compliant)
|
||||
@itemx the option @option{--debug} (Bison extension)
|
||||
Use the @samp{-t} option when you run Bison (@pxref{Invocation, ,Invoking
|
||||
Bison}). With @samp{%define api.prefix @{c@}}, it defines @code{CDEBUG} to
|
||||
1, otherwise it defines @code{YYDEBUG} to 1.
|
||||
|
||||
@item the directive @samp{%debug} (deprecated)
|
||||
@findex %debug
|
||||
Add the @code{%debug} directive (@pxref{Decl Summary, ,Bison Declaration
|
||||
Summary}). This Bison extension is maintained for backward compatibility
|
||||
with previous versions of Bison; use @code{%define parse.trace} instead.
|
||||
|
||||
@item the macro @code{YYDEBUG} (C/C++ only)
|
||||
@findex YYDEBUG
|
||||
Define the macro @code{YYDEBUG} to a nonzero value when you compile the
|
||||
parser. This is compliant with POSIX Yacc. You could use
|
||||
@@ -9989,89 +10007,66 @@ Prologue}).
|
||||
|
||||
If the @code{%define} variable @code{api.prefix} is used (@pxref{Multiple
|
||||
Parsers, ,Multiple Parsers in the Same Program}), for instance @samp{%define
|
||||
api.prefix x}, then if @code{CDEBUG} is defined, its value controls the
|
||||
api.prefix @{c@}}, then if @code{CDEBUG} is defined, its value controls the
|
||||
tracing feature (enabled if and only if nonzero); otherwise tracing is
|
||||
enabled if and only if @code{YYDEBUG} is nonzero.
|
||||
|
||||
@item the option @option{-t} (POSIX Yacc compliant)
|
||||
@itemx the option @option{--debug} (Bison extension)
|
||||
Use the @samp{-t} option when you run Bison (@pxref{Invocation, ,Invoking
|
||||
Bison}). With @samp{%define api.prefix @{c@}}, it defines @code{CDEBUG} to 1,
|
||||
otherwise it defines @code{YYDEBUG} to 1.
|
||||
|
||||
@item the directive @samp{%debug}
|
||||
@findex %debug
|
||||
Add the @code{%debug} directive (@pxref{Decl Summary, ,Bison Declaration
|
||||
Summary}). This Bison extension is maintained for backward
|
||||
compatibility with previous versions of Bison.
|
||||
|
||||
@item the variable @samp{parse.trace}
|
||||
@findex %define parse.trace
|
||||
Add the @samp{%define parse.trace} directive (@pxref{%define
|
||||
Summary,,parse.trace}), or pass the @option{-Dparse.trace} option
|
||||
(@pxref{Tuning the Parser}). This is a Bison extension, which is especially
|
||||
useful for languages that don't use a preprocessor. Unless POSIX and Yacc
|
||||
portability matter to you, this is the preferred solution.
|
||||
@end table
|
||||
|
||||
We suggest that you always enable the trace option so that debugging is
|
||||
always possible.
|
||||
|
||||
@findex YYFPRINTF
|
||||
The trace facility outputs messages with macro calls of the form
|
||||
@code{YYFPRINTF (stderr, @var{format}, @var{args})} where
|
||||
@var{format} and @var{args} are the usual @code{printf} format and variadic
|
||||
arguments. If you define @code{YYDEBUG} to a nonzero value but do not
|
||||
define @code{YYFPRINTF}, @code{<stdio.h>} is automatically included
|
||||
and @code{YYFPRINTF} is defined to @code{fprintf}.
|
||||
In C the trace facility outputs messages with macro calls of the form
|
||||
@code{YYFPRINTF (stderr, @var{format}, @var{args})} where @var{format} and
|
||||
@var{args} are the usual @code{printf} format and variadic arguments. If
|
||||
you define @code{YYDEBUG} to a nonzero value but do not define
|
||||
@code{YYFPRINTF}, @code{<stdio.h>} is automatically included and
|
||||
@code{YYFPRINTF} is defined to @code{fprintf}.
|
||||
|
||||
Once you have compiled the program with trace facilities, the way to
|
||||
request a trace is to store a nonzero value in the variable @code{yydebug}.
|
||||
You can do this by making the C code do it (in @code{main}, perhaps), or
|
||||
you can alter the value with a C debugger.
|
||||
Once you have compiled the program with trace facilities, the way to request
|
||||
a trace is to store a nonzero value in the variable @code{yydebug}. You can
|
||||
do this by making the C code do it (in @code{main}, perhaps), or you can
|
||||
alter the value with a C debugger.
|
||||
|
||||
Each step taken by the parser when @code{yydebug} is nonzero produces a
|
||||
line or two of trace information, written on @code{stderr}. The trace
|
||||
messages tell you these things:
|
||||
Each step taken by the parser when @code{yydebug} is nonzero produces a line
|
||||
or two of trace information, written on @code{stderr}. The trace messages
|
||||
tell you these things:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
Each time the parser calls @code{yylex}, what kind of token was read.
|
||||
|
||||
@item
|
||||
Each time a token is shifted, the depth and complete contents of the
|
||||
state stack (@pxref{Parser States}).
|
||||
Each time a token is shifted, the depth and complete contents of the state
|
||||
stack (@pxref{Parser States}).
|
||||
|
||||
@item
|
||||
Each time a rule is reduced, which rule it is, and the complete contents
|
||||
of the state stack afterward.
|
||||
Each time a rule is reduced, which rule it is, and the complete contents of
|
||||
the state stack afterward.
|
||||
@end itemize
|
||||
|
||||
To make sense of this information, it helps to refer to the automaton
|
||||
description file (@pxref{Understanding, ,Understanding Your Parser}).
|
||||
This file shows the meaning of each state in terms of
|
||||
positions in various rules, and also what each state will do with each
|
||||
possible input token. As you read the successive trace messages, you
|
||||
can see that the parser is functioning according to its specification in
|
||||
the listing file. Eventually you will arrive at the place where
|
||||
something undesirable happens, and you will see which parts of the
|
||||
grammar are to blame.
|
||||
description file (@pxref{Understanding, ,Understanding Your Parser}). This
|
||||
file shows the meaning of each state in terms of positions in various rules,
|
||||
and also what each state will do with each possible input token. As you
|
||||
read the successive trace messages, you can see that the parser is
|
||||
functioning according to its specification in the listing file. Eventually
|
||||
you will arrive at the place where something undesirable happens, and you
|
||||
will see which parts of the grammar are to blame.
|
||||
|
||||
The parser implementation file is a C/C++/Java program and you can use
|
||||
debuggers on it, but it's not easy to interpret what it is doing. The
|
||||
parser function is a finite-state machine interpreter, and aside from
|
||||
the actions it executes the same code over and over. Only the values
|
||||
of variables show where in the grammar it is working.
|
||||
parser function is a finite-state machine interpreter, and aside from the
|
||||
actions it executes the same code over and over. Only the values of
|
||||
variables show where in the grammar it is working.
|
||||
|
||||
@node Mfcalc Traces
|
||||
@subsection Enabling Debug Traces for @code{mfcalc}
|
||||
|
||||
The debugging information normally gives the token type of each token read,
|
||||
but not its semantic value. The @code{%printer} directive allows specify
|
||||
how semantic values are reported, see @ref{Printer Decl, , Printing
|
||||
Semantic Values}. For backward compatibility, Yacc like C parsers may also
|
||||
use the @code{YYPRINT} (@pxref{The YYPRINT Macro, , The @code{YYPRINT}
|
||||
Macro}), but its use is discouraged.
|
||||
how semantic values are reported, see @ref{Printer Decl, , Printing Semantic
|
||||
Values}.
|
||||
|
||||
As a demonstration of @code{%printer}, consider the multi-function
|
||||
calculator, @code{mfcalc} (@pxref{Multi-function Calc}). To enable run-time
|
||||
@@ -10234,14 +10229,16 @@ Cleanup: popping nterm input ()
|
||||
|
||||
@node The YYPRINT Macro
|
||||
@subsection The @code{YYPRINT} Macro
|
||||
|
||||
@findex YYPRINT
|
||||
Before @code{%printer} support, semantic values could be displayed using the
|
||||
@code{YYPRINT} macro, which works only for terminal symbols and only with
|
||||
the @file{yacc.c} skeleton.
|
||||
|
||||
The @code{%printer} directive was introduced in Bison 1.50 (November 2002).
|
||||
Before then, @code{YYPRINT} provided a similar feature, but only for
|
||||
terminal symbols and only with the @file{yacc.c} skeleton.
|
||||
|
||||
@deffn {Macro} YYPRINT (@var{stream}, @var{token}, @var{value});
|
||||
@findex YYPRINT
|
||||
Deprecated, will be removed eventually.
|
||||
|
||||
If you define @code{YYPRINT}, it should take three arguments. The parser
|
||||
will pass a standard I/O stream, the numeric code for the token type, and
|
||||
the token value (from @code{yylval}).
|
||||
@@ -10254,7 +10251,7 @@ calculator (@pxref{Mfcalc Declarations, ,Declarations for @code{mfcalc}}):
|
||||
|
||||
@example
|
||||
%@{
|
||||
static void print_token_value (FILE *, int, YYSTYPE);
|
||||
static void print_token_value (FILE *file, int type, YYSTYPE value);
|
||||
#define YYPRINT(File, Type, Value) \
|
||||
print_token_value (File, Type, Value)
|
||||
%@}
|
||||
@@ -10271,6 +10268,9 @@ print_token_value (FILE *file, int type, YYSTYPE value)
|
||||
@}
|
||||
@end example
|
||||
|
||||
@xref{Mfcalc Traces, ,Enabling Debug Traces for @code{mfcalc}}, for the
|
||||
proper use of @code{%printer}.
|
||||
|
||||
@c ================================================= Invoking Bison
|
||||
|
||||
@node Invocation
|
||||
@@ -10860,11 +10860,10 @@ different diagnostics to be generated (it implies @option{-Wyacc}), and may
|
||||
change behavior in other minor ways. Most importantly, imitate Yacc's
|
||||
output file name conventions, so that the parser implementation file is
|
||||
called @file{y.tab.c}, and the other outputs are called @file{y.output} and
|
||||
@file{y.tab.h}. Also, if generating a deterministic parser in C, generate
|
||||
@code{#define} statements in addition to an @code{enum} to associate token
|
||||
numbers with token names. Thus, the following shell script can substitute
|
||||
for Yacc, and the Bison distribution contains such a script for
|
||||
compatibility with POSIX:
|
||||
@file{y.tab.h}. Also, generate @code{#define} statements in addition to an
|
||||
@code{enum} to associate token numbers with token names. Thus, the
|
||||
following shell script can substitute for Yacc, and the Bison distribution
|
||||
contains such a script for compatibility with POSIX:
|
||||
|
||||
@example
|
||||
#! /bin/sh
|
||||
@@ -10872,9 +10871,9 @@ bison -y "$@@"
|
||||
@end example
|
||||
|
||||
The @option{-y}/@option{--yacc} option is intended for use with traditional
|
||||
Yacc grammars. If your grammar uses Bison extensions like
|
||||
@samp{%glr-parser}, Bison might not be Yacc-compatible even if this option
|
||||
is specified.
|
||||
Yacc grammars. This option only makes sense for the default C skeleton,
|
||||
@file{yacc.c}. If your grammar uses Bison extensions Bison cannot be
|
||||
Yacc-compatible, even if this option is specified.
|
||||
@end table
|
||||
|
||||
@node Output Files
|
||||
@@ -12106,13 +12105,24 @@ designed the grammar for.
|
||||
%defines
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
@findex %define api.token.raw
|
||||
Because our scanner returns only genuine tokens and never simple characters
|
||||
(i.e., it returns @samp{PLUS}, not @samp{'+'}), we can avoid conversions.
|
||||
|
||||
@comment file: calc++/parser.yy
|
||||
@example
|
||||
%define api.token.raw
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
@findex %define api.token.constructor
|
||||
@findex %define api.value.type variant
|
||||
This example will use genuine C++ objects as semantic values, therefore, we
|
||||
require the variant-based interface. To make sure we properly use it, we
|
||||
enable assertions. To fully benefit from type-safety and more natural
|
||||
definition of ``symbol'', we enable @code{api.token.constructor}.
|
||||
This example uses genuine C++ objects as semantic values, therefore, we
|
||||
require the variant-based storage of semantic values. To make sure we
|
||||
properly use it, we enable assertions. To fully benefit from type-safety
|
||||
and more natural definition of ``symbol'', we enable
|
||||
@code{api.token.constructor}.
|
||||
|
||||
@comment file: calc++/parser.yy
|
||||
@example
|
||||
@@ -14171,7 +14181,7 @@ it. Using @samp{%define parse.error verbose} is preferred
|
||||
@end deffn
|
||||
|
||||
@deffn {Macro} YYFPRINTF
|
||||
Macro used to output run-time traces.
|
||||
Macro used to output run-time traces in C.
|
||||
@xref{Enabling Traces}.
|
||||
@end deffn
|
||||
|
||||
@@ -14232,7 +14242,8 @@ parsing. @xref{Parser Function, ,The Parser Function @code{yyparse}}.
|
||||
|
||||
@deffn {Macro} YYPRINT
|
||||
Macro used to output token semantic values. For @file{yacc.c} only.
|
||||
Obsoleted by @code{%printer}.
|
||||
Deprecated, use @code{%printer} instead (@pxref{Printer Decl, , Printing
|
||||
Semantic Values}).
|
||||
@xref{The YYPRINT Macro, , The @code{YYPRINT} Macro}.
|
||||
@end deffn
|
||||
|
||||
@@ -14606,7 +14617,7 @@ London, Department of Computer Science, TR-00-12 (December 2000).
|
||||
@c LocalWords: strncmp intval tindex lvalp locp llocp typealt YYBACKUP subrange
|
||||
@c LocalWords: YYEMPTY YYEOF YYRECOVERING yyclearin GE def UMINUS maybeword loc
|
||||
@c LocalWords: Johnstone Shamsa Sadaf Hussain Tomita TR uref YYMAXDEPTH inline
|
||||
@c LocalWords: YYINITDEPTH stmts ref initdcl maybeasm notype Lookahead
|
||||
@c LocalWords: YYINITDEPTH stmts ref initdcl maybeasm notype Lookahead ctx
|
||||
@c LocalWords: hexflag STR exdent itemset asis DYYDEBUG YYFPRINTF args Autoconf
|
||||
@c LocalWords: ypp yxx itemx tex leaderfill Troubleshouting sqrt Graphviz
|
||||
@c LocalWords: hbox hss hfill tt ly yyin fopen fclose ofirst gcc ll lookahead
|
||||
@@ -14650,10 +14661,12 @@ London, Department of Computer Science, TR-00-12 (December 2000).
|
||||
@c LocalWords: Relocatability exprs fixit Wyacc parseable fixits ffixit svg
|
||||
@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: Beazley's goyacc ocamlyacc SIGACT SIGPLAN colorWarning
|
||||
@c LocalWords: Beazley's goyacc ocamlyacc SIGACT SIGPLAN colorWarning exVal
|
||||
@c LocalWords: setcolor rgbError colorError rgbNotice colorNotice derror
|
||||
@c LocalWords: colorOff maincolor inlineraw darkviolet darkcyan dwarning
|
||||
@c LocalWords: dnotice copyable stdint ptrdiff bufsize
|
||||
@c LocalWords: dnotice copyable stdint ptrdiff bufsize yyreport invariants
|
||||
@c LocalWords: xrefautomaticsectiontitle yysyntax yysymbol ARGMAX cond
|
||||
@c LocalWords: Wdangling
|
||||
|
||||
@c Local Variables:
|
||||
@c ispell-dictionary: "american"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2001-2003, 2005-2015, 2018-2019 Free Software
|
||||
## Copyright (C) 2001-2003, 2005-2015, 2018-2020 Free Software
|
||||
## Foundation, Inc.
|
||||
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
\def\finalout{\overfullrule=0pt}
|
||||
%\finalout
|
||||
|
||||
% Copyright (c) 1998, 2001, 2009-2015, 2018-2019 Free Software
|
||||
% Copyright (c) 1998, 2001, 2009--2015, 2018--2020 Free Software
|
||||
% Foundation, Inc.
|
||||
%
|
||||
% This file is part of Bison.
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ straightforward use of _build/src/bison would.)
|
||||
|
||||
--
|
||||
|
||||
Copyright (C) 2006, 2009-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2009-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2006, 2008-2015, 2018-2019 Free Software Foundation,
|
||||
# Copyright (C) 2006, 2008-2015, 2018-2020 Free Software Foundation,
|
||||
# Inc.
|
||||
#
|
||||
# This file is part of Bison, the GNU Compiler Compiler.
|
||||
@@ -100,7 +100,7 @@ Artificial grammar with very long rules.
|
||||
|
||||
=item B<-h>, B<--help>
|
||||
|
||||
Display this message and exit succesfully. The more verbose, the more
|
||||
Display this message and exit successfully. The more verbose, the more
|
||||
details.
|
||||
|
||||
=item B<-i>, B<--iterations>=I<integer>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2006, 2008-2015, 2018-2019 Free Software Foundation,
|
||||
## Copyright (C) 2006, 2008-2015, 2018-2020 Free Software Foundation,
|
||||
## Inc.
|
||||
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
||||
@@ -46,7 +46,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
@@ -55,5 +55,5 @@ 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.
|
||||
|
||||
# LocalWords: mfcalc calc parsers yy ispell american
|
||||
LocalWords: mfcalc calc parsers yy ispell american
|
||||
--->
|
||||
|
||||
@@ -36,22 +36,14 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2020 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.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# LocalWords: calc parsers yy MERCHANTABILITY Ctrl ispell american
|
||||
LocalWords: calc parsers yy MERCHANTABILITY Ctrl ispell american
|
||||
--->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2005-2006, 2008-2015, 2018-2019 Free Software
|
||||
## Copyright (C) 2005-2006, 2008-2015, 2018-2020 Free Software
|
||||
## Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2008-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2008-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -45,7 +45,9 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2020 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
|
||||
|
||||
@@ -9,20 +9,15 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2019-2020 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.
|
||||
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.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2019-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2019-2020 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -9,20 +9,14 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
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.
|
||||
--->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2005-2006, 2008-2015, 2018-2019 Free Software
|
||||
## Copyright (C) 2005-2006, 2008-2015, 2018-2020 Free Software
|
||||
## Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -26,20 +26,13 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2020 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.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2019-2020 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
// Emitted in the header file, before the definition of YYSTYPE.
|
||||
%code requires
|
||||
{
|
||||
#ifndef YY_TYPEDEF_YY_SCANNER_T
|
||||
# define YY_TYPEDEF_YY_SCANNER_T
|
||||
typedef void* yyscan_t;
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Whether to print the intermediate results.
|
||||
@@ -132,7 +136,6 @@ exp:
|
||||
|
||||
%%
|
||||
// Epilogue (C code).
|
||||
|
||||
#include "scan.h"
|
||||
|
||||
result
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -15,6 +15,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
seq 0 >/dev/null || exit 77
|
||||
|
||||
cat >input <<EOF
|
||||
1+2*3
|
||||
EOF
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2005-2006, 2008-2015, 2018-2019 Free Software
|
||||
## Copyright (C) 2005-2006, 2008-2015, 2018-2020 Free Software
|
||||
## Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -15,7 +15,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
# This file is part of GNU Bison
|
||||
|
||||
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2015, 2018-2019 Free
|
||||
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2015, 2018-2020 Free
|
||||
# Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -16,7 +16,7 @@ fill-column: 76
|
||||
ispell-dictionary: "american"
|
||||
End:
|
||||
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2005, 2008-2015, 2018-2019 Free Software Foundation,
|
||||
## Copyright (C) 2005, 2008-2015, 2018-2020 Free Software Foundation,
|
||||
## Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+15
-15
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -31,18 +31,18 @@ exit=true
|
||||
cwd=$(pwd)
|
||||
|
||||
# The exercised program.
|
||||
for p in "$cwd/examples/$medir/$me"
|
||||
do
|
||||
if test -x "$p"; then
|
||||
prog=$p
|
||||
break
|
||||
elif test -f "$p.class"; then
|
||||
pwd
|
||||
prog="$SHELL $cwd/javaexec.sh -cp $(dirname $p) $(basename $p)"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test x"$prog" = x; then
|
||||
abs_medir=$cwd/examples/$medir
|
||||
if test -x "$abs_medir/$me"; then
|
||||
prog ()
|
||||
{
|
||||
"$abs_medir/$me" "$@"
|
||||
}
|
||||
elif test -f "$abs_medir/$me.class"; then
|
||||
prog ()
|
||||
{
|
||||
"$SHELL" "$cwd/javaexec.sh" -cp "$abs_medir" "$me" "$@"
|
||||
}
|
||||
else
|
||||
echo "$me: ERROR: cannot find program to exercise in:"
|
||||
echo "$me: ERROR: $cwd/examples/$medir/$me"
|
||||
exit 1
|
||||
@@ -55,7 +55,7 @@ cleanup ()
|
||||
{
|
||||
status=$?
|
||||
if test -z "$DEBUG"; then
|
||||
cd $cwd
|
||||
cd "$cwd"
|
||||
rm -rf $$.dir
|
||||
fi
|
||||
exit $status
|
||||
@@ -82,7 +82,7 @@ run ()
|
||||
shift
|
||||
# Effective exit status.
|
||||
sta_eff=0
|
||||
$prog "$@" - <input >out_eff 2>err_eff || sta_eff=$?
|
||||
prog "$@" - <input >out_eff 2>err_eff || sta_eff=$?
|
||||
# Combine effective output and error streams.
|
||||
out_eff=$(cat out_eff && $noerr || sed -e 's/^/err: /g' err_eff)
|
||||
if test $sta_eff -eq $sta_exp; then
|
||||
|
||||
+1
-1
Submodule gnulib updated: a4740cc6fa...d279bc6d9f
@@ -138,13 +138,19 @@
|
||||
/isnanl-nolibm.h
|
||||
/isnanl.c
|
||||
/iswblank.c
|
||||
/iswdigit.c
|
||||
/iswxdigit.c
|
||||
/itold.c
|
||||
/lc-charset-dispatch.c
|
||||
/lc-charset-dispatch.h
|
||||
/ldexpl.c
|
||||
/libc-config.h
|
||||
/limits.h
|
||||
/limits.in.h
|
||||
/localcharset.c
|
||||
/localcharset.h
|
||||
/locale.h
|
||||
/locale.in.h
|
||||
/localtime-buffer.c
|
||||
/localtime-buffer.h
|
||||
/lstat.c
|
||||
@@ -158,10 +164,14 @@
|
||||
/mbchar.h
|
||||
/mbfile.c
|
||||
/mbfile.h
|
||||
/mbrtowc-impl-utf8.h
|
||||
/mbrtowc-impl.h
|
||||
/mbrtowc.c
|
||||
/mbsinit.c
|
||||
/mbswidth.c
|
||||
/mbswidth.h
|
||||
/mbtowc-lock.c
|
||||
/mbtowc-lock.h
|
||||
/memchr.c
|
||||
/memchr.valgrind
|
||||
/minmax.h
|
||||
@@ -209,6 +219,9 @@
|
||||
/sched.h
|
||||
/sched.in.h
|
||||
/setenv.c
|
||||
/setlocale-lock.c
|
||||
/setlocale_null.c
|
||||
/setlocale_null.h
|
||||
/sig-handler.c
|
||||
/sig-handler.h
|
||||
/sigaction.c
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* get-errno.c - get and set errno.
|
||||
|
||||
Copyright (C) 2002, 2006, 2009-2015, 2018-2019 Free Software
|
||||
Copyright (C) 2002, 2006, 2009-2015, 2018-2020 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* get-errno.h - get and set errno.
|
||||
|
||||
Copyright (C) 2002, 2009-2015, 2018-2019 Free Software Foundation,
|
||||
Copyright (C) 2002, 2009-2015, 2018-2020 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2001-2015, 2018-2019 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2001-2015, 2018-2020 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Yacc library main function.
|
||||
|
||||
Copyright (C) 2002, 2009-2015, 2018-2019 Free Software Foundation,
|
||||
Copyright (C) 2002, 2009-2015, 2018-2020 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* Concatenate path components.
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/* Concatenate path components.
|
||||
Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
||||
Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user