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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
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. */