Commit e4c00e90abf530fc58ad0af391ea8f1829a3153d

Ran Benita 2013-09-29T00:19:32

parser: don't use enum yytokentype byacc doesn't support this, it just puts out #define's for the tokens. Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/xkbcomp/keywords.c b/src/xkbcomp/keywords.c
index dba7086..c19d66f 100644
--- a/src/xkbcomp/keywords.c
+++ b/src/xkbcomp/keywords.c
@@ -38,7 +38,7 @@ keyword_gperf_hash(const char *str, unsigned int len);
 
 static const struct keyword_tok *
 keyword_gperf_lookup(const char *str, unsigned int len);
-struct keyword_tok { int name; enum yytokentype tok; };
+struct keyword_tok { int name; int tok; };
 #include <string.h>
 /* maximum key range = 70, duplicates = 0 */
 
diff --git a/src/xkbcomp/keywords.gperf b/src/xkbcomp/keywords.gperf
index cfbfe8f..4a77703 100644
--- a/src/xkbcomp/keywords.gperf
+++ b/src/xkbcomp/keywords.gperf
@@ -9,7 +9,7 @@ static const struct keyword_tok *
 keyword_gperf_lookup(const char *str, unsigned int len);
 %}
 
-struct keyword_tok { int name; enum yytokentype tok; };
+struct keyword_tok { int name; int tok; };
 %language=ANSI-C
 %define hash-function-name keyword_gperf_hash
 %define lookup-function-name keyword_gperf_lookup
diff --git a/src/xkbcomp/scanner.c b/src/xkbcomp/scanner.c
index b37adec..fa63e10 100644
--- a/src/xkbcomp/scanner.c
+++ b/src/xkbcomp/scanner.c
@@ -47,7 +47,7 @@ scanner_warn(YYLTYPE *yylloc, struct scanner *s, const char *msg)
 }
 
 static bool
-number(struct scanner *s, int64_t *out, enum yytokentype *out_tok)
+number(struct scanner *s, int64_t *out, int *out_tok)
 {
     bool is_float = false, is_hex = false;
     const char *start = s->s + s->pos;
@@ -82,7 +82,7 @@ number(struct scanner *s, int64_t *out, enum yytokentype *out_tok)
 int
 _xkbcommon_lex(YYSTYPE *yylval, YYLTYPE *yylloc, struct scanner *s)
 {
-    enum yytokentype tok;
+    int tok;
 
 skip_more_whitespace_and_comments:
     /* Skip spaces. */