parser: don't use enum yytokentype
authorRan Benita <ran234@gmail.com>
Sat, 28 Sep 2013 21:19:32 +0000 (00:19 +0300)
committerRan Benita <ran234@gmail.com>
Sat, 28 Sep 2013 21:19:32 +0000 (00:19 +0300)
byacc doesn't support this, it just puts out #define's for the tokens.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/keywords.c
src/xkbcomp/keywords.gperf
src/xkbcomp/scanner.c

index dba7086..c19d66f 100644 (file)
@@ -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 */
 
index cfbfe8f..4a77703 100644 (file)
@@ -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
index b37adec..fa63e10 100644 (file)
@@ -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. */