From: Daiki Ueno Date: Wed, 23 Apr 2014 08:44:46 +0000 (+0900) Subject: intl: Port to Bison 3.0 X-Git-Tag: v0.19~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19f23e290a5e4a82b9edf9f5a4f8ab6192871be9;p=thirdparty%2Fgettext.git intl: Port to Bison 3.0 * gettext-runtime/intl/plural.y: Don't use removed YYLEX_PARAM and YYPARSE_PARAM macros; replace deprecated %pure_parser with '%define api.pure full'; adjust yylex/yyerror arglist. * gettext-runtime/intl/plural-exp.h (PLURAL_PARSE): Use explicit type 'struct parse_args *arg' for ARG. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 53168881e..d4523a54b 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,12 @@ +2014-04-23 Daiki Ueno + + intl: Port to Bison 3.0 + * plural.y: Don't use removed YYLEX_PARAM and YYPARSE_PARAM + macros; replace deprecated %pure_parser with '%define api.pure + full'; adjust yylex/yyerror arglist. + * plural-exp.h (PLURAL_PARSE): Use explicit type 'struct + parse_args *arg' for ARG. + 2013-05-07 Carlos O'Donell Jeff Law diff --git a/gettext-runtime/intl/plural-exp.h b/gettext-runtime/intl/plural-exp.h index cc3fcf65f..251d57cef 100644 --- a/gettext-runtime/intl/plural-exp.h +++ b/gettext-runtime/intl/plural-exp.h @@ -107,7 +107,7 @@ struct parse_args extern void FREE_EXPRESSION (struct expression *exp) internal_function; -extern int PLURAL_PARSE (void *arg); +extern int PLURAL_PARSE (struct parse_args *arg); extern struct expression GERMANIC_PLURAL attribute_hidden; extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry, const struct expression **pluralp, diff --git a/gettext-runtime/intl/plural.y b/gettext-runtime/intl/plural.y index 46d86b4e9..673567e26 100644 --- a/gettext-runtime/intl/plural.y +++ b/gettext-runtime/intl/plural.y @@ -40,10 +40,9 @@ # define __gettextparse PLURAL_PARSE #endif -#define YYLEX_PARAM &((struct parse_args *) arg)->cp -#define YYPARSE_PARAM arg %} -%pure_parser +%param {struct parse_args *arg} +%define api.pure full %expect 7 %union { @@ -54,8 +53,8 @@ %{ /* Prototypes for local functions. */ -static int yylex (YYSTYPE *lval, const char **pexp); -static void yyerror (const char *str); +static int yylex (YYSTYPE *lval, struct parse_args *arg); +static void yyerror (struct parse_args *arg, const char *str); /* Allocation of expressions. */ @@ -153,7 +152,7 @@ start: exp { if ($1 == NULL) YYABORT; - ((struct parse_args *) arg)->res = $1; + arg->res = $1; } ; @@ -234,16 +233,16 @@ FREE_EXPRESSION (struct expression *exp) static int -yylex (YYSTYPE *lval, const char **pexp) +yylex (YYSTYPE *lval, struct parse_args *arg) { - const char *exp = *pexp; + const char *exp = arg->cp; int result; while (1) { if (exp[0] == '\0') { - *pexp = exp; + arg->cp = exp; return YYEOF; } @@ -370,14 +369,14 @@ yylex (YYSTYPE *lval, const char **pexp) break; } - *pexp = exp; + arg->cp = exp; return result; } static void -yyerror (const char *str) +yyerror (struct parse_args *arg, const char *str) { /* Do nothing. We don't print error messages here. */ }