/src/gettext-0.26/gettext-tools/src/read-po-gram.c
Line | Count | Source |
1 | | /* A Bison parser, made by GNU Bison 3.8.2. */ |
2 | | |
3 | | /* Bison implementation for Yacc-like parsers in C |
4 | | |
5 | | Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, |
6 | | Inc. |
7 | | |
8 | | This program is free software: you can redistribute it and/or modify |
9 | | it under the terms of the GNU General Public License as published by |
10 | | the Free Software Foundation, either version 3 of the License, or |
11 | | (at your option) any later version. |
12 | | |
13 | | This program is distributed in the hope that it will be useful, |
14 | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | | GNU General Public License for more details. |
17 | | |
18 | | You should have received a copy of the GNU General Public License |
19 | | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
20 | | |
21 | | /* As a special exception, you may create a larger work that contains |
22 | | part or all of the Bison parser skeleton and distribute that work |
23 | | under terms of your choice, so long as that work isn't itself a |
24 | | parser generator using the skeleton or a modified version thereof |
25 | | as a parser skeleton. Alternatively, if you modify or redistribute |
26 | | the parser skeleton itself, you may (at your option) remove this |
27 | | special exception, which will cause the skeleton and the resulting |
28 | | Bison output files to be licensed under the GNU General Public |
29 | | License without this special exception. |
30 | | |
31 | | This special exception was added by the Free Software Foundation in |
32 | | version 2.2 of Bison. */ |
33 | | |
34 | | /* C LALR(1) parser skeleton written by Richard Stallman, by |
35 | | simplifying the original so-called "semantic" parser. */ |
36 | | |
37 | | /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, |
38 | | especially those whose name start with YY_ or yy_. They are |
39 | | private implementation details that can be changed or removed. */ |
40 | | |
41 | | /* All symbols defined below should begin with yy or YY, to avoid |
42 | | infringing on user name space. This should be done even for local |
43 | | variables, as they might otherwise be expanded by user macros. |
44 | | There are some unavoidable exceptions within include files to |
45 | | define necessary library symbols; they are noted "INFRINGES ON |
46 | | USER NAME SPACE" below. */ |
47 | | |
48 | | /* Identify Bison output, and Bison version. */ |
49 | | #define YYBISON 30802 |
50 | | |
51 | | /* Bison version string. */ |
52 | | #define YYBISON_VERSION "3.8.2" |
53 | | |
54 | | /* Skeleton name. */ |
55 | | #define YYSKELETON_NAME "yacc.c" |
56 | | |
57 | | /* Pure parsers. */ |
58 | | #define YYPURE 2 |
59 | | |
60 | | /* Push parsers. */ |
61 | | #define YYPUSH 0 |
62 | | |
63 | | /* Pull parsers. */ |
64 | | #define YYPULL 1 |
65 | | |
66 | | /* Substitute the type names. */ |
67 | 42.7k | #define YYSTYPE PO_GRAM_STYPE |
68 | | /* Substitute the variable and function names. */ |
69 | | #define yyparse po_gram_parse |
70 | 40.2M | #define yylex po_gram_lex |
71 | 131k | #define yyerror po_gram_error |
72 | | #define yydebug po_gram_debug |
73 | 131k | #define yynerrs po_gram_nerrs |
74 | | |
75 | | /* First part of user prologue. */ |
76 | | #line 19 "read-po-gram.y" |
77 | | |
78 | | #ifdef HAVE_CONFIG_H |
79 | | # include "config.h" |
80 | | #endif |
81 | | |
82 | | /* Specification. */ |
83 | | #include "read-po-internal.h" |
84 | | |
85 | | #include <stdbool.h> |
86 | | #include <stdio.h> |
87 | | #include <stdlib.h> |
88 | | #include <string.h> |
89 | | |
90 | | #include <error.h> |
91 | | #include "str-list.h" |
92 | | #include "read-po-lex.h" |
93 | | #include "po-charset.h" |
94 | | #include "xalloc.h" |
95 | | #include "gettext.h" |
96 | | #include "read-catalog-abstract.h" |
97 | | |
98 | 43.0k | #define _(str) gettext (str) |
99 | | |
100 | | #define check_obsolete(value1,value2) \ |
101 | 388k | if ((value1).obsolete != (value2).obsolete) \ |
102 | 388k | po_gram_error_at_line (ps->catr, &(value2).pos, \ |
103 | 6.28k | _("inconsistent use of #~")); |
104 | | |
105 | | static inline void |
106 | | do_callback_message (struct po_parser_state *ps, |
107 | | char *msgctxt, |
108 | | char *msgid, lex_pos_ty *msgid_pos, char *msgid_plural, |
109 | | char *msgstr, size_t msgstr_len, lex_pos_ty *msgstr_pos, |
110 | | char *prev_msgctxt, |
111 | | char *prev_msgid, char *prev_msgid_plural, |
112 | | bool obsolete) |
113 | 65.4k | { |
114 | | /* Test for header entry. Ignore fuzziness of the header entry. */ |
115 | 65.4k | if (msgctxt == NULL && msgid[0] == '\0' && !obsolete) |
116 | 33.5k | po_lex_charset_set (ps, msgstr, ps->gram_pos.file_name, ps->gram_pot_role); |
117 | | |
118 | 65.4k | catalog_reader_seen_message (ps->catr, |
119 | 65.4k | msgctxt, |
120 | 65.4k | msgid, msgid_pos, msgid_plural, |
121 | 65.4k | msgstr, msgstr_len, msgstr_pos, |
122 | 65.4k | prev_msgctxt, prev_msgid, prev_msgid_plural, |
123 | 65.4k | false, obsolete); |
124 | 65.4k | } |
125 | | |
126 | | #define free_message_intro(value) \ |
127 | 36.7k | if ((value).prev_ctxt != NULL) \ |
128 | 36.7k | free ((value).prev_ctxt); \ |
129 | 36.7k | if ((value).prev_id != NULL) \ |
130 | 36.7k | free ((value).prev_id); \ |
131 | 36.7k | if ((value).prev_id_plural != NULL) \ |
132 | 36.7k | free ((value).prev_id_plural); \ |
133 | 36.7k | if ((value).ctxt != NULL) \ |
134 | 36.7k | free ((value).ctxt); |
135 | | |
136 | | |
137 | | #line 138 "read-po-gram.c" |
138 | | |
139 | | # ifndef YY_CAST |
140 | | # ifdef __cplusplus |
141 | | # define YY_CAST(Type, Val) static_cast<Type> (Val) |
142 | | # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val) |
143 | | # else |
144 | 161M | # define YY_CAST(Type, Val) ((Type) (Val)) |
145 | | # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) |
146 | | # endif |
147 | | # endif |
148 | | # ifndef YY_NULLPTR |
149 | | # if defined __cplusplus |
150 | | # if 201103L <= __cplusplus |
151 | | # define YY_NULLPTR nullptr |
152 | | # else |
153 | | # define YY_NULLPTR 0 |
154 | | # endif |
155 | | # else |
156 | | # define YY_NULLPTR ((void*)0) |
157 | | # endif |
158 | | # endif |
159 | | |
160 | | #include "read-po-gram.h" |
161 | | /* Symbol kind. */ |
162 | | enum yysymbol_kind_t |
163 | | { |
164 | | YYSYMBOL_YYEMPTY = -2, |
165 | | YYSYMBOL_YYEOF = 0, /* "end of file" */ |
166 | | YYSYMBOL_YYerror = 1, /* error */ |
167 | | YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ |
168 | | YYSYMBOL_COMMENT = 3, /* COMMENT */ |
169 | | YYSYMBOL_DOMAIN = 4, /* DOMAIN */ |
170 | | YYSYMBOL_JUNK = 5, /* JUNK */ |
171 | | YYSYMBOL_PREV_MSGCTXT = 6, /* PREV_MSGCTXT */ |
172 | | YYSYMBOL_PREV_MSGID = 7, /* PREV_MSGID */ |
173 | | YYSYMBOL_PREV_MSGID_PLURAL = 8, /* PREV_MSGID_PLURAL */ |
174 | | YYSYMBOL_PREV_STRING = 9, /* PREV_STRING */ |
175 | | YYSYMBOL_MSGCTXT = 10, /* MSGCTXT */ |
176 | | YYSYMBOL_MSGID = 11, /* MSGID */ |
177 | | YYSYMBOL_MSGID_PLURAL = 12, /* MSGID_PLURAL */ |
178 | | YYSYMBOL_MSGSTR = 13, /* MSGSTR */ |
179 | | YYSYMBOL_NAME = 14, /* NAME */ |
180 | | YYSYMBOL_15_ = 15, /* '[' */ |
181 | | YYSYMBOL_16_ = 16, /* ']' */ |
182 | | YYSYMBOL_NUMBER = 17, /* NUMBER */ |
183 | | YYSYMBOL_STRING = 18, /* STRING */ |
184 | | YYSYMBOL_YYACCEPT = 19, /* $accept */ |
185 | | YYSYMBOL_po_file = 20, /* po_file */ |
186 | | YYSYMBOL_comment = 21, /* comment */ |
187 | | YYSYMBOL_domain = 22, /* domain */ |
188 | | YYSYMBOL_message = 23, /* message */ |
189 | | YYSYMBOL_message_intro = 24, /* message_intro */ |
190 | | YYSYMBOL_prev = 25, /* prev */ |
191 | | YYSYMBOL_msg_intro = 26, /* msg_intro */ |
192 | | YYSYMBOL_prev_msg_intro = 27, /* prev_msg_intro */ |
193 | | YYSYMBOL_msgid_pluralform = 28, /* msgid_pluralform */ |
194 | | YYSYMBOL_prev_msgid_pluralform = 29, /* prev_msgid_pluralform */ |
195 | | YYSYMBOL_pluralform_list = 30, /* pluralform_list */ |
196 | | YYSYMBOL_pluralform = 31, /* pluralform */ |
197 | | YYSYMBOL_string_list = 32, /* string_list */ |
198 | | YYSYMBOL_prev_string_list = 33 /* prev_string_list */ |
199 | | }; |
200 | | typedef enum yysymbol_kind_t yysymbol_kind_t; |
201 | | |
202 | | |
203 | | |
204 | | |
205 | | #ifdef short |
206 | | # undef short |
207 | | #endif |
208 | | |
209 | | /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure |
210 | | <limits.h> and (if available) <stdint.h> are included |
211 | | so that the code can choose integer types of a good width. */ |
212 | | |
213 | | #ifndef __PTRDIFF_MAX__ |
214 | | # include <limits.h> /* INFRINGES ON USER NAME SPACE */ |
215 | | # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ |
216 | | # include <stdint.h> /* INFRINGES ON USER NAME SPACE */ |
217 | | # define YY_STDINT_H |
218 | | # endif |
219 | | #endif |
220 | | |
221 | | /* Narrow types that promote to a signed type and that can represent a |
222 | | signed or unsigned integer of at least N bits. In tables they can |
223 | | save space and decrease cache pressure. Promoting to a signed type |
224 | | helps avoid bugs in integer arithmetic. */ |
225 | | |
226 | | #ifdef __INT_LEAST8_MAX__ |
227 | | typedef __INT_LEAST8_TYPE__ yytype_int8; |
228 | | #elif defined YY_STDINT_H |
229 | | typedef int_least8_t yytype_int8; |
230 | | #else |
231 | | typedef signed char yytype_int8; |
232 | | #endif |
233 | | |
234 | | #ifdef __INT_LEAST16_MAX__ |
235 | | typedef __INT_LEAST16_TYPE__ yytype_int16; |
236 | | #elif defined YY_STDINT_H |
237 | | typedef int_least16_t yytype_int16; |
238 | | #else |
239 | | typedef short yytype_int16; |
240 | | #endif |
241 | | |
242 | | /* Work around bug in HP-UX 11.23, which defines these macros |
243 | | incorrectly for preprocessor constants. This workaround can likely |
244 | | be removed in 2023, as HPE has promised support for HP-UX 11.23 |
245 | | (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of |
246 | | <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ |
247 | | #ifdef __hpux |
248 | | # undef UINT_LEAST8_MAX |
249 | | # undef UINT_LEAST16_MAX |
250 | | # define UINT_LEAST8_MAX 255 |
251 | | # define UINT_LEAST16_MAX 65535 |
252 | | #endif |
253 | | |
254 | | #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ |
255 | | typedef __UINT_LEAST8_TYPE__ yytype_uint8; |
256 | | #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ |
257 | | && UINT_LEAST8_MAX <= INT_MAX) |
258 | | typedef uint_least8_t yytype_uint8; |
259 | | #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX |
260 | | typedef unsigned char yytype_uint8; |
261 | | #else |
262 | | typedef short yytype_uint8; |
263 | | #endif |
264 | | |
265 | | #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ |
266 | | typedef __UINT_LEAST16_TYPE__ yytype_uint16; |
267 | | #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ |
268 | | && UINT_LEAST16_MAX <= INT_MAX) |
269 | | typedef uint_least16_t yytype_uint16; |
270 | | #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX |
271 | | typedef unsigned short yytype_uint16; |
272 | | #else |
273 | | typedef int yytype_uint16; |
274 | | #endif |
275 | | |
276 | | #ifndef YYPTRDIFF_T |
277 | | # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ |
278 | 8.54k | # define YYPTRDIFF_T __PTRDIFF_TYPE__ |
279 | | # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ |
280 | | # elif defined PTRDIFF_MAX |
281 | | # ifndef ptrdiff_t |
282 | | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
283 | | # endif |
284 | | # define YYPTRDIFF_T ptrdiff_t |
285 | | # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX |
286 | | # else |
287 | | # define YYPTRDIFF_T long |
288 | | # define YYPTRDIFF_MAXIMUM LONG_MAX |
289 | | # endif |
290 | | #endif |
291 | | |
292 | | #ifndef YYSIZE_T |
293 | | # ifdef __SIZE_TYPE__ |
294 | | # define YYSIZE_T __SIZE_TYPE__ |
295 | | # elif defined size_t |
296 | | # define YYSIZE_T size_t |
297 | | # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ |
298 | | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
299 | | # define YYSIZE_T size_t |
300 | | # else |
301 | | # define YYSIZE_T unsigned |
302 | | # endif |
303 | | #endif |
304 | | |
305 | | #define YYSIZE_MAXIMUM \ |
306 | | YY_CAST (YYPTRDIFF_T, \ |
307 | | (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ |
308 | | ? YYPTRDIFF_MAXIMUM \ |
309 | | : YY_CAST (YYSIZE_T, -1))) |
310 | | |
311 | 0 | #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) |
312 | | |
313 | | |
314 | | /* Stored state numbers (used for stacks). */ |
315 | | typedef yytype_int8 yy_state_t; |
316 | | |
317 | | /* State numbers in computations. */ |
318 | | typedef int yy_state_fast_t; |
319 | | |
320 | | #ifndef YY_ |
321 | | # if defined YYENABLE_NLS && YYENABLE_NLS |
322 | | # if ENABLE_NLS |
323 | | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
324 | 131k | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
325 | | # endif |
326 | | # endif |
327 | | # ifndef YY_ |
328 | | # define YY_(Msgid) Msgid |
329 | | # endif |
330 | | #endif |
331 | | |
332 | | |
333 | | #ifndef YY_ATTRIBUTE_PURE |
334 | | # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) |
335 | | # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) |
336 | | # else |
337 | | # define YY_ATTRIBUTE_PURE |
338 | | # endif |
339 | | #endif |
340 | | |
341 | | #ifndef YY_ATTRIBUTE_UNUSED |
342 | | # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) |
343 | | # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) |
344 | | # else |
345 | | # define YY_ATTRIBUTE_UNUSED |
346 | | # endif |
347 | | #endif |
348 | | |
349 | | /* Suppress unused-variable warnings by "using" E. */ |
350 | | #if ! defined lint || defined __GNUC__ |
351 | 116M | # define YY_USE(E) ((void) (E)) |
352 | | #else |
353 | | # define YY_USE(E) /* empty */ |
354 | | #endif |
355 | | |
356 | | /* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
357 | | #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ |
358 | | # if __GNUC__ * 100 + __GNUC_MINOR__ < 407 |
359 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
360 | | _Pragma ("GCC diagnostic push") \ |
361 | | _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") |
362 | | # else |
363 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
364 | | _Pragma ("GCC diagnostic push") \ |
365 | | _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ |
366 | | _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
367 | | # endif |
368 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ |
369 | | _Pragma ("GCC diagnostic pop") |
370 | | #else |
371 | 17.0k | # define YY_INITIAL_VALUE(Value) Value |
372 | | #endif |
373 | | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
374 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
375 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_END |
376 | | #endif |
377 | | #ifndef YY_INITIAL_VALUE |
378 | | # define YY_INITIAL_VALUE(Value) /* Nothing. */ |
379 | | #endif |
380 | | |
381 | | #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ |
382 | | # define YY_IGNORE_USELESS_CAST_BEGIN \ |
383 | | _Pragma ("GCC diagnostic push") \ |
384 | | _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") |
385 | | # define YY_IGNORE_USELESS_CAST_END \ |
386 | | _Pragma ("GCC diagnostic pop") |
387 | | #endif |
388 | | #ifndef YY_IGNORE_USELESS_CAST_BEGIN |
389 | | # define YY_IGNORE_USELESS_CAST_BEGIN |
390 | | # define YY_IGNORE_USELESS_CAST_END |
391 | | #endif |
392 | | |
393 | | |
394 | 82.0M | #define YY_ASSERT(E) ((void) (0 && (E))) |
395 | | |
396 | | #if !defined yyoverflow |
397 | | |
398 | | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
399 | | |
400 | | # ifdef YYSTACK_USE_ALLOCA |
401 | | # if YYSTACK_USE_ALLOCA |
402 | | # ifdef __GNUC__ |
403 | | # define YYSTACK_ALLOC __builtin_alloca |
404 | | # elif defined __BUILTIN_VA_ARG_INCR |
405 | | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
406 | | # elif defined _AIX |
407 | | # define YYSTACK_ALLOC __alloca |
408 | | # elif defined _MSC_VER |
409 | | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
410 | | # define alloca _alloca |
411 | | # else |
412 | | # define YYSTACK_ALLOC alloca |
413 | | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS |
414 | | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
415 | | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
416 | | # ifndef EXIT_SUCCESS |
417 | | # define EXIT_SUCCESS 0 |
418 | | # endif |
419 | | # endif |
420 | | # endif |
421 | | # endif |
422 | | # endif |
423 | | |
424 | | # ifdef YYSTACK_ALLOC |
425 | | /* Pacify GCC's 'empty if-body' warning. */ |
426 | | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) |
427 | | # ifndef YYSTACK_ALLOC_MAXIMUM |
428 | | /* The OS might guarantee only one guard page at the bottom of the stack, |
429 | | and a page size can be as small as 4096 bytes. So we cannot safely |
430 | | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
431 | | to allow for a few compiler-allocated temporary stack slots. */ |
432 | | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
433 | | # endif |
434 | | # else |
435 | | # define YYSTACK_ALLOC YYMALLOC |
436 | 0 | # define YYSTACK_FREE YYFREE |
437 | | # ifndef YYSTACK_ALLOC_MAXIMUM |
438 | | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
439 | | # endif |
440 | | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
441 | | && ! ((defined YYMALLOC || defined malloc) \ |
442 | | && (defined YYFREE || defined free))) |
443 | | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
444 | | # ifndef EXIT_SUCCESS |
445 | | # define EXIT_SUCCESS 0 |
446 | | # endif |
447 | | # endif |
448 | | # ifndef YYMALLOC |
449 | | # define YYMALLOC malloc |
450 | | # if ! defined malloc && ! defined EXIT_SUCCESS |
451 | | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
452 | | # endif |
453 | | # endif |
454 | | # ifndef YYFREE |
455 | 0 | # define YYFREE free |
456 | | # if ! defined free && ! defined EXIT_SUCCESS |
457 | | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
458 | | # endif |
459 | | # endif |
460 | | # endif |
461 | | #endif /* !defined yyoverflow */ |
462 | | |
463 | | #if (! defined yyoverflow \ |
464 | | && (! defined __cplusplus \ |
465 | | || (defined PO_GRAM_STYPE_IS_TRIVIAL && PO_GRAM_STYPE_IS_TRIVIAL))) |
466 | | |
467 | | /* A type that is properly aligned for any stack member. */ |
468 | | union yyalloc |
469 | | { |
470 | | yy_state_t yyss_alloc; |
471 | | YYSTYPE yyvs_alloc; |
472 | | }; |
473 | | |
474 | | /* The size of the maximum gap between one aligned stack and the next. */ |
475 | 0 | # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) |
476 | | |
477 | | /* The size of an array large to enough to hold all stacks, each with |
478 | | N elements. */ |
479 | | # define YYSTACK_BYTES(N) \ |
480 | | ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ |
481 | | + YYSTACK_GAP_MAXIMUM) |
482 | | |
483 | | # define YYCOPY_NEEDED 1 |
484 | | |
485 | | /* Relocate STACK from its old location to the new one. The |
486 | | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
487 | | elements in the stack, and YYPTR gives the new location of the |
488 | | stack. Advance YYPTR to a properly aligned location for the next |
489 | | stack. */ |
490 | | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
491 | 0 | do \ |
492 | 0 | { \ |
493 | 0 | YYPTRDIFF_T yynewbytes; \ |
494 | 0 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
495 | 0 | Stack = &yyptr->Stack_alloc; \ |
496 | 0 | yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
497 | 0 | yyptr += yynewbytes / YYSIZEOF (*yyptr); \ |
498 | 0 | } \ |
499 | 0 | while (0) |
500 | | |
501 | | #endif |
502 | | |
503 | | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
504 | | /* Copy COUNT objects from SRC to DST. The source and destination do |
505 | | not overlap. */ |
506 | | # ifndef YYCOPY |
507 | | # if defined __GNUC__ && 1 < __GNUC__ |
508 | | # define YYCOPY(Dst, Src, Count) \ |
509 | 0 | __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) |
510 | | # else |
511 | | # define YYCOPY(Dst, Src, Count) \ |
512 | | do \ |
513 | | { \ |
514 | | YYPTRDIFF_T yyi; \ |
515 | | for (yyi = 0; yyi < (Count); yyi++) \ |
516 | | (Dst)[yyi] = (Src)[yyi]; \ |
517 | | } \ |
518 | | while (0) |
519 | | # endif |
520 | | # endif |
521 | | #endif /* !YYCOPY_NEEDED */ |
522 | | |
523 | | /* YYFINAL -- State number of the termination state. */ |
524 | 82.0M | #define YYFINAL 2 |
525 | | /* YYLAST -- Last index in YYTABLE. */ |
526 | 160M | #define YYLAST 40 |
527 | | |
528 | | /* YYNTOKENS -- Number of terminals. */ |
529 | 41.5M | #define YYNTOKENS 19 |
530 | | /* YYNNTS -- Number of nonterminals. */ |
531 | | #define YYNNTS 15 |
532 | | /* YYNRULES -- Number of rules. */ |
533 | | #define YYNRULES 30 |
534 | | /* YYNSTATES -- Number of states. */ |
535 | | #define YYNSTATES 46 |
536 | | |
537 | | /* YYMAXUTOK -- Last valid token kind. */ |
538 | 79.7M | #define YYMAXUTOK 271 |
539 | | |
540 | | |
541 | | /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM |
542 | | as returned by yylex, with out-of-bounds checking. */ |
543 | | #define YYTRANSLATE(YYX) \ |
544 | 118M | (0 <= (YYX) && (YYX) <= YYMAXUTOK \ |
545 | 118M | ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ |
546 | 118M | : YYSYMBOL_YYUNDEF) |
547 | | |
548 | | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
549 | | as returned by yylex. */ |
550 | | static const yytype_int8 yytranslate[] = |
551 | | { |
552 | | 0, 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, 15, 2, 16, 2, 2, 2, 2, 2, 2, |
562 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
563 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
564 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
565 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
566 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
567 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
568 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
569 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
570 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
571 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
572 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
573 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
574 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
575 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
576 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
577 | | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
578 | | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
579 | | 17, 18 |
580 | | }; |
581 | | |
582 | | #if PO_GRAM_DEBUG |
583 | | /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
584 | | static const yytype_int16 yyrline[] = |
585 | | { |
586 | | 0, 133, 133, 134, 135, 136, 137, 142, 150, 159, |
587 | | 180, 201, 210, 219, 230, 239, 253, 262, 276, 282, |
588 | | 293, 299, 311, 322, 333, 337, 352, 375, 383, 395, |
589 | | 403 |
590 | | }; |
591 | | #endif |
592 | | |
593 | | /** Accessing symbol of state STATE. */ |
594 | 41.0k | #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) |
595 | | |
596 | | #if PO_GRAM_DEBUG || 0 |
597 | | /* The user-facing name of the symbol whose (internal) number is |
598 | | YYSYMBOL. No bounds checking. */ |
599 | | static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; |
600 | | |
601 | | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
602 | | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
603 | | static const char *const yytname[] = |
604 | | { |
605 | | "\"end of file\"", "error", "\"invalid token\"", "COMMENT", "DOMAIN", |
606 | | "JUNK", "PREV_MSGCTXT", "PREV_MSGID", "PREV_MSGID_PLURAL", "PREV_STRING", |
607 | | "MSGCTXT", "MSGID", "MSGID_PLURAL", "MSGSTR", "NAME", "'['", "']'", |
608 | | "NUMBER", "STRING", "$accept", "po_file", "comment", "domain", "message", |
609 | | "message_intro", "prev", "msg_intro", "prev_msg_intro", |
610 | | "msgid_pluralform", "prev_msgid_pluralform", "pluralform_list", |
611 | | "pluralform", "string_list", "prev_string_list", YY_NULLPTR |
612 | | }; |
613 | | |
614 | | static const char * |
615 | | yysymbol_name (yysymbol_kind_t yysymbol) |
616 | | { |
617 | | return yytname[yysymbol]; |
618 | | } |
619 | | #endif |
620 | | |
621 | 121M | #define YYPACT_NINF (-26) |
622 | | |
623 | | #define yypact_value_is_default(Yyn) \ |
624 | 121M | ((Yyn) == YYPACT_NINF) |
625 | | |
626 | | #define YYTABLE_NINF (-1) |
627 | | |
628 | | #define yytable_value_is_error(Yyn) \ |
629 | 0 | 0 |
630 | | |
631 | | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
632 | | STATE-NUM. */ |
633 | | static const yytype_int8 yypact[] = |
634 | | { |
635 | | -26, 2, -26, -26, -26, -8, 5, -26, 0, -26, |
636 | | -26, -26, -26, 0, 13, -26, 5, -26, -26, 20, |
637 | | -26, -7, 8, -26, 24, -26, -26, -26, -26, 0, |
638 | | 7, 15, 15, -26, 5, -26, 12, 17, 12, 21, |
639 | | 15, -26, 26, 22, 0, 12 |
640 | | }; |
641 | | |
642 | | /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. |
643 | | Performed when YYTABLE does not specify something else to do. Zero |
644 | | means the default is an error. */ |
645 | | static const yytype_int8 yydefact[] = |
646 | | { |
647 | | 2, 0, 1, 6, 7, 0, 0, 20, 0, 18, |
648 | | 3, 4, 5, 0, 0, 14, 0, 8, 29, 0, |
649 | | 27, 0, 13, 15, 16, 21, 30, 19, 28, 0, |
650 | | 0, 11, 12, 24, 0, 17, 22, 0, 9, 0, |
651 | | 10, 25, 23, 0, 0, 26 |
652 | | }; |
653 | | |
654 | | /* YYPGOTO[NTERM-NUM]. */ |
655 | | static const yytype_int8 yypgoto[] = |
656 | | { |
657 | | -26, -26, -26, -26, -26, -26, -26, 23, -26, -26, |
658 | | -26, 9, -25, -13, -15 |
659 | | }; |
660 | | |
661 | | /* YYDEFGOTO[NTERM-NUM]. */ |
662 | | static const yytype_int8 yydefgoto[] = |
663 | | { |
664 | | 0, 1, 10, 11, 12, 13, 14, 15, 16, 31, |
665 | | 35, 32, 33, 21, 19 |
666 | | }; |
667 | | |
668 | | /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If |
669 | | positive, shift that token. If negative, reduce the rule whose |
670 | | number is the opposite. If YYTABLE_NINF, syntax error. */ |
671 | | static const yytype_int8 yytable[] = |
672 | | { |
673 | | 22, 24, 2, 3, 27, 4, 5, 41, 6, 7, |
674 | | 17, 28, 8, 9, 18, 41, 36, 38, 20, 42, |
675 | | 29, 30, 37, 8, 9, 20, 28, 25, 39, 26, |
676 | | 28, 45, 34, 26, 43, 26, 37, 23, 44, 0, |
677 | | 40 |
678 | | }; |
679 | | |
680 | | static const yytype_int8 yycheck[] = |
681 | | { |
682 | | 13, 16, 0, 1, 11, 3, 4, 32, 6, 7, |
683 | | 18, 18, 10, 11, 9, 40, 29, 30, 18, 34, |
684 | | 12, 13, 15, 10, 11, 18, 18, 7, 13, 9, |
685 | | 18, 44, 8, 9, 17, 9, 15, 14, 16, -1, |
686 | | 31 |
687 | | }; |
688 | | |
689 | | /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of |
690 | | state STATE-NUM. */ |
691 | | static const yytype_int8 yystos[] = |
692 | | { |
693 | | 0, 20, 0, 1, 3, 4, 6, 7, 10, 11, |
694 | | 21, 22, 23, 24, 25, 26, 27, 18, 9, 33, |
695 | | 18, 32, 32, 26, 33, 7, 9, 11, 18, 12, |
696 | | 13, 28, 30, 31, 8, 29, 32, 15, 32, 13, |
697 | | 30, 31, 33, 17, 16, 32 |
698 | | }; |
699 | | |
700 | | /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ |
701 | | static const yytype_int8 yyr1[] = |
702 | | { |
703 | | 0, 19, 20, 20, 20, 20, 20, 21, 22, 23, |
704 | | 23, 23, 23, 23, 24, 24, 25, 25, 26, 26, |
705 | | 27, 27, 28, 29, 30, 30, 31, 32, 32, 33, |
706 | | 33 |
707 | | }; |
708 | | |
709 | | /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ |
710 | | static const yytype_int8 yyr2[] = |
711 | | { |
712 | | 0, 2, 0, 2, 2, 2, 2, 1, 2, 4, |
713 | | 4, 3, 3, 2, 1, 2, 2, 3, 1, 3, |
714 | | 1, 3, 2, 2, 1, 2, 5, 1, 2, 1, |
715 | | 2 |
716 | | }; |
717 | | |
718 | | |
719 | | enum { YYENOMEM = -2 }; |
720 | | |
721 | | #define yyerrok (yyerrstatus = 0) |
722 | | #define yyclearin (yychar = PO_GRAM_EMPTY) |
723 | | |
724 | 8.54k | #define YYACCEPT goto yyacceptlab |
725 | 0 | #define YYABORT goto yyabortlab |
726 | 0 | #define YYERROR goto yyerrorlab |
727 | 0 | #define YYNOMEM goto yyexhaustedlab |
728 | | |
729 | | |
730 | | #define YYRECOVERING() (!!yyerrstatus) |
731 | | |
732 | | #define YYBACKUP(Token, Value) \ |
733 | | do \ |
734 | | if (yychar == PO_GRAM_EMPTY) \ |
735 | | { \ |
736 | | yychar = (Token); \ |
737 | | yylval = (Value); \ |
738 | | YYPOPSTACK (yylen); \ |
739 | | yystate = *yyssp; \ |
740 | | goto yybackup; \ |
741 | | } \ |
742 | | else \ |
743 | | { \ |
744 | | yyerror (ps, YY_("syntax error: cannot back up")); \ |
745 | | YYERROR; \ |
746 | | } \ |
747 | | while (0) |
748 | | |
749 | | /* Backward compatibility with an undocumented macro. |
750 | | Use PO_GRAM_error or PO_GRAM_UNDEF. */ |
751 | | #define YYERRCODE PO_GRAM_UNDEF |
752 | | |
753 | | |
754 | | /* Enable debugging if requested. */ |
755 | | #if PO_GRAM_DEBUG |
756 | | |
757 | | # ifndef YYFPRINTF |
758 | | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
759 | | # define YYFPRINTF fprintf |
760 | | # endif |
761 | | |
762 | | # define YYDPRINTF(Args) \ |
763 | | do { \ |
764 | | if (yydebug) \ |
765 | | YYFPRINTF Args; \ |
766 | | } while (0) |
767 | | |
768 | | |
769 | | |
770 | | |
771 | | # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ |
772 | | do { \ |
773 | | if (yydebug) \ |
774 | | { \ |
775 | | YYFPRINTF (stderr, "%s ", Title); \ |
776 | | yy_symbol_print (stderr, \ |
777 | | Kind, Value, ps); \ |
778 | | YYFPRINTF (stderr, "\n"); \ |
779 | | } \ |
780 | | } while (0) |
781 | | |
782 | | |
783 | | /*-----------------------------------. |
784 | | | Print this symbol's value on YYO. | |
785 | | `-----------------------------------*/ |
786 | | |
787 | | static void |
788 | | yy_symbol_value_print (FILE *yyo, |
789 | | yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, struct po_parser_state *ps) |
790 | | { |
791 | | FILE *yyoutput = yyo; |
792 | | YY_USE (yyoutput); |
793 | | YY_USE (ps); |
794 | | if (!yyvaluep) |
795 | | return; |
796 | | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
797 | | YY_USE (yykind); |
798 | | YY_IGNORE_MAYBE_UNINITIALIZED_END |
799 | | } |
800 | | |
801 | | |
802 | | /*---------------------------. |
803 | | | Print this symbol on YYO. | |
804 | | `---------------------------*/ |
805 | | |
806 | | static void |
807 | | yy_symbol_print (FILE *yyo, |
808 | | yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, struct po_parser_state *ps) |
809 | | { |
810 | | YYFPRINTF (yyo, "%s %s (", |
811 | | yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); |
812 | | |
813 | | yy_symbol_value_print (yyo, yykind, yyvaluep, ps); |
814 | | YYFPRINTF (yyo, ")"); |
815 | | } |
816 | | |
817 | | /*------------------------------------------------------------------. |
818 | | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
819 | | | TOP (included). | |
820 | | `------------------------------------------------------------------*/ |
821 | | |
822 | | static void |
823 | | yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) |
824 | | { |
825 | | YYFPRINTF (stderr, "Stack now"); |
826 | | for (; yybottom <= yytop; yybottom++) |
827 | | { |
828 | | int yybot = *yybottom; |
829 | | YYFPRINTF (stderr, " %d", yybot); |
830 | | } |
831 | | YYFPRINTF (stderr, "\n"); |
832 | | } |
833 | | |
834 | | # define YY_STACK_PRINT(Bottom, Top) \ |
835 | | do { \ |
836 | | if (yydebug) \ |
837 | | yy_stack_print ((Bottom), (Top)); \ |
838 | | } while (0) |
839 | | |
840 | | |
841 | | /*------------------------------------------------. |
842 | | | Report that the YYRULE is going to be reduced. | |
843 | | `------------------------------------------------*/ |
844 | | |
845 | | static void |
846 | | yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, |
847 | | int yyrule, struct po_parser_state *ps) |
848 | | { |
849 | | int yylno = yyrline[yyrule]; |
850 | | int yynrhs = yyr2[yyrule]; |
851 | | int yyi; |
852 | | YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", |
853 | | yyrule - 1, yylno); |
854 | | /* The symbols being reduced. */ |
855 | | for (yyi = 0; yyi < yynrhs; yyi++) |
856 | | { |
857 | | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
858 | | yy_symbol_print (stderr, |
859 | | YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), |
860 | | &yyvsp[(yyi + 1) - (yynrhs)], ps); |
861 | | YYFPRINTF (stderr, "\n"); |
862 | | } |
863 | | } |
864 | | |
865 | | # define YY_REDUCE_PRINT(Rule) \ |
866 | | do { \ |
867 | | if (yydebug) \ |
868 | | yy_reduce_print (yyssp, yyvsp, Rule, ps); \ |
869 | | } while (0) |
870 | | |
871 | | /* Nonzero means print parse trace. It is left uninitialized so that |
872 | | multiple parsers can coexist. */ |
873 | | int yydebug; |
874 | | #else /* !PO_GRAM_DEBUG */ |
875 | 122M | # define YYDPRINTF(Args) ((void) 0) |
876 | | # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) |
877 | | # define YY_STACK_PRINT(Bottom, Top) |
878 | | # define YY_REDUCE_PRINT(Rule) |
879 | | #endif /* !PO_GRAM_DEBUG */ |
880 | | |
881 | | |
882 | | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
883 | | #ifndef YYINITDEPTH |
884 | 8.54k | # define YYINITDEPTH 200 |
885 | | #endif |
886 | | |
887 | | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
888 | | if the built-in stack extension method is used). |
889 | | |
890 | | Do not make this value too large; the results are undefined if |
891 | | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
892 | | evaluated with infinite-precision integer arithmetic. */ |
893 | | |
894 | | #ifndef YYMAXDEPTH |
895 | 0 | # define YYMAXDEPTH 10000 |
896 | | #endif |
897 | | |
898 | | |
899 | | |
900 | | |
901 | | |
902 | | |
903 | | /*-----------------------------------------------. |
904 | | | Release the memory associated to this symbol. | |
905 | | `-----------------------------------------------*/ |
906 | | |
907 | | static void |
908 | | yydestruct (const char *yymsg, |
909 | | yysymbol_kind_t yykind, YYSTYPE *yyvaluep, struct po_parser_state *ps) |
910 | 38.9M | { |
911 | 38.9M | YY_USE (yyvaluep); |
912 | 38.9M | YY_USE (ps); |
913 | 38.9M | if (!yymsg) |
914 | 0 | yymsg = "Deleting"; |
915 | 38.9M | YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); |
916 | | |
917 | 38.9M | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
918 | 38.9M | YY_USE (yykind); |
919 | 38.9M | YY_IGNORE_MAYBE_UNINITIALIZED_END |
920 | 38.9M | } |
921 | | |
922 | | |
923 | | |
924 | | |
925 | | |
926 | | |
927 | | /*----------. |
928 | | | yyparse. | |
929 | | `----------*/ |
930 | | |
931 | | int |
932 | | yyparse (struct po_parser_state *ps) |
933 | 8.54k | { |
934 | | /* Lookahead token kind. */ |
935 | 8.54k | int yychar; |
936 | | |
937 | | |
938 | | /* The semantic value of the lookahead symbol. */ |
939 | | /* Default value used for initialization, for pacifying older GCCs |
940 | | or non-GCC compilers. */ |
941 | 8.54k | YY_INITIAL_VALUE (static YYSTYPE yyval_default;) |
942 | 8.54k | YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); |
943 | | |
944 | | /* Number of syntax errors so far. */ |
945 | 8.54k | int yynerrs = 0; |
946 | | |
947 | 8.54k | yy_state_fast_t yystate = 0; |
948 | | /* Number of tokens to shift before error messages enabled. */ |
949 | 8.54k | int yyerrstatus = 0; |
950 | | |
951 | | /* Refer to the stacks through separate pointers, to allow yyoverflow |
952 | | to reallocate them elsewhere. */ |
953 | | |
954 | | /* Their size. */ |
955 | 8.54k | YYPTRDIFF_T yystacksize = YYINITDEPTH; |
956 | | |
957 | | /* The state stack: array, bottom, top. */ |
958 | 8.54k | yy_state_t yyssa[YYINITDEPTH]; |
959 | 8.54k | yy_state_t *yyss = yyssa; |
960 | 8.54k | yy_state_t *yyssp = yyss; |
961 | | |
962 | | /* The semantic value stack: array, bottom, top. */ |
963 | 8.54k | YYSTYPE yyvsa[YYINITDEPTH]; |
964 | 8.54k | YYSTYPE *yyvs = yyvsa; |
965 | 8.54k | YYSTYPE *yyvsp = yyvs; |
966 | | |
967 | 8.54k | int yyn; |
968 | | /* The return value of yyparse. */ |
969 | 8.54k | int yyresult; |
970 | | /* Lookahead symbol kind. */ |
971 | 8.54k | yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; |
972 | | /* The variables used to return semantic value and location from the |
973 | | action routines. */ |
974 | 8.54k | YYSTYPE yyval; |
975 | | |
976 | | |
977 | | |
978 | 41.5M | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
979 | | |
980 | | /* The number of symbols on the RHS of the reduced rule. |
981 | | Keep to zero when no symbol should be popped. */ |
982 | 8.54k | int yylen = 0; |
983 | | |
984 | 8.54k | YYDPRINTF ((stderr, "Starting parse\n")); |
985 | | |
986 | 8.54k | yychar = PO_GRAM_EMPTY; /* Cause a token to be read. */ |
987 | | |
988 | 8.54k | goto yysetstate; |
989 | | |
990 | | |
991 | | /*------------------------------------------------------------. |
992 | | | yynewstate -- push a new state, which is found in yystate. | |
993 | | `------------------------------------------------------------*/ |
994 | 82.0M | yynewstate: |
995 | | /* In all cases, when you get here, the value and location stacks |
996 | | have just been pushed. So pushing a state here evens the stacks. */ |
997 | 82.0M | yyssp++; |
998 | | |
999 | | |
1000 | | /*--------------------------------------------------------------------. |
1001 | | | yysetstate -- set current state (the top of the stack) to yystate. | |
1002 | | `--------------------------------------------------------------------*/ |
1003 | 82.0M | yysetstate: |
1004 | 82.0M | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
1005 | 82.0M | YY_ASSERT (0 <= yystate && yystate < YYNSTATES); |
1006 | 82.0M | YY_IGNORE_USELESS_CAST_BEGIN |
1007 | 82.0M | *yyssp = YY_CAST (yy_state_t, yystate); |
1008 | 82.0M | YY_IGNORE_USELESS_CAST_END |
1009 | 82.0M | YY_STACK_PRINT (yyss, yyssp); |
1010 | | |
1011 | 82.0M | if (yyss + yystacksize - 1 <= yyssp) |
1012 | | #if !defined yyoverflow && !defined YYSTACK_RELOCATE |
1013 | | YYNOMEM; |
1014 | | #else |
1015 | 0 | { |
1016 | | /* Get the current used size of the three stacks, in elements. */ |
1017 | 0 | YYPTRDIFF_T yysize = yyssp - yyss + 1; |
1018 | |
|
1019 | | # if defined yyoverflow |
1020 | | { |
1021 | | /* Give user a chance to reallocate the stack. Use copies of |
1022 | | these so that the &'s don't force the real ones into |
1023 | | memory. */ |
1024 | | yy_state_t *yyss1 = yyss; |
1025 | | YYSTYPE *yyvs1 = yyvs; |
1026 | | |
1027 | | /* Each stack pointer address is followed by the size of the |
1028 | | data in use in that stack, in bytes. This used to be a |
1029 | | conditional around just the two extra args, but that might |
1030 | | be undefined if yyoverflow is a macro. */ |
1031 | | yyoverflow (YY_("memory exhausted"), |
1032 | | &yyss1, yysize * YYSIZEOF (*yyssp), |
1033 | | &yyvs1, yysize * YYSIZEOF (*yyvsp), |
1034 | | &yystacksize); |
1035 | | yyss = yyss1; |
1036 | | yyvs = yyvs1; |
1037 | | } |
1038 | | # else /* defined YYSTACK_RELOCATE */ |
1039 | | /* Extend the stack our own way. */ |
1040 | 0 | if (YYMAXDEPTH <= yystacksize) |
1041 | 0 | YYNOMEM; |
1042 | 0 | yystacksize *= 2; |
1043 | 0 | if (YYMAXDEPTH < yystacksize) |
1044 | 0 | yystacksize = YYMAXDEPTH; |
1045 | |
|
1046 | 0 | { |
1047 | 0 | yy_state_t *yyss1 = yyss; |
1048 | 0 | union yyalloc *yyptr = |
1049 | 0 | YY_CAST (union yyalloc *, |
1050 | 0 | YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); |
1051 | 0 | if (! yyptr) |
1052 | 0 | YYNOMEM; |
1053 | 0 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
1054 | 0 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
1055 | 0 | # undef YYSTACK_RELOCATE |
1056 | 0 | if (yyss1 != yyssa) |
1057 | 0 | YYSTACK_FREE (yyss1); |
1058 | 0 | } |
1059 | 0 | # endif |
1060 | | |
1061 | 0 | yyssp = yyss + yysize - 1; |
1062 | 0 | yyvsp = yyvs + yysize - 1; |
1063 | |
|
1064 | 0 | YY_IGNORE_USELESS_CAST_BEGIN |
1065 | 0 | YYDPRINTF ((stderr, "Stack size increased to %ld\n", |
1066 | 0 | YY_CAST (long, yystacksize))); |
1067 | 0 | YY_IGNORE_USELESS_CAST_END |
1068 | |
|
1069 | 0 | if (yyss + yystacksize - 1 <= yyssp) |
1070 | 0 | YYABORT; |
1071 | 0 | } |
1072 | 82.0M | #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ |
1073 | | |
1074 | | |
1075 | 82.0M | if (yystate == YYFINAL) |
1076 | 8.54k | YYACCEPT; |
1077 | | |
1078 | 82.0M | goto yybackup; |
1079 | | |
1080 | | |
1081 | | /*-----------. |
1082 | | | yybackup. | |
1083 | | `-----------*/ |
1084 | 82.0M | yybackup: |
1085 | | /* Do appropriate processing given the current state. Read a |
1086 | | lookahead token if we need one and don't already have one. */ |
1087 | | |
1088 | | /* First try to decide what to do without reference to lookahead token. */ |
1089 | 82.0M | yyn = yypact[yystate]; |
1090 | 82.0M | if (yypact_value_is_default (yyn)) |
1091 | 41.4M | goto yydefault; |
1092 | | |
1093 | | /* Not known => get a lookahead token if don't already have one. */ |
1094 | | |
1095 | | /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ |
1096 | 40.6M | if (yychar == PO_GRAM_EMPTY) |
1097 | 40.2M | { |
1098 | 40.2M | YYDPRINTF ((stderr, "Reading a token\n")); |
1099 | 40.2M | yychar = yylex (&yylval, ps); |
1100 | 40.2M | } |
1101 | | |
1102 | 40.6M | if (yychar <= PO_GRAM_EOF) |
1103 | 9.35k | { |
1104 | 9.35k | yychar = PO_GRAM_EOF; |
1105 | 9.35k | yytoken = YYSYMBOL_YYEOF; |
1106 | 9.35k | YYDPRINTF ((stderr, "Now at end of input.\n")); |
1107 | 9.35k | } |
1108 | 40.5M | else if (yychar == PO_GRAM_error) |
1109 | 0 | { |
1110 | | /* The scanner already issued an error message, process directly |
1111 | | to error recovery. But do not keep the error token as |
1112 | | lookahead, it is too special and may lead us to an endless |
1113 | | loop in error recovery. */ |
1114 | 0 | yychar = PO_GRAM_UNDEF; |
1115 | 0 | yytoken = YYSYMBOL_YYerror; |
1116 | 0 | goto yyerrlab1; |
1117 | 0 | } |
1118 | 40.5M | else |
1119 | 40.5M | { |
1120 | 40.5M | yytoken = YYTRANSLATE (yychar); |
1121 | 40.5M | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
1122 | 40.5M | } |
1123 | | |
1124 | | /* If the proper action on seeing token YYTOKEN is to reduce or to |
1125 | | detect an error, take that action. */ |
1126 | 40.6M | yyn += yytoken; |
1127 | 40.6M | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
1128 | 39.2M | goto yydefault; |
1129 | 1.31M | yyn = yytable[yyn]; |
1130 | 1.31M | if (yyn <= 0) |
1131 | 0 | { |
1132 | 0 | if (yytable_value_is_error (yyn)) |
1133 | 0 | goto yyerrlab; |
1134 | 0 | yyn = -yyn; |
1135 | 0 | goto yyreduce; |
1136 | 0 | } |
1137 | | |
1138 | | /* Count tokens shifted since error; after three, turn off error |
1139 | | status. */ |
1140 | 1.31M | if (yyerrstatus) |
1141 | 552k | yyerrstatus--; |
1142 | | |
1143 | | /* Shift the lookahead token. */ |
1144 | 1.31M | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
1145 | 1.31M | yystate = yyn; |
1146 | 1.31M | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1147 | 1.31M | *++yyvsp = yylval; |
1148 | 1.31M | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1149 | | |
1150 | | /* Discard the shifted token. */ |
1151 | 1.31M | yychar = PO_GRAM_EMPTY; |
1152 | 1.31M | goto yynewstate; |
1153 | | |
1154 | | |
1155 | | /*-----------------------------------------------------------. |
1156 | | | yydefault -- do the default action for the current state. | |
1157 | | `-----------------------------------------------------------*/ |
1158 | 80.6M | yydefault: |
1159 | 80.6M | yyn = yydefact[yystate]; |
1160 | 80.6M | if (yyn == 0) |
1161 | 39.1M | goto yyerrlab; |
1162 | 41.5M | goto yyreduce; |
1163 | | |
1164 | | |
1165 | | /*-----------------------------. |
1166 | | | yyreduce -- do a reduction. | |
1167 | | `-----------------------------*/ |
1168 | 41.5M | yyreduce: |
1169 | | /* yyn is the number of a rule to reduce with. */ |
1170 | 41.5M | yylen = yyr2[yyn]; |
1171 | | |
1172 | | /* If YYLEN is nonzero, implement the default value of the action: |
1173 | | '$$ = $1'. |
1174 | | |
1175 | | Otherwise, the following line sets YYVAL to garbage. |
1176 | | This behavior is undocumented and Bison |
1177 | | users should not rely upon it. Assigning to YYVAL |
1178 | | unconditionally makes the parser a bit smaller, and it avoids a |
1179 | | GCC warning that YYVAL may be used uninitialized. */ |
1180 | 41.5M | yyval = yyvsp[1-yylen]; |
1181 | | |
1182 | | |
1183 | 41.5M | YY_REDUCE_PRINT (yyn); |
1184 | 41.5M | switch (yyn) |
1185 | 41.5M | { |
1186 | 783k | case 7: /* comment: COMMENT */ |
1187 | 783k | #line 143 "read-po-gram.y" |
1188 | 783k | { |
1189 | 783k | catalog_reader_seen_generic_comment (ps->catr, (yyvsp[0].string).string); |
1190 | 783k | } |
1191 | 783k | #line 1192 "read-po-gram.c" |
1192 | 783k | break; |
1193 | | |
1194 | 4.37k | case 8: /* domain: DOMAIN STRING */ |
1195 | 4.37k | #line 151 "read-po-gram.y" |
1196 | 4.37k | { |
1197 | 4.37k | catalog_reader_seen_domain (ps->catr, (yyvsp[0].string).string, |
1198 | 4.37k | &ps->gram_pos); |
1199 | 4.37k | } |
1200 | 4.37k | #line 1201 "read-po-gram.c" |
1201 | 4.37k | break; |
1202 | | |
1203 | 65.4k | case 9: /* message: message_intro string_list MSGSTR string_list */ |
1204 | 65.4k | #line 160 "read-po-gram.y" |
1205 | 65.4k | { |
1206 | 65.4k | char *string2 = string_list_concat_destroy (&(yyvsp[-2].stringlist).stringlist); |
1207 | 65.4k | char *string4 = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist); |
1208 | | |
1209 | 65.4k | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-2].stringlist)); |
1210 | 65.4k | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-1].pos)); |
1211 | 65.4k | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[0].stringlist)); |
1212 | 65.4k | if (!(yyvsp[-3].message_intro).obsolete || ps->catr->pass_obsolete_entries) |
1213 | 65.4k | do_callback_message (ps, (yyvsp[-3].message_intro).ctxt, string2, &(yyvsp[-3].message_intro).pos, NULL, |
1214 | 65.4k | string4, strlen (string4) + 1, &(yyvsp[-1].pos).pos, |
1215 | 65.4k | (yyvsp[-3].message_intro).prev_ctxt, |
1216 | 65.4k | (yyvsp[-3].message_intro).prev_id, (yyvsp[-3].message_intro).prev_id_plural, |
1217 | 65.4k | (yyvsp[-3].message_intro).obsolete); |
1218 | 0 | else |
1219 | 0 | { |
1220 | 0 | free_message_intro ((yyvsp[-3].message_intro)); |
1221 | 0 | free (string2); |
1222 | 0 | free (string4); |
1223 | 0 | } |
1224 | 65.4k | } |
1225 | 65.4k | #line 1226 "read-po-gram.c" |
1226 | 65.4k | break; |
1227 | | |
1228 | 0 | case 10: /* message: message_intro string_list msgid_pluralform pluralform_list */ |
1229 | 0 | #line 181 "read-po-gram.y" |
1230 | 0 | { |
1231 | 0 | char *string2 = string_list_concat_destroy (&(yyvsp[-2].stringlist).stringlist); |
1232 | |
|
1233 | 0 | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-2].stringlist)); |
1234 | 0 | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-1].string)); |
1235 | 0 | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[0].rhs)); |
1236 | 0 | if (!(yyvsp[-3].message_intro).obsolete || ps->catr->pass_obsolete_entries) |
1237 | 0 | do_callback_message (ps, (yyvsp[-3].message_intro).ctxt, string2, &(yyvsp[-3].message_intro).pos, (yyvsp[-1].string).string, |
1238 | 0 | (yyvsp[0].rhs).rhs.msgstr, (yyvsp[0].rhs).rhs.msgstr_len, &(yyvsp[0].rhs).pos, |
1239 | 0 | (yyvsp[-3].message_intro).prev_ctxt, |
1240 | 0 | (yyvsp[-3].message_intro).prev_id, (yyvsp[-3].message_intro).prev_id_plural, |
1241 | 0 | (yyvsp[-3].message_intro).obsolete); |
1242 | 0 | else |
1243 | 0 | { |
1244 | 0 | free_message_intro ((yyvsp[-3].message_intro)); |
1245 | 0 | free (string2); |
1246 | 0 | free ((yyvsp[-1].string).string); |
1247 | 0 | free ((yyvsp[0].rhs).rhs.msgstr); |
1248 | 0 | } |
1249 | 0 | } |
1250 | 0 | #line 1251 "read-po-gram.c" |
1251 | 0 | break; |
1252 | | |
1253 | 3.02k | case 11: /* message: message_intro string_list msgid_pluralform */ |
1254 | 3.02k | #line 202 "read-po-gram.y" |
1255 | 3.02k | { |
1256 | 3.02k | check_obsolete ((yyvsp[-2].message_intro), (yyvsp[-1].stringlist)); |
1257 | 3.02k | check_obsolete ((yyvsp[-2].message_intro), (yyvsp[0].string)); |
1258 | 3.02k | po_gram_error_at_line (ps->catr, &(yyvsp[-2].message_intro).pos, _("missing 'msgstr[]' section")); |
1259 | 3.02k | free_message_intro ((yyvsp[-2].message_intro)); |
1260 | 3.02k | string_list_destroy (&(yyvsp[-1].stringlist).stringlist); |
1261 | 3.02k | free ((yyvsp[0].string).string); |
1262 | 3.02k | } |
1263 | 3.02k | #line 1264 "read-po-gram.c" |
1264 | 3.02k | break; |
1265 | | |
1266 | 0 | case 12: /* message: message_intro string_list pluralform_list */ |
1267 | 0 | #line 211 "read-po-gram.y" |
1268 | 0 | { |
1269 | 0 | check_obsolete ((yyvsp[-2].message_intro), (yyvsp[-1].stringlist)); |
1270 | 0 | check_obsolete ((yyvsp[-2].message_intro), (yyvsp[0].rhs)); |
1271 | 0 | po_gram_error_at_line (ps->catr, &(yyvsp[-2].message_intro).pos, _("missing 'msgid_plural' section")); |
1272 | 0 | free_message_intro ((yyvsp[-2].message_intro)); |
1273 | 0 | string_list_destroy (&(yyvsp[-1].stringlist).stringlist); |
1274 | 0 | free ((yyvsp[0].rhs).rhs.msgstr); |
1275 | 0 | } |
1276 | 0 | #line 1277 "read-po-gram.c" |
1277 | 0 | break; |
1278 | | |
1279 | 33.7k | case 13: /* message: message_intro string_list */ |
1280 | 33.7k | #line 220 "read-po-gram.y" |
1281 | 33.7k | { |
1282 | 33.7k | check_obsolete ((yyvsp[-1].message_intro), (yyvsp[0].stringlist)); |
1283 | 33.7k | po_gram_error_at_line (ps->catr, &(yyvsp[-1].message_intro).pos, _("missing 'msgstr' section")); |
1284 | 33.7k | free_message_intro ((yyvsp[-1].message_intro)); |
1285 | 33.7k | string_list_destroy (&(yyvsp[0].stringlist).stringlist); |
1286 | 33.7k | } |
1287 | 33.7k | #line 1288 "read-po-gram.c" |
1288 | 33.7k | break; |
1289 | | |
1290 | 108k | case 14: /* message_intro: msg_intro */ |
1291 | 108k | #line 231 "read-po-gram.y" |
1292 | 108k | { |
1293 | 108k | (yyval.message_intro).prev_ctxt = NULL; |
1294 | 108k | (yyval.message_intro).prev_id = NULL; |
1295 | 108k | (yyval.message_intro).prev_id_plural = NULL; |
1296 | 108k | (yyval.message_intro).ctxt = (yyvsp[0].string).string; |
1297 | 108k | (yyval.message_intro).pos = (yyvsp[0].string).pos; |
1298 | 108k | (yyval.message_intro).obsolete = (yyvsp[0].string).obsolete; |
1299 | 108k | } |
1300 | 108k | #line 1301 "read-po-gram.c" |
1301 | 108k | break; |
1302 | | |
1303 | 1.54k | case 15: /* message_intro: prev msg_intro */ |
1304 | 1.54k | #line 240 "read-po-gram.y" |
1305 | 1.54k | { |
1306 | 1.54k | check_obsolete ((yyvsp[-1].prev), (yyvsp[0].string)); |
1307 | 1.54k | (yyval.message_intro).prev_ctxt = (yyvsp[-1].prev).ctxt; |
1308 | 1.54k | (yyval.message_intro).prev_id = (yyvsp[-1].prev).id; |
1309 | 1.54k | (yyval.message_intro).prev_id_plural = (yyvsp[-1].prev).id_plural; |
1310 | 1.54k | (yyval.message_intro).ctxt = (yyvsp[0].string).string; |
1311 | 1.54k | (yyval.message_intro).pos = (yyvsp[0].string).pos; |
1312 | 1.54k | (yyval.message_intro).obsolete = (yyvsp[0].string).obsolete; |
1313 | 1.54k | } |
1314 | 1.54k | #line 1315 "read-po-gram.c" |
1315 | 1.54k | break; |
1316 | | |
1317 | 4.15k | case 16: /* prev: prev_msg_intro prev_string_list */ |
1318 | 4.15k | #line 254 "read-po-gram.y" |
1319 | 4.15k | { |
1320 | 4.15k | check_obsolete ((yyvsp[-1].string), (yyvsp[0].stringlist)); |
1321 | 4.15k | (yyval.prev).ctxt = (yyvsp[-1].string).string; |
1322 | 4.15k | (yyval.prev).id = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist); |
1323 | 4.15k | (yyval.prev).id_plural = NULL; |
1324 | 4.15k | (yyval.prev).pos = (yyvsp[-1].string).pos; |
1325 | 4.15k | (yyval.prev).obsolete = (yyvsp[-1].string).obsolete; |
1326 | 4.15k | } |
1327 | 4.15k | #line 1328 "read-po-gram.c" |
1328 | 4.15k | break; |
1329 | | |
1330 | 73 | case 17: /* prev: prev_msg_intro prev_string_list prev_msgid_pluralform */ |
1331 | 73 | #line 263 "read-po-gram.y" |
1332 | 73 | { |
1333 | 73 | check_obsolete ((yyvsp[-2].string), (yyvsp[-1].stringlist)); |
1334 | 73 | check_obsolete ((yyvsp[-2].string), (yyvsp[0].string)); |
1335 | 73 | (yyval.prev).ctxt = (yyvsp[-2].string).string; |
1336 | 73 | (yyval.prev).id = string_list_concat_destroy (&(yyvsp[-1].stringlist).stringlist); |
1337 | 73 | (yyval.prev).id_plural = (yyvsp[0].string).string; |
1338 | 73 | (yyval.prev).pos = (yyvsp[-2].string).pos; |
1339 | 73 | (yyval.prev).obsolete = (yyvsp[-2].string).obsolete; |
1340 | 73 | } |
1341 | 73 | #line 1342 "read-po-gram.c" |
1342 | 73 | break; |
1343 | | |
1344 | 101k | case 18: /* msg_intro: MSGID */ |
1345 | 101k | #line 277 "read-po-gram.y" |
1346 | 101k | { |
1347 | 101k | (yyval.string).string = NULL; |
1348 | 101k | (yyval.string).pos = (yyvsp[0].pos).pos; |
1349 | 101k | (yyval.string).obsolete = (yyvsp[0].pos).obsolete; |
1350 | 101k | } |
1351 | 101k | #line 1352 "read-po-gram.c" |
1352 | 101k | break; |
1353 | | |
1354 | 8.15k | case 19: /* msg_intro: MSGCTXT string_list MSGID */ |
1355 | 8.15k | #line 283 "read-po-gram.y" |
1356 | 8.15k | { |
1357 | 8.15k | check_obsolete ((yyvsp[-2].pos), (yyvsp[-1].stringlist)); |
1358 | 8.15k | check_obsolete ((yyvsp[-2].pos), (yyvsp[0].pos)); |
1359 | 8.15k | (yyval.string).string = string_list_concat_destroy (&(yyvsp[-1].stringlist).stringlist); |
1360 | 8.15k | (yyval.string).pos = (yyvsp[0].pos).pos; |
1361 | 8.15k | (yyval.string).obsolete = (yyvsp[0].pos).obsolete; |
1362 | 8.15k | } |
1363 | 8.15k | #line 1364 "read-po-gram.c" |
1364 | 8.15k | break; |
1365 | | |
1366 | 4.29k | case 20: /* prev_msg_intro: PREV_MSGID */ |
1367 | 4.29k | #line 294 "read-po-gram.y" |
1368 | 4.29k | { |
1369 | 4.29k | (yyval.string).string = NULL; |
1370 | 4.29k | (yyval.string).pos = (yyvsp[0].pos).pos; |
1371 | 4.29k | (yyval.string).obsolete = (yyvsp[0].pos).obsolete; |
1372 | 4.29k | } |
1373 | 4.29k | #line 1374 "read-po-gram.c" |
1374 | 4.29k | break; |
1375 | | |
1376 | 1.99k | case 21: /* prev_msg_intro: PREV_MSGCTXT prev_string_list PREV_MSGID */ |
1377 | 1.99k | #line 300 "read-po-gram.y" |
1378 | 1.99k | { |
1379 | 1.99k | check_obsolete ((yyvsp[-2].pos), (yyvsp[-1].stringlist)); |
1380 | 1.99k | check_obsolete ((yyvsp[-2].pos), (yyvsp[0].pos)); |
1381 | 1.99k | (yyval.string).string = string_list_concat_destroy (&(yyvsp[-1].stringlist).stringlist); |
1382 | 1.99k | (yyval.string).pos = (yyvsp[0].pos).pos; |
1383 | 1.99k | (yyval.string).obsolete = (yyvsp[0].pos).obsolete; |
1384 | 1.99k | } |
1385 | 1.99k | #line 1386 "read-po-gram.c" |
1386 | 1.99k | break; |
1387 | | |
1388 | 3.02k | case 22: /* msgid_pluralform: MSGID_PLURAL string_list */ |
1389 | 3.02k | #line 312 "read-po-gram.y" |
1390 | 3.02k | { |
1391 | 3.02k | check_obsolete ((yyvsp[-1].pos), (yyvsp[0].stringlist)); |
1392 | 3.02k | ps->plural_counter = 0; |
1393 | 3.02k | (yyval.string).string = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist); |
1394 | 3.02k | (yyval.string).pos = (yyvsp[-1].pos).pos; |
1395 | 3.02k | (yyval.string).obsolete = (yyvsp[-1].pos).obsolete; |
1396 | 3.02k | } |
1397 | 3.02k | #line 1398 "read-po-gram.c" |
1398 | 3.02k | break; |
1399 | | |
1400 | 73 | case 23: /* prev_msgid_pluralform: PREV_MSGID_PLURAL prev_string_list */ |
1401 | 73 | #line 323 "read-po-gram.y" |
1402 | 73 | { |
1403 | 73 | check_obsolete ((yyvsp[-1].pos), (yyvsp[0].stringlist)); |
1404 | 73 | (yyval.string).string = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist); |
1405 | 73 | (yyval.string).pos = (yyvsp[-1].pos).pos; |
1406 | 73 | (yyval.string).obsolete = (yyvsp[-1].pos).obsolete; |
1407 | 73 | } |
1408 | 73 | #line 1409 "read-po-gram.c" |
1409 | 73 | break; |
1410 | | |
1411 | 0 | case 24: /* pluralform_list: pluralform */ |
1412 | 0 | #line 334 "read-po-gram.y" |
1413 | 0 | { |
1414 | 0 | (yyval.rhs) = (yyvsp[0].rhs); |
1415 | 0 | } |
1416 | 0 | #line 1417 "read-po-gram.c" |
1417 | 0 | break; |
1418 | | |
1419 | 0 | case 25: /* pluralform_list: pluralform_list pluralform */ |
1420 | 0 | #line 338 "read-po-gram.y" |
1421 | 0 | { |
1422 | 0 | check_obsolete ((yyvsp[-1].rhs), (yyvsp[0].rhs)); |
1423 | 0 | (yyval.rhs).rhs.msgstr = XNMALLOC ((yyvsp[-1].rhs).rhs.msgstr_len + (yyvsp[0].rhs).rhs.msgstr_len, char); |
1424 | 0 | memcpy ((yyval.rhs).rhs.msgstr, (yyvsp[-1].rhs).rhs.msgstr, (yyvsp[-1].rhs).rhs.msgstr_len); |
1425 | 0 | memcpy ((yyval.rhs).rhs.msgstr + (yyvsp[-1].rhs).rhs.msgstr_len, (yyvsp[0].rhs).rhs.msgstr, (yyvsp[0].rhs).rhs.msgstr_len); |
1426 | 0 | (yyval.rhs).rhs.msgstr_len = (yyvsp[-1].rhs).rhs.msgstr_len + (yyvsp[0].rhs).rhs.msgstr_len; |
1427 | 0 | free ((yyvsp[-1].rhs).rhs.msgstr); |
1428 | 0 | free ((yyvsp[0].rhs).rhs.msgstr); |
1429 | 0 | (yyval.rhs).pos = (yyvsp[-1].rhs).pos; |
1430 | 0 | (yyval.rhs).obsolete = (yyvsp[-1].rhs).obsolete; |
1431 | 0 | } |
1432 | 0 | #line 1433 "read-po-gram.c" |
1433 | 0 | break; |
1434 | | |
1435 | 0 | case 26: /* pluralform: MSGSTR '[' NUMBER ']' string_list */ |
1436 | 0 | #line 353 "read-po-gram.y" |
1437 | 0 | { |
1438 | 0 | check_obsolete ((yyvsp[-4].pos), (yyvsp[-3].pos)); |
1439 | 0 | check_obsolete ((yyvsp[-4].pos), (yyvsp[-2].number)); |
1440 | 0 | check_obsolete ((yyvsp[-4].pos), (yyvsp[-1].pos)); |
1441 | 0 | check_obsolete ((yyvsp[-4].pos), (yyvsp[0].stringlist)); |
1442 | 0 | if ((yyvsp[-2].number).number != ps->plural_counter) |
1443 | 0 | { |
1444 | 0 | if (ps->plural_counter == 0) |
1445 | 0 | po_gram_error_at_line (ps->catr, &(yyvsp[-4].pos).pos, _("first plural form has nonzero index")); |
1446 | 0 | else |
1447 | 0 | po_gram_error_at_line (ps->catr, &(yyvsp[-4].pos).pos, _("plural form has wrong index")); |
1448 | 0 | } |
1449 | 0 | ps->plural_counter++; |
1450 | 0 | (yyval.rhs).rhs.msgstr = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist); |
1451 | 0 | (yyval.rhs).rhs.msgstr_len = strlen ((yyval.rhs).rhs.msgstr) + 1; |
1452 | 0 | (yyval.rhs).pos = (yyvsp[-4].pos).pos; |
1453 | 0 | (yyval.rhs).obsolete = (yyvsp[-4].pos).obsolete; |
1454 | 0 | } |
1455 | 0 | #line 1456 "read-po-gram.c" |
1456 | 0 | break; |
1457 | | |
1458 | 183k | case 27: /* string_list: STRING */ |
1459 | 183k | #line 376 "read-po-gram.y" |
1460 | 183k | { |
1461 | 183k | string_list_init (&(yyval.stringlist).stringlist); |
1462 | 183k | string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string); |
1463 | 183k | free ((yyvsp[0].string).string); |
1464 | 183k | (yyval.stringlist).pos = (yyvsp[0].string).pos; |
1465 | 183k | (yyval.stringlist).obsolete = (yyvsp[0].string).obsolete; |
1466 | 183k | } |
1467 | 183k | #line 1468 "read-po-gram.c" |
1468 | 183k | break; |
1469 | | |
1470 | 123k | case 28: /* string_list: string_list STRING */ |
1471 | 123k | #line 384 "read-po-gram.y" |
1472 | 123k | { |
1473 | 123k | check_obsolete ((yyvsp[-1].stringlist), (yyvsp[0].string)); |
1474 | 123k | (yyval.stringlist).stringlist = (yyvsp[-1].stringlist).stringlist; |
1475 | 123k | string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string); |
1476 | 123k | free ((yyvsp[0].string).string); |
1477 | 123k | (yyval.stringlist).pos = (yyvsp[-1].stringlist).pos; |
1478 | 123k | (yyval.stringlist).obsolete = (yyvsp[-1].stringlist).obsolete; |
1479 | 123k | } |
1480 | 123k | #line 1481 "read-po-gram.c" |
1481 | 123k | break; |
1482 | | |
1483 | 6.80k | case 29: /* prev_string_list: PREV_STRING */ |
1484 | 6.80k | #line 396 "read-po-gram.y" |
1485 | 6.80k | { |
1486 | 6.80k | string_list_init (&(yyval.stringlist).stringlist); |
1487 | 6.80k | string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string); |
1488 | 6.80k | free ((yyvsp[0].string).string); |
1489 | 6.80k | (yyval.stringlist).pos = (yyvsp[0].string).pos; |
1490 | 6.80k | (yyval.stringlist).obsolete = (yyvsp[0].string).obsolete; |
1491 | 6.80k | } |
1492 | 6.80k | #line 1493 "read-po-gram.c" |
1493 | 6.80k | break; |
1494 | | |
1495 | 716 | case 30: /* prev_string_list: prev_string_list PREV_STRING */ |
1496 | 716 | #line 404 "read-po-gram.y" |
1497 | 716 | { |
1498 | 716 | check_obsolete ((yyvsp[-1].stringlist), (yyvsp[0].string)); |
1499 | 716 | (yyval.stringlist).stringlist = (yyvsp[-1].stringlist).stringlist; |
1500 | 716 | string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string); |
1501 | 716 | free ((yyvsp[0].string).string); |
1502 | 716 | (yyval.stringlist).pos = (yyvsp[-1].stringlist).pos; |
1503 | 716 | (yyval.stringlist).obsolete = (yyvsp[-1].stringlist).obsolete; |
1504 | 716 | } |
1505 | 716 | #line 1506 "read-po-gram.c" |
1506 | 716 | break; |
1507 | | |
1508 | | |
1509 | 0 | #line 1510 "read-po-gram.c" |
1510 | | |
1511 | 40.0M | default: break; |
1512 | 41.5M | } |
1513 | | /* User semantic actions sometimes alter yychar, and that requires |
1514 | | that yytoken be updated with the new translation. We take the |
1515 | | approach of translating immediately before every use of yytoken. |
1516 | | One alternative is translating here after every semantic action, |
1517 | | but that translation would be missed if the semantic action invokes |
1518 | | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
1519 | | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
1520 | | incorrect destructor might then be invoked immediately. In the |
1521 | | case of YYERROR or YYBACKUP, subsequent parser actions might lead |
1522 | | to an incorrect destructor call or verbose syntax error message |
1523 | | before the lookahead is translated. */ |
1524 | 41.5M | YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); |
1525 | | |
1526 | 41.5M | YYPOPSTACK (yylen); |
1527 | 41.5M | yylen = 0; |
1528 | | |
1529 | 41.5M | *++yyvsp = yyval; |
1530 | | |
1531 | | /* Now 'shift' the result of the reduction. Determine what state |
1532 | | that goes to, based on the state we popped back to and the rule |
1533 | | number reduced by. */ |
1534 | 41.5M | { |
1535 | 41.5M | const int yylhs = yyr1[yyn] - YYNTOKENS; |
1536 | 41.5M | const int yyi = yypgoto[yylhs] + *yyssp; |
1537 | 41.5M | yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp |
1538 | 41.5M | ? yytable[yyi] |
1539 | 41.5M | : yydefgoto[yylhs]); |
1540 | 41.5M | } |
1541 | | |
1542 | 41.5M | goto yynewstate; |
1543 | | |
1544 | | |
1545 | | /*--------------------------------------. |
1546 | | | yyerrlab -- here on detecting error. | |
1547 | | `--------------------------------------*/ |
1548 | 39.1M | yyerrlab: |
1549 | | /* Make sure we have latest lookahead translation. See comments at |
1550 | | user semantic actions for why this is necessary. */ |
1551 | 39.1M | yytoken = yychar == PO_GRAM_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); |
1552 | | /* If not already recovering from an error, report this error. */ |
1553 | 39.1M | if (!yyerrstatus) |
1554 | 131k | { |
1555 | 131k | ++yynerrs; |
1556 | 131k | yyerror (ps, YY_("syntax error")); |
1557 | 131k | } |
1558 | | |
1559 | 39.1M | if (yyerrstatus == 3) |
1560 | 38.9M | { |
1561 | | /* If just tried and failed to reuse lookahead token after an |
1562 | | error, discard it. */ |
1563 | | |
1564 | 38.9M | if (yychar <= PO_GRAM_EOF) |
1565 | 0 | { |
1566 | | /* Return failure if at end of input. */ |
1567 | 0 | if (yychar == PO_GRAM_EOF) |
1568 | 0 | YYABORT; |
1569 | 0 | } |
1570 | 38.9M | else |
1571 | 38.9M | { |
1572 | 38.9M | yydestruct ("Error: discarding", |
1573 | 38.9M | yytoken, &yylval, ps); |
1574 | 38.9M | yychar = PO_GRAM_EMPTY; |
1575 | 38.9M | } |
1576 | 38.9M | } |
1577 | | |
1578 | | /* Else will try to reuse lookahead token after shifting the error |
1579 | | token. */ |
1580 | 39.1M | goto yyerrlab1; |
1581 | | |
1582 | | |
1583 | | /*---------------------------------------------------. |
1584 | | | yyerrorlab -- error raised explicitly by YYERROR. | |
1585 | | `---------------------------------------------------*/ |
1586 | 39.1M | yyerrorlab: |
1587 | | /* Pacify compilers when the user code never invokes YYERROR and the |
1588 | | label yyerrorlab therefore never appears in user code. */ |
1589 | 0 | if (0) |
1590 | 0 | YYERROR; |
1591 | 0 | ++yynerrs; |
1592 | | |
1593 | | /* Do not reclaim the symbols of the rule whose action triggered |
1594 | | this YYERROR. */ |
1595 | 0 | YYPOPSTACK (yylen); |
1596 | 0 | yylen = 0; |
1597 | 0 | YY_STACK_PRINT (yyss, yyssp); |
1598 | 0 | yystate = *yyssp; |
1599 | 0 | goto yyerrlab1; |
1600 | | |
1601 | | |
1602 | | /*-------------------------------------------------------------. |
1603 | | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
1604 | | `-------------------------------------------------------------*/ |
1605 | 39.1M | yyerrlab1: |
1606 | 39.1M | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
1607 | | |
1608 | | /* Pop stack until we find a state that shifts the error token. */ |
1609 | 39.1M | for (;;) |
1610 | 39.2M | { |
1611 | 39.2M | yyn = yypact[yystate]; |
1612 | 39.2M | if (!yypact_value_is_default (yyn)) |
1613 | 39.2M | { |
1614 | 39.2M | yyn += YYSYMBOL_YYerror; |
1615 | 39.2M | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) |
1616 | 39.1M | { |
1617 | 39.1M | yyn = yytable[yyn]; |
1618 | 39.1M | if (0 < yyn) |
1619 | 39.1M | break; |
1620 | 39.1M | } |
1621 | 39.2M | } |
1622 | | |
1623 | | /* Pop the current state because it cannot handle the error token. */ |
1624 | 23.9k | if (yyssp == yyss) |
1625 | 0 | YYABORT; |
1626 | | |
1627 | | |
1628 | 23.9k | yydestruct ("Error: popping", |
1629 | 23.9k | YY_ACCESSING_SYMBOL (yystate), yyvsp, ps); |
1630 | 23.9k | YYPOPSTACK (1); |
1631 | 23.9k | yystate = *yyssp; |
1632 | 23.9k | YY_STACK_PRINT (yyss, yyssp); |
1633 | 23.9k | } |
1634 | | |
1635 | 39.1M | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1636 | 39.1M | *++yyvsp = yylval; |
1637 | 39.1M | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1638 | | |
1639 | | |
1640 | | /* Shift the error token. */ |
1641 | 39.1M | YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); |
1642 | | |
1643 | 39.1M | yystate = yyn; |
1644 | 39.1M | goto yynewstate; |
1645 | | |
1646 | | |
1647 | | /*-------------------------------------. |
1648 | | | yyacceptlab -- YYACCEPT comes here. | |
1649 | | `-------------------------------------*/ |
1650 | 8.54k | yyacceptlab: |
1651 | 8.54k | yyresult = 0; |
1652 | 8.54k | goto yyreturnlab; |
1653 | | |
1654 | | |
1655 | | /*-----------------------------------. |
1656 | | | yyabortlab -- YYABORT comes here. | |
1657 | | `-----------------------------------*/ |
1658 | 0 | yyabortlab: |
1659 | 0 | yyresult = 1; |
1660 | 0 | goto yyreturnlab; |
1661 | | |
1662 | | |
1663 | | /*-----------------------------------------------------------. |
1664 | | | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | |
1665 | | `-----------------------------------------------------------*/ |
1666 | 0 | yyexhaustedlab: |
1667 | 0 | yyerror (ps, YY_("memory exhausted")); |
1668 | 0 | yyresult = 2; |
1669 | 0 | goto yyreturnlab; |
1670 | | |
1671 | | |
1672 | | /*----------------------------------------------------------. |
1673 | | | yyreturnlab -- parsing is finished, clean up and return. | |
1674 | | `----------------------------------------------------------*/ |
1675 | 8.54k | yyreturnlab: |
1676 | 8.54k | if (yychar != PO_GRAM_EMPTY) |
1677 | 0 | { |
1678 | | /* Make sure we have latest lookahead translation. See comments at |
1679 | | user semantic actions for why this is necessary. */ |
1680 | 0 | yytoken = YYTRANSLATE (yychar); |
1681 | 0 | yydestruct ("Cleanup: discarding lookahead", |
1682 | 0 | yytoken, &yylval, ps); |
1683 | 0 | } |
1684 | | /* Do not reclaim the symbols of the rule whose action triggered |
1685 | | this YYABORT or YYACCEPT. */ |
1686 | 8.54k | YYPOPSTACK (yylen); |
1687 | 8.54k | YY_STACK_PRINT (yyss, yyssp); |
1688 | 25.6k | while (yyssp != yyss) |
1689 | 17.0k | { |
1690 | 17.0k | yydestruct ("Cleanup: popping", |
1691 | 17.0k | YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, ps); |
1692 | 17.0k | YYPOPSTACK (1); |
1693 | 17.0k | } |
1694 | 8.54k | #ifndef yyoverflow |
1695 | 8.54k | if (yyss != yyssa) |
1696 | 0 | YYSTACK_FREE (yyss); |
1697 | 8.54k | #endif |
1698 | | |
1699 | 8.54k | return yyresult; |
1700 | 39.1M | } |
1701 | | |