diff options
author | Daiki Ueno <ueno@gnu.org> | 2014-04-23 17:44:46 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2014-04-23 17:53:05 +0900 |
commit | 19f23e290a5e4a82b9edf9f5a4f8ab6192871be9 (patch) | |
tree | c6353d6a72cb1dd10ee9334649a8430c866ac464 /gettext-runtime/intl | |
parent | d70724a34ca4d4f26e588ec5c300820bc1f2822d (diff) | |
download | external_gettext-19f23e290a5e4a82b9edf9f5a4f8ab6192871be9.zip external_gettext-19f23e290a5e4a82b9edf9f5a4f8ab6192871be9.tar.gz external_gettext-19f23e290a5e4a82b9edf9f5a4f8ab6192871be9.tar.bz2 |
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.
Diffstat (limited to 'gettext-runtime/intl')
-rw-r--r-- | gettext-runtime/intl/ChangeLog | 9 | ||||
-rw-r--r-- | gettext-runtime/intl/plural-exp.h | 2 | ||||
-rw-r--r-- | gettext-runtime/intl/plural.y | 21 |
3 files changed, 20 insertions, 12 deletions
diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 5316888..d4523a5 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,12 @@ +2014-04-23 Daiki Ueno <ueno@gnu.org> + + 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 <carlos@redhat.com> Jeff Law <law@redhat.com> diff --git a/gettext-runtime/intl/plural-exp.h b/gettext-runtime/intl/plural-exp.h index cc3fcf6..251d57c 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 46d86b4..673567e 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. */ } |