diff --git a/configure.ac b/configure.ac index b0d2b3644..a8df259ee 100644 --- a/configure.ac +++ b/configure.ac @@ -54,7 +54,7 @@ AM_PROG_CC_C_O AC_PROG_CXX AM_PROG_LEX -AC_PROG_YACC +adl_CHECK_BISON gl_INIT diff --git a/m4/bison.m4 b/m4/bison.m4 new file mode 100644 index 000000000..fcb8f3b63 --- /dev/null +++ b/m4/bison.m4 @@ -0,0 +1,15 @@ +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])]) diff --git a/src/dstarparse/Makefile.am b/src/dstarparse/Makefile.am index a50feabd0..e739ba636 100644 --- a/src/dstarparse/Makefile.am +++ b/src/dstarparse/Makefile.am @@ -43,7 +43,7 @@ $(FROM_DSTARPARSE_YY_MAIN): $(srcdir)/$(DSTARPARSE_YY) ## $(srcdir)/$(DSTARPARSE_YY), it will also use the value of $(srcdir)/ ## in the generated include statements. cd $(srcdir) && \ - bison -Wall -Werror --report=all \ + $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \ $(DSTARPARSE_YY) -o $(FROM_DSTARPARSE_YY_MAIN) $(FROM_DSTARPARSE_YY_OTHERS): $(DSTARPARSE_YY) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_DSTARPARSE_YY_MAIN) diff --git a/src/eltlparse/Makefile.am b/src/eltlparse/Makefile.am index 91f6bba7a..0d0fb0d4a 100644 --- a/src/eltlparse/Makefile.am +++ b/src/eltlparse/Makefile.am @@ -40,7 +40,7 @@ $(FROM_ELTLPARSE_YY_MAIN): $(srcdir)/$(ELTLPARSE_YY) ## $(srcdir)/$(ELTLPARSE_YY), it will also use the value of $(srcdir)/ ## in the generated include statements. cd $(srcdir) && \ - bison -Wall -Werror --report=all \ + $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \ $(ELTLPARSE_YY) -o $(FROM_ELTLPARSE_YY_MAIN) $(FROM_ELTLPARSE_YY_OTHERS): $(ELTLPARSE_YY) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_ELTLPARSE_YY_MAIN) diff --git a/src/eltlparse/eltlparse.yy b/src/eltlparse/eltlparse.yy index e52d1d6a7..16e32bfff 100644 --- a/src/eltlparse/eltlparse.yy +++ b/src/eltlparse/eltlparse.yy @@ -67,7 +67,7 @@ namespace spot %parse-param {const spot::ltl::formula* &result} %lex-param {spot::eltl::parse_error_list_t &pe} %expect 0 -%pure-parser + %union { int ival; diff --git a/src/kripkeparse/Makefile.am b/src/kripkeparse/Makefile.am index c2e7e11c6..9d347b134 100644 --- a/src/kripkeparse/Makefile.am +++ b/src/kripkeparse/Makefile.am @@ -44,7 +44,7 @@ $(FROM_KRIPKEPARSE_YY_MAIN): $(srcdir)/$(KRIPKEPARSE_YY) ## $(srcdir)/$(KRIPKEPARSE_YY), it will also use the value of $(srcdir)/ ## in the generated include statements. cd $(srcdir) && \ - bison -Wall -Werror --report=all \ + $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \ $(KRIPKEPARSE_YY) -o $(FROM_KRIPKEPARSE_YY_MAIN) $(FROM_KRIPKEPARSE_YY_OTHERS): $(KRIPKEPARSE_YY) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_KRIPKEPARSE_YY_MAIN) diff --git a/src/ltlparse/Makefile.am b/src/ltlparse/Makefile.am index ccbc0eac0..076ebbc5d 100644 --- a/src/ltlparse/Makefile.am +++ b/src/ltlparse/Makefile.am @@ -43,7 +43,7 @@ $(FROM_LTLPARSE_YY_MAIN): $(srcdir)/$(LTLPARSE_YY) ## $(srcdir)/$(LTLPARSE_YY), it will also use the value of $(srcdir)/ ## in the generated include statements. cd $(srcdir) && \ - bison -Wall -Werror --report=all \ + $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \ $(LTLPARSE_YY) -o $(FROM_LTLPARSE_YY_MAIN) $(FROM_LTLPARSE_YY_OTHERS): $(LTLPARSE_YY) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_LTLPARSE_YY_MAIN) diff --git a/src/ltlparse/ltlparse.yy b/src/ltlparse/ltlparse.yy index a430eaae1..1bb71d4b6 100644 --- a/src/ltlparse/ltlparse.yy +++ b/src/ltlparse/ltlparse.yy @@ -197,7 +197,7 @@ using namespace spot::ltl; /* Priorities. */ /* 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_FUSION @@ -222,11 +222,11 @@ using namespace spot::ltl; /* High priority regex operator. */ %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_POST_NEG OP_POST_POS - %type subformula booleanatom sere lbtformula boolformula %type bracedsere parenthesedsubformula %type starargs equalargs sqbracketargs gotoargs diff --git a/src/neverparse/Makefile.am b/src/neverparse/Makefile.am index 904807c5e..d82eb71e8 100644 --- a/src/neverparse/Makefile.am +++ b/src/neverparse/Makefile.am @@ -43,7 +43,7 @@ $(FROM_NEVERCLAIMPARSE_YY_MAIN): $(srcdir)/$(NEVERCLAIMPARSE_YY) ## $(srcdir)/$(NEVERCLAIMPARSE_YY), it will also use the value of $(srcdir)/ ## in the generated include statements. cd $(srcdir) && \ - bison -Wall -Werror --report=all \ + $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \ $(NEVERCLAIMPARSE_YY) -o $(FROM_NEVERCLAIMPARSE_YY_MAIN) $(FROM_NEVERCLAIMPARSE_YY_OTHERS): $(NEVERCLAIMPARSE_YY) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_NEVERCLAIMPARSE_YY_MAIN) diff --git a/src/tgbaparse/Makefile.am b/src/tgbaparse/Makefile.am index eeb67ce86..754a0552e 100644 --- a/src/tgbaparse/Makefile.am +++ b/src/tgbaparse/Makefile.am @@ -46,7 +46,7 @@ $(FROM_TGBAPARSE_YY_MAIN): $(srcdir)/$(TGBAPARSE_YY) ## $(srcdir)/$(TGBAPARSE_YY), it will also use the value of $(srcdir)/ ## in the generated include statements. cd $(srcdir) && \ - bison -Wall -Werror --report=all \ + $(BISON) -Wall -Werror --report=all $(BISON_EXTRA_FLAGS) \ $(TGBAPARSE_YY) -o $(FROM_TGBAPARSE_YY_MAIN) $(FROM_TGBAPARSE_YY_OTHERS): $(TGBAPARSE_YY) @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(FROM_TGBAPARSE_YY_MAIN)