2
/* A Bison parser, made from po-gram-gen.y
3
by GNU Bison version 1.28 */
5
#define YYBISON 1 /* Identify Bison output. */
11
#define MSGID_PLURAL 261
17
#line 20 "po-gram-gen.y"
29
#include "libgettext.h"
32
#define _(str) gettext (str)
34
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
35
as well as gratuitiously global symbol names, so we can have multiple
36
yacc generated parsers in the same program. Note that these are only
37
the variables produced by yacc. If other parser generators (bison,
38
byacc, etc) produce additional global names that conflict at link time,
39
then those parser generators need to be fixed instead of adding those
40
names to this list. */
42
#define yymaxdepth po_gram_maxdepth
43
#define yyparse po_gram_parse
44
#define yylex po_gram_lex
45
#define yyerror po_gram_error
46
#define yylval po_gram_lval
47
#define yychar po_gram_char
48
#define yydebug po_gram_debug
49
#define yypact po_gram_pact
50
#define yyr1 po_gram_r1
51
#define yyr2 po_gram_r2
52
#define yydef po_gram_def
53
#define yychk po_gram_chk
54
#define yypgo po_gram_pgo
55
#define yyact po_gram_act
56
#define yyexca po_gram_exca
57
#define yyerrflag po_gram_errflag
58
#define yynerrs po_gram_nerrs
59
#define yyps po_gram_ps
60
#define yypv po_gram_pv
62
#define yy_yys po_gram_yys
63
#define yystate po_gram_state
64
#define yytmp po_gram_tmp
66
#define yy_yyv po_gram_yyv
67
#define yyval po_gram_val
68
#define yylloc po_gram_lloc
69
#define yyreds po_gram_reds /* With YYDEBUG defined */
70
#define yytoks po_gram_toks /* With YYDEBUG defined */
71
#define yylhs po_gram_yylhs
72
#define yylen po_gram_yylen
73
#define yydefred po_gram_yydefred
74
#define yydgoto po_gram_yydgoto
75
#define yysindex po_gram_yysindex
76
#define yyrindex po_gram_yyrindex
77
#define yygindex po_gram_yygindex
78
#define yytable po_gram_yytable
79
#define yycheck po_gram_yycheck
81
static long plural_counter;
83
#define check_obsolete(value1,value2) \
84
if ((value1).obsolete != (value2).obsolete) \
85
po_gram_error_at_line (&(value2).pos, _("inconsistent use of #~"));
88
#line 102 "po-gram-gen.y"
91
struct { char *string; lex_pos_ty pos; int obsolete; } string;
92
struct { long number; lex_pos_ty pos; int obsolete; } number;
93
struct { lex_pos_ty pos; int obsolete; } pos;
94
struct { struct msgstr_def rhs; lex_pos_ty pos; int obsolete; } rhs;
107
#define YYFLAG -32768
110
#define YYTRANSLATE(x) ((unsigned)(x) <= 265 ? yytranslate[x] : 22)
112
static const char yytranslate[] = { 0,
113
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
114
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
115
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
116
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
117
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
118
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
119
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
120
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
121
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
122
10, 2, 11, 2, 2, 2, 2, 2, 2, 2,
123
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
124
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
125
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
126
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
127
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
128
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
129
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
130
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
131
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
132
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
133
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
134
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
135
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
136
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
137
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
138
2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
143
static const short yyprhs[] = { 0,
144
0, 1, 4, 7, 10, 13, 16, 21, 26, 30,
145
34, 37, 40, 42, 45, 51, 53, 56
148
static const short yyrhs[] = { -1,
149
14, 21, 0, 14, 15, 0, 14, 16, 0, 14,
150
1, 0, 4, 13, 0, 6, 20, 8, 20, 0,
151
6, 20, 17, 18, 0, 6, 20, 17, 0, 6,
152
20, 18, 0, 6, 20, 0, 7, 20, 0, 19,
153
0, 18, 19, 0, 8, 10, 12, 11, 20, 0,
154
13, 0, 20, 13, 0, 3, 0
160
static const short yyrline[] = { 0,
161
120, 121, 122, 123, 124, 128, 135, 149, 164, 172,
162
180, 189, 200, 204, 219, 241, 245, 263
167
#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
169
static const char * const yytname[] = { "$","error","$undefined.","COMMENT",
170
"DOMAIN","JUNK","MSGID","MSGID_PLURAL","MSGSTR","NAME","'['","']'","NUMBER",
171
"STRING","msgfmt","domain","message","msgid_pluralform","pluralform_list","pluralform",
172
"string_list","comment", NULL
176
static const short yyr1[] = { 0,
177
14, 14, 14, 14, 14, 15, 16, 16, 16, 16,
178
16, 17, 18, 18, 19, 20, 20, 21
181
static const short yyr2[] = { 0,
182
0, 2, 2, 2, 2, 2, 4, 4, 3, 3,
183
2, 2, 1, 2, 5, 1, 2, 1
186
static const short yydefact[] = { 1,
187
0, 5, 18, 0, 0, 3, 4, 2, 6, 16,
188
11, 0, 0, 17, 9, 10, 13, 12, 0, 7,
189
0, 8, 14, 0, 0, 15, 0, 0
192
static const short yydefgoto[] = { 1,
193
6, 7, 15, 16, 17, 11, 8
196
static const short yypact[] = {-32768,
197
2,-32768,-32768, -1, 1,-32768,-32768,-32768,-32768,-32768,
198
3, 1, -6,-32768, 9, 9,-32768, 5, 7, 5,
199
10, 9,-32768, 11, 1, 5, 21,-32768
202
static const short yypgoto[] = {-32768,
203
-32768,-32768,-32768, 8, -7, -12,-32768
210
static const short yytable[] = { 18,
211
20, 27, 2, 19, 3, 4, 10, 5, 23, 12,
212
13, 9, 26, 10, 23, 14, 21, 14, 24, 19,
216
static const short yycheck[] = { 12,
217
13, 0, 1, 10, 3, 4, 13, 6, 16, 7,
218
8, 13, 25, 13, 22, 13, 8, 13, 12, 10,
221
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
222
#line 3 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple"
223
/* This file comes from bison-1.28. */
225
/* Skeleton output parser for bison,
226
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
228
This program is free software; you can redistribute it and/or modify
229
it under the terms of the GNU General Public License as published by
230
the Free Software Foundation; either version 2, or (at your option)
233
This program is distributed in the hope that it will be useful,
234
but WITHOUT ANY WARRANTY; without even the implied warranty of
235
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
236
GNU General Public License for more details.
238
You should have received a copy of the GNU General Public License
239
along with this program; if not, write to the Free Software
240
Foundation, Inc., 59 Temple Place - Suite 330,
241
Boston, MA 02111-1307, USA. */
243
/* As a special exception, when this file is copied by Bison into a
244
Bison output file, you may use that output file without restriction.
245
This special exception was added by the Free Software Foundation
246
in version 1.24 of Bison. */
248
/* This is the parser code that is written into each bison parser
249
when the %semantic_parser declaration is not specified in the grammar.
250
It was written by Richard Stallman by simplifying the hairy parser
251
used when %semantic_parser is specified. */
253
#ifndef YYSTACK_USE_ALLOCA
255
#define YYSTACK_USE_ALLOCA
256
#else /* alloca not defined */
258
#define YYSTACK_USE_ALLOCA
259
#define alloca __builtin_alloca
260
#else /* not GNU C. */
261
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
262
#define YYSTACK_USE_ALLOCA
264
#else /* not sparc */
265
/* We think this test detects Watcom and Microsoft C. */
266
/* This used to test MSDOS, but that is a bad idea
267
since that symbol is in the user namespace. */
268
#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
269
#if 0 /* No need for malloc.h, which pollutes the namespace;
270
instead, just don't use alloca. */
273
#else /* not MSDOS, or __TURBOC__ */
275
/* I don't know what this was needed for, but it pollutes the namespace.
276
So I turned it off. rms, 2 May 1997. */
277
/* #include <malloc.h> */
279
#define YYSTACK_USE_ALLOCA
280
#else /* not MSDOS, or __TURBOC__, or _AIX */
282
#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
283
and on HPUX 10. Eventually we can turn this on. */
284
#define YYSTACK_USE_ALLOCA
285
#define alloca __builtin_alloca
288
#endif /* not _AIX */
289
#endif /* not MSDOS, or __TURBOC__ */
290
#endif /* not sparc */
291
#endif /* not GNU C */
292
#endif /* alloca not defined */
293
#endif /* YYSTACK_USE_ALLOCA not defined */
295
#ifdef YYSTACK_USE_ALLOCA
296
#define YYSTACK_ALLOC alloca
298
#define YYSTACK_ALLOC malloc
301
/* Note: there must be only one dollar sign in this file.
302
It is replaced by the list of actions, each action
303
as one case of the switch. */
305
#define yyerrok (yyerrstatus = 0)
306
#define yyclearin (yychar = YYEMPTY)
309
#define YYACCEPT goto yyacceptlab
310
#define YYABORT goto yyabortlab
311
#define YYERROR goto yyerrlab1
312
/* Like YYERROR except do call yyerror.
313
This remains here temporarily to ease the
314
transition to the new meaning of YYERROR, for GCC.
315
Once GCC version 2 has supplanted version 1, this can go. */
316
#define YYFAIL goto yyerrlab
317
#define YYRECOVERING() (!!yyerrstatus)
318
#define YYBACKUP(token, value) \
320
if (yychar == YYEMPTY && yylen == 1) \
321
{ yychar = (token), yylval = (value); \
322
yychar1 = YYTRANSLATE (yychar); \
327
{ yyerror ("syntax error: cannot back up"); YYERROR; } \
331
#define YYERRCODE 256
334
#define YYLEX yylex()
340
#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
342
#define YYLEX yylex(&yylval, &yylloc)
344
#else /* not YYLSP_NEEDED */
346
#define YYLEX yylex(&yylval, YYLEX_PARAM)
348
#define YYLEX yylex(&yylval)
350
#endif /* not YYLSP_NEEDED */
353
/* If nonreentrant, generate the variables here */
357
int yychar; /* the lookahead symbol */
358
YYSTYPE yylval; /* the semantic value of the */
359
/* lookahead symbol */
362
YYLTYPE yylloc; /* location data for the lookahead */
366
int yynerrs; /* number of parse errors so far */
367
#endif /* not YYPURE */
370
int yydebug; /* nonzero means print parse trace */
371
/* Since this is uninitialized, it does not stop multiple parsers
375
/* YYINITDEPTH indicates the initial size of the parser's stacks */
378
#define YYINITDEPTH 200
381
/* YYMAXDEPTH is the maximum size the stacks can grow to
382
(effective only if the built-in stack extension method is used). */
389
#define YYMAXDEPTH 10000
392
/* Define __yy_memcpy. Note that the size argument
393
should be passed with type unsigned int, because that is what the non-GCC
394
definitions require. With GCC, __builtin_memcpy takes an arg
395
of type size_t, but it can handle unsigned int. */
397
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
398
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
399
#else /* not GNU C or C++ */
402
/* This is the most reliable way to avoid incompatibilities
403
in available built-in functions on various systems. */
405
__yy_memcpy (to, from, count)
410
register char *f = from;
411
register char *t = to;
412
register int i = count;
418
#else /* __cplusplus */
420
/* This is the most reliable way to avoid incompatibilities
421
in available built-in functions on various systems. */
423
__yy_memcpy (char *to, char *from, unsigned int count)
425
register char *t = to;
426
register char *f = from;
427
register int i = count;
436
#line 217 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple"
438
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
439
into yyparse. The argument should have type void *.
440
It should actually point to an object.
441
Grammar actions can access the variable by casting it
442
to the proper pointer type. */
446
#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
447
#define YYPARSE_PARAM_DECL
448
#else /* not __cplusplus */
449
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
450
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
451
#endif /* not __cplusplus */
452
#else /* not YYPARSE_PARAM */
453
#define YYPARSE_PARAM_ARG
454
#define YYPARSE_PARAM_DECL
455
#endif /* not YYPARSE_PARAM */
457
/* Prevent warning if -Wstrict-prototypes. */
460
int yyparse (void *);
467
yyparse(YYPARSE_PARAM_ARG)
470
register int yystate;
472
register short *yyssp;
473
register YYSTYPE *yyvsp;
474
int yyerrstatus; /* number of tokens to shift before error messages enabled */
475
int yychar1 = 0; /* lookahead token as an internal (translated) token number */
477
short yyssa[YYINITDEPTH]; /* the state stack */
478
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
480
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
481
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
484
YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
485
YYLTYPE *yyls = yylsa;
488
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
490
#define YYPOPSTACK (yyvsp--, yyssp--)
493
int yystacksize = YYINITDEPTH;
494
int yyfree_stacks = 0;
505
YYSTYPE yyval; /* the variable used to return */
506
/* semantic values from the action */
513
fprintf(stderr, "Starting parse\n");
519
yychar = YYEMPTY; /* Cause a token to be read. */
521
/* Initialize stack pointers.
522
Waste one element of value and location stack
523
so that they stay on the same level as the state stack.
524
The wasted elements are never initialized. */
532
/* Push a new state, which is found in yystate . */
533
/* In all cases, when you get here, the value and location stacks
534
have just been pushed. so pushing a state here evens the stacks. */
539
if (yyssp >= yyss + yystacksize - 1)
541
/* Give user a chance to reallocate the stack */
542
/* Use copies of these so that the &'s don't force the real ones into memory. */
543
YYSTYPE *yyvs1 = yyvs;
546
YYLTYPE *yyls1 = yyls;
549
/* Get the current used size of the three stacks, in elements. */
550
int size = yyssp - yyss + 1;
553
/* Each stack pointer address is followed by the size of
554
the data in use in that stack, in bytes. */
556
/* This used to be a conditional around just the two extra args,
557
but that might be undefined if yyoverflow is a macro. */
558
yyoverflow("parser stack overflow",
559
&yyss1, size * sizeof (*yyssp),
560
&yyvs1, size * sizeof (*yyvsp),
561
&yyls1, size * sizeof (*yylsp),
564
yyoverflow("parser stack overflow",
565
&yyss1, size * sizeof (*yyssp),
566
&yyvs1, size * sizeof (*yyvsp),
570
yyss = yyss1; yyvs = yyvs1;
574
#else /* no yyoverflow */
575
/* Extend the stack our own way. */
576
if (yystacksize >= YYMAXDEPTH)
578
yyerror("parser stack overflow");
590
if (yystacksize > YYMAXDEPTH)
591
yystacksize = YYMAXDEPTH;
592
#ifndef YYSTACK_USE_ALLOCA
595
yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
596
__yy_memcpy ((char *)yyss, (char *)yyss1,
597
size * (unsigned int) sizeof (*yyssp));
598
yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
599
__yy_memcpy ((char *)yyvs, (char *)yyvs1,
600
size * (unsigned int) sizeof (*yyvsp));
602
yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
603
__yy_memcpy ((char *)yyls, (char *)yyls1,
604
size * (unsigned int) sizeof (*yylsp));
606
#endif /* no yyoverflow */
608
yyssp = yyss + size - 1;
609
yyvsp = yyvs + size - 1;
611
yylsp = yyls + size - 1;
616
fprintf(stderr, "Stack size increased to %d\n", yystacksize);
619
if (yyssp >= yyss + yystacksize - 1)
625
fprintf(stderr, "Entering state %d\n", yystate);
631
/* Do appropriate processing given the current state. */
632
/* Read a lookahead token if we need one and don't already have one. */
635
/* First try to decide what to do without reference to lookahead token. */
637
yyn = yypact[yystate];
641
/* Not known => get a lookahead token if don't already have one. */
643
/* yychar is either YYEMPTY or YYEOF
644
or a valid token in external form. */
646
if (yychar == YYEMPTY)
650
fprintf(stderr, "Reading a token: ");
655
/* Convert token to internal form (in yychar1) for indexing tables with */
657
if (yychar <= 0) /* This means end of input. */
660
yychar = YYEOF; /* Don't call YYLEX any more */
664
fprintf(stderr, "Now at end of input.\n");
669
yychar1 = YYTRANSLATE(yychar);
674
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
675
/* Give the individual parser a way to print the precise meaning
676
of a token, for further debugging info. */
678
YYPRINT (stderr, yychar, yylval);
680
fprintf (stderr, ")\n");
686
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
691
/* yyn is what to do for this token type in this state.
692
Negative => reduce, -yyn is rule number.
693
Positive => shift, yyn is new state.
694
New state is final state => don't bother to shift,
696
0, or most negative number => error. */
711
/* Shift the lookahead token. */
715
fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
718
/* Discard the token being shifted unless it is eof. */
727
/* count tokens shifted since error; after three, turn off error status. */
728
if (yyerrstatus) yyerrstatus--;
733
/* Do the default action for the current state. */
736
yyn = yydefact[yystate];
740
/* Do a reduction. yyn is the number of a rule to reduce with. */
744
yyval = yyvsp[1-yylen]; /* implement default value of the action */
751
fprintf (stderr, "Reducing via rule %d (line %d), ",
754
/* Print the symbols being reduced, and their result. */
755
for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
756
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
757
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
765
#line 129 "po-gram-gen.y"
767
po_callback_domain (yyvsp[0].string.string);
771
#line 136 "po-gram-gen.y"
773
check_obsolete (yyvsp[-3].pos, yyvsp[-2].string);
774
check_obsolete (yyvsp[-3].pos, yyvsp[-1].pos);
775
check_obsolete (yyvsp[-3].pos, yyvsp[0].string);
776
if (!yyvsp[-3].pos.obsolete || pass_obsolete_entries)
777
po_callback_message (yyvsp[-2].string.string, &yyvsp[-3].pos.pos, NULL,
778
yyvsp[0].string.string, strlen (yyvsp[0].string.string) + 1, &yyvsp[-1].pos.pos);
781
free (yyvsp[-2].string.string);
782
free (yyvsp[0].string.string);
787
#line 150 "po-gram-gen.y"
789
check_obsolete (yyvsp[-3].pos, yyvsp[-2].string);
790
check_obsolete (yyvsp[-3].pos, yyvsp[-1].string);
791
check_obsolete (yyvsp[-3].pos, yyvsp[0].rhs);
792
if (!yyvsp[-3].pos.obsolete || pass_obsolete_entries)
793
po_callback_message (yyvsp[-2].string.string, &yyvsp[-3].pos.pos, yyvsp[-1].string.string,
794
yyvsp[0].rhs.rhs.msgstr, yyvsp[0].rhs.rhs.msgstr_len, &yyvsp[0].rhs.pos);
797
free (yyvsp[-2].string.string);
798
free (yyvsp[-1].string.string);
799
free (yyvsp[0].rhs.rhs.msgstr);
804
#line 165 "po-gram-gen.y"
806
check_obsolete (yyvsp[-2].pos, yyvsp[-1].string);
807
check_obsolete (yyvsp[-2].pos, yyvsp[0].string);
808
po_gram_error_at_line (&yyvsp[-2].pos.pos, _("missing `msgstr[]' section"));
809
free (yyvsp[-1].string.string);
810
free (yyvsp[0].string.string);
814
#line 173 "po-gram-gen.y"
816
check_obsolete (yyvsp[-2].pos, yyvsp[-1].string);
817
check_obsolete (yyvsp[-2].pos, yyvsp[0].rhs);
818
po_gram_error_at_line (&yyvsp[-2].pos.pos, _("missing `msgid_plural' section"));
819
free (yyvsp[-1].string.string);
820
free (yyvsp[0].rhs.rhs.msgstr);
824
#line 181 "po-gram-gen.y"
826
check_obsolete (yyvsp[-1].pos, yyvsp[0].string);
827
po_gram_error_at_line (&yyvsp[-1].pos.pos, _("missing `msgstr' section"));
828
free (yyvsp[0].string.string);
832
#line 190 "po-gram-gen.y"
834
check_obsolete (yyvsp[-1].pos, yyvsp[0].string);
836
yyval.string.string = yyvsp[0].string.string;
837
yyval.string.pos = yyvsp[-1].pos.pos;
838
yyval.string.obsolete = yyvsp[-1].pos.obsolete;
842
#line 201 "po-gram-gen.y"
844
yyval.rhs = yyvsp[0].rhs;
848
#line 205 "po-gram-gen.y"
850
check_obsolete (yyvsp[-1].rhs, yyvsp[0].rhs);
851
yyval.rhs.rhs.msgstr = (char *) xmalloc (yyvsp[-1].rhs.rhs.msgstr_len + yyvsp[0].rhs.rhs.msgstr_len);
852
memcpy (yyval.rhs.rhs.msgstr, yyvsp[-1].rhs.rhs.msgstr, yyvsp[-1].rhs.rhs.msgstr_len);
853
memcpy (yyval.rhs.rhs.msgstr + yyvsp[-1].rhs.rhs.msgstr_len, yyvsp[0].rhs.rhs.msgstr, yyvsp[0].rhs.rhs.msgstr_len);
854
yyval.rhs.rhs.msgstr_len = yyvsp[-1].rhs.rhs.msgstr_len + yyvsp[0].rhs.rhs.msgstr_len;
855
free (yyvsp[-1].rhs.rhs.msgstr);
856
free (yyvsp[0].rhs.rhs.msgstr);
857
yyval.rhs.pos = yyvsp[-1].rhs.pos;
858
yyval.rhs.obsolete = yyvsp[-1].rhs.obsolete;
862
#line 220 "po-gram-gen.y"
864
check_obsolete (yyvsp[-4].pos, yyvsp[-3].pos);
865
check_obsolete (yyvsp[-4].pos, yyvsp[-2].number);
866
check_obsolete (yyvsp[-4].pos, yyvsp[-1].pos);
867
check_obsolete (yyvsp[-4].pos, yyvsp[0].string);
868
if (yyvsp[-2].number.number != plural_counter)
870
if (plural_counter == 0)
871
po_gram_error_at_line (&yyvsp[-4].pos.pos, _("first plural form has nonzero index"));
873
po_gram_error_at_line (&yyvsp[-4].pos.pos, _("plural form has wrong index"));
876
yyval.rhs.rhs.msgstr = yyvsp[0].string.string;
877
yyval.rhs.rhs.msgstr_len = strlen (yyvsp[0].string.string) + 1;
878
yyval.rhs.pos = yyvsp[-4].pos.pos;
879
yyval.rhs.obsolete = yyvsp[-4].pos.obsolete;
883
#line 242 "po-gram-gen.y"
885
yyval.string = yyvsp[0].string;
889
#line 246 "po-gram-gen.y"
894
check_obsolete (yyvsp[-1].string, yyvsp[0].string);
895
len1 = strlen (yyvsp[-1].string.string);
896
len2 = strlen (yyvsp[0].string.string);
897
yyval.string.string = (char *) xmalloc (len1 + len2 + 1);
898
stpcpy (stpcpy (yyval.string.string, yyvsp[-1].string.string), yyvsp[0].string.string);
899
free (yyvsp[-1].string.string);
900
free (yyvsp[0].string.string);
901
yyval.string.pos = yyvsp[-1].string.pos;
902
yyval.string.obsolete = yyvsp[-1].string.obsolete;
906
#line 264 "po-gram-gen.y"
908
po_callback_comment (yyvsp[0].string.string);
912
/* the action file gets copied in in place of this dollarsign */
913
#line 543 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple"
924
short *ssp1 = yyss - 1;
925
fprintf (stderr, "state stack now");
926
while (ssp1 != yyssp)
927
fprintf (stderr, " %d", *++ssp1);
928
fprintf (stderr, "\n");
938
yylsp->first_line = yylloc.first_line;
939
yylsp->first_column = yylloc.first_column;
940
yylsp->last_line = (yylsp-1)->last_line;
941
yylsp->last_column = (yylsp-1)->last_column;
946
yylsp->last_line = (yylsp+yylen-1)->last_line;
947
yylsp->last_column = (yylsp+yylen-1)->last_column;
951
/* Now "shift" the result of the reduction.
952
Determine what state that goes to,
953
based on the state we popped back to
954
and the rule number reduced by. */
958
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
959
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
960
yystate = yytable[yystate];
962
yystate = yydefgoto[yyn - YYNTBASE];
966
yyerrlab: /* here on detecting error */
969
/* If not already recovering from an error, report this error. */
973
#ifdef YYERROR_VERBOSE
974
yyn = yypact[yystate];
976
if (yyn > YYFLAG && yyn < YYLAST)
983
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
984
for (x = (yyn < 0 ? -yyn : 0);
985
x < (sizeof(yytname) / sizeof(char *)); x++)
986
if (yycheck[x + yyn] == x)
987
size += strlen(yytname[x]) + 15, count++;
988
msg = (char *) malloc(size + 15);
991
strcpy(msg, "parse error");
996
for (x = (yyn < 0 ? -yyn : 0);
997
x < (sizeof(yytname) / sizeof(char *)); x++)
998
if (yycheck[x + yyn] == x)
1000
strcat(msg, count == 0 ? ", expecting `" : " or `");
1001
strcat(msg, yytname[x]);
1010
yyerror ("parse error; also virtual memory exceeded");
1013
#endif /* YYERROR_VERBOSE */
1014
yyerror("parse error");
1018
yyerrlab1: /* here on error raised explicitly by an action */
1020
if (yyerrstatus == 3)
1022
/* if just tried and failed to reuse lookahead token after an error, discard it. */
1024
/* return failure if at end of input */
1025
if (yychar == YYEOF)
1030
fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1036
/* Else will try to reuse lookahead token
1037
after shifting the error token. */
1039
yyerrstatus = 3; /* Each real token shifted decrements this */
1043
yyerrdefault: /* current state does not do anything special for the error token. */
1046
/* This is wrong; only states that explicitly want error tokens
1047
should shift them. */
1048
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1049
if (yyn) goto yydefault;
1052
yyerrpop: /* pop the current state because it cannot handle the error token */
1054
if (yyssp == yyss) YYABORT;
1064
short *ssp1 = yyss - 1;
1065
fprintf (stderr, "Error: state stack now");
1066
while (ssp1 != yyssp)
1067
fprintf (stderr, " %d", *++ssp1);
1068
fprintf (stderr, "\n");
1074
yyn = yypact[yystate];
1079
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1098
fprintf(stderr, "Shifting error token, ");
1110
/* YYACCEPT comes here. */
1122
/* YYABORT comes here. */
1133
#line 268 "po-gram-gen.y"