1 /* A Bison parser, made by GNU Bison 3.0.4. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "3.0.4"
50 #define YYSKELETON_NAME "yacc.c"
64 /* Copy the first part of user declarations. */
65 #line 20 "po-gram-gen.y" /* yacc.c:339 */
81 #include "po-charset.h"
85 #include "read-catalog-abstract.h"
87 #define _(str) gettext (str)
89 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
90 as well as gratuitiously global symbol names, so we can have multiple
91 yacc generated parsers in the same program. Note that these are only
92 the variables produced by yacc. If other parser generators (bison,
93 byacc, etc) produce additional global names that conflict at link time,
94 then those parser generators need to be fixed instead of adding those
95 names to this list. */
97 #define yymaxdepth po_gram_maxdepth
98 #define yyparse po_gram_parse
99 #define yylex po_gram_lex
100 #define yyerror po_gram_error
101 #define yylval po_gram_lval
102 #define yychar po_gram_char
103 #define yydebug po_gram_debug
104 #define yypact po_gram_pact
105 #define yyr1 po_gram_r1
106 #define yyr2 po_gram_r2
107 #define yydef po_gram_def
108 #define yychk po_gram_chk
109 #define yypgo po_gram_pgo
110 #define yyact po_gram_act
111 #define yyexca po_gram_exca
112 #define yyerrflag po_gram_errflag
113 #define yynerrs po_gram_nerrs
114 #define yyps po_gram_ps
115 #define yypv po_gram_pv
116 #define yys po_gram_s
117 #define yy_yys po_gram_yys
118 #define yystate po_gram_state
119 #define yytmp po_gram_tmp
120 #define yyv po_gram_v
121 #define yy_yyv po_gram_yyv
122 #define yyval po_gram_val
123 #define yylloc po_gram_lloc
124 #define yyreds po_gram_reds /* With YYDEBUG defined */
125 #define yytoks po_gram_toks /* With YYDEBUG defined */
126 #define yylhs po_gram_yylhs
127 #define yylen po_gram_yylen
128 #define yydefred po_gram_yydefred
129 #define yydgoto po_gram_yydgoto
130 #define yysindex po_gram_yysindex
131 #define yyrindex po_gram_yyrindex
132 #define yygindex po_gram_yygindex
133 #define yytable po_gram_yytable
134 #define yycheck po_gram_yycheck
136 static long plural_counter;
138 #define check_obsolete(value1,value2) \
139 if ((value1).obsolete != (value2).obsolete) \
140 po_gram_error_at_line (&(value2).pos, _("inconsistent use of #~"));
143 do_callback_message (char *msgctxt,
144 char *msgid, lex_pos_ty *msgid_pos, char *msgid_plural,
145 char *msgstr, size_t msgstr_len, lex_pos_ty *msgstr_pos,
147 char *prev_msgid, char *prev_msgid_plural,
150 /* Test for header entry. Ignore fuzziness of the header entry. */
151 if (msgctxt == NULL && msgid[0] == '\0' && !obsolete)
152 po_lex_charset_set (msgstr, gram_pos.file_name);
154 po_callback_message (msgctxt,
155 msgid, msgid_pos, msgid_plural,
156 msgstr, msgstr_len, msgstr_pos,
157 prev_msgctxt, prev_msgid, prev_msgid_plural,
161 #define free_message_intro(value) \
162 if ((value).prev_ctxt != NULL) \
163 free ((value).prev_ctxt); \
164 if ((value).prev_id != NULL) \
165 free ((value).prev_id); \
166 if ((value).prev_id_plural != NULL) \
167 free ((value).prev_id_plural); \
168 if ((value).ctxt != NULL) \
172 #line 173 "po-gram-gen.c" /* yacc.c:339 */
175 # if defined __cplusplus && 201103L <= __cplusplus
176 # define YY_NULLPTR nullptr
178 # define YY_NULLPTR 0
182 /* Enabling verbose error messages. */
183 #ifdef YYERROR_VERBOSE
184 # undef YYERROR_VERBOSE
185 # define YYERROR_VERBOSE 1
187 # define YYERROR_VERBOSE 0
190 /* In a future release of Bison, this section will be replaced
191 by #include "y.tab.h". */
192 #ifndef YY_YY_PO_GRAM_GEN_H_INCLUDED
193 # define YY_YY_PO_GRAM_GEN_H_INCLUDED
212 PREV_MSGID_PLURAL = 263,
227 #define PREV_MSGCTXT 261
228 #define PREV_MSGID 262
229 #define PREV_MSGID_PLURAL 263
230 #define PREV_STRING 264
233 #define MSGID_PLURAL 267
240 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
244 #line 144 "po-gram-gen.y" /* yacc.c:355 */
246 struct { char *string; lex_pos_ty pos; bool obsolete; } string;
247 struct { string_list_ty stringlist; lex_pos_ty pos; bool obsolete; } stringlist;
248 struct { long number; lex_pos_ty pos; bool obsolete; } number;
249 struct { lex_pos_ty pos; bool obsolete; } pos;
250 struct { char *ctxt; char *id; char *id_plural; lex_pos_ty pos; bool obsolete; } prev;
251 struct { char *prev_ctxt; char *prev_id; char *prev_id_plural; char *ctxt; lex_pos_ty pos; bool obsolete; } message_intro;
252 struct { struct msgstr_def rhs; lex_pos_ty pos; bool obsolete; } rhs;
254 #line 255 "po-gram-gen.c" /* yacc.c:355 */
257 typedef union YYSTYPE YYSTYPE;
258 # define YYSTYPE_IS_TRIVIAL 1
259 # define YYSTYPE_IS_DECLARED 1
263 extern YYSTYPE yylval;
267 #endif /* !YY_YY_PO_GRAM_GEN_H_INCLUDED */
269 /* Copy the second part of user declarations. */
271 #line 272 "po-gram-gen.c" /* yacc.c:358 */
278 typedef YYTYPE_UINT8 yytype_uint8;
280 typedef unsigned char yytype_uint8;
284 typedef YYTYPE_INT8 yytype_int8;
286 typedef signed char yytype_int8;
290 typedef YYTYPE_UINT16 yytype_uint16;
292 typedef unsigned short int yytype_uint16;
296 typedef YYTYPE_INT16 yytype_int16;
298 typedef short int yytype_int16;
302 # ifdef __SIZE_TYPE__
303 # define YYSIZE_T __SIZE_TYPE__
304 # elif defined size_t
305 # define YYSIZE_T size_t
306 # elif ! defined YYSIZE_T
307 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
308 # define YYSIZE_T size_t
310 # define YYSIZE_T unsigned int
314 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
317 # if defined YYENABLE_NLS && YYENABLE_NLS
319 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
320 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
324 # define YY_(Msgid) Msgid
329 # if (defined __GNUC__ \
330 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
331 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
332 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
334 # define YY_ATTRIBUTE(Spec) /* empty */
338 #ifndef YY_ATTRIBUTE_PURE
339 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
342 #ifndef YY_ATTRIBUTE_UNUSED
343 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
346 #if !defined _Noreturn \
347 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
348 # if defined _MSC_VER && 1200 <= _MSC_VER
349 # define _Noreturn __declspec (noreturn)
351 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
355 /* Suppress unused-variable warnings by "using" E. */
356 #if ! defined lint || defined __GNUC__
357 # define YYUSE(E) ((void) (E))
359 # define YYUSE(E) /* empty */
362 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
363 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
364 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
365 _Pragma ("GCC diagnostic push") \
366 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
367 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
368 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
369 _Pragma ("GCC diagnostic pop")
371 # define YY_INITIAL_VALUE(Value) Value
373 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
374 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
375 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
377 #ifndef YY_INITIAL_VALUE
378 # define YY_INITIAL_VALUE(Value) /* Nothing. */
382 #if ! defined yyoverflow || YYERROR_VERBOSE
384 /* The parser invokes alloca or malloc; define the necessary symbols. */
386 # ifdef YYSTACK_USE_ALLOCA
387 # if YYSTACK_USE_ALLOCA
389 # define YYSTACK_ALLOC __builtin_alloca
390 # elif defined __BUILTIN_VA_ARG_INCR
391 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
393 # define YYSTACK_ALLOC __alloca
394 # elif defined _MSC_VER
395 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
396 # define alloca _alloca
398 # define YYSTACK_ALLOC alloca
399 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
400 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
401 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
402 # ifndef EXIT_SUCCESS
403 # define EXIT_SUCCESS 0
410 # ifdef YYSTACK_ALLOC
411 /* Pacify GCC's 'empty if-body' warning. */
412 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
413 # ifndef YYSTACK_ALLOC_MAXIMUM
414 /* The OS might guarantee only one guard page at the bottom of the stack,
415 and a page size can be as small as 4096 bytes. So we cannot safely
416 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
417 to allow for a few compiler-allocated temporary stack slots. */
418 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
421 # define YYSTACK_ALLOC YYMALLOC
422 # define YYSTACK_FREE YYFREE
423 # ifndef YYSTACK_ALLOC_MAXIMUM
424 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
426 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
427 && ! ((defined YYMALLOC || defined malloc) \
428 && (defined YYFREE || defined free)))
429 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
430 # ifndef EXIT_SUCCESS
431 # define EXIT_SUCCESS 0
435 # define YYMALLOC malloc
436 # if ! defined malloc && ! defined EXIT_SUCCESS
437 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
442 # if ! defined free && ! defined EXIT_SUCCESS
443 void free (void *); /* INFRINGES ON USER NAME SPACE */
447 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
450 #if (! defined yyoverflow \
451 && (! defined __cplusplus \
452 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
454 /* A type that is properly aligned for any stack member. */
457 yytype_int16 yyss_alloc;
461 /* The size of the maximum gap between one aligned stack and the next. */
462 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
464 /* The size of an array large to enough to hold all stacks, each with
466 # define YYSTACK_BYTES(N) \
467 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
468 + YYSTACK_GAP_MAXIMUM)
470 # define YYCOPY_NEEDED 1
472 /* Relocate STACK from its old location to the new one. The
473 local variables YYSIZE and YYSTACKSIZE give the old and new number of
474 elements in the stack, and YYPTR gives the new location of the
475 stack. Advance YYPTR to a properly aligned location for the next
477 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
480 YYSIZE_T yynewbytes; \
481 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
482 Stack = &yyptr->Stack_alloc; \
483 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
484 yyptr += yynewbytes / sizeof (*yyptr); \
490 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
491 /* Copy COUNT objects from SRC to DST. The source and destination do
494 # if defined __GNUC__ && 1 < __GNUC__
495 # define YYCOPY(Dst, Src, Count) \
496 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
498 # define YYCOPY(Dst, Src, Count) \
502 for (yyi = 0; yyi < (Count); yyi++) \
503 (Dst)[yyi] = (Src)[yyi]; \
508 #endif /* !YYCOPY_NEEDED */
510 /* YYFINAL -- State number of the termination state. */
512 /* YYLAST -- Last index in YYTABLE. */
515 /* YYNTOKENS -- Number of terminals. */
517 /* YYNNTS -- Number of nonterminals. */
519 /* YYNRULES -- Number of rules. */
521 /* YYNSTATES -- Number of states. */
524 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
525 by yylex, with out-of-bounds checking. */
527 #define YYMAXUTOK 271
529 #define YYTRANSLATE(YYX) \
530 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
532 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
533 as returned by yylex, without out-of-bounds checking. */
534 static const yytype_uint8 yytranslate[] =
536 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 15, 2, 16, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
562 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
567 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
568 static const yytype_uint16 yyrline[] =
570 0, 169, 169, 171, 172, 173, 174, 179, 187, 195,
571 216, 240, 249, 258, 269, 278, 292, 301, 315, 321,
572 332, 338, 350, 361, 372, 376, 391, 414, 422, 434,
577 #if YYDEBUG || YYERROR_VERBOSE || 0
578 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
579 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
580 static const char *const yytname[] =
582 "$end", "error", "$undefined", "COMMENT", "DOMAIN", "JUNK",
583 "PREV_MSGCTXT", "PREV_MSGID", "PREV_MSGID_PLURAL", "PREV_STRING",
584 "MSGCTXT", "MSGID", "MSGID_PLURAL", "MSGSTR", "NAME", "'['", "']'",
585 "NUMBER", "STRING", "$accept", "po_file", "comment", "domain", "message",
586 "message_intro", "prev", "msg_intro", "prev_msg_intro",
587 "msgid_pluralform", "prev_msgid_pluralform", "pluralform_list",
588 "pluralform", "string_list", "prev_string_list", YY_NULLPTR
593 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
594 (internal) symbol number NUM (which must be that of a token). */
595 static const yytype_uint16 yytoknum[] =
597 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
598 265, 266, 267, 268, 269, 91, 93, 270, 271
602 #define YYPACT_NINF -26
604 #define yypact_value_is_default(Yystate) \
605 (!!((Yystate) == (-26)))
607 #define YYTABLE_NINF -1
609 #define yytable_value_is_error(Yytable_value) \
612 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
614 static const yytype_int8 yypact[] =
616 -26, 2, -26, -26, -26, -8, 5, -26, 0, -26,
617 -26, -26, -26, 0, 13, -26, 5, -26, -26, 20,
618 -26, -7, 8, -26, 24, -26, -26, -26, -26, 0,
619 7, 15, 15, -26, 5, -26, 12, 17, 12, 21,
620 15, -26, 26, 22, 0, 12
623 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
624 Performed when YYTABLE does not specify something else to do. Zero
625 means the default is an error. */
626 static const yytype_uint8 yydefact[] =
628 2, 0, 1, 6, 7, 0, 0, 20, 0, 18,
629 3, 4, 5, 0, 0, 14, 0, 8, 29, 0,
630 27, 0, 13, 15, 16, 21, 30, 19, 28, 0,
631 0, 11, 12, 24, 0, 17, 22, 0, 9, 0,
635 /* YYPGOTO[NTERM-NUM]. */
636 static const yytype_int8 yypgoto[] =
638 -26, -26, -26, -26, -26, -26, -26, 23, -26, -26,
639 -26, 9, -25, -13, -15
642 /* YYDEFGOTO[NTERM-NUM]. */
643 static const yytype_int8 yydefgoto[] =
645 -1, 1, 10, 11, 12, 13, 14, 15, 16, 31,
649 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
650 positive, shift that token. If negative, reduce the rule whose
651 number is the opposite. If YYTABLE_NINF, syntax error. */
652 static const yytype_uint8 yytable[] =
654 22, 24, 2, 3, 27, 4, 5, 41, 6, 7,
655 17, 28, 8, 9, 18, 41, 36, 38, 20, 42,
656 29, 30, 37, 8, 9, 20, 28, 25, 39, 26,
657 28, 45, 34, 26, 43, 26, 37, 23, 44, 0,
661 static const yytype_int8 yycheck[] =
663 13, 16, 0, 1, 11, 3, 4, 32, 6, 7,
664 18, 18, 10, 11, 9, 40, 29, 30, 18, 34,
665 12, 13, 15, 10, 11, 18, 18, 7, 13, 9,
666 18, 44, 8, 9, 17, 9, 15, 14, 16, -1,
670 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
671 symbol of state STATE-NUM. */
672 static const yytype_uint8 yystos[] =
674 0, 20, 0, 1, 3, 4, 6, 7, 10, 11,
675 21, 22, 23, 24, 25, 26, 27, 18, 9, 33,
676 18, 32, 32, 26, 33, 7, 9, 11, 18, 12,
677 13, 28, 30, 31, 8, 29, 32, 15, 32, 13,
678 30, 31, 33, 17, 16, 32
681 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
682 static const yytype_uint8 yyr1[] =
684 0, 19, 20, 20, 20, 20, 20, 21, 22, 23,
685 23, 23, 23, 23, 24, 24, 25, 25, 26, 26,
686 27, 27, 28, 29, 30, 30, 31, 32, 32, 33,
690 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
691 static const yytype_uint8 yyr2[] =
693 0, 2, 0, 2, 2, 2, 2, 1, 2, 4,
694 4, 3, 3, 2, 1, 2, 2, 3, 1, 3,
695 1, 3, 2, 2, 1, 2, 5, 1, 2, 1,
700 #define yyerrok (yyerrstatus = 0)
701 #define yyclearin (yychar = YYEMPTY)
705 #define YYACCEPT goto yyacceptlab
706 #define YYABORT goto yyabortlab
707 #define YYERROR goto yyerrorlab
710 #define YYRECOVERING() (!!yyerrstatus)
712 #define YYBACKUP(Token, Value) \
714 if (yychar == YYEMPTY) \
718 YYPOPSTACK (yylen); \
724 yyerror (YY_("syntax error: cannot back up")); \
729 /* Error token number */
731 #define YYERRCODE 256
735 /* Enable debugging if requested. */
739 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
740 # define YYFPRINTF fprintf
743 # define YYDPRINTF(Args) \
749 /* This macro is provided for backward compatibility. */
750 #ifndef YY_LOCATION_PRINT
751 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
755 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
759 YYFPRINTF (stderr, "%s ", Title); \
760 yy_symbol_print (stderr, \
762 YYFPRINTF (stderr, "\n"); \
767 /*----------------------------------------.
768 | Print this symbol's value on YYOUTPUT. |
769 `----------------------------------------*/
772 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
774 FILE *yyo = yyoutput;
779 if (yytype < YYNTOKENS)
780 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
786 /*--------------------------------.
787 | Print this symbol on YYOUTPUT. |
788 `--------------------------------*/
791 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
793 YYFPRINTF (yyoutput, "%s %s (",
794 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
796 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
797 YYFPRINTF (yyoutput, ")");
800 /*------------------------------------------------------------------.
801 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
803 `------------------------------------------------------------------*/
806 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
808 YYFPRINTF (stderr, "Stack now");
809 for (; yybottom <= yytop; yybottom++)
811 int yybot = *yybottom;
812 YYFPRINTF (stderr, " %d", yybot);
814 YYFPRINTF (stderr, "\n");
817 # define YY_STACK_PRINT(Bottom, Top) \
820 yy_stack_print ((Bottom), (Top)); \
824 /*------------------------------------------------.
825 | Report that the YYRULE is going to be reduced. |
826 `------------------------------------------------*/
829 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
831 unsigned long int yylno = yyrline[yyrule];
832 int yynrhs = yyr2[yyrule];
834 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
836 /* The symbols being reduced. */
837 for (yyi = 0; yyi < yynrhs; yyi++)
839 YYFPRINTF (stderr, " $%d = ", yyi + 1);
840 yy_symbol_print (stderr,
841 yystos[yyssp[yyi + 1 - yynrhs]],
842 &(yyvsp[(yyi + 1) - (yynrhs)])
844 YYFPRINTF (stderr, "\n");
848 # define YY_REDUCE_PRINT(Rule) \
851 yy_reduce_print (yyssp, yyvsp, Rule); \
854 /* Nonzero means print parse trace. It is left uninitialized so that
855 multiple parsers can coexist. */
858 # define YYDPRINTF(Args)
859 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
860 # define YY_STACK_PRINT(Bottom, Top)
861 # define YY_REDUCE_PRINT(Rule)
862 #endif /* !YYDEBUG */
865 /* YYINITDEPTH -- initial size of the parser's stacks. */
867 # define YYINITDEPTH 200
870 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
871 if the built-in stack extension method is used).
873 Do not make this value too large; the results are undefined if
874 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
875 evaluated with infinite-precision integer arithmetic. */
878 # define YYMAXDEPTH 10000
885 # if defined __GLIBC__ && defined _STRING_H
886 # define yystrlen strlen
888 /* Return the length of YYSTR. */
890 yystrlen (const char *yystr)
893 for (yylen = 0; yystr[yylen]; yylen++)
901 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
902 # define yystpcpy stpcpy
904 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
907 yystpcpy (char *yydest, const char *yysrc)
910 const char *yys = yysrc;
912 while ((*yyd++ = *yys++) != '\0')
921 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
922 quotes and backslashes, so that it's suitable for yyerror. The
923 heuristic is that double-quoting is unnecessary unless the string
924 contains an apostrophe, a comma, or backslash (other than
925 backslash-backslash). YYSTR is taken from yytname. If YYRES is
926 null, do not copy; instead, return the length of what the result
929 yytnamerr (char *yyres, const char *yystr)
934 char const *yyp = yystr;
941 goto do_not_strip_quotes;
945 goto do_not_strip_quotes;
958 do_not_strip_quotes: ;
962 return yystrlen (yystr);
964 return yystpcpy (yyres, yystr) - yyres;
968 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
969 about the unexpected token YYTOKEN for the state stack whose top is
972 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
973 not large enough to hold the message. In that case, also set
974 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
975 required number of bytes is too large to store. */
977 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
978 yytype_int16 *yyssp, int yytoken)
980 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
981 YYSIZE_T yysize = yysize0;
982 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
983 /* Internationalized format string. */
984 const char *yyformat = YY_NULLPTR;
985 /* Arguments of yyformat. */
986 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
987 /* Number of reported tokens (one for the "unexpected", one per
991 /* There are many possibilities here to consider:
992 - If this state is a consistent state with a default action, then
993 the only way this function was invoked is if the default action
994 is an error action. In that case, don't check for expected
995 tokens because there are none.
996 - The only way there can be no lookahead present (in yychar) is if
997 this state is a consistent state with a default action. Thus,
998 detecting the absence of a lookahead is sufficient to determine
999 that there is no unexpected or expected token to report. In that
1000 case, just report a simple "syntax error".
1001 - Don't assume there isn't a lookahead just because this state is a
1002 consistent state with a default action. There might have been a
1003 previous inconsistent state, consistent state with a non-default
1004 action, or user semantic action that manipulated yychar.
1005 - Of course, the expected token list depends on states to have
1006 correct lookahead information, and it depends on the parser not
1007 to perform extra reductions after fetching a lookahead from the
1008 scanner and before detecting a syntax error. Thus, state merging
1009 (from LALR or IELR) and default reductions corrupt the expected
1010 token list. However, the list is correct for canonical LR with
1011 one exception: it will still contain any token that will not be
1012 accepted due to an error action in a later state.
1014 if (yytoken != YYEMPTY)
1016 int yyn = yypact[*yyssp];
1017 yyarg[yycount++] = yytname[yytoken];
1018 if (!yypact_value_is_default (yyn))
1020 /* Start YYX at -YYN if negative to avoid negative indexes in
1021 YYCHECK. In other words, skip the first -YYN actions for
1022 this state because they are default actions. */
1023 int yyxbegin = yyn < 0 ? -yyn : 0;
1024 /* Stay within bounds of both yycheck and yytname. */
1025 int yychecklim = YYLAST - yyn + 1;
1026 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1029 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1030 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1031 && !yytable_value_is_error (yytable[yyx + yyn]))
1033 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1039 yyarg[yycount++] = yytname[yyx];
1041 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1042 if (! (yysize <= yysize1
1043 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1053 # define YYCASE_(N, S) \
1057 YYCASE_(0, YY_("syntax error"));
1058 YYCASE_(1, YY_("syntax error, unexpected %s"));
1059 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1060 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1061 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1062 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1067 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1068 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1073 if (*yymsg_alloc < yysize)
1075 *yymsg_alloc = 2 * yysize;
1076 if (! (yysize <= *yymsg_alloc
1077 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1078 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1082 /* Avoid sprintf, as that infringes on the user's name space.
1083 Don't have undefined behavior even if the translation
1084 produced a string with the wrong number of "%s"s. */
1088 while ((*yyp = *yyformat) != '\0')
1089 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1091 yyp += yytnamerr (yyp, yyarg[yyi++]);
1102 #endif /* YYERROR_VERBOSE */
1104 /*-----------------------------------------------.
1105 | Release the memory associated to this symbol. |
1106 `-----------------------------------------------*/
1109 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1114 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1116 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1118 YY_IGNORE_MAYBE_UNINITIALIZED_END
1124 /* The lookahead symbol. */
1127 /* The semantic value of the lookahead symbol. */
1129 /* Number of syntax errors so far. */
1141 /* Number of tokens to shift before error messages enabled. */
1144 /* The stacks and their tools:
1145 'yyss': related to states.
1146 'yyvs': related to semantic values.
1148 Refer to the stacks through separate pointers, to allow yyoverflow
1149 to reallocate them elsewhere. */
1151 /* The state stack. */
1152 yytype_int16 yyssa[YYINITDEPTH];
1154 yytype_int16 *yyssp;
1156 /* The semantic value stack. */
1157 YYSTYPE yyvsa[YYINITDEPTH];
1161 YYSIZE_T yystacksize;
1165 /* Lookahead token as an internal (translated) token number. */
1167 /* The variables used to return semantic value and location from the
1172 /* Buffer for error messages, and its allocated size. */
1174 char *yymsg = yymsgbuf;
1175 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1178 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1180 /* The number of symbols on the RHS of the reduced rule.
1181 Keep to zero when no symbol should be popped. */
1184 yyssp = yyss = yyssa;
1185 yyvsp = yyvs = yyvsa;
1186 yystacksize = YYINITDEPTH;
1188 YYDPRINTF ((stderr, "Starting parse\n"));
1193 yychar = YYEMPTY; /* Cause a token to be read. */
1196 /*------------------------------------------------------------.
1197 | yynewstate -- Push a new state, which is found in yystate. |
1198 `------------------------------------------------------------*/
1200 /* In all cases, when you get here, the value and location stacks
1201 have just been pushed. So pushing a state here evens the stacks. */
1207 if (yyss + yystacksize - 1 <= yyssp)
1209 /* Get the current used size of the three stacks, in elements. */
1210 YYSIZE_T yysize = yyssp - yyss + 1;
1214 /* Give user a chance to reallocate the stack. Use copies of
1215 these so that the &'s don't force the real ones into
1217 YYSTYPE *yyvs1 = yyvs;
1218 yytype_int16 *yyss1 = yyss;
1220 /* Each stack pointer address is followed by the size of the
1221 data in use in that stack, in bytes. This used to be a
1222 conditional around just the two extra args, but that might
1223 be undefined if yyoverflow is a macro. */
1224 yyoverflow (YY_("memory exhausted"),
1225 &yyss1, yysize * sizeof (*yyssp),
1226 &yyvs1, yysize * sizeof (*yyvsp),
1232 #else /* no yyoverflow */
1233 # ifndef YYSTACK_RELOCATE
1234 goto yyexhaustedlab;
1236 /* Extend the stack our own way. */
1237 if (YYMAXDEPTH <= yystacksize)
1238 goto yyexhaustedlab;
1240 if (YYMAXDEPTH < yystacksize)
1241 yystacksize = YYMAXDEPTH;
1244 yytype_int16 *yyss1 = yyss;
1245 union yyalloc *yyptr =
1246 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1248 goto yyexhaustedlab;
1249 YYSTACK_RELOCATE (yyss_alloc, yyss);
1250 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1251 # undef YYSTACK_RELOCATE
1253 YYSTACK_FREE (yyss1);
1256 #endif /* no yyoverflow */
1258 yyssp = yyss + yysize - 1;
1259 yyvsp = yyvs + yysize - 1;
1261 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1262 (unsigned long int) yystacksize));
1264 if (yyss + yystacksize - 1 <= yyssp)
1268 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1270 if (yystate == YYFINAL)
1280 /* Do appropriate processing given the current state. Read a
1281 lookahead token if we need one and don't already have one. */
1283 /* First try to decide what to do without reference to lookahead token. */
1284 yyn = yypact[yystate];
1285 if (yypact_value_is_default (yyn))
1288 /* Not known => get a lookahead token if don't already have one. */
1290 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1291 if (yychar == YYEMPTY)
1293 YYDPRINTF ((stderr, "Reading a token: "));
1297 if (yychar <= YYEOF)
1299 yychar = yytoken = YYEOF;
1300 YYDPRINTF ((stderr, "Now at end of input.\n"));
1304 yytoken = YYTRANSLATE (yychar);
1305 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1308 /* If the proper action on seeing token YYTOKEN is to reduce or to
1309 detect an error, take that action. */
1311 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1316 if (yytable_value_is_error (yyn))
1322 /* Count tokens shifted since error; after three, turn off error
1327 /* Shift the lookahead token. */
1328 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1330 /* Discard the shifted token. */
1334 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1336 YY_IGNORE_MAYBE_UNINITIALIZED_END
1341 /*-----------------------------------------------------------.
1342 | yydefault -- do the default action for the current state. |
1343 `-----------------------------------------------------------*/
1345 yyn = yydefact[yystate];
1351 /*-----------------------------.
1352 | yyreduce -- Do a reduction. |
1353 `-----------------------------*/
1355 /* yyn is the number of a rule to reduce with. */
1358 /* If YYLEN is nonzero, implement the default value of the action:
1361 Otherwise, the following line sets YYVAL to garbage.
1362 This behavior is undocumented and Bison
1363 users should not rely upon it. Assigning to YYVAL
1364 unconditionally makes the parser a bit smaller, and it avoids a
1365 GCC warning that YYVAL may be used uninitialized. */
1366 yyval = yyvsp[1-yylen];
1369 YY_REDUCE_PRINT (yyn);
1373 #line 180 "po-gram-gen.y" /* yacc.c:1646 */
1375 po_callback_comment_dispatcher ((yyvsp[0].string).string);
1377 #line 1378 "po-gram-gen.c" /* yacc.c:1646 */
1381 #line 188 "po-gram-gen.y" /* yacc.c:1646 */
1383 po_callback_domain ((yyvsp[0].string).string);
1385 #line 1386 "po-gram-gen.c" /* yacc.c:1646 */
1389 #line 196 "po-gram-gen.y" /* yacc.c:1646 */
1391 char *string2 = string_list_concat_destroy (&(yyvsp[-2].stringlist).stringlist);
1392 char *string4 = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist);
1394 check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-2].stringlist));
1395 check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-1].pos));
1396 check_obsolete ((yyvsp[-3].message_intro), (yyvsp[0].stringlist));
1397 if (!(yyvsp[-3].message_intro).obsolete || pass_obsolete_entries)
1398 do_callback_message ((yyvsp[-3].message_intro).ctxt, string2, &(yyvsp[-3].message_intro).pos, NULL,
1399 string4, strlen (string4) + 1, &(yyvsp[-1].pos).pos,
1400 (yyvsp[-3].message_intro).prev_ctxt,
1401 (yyvsp[-3].message_intro).prev_id, (yyvsp[-3].message_intro).prev_id_plural,
1402 (yyvsp[-3].message_intro).obsolete);
1405 free_message_intro ((yyvsp[-3].message_intro));
1410 #line 1411 "po-gram-gen.c" /* yacc.c:1646 */
1414 #line 217 "po-gram-gen.y" /* yacc.c:1646 */
1416 char *string2 = string_list_concat_destroy (&(yyvsp[-2].stringlist).stringlist);
1418 check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-2].stringlist));
1419 check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-1].string));
1420 check_obsolete ((yyvsp[-3].message_intro), (yyvsp[0].rhs));
1421 if (!(yyvsp[-3].message_intro).obsolete || pass_obsolete_entries)
1423 do_callback_message ((yyvsp[-3].message_intro).ctxt, string2, &(yyvsp[-3].message_intro).pos, (yyvsp[-1].string).string,
1424 (yyvsp[0].rhs).rhs.msgstr, (yyvsp[0].rhs).rhs.msgstr_len, &(yyvsp[0].rhs).pos,
1425 (yyvsp[-3].message_intro).prev_ctxt,
1426 (yyvsp[-3].message_intro).prev_id, (yyvsp[-3].message_intro).prev_id_plural,
1427 (yyvsp[-3].message_intro).obsolete);
1428 free ((yyvsp[-1].string).string);
1432 free_message_intro ((yyvsp[-3].message_intro));
1434 free ((yyvsp[-1].string).string);
1435 free ((yyvsp[0].rhs).rhs.msgstr);
1438 #line 1439 "po-gram-gen.c" /* yacc.c:1646 */
1442 #line 241 "po-gram-gen.y" /* yacc.c:1646 */
1444 check_obsolete ((yyvsp[-2].message_intro), (yyvsp[-1].stringlist));
1445 check_obsolete ((yyvsp[-2].message_intro), (yyvsp[0].string));
1446 po_gram_error_at_line (&(yyvsp[-2].message_intro).pos, _("missing 'msgstr[]' section"));
1447 free_message_intro ((yyvsp[-2].message_intro));
1448 string_list_destroy (&(yyvsp[-1].stringlist).stringlist);
1449 free ((yyvsp[0].string).string);
1451 #line 1452 "po-gram-gen.c" /* yacc.c:1646 */
1455 #line 250 "po-gram-gen.y" /* yacc.c:1646 */
1457 check_obsolete ((yyvsp[-2].message_intro), (yyvsp[-1].stringlist));
1458 check_obsolete ((yyvsp[-2].message_intro), (yyvsp[0].rhs));
1459 po_gram_error_at_line (&(yyvsp[-2].message_intro).pos, _("missing 'msgid_plural' section"));
1460 free_message_intro ((yyvsp[-2].message_intro));
1461 string_list_destroy (&(yyvsp[-1].stringlist).stringlist);
1462 free ((yyvsp[0].rhs).rhs.msgstr);
1464 #line 1465 "po-gram-gen.c" /* yacc.c:1646 */
1468 #line 259 "po-gram-gen.y" /* yacc.c:1646 */
1470 check_obsolete ((yyvsp[-1].message_intro), (yyvsp[0].stringlist));
1471 po_gram_error_at_line (&(yyvsp[-1].message_intro).pos, _("missing 'msgstr' section"));
1472 free_message_intro ((yyvsp[-1].message_intro));
1473 string_list_destroy (&(yyvsp[0].stringlist).stringlist);
1475 #line 1476 "po-gram-gen.c" /* yacc.c:1646 */
1479 #line 270 "po-gram-gen.y" /* yacc.c:1646 */
1481 (yyval.message_intro).prev_ctxt = NULL;
1482 (yyval.message_intro).prev_id = NULL;
1483 (yyval.message_intro).prev_id_plural = NULL;
1484 (yyval.message_intro).ctxt = (yyvsp[0].string).string;
1485 (yyval.message_intro).pos = (yyvsp[0].string).pos;
1486 (yyval.message_intro).obsolete = (yyvsp[0].string).obsolete;
1488 #line 1489 "po-gram-gen.c" /* yacc.c:1646 */
1492 #line 279 "po-gram-gen.y" /* yacc.c:1646 */
1494 check_obsolete ((yyvsp[-1].prev), (yyvsp[0].string));
1495 (yyval.message_intro).prev_ctxt = (yyvsp[-1].prev).ctxt;
1496 (yyval.message_intro).prev_id = (yyvsp[-1].prev).id;
1497 (yyval.message_intro).prev_id_plural = (yyvsp[-1].prev).id_plural;
1498 (yyval.message_intro).ctxt = (yyvsp[0].string).string;
1499 (yyval.message_intro).pos = (yyvsp[0].string).pos;
1500 (yyval.message_intro).obsolete = (yyvsp[0].string).obsolete;
1502 #line 1503 "po-gram-gen.c" /* yacc.c:1646 */
1506 #line 293 "po-gram-gen.y" /* yacc.c:1646 */
1508 check_obsolete ((yyvsp[-1].string), (yyvsp[0].stringlist));
1509 (yyval.prev).ctxt = (yyvsp[-1].string).string;
1510 (yyval.prev).id = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist);
1511 (yyval.prev).id_plural = NULL;
1512 (yyval.prev).pos = (yyvsp[-1].string).pos;
1513 (yyval.prev).obsolete = (yyvsp[-1].string).obsolete;
1515 #line 1516 "po-gram-gen.c" /* yacc.c:1646 */
1519 #line 302 "po-gram-gen.y" /* yacc.c:1646 */
1521 check_obsolete ((yyvsp[-2].string), (yyvsp[-1].stringlist));
1522 check_obsolete ((yyvsp[-2].string), (yyvsp[0].string));
1523 (yyval.prev).ctxt = (yyvsp[-2].string).string;
1524 (yyval.prev).id = string_list_concat_destroy (&(yyvsp[-1].stringlist).stringlist);
1525 (yyval.prev).id_plural = (yyvsp[0].string).string;
1526 (yyval.prev).pos = (yyvsp[-2].string).pos;
1527 (yyval.prev).obsolete = (yyvsp[-2].string).obsolete;
1529 #line 1530 "po-gram-gen.c" /* yacc.c:1646 */
1533 #line 316 "po-gram-gen.y" /* yacc.c:1646 */
1535 (yyval.string).string = NULL;
1536 (yyval.string).pos = (yyvsp[0].pos).pos;
1537 (yyval.string).obsolete = (yyvsp[0].pos).obsolete;
1539 #line 1540 "po-gram-gen.c" /* yacc.c:1646 */
1543 #line 322 "po-gram-gen.y" /* yacc.c:1646 */
1545 check_obsolete ((yyvsp[-2].pos), (yyvsp[-1].stringlist));
1546 check_obsolete ((yyvsp[-2].pos), (yyvsp[0].pos));
1547 (yyval.string).string = string_list_concat_destroy (&(yyvsp[-1].stringlist).stringlist);
1548 (yyval.string).pos = (yyvsp[0].pos).pos;
1549 (yyval.string).obsolete = (yyvsp[0].pos).obsolete;
1551 #line 1552 "po-gram-gen.c" /* yacc.c:1646 */
1555 #line 333 "po-gram-gen.y" /* yacc.c:1646 */
1557 (yyval.string).string = NULL;
1558 (yyval.string).pos = (yyvsp[0].pos).pos;
1559 (yyval.string).obsolete = (yyvsp[0].pos).obsolete;
1561 #line 1562 "po-gram-gen.c" /* yacc.c:1646 */
1565 #line 339 "po-gram-gen.y" /* yacc.c:1646 */
1567 check_obsolete ((yyvsp[-2].pos), (yyvsp[-1].stringlist));
1568 check_obsolete ((yyvsp[-2].pos), (yyvsp[0].pos));
1569 (yyval.string).string = string_list_concat_destroy (&(yyvsp[-1].stringlist).stringlist);
1570 (yyval.string).pos = (yyvsp[0].pos).pos;
1571 (yyval.string).obsolete = (yyvsp[0].pos).obsolete;
1573 #line 1574 "po-gram-gen.c" /* yacc.c:1646 */
1577 #line 351 "po-gram-gen.y" /* yacc.c:1646 */
1579 check_obsolete ((yyvsp[-1].pos), (yyvsp[0].stringlist));
1581 (yyval.string).string = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist);
1582 (yyval.string).pos = (yyvsp[-1].pos).pos;
1583 (yyval.string).obsolete = (yyvsp[-1].pos).obsolete;
1585 #line 1586 "po-gram-gen.c" /* yacc.c:1646 */
1589 #line 362 "po-gram-gen.y" /* yacc.c:1646 */
1591 check_obsolete ((yyvsp[-1].pos), (yyvsp[0].stringlist));
1592 (yyval.string).string = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist);
1593 (yyval.string).pos = (yyvsp[-1].pos).pos;
1594 (yyval.string).obsolete = (yyvsp[-1].pos).obsolete;
1596 #line 1597 "po-gram-gen.c" /* yacc.c:1646 */
1600 #line 373 "po-gram-gen.y" /* yacc.c:1646 */
1602 (yyval.rhs) = (yyvsp[0].rhs);
1604 #line 1605 "po-gram-gen.c" /* yacc.c:1646 */
1608 #line 377 "po-gram-gen.y" /* yacc.c:1646 */
1610 check_obsolete ((yyvsp[-1].rhs), (yyvsp[0].rhs));
1611 (yyval.rhs).rhs.msgstr = XNMALLOC ((yyvsp[-1].rhs).rhs.msgstr_len + (yyvsp[0].rhs).rhs.msgstr_len, char);
1612 memcpy ((yyval.rhs).rhs.msgstr, (yyvsp[-1].rhs).rhs.msgstr, (yyvsp[-1].rhs).rhs.msgstr_len);
1613 memcpy ((yyval.rhs).rhs.msgstr + (yyvsp[-1].rhs).rhs.msgstr_len, (yyvsp[0].rhs).rhs.msgstr, (yyvsp[0].rhs).rhs.msgstr_len);
1614 (yyval.rhs).rhs.msgstr_len = (yyvsp[-1].rhs).rhs.msgstr_len + (yyvsp[0].rhs).rhs.msgstr_len;
1615 free ((yyvsp[-1].rhs).rhs.msgstr);
1616 free ((yyvsp[0].rhs).rhs.msgstr);
1617 (yyval.rhs).pos = (yyvsp[-1].rhs).pos;
1618 (yyval.rhs).obsolete = (yyvsp[-1].rhs).obsolete;
1620 #line 1621 "po-gram-gen.c" /* yacc.c:1646 */
1624 #line 392 "po-gram-gen.y" /* yacc.c:1646 */
1626 check_obsolete ((yyvsp[-4].pos), (yyvsp[-3].pos));
1627 check_obsolete ((yyvsp[-4].pos), (yyvsp[-2].number));
1628 check_obsolete ((yyvsp[-4].pos), (yyvsp[-1].pos));
1629 check_obsolete ((yyvsp[-4].pos), (yyvsp[0].stringlist));
1630 if ((yyvsp[-2].number).number != plural_counter)
1632 if (plural_counter == 0)
1633 po_gram_error_at_line (&(yyvsp[-4].pos).pos, _("first plural form has nonzero index"));
1635 po_gram_error_at_line (&(yyvsp[-4].pos).pos, _("plural form has wrong index"));
1638 (yyval.rhs).rhs.msgstr = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist);
1639 (yyval.rhs).rhs.msgstr_len = strlen ((yyval.rhs).rhs.msgstr) + 1;
1640 (yyval.rhs).pos = (yyvsp[-4].pos).pos;
1641 (yyval.rhs).obsolete = (yyvsp[-4].pos).obsolete;
1643 #line 1644 "po-gram-gen.c" /* yacc.c:1646 */
1647 #line 415 "po-gram-gen.y" /* yacc.c:1646 */
1649 string_list_init (&(yyval.stringlist).stringlist);
1650 string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string);
1651 free ((yyvsp[0].string).string);
1652 (yyval.stringlist).pos = (yyvsp[0].string).pos;
1653 (yyval.stringlist).obsolete = (yyvsp[0].string).obsolete;
1655 #line 1656 "po-gram-gen.c" /* yacc.c:1646 */
1659 #line 423 "po-gram-gen.y" /* yacc.c:1646 */
1661 check_obsolete ((yyvsp[-1].stringlist), (yyvsp[0].string));
1662 (yyval.stringlist).stringlist = (yyvsp[-1].stringlist).stringlist;
1663 string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string);
1664 free ((yyvsp[0].string).string);
1665 (yyval.stringlist).pos = (yyvsp[-1].stringlist).pos;
1666 (yyval.stringlist).obsolete = (yyvsp[-1].stringlist).obsolete;
1668 #line 1669 "po-gram-gen.c" /* yacc.c:1646 */
1672 #line 435 "po-gram-gen.y" /* yacc.c:1646 */
1674 string_list_init (&(yyval.stringlist).stringlist);
1675 string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string);
1676 free ((yyvsp[0].string).string);
1677 (yyval.stringlist).pos = (yyvsp[0].string).pos;
1678 (yyval.stringlist).obsolete = (yyvsp[0].string).obsolete;
1680 #line 1681 "po-gram-gen.c" /* yacc.c:1646 */
1684 #line 443 "po-gram-gen.y" /* yacc.c:1646 */
1686 check_obsolete ((yyvsp[-1].stringlist), (yyvsp[0].string));
1687 (yyval.stringlist).stringlist = (yyvsp[-1].stringlist).stringlist;
1688 string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string);
1689 free ((yyvsp[0].string).string);
1690 (yyval.stringlist).pos = (yyvsp[-1].stringlist).pos;
1691 (yyval.stringlist).obsolete = (yyvsp[-1].stringlist).obsolete;
1693 #line 1694 "po-gram-gen.c" /* yacc.c:1646 */
1697 #line 1698 "po-gram-gen.c" /* yacc.c:1646 */
1700 /* User semantic actions sometimes alter yychar, and that requires
1701 that yytoken be updated with the new translation. We take the
1702 approach of translating immediately before every use of yytoken.
1703 One alternative is translating here after every semantic action,
1704 but that translation would be missed if the semantic action invokes
1705 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1706 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1707 incorrect destructor might then be invoked immediately. In the
1708 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1709 to an incorrect destructor call or verbose syntax error message
1710 before the lookahead is translated. */
1711 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1715 YY_STACK_PRINT (yyss, yyssp);
1719 /* Now 'shift' the result of the reduction. Determine what state
1720 that goes to, based on the state we popped back to and the rule
1721 number reduced by. */
1725 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1726 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1727 yystate = yytable[yystate];
1729 yystate = yydefgoto[yyn - YYNTOKENS];
1734 /*--------------------------------------.
1735 | yyerrlab -- here on detecting error. |
1736 `--------------------------------------*/
1738 /* Make sure we have latest lookahead translation. See comments at
1739 user semantic actions for why this is necessary. */
1740 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1742 /* If not already recovering from an error, report this error. */
1746 #if ! YYERROR_VERBOSE
1747 yyerror (YY_("syntax error"));
1749 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1752 char const *yymsgp = YY_("syntax error");
1753 int yysyntax_error_status;
1754 yysyntax_error_status = YYSYNTAX_ERROR;
1755 if (yysyntax_error_status == 0)
1757 else if (yysyntax_error_status == 1)
1759 if (yymsg != yymsgbuf)
1760 YYSTACK_FREE (yymsg);
1761 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1765 yymsg_alloc = sizeof yymsgbuf;
1766 yysyntax_error_status = 2;
1770 yysyntax_error_status = YYSYNTAX_ERROR;
1775 if (yysyntax_error_status == 2)
1776 goto yyexhaustedlab;
1778 # undef YYSYNTAX_ERROR
1784 if (yyerrstatus == 3)
1786 /* If just tried and failed to reuse lookahead token after an
1787 error, discard it. */
1789 if (yychar <= YYEOF)
1791 /* Return failure if at end of input. */
1792 if (yychar == YYEOF)
1797 yydestruct ("Error: discarding",
1803 /* Else will try to reuse lookahead token after shifting the error
1808 /*---------------------------------------------------.
1809 | yyerrorlab -- error raised explicitly by YYERROR. |
1810 `---------------------------------------------------*/
1813 /* Pacify compilers like GCC when the user code never invokes
1814 YYERROR and the label yyerrorlab therefore never appears in user
1816 if (/*CONSTCOND*/ 0)
1819 /* Do not reclaim the symbols of the rule whose action triggered
1823 YY_STACK_PRINT (yyss, yyssp);
1828 /*-------------------------------------------------------------.
1829 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1830 `-------------------------------------------------------------*/
1832 yyerrstatus = 3; /* Each real token shifted decrements this. */
1836 yyn = yypact[yystate];
1837 if (!yypact_value_is_default (yyn))
1840 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1848 /* Pop the current state because it cannot handle the error token. */
1853 yydestruct ("Error: popping",
1854 yystos[yystate], yyvsp);
1857 YY_STACK_PRINT (yyss, yyssp);
1860 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1862 YY_IGNORE_MAYBE_UNINITIALIZED_END
1865 /* Shift the error token. */
1866 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1872 /*-------------------------------------.
1873 | yyacceptlab -- YYACCEPT comes here. |
1874 `-------------------------------------*/
1879 /*-----------------------------------.
1880 | yyabortlab -- YYABORT comes here. |
1881 `-----------------------------------*/
1886 #if !defined yyoverflow || YYERROR_VERBOSE
1887 /*-------------------------------------------------.
1888 | yyexhaustedlab -- memory exhaustion comes here. |
1889 `-------------------------------------------------*/
1891 yyerror (YY_("memory exhausted"));
1897 if (yychar != YYEMPTY)
1899 /* Make sure we have latest lookahead translation. See comments at
1900 user semantic actions for why this is necessary. */
1901 yytoken = YYTRANSLATE (yychar);
1902 yydestruct ("Cleanup: discarding lookahead",
1905 /* Do not reclaim the symbols of the rule whose action triggered
1906 this YYABORT or YYACCEPT. */
1908 YY_STACK_PRINT (yyss, yyssp);
1909 while (yyssp != yyss)
1911 yydestruct ("Cleanup: popping",
1912 yystos[*yyssp], yyvsp);
1917 YYSTACK_FREE (yyss);
1920 if (yymsg != yymsgbuf)
1921 YYSTACK_FREE (yymsg);