]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
intl: Port to Bison 3.0
authorDaiki Ueno <ueno@gnu.org>
Wed, 23 Apr 2014 08:44:46 +0000 (17:44 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 23 Apr 2014 08:53:05 +0000 (17:53 +0900)
* 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.

gettext-runtime/intl/ChangeLog
gettext-runtime/intl/plural-exp.h
gettext-runtime/intl/plural.y

index 53168881e6d021b677814f717d62c9a96ab1ffac..d4523a54bc30ab0d207c3d626a81c2ff8ddee35c 100644 (file)
@@ -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>
 
index cc3fcf65ffd252122962b262ea2d955606f74032..251d57cef7976ee37588805b5d4a0f46e753fe29 100644 (file)
@@ -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,
index 46d86b4e9ca125a8ceaa81945422b935f9d729ca..673567e26357e86812d9c2465be4b6020e21e30c 100644 (file)
 # 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.  */
 }