Add _xkbcommon_ prefix to parser and lexer symbols
authorDaniel Stone <daniel@fooishbar.org>
Thu, 20 Sep 2012 13:28:27 +0000 (23:28 +1000)
committerDaniel Stone <daniel@fooishbar.org>
Thu, 20 Sep 2012 13:30:17 +0000 (23:30 +1000)
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Makefile.am
src/xkbcomp/parser-priv.h
src/xkbcomp/parser.y
src/xkbcomp/scanner.l

index a8c1414..7d1bffe 100644 (file)
@@ -28,6 +28,7 @@ AM_CFLAGS = \
        $(BASE_CFLAGS) \
        $(XMALLOC_ZERO_CFLAGS)
 
+AM_LFLAGS = -o lex.yy.c
 AM_YFLAGS = -d
 
 xkbcommonincludedir = $(includedir)/xkbcommon
index 17db6ed..98a97e9 100644 (file)
@@ -43,6 +43,6 @@ void
 scanner_error(YYLTYPE *loc, void *scanner, const char *msg);
 
 int
-yylex(YYSTYPE *val, YYLTYPE *loc, void *scanner);
+_xkbcommon_lex(YYSTYPE *val, YYLTYPE *loc, void *scanner);
 
 #endif
index e1bf18e..bb1bb82 100644 (file)
@@ -30,7 +30,7 @@
 #include "parser-priv.h"
 
 static void
-yyerror(struct YYLTYPE *loc, struct parser_param *param, const char *msg)
+_xkbcommon_error(struct YYLTYPE *loc, struct parser_param *param, const char *msg)
 {
     scanner_error(loc, param->scanner, msg);
 }
@@ -38,6 +38,7 @@ yyerror(struct YYLTYPE *loc, struct parser_param *param, const char *msg)
 #define scanner param->scanner
 %}
 
+%name-prefix    "_xkbcommon_"
 %define         api.pure
 %locations
 %lex-param      { void *scanner }
index 95fcaa1..283d07e 100644 (file)
@@ -53,6 +53,7 @@ scanner_error_extra(struct YYLTYPE *loc, struct scanner_extra *extra,
 } while (0)
 %}
 
+%option prefix="_xkbcommon_"
 %option reentrant
 %option extra-type="struct scanner_extra *"
 %option bison-bridge bison-locations
@@ -279,9 +280,9 @@ XkbParseString(struct xkb_context *ctx, const char *string,
         return false;
 
     state = yy_scan_string(string, param.scanner);
-    ret = yyparse(&param);
+    ret = _xkbcommon_parse(&param);
     yy_delete_buffer(state, param.scanner);
-    yylex_destroy(param.scanner);
+    _xkbcommon_lex_destroy(param.scanner);
     free(extra.scanFile);
     if (ret != 0)
         return false;
@@ -315,9 +316,9 @@ XkbParseFile(struct xkb_context *ctx, FILE *file,
     if (!extra.scanFile)
         return false;
 
-    yyset_in(file, param.scanner);
-    ret = yyparse(&param);
-    yylex_destroy(param.scanner);
+    _xkbcommon_set_in(file, param.scanner);
+    ret = _xkbcommon_parse(&param);
+    _xkbcommon_lex_destroy(param.scanner);
     free(extra.scanFile);
     if (ret != 0)
         return false;