/src/gettext/gettext-tools/src/read-po-gram.c
Line | Count | Source |
1 | | /* A Bison parser, made by GNU Bison 3.5.1. */ |
2 | | |
3 | | /* Bison implementation for Yacc-like parsers in C |
4 | | |
5 | | Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 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 <http://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 | | /* All symbols defined below should begin with yy or YY, to avoid |
38 | | infringing on user name space. This should be done even for local |
39 | | variables, as they might otherwise be expanded by user macros. |
40 | | There are some unavoidable exceptions within include files to |
41 | | define necessary library symbols; they are noted "INFRINGES ON |
42 | | USER NAME SPACE" below. */ |
43 | | |
44 | | /* Undocumented macros, especially those whose name start with YY_, |
45 | | are private implementation details. Do not rely on them. */ |
46 | | |
47 | | /* Identify Bison output. */ |
48 | | #define YYBISON 1 |
49 | | |
50 | | /* Bison version. */ |
51 | | #define YYBISON_VERSION "3.5.1" |
52 | | |
53 | | /* Skeleton name. */ |
54 | | #define YYSKELETON_NAME "yacc.c" |
55 | | |
56 | | /* Pure parsers. */ |
57 | | #define YYPURE 2 |
58 | | |
59 | | /* Push parsers. */ |
60 | | #define YYPUSH 0 |
61 | | |
62 | | /* Pull parsers. */ |
63 | | #define YYPULL 1 |
64 | | |
65 | | /* Substitute the type names. */ |
66 | 60.1k | #define YYSTYPE PO_GRAM_STYPE |
67 | | /* Substitute the variable and function names. */ |
68 | | #define yyparse po_gram_parse |
69 | 68.9M | #define yylex po_gram_lex |
70 | 165k | #define yyerror po_gram_error |
71 | | #define yydebug po_gram_debug |
72 | 177k | #define yynerrs po_gram_nerrs |
73 | | |
74 | | /* First part of user prologue. */ |
75 | | #line 19 "read-po-gram.y" |
76 | | |
77 | | #include <config.h> |
78 | | |
79 | | /* Specification. */ |
80 | | #include "read-po-internal.h" |
81 | | |
82 | | #include <stdbool.h> |
83 | | #include <stdio.h> |
84 | | #include <stdlib.h> |
85 | | #include <string.h> |
86 | | |
87 | | #include <error.h> |
88 | | #include "str-list.h" |
89 | | #include "read-po-lex.h" |
90 | | #include "po-charset.h" |
91 | | #include "xalloc.h" |
92 | | #include "gettext.h" |
93 | | #include "read-catalog-abstract.h" |
94 | | |
95 | 73.2k | #define _(str) gettext (str) |
96 | | |
97 | | #define check_obsolete(value1,value2) \ |
98 | 571k | if ((value1).obsolete != (value2).obsolete) \ |
99 | 571k | po_gram_error_at_line (ps->catr, &(value2).pos, \ |
100 | 10.8k | _("inconsistent use of #~")); |
101 | | |
102 | | static inline void |
103 | | do_callback_message (struct po_parser_state *ps, |
104 | | char *msgctxt, |
105 | | char *msgid, lex_pos_ty *msgid_pos, char *msgid_plural, |
106 | | char *msgstr, size_t msgstr_len, lex_pos_ty *msgstr_pos, |
107 | | char *prev_msgctxt, |
108 | | char *prev_msgid, char *prev_msgid_plural, |
109 | | bool obsolete) |
110 | 97.2k | { |
111 | | /* Test for header entry. Ignore fuzziness of the header entry. */ |
112 | 97.2k | if (msgctxt == NULL && msgid[0] == '\0' && !obsolete) |
113 | 40.1k | po_lex_charset_set (ps, msgstr, ps->gram_pos.file_name, ps->gram_pot_role); |
114 | | |
115 | 97.2k | catalog_reader_seen_message (ps->catr, |
116 | 97.2k | msgctxt, |
117 | 97.2k | msgid, msgid_pos, msgid_plural, |
118 | 97.2k | msgstr, msgstr_len, msgstr_pos, |
119 | 97.2k | prev_msgctxt, prev_msgid, prev_msgid_plural, |
120 | 97.2k | false, obsolete); |
121 | 97.2k | } |
122 | | |
123 | | #define free_message_intro(value) \ |
124 | 62.4k | if ((value).prev_ctxt != NULL) \ |
125 | 62.4k | free ((value).prev_ctxt); \ |
126 | 62.4k | if ((value).prev_id != NULL) \ |
127 | 62.4k | free ((value).prev_id); \ |
128 | 62.4k | if ((value).prev_id_plural != NULL) \ |
129 | 62.4k | free ((value).prev_id_plural); \ |
130 | 62.4k | if ((value).ctxt != NULL) \ |
131 | 62.4k | free ((value).ctxt); |
132 | | |
133 | | |
134 | | #line 135 "read-po-gram.c" |
135 | | |
136 | | # ifndef YY_CAST |
137 | | # ifdef __cplusplus |
138 | | # define YY_CAST(Type, Val) static_cast<Type> (Val) |
139 | | # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val) |
140 | | # else |
141 | 140M | # define YY_CAST(Type, Val) ((Type) (Val)) |
142 | | # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) |
143 | | # endif |
144 | | # endif |
145 | | # ifndef YY_NULLPTR |
146 | | # if defined __cplusplus |
147 | | # if 201103L <= __cplusplus |
148 | | # define YY_NULLPTR nullptr |
149 | | # else |
150 | | # define YY_NULLPTR 0 |
151 | | # endif |
152 | | # else |
153 | | # define YY_NULLPTR ((void*)0) |
154 | | # endif |
155 | | # endif |
156 | | |
157 | | /* Enabling verbose error messages. */ |
158 | | #ifdef YYERROR_VERBOSE |
159 | | # undef YYERROR_VERBOSE |
160 | | # define YYERROR_VERBOSE 1 |
161 | | #else |
162 | | # define YYERROR_VERBOSE 0 |
163 | | #endif |
164 | | |
165 | | /* Use api.header.include to #include this header |
166 | | instead of duplicating it here. */ |
167 | | #ifndef YY_PO_GRAM_READ_PO_GRAM_TAB_H_INCLUDED |
168 | | # define YY_PO_GRAM_READ_PO_GRAM_TAB_H_INCLUDED |
169 | | /* Debug traces. */ |
170 | | #ifndef PO_GRAM_DEBUG |
171 | | # if defined YYDEBUG |
172 | | #if YYDEBUG |
173 | | # define PO_GRAM_DEBUG 1 |
174 | | # else |
175 | | # define PO_GRAM_DEBUG 0 |
176 | | # endif |
177 | | # else /* ! defined YYDEBUG */ |
178 | | # define PO_GRAM_DEBUG 0 |
179 | | # endif /* ! defined YYDEBUG */ |
180 | | #endif /* ! defined PO_GRAM_DEBUG */ |
181 | | #if PO_GRAM_DEBUG |
182 | | extern int po_gram_debug; |
183 | | #endif |
184 | | |
185 | | /* Token type. */ |
186 | | #ifndef PO_GRAM_TOKENTYPE |
187 | | # define PO_GRAM_TOKENTYPE |
188 | | enum po_gram_tokentype |
189 | | { |
190 | | COMMENT = 258, |
191 | | DOMAIN = 259, |
192 | | JUNK = 260, |
193 | | PREV_MSGCTXT = 261, |
194 | | PREV_MSGID = 262, |
195 | | PREV_MSGID_PLURAL = 263, |
196 | | PREV_STRING = 264, |
197 | | MSGCTXT = 265, |
198 | | MSGID = 266, |
199 | | MSGID_PLURAL = 267, |
200 | | MSGSTR = 268, |
201 | | NAME = 269, |
202 | | NUMBER = 270, |
203 | | STRING = 271 |
204 | | }; |
205 | | #endif |
206 | | |
207 | | /* Value type. */ |
208 | | #if ! defined PO_GRAM_STYPE && ! defined PO_GRAM_STYPE_IS_DECLARED |
209 | | union PO_GRAM_STYPE |
210 | | { |
211 | | #line 105 "read-po-gram.y" |
212 | | |
213 | | struct { char *string; lex_pos_ty pos; bool obsolete; } string; |
214 | | struct { string_list_ty stringlist; lex_pos_ty pos; bool obsolete; } stringlist; |
215 | | struct { long number; lex_pos_ty pos; bool obsolete; } number; |
216 | | struct { lex_pos_ty pos; bool obsolete; } pos; |
217 | | struct { char *ctxt; char *id; char *id_plural; lex_pos_ty pos; bool obsolete; } prev; |
218 | | struct { char *prev_ctxt; char *prev_id; char *prev_id_plural; char *ctxt; lex_pos_ty pos; bool obsolete; } message_intro; |
219 | | struct { struct msgstr_def rhs; lex_pos_ty pos; bool obsolete; } rhs; |
220 | | |
221 | | #line 222 "read-po-gram.c" |
222 | | |
223 | | }; |
224 | | typedef union PO_GRAM_STYPE PO_GRAM_STYPE; |
225 | | # define PO_GRAM_STYPE_IS_TRIVIAL 1 |
226 | | # define PO_GRAM_STYPE_IS_DECLARED 1 |
227 | | #endif |
228 | | |
229 | | |
230 | | |
231 | | int po_gram_parse (struct po_parser_state *ps); |
232 | | |
233 | | #endif /* !YY_PO_GRAM_READ_PO_GRAM_TAB_H_INCLUDED */ |
234 | | |
235 | | |
236 | | |
237 | | #ifdef short |
238 | | # undef short |
239 | | #endif |
240 | | |
241 | | /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure |
242 | | <limits.h> and (if available) <stdint.h> are included |
243 | | so that the code can choose integer types of a good width. */ |
244 | | |
245 | | #ifndef __PTRDIFF_MAX__ |
246 | | # include <limits.h> /* INFRINGES ON USER NAME SPACE */ |
247 | | # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ |
248 | | # include <stdint.h> /* INFRINGES ON USER NAME SPACE */ |
249 | | # define YY_STDINT_H |
250 | | # endif |
251 | | #endif |
252 | | |
253 | | /* Narrow types that promote to a signed type and that can represent a |
254 | | signed or unsigned integer of at least N bits. In tables they can |
255 | | save space and decrease cache pressure. Promoting to a signed type |
256 | | helps avoid bugs in integer arithmetic. */ |
257 | | |
258 | | #ifdef __INT_LEAST8_MAX__ |
259 | | typedef __INT_LEAST8_TYPE__ yytype_int8; |
260 | | #elif defined YY_STDINT_H |
261 | | typedef int_least8_t yytype_int8; |
262 | | #else |
263 | | typedef signed char yytype_int8; |
264 | | #endif |
265 | | |
266 | | #ifdef __INT_LEAST16_MAX__ |
267 | | typedef __INT_LEAST16_TYPE__ yytype_int16; |
268 | | #elif defined YY_STDINT_H |
269 | | typedef int_least16_t yytype_int16; |
270 | | #else |
271 | | typedef short yytype_int16; |
272 | | #endif |
273 | | |
274 | | #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ |
275 | | typedef __UINT_LEAST8_TYPE__ yytype_uint8; |
276 | | #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ |
277 | | && UINT_LEAST8_MAX <= INT_MAX) |
278 | | typedef uint_least8_t yytype_uint8; |
279 | | #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX |
280 | | typedef unsigned char yytype_uint8; |
281 | | #else |
282 | | typedef short yytype_uint8; |
283 | | #endif |
284 | | |
285 | | #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ |
286 | | typedef __UINT_LEAST16_TYPE__ yytype_uint16; |
287 | | #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ |
288 | | && UINT_LEAST16_MAX <= INT_MAX) |
289 | | typedef uint_least16_t yytype_uint16; |
290 | | #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX |
291 | | typedef unsigned short yytype_uint16; |
292 | | #else |
293 | | typedef int yytype_uint16; |
294 | | #endif |
295 | | |
296 | | #ifndef YYPTRDIFF_T |
297 | | # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ |
298 | 12.0k | # define YYPTRDIFF_T __PTRDIFF_TYPE__ |
299 | | # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ |
300 | | # elif defined PTRDIFF_MAX |
301 | | # ifndef ptrdiff_t |
302 | | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
303 | | # endif |
304 | | # define YYPTRDIFF_T ptrdiff_t |
305 | | # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX |
306 | | # else |
307 | | # define YYPTRDIFF_T long |
308 | | # define YYPTRDIFF_MAXIMUM LONG_MAX |
309 | | # endif |
310 | | #endif |
311 | | |
312 | | #ifndef YYSIZE_T |
313 | | # ifdef __SIZE_TYPE__ |
314 | | # define YYSIZE_T __SIZE_TYPE__ |
315 | | # elif defined size_t |
316 | | # define YYSIZE_T size_t |
317 | | # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ |
318 | | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
319 | | # define YYSIZE_T size_t |
320 | | # else |
321 | | # define YYSIZE_T unsigned |
322 | | # endif |
323 | | #endif |
324 | | |
325 | | #define YYSIZE_MAXIMUM \ |
326 | | YY_CAST (YYPTRDIFF_T, \ |
327 | | (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ |
328 | | ? YYPTRDIFF_MAXIMUM \ |
329 | | : YY_CAST (YYSIZE_T, -1))) |
330 | | |
331 | 0 | #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) |
332 | | |
333 | | /* Stored state numbers (used for stacks). */ |
334 | | typedef yytype_int8 yy_state_t; |
335 | | |
336 | | /* State numbers in computations. */ |
337 | | typedef int yy_state_fast_t; |
338 | | |
339 | | #ifndef YY_ |
340 | | # if defined YYENABLE_NLS && YYENABLE_NLS |
341 | | # if ENABLE_NLS |
342 | | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
343 | | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
344 | | # endif |
345 | | # endif |
346 | | # ifndef YY_ |
347 | 165k | # define YY_(Msgid) Msgid |
348 | | # endif |
349 | | #endif |
350 | | |
351 | | #ifndef YY_ATTRIBUTE_PURE |
352 | | # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) |
353 | | # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) |
354 | | # else |
355 | | # define YY_ATTRIBUTE_PURE |
356 | | # endif |
357 | | #endif |
358 | | |
359 | | #ifndef YY_ATTRIBUTE_UNUSED |
360 | | # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) |
361 | | # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) |
362 | | # else |
363 | | # define YY_ATTRIBUTE_UNUSED |
364 | | # endif |
365 | | #endif |
366 | | |
367 | | /* Suppress unused-variable warnings by "using" E. */ |
368 | | #if ! defined lint || defined __GNUC__ |
369 | 200M | # define YYUSE(E) ((void) (E)) |
370 | | #else |
371 | | # define YYUSE(E) /* empty */ |
372 | | #endif |
373 | | |
374 | | #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ |
375 | | /* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
376 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
377 | | _Pragma ("GCC diagnostic push") \ |
378 | | _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ |
379 | | _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
380 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ |
381 | | _Pragma ("GCC diagnostic pop") |
382 | | #else |
383 | 24.0k | # define YY_INITIAL_VALUE(Value) Value |
384 | | #endif |
385 | | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
386 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
387 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_END |
388 | | #endif |
389 | | #ifndef YY_INITIAL_VALUE |
390 | | # define YY_INITIAL_VALUE(Value) /* Nothing. */ |
391 | | #endif |
392 | | |
393 | | #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ |
394 | | # define YY_IGNORE_USELESS_CAST_BEGIN \ |
395 | | _Pragma ("GCC diagnostic push") \ |
396 | | _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") |
397 | | # define YY_IGNORE_USELESS_CAST_END \ |
398 | | _Pragma ("GCC diagnostic pop") |
399 | | #endif |
400 | | #ifndef YY_IGNORE_USELESS_CAST_BEGIN |
401 | | # define YY_IGNORE_USELESS_CAST_BEGIN |
402 | | # define YY_IGNORE_USELESS_CAST_END |
403 | | #endif |
404 | | |
405 | | |
406 | 140M | #define YY_ASSERT(E) ((void) (0 && (E))) |
407 | | |
408 | | #if ! defined yyoverflow || YYERROR_VERBOSE |
409 | | |
410 | | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
411 | | |
412 | | # ifdef YYSTACK_USE_ALLOCA |
413 | | # if YYSTACK_USE_ALLOCA |
414 | | # ifdef __GNUC__ |
415 | | # define YYSTACK_ALLOC __builtin_alloca |
416 | | # elif defined __BUILTIN_VA_ARG_INCR |
417 | | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
418 | | # elif defined _AIX |
419 | | # define YYSTACK_ALLOC __alloca |
420 | | # elif defined _MSC_VER |
421 | | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
422 | | # define alloca _alloca |
423 | | # else |
424 | | # define YYSTACK_ALLOC alloca |
425 | | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS |
426 | | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
427 | | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
428 | | # ifndef EXIT_SUCCESS |
429 | | # define EXIT_SUCCESS 0 |
430 | | # endif |
431 | | # endif |
432 | | # endif |
433 | | # endif |
434 | | # endif |
435 | | |
436 | | # ifdef YYSTACK_ALLOC |
437 | | /* Pacify GCC's 'empty if-body' warning. */ |
438 | | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) |
439 | | # ifndef YYSTACK_ALLOC_MAXIMUM |
440 | | /* The OS might guarantee only one guard page at the bottom of the stack, |
441 | | and a page size can be as small as 4096 bytes. So we cannot safely |
442 | | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
443 | | to allow for a few compiler-allocated temporary stack slots. */ |
444 | | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
445 | | # endif |
446 | | # else |
447 | | # define YYSTACK_ALLOC YYMALLOC |
448 | 0 | # define YYSTACK_FREE YYFREE |
449 | | # ifndef YYSTACK_ALLOC_MAXIMUM |
450 | | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
451 | | # endif |
452 | | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
453 | | && ! ((defined YYMALLOC || defined malloc) \ |
454 | | && (defined YYFREE || defined free))) |
455 | | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
456 | | # ifndef EXIT_SUCCESS |
457 | | # define EXIT_SUCCESS 0 |
458 | | # endif |
459 | | # endif |
460 | | # ifndef YYMALLOC |
461 | | # define YYMALLOC malloc |
462 | | # if ! defined malloc && ! defined EXIT_SUCCESS |
463 | | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
464 | | # endif |
465 | | # endif |
466 | | # ifndef YYFREE |
467 | 0 | # define YYFREE free |
468 | | # if ! defined free && ! defined EXIT_SUCCESS |
469 | | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
470 | | # endif |
471 | | # endif |
472 | | # endif |
473 | | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
474 | | |
475 | | |
476 | | #if (! defined yyoverflow \ |
477 | | && (! defined __cplusplus \ |
478 | | || (defined PO_GRAM_STYPE_IS_TRIVIAL && PO_GRAM_STYPE_IS_TRIVIAL))) |
479 | | |
480 | | /* A type that is properly aligned for any stack member. */ |
481 | | union yyalloc |
482 | | { |
483 | | yy_state_t yyss_alloc; |
484 | | YYSTYPE yyvs_alloc; |
485 | | }; |
486 | | |
487 | | /* The size of the maximum gap between one aligned stack and the next. */ |
488 | 0 | # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) |
489 | | |
490 | | /* The size of an array large to enough to hold all stacks, each with |
491 | | N elements. */ |
492 | | # define YYSTACK_BYTES(N) \ |
493 | | ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ |
494 | | + YYSTACK_GAP_MAXIMUM) |
495 | | |
496 | | # define YYCOPY_NEEDED 1 |
497 | | |
498 | | /* Relocate STACK from its old location to the new one. The |
499 | | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
500 | | elements in the stack, and YYPTR gives the new location of the |
501 | | stack. Advance YYPTR to a properly aligned location for the next |
502 | | stack. */ |
503 | | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
504 | 0 | do \ |
505 | 0 | { \ |
506 | 0 | YYPTRDIFF_T yynewbytes; \ |
507 | 0 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
508 | 0 | Stack = &yyptr->Stack_alloc; \ |
509 | 0 | yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
510 | 0 | yyptr += yynewbytes / YYSIZEOF (*yyptr); \ |
511 | 0 | } \ |
512 | 0 | while (0) |
513 | | |
514 | | #endif |
515 | | |
516 | | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
517 | | /* Copy COUNT objects from SRC to DST. The source and destination do |
518 | | not overlap. */ |
519 | | # ifndef YYCOPY |
520 | | # if defined __GNUC__ && 1 < __GNUC__ |
521 | | # define YYCOPY(Dst, Src, Count) \ |
522 | 0 | __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) |
523 | | # else |
524 | | # define YYCOPY(Dst, Src, Count) \ |
525 | | do \ |
526 | | { \ |
527 | | YYPTRDIFF_T yyi; \ |
528 | | for (yyi = 0; yyi < (Count); yyi++) \ |
529 | | (Dst)[yyi] = (Src)[yyi]; \ |
530 | | } \ |
531 | | while (0) |
532 | | # endif |
533 | | # endif |
534 | | #endif /* !YYCOPY_NEEDED */ |
535 | | |
536 | | /* YYFINAL -- State number of the termination state. */ |
537 | 140M | #define YYFINAL 2 |
538 | | /* YYLAST -- Last index in YYTABLE. */ |
539 | 275M | #define YYLAST 40 |
540 | | |
541 | | /* YYNTOKENS -- Number of terminals. */ |
542 | 70.9M | #define YYNTOKENS 19 |
543 | | /* YYNNTS -- Number of nonterminals. */ |
544 | | #define YYNNTS 15 |
545 | | /* YYNRULES -- Number of rules. */ |
546 | | #define YYNRULES 30 |
547 | | /* YYNSTATES -- Number of states. */ |
548 | | #define YYNSTATES 46 |
549 | | |
550 | 0 | #define YYUNDEFTOK 2 |
551 | 136M | #define YYMAXUTOK 271 |
552 | | |
553 | | |
554 | | /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM |
555 | | as returned by yylex, with out-of-bounds checking. */ |
556 | | #define YYTRANSLATE(YYX) \ |
557 | 203M | (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
558 | | |
559 | | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
560 | | as returned by yylex. */ |
561 | | static const yytype_int8 yytranslate[] = |
562 | | { |
563 | | 0, 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, 15, 2, 16, 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, 2, 2, 2, 2, |
578 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
579 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
580 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
581 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
582 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
583 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
584 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
585 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
586 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
587 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
588 | | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
589 | | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
590 | | 17, 18 |
591 | | }; |
592 | | |
593 | | #if PO_GRAM_DEBUG |
594 | | /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
595 | | static const yytype_int16 yyrline[] = |
596 | | { |
597 | | 0, 131, 131, 132, 133, 134, 135, 140, 148, 157, |
598 | | 178, 199, 208, 217, 228, 237, 251, 260, 274, 280, |
599 | | 291, 297, 309, 320, 331, 335, 350, 373, 381, 393, |
600 | | 401 |
601 | | }; |
602 | | #endif |
603 | | |
604 | | #if PO_GRAM_DEBUG || YYERROR_VERBOSE || 0 |
605 | | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
606 | | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
607 | | static const char *const yytname[] = |
608 | | { |
609 | | "$end", "error", "$undefined", "COMMENT", "DOMAIN", "JUNK", |
610 | | "PREV_MSGCTXT", "PREV_MSGID", "PREV_MSGID_PLURAL", "PREV_STRING", |
611 | | "MSGCTXT", "MSGID", "MSGID_PLURAL", "MSGSTR", "NAME", "'['", "']'", |
612 | | "NUMBER", "STRING", "$accept", "po_file", "comment", "domain", "message", |
613 | | "message_intro", "prev", "msg_intro", "prev_msg_intro", |
614 | | "msgid_pluralform", "prev_msgid_pluralform", "pluralform_list", |
615 | | "pluralform", "string_list", "prev_string_list", YY_NULLPTR |
616 | | }; |
617 | | #endif |
618 | | |
619 | | # ifdef YYPRINT |
620 | | /* YYTOKNUM[NUM] -- (External) token number corresponding to the |
621 | | (internal) symbol number NUM (which must be that of a token). */ |
622 | | static const yytype_int16 yytoknum[] = |
623 | | { |
624 | | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
625 | | 265, 266, 267, 268, 269, 91, 93, 270, 271 |
626 | | }; |
627 | | # endif |
628 | | |
629 | 207M | #define YYPACT_NINF (-26) |
630 | | |
631 | | #define yypact_value_is_default(Yyn) \ |
632 | 207M | ((Yyn) == YYPACT_NINF) |
633 | | |
634 | | #define YYTABLE_NINF (-1) |
635 | | |
636 | | #define yytable_value_is_error(Yyn) \ |
637 | 0 | 0 |
638 | | |
639 | | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
640 | | STATE-NUM. */ |
641 | | static const yytype_int8 yypact[] = |
642 | | { |
643 | | -26, 2, -26, -26, -26, -8, 5, -26, 0, -26, |
644 | | -26, -26, -26, 0, 13, -26, 5, -26, -26, 20, |
645 | | -26, -7, 8, -26, 24, -26, -26, -26, -26, 0, |
646 | | 7, 15, 15, -26, 5, -26, 12, 17, 12, 21, |
647 | | 15, -26, 26, 22, 0, 12 |
648 | | }; |
649 | | |
650 | | /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. |
651 | | Performed when YYTABLE does not specify something else to do. Zero |
652 | | means the default is an error. */ |
653 | | static const yytype_int8 yydefact[] = |
654 | | { |
655 | | 2, 0, 1, 6, 7, 0, 0, 20, 0, 18, |
656 | | 3, 4, 5, 0, 0, 14, 0, 8, 29, 0, |
657 | | 27, 0, 13, 15, 16, 21, 30, 19, 28, 0, |
658 | | 0, 11, 12, 24, 0, 17, 22, 0, 9, 0, |
659 | | 10, 25, 23, 0, 0, 26 |
660 | | }; |
661 | | |
662 | | /* YYPGOTO[NTERM-NUM]. */ |
663 | | static const yytype_int8 yypgoto[] = |
664 | | { |
665 | | -26, -26, -26, -26, -26, -26, -26, 23, -26, -26, |
666 | | -26, 9, -25, -13, -15 |
667 | | }; |
668 | | |
669 | | /* YYDEFGOTO[NTERM-NUM]. */ |
670 | | static const yytype_int8 yydefgoto[] = |
671 | | { |
672 | | -1, 1, 10, 11, 12, 13, 14, 15, 16, 31, |
673 | | 35, 32, 33, 21, 19 |
674 | | }; |
675 | | |
676 | | /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If |
677 | | positive, shift that token. If negative, reduce the rule whose |
678 | | number is the opposite. If YYTABLE_NINF, syntax error. */ |
679 | | static const yytype_int8 yytable[] = |
680 | | { |
681 | | 22, 24, 2, 3, 27, 4, 5, 41, 6, 7, |
682 | | 17, 28, 8, 9, 18, 41, 36, 38, 20, 42, |
683 | | 29, 30, 37, 8, 9, 20, 28, 25, 39, 26, |
684 | | 28, 45, 34, 26, 43, 26, 37, 23, 44, 0, |
685 | | 40 |
686 | | }; |
687 | | |
688 | | static const yytype_int8 yycheck[] = |
689 | | { |
690 | | 13, 16, 0, 1, 11, 3, 4, 32, 6, 7, |
691 | | 18, 18, 10, 11, 9, 40, 29, 30, 18, 34, |
692 | | 12, 13, 15, 10, 11, 18, 18, 7, 13, 9, |
693 | | 18, 44, 8, 9, 17, 9, 15, 14, 16, -1, |
694 | | 31 |
695 | | }; |
696 | | |
697 | | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
698 | | symbol of state STATE-NUM. */ |
699 | | static const yytype_int8 yystos[] = |
700 | | { |
701 | | 0, 20, 0, 1, 3, 4, 6, 7, 10, 11, |
702 | | 21, 22, 23, 24, 25, 26, 27, 18, 9, 33, |
703 | | 18, 32, 32, 26, 33, 7, 9, 11, 18, 12, |
704 | | 13, 28, 30, 31, 8, 29, 32, 15, 32, 13, |
705 | | 30, 31, 33, 17, 16, 32 |
706 | | }; |
707 | | |
708 | | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
709 | | static const yytype_int8 yyr1[] = |
710 | | { |
711 | | 0, 19, 20, 20, 20, 20, 20, 21, 22, 23, |
712 | | 23, 23, 23, 23, 24, 24, 25, 25, 26, 26, |
713 | | 27, 27, 28, 29, 30, 30, 31, 32, 32, 33, |
714 | | 33 |
715 | | }; |
716 | | |
717 | | /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ |
718 | | static const yytype_int8 yyr2[] = |
719 | | { |
720 | | 0, 2, 0, 2, 2, 2, 2, 1, 2, 4, |
721 | | 4, 3, 3, 2, 1, 2, 2, 3, 1, 3, |
722 | | 1, 3, 2, 2, 1, 2, 5, 1, 2, 1, |
723 | | 2 |
724 | | }; |
725 | | |
726 | | |
727 | | #define yyerrok (yyerrstatus = 0) |
728 | | #define yyclearin (yychar = YYEMPTY) |
729 | 205M | #define YYEMPTY (-2) |
730 | 136M | #define YYEOF 0 |
731 | | |
732 | 12.0k | #define YYACCEPT goto yyacceptlab |
733 | 0 | #define YYABORT goto yyabortlab |
734 | 0 | #define YYERROR goto yyerrorlab |
735 | | |
736 | | |
737 | | #define YYRECOVERING() (!!yyerrstatus) |
738 | | |
739 | | #define YYBACKUP(Token, Value) \ |
740 | | do \ |
741 | | if (yychar == YYEMPTY) \ |
742 | | { \ |
743 | | yychar = (Token); \ |
744 | | yylval = (Value); \ |
745 | | YYPOPSTACK (yylen); \ |
746 | | yystate = *yyssp; \ |
747 | | goto yybackup; \ |
748 | | } \ |
749 | | else \ |
750 | | { \ |
751 | | yyerror (ps, YY_("syntax error: cannot back up")); \ |
752 | | YYERROR; \ |
753 | | } \ |
754 | | while (0) |
755 | | |
756 | | /* Error token number */ |
757 | 134M | #define YYTERROR 1 |
758 | | #define YYERRCODE 256 |
759 | | |
760 | | |
761 | | |
762 | | /* Enable debugging if requested. */ |
763 | | #if PO_GRAM_DEBUG |
764 | | |
765 | | # ifndef YYFPRINTF |
766 | | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
767 | | # define YYFPRINTF fprintf |
768 | | # endif |
769 | | |
770 | | # define YYDPRINTF(Args) \ |
771 | | do { \ |
772 | | if (yydebug) \ |
773 | | YYFPRINTF Args; \ |
774 | | } while (0) |
775 | | |
776 | | /* This macro is provided for backward compatibility. */ |
777 | | #ifndef YY_LOCATION_PRINT |
778 | | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
779 | | #endif |
780 | | |
781 | | |
782 | | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
783 | | do { \ |
784 | | if (yydebug) \ |
785 | | { \ |
786 | | YYFPRINTF (stderr, "%s ", Title); \ |
787 | | yy_symbol_print (stderr, \ |
788 | | Type, Value, ps); \ |
789 | | YYFPRINTF (stderr, "\n"); \ |
790 | | } \ |
791 | | } while (0) |
792 | | |
793 | | |
794 | | /*-----------------------------------. |
795 | | | Print this symbol's value on YYO. | |
796 | | `-----------------------------------*/ |
797 | | |
798 | | static void |
799 | | yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, struct po_parser_state *ps) |
800 | | { |
801 | | FILE *yyoutput = yyo; |
802 | | YYUSE (yyoutput); |
803 | | YYUSE (ps); |
804 | | if (!yyvaluep) |
805 | | return; |
806 | | # ifdef YYPRINT |
807 | | if (yytype < YYNTOKENS) |
808 | | YYPRINT (yyo, yytoknum[yytype], *yyvaluep); |
809 | | # endif |
810 | | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
811 | | YYUSE (yytype); |
812 | | YY_IGNORE_MAYBE_UNINITIALIZED_END |
813 | | } |
814 | | |
815 | | |
816 | | /*---------------------------. |
817 | | | Print this symbol on YYO. | |
818 | | `---------------------------*/ |
819 | | |
820 | | static void |
821 | | yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, struct po_parser_state *ps) |
822 | | { |
823 | | YYFPRINTF (yyo, "%s %s (", |
824 | | yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); |
825 | | |
826 | | yy_symbol_value_print (yyo, yytype, yyvaluep, ps); |
827 | | YYFPRINTF (yyo, ")"); |
828 | | } |
829 | | |
830 | | /*------------------------------------------------------------------. |
831 | | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
832 | | | TOP (included). | |
833 | | `------------------------------------------------------------------*/ |
834 | | |
835 | | static void |
836 | | yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) |
837 | | { |
838 | | YYFPRINTF (stderr, "Stack now"); |
839 | | for (; yybottom <= yytop; yybottom++) |
840 | | { |
841 | | int yybot = *yybottom; |
842 | | YYFPRINTF (stderr, " %d", yybot); |
843 | | } |
844 | | YYFPRINTF (stderr, "\n"); |
845 | | } |
846 | | |
847 | | # define YY_STACK_PRINT(Bottom, Top) \ |
848 | | do { \ |
849 | | if (yydebug) \ |
850 | | yy_stack_print ((Bottom), (Top)); \ |
851 | | } while (0) |
852 | | |
853 | | |
854 | | /*------------------------------------------------. |
855 | | | Report that the YYRULE is going to be reduced. | |
856 | | `------------------------------------------------*/ |
857 | | |
858 | | static void |
859 | | yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, struct po_parser_state *ps) |
860 | | { |
861 | | int yylno = yyrline[yyrule]; |
862 | | int yynrhs = yyr2[yyrule]; |
863 | | int yyi; |
864 | | YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", |
865 | | yyrule - 1, yylno); |
866 | | /* The symbols being reduced. */ |
867 | | for (yyi = 0; yyi < yynrhs; yyi++) |
868 | | { |
869 | | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
870 | | yy_symbol_print (stderr, |
871 | | yystos[+yyssp[yyi + 1 - yynrhs]], |
872 | | &yyvsp[(yyi + 1) - (yynrhs)] |
873 | | , ps); |
874 | | YYFPRINTF (stderr, "\n"); |
875 | | } |
876 | | } |
877 | | |
878 | | # define YY_REDUCE_PRINT(Rule) \ |
879 | | do { \ |
880 | | if (yydebug) \ |
881 | | yy_reduce_print (yyssp, yyvsp, Rule, ps); \ |
882 | | } while (0) |
883 | | |
884 | | /* Nonzero means print parse trace. It is left uninitialized so that |
885 | | multiple parsers can coexist. */ |
886 | | int yydebug; |
887 | | #else /* !PO_GRAM_DEBUG */ |
888 | | # define YYDPRINTF(Args) |
889 | | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
890 | | # define YY_STACK_PRINT(Bottom, Top) |
891 | | # define YY_REDUCE_PRINT(Rule) |
892 | | #endif /* !PO_GRAM_DEBUG */ |
893 | | |
894 | | |
895 | | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
896 | | #ifndef YYINITDEPTH |
897 | 12.0k | # define YYINITDEPTH 200 |
898 | | #endif |
899 | | |
900 | | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
901 | | if the built-in stack extension method is used). |
902 | | |
903 | | Do not make this value too large; the results are undefined if |
904 | | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
905 | | evaluated with infinite-precision integer arithmetic. */ |
906 | | |
907 | | #ifndef YYMAXDEPTH |
908 | 0 | # define YYMAXDEPTH 10000 |
909 | | #endif |
910 | | |
911 | | |
912 | | #if YYERROR_VERBOSE |
913 | | |
914 | | # ifndef yystrlen |
915 | | # if defined __GLIBC__ && defined _STRING_H |
916 | | # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) |
917 | | # else |
918 | | /* Return the length of YYSTR. */ |
919 | | static YYPTRDIFF_T |
920 | | yystrlen (const char *yystr) |
921 | | { |
922 | | YYPTRDIFF_T yylen; |
923 | | for (yylen = 0; yystr[yylen]; yylen++) |
924 | | continue; |
925 | | return yylen; |
926 | | } |
927 | | # endif |
928 | | # endif |
929 | | |
930 | | # ifndef yystpcpy |
931 | | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
932 | | # define yystpcpy stpcpy |
933 | | # else |
934 | | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
935 | | YYDEST. */ |
936 | | static char * |
937 | | yystpcpy (char *yydest, const char *yysrc) |
938 | | { |
939 | | char *yyd = yydest; |
940 | | const char *yys = yysrc; |
941 | | |
942 | | while ((*yyd++ = *yys++) != '\0') |
943 | | continue; |
944 | | |
945 | | return yyd - 1; |
946 | | } |
947 | | # endif |
948 | | # endif |
949 | | |
950 | | # ifndef yytnamerr |
951 | | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
952 | | quotes and backslashes, so that it's suitable for yyerror. The |
953 | | heuristic is that double-quoting is unnecessary unless the string |
954 | | contains an apostrophe, a comma, or backslash (other than |
955 | | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
956 | | null, do not copy; instead, return the length of what the result |
957 | | would have been. */ |
958 | | static YYPTRDIFF_T |
959 | | yytnamerr (char *yyres, const char *yystr) |
960 | | { |
961 | | if (*yystr == '"') |
962 | | { |
963 | | YYPTRDIFF_T yyn = 0; |
964 | | char const *yyp = yystr; |
965 | | |
966 | | for (;;) |
967 | | switch (*++yyp) |
968 | | { |
969 | | case '\'': |
970 | | case ',': |
971 | | goto do_not_strip_quotes; |
972 | | |
973 | | case '\\': |
974 | | if (*++yyp != '\\') |
975 | | goto do_not_strip_quotes; |
976 | | else |
977 | | goto append; |
978 | | |
979 | | append: |
980 | | default: |
981 | | if (yyres) |
982 | | yyres[yyn] = *yyp; |
983 | | yyn++; |
984 | | break; |
985 | | |
986 | | case '"': |
987 | | if (yyres) |
988 | | yyres[yyn] = '\0'; |
989 | | return yyn; |
990 | | } |
991 | | do_not_strip_quotes: ; |
992 | | } |
993 | | |
994 | | if (yyres) |
995 | | return yystpcpy (yyres, yystr) - yyres; |
996 | | else |
997 | | return yystrlen (yystr); |
998 | | } |
999 | | # endif |
1000 | | |
1001 | | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
1002 | | about the unexpected token YYTOKEN for the state stack whose top is |
1003 | | YYSSP. |
1004 | | |
1005 | | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
1006 | | not large enough to hold the message. In that case, also set |
1007 | | *YYMSG_ALLOC to the required number of bytes. Return 2 if the |
1008 | | required number of bytes is too large to store. */ |
1009 | | static int |
1010 | | yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, |
1011 | | yy_state_t *yyssp, int yytoken) |
1012 | | { |
1013 | | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
1014 | | /* Internationalized format string. */ |
1015 | | const char *yyformat = YY_NULLPTR; |
1016 | | /* Arguments of yyformat: reported tokens (one for the "unexpected", |
1017 | | one per "expected"). */ |
1018 | | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
1019 | | /* Actual size of YYARG. */ |
1020 | | int yycount = 0; |
1021 | | /* Cumulated lengths of YYARG. */ |
1022 | | YYPTRDIFF_T yysize = 0; |
1023 | | |
1024 | | /* There are many possibilities here to consider: |
1025 | | - If this state is a consistent state with a default action, then |
1026 | | the only way this function was invoked is if the default action |
1027 | | is an error action. In that case, don't check for expected |
1028 | | tokens because there are none. |
1029 | | - The only way there can be no lookahead present (in yychar) is if |
1030 | | this state is a consistent state with a default action. Thus, |
1031 | | detecting the absence of a lookahead is sufficient to determine |
1032 | | that there is no unexpected or expected token to report. In that |
1033 | | case, just report a simple "syntax error". |
1034 | | - Don't assume there isn't a lookahead just because this state is a |
1035 | | consistent state with a default action. There might have been a |
1036 | | previous inconsistent state, consistent state with a non-default |
1037 | | action, or user semantic action that manipulated yychar. |
1038 | | - Of course, the expected token list depends on states to have |
1039 | | correct lookahead information, and it depends on the parser not |
1040 | | to perform extra reductions after fetching a lookahead from the |
1041 | | scanner and before detecting a syntax error. Thus, state merging |
1042 | | (from LALR or IELR) and default reductions corrupt the expected |
1043 | | token list. However, the list is correct for canonical LR with |
1044 | | one exception: it will still contain any token that will not be |
1045 | | accepted due to an error action in a later state. |
1046 | | */ |
1047 | | if (yytoken != YYEMPTY) |
1048 | | { |
1049 | | int yyn = yypact[+*yyssp]; |
1050 | | YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); |
1051 | | yysize = yysize0; |
1052 | | yyarg[yycount++] = yytname[yytoken]; |
1053 | | if (!yypact_value_is_default (yyn)) |
1054 | | { |
1055 | | /* Start YYX at -YYN if negative to avoid negative indexes in |
1056 | | YYCHECK. In other words, skip the first -YYN actions for |
1057 | | this state because they are default actions. */ |
1058 | | int yyxbegin = yyn < 0 ? -yyn : 0; |
1059 | | /* Stay within bounds of both yycheck and yytname. */ |
1060 | | int yychecklim = YYLAST - yyn + 1; |
1061 | | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
1062 | | int yyx; |
1063 | | |
1064 | | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
1065 | | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR |
1066 | | && !yytable_value_is_error (yytable[yyx + yyn])) |
1067 | | { |
1068 | | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
1069 | | { |
1070 | | yycount = 1; |
1071 | | yysize = yysize0; |
1072 | | break; |
1073 | | } |
1074 | | yyarg[yycount++] = yytname[yyx]; |
1075 | | { |
1076 | | YYPTRDIFF_T yysize1 |
1077 | | = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); |
1078 | | if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) |
1079 | | yysize = yysize1; |
1080 | | else |
1081 | | return 2; |
1082 | | } |
1083 | | } |
1084 | | } |
1085 | | } |
1086 | | |
1087 | | switch (yycount) |
1088 | | { |
1089 | | # define YYCASE_(N, S) \ |
1090 | | case N: \ |
1091 | | yyformat = S; \ |
1092 | | break |
1093 | | default: /* Avoid compiler warnings. */ |
1094 | | YYCASE_(0, YY_("syntax error")); |
1095 | | YYCASE_(1, YY_("syntax error, unexpected %s")); |
1096 | | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); |
1097 | | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); |
1098 | | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); |
1099 | | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
1100 | | # undef YYCASE_ |
1101 | | } |
1102 | | |
1103 | | { |
1104 | | /* Don't count the "%s"s in the final size, but reserve room for |
1105 | | the terminator. */ |
1106 | | YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1; |
1107 | | if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) |
1108 | | yysize = yysize1; |
1109 | | else |
1110 | | return 2; |
1111 | | } |
1112 | | |
1113 | | if (*yymsg_alloc < yysize) |
1114 | | { |
1115 | | *yymsg_alloc = 2 * yysize; |
1116 | | if (! (yysize <= *yymsg_alloc |
1117 | | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
1118 | | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
1119 | | return 1; |
1120 | | } |
1121 | | |
1122 | | /* Avoid sprintf, as that infringes on the user's name space. |
1123 | | Don't have undefined behavior even if the translation |
1124 | | produced a string with the wrong number of "%s"s. */ |
1125 | | { |
1126 | | char *yyp = *yymsg; |
1127 | | int yyi = 0; |
1128 | | while ((*yyp = *yyformat) != '\0') |
1129 | | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) |
1130 | | { |
1131 | | yyp += yytnamerr (yyp, yyarg[yyi++]); |
1132 | | yyformat += 2; |
1133 | | } |
1134 | | else |
1135 | | { |
1136 | | ++yyp; |
1137 | | ++yyformat; |
1138 | | } |
1139 | | } |
1140 | | return 0; |
1141 | | } |
1142 | | #endif /* YYERROR_VERBOSE */ |
1143 | | |
1144 | | /*-----------------------------------------------. |
1145 | | | Release the memory associated to this symbol. | |
1146 | | `-----------------------------------------------*/ |
1147 | | |
1148 | | static void |
1149 | | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct po_parser_state *ps) |
1150 | 66.9M | { |
1151 | 66.9M | YYUSE (yyvaluep); |
1152 | 66.9M | YYUSE (ps); |
1153 | 66.9M | if (!yymsg) |
1154 | 0 | yymsg = "Deleting"; |
1155 | 66.9M | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
1156 | | |
1157 | 66.9M | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1158 | 66.9M | YYUSE (yytype); |
1159 | 66.9M | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1160 | 66.9M | } |
1161 | | |
1162 | | |
1163 | | |
1164 | | |
1165 | | /*----------. |
1166 | | | yyparse. | |
1167 | | `----------*/ |
1168 | | |
1169 | | int |
1170 | | yyparse (struct po_parser_state *ps) |
1171 | 12.0k | { |
1172 | | /* The lookahead symbol. */ |
1173 | 12.0k | int yychar; |
1174 | | |
1175 | | |
1176 | | /* The semantic value of the lookahead symbol. */ |
1177 | | /* Default value used for initialization, for pacifying older GCCs |
1178 | | or non-GCC compilers. */ |
1179 | 12.0k | YY_INITIAL_VALUE (static YYSTYPE yyval_default;) |
1180 | 12.0k | YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); |
1181 | | |
1182 | | /* Number of syntax errors so far. */ |
1183 | 12.0k | int yynerrs; |
1184 | | |
1185 | 12.0k | yy_state_fast_t yystate; |
1186 | | /* Number of tokens to shift before error messages enabled. */ |
1187 | 12.0k | int yyerrstatus; |
1188 | | |
1189 | | /* The stacks and their tools: |
1190 | | 'yyss': related to states. |
1191 | | 'yyvs': related to semantic values. |
1192 | | |
1193 | | Refer to the stacks through separate pointers, to allow yyoverflow |
1194 | | to reallocate them elsewhere. */ |
1195 | | |
1196 | | /* The state stack. */ |
1197 | 12.0k | yy_state_t yyssa[YYINITDEPTH]; |
1198 | 12.0k | yy_state_t *yyss; |
1199 | 12.0k | yy_state_t *yyssp; |
1200 | | |
1201 | | /* The semantic value stack. */ |
1202 | 12.0k | YYSTYPE yyvsa[YYINITDEPTH]; |
1203 | 12.0k | YYSTYPE *yyvs; |
1204 | 12.0k | YYSTYPE *yyvsp; |
1205 | | |
1206 | 12.0k | YYPTRDIFF_T yystacksize; |
1207 | | |
1208 | 12.0k | int yyn; |
1209 | 12.0k | int yyresult; |
1210 | | /* Lookahead token as an internal (translated) token number. */ |
1211 | 12.0k | int yytoken = 0; |
1212 | | /* The variables used to return semantic value and location from the |
1213 | | action routines. */ |
1214 | 12.0k | YYSTYPE yyval; |
1215 | | |
1216 | | #if YYERROR_VERBOSE |
1217 | | /* Buffer for error messages, and its allocated size. */ |
1218 | | char yymsgbuf[128]; |
1219 | | char *yymsg = yymsgbuf; |
1220 | | YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; |
1221 | | #endif |
1222 | | |
1223 | 71.0M | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
1224 | | |
1225 | | /* The number of symbols on the RHS of the reduced rule. |
1226 | | Keep to zero when no symbol should be popped. */ |
1227 | 12.0k | int yylen = 0; |
1228 | | |
1229 | 12.0k | yyssp = yyss = yyssa; |
1230 | 12.0k | yyvsp = yyvs = yyvsa; |
1231 | 12.0k | yystacksize = YYINITDEPTH; |
1232 | | |
1233 | 12.0k | YYDPRINTF ((stderr, "Starting parse\n")); |
1234 | | |
1235 | 12.0k | yystate = 0; |
1236 | 12.0k | yyerrstatus = 0; |
1237 | 12.0k | yynerrs = 0; |
1238 | 12.0k | yychar = YYEMPTY; /* Cause a token to be read. */ |
1239 | 12.0k | goto yysetstate; |
1240 | | |
1241 | | |
1242 | | /*------------------------------------------------------------. |
1243 | | | yynewstate -- push a new state, which is found in yystate. | |
1244 | | `------------------------------------------------------------*/ |
1245 | 140M | yynewstate: |
1246 | | /* In all cases, when you get here, the value and location stacks |
1247 | | have just been pushed. So pushing a state here evens the stacks. */ |
1248 | 140M | yyssp++; |
1249 | | |
1250 | | |
1251 | | /*--------------------------------------------------------------------. |
1252 | | | yysetstate -- set current state (the top of the stack) to yystate. | |
1253 | | `--------------------------------------------------------------------*/ |
1254 | 140M | yysetstate: |
1255 | 140M | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
1256 | 140M | YY_ASSERT (0 <= yystate && yystate < YYNSTATES); |
1257 | 140M | YY_IGNORE_USELESS_CAST_BEGIN |
1258 | 140M | *yyssp = YY_CAST (yy_state_t, yystate); |
1259 | 140M | YY_IGNORE_USELESS_CAST_END |
1260 | | |
1261 | 140M | if (yyss + yystacksize - 1 <= yyssp) |
1262 | | #if !defined yyoverflow && !defined YYSTACK_RELOCATE |
1263 | | goto yyexhaustedlab; |
1264 | | #else |
1265 | 0 | { |
1266 | | /* Get the current used size of the three stacks, in elements. */ |
1267 | 0 | YYPTRDIFF_T yysize = yyssp - yyss + 1; |
1268 | |
|
1269 | | # if defined yyoverflow |
1270 | | { |
1271 | | /* Give user a chance to reallocate the stack. Use copies of |
1272 | | these so that the &'s don't force the real ones into |
1273 | | memory. */ |
1274 | | yy_state_t *yyss1 = yyss; |
1275 | | YYSTYPE *yyvs1 = yyvs; |
1276 | | |
1277 | | /* Each stack pointer address is followed by the size of the |
1278 | | data in use in that stack, in bytes. This used to be a |
1279 | | conditional around just the two extra args, but that might |
1280 | | be undefined if yyoverflow is a macro. */ |
1281 | | yyoverflow (YY_("memory exhausted"), |
1282 | | &yyss1, yysize * YYSIZEOF (*yyssp), |
1283 | | &yyvs1, yysize * YYSIZEOF (*yyvsp), |
1284 | | &yystacksize); |
1285 | | yyss = yyss1; |
1286 | | yyvs = yyvs1; |
1287 | | } |
1288 | | # else /* defined YYSTACK_RELOCATE */ |
1289 | | /* Extend the stack our own way. */ |
1290 | 0 | if (YYMAXDEPTH <= yystacksize) |
1291 | 0 | goto yyexhaustedlab; |
1292 | 0 | yystacksize *= 2; |
1293 | 0 | if (YYMAXDEPTH < yystacksize) |
1294 | 0 | yystacksize = YYMAXDEPTH; |
1295 | |
|
1296 | 0 | { |
1297 | 0 | yy_state_t *yyss1 = yyss; |
1298 | 0 | union yyalloc *yyptr = |
1299 | 0 | YY_CAST (union yyalloc *, |
1300 | 0 | YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); |
1301 | 0 | if (! yyptr) |
1302 | 0 | goto yyexhaustedlab; |
1303 | 0 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
1304 | 0 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
1305 | 0 | # undef YYSTACK_RELOCATE |
1306 | 0 | if (yyss1 != yyssa) |
1307 | 0 | YYSTACK_FREE (yyss1); |
1308 | 0 | } |
1309 | 0 | # endif |
1310 | | |
1311 | 0 | yyssp = yyss + yysize - 1; |
1312 | 0 | yyvsp = yyvs + yysize - 1; |
1313 | |
|
1314 | 0 | YY_IGNORE_USELESS_CAST_BEGIN |
1315 | 0 | YYDPRINTF ((stderr, "Stack size increased to %ld\n", |
1316 | 0 | YY_CAST (long, yystacksize))); |
1317 | 0 | YY_IGNORE_USELESS_CAST_END |
1318 | |
|
1319 | 0 | if (yyss + yystacksize - 1 <= yyssp) |
1320 | 0 | YYABORT; |
1321 | 0 | } |
1322 | 140M | #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ |
1323 | | |
1324 | 140M | if (yystate == YYFINAL) |
1325 | 12.0k | YYACCEPT; |
1326 | | |
1327 | 140M | goto yybackup; |
1328 | | |
1329 | | |
1330 | | /*-----------. |
1331 | | | yybackup. | |
1332 | | `-----------*/ |
1333 | 140M | yybackup: |
1334 | | /* Do appropriate processing given the current state. Read a |
1335 | | lookahead token if we need one and don't already have one. */ |
1336 | | |
1337 | | /* First try to decide what to do without reference to lookahead token. */ |
1338 | 140M | yyn = yypact[yystate]; |
1339 | 140M | if (yypact_value_is_default (yyn)) |
1340 | 70.7M | goto yydefault; |
1341 | | |
1342 | | /* Not known => get a lookahead token if don't already have one. */ |
1343 | | |
1344 | | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
1345 | 69.4M | if (yychar == YYEMPTY) |
1346 | 68.9M | { |
1347 | 68.9M | YYDPRINTF ((stderr, "Reading a token: ")); |
1348 | 68.9M | yychar = yylex (&yylval, ps); |
1349 | 68.9M | } |
1350 | | |
1351 | 69.4M | if (yychar <= YYEOF) |
1352 | 13.9k | { |
1353 | 13.9k | yychar = yytoken = YYEOF; |
1354 | 13.9k | YYDPRINTF ((stderr, "Now at end of input.\n")); |
1355 | 13.9k | } |
1356 | 69.4M | else |
1357 | 69.4M | { |
1358 | 69.4M | yytoken = YYTRANSLATE (yychar); |
1359 | 69.4M | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
1360 | 69.4M | } |
1361 | | |
1362 | | /* If the proper action on seeing token YYTOKEN is to reduce or to |
1363 | | detect an error, take that action. */ |
1364 | 69.4M | yyn += yytoken; |
1365 | 69.4M | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
1366 | 67.3M | goto yydefault; |
1367 | 2.07M | yyn = yytable[yyn]; |
1368 | 2.07M | if (yyn <= 0) |
1369 | 0 | { |
1370 | 0 | if (yytable_value_is_error (yyn)) |
1371 | 0 | goto yyerrlab; |
1372 | 0 | yyn = -yyn; |
1373 | 0 | goto yyreduce; |
1374 | 0 | } |
1375 | | |
1376 | | /* Count tokens shifted since error; after three, turn off error |
1377 | | status. */ |
1378 | 2.07M | if (yyerrstatus) |
1379 | 687k | yyerrstatus--; |
1380 | | |
1381 | | /* Shift the lookahead token. */ |
1382 | 2.07M | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
1383 | 2.07M | yystate = yyn; |
1384 | 2.07M | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1385 | 2.07M | *++yyvsp = yylval; |
1386 | 2.07M | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1387 | | |
1388 | | /* Discard the shifted token. */ |
1389 | 2.07M | yychar = YYEMPTY; |
1390 | 2.07M | goto yynewstate; |
1391 | | |
1392 | | |
1393 | | /*-----------------------------------------------------------. |
1394 | | | yydefault -- do the default action for the current state. | |
1395 | | `-----------------------------------------------------------*/ |
1396 | 138M | yydefault: |
1397 | 138M | yyn = yydefact[yystate]; |
1398 | 138M | if (yyn == 0) |
1399 | 67.1M | goto yyerrlab; |
1400 | 70.9M | goto yyreduce; |
1401 | | |
1402 | | |
1403 | | /*-----------------------------. |
1404 | | | yyreduce -- do a reduction. | |
1405 | | `-----------------------------*/ |
1406 | 70.9M | yyreduce: |
1407 | | /* yyn is the number of a rule to reduce with. */ |
1408 | 70.9M | yylen = yyr2[yyn]; |
1409 | | |
1410 | | /* If YYLEN is nonzero, implement the default value of the action: |
1411 | | '$$ = $1'. |
1412 | | |
1413 | | Otherwise, the following line sets YYVAL to garbage. |
1414 | | This behavior is undocumented and Bison |
1415 | | users should not rely upon it. Assigning to YYVAL |
1416 | | unconditionally makes the parser a bit smaller, and it avoids a |
1417 | | GCC warning that YYVAL may be used uninitialized. */ |
1418 | 70.9M | yyval = yyvsp[1-yylen]; |
1419 | | |
1420 | | |
1421 | 70.9M | YY_REDUCE_PRINT (yyn); |
1422 | 70.9M | switch (yyn) |
1423 | 70.9M | { |
1424 | 1.28M | case 7: |
1425 | 1.28M | #line 141 "read-po-gram.y" |
1426 | 1.28M | { |
1427 | 1.28M | catalog_reader_seen_generic_comment (ps->catr, (yyvsp[0].string).string); |
1428 | 1.28M | } |
1429 | 1.28M | #line 1430 "read-po-gram.c" |
1430 | 1.28M | break; |
1431 | | |
1432 | 5.22k | case 8: |
1433 | 5.22k | #line 149 "read-po-gram.y" |
1434 | 5.22k | { |
1435 | 5.22k | catalog_reader_seen_domain (ps->catr, (yyvsp[0].string).string, |
1436 | 5.22k | &ps->gram_pos); |
1437 | 5.22k | } |
1438 | 5.22k | #line 1439 "read-po-gram.c" |
1439 | 5.22k | break; |
1440 | | |
1441 | 97.2k | case 9: |
1442 | 97.2k | #line 158 "read-po-gram.y" |
1443 | 97.2k | { |
1444 | 97.2k | char *string2 = string_list_concat_destroy (&(yyvsp[-2].stringlist).stringlist); |
1445 | 97.2k | char *string4 = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist); |
1446 | | |
1447 | 97.2k | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-2].stringlist)); |
1448 | 97.2k | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-1].pos)); |
1449 | 97.2k | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[0].stringlist)); |
1450 | 97.2k | if (!(yyvsp[-3].message_intro).obsolete || ps->catr->pass_obsolete_entries) |
1451 | 97.2k | do_callback_message (ps, (yyvsp[-3].message_intro).ctxt, string2, &(yyvsp[-3].message_intro).pos, NULL, |
1452 | 97.2k | string4, strlen (string4) + 1, &(yyvsp[-1].pos).pos, |
1453 | 97.2k | (yyvsp[-3].message_intro).prev_ctxt, |
1454 | 97.2k | (yyvsp[-3].message_intro).prev_id, (yyvsp[-3].message_intro).prev_id_plural, |
1455 | 97.2k | (yyvsp[-3].message_intro).obsolete); |
1456 | 0 | else |
1457 | 0 | { |
1458 | 0 | free_message_intro ((yyvsp[-3].message_intro)); |
1459 | 0 | free (string2); |
1460 | 0 | free (string4); |
1461 | 0 | } |
1462 | 97.2k | } |
1463 | 97.2k | #line 1464 "read-po-gram.c" |
1464 | 97.2k | break; |
1465 | | |
1466 | 0 | case 10: |
1467 | 0 | #line 179 "read-po-gram.y" |
1468 | 0 | { |
1469 | 0 | char *string2 = string_list_concat_destroy (&(yyvsp[-2].stringlist).stringlist); |
1470 | |
|
1471 | 0 | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-2].stringlist)); |
1472 | 0 | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-1].string)); |
1473 | 0 | check_obsolete ((yyvsp[-3].message_intro), (yyvsp[0].rhs)); |
1474 | 0 | if (!(yyvsp[-3].message_intro).obsolete || ps->catr->pass_obsolete_entries) |
1475 | 0 | do_callback_message (ps, (yyvsp[-3].message_intro).ctxt, string2, &(yyvsp[-3].message_intro).pos, (yyvsp[-1].string).string, |
1476 | 0 | (yyvsp[0].rhs).rhs.msgstr, (yyvsp[0].rhs).rhs.msgstr_len, &(yyvsp[0].rhs).pos, |
1477 | 0 | (yyvsp[-3].message_intro).prev_ctxt, |
1478 | 0 | (yyvsp[-3].message_intro).prev_id, (yyvsp[-3].message_intro).prev_id_plural, |
1479 | 0 | (yyvsp[-3].message_intro).obsolete); |
1480 | 0 | else |
1481 | 0 | { |
1482 | 0 | free_message_intro ((yyvsp[-3].message_intro)); |
1483 | 0 | free (string2); |
1484 | 0 | free ((yyvsp[-1].string).string); |
1485 | 0 | free ((yyvsp[0].rhs).rhs.msgstr); |
1486 | 0 | } |
1487 | 0 | } |
1488 | 0 | #line 1489 "read-po-gram.c" |
1489 | 0 | break; |
1490 | | |
1491 | 3.29k | case 11: |
1492 | 3.29k | #line 200 "read-po-gram.y" |
1493 | 3.29k | { |
1494 | 3.29k | check_obsolete ((yyvsp[-2].message_intro), (yyvsp[-1].stringlist)); |
1495 | 3.29k | check_obsolete ((yyvsp[-2].message_intro), (yyvsp[0].string)); |
1496 | 3.29k | po_gram_error_at_line (ps->catr, &(yyvsp[-2].message_intro).pos, _("missing 'msgstr[]' section")); |
1497 | 3.29k | free_message_intro ((yyvsp[-2].message_intro)); |
1498 | 3.29k | string_list_destroy (&(yyvsp[-1].stringlist).stringlist); |
1499 | 3.29k | free ((yyvsp[0].string).string); |
1500 | 3.29k | } |
1501 | 3.29k | #line 1502 "read-po-gram.c" |
1502 | 3.29k | break; |
1503 | | |
1504 | 0 | case 12: |
1505 | 0 | #line 209 "read-po-gram.y" |
1506 | 0 | { |
1507 | 0 | check_obsolete ((yyvsp[-2].message_intro), (yyvsp[-1].stringlist)); |
1508 | 0 | check_obsolete ((yyvsp[-2].message_intro), (yyvsp[0].rhs)); |
1509 | 0 | po_gram_error_at_line (ps->catr, &(yyvsp[-2].message_intro).pos, _("missing 'msgid_plural' section")); |
1510 | 0 | free_message_intro ((yyvsp[-2].message_intro)); |
1511 | 0 | string_list_destroy (&(yyvsp[-1].stringlist).stringlist); |
1512 | 0 | free ((yyvsp[0].rhs).rhs.msgstr); |
1513 | 0 | } |
1514 | 0 | #line 1515 "read-po-gram.c" |
1515 | 0 | break; |
1516 | | |
1517 | 59.1k | case 13: |
1518 | 59.1k | #line 218 "read-po-gram.y" |
1519 | 59.1k | { |
1520 | 59.1k | check_obsolete ((yyvsp[-1].message_intro), (yyvsp[0].stringlist)); |
1521 | 59.1k | po_gram_error_at_line (ps->catr, &(yyvsp[-1].message_intro).pos, _("missing 'msgstr' section")); |
1522 | 59.1k | free_message_intro ((yyvsp[-1].message_intro)); |
1523 | 59.1k | string_list_destroy (&(yyvsp[0].stringlist).stringlist); |
1524 | 59.1k | } |
1525 | 59.1k | #line 1526 "read-po-gram.c" |
1526 | 59.1k | break; |
1527 | | |
1528 | 167k | case 14: |
1529 | 167k | #line 229 "read-po-gram.y" |
1530 | 167k | { |
1531 | 167k | (yyval.message_intro).prev_ctxt = NULL; |
1532 | 167k | (yyval.message_intro).prev_id = NULL; |
1533 | 167k | (yyval.message_intro).prev_id_plural = NULL; |
1534 | 167k | (yyval.message_intro).ctxt = (yyvsp[0].string).string; |
1535 | 167k | (yyval.message_intro).pos = (yyvsp[0].string).pos; |
1536 | 167k | (yyval.message_intro).obsolete = (yyvsp[0].string).obsolete; |
1537 | 167k | } |
1538 | 167k | #line 1539 "read-po-gram.c" |
1539 | 167k | break; |
1540 | | |
1541 | 3.78k | case 15: |
1542 | 3.78k | #line 238 "read-po-gram.y" |
1543 | 3.78k | { |
1544 | 3.78k | check_obsolete ((yyvsp[-1].prev), (yyvsp[0].string)); |
1545 | 3.78k | (yyval.message_intro).prev_ctxt = (yyvsp[-1].prev).ctxt; |
1546 | 3.78k | (yyval.message_intro).prev_id = (yyvsp[-1].prev).id; |
1547 | 3.78k | (yyval.message_intro).prev_id_plural = (yyvsp[-1].prev).id_plural; |
1548 | 3.78k | (yyval.message_intro).ctxt = (yyvsp[0].string).string; |
1549 | 3.78k | (yyval.message_intro).pos = (yyvsp[0].string).pos; |
1550 | 3.78k | (yyval.message_intro).obsolete = (yyvsp[0].string).obsolete; |
1551 | 3.78k | } |
1552 | 3.78k | #line 1553 "read-po-gram.c" |
1553 | 3.78k | break; |
1554 | | |
1555 | 7.37k | case 16: |
1556 | 7.37k | #line 252 "read-po-gram.y" |
1557 | 7.37k | { |
1558 | 7.37k | check_obsolete ((yyvsp[-1].string), (yyvsp[0].stringlist)); |
1559 | 7.37k | (yyval.prev).ctxt = (yyvsp[-1].string).string; |
1560 | 7.37k | (yyval.prev).id = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist); |
1561 | 7.37k | (yyval.prev).id_plural = NULL; |
1562 | 7.37k | (yyval.prev).pos = (yyvsp[-1].string).pos; |
1563 | 7.37k | (yyval.prev).obsolete = (yyvsp[-1].string).obsolete; |
1564 | 7.37k | } |
1565 | 7.37k | #line 1566 "read-po-gram.c" |
1566 | 7.37k | break; |
1567 | | |
1568 | 1.95k | case 17: |
1569 | 1.95k | #line 261 "read-po-gram.y" |
1570 | 1.95k | { |
1571 | 1.95k | check_obsolete ((yyvsp[-2].string), (yyvsp[-1].stringlist)); |
1572 | 1.95k | check_obsolete ((yyvsp[-2].string), (yyvsp[0].string)); |
1573 | 1.95k | (yyval.prev).ctxt = (yyvsp[-2].string).string; |
1574 | 1.95k | (yyval.prev).id = string_list_concat_destroy (&(yyvsp[-1].stringlist).stringlist); |
1575 | 1.95k | (yyval.prev).id_plural = (yyvsp[0].string).string; |
1576 | 1.95k | (yyval.prev).pos = (yyvsp[-2].string).pos; |
1577 | 1.95k | (yyval.prev).obsolete = (yyvsp[-2].string).obsolete; |
1578 | 1.95k | } |
1579 | 1.95k | #line 1580 "read-po-gram.c" |
1580 | 1.95k | break; |
1581 | | |
1582 | 163k | case 18: |
1583 | 163k | #line 275 "read-po-gram.y" |
1584 | 163k | { |
1585 | 163k | (yyval.string).string = NULL; |
1586 | 163k | (yyval.string).pos = (yyvsp[0].pos).pos; |
1587 | 163k | (yyval.string).obsolete = (yyvsp[0].pos).obsolete; |
1588 | 163k | } |
1589 | 163k | #line 1590 "read-po-gram.c" |
1590 | 163k | break; |
1591 | | |
1592 | 8.13k | case 19: |
1593 | 8.13k | #line 281 "read-po-gram.y" |
1594 | 8.13k | { |
1595 | 8.13k | check_obsolete ((yyvsp[-2].pos), (yyvsp[-1].stringlist)); |
1596 | 8.13k | check_obsolete ((yyvsp[-2].pos), (yyvsp[0].pos)); |
1597 | 8.13k | (yyval.string).string = string_list_concat_destroy (&(yyvsp[-1].stringlist).stringlist); |
1598 | 8.13k | (yyval.string).pos = (yyvsp[0].pos).pos; |
1599 | 8.13k | (yyval.string).obsolete = (yyvsp[0].pos).obsolete; |
1600 | 8.13k | } |
1601 | 8.13k | #line 1602 "read-po-gram.c" |
1602 | 8.13k | break; |
1603 | | |
1604 | 7.65k | case 20: |
1605 | 7.65k | #line 292 "read-po-gram.y" |
1606 | 7.65k | { |
1607 | 7.65k | (yyval.string).string = NULL; |
1608 | 7.65k | (yyval.string).pos = (yyvsp[0].pos).pos; |
1609 | 7.65k | (yyval.string).obsolete = (yyvsp[0].pos).obsolete; |
1610 | 7.65k | } |
1611 | 7.65k | #line 1612 "read-po-gram.c" |
1612 | 7.65k | break; |
1613 | | |
1614 | 3.24k | case 21: |
1615 | 3.24k | #line 298 "read-po-gram.y" |
1616 | 3.24k | { |
1617 | 3.24k | check_obsolete ((yyvsp[-2].pos), (yyvsp[-1].stringlist)); |
1618 | 3.24k | check_obsolete ((yyvsp[-2].pos), (yyvsp[0].pos)); |
1619 | 3.24k | (yyval.string).string = string_list_concat_destroy (&(yyvsp[-1].stringlist).stringlist); |
1620 | 3.24k | (yyval.string).pos = (yyvsp[0].pos).pos; |
1621 | 3.24k | (yyval.string).obsolete = (yyvsp[0].pos).obsolete; |
1622 | 3.24k | } |
1623 | 3.24k | #line 1624 "read-po-gram.c" |
1624 | 3.24k | break; |
1625 | | |
1626 | 3.29k | case 22: |
1627 | 3.29k | #line 310 "read-po-gram.y" |
1628 | 3.29k | { |
1629 | 3.29k | check_obsolete ((yyvsp[-1].pos), (yyvsp[0].stringlist)); |
1630 | 3.29k | ps->plural_counter = 0; |
1631 | 3.29k | (yyval.string).string = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist); |
1632 | 3.29k | (yyval.string).pos = (yyvsp[-1].pos).pos; |
1633 | 3.29k | (yyval.string).obsolete = (yyvsp[-1].pos).obsolete; |
1634 | 3.29k | } |
1635 | 3.29k | #line 1636 "read-po-gram.c" |
1636 | 3.29k | break; |
1637 | | |
1638 | 1.95k | case 23: |
1639 | 1.95k | #line 321 "read-po-gram.y" |
1640 | 1.95k | { |
1641 | 1.95k | check_obsolete ((yyvsp[-1].pos), (yyvsp[0].stringlist)); |
1642 | 1.95k | (yyval.string).string = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist); |
1643 | 1.95k | (yyval.string).pos = (yyvsp[-1].pos).pos; |
1644 | 1.95k | (yyval.string).obsolete = (yyvsp[-1].pos).obsolete; |
1645 | 1.95k | } |
1646 | 1.95k | #line 1647 "read-po-gram.c" |
1647 | 1.95k | break; |
1648 | | |
1649 | 0 | case 24: |
1650 | 0 | #line 332 "read-po-gram.y" |
1651 | 0 | { |
1652 | 0 | (yyval.rhs) = (yyvsp[0].rhs); |
1653 | 0 | } |
1654 | 0 | #line 1655 "read-po-gram.c" |
1655 | 0 | break; |
1656 | | |
1657 | 0 | case 25: |
1658 | 0 | #line 336 "read-po-gram.y" |
1659 | 0 | { |
1660 | 0 | check_obsolete ((yyvsp[-1].rhs), (yyvsp[0].rhs)); |
1661 | 0 | (yyval.rhs).rhs.msgstr = XNMALLOC ((yyvsp[-1].rhs).rhs.msgstr_len + (yyvsp[0].rhs).rhs.msgstr_len, char); |
1662 | 0 | memcpy ((yyval.rhs).rhs.msgstr, (yyvsp[-1].rhs).rhs.msgstr, (yyvsp[-1].rhs).rhs.msgstr_len); |
1663 | 0 | memcpy ((yyval.rhs).rhs.msgstr + (yyvsp[-1].rhs).rhs.msgstr_len, (yyvsp[0].rhs).rhs.msgstr, (yyvsp[0].rhs).rhs.msgstr_len); |
1664 | 0 | (yyval.rhs).rhs.msgstr_len = (yyvsp[-1].rhs).rhs.msgstr_len + (yyvsp[0].rhs).rhs.msgstr_len; |
1665 | 0 | free ((yyvsp[-1].rhs).rhs.msgstr); |
1666 | 0 | free ((yyvsp[0].rhs).rhs.msgstr); |
1667 | 0 | (yyval.rhs).pos = (yyvsp[-1].rhs).pos; |
1668 | 0 | (yyval.rhs).obsolete = (yyvsp[-1].rhs).obsolete; |
1669 | 0 | } |
1670 | 0 | #line 1671 "read-po-gram.c" |
1671 | 0 | break; |
1672 | | |
1673 | 0 | case 26: |
1674 | 0 | #line 351 "read-po-gram.y" |
1675 | 0 | { |
1676 | 0 | check_obsolete ((yyvsp[-4].pos), (yyvsp[-3].pos)); |
1677 | 0 | check_obsolete ((yyvsp[-4].pos), (yyvsp[-2].number)); |
1678 | 0 | check_obsolete ((yyvsp[-4].pos), (yyvsp[-1].pos)); |
1679 | 0 | check_obsolete ((yyvsp[-4].pos), (yyvsp[0].stringlist)); |
1680 | 0 | if ((yyvsp[-2].number).number != ps->plural_counter) |
1681 | 0 | { |
1682 | 0 | if (ps->plural_counter == 0) |
1683 | 0 | po_gram_error_at_line (ps->catr, &(yyvsp[-4].pos).pos, _("first plural form has nonzero index")); |
1684 | 0 | else |
1685 | 0 | po_gram_error_at_line (ps->catr, &(yyvsp[-4].pos).pos, _("plural form has wrong index")); |
1686 | 0 | } |
1687 | 0 | ps->plural_counter++; |
1688 | 0 | (yyval.rhs).rhs.msgstr = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist); |
1689 | 0 | (yyval.rhs).rhs.msgstr_len = strlen ((yyval.rhs).rhs.msgstr) + 1; |
1690 | 0 | (yyval.rhs).pos = (yyvsp[-4].pos).pos; |
1691 | 0 | (yyval.rhs).obsolete = (yyvsp[-4].pos).obsolete; |
1692 | 0 | } |
1693 | 0 | #line 1694 "read-po-gram.c" |
1694 | 0 | break; |
1695 | | |
1696 | 276k | case 27: |
1697 | 276k | #line 374 "read-po-gram.y" |
1698 | 276k | { |
1699 | 276k | string_list_init (&(yyval.stringlist).stringlist); |
1700 | 276k | string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string); |
1701 | 276k | free ((yyvsp[0].string).string); |
1702 | 276k | (yyval.stringlist).pos = (yyvsp[0].string).pos; |
1703 | 276k | (yyval.stringlist).obsolete = (yyvsp[0].string).obsolete; |
1704 | 276k | } |
1705 | 276k | #line 1706 "read-po-gram.c" |
1706 | 276k | break; |
1707 | | |
1708 | 165k | case 28: |
1709 | 165k | #line 382 "read-po-gram.y" |
1710 | 165k | { |
1711 | 165k | check_obsolete ((yyvsp[-1].stringlist), (yyvsp[0].string)); |
1712 | 165k | (yyval.stringlist).stringlist = (yyvsp[-1].stringlist).stringlist; |
1713 | 165k | string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string); |
1714 | 165k | free ((yyvsp[0].string).string); |
1715 | 165k | (yyval.stringlist).pos = (yyvsp[-1].stringlist).pos; |
1716 | 165k | (yyval.stringlist).obsolete = (yyvsp[-1].stringlist).obsolete; |
1717 | 165k | } |
1718 | 165k | #line 1719 "read-po-gram.c" |
1719 | 165k | break; |
1720 | | |
1721 | 15.7k | case 29: |
1722 | 15.7k | #line 394 "read-po-gram.y" |
1723 | 15.7k | { |
1724 | 15.7k | string_list_init (&(yyval.stringlist).stringlist); |
1725 | 15.7k | string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string); |
1726 | 15.7k | free ((yyvsp[0].string).string); |
1727 | 15.7k | (yyval.stringlist).pos = (yyvsp[0].string).pos; |
1728 | 15.7k | (yyval.stringlist).obsolete = (yyvsp[0].string).obsolete; |
1729 | 15.7k | } |
1730 | 15.7k | #line 1731 "read-po-gram.c" |
1731 | 15.7k | break; |
1732 | | |
1733 | 5.34k | case 30: |
1734 | 5.34k | #line 402 "read-po-gram.y" |
1735 | 5.34k | { |
1736 | 5.34k | check_obsolete ((yyvsp[-1].stringlist), (yyvsp[0].string)); |
1737 | 5.34k | (yyval.stringlist).stringlist = (yyvsp[-1].stringlist).stringlist; |
1738 | 5.34k | string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string); |
1739 | 5.34k | free ((yyvsp[0].string).string); |
1740 | 5.34k | (yyval.stringlist).pos = (yyvsp[-1].stringlist).pos; |
1741 | 5.34k | (yyval.stringlist).obsolete = (yyvsp[-1].stringlist).obsolete; |
1742 | 5.34k | } |
1743 | 5.34k | #line 1744 "read-po-gram.c" |
1744 | 5.34k | break; |
1745 | | |
1746 | | |
1747 | 0 | #line 1748 "read-po-gram.c" |
1748 | | |
1749 | 68.6M | default: break; |
1750 | 70.9M | } |
1751 | | /* User semantic actions sometimes alter yychar, and that requires |
1752 | | that yytoken be updated with the new translation. We take the |
1753 | | approach of translating immediately before every use of yytoken. |
1754 | | One alternative is translating here after every semantic action, |
1755 | | but that translation would be missed if the semantic action invokes |
1756 | | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
1757 | | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
1758 | | incorrect destructor might then be invoked immediately. In the |
1759 | | case of YYERROR or YYBACKUP, subsequent parser actions might lead |
1760 | | to an incorrect destructor call or verbose syntax error message |
1761 | | before the lookahead is translated. */ |
1762 | 70.9M | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
1763 | | |
1764 | 70.9M | YYPOPSTACK (yylen); |
1765 | 70.9M | yylen = 0; |
1766 | 70.9M | YY_STACK_PRINT (yyss, yyssp); |
1767 | | |
1768 | 70.9M | *++yyvsp = yyval; |
1769 | | |
1770 | | /* Now 'shift' the result of the reduction. Determine what state |
1771 | | that goes to, based on the state we popped back to and the rule |
1772 | | number reduced by. */ |
1773 | 70.9M | { |
1774 | 70.9M | const int yylhs = yyr1[yyn] - YYNTOKENS; |
1775 | 70.9M | const int yyi = yypgoto[yylhs] + *yyssp; |
1776 | 70.9M | yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp |
1777 | 70.9M | ? yytable[yyi] |
1778 | 70.9M | : yydefgoto[yylhs]); |
1779 | 70.9M | } |
1780 | | |
1781 | 70.9M | goto yynewstate; |
1782 | | |
1783 | | |
1784 | | /*--------------------------------------. |
1785 | | | yyerrlab -- here on detecting error. | |
1786 | | `--------------------------------------*/ |
1787 | 67.1M | yyerrlab: |
1788 | | /* Make sure we have latest lookahead translation. See comments at |
1789 | | user semantic actions for why this is necessary. */ |
1790 | 67.1M | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
1791 | | |
1792 | | /* If not already recovering from an error, report this error. */ |
1793 | 67.1M | if (!yyerrstatus) |
1794 | 165k | { |
1795 | 165k | ++yynerrs; |
1796 | 165k | #if ! YYERROR_VERBOSE |
1797 | 165k | yyerror (ps, YY_("syntax error")); |
1798 | | #else |
1799 | | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
1800 | | yyssp, yytoken) |
1801 | | { |
1802 | | char const *yymsgp = YY_("syntax error"); |
1803 | | int yysyntax_error_status; |
1804 | | yysyntax_error_status = YYSYNTAX_ERROR; |
1805 | | if (yysyntax_error_status == 0) |
1806 | | yymsgp = yymsg; |
1807 | | else if (yysyntax_error_status == 1) |
1808 | | { |
1809 | | if (yymsg != yymsgbuf) |
1810 | | YYSTACK_FREE (yymsg); |
1811 | | yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); |
1812 | | if (!yymsg) |
1813 | | { |
1814 | | yymsg = yymsgbuf; |
1815 | | yymsg_alloc = sizeof yymsgbuf; |
1816 | | yysyntax_error_status = 2; |
1817 | | } |
1818 | | else |
1819 | | { |
1820 | | yysyntax_error_status = YYSYNTAX_ERROR; |
1821 | | yymsgp = yymsg; |
1822 | | } |
1823 | | } |
1824 | | yyerror (ps, yymsgp); |
1825 | | if (yysyntax_error_status == 2) |
1826 | | goto yyexhaustedlab; |
1827 | | } |
1828 | | # undef YYSYNTAX_ERROR |
1829 | | #endif |
1830 | 165k | } |
1831 | | |
1832 | | |
1833 | | |
1834 | 67.1M | if (yyerrstatus == 3) |
1835 | 66.8M | { |
1836 | | /* If just tried and failed to reuse lookahead token after an |
1837 | | error, discard it. */ |
1838 | | |
1839 | 66.8M | if (yychar <= YYEOF) |
1840 | 0 | { |
1841 | | /* Return failure if at end of input. */ |
1842 | 0 | if (yychar == YYEOF) |
1843 | 0 | YYABORT; |
1844 | 0 | } |
1845 | 66.8M | else |
1846 | 66.8M | { |
1847 | 66.8M | yydestruct ("Error: discarding", |
1848 | 66.8M | yytoken, &yylval, ps); |
1849 | 66.8M | yychar = YYEMPTY; |
1850 | 66.8M | } |
1851 | 66.8M | } |
1852 | | |
1853 | | /* Else will try to reuse lookahead token after shifting the error |
1854 | | token. */ |
1855 | 67.1M | goto yyerrlab1; |
1856 | | |
1857 | | |
1858 | | /*---------------------------------------------------. |
1859 | | | yyerrorlab -- error raised explicitly by YYERROR. | |
1860 | | `---------------------------------------------------*/ |
1861 | 67.1M | yyerrorlab: |
1862 | | /* Pacify compilers when the user code never invokes YYERROR and the |
1863 | | label yyerrorlab therefore never appears in user code. */ |
1864 | 0 | if (0) |
1865 | 0 | YYERROR; |
1866 | | |
1867 | | /* Do not reclaim the symbols of the rule whose action triggered |
1868 | | this YYERROR. */ |
1869 | 0 | YYPOPSTACK (yylen); |
1870 | 0 | yylen = 0; |
1871 | 0 | YY_STACK_PRINT (yyss, yyssp); |
1872 | 0 | yystate = *yyssp; |
1873 | 0 | goto yyerrlab1; |
1874 | | |
1875 | | |
1876 | | /*-------------------------------------------------------------. |
1877 | | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
1878 | | `-------------------------------------------------------------*/ |
1879 | 67.1M | yyerrlab1: |
1880 | 67.1M | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
1881 | | |
1882 | 67.1M | for (;;) |
1883 | 67.2M | { |
1884 | 67.2M | yyn = yypact[yystate]; |
1885 | 67.2M | if (!yypact_value_is_default (yyn)) |
1886 | 67.2M | { |
1887 | 67.2M | yyn += YYTERROR; |
1888 | 67.2M | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
1889 | 67.1M | { |
1890 | 67.1M | yyn = yytable[yyn]; |
1891 | 67.1M | if (0 < yyn) |
1892 | 67.1M | break; |
1893 | 67.1M | } |
1894 | 67.2M | } |
1895 | | |
1896 | | /* Pop the current state because it cannot handle the error token. */ |
1897 | 39.3k | if (yyssp == yyss) |
1898 | 0 | YYABORT; |
1899 | | |
1900 | | |
1901 | 39.3k | yydestruct ("Error: popping", |
1902 | 39.3k | yystos[yystate], yyvsp, ps); |
1903 | 39.3k | YYPOPSTACK (1); |
1904 | 39.3k | yystate = *yyssp; |
1905 | 39.3k | YY_STACK_PRINT (yyss, yyssp); |
1906 | 39.3k | } |
1907 | | |
1908 | 67.1M | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1909 | 67.1M | *++yyvsp = yylval; |
1910 | 67.1M | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1911 | | |
1912 | | |
1913 | | /* Shift the error token. */ |
1914 | 67.1M | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
1915 | | |
1916 | 67.1M | yystate = yyn; |
1917 | 67.1M | goto yynewstate; |
1918 | | |
1919 | | |
1920 | | /*-------------------------------------. |
1921 | | | yyacceptlab -- YYACCEPT comes here. | |
1922 | | `-------------------------------------*/ |
1923 | 12.0k | yyacceptlab: |
1924 | 12.0k | yyresult = 0; |
1925 | 12.0k | goto yyreturn; |
1926 | | |
1927 | | |
1928 | | /*-----------------------------------. |
1929 | | | yyabortlab -- YYABORT comes here. | |
1930 | | `-----------------------------------*/ |
1931 | 0 | yyabortlab: |
1932 | 0 | yyresult = 1; |
1933 | 0 | goto yyreturn; |
1934 | | |
1935 | | |
1936 | 0 | #if !defined yyoverflow || YYERROR_VERBOSE |
1937 | | /*-------------------------------------------------. |
1938 | | | yyexhaustedlab -- memory exhaustion comes here. | |
1939 | | `-------------------------------------------------*/ |
1940 | 0 | yyexhaustedlab: |
1941 | 0 | yyerror (ps, YY_("memory exhausted")); |
1942 | 0 | yyresult = 2; |
1943 | | /* Fall through. */ |
1944 | 0 | #endif |
1945 | | |
1946 | | |
1947 | | /*-----------------------------------------------------. |
1948 | | | yyreturn -- parsing is finished, return the result. | |
1949 | | `-----------------------------------------------------*/ |
1950 | 12.0k | yyreturn: |
1951 | 12.0k | if (yychar != YYEMPTY) |
1952 | 0 | { |
1953 | | /* Make sure we have latest lookahead translation. See comments at |
1954 | | user semantic actions for why this is necessary. */ |
1955 | 0 | yytoken = YYTRANSLATE (yychar); |
1956 | 0 | yydestruct ("Cleanup: discarding lookahead", |
1957 | 0 | yytoken, &yylval, ps); |
1958 | 0 | } |
1959 | | /* Do not reclaim the symbols of the rule whose action triggered |
1960 | | this YYABORT or YYACCEPT. */ |
1961 | 12.0k | YYPOPSTACK (yylen); |
1962 | 12.0k | YY_STACK_PRINT (yyss, yyssp); |
1963 | 36.0k | while (yyssp != yyss) |
1964 | 24.0k | { |
1965 | 24.0k | yydestruct ("Cleanup: popping", |
1966 | 24.0k | yystos[+*yyssp], yyvsp, ps); |
1967 | 24.0k | YYPOPSTACK (1); |
1968 | 24.0k | } |
1969 | 12.0k | #ifndef yyoverflow |
1970 | 12.0k | if (yyss != yyssa) |
1971 | 0 | YYSTACK_FREE (yyss); |
1972 | 12.0k | #endif |
1973 | | #if YYERROR_VERBOSE |
1974 | | if (yymsg != yymsgbuf) |
1975 | | YYSTACK_FREE (yymsg); |
1976 | | #endif |
1977 | 12.0k | return yyresult; |
1978 | 0 | } |