bison-patches
[Top][All Lists]
Advanced

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

Re: Bison i18n patches installed


From: Paul Eggert
Subject: Re: Bison i18n patches installed
Date: Mon, 18 Jul 2005 15:13:24 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

> could you please add a reference to node 'Users' in gettext.info as
> primary reference? ....
> Looks all fine to me, except for a typo in PACKAGING:
> "to in the bison package".

Thanks for checking it.  I fixed those two issues in the patch
enclosed below, which I installed into Bison.

This patch also addresses some other issues, as described in the
ChangeLog.  Most importantly, the C++ skeleton i18n is broken (look
for FIXME), but I don't use C++ so I can't easily fix it.

Akim is the guy who usually worries about the C++ skeleton.  I believe
he was thinking of factoring the i18n stuff out into another file, but
don't know exactly how that would work.  Akim?

2005-07-18  Paul Eggert  <address@hidden>

        Add i18n support to the GLR skeleton.  Partially fix the C++
        skeleton; a C++ expert needs to finish this.  Remove debugging
        msgids; there's little point to having them translated, since they
        can be understood only by someone who can read the
        (English-language) source code.

        Generate runtime-po/bison-runtime.pot automatically, so that we
        don't have to worry about garbage getting in that file.  We'll
        make sure after the next official release that old msgids don't
        get lost.  See
        <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.

        * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
        Now auto-generated.
        * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
        Fix typos in explanations of the runtime file.
        * bootstrap: Change gettext keyword from YYI18N to YY_.
        Use standard Makefile.in.in in runtime-po, since we'll arrange
        for backward-compatible bison-runtime.po files in a different way.
        * data/glr.c (YY_): New macro, from yacc.c.
        (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
        Translate messages intended for users.
        (yyreportSyntaxError): Change "virtual memory" to "memory" to match
        the wording in the other skeletons.  We don't know that the memory
        is virtual.
        * data/lalr1.cc (YY_): Renamed from _.  All uses changed.
        Use same method that yacc.c uses.
        Don't translate debugging messages.
        (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
        it doesn't work (yet), and requires C++ expertise to fix.
        * data/yacc.c (YY_): Renamed from YY18N.  All uses changed.
        Move defn to a more logical place, to be consistent with other
        skeletons.
        Don't translate debugging messages.
        Don't assume line numbers fit in unsigned int; use unsigned long fmts.
        * doc/bison.texinfo: Mention <libintl.h>.  Change glibc cross reference
        to gettext cross reference.  Add indexing terms.  Mention YYENABLE_NLS.
        * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.

Index: PACKAGING
===================================================================
RCS file: /cvsroot/bison/bison/PACKAGING,v
retrieving revision 1.1
diff -p -u -r1.1 PACKAGING
--- PACKAGING   13 Jul 2005 18:16:30 -0000      1.1
+++ PACKAGING   18 Jul 2005 22:07:12 -0000
@@ -17,8 +17,8 @@ be split into two packages:
 
 The 'bison-runtime' binary package is much smaller than the 'bison'
 binary package.  It should be included in any distribution that
-contains programs that use the diagnostics contained in
-Bison-generated parsers, e.g., Gawk, GCC, Perl.
+contains localized programs that use the diagnostics contained in
+Bison-generated parsers.
 
 If you want to install both packages at the same time, you simply do
 at the toplevel directory:
@@ -27,12 +27,12 @@ at the toplevel directory:
       make
       make install
 
-After installation, the files
+After installation, the file
 
       $prefix/share/locale/*/LC_MESSAGES/bison-runtime.mo
 
-belong to the bison-runtime package; all other installed files belong
-to in the bison package.
+belongs to the bison-runtime package; all other installed files belong
+to the bison package.
 
 -----
 
Index: bootstrap
===================================================================
RCS file: /cvsroot/bison/bison/bootstrap,v
retrieving revision 1.21
diff -p -u -r1.21 bootstrap
--- bootstrap   12 Jul 2005 23:28:54 -0000      1.21
+++ bootstrap   18 Jul 2005 22:07:12 -0000
@@ -246,11 +246,11 @@ sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug
 sed '
   s/^\(DOMAIN\) *=.*/\1 = bison-runtime/
   s/^\(subdir\) *=.*/\1 = runtime-po/
-  s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = --keyword=YYI18N/
+  s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = --keyword=YY_/
 ' <po/Makevars >runtime-po/Makevars
 
 # Copy identical files from po to runtime-po.
-(cd po && cp -p *-quot *.header *.sed *.sin ../runtime-po)
+(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
 
 # if src/parse-gram.[ch] are out of date, rebuild them.
 parse_gram_y=`find src/parse-gram.y \
Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.101
diff -p -u -r1.101 glr.c
--- data/glr.c  18 Jul 2005 18:09:40 -0000      1.101
+++ data/glr.c  18 Jul 2005 22:07:12 -0000
@@ -218,6 +218,18 @@ b4_syncline(address@hidden@], address@hidden@])
 #include <stdarg.h>
 #include <setjmp.h>
 
+#ifndef YY_
+# if YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#  endif
+# endif
+# ifndef YY_
+#  define YY_(msgid) msgid
+# endif
+#endif
+
 #ifndef YYFREE
 # define YYFREE free
 #endif
@@ -771,7 +783,7 @@ yyuserAction (yyRuleNum yyn, int yyrhsle
 # define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal)
 # undef YYBACKUP
 # define YYBACKUP(Token, Value)                                                
     \
-  return yyerror (]b4_yyerror_args["syntax error: cannot back up"),         \
+  return yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")),     \
         yyerrok, yyerr
 
   yylow = 1;
@@ -1524,7 +1536,7 @@ yyreportAmbiguity (yySemanticOption* yyx
   yyreportTree (yyx1, 2);
   YYFPRINTF (stderr, "\n");
 #endif
-  yyFail (yystack][]b4_pure_args[, "ambiguity detected");
+  yyFail (yystack][]b4_pure_args[, YY_("ambiguity detected"));
 }
 
 
@@ -1774,8 +1786,8 @@ yyreportSyntaxError (yyGLRStack* yystack
                yyprefix = yyor;
              }
 
-         yyf = yyformat;
-         yysize1 = yysize + (yyfmt - yyformat);
+         yyf = YY_(yyformat);
+         yysize1 = yysize + strlen (yyf);
          yysize_overflow |= yysize1 < yysize;
          yysize = yysize1;
 
@@ -1803,11 +1815,11 @@ yyreportSyntaxError (yyGLRStack* yystack
              YYFREE (yymsg);
            }
          else
-           yyerror (]b4_lyyerror_args["syntax error; also virtual memory 
exhausted");
+           yyerror (]b4_lyyerror_args[YY_("syntax error; also memory 
exhausted"));
        }
       else
 #endif /* YYERROR_VERBOSE */
-       yyerror (]b4_lyyerror_args["syntax error");
+       yyerror (]b4_lyyerror_args[YY_("syntax error"));
       yynerrs += 1;
     }
 }
@@ -2068,7 +2080,7 @@ b4_syncline(address@hidden@], address@hidden@])])dnl
            {
              yyundeleteLastStack (&yystack);
              if (yystack.yytops.yysize == 0)
-               yyFail (&yystack][]b4_lpure_args[, "syntax error");
+               yyFail (&yystack][]b4_lpure_args[, YY_("syntax error"));
              YYCHK1 (yyresolveStack (&yystack]b4_user_args[));
              YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
 ]b4_location_if([[           yystack.yyerror_range[1].yystate.yyloc = 
*yyllocp;]])[
@@ -2098,7 +2110,7 @@ b4_syncline(address@hidden@], address@hidden@])])dnl
   goto yyreturn;
 
  yyoverflowlab:
-  yyerror (]b4_lyyerror_args["parser stack overflow");
+  yyerror (]b4_lyyerror_args[YY_("parser stack overflow"));
   yyresult = 2;
   /* Fall through.  */
 
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.87
diff -p -u -r1.87 lalr1.cc
--- data/lalr1.cc       22 Jun 2005 15:37:22 -0000      1.87
+++ data/lalr1.cc       18 Jul 2005 22:07:12 -0000
@@ -417,9 +417,16 @@ m4_if(b4_defines_flag, 0, [],
 [
 #include @address@hidden)[
 
-/* INFRINGES ON USER NAME SPACE */
-#ifndef _
-# define _(msgid) msgid
+#ifndef YY_
+# if YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
+#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#  endif
+# endif
+# ifndef YY_
+#  define YY_(msgid) msgid
+# endif
 #endif
 
 /* A pseudo ostream that takes yydebug_ into account. */
@@ -551,7 +558,7 @@ yy::]b4_parser_class_name[::parse ()
 {
   int yyresult_;
 
-  YYCDEBUG << _("Starting parse") << std::endl;
+  YYCDEBUG << "Starting parse" << std::endl;
 
   yynerrs_ = 0;
   yyerrstatus_ = 0;
@@ -583,7 +590,7 @@ b4_syncline(address@hidden@], address@hidden@])])dnl
   /* New state.  */
 yynewstate:
   yystate_stack_.push (yystate_);
-  YYCDEBUG << _("Entering state ") << yystate_ << std::endl;
+  YYCDEBUG << "Entering state " << yystate_ << std::endl;
   goto yybackup;
 
   /* Backup.  */
@@ -602,12 +609,12 @@ yybackup:
   if (yylooka_ <= yyeof_)
     {
       yylooka_ = yyilooka_ = yyeof_;
-      YYCDEBUG << _("Now at end of input.") << std::endl;
+      YYCDEBUG << "Now at end of input." << std::endl;
     }
   else
     {
       yyilooka_ = yytranslate_ (yylooka_);
-      YY_SYMBOL_PRINT (_("Next token is"), yyilooka_, &yylval, &yylloc);
+      YY_SYMBOL_PRINT ("Next token is", yyilooka_, &yylval, &yylloc);
     }
 
   /* If the proper action on seeing token ILOOKA_ is to reduce or to
@@ -636,7 +643,7 @@ yybackup:
     goto yyacceptlab;
 
   /* Shift the look-ahead token.  */
-  YY_SYMBOL_PRINT (_("Shifting"), yyilooka_, &yylval, &yylloc);
+  YY_SYMBOL_PRINT ("Shifting", yyilooka_, &yylval, &yylloc);
 
   /* Discard the token being shifted unless it is eof.  */
   if (yylooka_ != yyeof_)
@@ -734,7 +741,7 @@ yyerrlab:
                  yypop_ ();
                 if (yystate_stack_.height () == 1)
                   YYABORT;
-                 yydestruct_ (_("Error: popping"),
+                 yydestruct_ ("Error: popping",
                               yystos_[yystate_stack_[0]],
                               &yysemantic_stack_[0],
                               &yylocation_stack_[0]);
@@ -742,7 +749,7 @@ yyerrlab:
         }
       else
         {
-          yydestruct_ (_("Error: discarding"), yyilooka_, &yylval, &yylloc);
+          yydestruct_ ("Error: discarding", yyilooka_, &yylval, &yylloc);
           yylooka_ = yyempty_;
         }
     }
@@ -793,7 +800,7 @@ yyerrlab1:
        YYABORT;
 
       yyerror_range_[0] = yylocation_stack_[0];
-      yydestruct_ (_("Error: popping"),
+      yydestruct_ ("Error: popping",
                    yystos_[yystate_],
                    &yysemantic_stack_[0], &yylocation_stack_[0]);
       yypop_ ();
@@ -812,7 +819,7 @@ yyerrlab1:
   yylocation_stack_.push (yyloc);
 
   /* Shift the error token. */
-  YY_SYMBOL_PRINT (_("Shifting"), yystos_[yyn_],
+  YY_SYMBOL_PRINT ("Shifting", yystos_[yyn_],
                   &yysemantic_stack_[0], &yylocation_stack_[0]);
 
   yystate_ = yyn_;
@@ -830,14 +837,14 @@ yyabortlab:
 
 yyreturn:
   if (yylooka_ != yyeof_ && yylooka_ != yyempty_)
-    yydestruct_ (_("Error: discarding lookahead"), yyilooka_, &yylval, 
&yylloc);
+    yydestruct_ ("Error: discarding lookahead", yyilooka_, &yylval, &yylloc);
   return yyresult_;
 }
 
 void
 yy::]b4_parser_class_name[::yylex_ ()
 {
-  YYCDEBUG << _("Reading a token: ");
+  YYCDEBUG << "Reading a token: ";
   yylooka_ = ]b4_c_function_call([yylex], [int],
 [[YYSTYPE*], [&yylval]][]dnl
 b4_location_if([, [[location*], [&yylloc]]])dnl
@@ -869,7 +876,15 @@ yy::]b4_parser_class_name[::yyreport_syn
             if (yycheck_[x + yyn_] == x && x != yyterror_)
               ++count;
 
-         message = _("syntax error, unexpected ");
+         // FIXME: This method of building the message is not compatible
+         // with internationalization.  It should work like yacc.c does it.
+         // That is, first build a string that looks like this:
+         // "syntax error, unexpected %s or %s or %s"
+         // Then, invoke YY_ on this string.
+         // Finally, use the string as a format to output
+         // yyname_[yyilooka_], etc.
+         // Until this gets fixed, this message appears in English only.
+         message = "syntax error, unexpected ";
          message += yyname_[yyilooka_];
           if (count < 5)
             {
@@ -877,14 +892,14 @@ yy::]b4_parser_class_name[::yyreport_syn
               for (int x = yyxbegin; x < yyxend; ++x)
                 if (yycheck_[x + yyn_] == x && x != yyterror_)
                   {
-                    message += (!count++) ? _(", expecting ") : _(" or ");
+                    message += (!count++) ? ", expecting " : " or ";
                     message += yyname_[x];
                  }
             }
        }
       else
 #endif
-       message = _("syntax error");
+       message = YY_("syntax error");
       error (yylloc, message);
     }
 }
@@ -1008,7 +1023,7 @@ yy::]b4_parser_class_name[::yyrline_[] =
 void
 yy::]b4_parser_class_name[::yystack_print_ ()
 {
-  *yycdebug_ << _("Stack now");
+  *yycdebug_ << "Stack now";
   for (state_stack_type::const_iterator i = yystate_stack_.begin ();
        i != yystate_stack_.end (); ++i)
     *yycdebug_ << ' ' << *i;
@@ -1021,8 +1036,8 @@ yy::]b4_parser_class_name[::yyreduce_pri
 {
   unsigned int yylno = yyrline_[yyrule];
   /* Print the symbols being reduced, and their result.  */
-    *yycdebug_ << _("Reducing stack by rule ") << yyn_ - 1
-               << " (" << _("line") << ' ' << yylno << "), ";
+  *yycdebug_ << "Reducing stack by rule " << yyn_ - 1
+             << " (line " << yylno << "), ";
   for (]b4_int_type_for([b4_prhs])[ i = yyprhs_[yyn_];
        0 <= yyrhs_[i]; ++i)
     *yycdebug_ << yyname_[yyrhs_[i]] << ' ';
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.95
diff -p -u -r1.95 yacc.c
--- data/yacc.c 12 Jul 2005 23:28:54 -0000      1.95
+++ data/yacc.c 18 Jul 2005 22:07:13 -0000
@@ -228,6 +228,18 @@ b4_syncline(address@hidden@], address@hidden@])[
 # define YYSIZE_T unsigned int
 #endif
 
+#ifndef YY_
+# if YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#  endif
+# endif
+# ifndef YY_
+#  define YY_(msgid) msgid
+# endif
+#endif
+
 #if ! defined (yyoverflow) || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
@@ -412,18 +424,6 @@ static const char *const yytname[] =
 };
 #endif
 
-#ifndef YYI18N
-# if YYENABLE_NLS
-#  if ENABLE_NLS
-#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#   define YYI18N(msgid) dgettext ("bison-runtime", msgid)
-#  endif
-# endif
-# ifndef YYI18N
-#  define YYI18N(msgid) msgid
-# endif
-#endif
-
 # ifdef YYPRINT
 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
    token YYLEX-NUM.  */
@@ -525,7 +525,7 @@ do                                                          
\
     }                                                          \
   else                                                         \
     {                                                          \
-      yyerror (]b4_yyerror_args[YYI18N ("syntax error: cannot back up")); \
+      yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \
       YYERROR;                                                 \
     }                                                          \
 while (0)
@@ -619,7 +619,7 @@ do {                                                        
        \
                    [[short int *bottom], [bottom]],
                    [[short int *top],    [top]])[
 {
-  YYFPRINTF (stderr, YYI18N ("Stack now"));
+  YYFPRINTF (stderr, "Stack now");
   for (/* Nothing. */; bottom <= top; ++bottom)
     YYFPRINTF (stderr, " %d", *bottom);
   YYFPRINTF (stderr, "\n");
@@ -640,8 +640,8 @@ do {                                                        
        \
                    [[int yyrule], [yyrule]])[
 {
   int yyi;
-  unsigned int yylno = yyrline[yyrule];
-  YYFPRINTF (stderr, YYI18N ("Reducing stack by rule %d (line %u), "),
+  unsigned long int yylno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
              yyrule - 1, yylno);
   /* Print the symbols being reduced, and their result.  */
   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
@@ -911,7 +911,7 @@ m4_ifdef([b4_at_dollar_used], [[  yylsp[
           data in use in that stack, in bytes.  This used to be a
           conditional around just the two extra args, but that might
           be undefined if yyoverflow is a macro.  */
-       yyoverflow (YYI18N ("parser stack overflow"),
+       yyoverflow (YY_("parser stack overflow"),
                    &yyss1, yysize * sizeof (*yyssp),
                    &yyvs1, yysize * sizeof (*yyvsp),
 ]b4_location_if([                  &yyls1, yysize * sizeof (*yylsp),])[
@@ -951,14 +951,14 @@ m4_ifdef([b4_at_dollar_used], [[  yylsp[
       yyvsp = yyvs + yysize - 1;
 ]b4_location_if([      yylsp = yyls + yysize - 1;])[
 
-      YYDPRINTF ((stderr, YYI18N ("Stack size increased to %lu\n"),
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
                  (unsigned long int) yystacksize));
 
       if (yyss + yystacksize - 1 <= yyssp)
        YYABORT;
     }
 
-  YYDPRINTF ((stderr, YYI18N ("Entering state %d\n"), yystate));
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
   goto yybackup;
 
@@ -982,19 +982,19 @@ yybackup:
   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
   if (yychar == YYEMPTY)
     {
-      YYDPRINTF ((stderr, YYI18N ("Reading a token: ")));
+      YYDPRINTF ((stderr, "Reading a token: "));
       yychar = YYLEX;
     }
 
   if (yychar <= YYEOF)
     {
       yychar = yytoken = YYEOF;
-      YYDPRINTF ((stderr, YYI18N ("Now at end of input.\n")));
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
     }
   else
     {
       yytoken = YYTRANSLATE (yychar);
-      YY_SYMBOL_PRINT (YYI18N ("Next token is"), yytoken, &yylval, &yylloc);
+      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
     }
 
   /* If the proper action on seeing token YYTOKEN is to reduce or to
@@ -1015,7 +1015,7 @@ yybackup:
     YYACCEPT;
 
   /* Shift the look-ahead token.  */
-  YY_SYMBOL_PRINT (YYI18N ("Shifting"), yytoken, &yylval, &yylloc);
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
   /* Discard the token being shifted unless it is eof.  */
   if (yychar != YYEOF)
@@ -1123,11 +1123,11 @@ yyerrlab:
 #if 0
          /* This is so xgettext sees the translatable formats that are
             constructed on the fly.  */
-         YYI18N ("syntax error, unexpected %s");
-         YYI18N ("syntax error, unexpected %s, expecting %s");
-         YYI18N ("syntax error, unexpected %s, expecting %s or %s");
-         YYI18N ("syntax error, unexpected %s, expecting %s or %s or %s");
-         YYI18N ("syntax error, unexpected %s, expecting %s or %s or %s or 
%s");
+         YY_("syntax error, unexpected %s");
+         YY_("syntax error, unexpected %s, expecting %s");
+         YY_("syntax error, unexpected %s, expecting %s or %s");
+         YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+         YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
 #endif
          char *yyfmt;
          char const *yyf;
@@ -1170,7 +1170,7 @@ yyerrlab:
                yyprefix = yyor;
              }
 
-         yyf = YYI18N (yyformat);
+         yyf = YY_(yyformat);
          yysize1 = yysize + yystrlen (yyf);
          yysize_overflow |= yysize1 < yysize;
          yysize = yysize1;
@@ -1201,11 +1201,11 @@ yyerrlab:
              YYSTACK_FREE (yymsg);
            }
          else
-           yyerror (]b4_yyerror_args[YYI18N ("syntax error; also memory 
exhausted"));
+           yyerror (]b4_yyerror_args[YY_("syntax error; also memory 
exhausted"));
        }
       else
 #endif /* YYERROR_VERBOSE */
-       yyerror (]b4_yyerror_args[YYI18N ("syntax error"));
+       yyerror (]b4_yyerror_args[YY_("syntax error"));
     }
 
 ]b4_location_if([[  yyerror_range[0] = yylloc;]])[
@@ -1224,7 +1224,7 @@ yyerrlab:
         }
       else
        {
-         yydestruct (YYI18N ("Error: discarding"), yytoken, 
&yylval]b4_location_if([, &yylloc])[);
+         yydestruct ("Error: discarding", yytoken, &yylval]b4_location_if([, 
&yylloc])[);
          yychar = YYEMPTY;
        }
     }
@@ -1278,7 +1278,7 @@ yyerrlab1:
        YYABORT;
 
 ]b4_location_if([[      yyerror_range[0] = *yylsp;]])[
-      yydestruct (YYI18N ("Error: popping"), yystos[yystate], 
yyvsp]b4_location_if([, yylsp])[);
+      yydestruct ("Error: popping", yystos[yystate], yyvsp]b4_location_if([, 
yylsp])[);
       YYPOPSTACK;
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
@@ -1296,7 +1296,7 @@ yyerrlab1:
   *++yylsp = yyloc;]])[
 
   /* Shift the error token. */
-  YY_SYMBOL_PRINT (YYI18N ("Shifting"), yystos[yyn], yyvsp, yylsp);
+  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
 
   yystate = yyn;
   goto yynewstate;
@@ -1321,14 +1321,14 @@ yyabortlab:
 | yyoverflowlab -- parser overflow comes here.  |
 `----------------------------------------------*/
 yyoverflowlab:
-  yyerror (]b4_yyerror_args[YYI18N ("parser stack overflow"));
+  yyerror (]b4_yyerror_args[YY_("parser stack overflow"));
   yyresult = 2;
   /* Fall through.  */
 #endif
 
 yyreturn:
   if (yychar != YYEOF && yychar != YYEMPTY)
-     yydestruct (YYI18N ("Error: discarding lookahead"),
+     yydestruct ("Error: discarding lookahead",
                 yytoken, &yylval]b4_location_if([, &yylloc])[);
   if (yyssp != yyss)
     for (;;)
@@ -1337,7 +1337,7 @@ yyreturn:
        YYPOPSTACK;
        if (yyssp == yyss)
          break;
-       yydestruct (YYI18N ("Error: popping"),
+       yydestruct ("Error: popping",
                    yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[);
       }
 #ifndef yyoverflow
Index: doc/bison.texinfo
===================================================================
RCS file: /cvsroot/bison/bison/doc/bison.texinfo,v
retrieving revision 1.150
diff -p -u -r1.150 bison.texinfo
--- doc/bison.texinfo   12 Jul 2005 23:28:54 -0000      1.150
+++ doc/bison.texinfo   18 Jul 2005 22:07:13 -0000
@@ -1203,7 +1203,9 @@ In some cases the Bison parser file incl
 those cases your code should respect the identifiers reserved by those
 headers.  On some address@hidden hosts, @code{<alloca.h>},
 @code{<stddef.h>}, and @code{<stdlib.h>} are included as needed to
-declare memory allocators and related types.  Other system headers may
+declare memory allocators and related types.  @code{<libintl.h>} is
+included if message translation is in use
+(@pxref{Internationalization}).  Other system headers may
 be included if you define @code{YYDEBUG} to a nonzero value
 (@pxref{Tracing, ,Tracing Your Parser}).
 
@@ -4821,8 +4823,8 @@ A Bison-generated parser can print diagn
 tracing messages.  By default, they appear in English.  However, Bison
 also supports outputting diagnostics in the user's native language.
 To make this work, the user should set the usual environment
-variables.  @xref{Using gettextized software, , User influence on
address@hidden, libc, The GNU C Library Reference Manual}.  For
+variables.  @xref{Users, , The User's View, gettext, GNU
address@hidden utilities}.  For
 example, the shell command @samp{export LC_ALL=fr_CA.UTF-8} might set
 the user's locale to French Canadian using the @acronym{UTF}-8
 encoding.  The exact set of available locales depends on the user's
@@ -4835,6 +4837,7 @@ steps.  Here we assume a package that us
 
 @enumerate
 @item
address@hidden bison-i18n.m4
 Into the directory containing the @acronym{GNU} Autoconf macros used
 by the package---often called @file{m4}---copy the
 @file{bison-i18n.m4} file installed by Bison under
@@ -4846,11 +4849,16 @@ cp /usr/local/share/aclocal/bison-i18n.m
 @end example
 
 @item
address@hidden BISON_I18N
address@hidden BISON_LOCALEDIR
address@hidden YYENABLE_NLS
 In the top-level @file{configure.ac}, after the @code{AM_GNU_GETTEXT}
 invocation, add an invocation of @code{BISON_I18N}.  This macro is
 defined in the file @file{bison-i18n.m4} that you copied earlier.  It
 causes @samp{configure} to find the value of the
address@hidden variable.
address@hidden variable, and it defines the source-language
+symbol @code{YYENABLE_NLS} to enable translations in the
+Bison-generated parser.
 
 @item
 In the @code{main} function of your program, designate the directory
Index: runtime-po/POTFILES.in
===================================================================
RCS file: /cvsroot/bison/bison/runtime-po/POTFILES.in,v
retrieving revision 1.1
diff -p -u -r1.1 POTFILES.in
--- runtime-po/POTFILES.in      12 Jul 2005 23:28:54 -0000      1.1
+++ runtime-po/POTFILES.in      18 Jul 2005 22:07:13 -0000
@@ -1 +1,3 @@
+data/glr.c
+data/lalr1.cc
 data/yacc.c




reply via email to

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