Commit 3c943d83 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Add support for Bison 3.0.

We still want to remain compatible with Bison 2.7 so instead of fixing
all the new errors reported by 3.0 we silence some warning.  We should
fix these for good once Bison 3.0 is more widespread.

* m4/bison.m4: New file. Test if bison support -Wno-empty-rule and
-Wno-deprecated.  Define BISON and BISON_EXTRA_FLAGS.
* configure.ac: Do not test for yacc, use the above test instead.
* src/dstarparse/Makefile.am, src/eltlparse/Makefile.am,
src/kripkeparse/Makefile.am, src/ltlparse/Makefile.am,
src/neverparse/Makefile.am, src/tgbaparse/Makefile.am: Use BISON
and BISON_EXTRA_FLAGS.
* src/ltlparse/ltlparse.yy: Fix or and remove useless %right/%nonassoc
settings.
* src/eltlparse/eltlparse.yy: Likewise, and remove "%pure-parser".
parent 56638720
...@@ -54,7 +54,7 @@ AM_PROG_CC_C_O ...@@ -54,7 +54,7 @@ AM_PROG_CC_C_O
AC_PROG_CXX AC_PROG_CXX
AM_PROG_LEX AM_PROG_LEX
AC_PROG_YACC adl_CHECK_BISON
gl_INIT gl_INIT
......
AC_DEFUN([adl_CHECK_BISON],
[AC_ARG_VAR([BISON], [Bison parser generator])
AC_CHECK_PROGS([BISON], [bison])
if test -n "$BISON"; then
# Bison 3.0 has warning about issues that cannot be fixed in a
# compatible way with Bison 2.7. Since we want to be compatible
# with both version AND use -Werror, disable those warnings.
# (Unfortunately -Wno-error=empty-rule,no-error=deprecated does not
# work: https://lists.gnu.org/archive/html/bug-bison/2013-09/index.html)
opt='-Wno-empty-rule -Wno-deprecated -Wno-precedence'
if AM_RUN_LOG([$BISON $opt --version]); then
BISON_EXTRA_FLAGS=$opt
fi
fi
AC_SUBST([BISON_EXTRA_FLAGS])])
...@@ -43,7 +43,7 @@ $(FROM_DSTARPARSE_YY_MAIN): $(srcdir)/$(DSTARPARSE_YY) ...@@ -43,7 +43,7 @@ $(FROM_DSTARPARSE_YY_MAIN): $(srcdir)/$(DSTARPARSE_YY)
## $(srcdir)/$(DSTARPARSE_YY), it will also use the value of $(srcdir)/ ## $(srcdir)/$(DSTARPARSE_YY), it will also use the value of $(srcdir)/
## in the generated include statements. ## in the generated include statements.
cd $(srcdir) && \ cd $(srcdir) && \
bison -Wall -Werror --report=all \ $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \
$(DSTARPARSE_YY) -o $(FROM_DSTARPARSE_YY_MAIN) $(DSTARPARSE_YY) -o $(FROM_DSTARPARSE_YY_MAIN)
$(FROM_DSTARPARSE_YY_OTHERS): $(DSTARPARSE_YY) $(FROM_DSTARPARSE_YY_OTHERS): $(DSTARPARSE_YY)
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_DSTARPARSE_YY_MAIN) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_DSTARPARSE_YY_MAIN)
......
...@@ -40,7 +40,7 @@ $(FROM_ELTLPARSE_YY_MAIN): $(srcdir)/$(ELTLPARSE_YY) ...@@ -40,7 +40,7 @@ $(FROM_ELTLPARSE_YY_MAIN): $(srcdir)/$(ELTLPARSE_YY)
## $(srcdir)/$(ELTLPARSE_YY), it will also use the value of $(srcdir)/ ## $(srcdir)/$(ELTLPARSE_YY), it will also use the value of $(srcdir)/
## in the generated include statements. ## in the generated include statements.
cd $(srcdir) && \ cd $(srcdir) && \
bison -Wall -Werror --report=all \ $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \
$(ELTLPARSE_YY) -o $(FROM_ELTLPARSE_YY_MAIN) $(ELTLPARSE_YY) -o $(FROM_ELTLPARSE_YY_MAIN)
$(FROM_ELTLPARSE_YY_OTHERS): $(ELTLPARSE_YY) $(FROM_ELTLPARSE_YY_OTHERS): $(ELTLPARSE_YY)
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_ELTLPARSE_YY_MAIN) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_ELTLPARSE_YY_MAIN)
......
...@@ -67,7 +67,7 @@ namespace spot ...@@ -67,7 +67,7 @@ namespace spot
%parse-param {const spot::ltl::formula* &result} %parse-param {const spot::ltl::formula* &result}
%lex-param {spot::eltl::parse_error_list_t &pe} %lex-param {spot::eltl::parse_error_list_t &pe}
%expect 0 %expect 0
%pure-parser
%union %union
{ {
int ival; int ival;
......
...@@ -44,7 +44,7 @@ $(FROM_KRIPKEPARSE_YY_MAIN): $(srcdir)/$(KRIPKEPARSE_YY) ...@@ -44,7 +44,7 @@ $(FROM_KRIPKEPARSE_YY_MAIN): $(srcdir)/$(KRIPKEPARSE_YY)
## $(srcdir)/$(KRIPKEPARSE_YY), it will also use the value of $(srcdir)/ ## $(srcdir)/$(KRIPKEPARSE_YY), it will also use the value of $(srcdir)/
## in the generated include statements. ## in the generated include statements.
cd $(srcdir) && \ cd $(srcdir) && \
bison -Wall -Werror --report=all \ $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \
$(KRIPKEPARSE_YY) -o $(FROM_KRIPKEPARSE_YY_MAIN) $(KRIPKEPARSE_YY) -o $(FROM_KRIPKEPARSE_YY_MAIN)
$(FROM_KRIPKEPARSE_YY_OTHERS): $(KRIPKEPARSE_YY) $(FROM_KRIPKEPARSE_YY_OTHERS): $(KRIPKEPARSE_YY)
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_KRIPKEPARSE_YY_MAIN) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_KRIPKEPARSE_YY_MAIN)
......
...@@ -43,7 +43,7 @@ $(FROM_LTLPARSE_YY_MAIN): $(srcdir)/$(LTLPARSE_YY) ...@@ -43,7 +43,7 @@ $(FROM_LTLPARSE_YY_MAIN): $(srcdir)/$(LTLPARSE_YY)
## $(srcdir)/$(LTLPARSE_YY), it will also use the value of $(srcdir)/ ## $(srcdir)/$(LTLPARSE_YY), it will also use the value of $(srcdir)/
## in the generated include statements. ## in the generated include statements.
cd $(srcdir) && \ cd $(srcdir) && \
bison -Wall -Werror --report=all \ $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \
$(LTLPARSE_YY) -o $(FROM_LTLPARSE_YY_MAIN) $(LTLPARSE_YY) -o $(FROM_LTLPARSE_YY_MAIN)
$(FROM_LTLPARSE_YY_OTHERS): $(LTLPARSE_YY) $(FROM_LTLPARSE_YY_OTHERS): $(LTLPARSE_YY)
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_LTLPARSE_YY_MAIN) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_LTLPARSE_YY_MAIN)
......
...@@ -197,7 +197,7 @@ using namespace spot::ltl; ...@@ -197,7 +197,7 @@ using namespace spot::ltl;
/* Priorities. */ /* Priorities. */
/* Low priority SERE-LTL binding operator. */ /* Low priority SERE-LTL binding operator. */
%right OP_UCONCAT OP_ECONCAT OP_UCONCAT_NONO OP_ECONCAT_NONO %nonassoc OP_UCONCAT OP_ECONCAT OP_UCONCAT_NONO OP_ECONCAT_NONO
%left OP_CONCAT %left OP_CONCAT
%left OP_FUSION %left OP_FUSION
...@@ -222,11 +222,11 @@ using namespace spot::ltl; ...@@ -222,11 +222,11 @@ using namespace spot::ltl;
/* High priority regex operator. */ /* High priority regex operator. */
%nonassoc OP_BSTAR OP_STAR_OPEN OP_PLUS OP_EQUAL_OPEN OP_GOTO_OPEN %nonassoc OP_BSTAR OP_STAR_OPEN OP_PLUS OP_EQUAL_OPEN OP_GOTO_OPEN
/* Not has the most important priority after Wring's `=0' and `=1'. */ /* Not has the most important priority (after Wring's `=0' and `=1',
but as those can only attach to atomic proposition, they do not
need any precedence). */
%nonassoc OP_NOT %nonassoc OP_NOT
%nonassoc OP_POST_NEG OP_POST_POS
%type <ltl> subformula booleanatom sere lbtformula boolformula %type <ltl> subformula booleanatom sere lbtformula boolformula
%type <ltl> bracedsere parenthesedsubformula %type <ltl> bracedsere parenthesedsubformula
%type <minmax> starargs equalargs sqbracketargs gotoargs %type <minmax> starargs equalargs sqbracketargs gotoargs
......
...@@ -43,7 +43,7 @@ $(FROM_NEVERCLAIMPARSE_YY_MAIN): $(srcdir)/$(NEVERCLAIMPARSE_YY) ...@@ -43,7 +43,7 @@ $(FROM_NEVERCLAIMPARSE_YY_MAIN): $(srcdir)/$(NEVERCLAIMPARSE_YY)
## $(srcdir)/$(NEVERCLAIMPARSE_YY), it will also use the value of $(srcdir)/ ## $(srcdir)/$(NEVERCLAIMPARSE_YY), it will also use the value of $(srcdir)/
## in the generated include statements. ## in the generated include statements.
cd $(srcdir) && \ cd $(srcdir) && \
bison -Wall -Werror --report=all \ $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \
$(NEVERCLAIMPARSE_YY) -o $(FROM_NEVERCLAIMPARSE_YY_MAIN) $(NEVERCLAIMPARSE_YY) -o $(FROM_NEVERCLAIMPARSE_YY_MAIN)
$(FROM_NEVERCLAIMPARSE_YY_OTHERS): $(NEVERCLAIMPARSE_YY) $(FROM_NEVERCLAIMPARSE_YY_OTHERS): $(NEVERCLAIMPARSE_YY)
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_NEVERCLAIMPARSE_YY_MAIN) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_NEVERCLAIMPARSE_YY_MAIN)
......
...@@ -46,7 +46,7 @@ $(FROM_TGBAPARSE_YY_MAIN): $(srcdir)/$(TGBAPARSE_YY) ...@@ -46,7 +46,7 @@ $(FROM_TGBAPARSE_YY_MAIN): $(srcdir)/$(TGBAPARSE_YY)
## $(srcdir)/$(TGBAPARSE_YY), it will also use the value of $(srcdir)/ ## $(srcdir)/$(TGBAPARSE_YY), it will also use the value of $(srcdir)/
## in the generated include statements. ## in the generated include statements.
cd $(srcdir) && \ cd $(srcdir) && \
bison -Wall -Werror --report=all \ $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \
$(TGBAPARSE_YY) -o $(FROM_TGBAPARSE_YY_MAIN) $(TGBAPARSE_YY) -o $(FROM_TGBAPARSE_YY_MAIN)
$(FROM_TGBAPARSE_YY_OTHERS): $(TGBAPARSE_YY) $(FROM_TGBAPARSE_YY_OTHERS): $(TGBAPARSE_YY)
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_TGBAPARSE_YY_MAIN) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_TGBAPARSE_YY_MAIN)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment