parser: add some notes about byacc working
authorRan Benita <ran234@gmail.com>
Sat, 28 Sep 2013 22:41:52 +0000 (01:41 +0300)
committerRan Benita <ran234@gmail.com>
Sat, 28 Sep 2013 22:41:52 +0000 (01:41 +0300)
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>
configure.ac
src/xkbcomp/parser.y

index 48fa488..c0ac1c5 100644 (file)
@@ -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
index bb4be7b..001ea67 100644 (file)
 
  ********************************************************/
 
+/*
+ * 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"