parser: add some notes about byacc working We now also work with byacc (version tested: 20130925) which some people prefer, perhaps due to its license (public domain) or performance (haven't compared). When using byacc, currently the following warning comes up: src/xkbcomp/parser.c:954:14: warning: declaration shadows a variable in the global scope [-Wshadow] YYSTYPE yylval; ^ src/xkbcomp/parser.c:37:20: note: expanded from macro 'yylval' #define yylval _xkbcommon_lval ^ ./src/xkbcomp/parser.h:96:16: note: previous declaration is here extern YYSTYPE _xkbcommon_lval; This is due to a bug in byacc - it shouldn't output that extern line in %pure-parser mode. So the warning stays. Signed-off-by: Ran Benita <ran234@gmail.com>
diff --git a/configure.ac b/configure.ac
index 48fa488..c0ac1c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,6 +56,8 @@ AC_C_INLINE
AC_PROG_MKDIR_P
PKG_PROG_PKG_CONFIG
+# Note: we use some yacc extensions, which work with either GNU bison
+# (preferred) or byacc. Other yacc's may or may not work.
AC_PROG_YACC
AC_PATH_PROG([YACC_INST], $YACC)
if test ! -f "src/xkbcomp/parser.c"; then
diff --git a/src/xkbcomp/parser.y b/src/xkbcomp/parser.y
index bb4be7b..001ea67 100644
--- a/src/xkbcomp/parser.y
+++ b/src/xkbcomp/parser.y
@@ -24,6 +24,12 @@
********************************************************/
+/*
+ * The parser should work with reasonably recent versions of either
+ * bison or byacc. So if you make changes, try to make sure it works
+ * in both!
+ */
+
%{
#include "xkbcomp-priv.h"
#include "ast-build.h"