1 /* A Bison parser, made from po-gram-gen.y
4 #define YYBISON 1 /* Identify Bison output. */
10 # define MSGID_PLURAL 261
16 #line 20 "po-gram-gen.y"
32 #include "po-charset.h"
36 #include "read-po-abstract.h"
38 #define _(str) gettext (str)
40 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
41 as well as gratuitiously global symbol names, so we can have multiple
42 yacc generated parsers in the same program. Note that these are only
43 the variables produced by yacc. If other parser generators (bison,
44 byacc, etc) produce additional global names that conflict at link time,
45 then those parser generators need to be fixed instead of adding those
46 names to this list. */
48 #define yymaxdepth po_gram_maxdepth
49 #define yyparse po_gram_parse
50 #define yylex po_gram_lex
51 #define yyerror po_gram_error
52 #define yylval po_gram_lval
53 #define yychar po_gram_char
54 #define yydebug po_gram_debug
55 #define yypact po_gram_pact
56 #define yyr1 po_gram_r1
57 #define yyr2 po_gram_r2
58 #define yydef po_gram_def
59 #define yychk po_gram_chk
60 #define yypgo po_gram_pgo
61 #define yyact po_gram_act
62 #define yyexca po_gram_exca
63 #define yyerrflag po_gram_errflag
64 #define yynerrs po_gram_nerrs
65 #define yyps po_gram_ps
66 #define yypv po_gram_pv
68 #define yy_yys po_gram_yys
69 #define yystate po_gram_state
70 #define yytmp po_gram_tmp
72 #define yy_yyv po_gram_yyv
73 #define yyval po_gram_val
74 #define yylloc po_gram_lloc
75 #define yyreds po_gram_reds /* With YYDEBUG defined */
76 #define yytoks po_gram_toks /* With YYDEBUG defined */
77 #define yylhs po_gram_yylhs
78 #define yylen po_gram_yylen
79 #define yydefred po_gram_yydefred
80 #define yydgoto po_gram_yydgoto
81 #define yysindex po_gram_yysindex
82 #define yyrindex po_gram_yyrindex
83 #define yygindex po_gram_yygindex
84 #define yytable po_gram_yytable
85 #define yycheck po_gram_yycheck
87 static long plural_counter
;
89 #define check_obsolete(value1,value2) \
90 if ((value1).obsolete != (value2).obsolete) \
91 po_gram_error_at_line (&(value2).pos, _("inconsistent use of #~"));
94 do_callback_message (char *msgid
, lex_pos_ty
*msgid_pos
, char *msgid_plural
,
95 char *msgstr
, size_t msgstr_len
, lex_pos_ty
*msgstr_pos
,
98 /* Test for header entry. Ignore fuzziness of the header entry. */
99 if (msgid
[0] == '\0' && !obsolete
)
100 po_lex_charset_set (msgstr
, gram_pos
.file_name
);
102 po_callback_message (msgid
, msgid_pos
, msgid_plural
,
103 msgstr
, msgstr_len
, msgstr_pos
,
108 #line 123 "po-gram-gen.y"
112 struct { char *string
; lex_pos_ty pos
; bool obsolete
; } string
;
113 struct { string_list_ty stringlist
; lex_pos_ty pos
; bool obsolete
; } stringlist
;
114 struct { long number
; lex_pos_ty pos
; bool obsolete
; } number
;
115 struct { lex_pos_ty pos
; bool obsolete
; } pos
;
116 struct { struct msgstr_def rhs
; lex_pos_ty pos
; bool obsolete
; } rhs
;
118 # define YYSTYPE yystype
119 # define YYSTYPE_IS_TRIVIAL 1
128 #define YYFLAG -32768
131 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
132 #define YYTRANSLATE(x) ((unsigned)(x) <= 265 ? yytranslate[x] : 22)
134 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
135 static const char yytranslate
[] =
137 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
138 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
139 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
140 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
141 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
142 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
143 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
144 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
145 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
146 2, 10, 2, 11, 2, 2, 2, 2, 2, 2,
147 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
148 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
149 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
150 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
151 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
152 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
153 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
154 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
155 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
156 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
157 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
158 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
159 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
161 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
162 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
167 static const short yyprhs
[] =
169 0, 0, 1, 4, 7, 10, 13, 16, 21, 26,
170 30, 34, 37, 40, 42, 45, 51, 53, 56
172 static const short yyrhs
[] =
174 -1, 14, 21, 0, 14, 15, 0, 14, 16, 0,
175 14, 1, 0, 4, 13, 0, 6, 20, 8, 20,
176 0, 6, 20, 17, 18, 0, 6, 20, 17, 0,
177 6, 20, 18, 0, 6, 20, 0, 7, 20, 0,
178 19, 0, 18, 19, 0, 8, 10, 12, 11, 20,
179 0, 13, 0, 20, 13, 0, 3, 0
185 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
186 static const short yyrline
[] =
188 0, 143, 144, 145, 146, 147, 151, 158, 176, 194,
189 202, 210, 219, 230, 234, 249, 271, 278, 289
194 #if (YYDEBUG) || defined YYERROR_VERBOSE
196 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
197 static const char *const yytname
[] =
199 "$", "error", "$undefined.", "COMMENT", "DOMAIN", "JUNK", "MSGID",
200 "MSGID_PLURAL", "MSGSTR", "NAME", "'['", "']'", "NUMBER", "STRING",
201 "msgfmt", "domain", "message", "msgid_pluralform", "pluralform_list",
202 "pluralform", "string_list", "comment", 0
206 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
207 static const short yyr1
[] =
209 0, 14, 14, 14, 14, 14, 15, 16, 16, 16,
210 16, 16, 17, 18, 18, 19, 20, 20, 21
213 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
214 static const short yyr2
[] =
216 0, 0, 2, 2, 2, 2, 2, 4, 4, 3,
217 3, 2, 2, 1, 2, 5, 1, 2, 1
220 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
221 doesn't specify something else to do. Zero means the default is an
223 static const short yydefact
[] =
225 1, 0, 5, 18, 0, 0, 3, 4, 2, 6,
226 16, 11, 0, 0, 17, 9, 10, 13, 12, 0,
227 7, 0, 8, 14, 0, 0, 15, 0, 0
230 static const short yydefgoto
[] =
232 1, 6, 7, 15, 16, 17, 11, 8
235 static const short yypact
[] =
237 -32768, 2,-32768,-32768, -1, 1,-32768,-32768,-32768,-32768,
238 -32768, 3, 1, -6,-32768, 9, 9,-32768, 5, 7,
239 5, 10, 9,-32768, 11, 1, 5, 21,-32768
242 static const short yypgoto
[] =
244 -32768,-32768,-32768,-32768, 8, -7, -12,-32768
251 static const short yytable
[] =
253 18, 20, 27, 2, 19, 3, 4, 10, 5, 23,
254 12, 13, 9, 26, 10, 23, 14, 21, 14, 24,
258 static const short yycheck
[] =
260 12, 13, 0, 1, 10, 3, 4, 13, 6, 16,
261 7, 8, 13, 25, 13, 22, 13, 8, 13, 12,
264 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
265 #line 3 "/usr/local/share/bison/bison.simple"
267 /* Skeleton output parser for bison,
269 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
272 This program is free software; you can redistribute it and/or modify
273 it under the terms of the GNU General Public License as published by
274 the Free Software Foundation; either version 2, or (at your option)
277 This program is distributed in the hope that it will be useful,
278 but WITHOUT ANY WARRANTY; without even the implied warranty of
279 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
280 GNU General Public License for more details.
282 You should have received a copy of the GNU General Public License
283 along with this program; if not, write to the Free Software
284 Foundation, Inc., 59 Temple Place - Suite 330,
285 Boston, MA 02111-1307, USA. */
287 /* As a special exception, when this file is copied by Bison into a
288 Bison output file, you may use that output file without restriction.
289 This special exception was added by the Free Software Foundation
290 in version 1.24 of Bison. */
292 /* This is the parser code that is written into each bison parser when
293 the %semantic_parser declaration is not specified in the grammar.
294 It was written by Richard Stallman by simplifying the hairy parser
295 used when %semantic_parser is specified. */
297 /* All symbols defined below should begin with yy or YY, to avoid
298 infringing on user name space. This should be done even for local
299 variables, as they might otherwise be expanded by user macros.
300 There are some unavoidable exceptions within include files to
301 define necessary library symbols; they are noted "INFRINGES ON
302 USER NAME SPACE" below. */
304 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
306 /* The parser invokes alloca or malloc; define the necessary symbols. */
308 # if YYSTACK_USE_ALLOCA
309 # define YYSTACK_ALLOC alloca
311 # ifndef YYSTACK_USE_ALLOCA
312 # if defined (alloca) || defined (_ALLOCA_H)
313 # define YYSTACK_ALLOC alloca
316 # define YYSTACK_ALLOC __builtin_alloca
322 # ifdef YYSTACK_ALLOC
323 /* Pacify GCC's `empty if-body' warning. */
324 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
326 # if defined (__STDC__) || defined (__cplusplus)
327 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
328 # define YYSIZE_T size_t
330 # define YYSTACK_ALLOC malloc
331 # define YYSTACK_FREE free
333 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
336 #if (! defined (yyoverflow) \
337 && (! defined (__cplusplus) \
338 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
340 /* A type that is properly aligned for any stack member. */
350 /* The size of the maximum gap between one aligned stack and the next. */
351 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
353 /* The size of an array large to enough to hold all stacks, each with
356 # define YYSTACK_BYTES(N) \
357 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
358 + 2 * YYSTACK_GAP_MAX)
360 # define YYSTACK_BYTES(N) \
361 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
365 /* Copy COUNT objects from FROM to TO. The source and destination do
369 # define YYCOPY(To, From, Count) \
370 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
372 # define YYCOPY(To, From, Count) \
375 register YYSIZE_T yyi; \
376 for (yyi = 0; yyi < (Count); yyi++) \
377 (To)[yyi] = (From)[yyi]; \
383 /* Relocate STACK from its old location to the new one. The
384 local variables YYSIZE and YYSTACKSIZE give the old and new number of
385 elements in the stack, and YYPTR gives the new location of the
386 stack. Advance YYPTR to a properly aligned location for the next
388 # define YYSTACK_RELOCATE(Stack) \
391 YYSIZE_T yynewbytes; \
392 YYCOPY (&yyptr->Stack, Stack, yysize); \
393 Stack = &yyptr->Stack; \
394 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
395 yyptr += yynewbytes / sizeof (*yyptr); \
402 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
403 # define YYSIZE_T __SIZE_TYPE__
405 #if ! defined (YYSIZE_T) && defined (size_t)
406 # define YYSIZE_T size_t
408 #if ! defined (YYSIZE_T)
409 # if defined (__STDC__) || defined (__cplusplus)
410 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
411 # define YYSIZE_T size_t
414 #if ! defined (YYSIZE_T)
415 # define YYSIZE_T unsigned int
418 #define yyerrok (yyerrstatus = 0)
419 #define yyclearin (yychar = YYEMPTY)
422 #define YYACCEPT goto yyacceptlab
423 #define YYABORT goto yyabortlab
424 #define YYERROR goto yyerrlab1
425 /* Like YYERROR except do call yyerror. This remains here temporarily
426 to ease the transition to the new meaning of YYERROR, for GCC.
427 Once GCC version 2 has supplanted version 1, this can go. */
428 #define YYFAIL goto yyerrlab
429 #define YYRECOVERING() (!!yyerrstatus)
430 #define YYBACKUP(Token, Value) \
432 if (yychar == YYEMPTY && yylen == 1) \
436 yychar1 = YYTRANSLATE (yychar); \
442 yyerror ("syntax error: cannot back up"); \
448 #define YYERRCODE 256
451 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
454 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
455 first token. By default, to implement support for ranges, extend
456 its range to the last symbol. */
458 #ifndef YYLLOC_DEFAULT
459 # define YYLLOC_DEFAULT(Current, Rhs, N) \
460 Current.last_line = Rhs[N].last_line; \
461 Current.last_column = Rhs[N].last_column;
465 /* YYLEX -- calling `yylex' with the right arguments. */
470 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
472 # define YYLEX yylex (&yylval, &yylloc)
474 # else /* !YYLSP_NEEDED */
476 # define YYLEX yylex (&yylval, YYLEX_PARAM)
478 # define YYLEX yylex (&yylval)
480 # endif /* !YYLSP_NEEDED */
482 # define YYLEX yylex ()
486 /* Enable debugging if requested. */
490 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
491 # define YYFPRINTF fprintf
494 # define YYDPRINTF(Args) \
499 /* Nonzero means print parse trace. It is left uninitialized so that
500 multiple parsers can coexist. */
503 # define YYDPRINTF(Args)
504 #endif /* !YYDEBUG */
506 /* YYINITDEPTH -- initial size of the parser's stacks. */
508 # define YYINITDEPTH 200
511 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
512 if the built-in stack extension method is used).
514 Do not make this value too large; the results are undefined if
515 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
516 evaluated with infinite-precision integer arithmetic. */
523 # define YYMAXDEPTH 10000
526 #ifdef YYERROR_VERBOSE
529 # if defined (__GLIBC__) && defined (_STRING_H)
530 # define yystrlen strlen
532 /* Return the length of YYSTR. */
534 # if defined (__STDC__) || defined (__cplusplus)
535 yystrlen (const char *yystr
)
541 register const char *yys
= yystr
;
543 while (*yys
++ != '\0')
546 return yys
- yystr
- 1;
552 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
553 # define yystpcpy stpcpy
555 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
558 # if defined (__STDC__) || defined (__cplusplus)
559 yystpcpy (char *yydest
, const char *yysrc
)
561 yystpcpy (yydest
, yysrc
)
566 register char *yyd
= yydest
;
567 register const char *yys
= yysrc
;
569 while ((*yyd
++ = *yys
++) != '\0')
578 #line 315 "/usr/local/share/bison/bison.simple"
581 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
582 into yyparse. The argument should have type void *.
583 It should actually point to an object.
584 Grammar actions can access the variable by casting it
585 to the proper pointer type. */
588 # if defined (__STDC__) || defined (__cplusplus)
589 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
590 # define YYPARSE_PARAM_DECL
592 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
593 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
595 #else /* !YYPARSE_PARAM */
596 # define YYPARSE_PARAM_ARG
597 # define YYPARSE_PARAM_DECL
598 #endif /* !YYPARSE_PARAM */
600 /* Prevent warning if -Wstrict-prototypes. */
602 # ifdef YYPARSE_PARAM
603 int yyparse (void *);
609 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
610 variables are global, or local to YYPARSE. */
612 #define YY_DECL_NON_LSP_VARIABLES \
613 /* The lookahead symbol. */ \
616 /* The semantic value of the lookahead symbol. */ \
619 /* Number of parse errors so far. */ \
623 # define YY_DECL_VARIABLES \
624 YY_DECL_NON_LSP_VARIABLES \
626 /* Location data for the lookahead symbol. */ \
629 # define YY_DECL_VARIABLES \
630 YY_DECL_NON_LSP_VARIABLES
634 /* If nonreentrant, generate the variables here. */
641 yyparse (YYPARSE_PARAM_ARG
)
644 /* If reentrant, generate the variables here. */
649 register int yystate
;
652 /* Number of tokens to shift before error messages enabled. */
654 /* Lookahead token as an internal (translated) token number. */
657 /* Three stacks and their tools:
658 `yyss': related to states,
659 `yyvs': related to semantic values,
660 `yyls': related to locations.
662 Refer to the stacks thru separate pointers, to allow yyoverflow
663 to reallocate them elsewhere. */
665 /* The state stack. */
666 short yyssa
[YYINITDEPTH
];
668 register short *yyssp
;
670 /* The semantic value stack. */
671 YYSTYPE yyvsa
[YYINITDEPTH
];
672 YYSTYPE
*yyvs
= yyvsa
;
673 register YYSTYPE
*yyvsp
;
676 /* The location stack. */
677 YYLTYPE yylsa
[YYINITDEPTH
];
678 YYLTYPE
*yyls
= yylsa
;
683 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
685 # define YYPOPSTACK (yyvsp--, yyssp--)
688 YYSIZE_T yystacksize
= YYINITDEPTH
;
691 /* The variables used to return semantic value and location from the
698 /* When reducing, the number of symbols on the RHS of the reduced
702 YYDPRINTF ((stderr
, "Starting parse\n"));
707 yychar
= YYEMPTY
; /* Cause a token to be read. */
709 /* Initialize stack pointers.
710 Waste one element of value and location stack
711 so that they stay on the same level as the state stack.
712 The wasted elements are never initialized. */
721 /*------------------------------------------------------------.
722 | yynewstate -- Push a new state, which is found in yystate. |
723 `------------------------------------------------------------*/
725 /* In all cases, when you get here, the value and location stacks
726 have just been pushed. so pushing a state here evens the stacks.
733 if (yyssp
>= yyss
+ yystacksize
- 1)
735 /* Get the current used size of the three stacks, in elements. */
736 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
740 /* Give user a chance to reallocate the stack. Use copies of
741 these so that the &'s don't force the real ones into
743 YYSTYPE
*yyvs1
= yyvs
;
746 /* Each stack pointer address is followed by the size of the
747 data in use in that stack, in bytes. */
749 YYLTYPE
*yyls1
= yyls
;
750 /* This used to be a conditional around just the two extra args,
751 but that might be undefined if yyoverflow is a macro. */
752 yyoverflow ("parser stack overflow",
753 &yyss1
, yysize
* sizeof (*yyssp
),
754 &yyvs1
, yysize
* sizeof (*yyvsp
),
755 &yyls1
, yysize
* sizeof (*yylsp
),
759 yyoverflow ("parser stack overflow",
760 &yyss1
, yysize
* sizeof (*yyssp
),
761 &yyvs1
, yysize
* sizeof (*yyvsp
),
767 #else /* no yyoverflow */
768 # ifndef YYSTACK_RELOCATE
771 /* Extend the stack our own way. */
772 if (yystacksize
>= YYMAXDEPTH
)
775 if (yystacksize
> YYMAXDEPTH
)
776 yystacksize
= YYMAXDEPTH
;
780 union yyalloc
*yyptr
=
781 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
784 YYSTACK_RELOCATE (yyss
);
785 YYSTACK_RELOCATE (yyvs
);
787 YYSTACK_RELOCATE (yyls
);
789 # undef YYSTACK_RELOCATE
791 YYSTACK_FREE (yyss1
);
794 #endif /* no yyoverflow */
796 yyssp
= yyss
+ yysize
- 1;
797 yyvsp
= yyvs
+ yysize
- 1;
799 yylsp
= yyls
+ yysize
- 1;
802 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
803 (unsigned long int) yystacksize
));
805 if (yyssp
>= yyss
+ yystacksize
- 1)
809 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
819 /* Do appropriate processing given the current state. */
820 /* Read a lookahead token if we need one and don't already have one. */
823 /* First try to decide what to do without reference to lookahead token. */
825 yyn
= yypact
[yystate
];
829 /* Not known => get a lookahead token if don't already have one. */
831 /* yychar is either YYEMPTY or YYEOF
832 or a valid token in external form. */
834 if (yychar
== YYEMPTY
)
836 YYDPRINTF ((stderr
, "Reading a token: "));
840 /* Convert token to internal form (in yychar1) for indexing tables with */
842 if (yychar
<= 0) /* This means end of input. */
845 yychar
= YYEOF
; /* Don't call YYLEX any more */
847 YYDPRINTF ((stderr
, "Now at end of input.\n"));
851 yychar1
= YYTRANSLATE (yychar
);
854 /* We have to keep this `#if YYDEBUG', since we use variables
855 which are defined only if `YYDEBUG' is set. */
858 YYFPRINTF (stderr
, "Next token is %d (%s",
859 yychar
, yytname
[yychar1
]);
860 /* Give the individual parser a way to print the precise
861 meaning of a token, for further debugging info. */
863 YYPRINT (stderr
, yychar
, yylval
);
865 YYFPRINTF (stderr
, ")\n");
871 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
876 /* yyn is what to do for this token type in this state.
877 Negative => reduce, -yyn is rule number.
878 Positive => shift, yyn is new state.
879 New state is final state => don't bother to shift,
881 0, or most negative number => error. */
896 /* Shift the lookahead token. */
897 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
898 yychar
, yytname
[yychar1
]));
900 /* Discard the token being shifted unless it is eof. */
909 /* Count tokens shifted since error; after three, turn off error
918 /*-----------------------------------------------------------.
919 | yydefault -- do the default action for the current state. |
920 `-----------------------------------------------------------*/
922 yyn
= yydefact
[yystate
];
928 /*-----------------------------.
929 | yyreduce -- Do a reduction. |
930 `-----------------------------*/
932 /* yyn is the number of a rule to reduce with. */
935 /* If YYLEN is nonzero, implement the default value of the action:
938 Otherwise, the following line sets YYVAL to the semantic value of
939 the lookahead token. This behavior is undocumented and Bison
940 users should not rely upon it. Assigning to YYVAL
941 unconditionally makes the parser a bit smaller, and it avoids a
942 GCC warning that YYVAL may be used uninitialized. */
943 yyval
= yyvsp
[1-yylen
];
946 /* Similarly for the default location. Let the user run additional
947 commands if for instance locations are ranges. */
948 yyloc
= yylsp
[1-yylen
];
949 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
953 /* We have to keep this `#if YYDEBUG', since we use variables which
954 are defined only if `YYDEBUG' is set. */
959 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
962 /* Print the symbols being reduced, and their result. */
963 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] > 0; yyi
++)
964 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
965 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
972 #line 152 "po-gram-gen.y"
974 po_callback_domain (yyvsp
[0].string
.string
);
978 #line 159 "po-gram-gen.y"
980 char *string2
= string_list_concat_destroy (&yyvsp
[-2].stringlist
.stringlist
);
981 char *string4
= string_list_concat_destroy (&yyvsp
[0].stringlist
.stringlist
);
983 check_obsolete (yyvsp
[-3].pos
, yyvsp
[-2].stringlist
);
984 check_obsolete (yyvsp
[-3].pos
, yyvsp
[-1].pos
);
985 check_obsolete (yyvsp
[-3].pos
, yyvsp
[0].stringlist
);
986 if (!yyvsp
[-3].pos
.obsolete
|| pass_obsolete_entries
)
987 do_callback_message (string2
, &yyvsp
[-3].pos
.pos
, NULL
,
988 string4
, strlen (string4
) + 1, &yyvsp
[-1].pos
.pos
,
989 yyvsp
[-3].pos
.obsolete
);
998 #line 177 "po-gram-gen.y"
1000 char *string2
= string_list_concat_destroy (&yyvsp
[-2].stringlist
.stringlist
);
1002 check_obsolete (yyvsp
[-3].pos
, yyvsp
[-2].stringlist
);
1003 check_obsolete (yyvsp
[-3].pos
, yyvsp
[-1].string
);
1004 check_obsolete (yyvsp
[-3].pos
, yyvsp
[0].rhs
);
1005 if (!yyvsp
[-3].pos
.obsolete
|| pass_obsolete_entries
)
1006 do_callback_message (string2
, &yyvsp
[-3].pos
.pos
, yyvsp
[-1].string
.string
,
1007 yyvsp
[0].rhs
.rhs
.msgstr
, yyvsp
[0].rhs
.rhs
.msgstr_len
, &yyvsp
[0].rhs
.pos
,
1008 yyvsp
[-3].pos
.obsolete
);
1012 free (yyvsp
[-1].string
.string
);
1013 free (yyvsp
[0].rhs
.rhs
.msgstr
);
1018 #line 195 "po-gram-gen.y"
1020 check_obsolete (yyvsp
[-2].pos
, yyvsp
[-1].stringlist
);
1021 check_obsolete (yyvsp
[-2].pos
, yyvsp
[0].string
);
1022 po_gram_error_at_line (&yyvsp
[-2].pos
.pos
, _("missing `msgstr[]' section"));
1023 string_list_destroy (&yyvsp
[-1].stringlist
.stringlist
);
1024 free (yyvsp
[0].string
.string
);
1028 #line 203 "po-gram-gen.y"
1030 check_obsolete (yyvsp
[-2].pos
, yyvsp
[-1].stringlist
);
1031 check_obsolete (yyvsp
[-2].pos
, yyvsp
[0].rhs
);
1032 po_gram_error_at_line (&yyvsp
[-2].pos
.pos
, _("missing `msgid_plural' section"));
1033 string_list_destroy (&yyvsp
[-1].stringlist
.stringlist
);
1034 free (yyvsp
[0].rhs
.rhs
.msgstr
);
1038 #line 211 "po-gram-gen.y"
1040 check_obsolete (yyvsp
[-1].pos
, yyvsp
[0].stringlist
);
1041 po_gram_error_at_line (&yyvsp
[-1].pos
.pos
, _("missing `msgstr' section"));
1042 string_list_destroy (&yyvsp
[0].stringlist
.stringlist
);
1046 #line 220 "po-gram-gen.y"
1048 check_obsolete (yyvsp
[-1].pos
, yyvsp
[0].stringlist
);
1050 yyval
.string
.string
= string_list_concat_destroy (&yyvsp
[0].stringlist
.stringlist
);
1051 yyval
.string
.pos
= yyvsp
[-1].pos
.pos
;
1052 yyval
.string
.obsolete
= yyvsp
[-1].pos
.obsolete
;
1056 #line 231 "po-gram-gen.y"
1058 yyval
.rhs
= yyvsp
[0].rhs
;
1062 #line 235 "po-gram-gen.y"
1064 check_obsolete (yyvsp
[-1].rhs
, yyvsp
[0].rhs
);
1065 yyval
.rhs
.rhs
.msgstr
= (char *) xmalloc (yyvsp
[-1].rhs
.rhs
.msgstr_len
+ yyvsp
[0].rhs
.rhs
.msgstr_len
);
1066 memcpy (yyval
.rhs
.rhs
.msgstr
, yyvsp
[-1].rhs
.rhs
.msgstr
, yyvsp
[-1].rhs
.rhs
.msgstr_len
);
1067 memcpy (yyval
.rhs
.rhs
.msgstr
+ yyvsp
[-1].rhs
.rhs
.msgstr_len
, yyvsp
[0].rhs
.rhs
.msgstr
, yyvsp
[0].rhs
.rhs
.msgstr_len
);
1068 yyval
.rhs
.rhs
.msgstr_len
= yyvsp
[-1].rhs
.rhs
.msgstr_len
+ yyvsp
[0].rhs
.rhs
.msgstr_len
;
1069 free (yyvsp
[-1].rhs
.rhs
.msgstr
);
1070 free (yyvsp
[0].rhs
.rhs
.msgstr
);
1071 yyval
.rhs
.pos
= yyvsp
[-1].rhs
.pos
;
1072 yyval
.rhs
.obsolete
= yyvsp
[-1].rhs
.obsolete
;
1076 #line 250 "po-gram-gen.y"
1078 check_obsolete (yyvsp
[-4].pos
, yyvsp
[-3].pos
);
1079 check_obsolete (yyvsp
[-4].pos
, yyvsp
[-2].number
);
1080 check_obsolete (yyvsp
[-4].pos
, yyvsp
[-1].pos
);
1081 check_obsolete (yyvsp
[-4].pos
, yyvsp
[0].stringlist
);
1082 if (yyvsp
[-2].number
.number
!= plural_counter
)
1084 if (plural_counter
== 0)
1085 po_gram_error_at_line (&yyvsp
[-4].pos
.pos
, _("first plural form has nonzero index"));
1087 po_gram_error_at_line (&yyvsp
[-4].pos
.pos
, _("plural form has wrong index"));
1090 yyval
.rhs
.rhs
.msgstr
= string_list_concat_destroy (&yyvsp
[0].stringlist
.stringlist
);
1091 yyval
.rhs
.rhs
.msgstr_len
= strlen (yyval
.rhs
.rhs
.msgstr
) + 1;
1092 yyval
.rhs
.pos
= yyvsp
[-4].pos
.pos
;
1093 yyval
.rhs
.obsolete
= yyvsp
[-4].pos
.obsolete
;
1097 #line 272 "po-gram-gen.y"
1099 string_list_init (&yyval
.stringlist
.stringlist
);
1100 string_list_append (&yyval
.stringlist
.stringlist
, yyvsp
[0].string
.string
);
1101 yyval
.stringlist
.pos
= yyvsp
[0].string
.pos
;
1102 yyval
.stringlist
.obsolete
= yyvsp
[0].string
.obsolete
;
1106 #line 279 "po-gram-gen.y"
1108 check_obsolete (yyvsp
[-1].stringlist
, yyvsp
[0].string
);
1109 yyval
.stringlist
.stringlist
= yyvsp
[-1].stringlist
.stringlist
;
1110 string_list_append (&yyval
.stringlist
.stringlist
, yyvsp
[0].string
.string
);
1111 yyval
.stringlist
.pos
= yyvsp
[-1].stringlist
.pos
;
1112 yyval
.stringlist
.obsolete
= yyvsp
[-1].stringlist
.obsolete
;
1116 #line 290 "po-gram-gen.y"
1118 po_callback_comment_dispatcher (yyvsp
[0].string
.string
);
1123 #line 705 "/usr/local/share/bison/bison.simple"
1135 short *yyssp1
= yyss
- 1;
1136 YYFPRINTF (stderr
, "state stack now");
1137 while (yyssp1
!= yyssp
)
1138 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1139 YYFPRINTF (stderr
, "\n");
1148 /* Now `shift' the result of the reduction. Determine what state
1149 that goes to, based on the state we popped back to and the rule
1150 number reduced by. */
1154 yystate
= yypgoto
[yyn
- YYNTBASE
] + *yyssp
;
1155 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1156 yystate
= yytable
[yystate
];
1158 yystate
= yydefgoto
[yyn
- YYNTBASE
];
1163 /*------------------------------------.
1164 | yyerrlab -- here on detecting error |
1165 `------------------------------------*/
1167 /* If not already recovering from an error, report this error. */
1172 #ifdef YYERROR_VERBOSE
1173 yyn
= yypact
[yystate
];
1175 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
1177 YYSIZE_T yysize
= 0;
1182 /* Start YYX at -YYN if negative to avoid negative indexes in
1184 for (yyx
= yyn
< 0 ? -yyn
: 0;
1185 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1186 if (yycheck
[yyx
+ yyn
] == yyx
)
1187 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1188 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1189 yysize
+= yystrlen (yytname
[YYTRANSLATE (yychar
)]);
1190 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1193 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1194 yyp
= yystpcpy (yyp
, yytname
[YYTRANSLATE (yychar
)]);
1199 for (yyx
= yyn
< 0 ? -yyn
: 0;
1200 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1202 if (yycheck
[yyx
+ yyn
] == yyx
)
1204 const char *yyq
= ! yycount
? ", expecting " : " or ";
1205 yyp
= yystpcpy (yyp
, yyq
);
1206 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1211 YYSTACK_FREE (yymsg
);
1214 yyerror ("parse error; also virtual memory exhausted");
1217 #endif /* defined (YYERROR_VERBOSE) */
1218 yyerror ("parse error");
1223 /*--------------------------------------------------.
1224 | yyerrlab1 -- error raised explicitly by an action |
1225 `--------------------------------------------------*/
1227 if (yyerrstatus
== 3)
1229 /* If just tried and failed to reuse lookahead token after an
1230 error, discard it. */
1232 /* return failure if at end of input */
1233 if (yychar
== YYEOF
)
1235 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1236 yychar
, yytname
[yychar1
]));
1240 /* Else will try to reuse lookahead token after shifting the error
1243 yyerrstatus
= 3; /* Each real token shifted decrements this */
1248 /*-------------------------------------------------------------------.
1249 | yyerrdefault -- current state does not do anything special for the |
1251 `-------------------------------------------------------------------*/
1254 /* This is wrong; only states that explicitly want error tokens
1255 should shift them. */
1257 /* If its default is to accept any token, ok. Otherwise pop it. */
1258 yyn
= yydefact
[yystate
];
1264 /*---------------------------------------------------------------.
1265 | yyerrpop -- pop the current state because it cannot handle the |
1267 `---------------------------------------------------------------*/
1280 short *yyssp1
= yyss
- 1;
1281 YYFPRINTF (stderr
, "Error: state stack now");
1282 while (yyssp1
!= yyssp
)
1283 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1284 YYFPRINTF (stderr
, "\n");
1292 yyn
= yypact
[yystate
];
1297 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != YYTERROR
)
1314 YYDPRINTF ((stderr
, "Shifting error token, "));
1325 /*-------------------------------------.
1326 | yyacceptlab -- YYACCEPT comes here. |
1327 `-------------------------------------*/
1332 /*-----------------------------------.
1333 | yyabortlab -- YYABORT comes here. |
1334 `-----------------------------------*/
1339 /*---------------------------------------------.
1340 | yyoverflowab -- parser overflow comes here. |
1341 `---------------------------------------------*/
1343 yyerror ("parser stack overflow");
1350 YYSTACK_FREE (yyss
);
1354 #line 294 "po-gram-gen.y"