bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gettext] [PATCH] intl: Port to Bison 3.0


From: Daiki Ueno
Subject: [bug-gettext] [PATCH] intl: Port to Bison 3.0
Date: Wed, 23 Apr 2014 17:58:43 +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    |  9 +++++++++
 gettext-runtime/intl/plural-exp.h |  2 +-
 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  <address@hidden>
+
+       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  <address@hidden>
             Jeff Law  <address@hidden>
 
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.  */
 }
-- 
1.9.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]