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