Add _xkbcommon_ prefix to parser and lexer symbols

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
master
Daniel Stone 2012-09-20 23:28:27 +10:00
parent 80e156814d
commit 005dee2bb6
4 changed files with 10 additions and 7 deletions

View File

@ -28,6 +28,7 @@ AM_CFLAGS = \
$(BASE_CFLAGS) \
$(XMALLOC_ZERO_CFLAGS)
AM_LFLAGS = -o lex.yy.c
AM_YFLAGS = -d
xkbcommonincludedir = $(includedir)/xkbcommon

View 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

View 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 }

View 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;