1 /* A Bison parser, made by GNU Bison 3.0.2. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43 /* Identify Bison output. */
44 #define YYBISON 1
45
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.2"
48
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers. */
53 #define YYPURE 2
54
55 /* Push parsers. */
56 #define YYPUSH 0
57
58 /* Pull parsers. */
59 #define YYPULL 1
60
61
62 /* Substitute the variable and function names. */
63 #define yyparse ini_parse
64 #define yylex ini_lex
65 #define yyerror ini_error
66 #define yydebug ini_debug
67 #define yynerrs ini_nerrs
68
69
70 /* Copy the first part of user declarations. */
71
72
73 /*
74 +----------------------------------------------------------------------+
75 | Zend Engine |
76 +----------------------------------------------------------------------+
77 | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) |
78 +----------------------------------------------------------------------+
79 | This source file is subject to version 2.00 of the Zend license, |
80 | that is bundled with this package in the file LICENSE, and is |
81 | available through the world-wide-web at the following url: |
82 | http://www.zend.com/license/2_00.txt. |
83 | If you did not receive a copy of the Zend license and are unable to |
84 | obtain it through the world-wide-web, please send a note to |
85 | license@zend.com so we can mail you a copy immediately. |
86 +----------------------------------------------------------------------+
87 | Authors: Zeev Suraski <zeev@php.net> |
88 | Jani Taskinen <jani@php.net> |
89 +----------------------------------------------------------------------+
90 */
91
92 #define DEBUG_CFG_PARSER 0
93
94 #include "zend.h"
95 #include "zend_API.h"
96 #include "zend_ini.h"
97 #include "zend_constants.h"
98 #include "zend_ini_scanner.h"
99 #include "zend_extensions.h"
100
101 #ifdef ZEND_WIN32
102 #include "win32/syslog.h"
103 #endif
104
105 #define YYSTYPE zval
106
107 int ini_parse(void);
108
109 #define ZEND_INI_PARSER_CB (CG(ini_parser_param))->ini_parser_cb
110 #define ZEND_INI_PARSER_ARG (CG(ini_parser_param))->arg
111
112 #ifdef _MSC_VER
113 #define YYMALLOC malloc
114 #define YYFREE free
115 #endif
116
117 #define ZEND_SYSTEM_INI CG(ini_parser_unbuffered_errors)
118
get_int_val(zval * op)119 static int get_int_val(zval *op) {
120 switch (Z_TYPE_P(op)) {
121 case IS_LONG:
122 return Z_LVAL_P(op);
123 case IS_DOUBLE:
124 return (int)Z_DVAL_P(op);
125 case IS_STRING:
126 {
127 int val = atoi(Z_STRVAL_P(op));
128 zend_string_free(Z_STR_P(op));
129 return val;
130 }
131 EMPTY_SWITCH_DEFAULT_CASE()
132 }
133 }
134
135 /* {{{ zend_ini_do_op()
136 */
zend_ini_do_op(char type,zval * result,zval * op1,zval * op2)137 static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
138 {
139 int i_result;
140 int i_op1, i_op2;
141 int str_len;
142 char str_result[MAX_LENGTH_OF_LONG+1];
143
144 i_op1 = get_int_val(op1);
145 i_op2 = op2 ? get_int_val(op2) : 0;
146
147 switch (type) {
148 case '|':
149 i_result = i_op1 | i_op2;
150 break;
151 case '&':
152 i_result = i_op1 & i_op2;
153 break;
154 case '^':
155 i_result = i_op1 ^ i_op2;
156 break;
157 case '~':
158 i_result = ~i_op1;
159 break;
160 case '!':
161 i_result = !i_op1;
162 break;
163 default:
164 i_result = 0;
165 break;
166 }
167
168 str_len = sprintf(str_result, "%d", i_result);
169 ZVAL_NEW_STR(result, zend_string_init(str_result, str_len, ZEND_SYSTEM_INI));
170 }
171 /* }}} */
172
173 /* {{{ zend_ini_init_string()
174 */
zend_ini_init_string(zval * result)175 static void zend_ini_init_string(zval *result)
176 {
177 if (ZEND_SYSTEM_INI) {
178 ZVAL_EMPTY_PSTRING(result);
179 } else {
180 ZVAL_EMPTY_STRING(result);
181 }
182 }
183 /* }}} */
184
185 /* {{{ zend_ini_add_string()
186 */
zend_ini_add_string(zval * result,zval * op1,zval * op2)187 static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
188 {
189 int length, op1_len;
190
191 if (Z_TYPE_P(op1) != IS_STRING) {
192 /* ZEND_ASSERT(!Z_REFCOUNTED_P(op1)); */
193 if (ZEND_SYSTEM_INI) {
194 zend_string *tmp_str;
195 zend_string *str = zval_get_tmp_string(op1, &tmp_str);
196 ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
197 zend_tmp_string_release(tmp_str);
198 } else {
199 ZVAL_STR(op1, zval_get_string_func(op1));
200 }
201 }
202 op1_len = (int)Z_STRLEN_P(op1);
203
204 if (Z_TYPE_P(op2) != IS_STRING) {
205 convert_to_string(op2);
206 }
207 length = op1_len + (int)Z_STRLEN_P(op2);
208
209 ZVAL_NEW_STR(result, zend_string_extend(Z_STR_P(op1), length, ZEND_SYSTEM_INI));
210 memcpy(Z_STRVAL_P(result) + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2) + 1);
211 }
212 /* }}} */
213
214 /* {{{ zend_ini_get_constant()
215 */
zend_ini_get_constant(zval * result,zval * name)216 static void zend_ini_get_constant(zval *result, zval *name)
217 {
218 zval *c, tmp;
219
220 /* If name contains ':' it is not a constant. Bug #26893. */
221 if (!memchr(Z_STRVAL_P(name), ':', Z_STRLEN_P(name))
222 && (c = zend_get_constant(Z_STR_P(name))) != 0) {
223 if (Z_TYPE_P(c) != IS_STRING) {
224 ZVAL_COPY_OR_DUP(&tmp, c);
225 if (Z_OPT_CONSTANT(tmp)) {
226 zval_update_constant_ex(&tmp, NULL);
227 }
228 convert_to_string(&tmp);
229 c = &tmp;
230 }
231 ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(c), Z_STRLEN_P(c), ZEND_SYSTEM_INI));
232 if (c == &tmp) {
233 zend_string_release(Z_STR(tmp));
234 }
235 zend_string_free(Z_STR_P(name));
236 } else {
237 *result = *name;
238 }
239 }
240 /* }}} */
241
242 /* {{{ zend_ini_get_var()
243 */
zend_ini_get_var(zval * result,zval * name)244 static void zend_ini_get_var(zval *result, zval *name)
245 {
246 zval *curval;
247 char *envvar;
248
249 /* Fetch configuration option value */
250 if ((curval = zend_get_configuration_directive(Z_STR_P(name))) != NULL) {
251 ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(curval), Z_STRLEN_P(curval), ZEND_SYSTEM_INI));
252 /* ..or if not found, try ENV */
253 } else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name))) != NULL ||
254 (envvar = getenv(Z_STRVAL_P(name))) != NULL) {
255 ZVAL_NEW_STR(result, zend_string_init(envvar, strlen(envvar), ZEND_SYSTEM_INI));
256 } else {
257 zend_ini_init_string(result);
258 }
259 }
260 /* }}} */
261
262 /* {{{ ini_error()
263 */
ini_error(const char * msg)264 static ZEND_COLD void ini_error(const char *msg)
265 {
266 char *error_buf;
267 int error_buf_len;
268 char *currently_parsed_filename;
269
270 currently_parsed_filename = zend_ini_scanner_get_filename();
271 if (currently_parsed_filename) {
272 error_buf_len = 128 + (int)strlen(msg) + (int)strlen(currently_parsed_filename); /* should be more than enough */
273 error_buf = (char *) emalloc(error_buf_len);
274
275 sprintf(error_buf, "%s in %s on line %d\n", msg, currently_parsed_filename, zend_ini_scanner_get_lineno());
276 } else {
277 error_buf = estrdup("Invalid configuration directive\n");
278 }
279
280 if (CG(ini_parser_unbuffered_errors)) {
281 #ifdef ZEND_WIN32
282 syslog(LOG_ALERT, "PHP: %s (%s)", error_buf, GetCommandLine());
283 #endif
284 fprintf(stderr, "PHP: %s", error_buf);
285 } else {
286 zend_error(E_WARNING, "%s", error_buf);
287 }
288 efree(error_buf);
289 }
290 /* }}} */
291
292 /* {{{ zend_parse_ini_file()
293 */
zend_parse_ini_file(zend_file_handle * fh,zend_bool unbuffered_errors,int scanner_mode,zend_ini_parser_cb_t ini_parser_cb,void * arg)294 ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg)
295 {
296 int retval;
297 zend_ini_parser_param ini_parser_param;
298
299 ini_parser_param.ini_parser_cb = ini_parser_cb;
300 ini_parser_param.arg = arg;
301 CG(ini_parser_param) = &ini_parser_param;
302
303 if (zend_ini_open_file_for_scanning(fh, scanner_mode) == FAILURE) {
304 return FAILURE;
305 }
306
307 CG(ini_parser_unbuffered_errors) = unbuffered_errors;
308 retval = ini_parse();
309 zend_file_handle_dtor(fh);
310
311 shutdown_ini_scanner();
312
313 if (retval == 0) {
314 return SUCCESS;
315 } else {
316 return FAILURE;
317 }
318 }
319 /* }}} */
320
321 /* {{{ zend_parse_ini_string()
322 */
zend_parse_ini_string(char * str,zend_bool unbuffered_errors,int scanner_mode,zend_ini_parser_cb_t ini_parser_cb,void * arg)323 ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg)
324 {
325 int retval;
326 zend_ini_parser_param ini_parser_param;
327
328 ini_parser_param.ini_parser_cb = ini_parser_cb;
329 ini_parser_param.arg = arg;
330 CG(ini_parser_param) = &ini_parser_param;
331
332 if (zend_ini_prepare_string_for_scanning(str, scanner_mode) == FAILURE) {
333 return FAILURE;
334 }
335
336 CG(ini_parser_unbuffered_errors) = unbuffered_errors;
337 retval = ini_parse();
338
339 shutdown_ini_scanner();
340
341 if (retval == 0) {
342 return SUCCESS;
343 } else {
344 return FAILURE;
345 }
346 }
347 /* }}} */
348
349 /* {{{ zval_ini_dtor()
350 */
zval_ini_dtor(zval * zv)351 static void zval_ini_dtor(zval *zv)
352 {
353 if (Z_TYPE_P(zv) == IS_STRING) {
354 zend_string_release(Z_STR_P(zv));
355 }
356 }
357 /* }}} */
358
359
360
361
362 # ifndef YY_NULLPTR
363 # if defined __cplusplus && 201103L <= __cplusplus
364 # define YY_NULLPTR nullptr
365 # else
366 # define YY_NULLPTR 0
367 # endif
368 # endif
369
370 /* Enabling verbose error messages. */
371 #ifdef YYERROR_VERBOSE
372 # undef YYERROR_VERBOSE
373 # define YYERROR_VERBOSE 1
374 #else
375 # define YYERROR_VERBOSE 1
376 #endif
377
378 /* In a future release of Bison, this section will be replaced
379 by #include "zend_ini_parser.h". */
380 #ifndef YY_INI_ZEND_ZEND_INI_PARSER_H_INCLUDED
381 # define YY_INI_ZEND_ZEND_INI_PARSER_H_INCLUDED
382 /* Debug traces. */
383 #ifndef YYDEBUG
384 # define YYDEBUG 0
385 #endif
386 #if YYDEBUG
387 extern int ini_debug;
388 #endif
389
390 /* Token type. */
391 #ifndef YYTOKENTYPE
392 # define YYTOKENTYPE
393 enum yytokentype
394 {
395 END = 0,
396 TC_SECTION = 258,
397 TC_RAW = 259,
398 TC_CONSTANT = 260,
399 TC_NUMBER = 261,
400 TC_STRING = 262,
401 TC_WHITESPACE = 263,
402 TC_LABEL = 264,
403 TC_OFFSET = 265,
404 TC_DOLLAR_CURLY = 266,
405 TC_VARNAME = 267,
406 TC_QUOTED_STRING = 268,
407 BOOL_TRUE = 269,
408 BOOL_FALSE = 270,
409 NULL_NULL = 271,
410 END_OF_LINE = 272
411 };
412 #endif
413
414 /* Value type. */
415 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
416 typedef int YYSTYPE;
417 # define YYSTYPE_IS_TRIVIAL 1
418 # define YYSTYPE_IS_DECLARED 1
419 #endif
420
421
422
423 int ini_parse (void);
424
425 #endif /* !YY_INI_ZEND_ZEND_INI_PARSER_H_INCLUDED */
426
427 /* Copy the second part of user declarations. */
428
429
430
431 #ifdef short
432 # undef short
433 #endif
434
435 #ifdef YYTYPE_UINT8
436 typedef YYTYPE_UINT8 yytype_uint8;
437 #else
438 typedef unsigned char yytype_uint8;
439 #endif
440
441 #ifdef YYTYPE_INT8
442 typedef YYTYPE_INT8 yytype_int8;
443 #else
444 typedef signed char yytype_int8;
445 #endif
446
447 #ifdef YYTYPE_UINT16
448 typedef YYTYPE_UINT16 yytype_uint16;
449 #else
450 typedef unsigned short int yytype_uint16;
451 #endif
452
453 #ifdef YYTYPE_INT16
454 typedef YYTYPE_INT16 yytype_int16;
455 #else
456 typedef short int yytype_int16;
457 #endif
458
459 #ifndef YYSIZE_T
460 # ifdef __SIZE_TYPE__
461 # define YYSIZE_T __SIZE_TYPE__
462 # elif defined size_t
463 # define YYSIZE_T size_t
464 # elif ! defined YYSIZE_T
465 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
466 # define YYSIZE_T size_t
467 # else
468 # define YYSIZE_T unsigned int
469 # endif
470 #endif
471
472 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
473
474 #ifndef YY_
475 # if defined YYENABLE_NLS && YYENABLE_NLS
476 # if ENABLE_NLS
477 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
478 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
479 # endif
480 # endif
481 # ifndef YY_
482 # define YY_(Msgid) Msgid
483 # endif
484 #endif
485
486 #ifndef YY_ATTRIBUTE
487 # if (defined __GNUC__ \
488 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
489 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
490 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
491 # else
492 # define YY_ATTRIBUTE(Spec) /* empty */
493 # endif
494 #endif
495
496 #ifndef YY_ATTRIBUTE_PURE
497 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
498 #endif
499
500 #ifndef YY_ATTRIBUTE_UNUSED
501 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
502 #endif
503
504 #if !defined _Noreturn \
505 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
506 # if defined _MSC_VER && 1200 <= _MSC_VER
507 # define _Noreturn __declspec (noreturn)
508 # else
509 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
510 # endif
511 #endif
512
513 /* Suppress unused-variable warnings by "using" E. */
514 #if ! defined lint || defined __GNUC__
515 # define YYUSE(E) ((void) (E))
516 #else
517 # define YYUSE(E) /* empty */
518 #endif
519
520 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
521 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
522 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
523 _Pragma ("GCC diagnostic push") \
524 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
525 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
526 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
527 _Pragma ("GCC diagnostic pop")
528 #else
529 # define YY_INITIAL_VALUE(Value) Value
530 #endif
531 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
532 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
533 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
534 #endif
535 #ifndef YY_INITIAL_VALUE
536 # define YY_INITIAL_VALUE(Value) /* Nothing. */
537 #endif
538
539
540 #if ! defined yyoverflow || YYERROR_VERBOSE
541
542 /* The parser invokes alloca or malloc; define the necessary symbols. */
543
544 # ifdef YYSTACK_USE_ALLOCA
545 # if YYSTACK_USE_ALLOCA
546 # ifdef __GNUC__
547 # define YYSTACK_ALLOC __builtin_alloca
548 # elif defined __BUILTIN_VA_ARG_INCR
549 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
550 # elif defined _AIX
551 # define YYSTACK_ALLOC __alloca
552 # elif defined _MSC_VER
553 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
554 # define alloca _alloca
555 # else
556 # define YYSTACK_ALLOC alloca
557 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
558 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
559 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
560 # ifndef EXIT_SUCCESS
561 # define EXIT_SUCCESS 0
562 # endif
563 # endif
564 # endif
565 # endif
566 # endif
567
568 # ifdef YYSTACK_ALLOC
569 /* Pacify GCC's 'empty if-body' warning. */
570 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
571 # ifndef YYSTACK_ALLOC_MAXIMUM
572 /* The OS might guarantee only one guard page at the bottom of the stack,
573 and a page size can be as small as 4096 bytes. So we cannot safely
574 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
575 to allow for a few compiler-allocated temporary stack slots. */
576 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
577 # endif
578 # else
579 # define YYSTACK_ALLOC YYMALLOC
580 # define YYSTACK_FREE YYFREE
581 # ifndef YYSTACK_ALLOC_MAXIMUM
582 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
583 # endif
584 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
585 && ! ((defined YYMALLOC || defined malloc) \
586 && (defined YYFREE || defined free)))
587 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
588 # ifndef EXIT_SUCCESS
589 # define EXIT_SUCCESS 0
590 # endif
591 # endif
592 # ifndef YYMALLOC
593 # define YYMALLOC malloc
594 # if ! defined malloc && ! defined EXIT_SUCCESS
595 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
596 # endif
597 # endif
598 # ifndef YYFREE
599 # define YYFREE free
600 # if ! defined free && ! defined EXIT_SUCCESS
601 void free (void *); /* INFRINGES ON USER NAME SPACE */
602 # endif
603 # endif
604 # endif
605 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
606
607
608 #if (! defined yyoverflow \
609 && (! defined __cplusplus \
610 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
611
612 /* A type that is properly aligned for any stack member. */
613 union yyalloc
614 {
615 yytype_int16 yyss_alloc;
616 YYSTYPE yyvs_alloc;
617 };
618
619 /* The size of the maximum gap between one aligned stack and the next. */
620 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
621
622 /* The size of an array large to enough to hold all stacks, each with
623 N elements. */
624 # define YYSTACK_BYTES(N) \
625 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
626 + YYSTACK_GAP_MAXIMUM)
627
628 # define YYCOPY_NEEDED 1
629
630 /* Relocate STACK from its old location to the new one. The
631 local variables YYSIZE and YYSTACKSIZE give the old and new number of
632 elements in the stack, and YYPTR gives the new location of the
633 stack. Advance YYPTR to a properly aligned location for the next
634 stack. */
635 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
636 do \
637 { \
638 YYSIZE_T yynewbytes; \
639 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
640 Stack = &yyptr->Stack_alloc; \
641 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
642 yyptr += yynewbytes / sizeof (*yyptr); \
643 } \
644 while (0)
645
646 #endif
647
648 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
649 /* Copy COUNT objects from SRC to DST. The source and destination do
650 not overlap. */
651 # ifndef YYCOPY
652 # if defined __GNUC__ && 1 < __GNUC__
653 # define YYCOPY(Dst, Src, Count) \
654 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
655 # else
656 # define YYCOPY(Dst, Src, Count) \
657 do \
658 { \
659 YYSIZE_T yyi; \
660 for (yyi = 0; yyi < (Count); yyi++) \
661 (Dst)[yyi] = (Src)[yyi]; \
662 } \
663 while (0)
664 # endif
665 # endif
666 #endif /* !YYCOPY_NEEDED */
667
668 /* YYFINAL -- State number of the termination state. */
669 #define YYFINAL 2
670 /* YYLAST -- Last index in YYTABLE. */
671 #define YYLAST 123
672
673 /* YYNTOKENS -- Number of terminals. */
674 #define YYNTOKENS 44
675 /* YYNNTS -- Number of nonterminals. */
676 #define YYNNTS 13
677 /* YYNRULES -- Number of rules. */
678 #define YYNRULES 50
679 /* YYNSTATES -- Number of states. */
680 #define YYNSTATES 72
681
682 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
683 by yylex, with out-of-bounds checking. */
684 #define YYUNDEFTOK 2
685 #define YYMAXUTOK 272
686
687 #define YYTRANSLATE(YYX) \
688 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
689
690 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
691 as returned by yylex, without out-of-bounds checking. */
692 static const yytype_uint8 yytranslate[] =
693 {
694 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
695 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
696 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
697 2, 2, 2, 40, 22, 2, 30, 29, 39, 23,
698 42, 43, 28, 25, 20, 26, 21, 27, 2, 2,
699 2, 2, 2, 2, 2, 2, 2, 2, 19, 2,
700 32, 18, 33, 34, 35, 2, 2, 2, 2, 2,
701 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
702 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
703 2, 2, 2, 41, 24, 2, 2, 2, 2, 2,
704 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
705 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
706 2, 2, 2, 36, 38, 37, 31, 2, 2, 2,
707 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
708 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
709 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
710 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
711 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
712 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
713 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
714 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
715 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
716 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
717 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
718 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
719 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
720 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
721 15, 16, 17
722 };
723
724 #if YYDEBUG
725 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
726 static const yytype_uint16 yyrline[] =
727 {
728 0, 320, 320, 321, 325, 332, 340, 349, 350, 354,
729 355, 359, 360, 361, 362, 363, 367, 368, 372, 373,
730 374, 378, 379, 380, 381, 382, 383, 387, 388, 389,
731 390, 391, 392, 396, 397, 398, 399, 400, 401, 402,
732 406, 410, 411, 412, 413, 414, 418, 419, 420, 421,
733 422
734 };
735 #endif
736
737 #if YYDEBUG || YYERROR_VERBOSE || 1
738 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
739 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
740 static const char *const yytname[] =
741 {
742 "\"end of file\"", "error", "$undefined", "TC_SECTION", "TC_RAW",
743 "TC_CONSTANT", "TC_NUMBER", "TC_STRING", "TC_WHITESPACE", "TC_LABEL",
744 "TC_OFFSET", "TC_DOLLAR_CURLY", "TC_VARNAME", "TC_QUOTED_STRING",
745 "BOOL_TRUE", "BOOL_FALSE", "NULL_NULL", "END_OF_LINE", "'='", "':'",
746 "','", "'.'", "'\"'", "'\\''", "'^'", "'+'", "'-'", "'/'", "'*'", "'%'",
747 "'$'", "'~'", "'<'", "'>'", "'?'", "'@'", "'{'", "'}'", "'|'", "'&'",
748 "'!'", "']'", "'('", "')'", "$accept", "statement_list", "statement",
749 "section_string_or_value", "string_or_value", "option_offset",
750 "encapsed_list", "var_string_list_section", "var_string_list", "expr",
751 "cfg_var_ref", "constant_literal", "constant_string", YY_NULLPTR
752 };
753 #endif
754
755 # ifdef YYPRINT
756 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
757 (internal) symbol number NUM (which must be that of a token). */
758 static const yytype_uint16 yytoknum[] =
759 {
760 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
761 265, 266, 267, 268, 269, 270, 271, 272, 61, 58,
762 44, 46, 34, 39, 94, 43, 45, 47, 42, 37,
763 36, 126, 60, 62, 63, 64, 123, 125, 124, 38,
764 33, 93, 40, 41
765 };
766 # endif
767
768 #define YYPACT_NINF -25
769
770 #define yypact_value_is_default(Yystate) \
771 (!!((Yystate) == (-25)))
772
773 #define YYTABLE_NINF -1
774
775 #define yytable_value_is_error(Yytable_value) \
776 0
777
778 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
779 STATE-NUM. */
780 static const yytype_int8 yypact[] =
781 {
782 -25, 9, -25, 73, -17, 81, -25, -25, -25, -25,
783 -25, -25, -25, 15, -25, -20, 93, -25, -25, 0,
784 -25, -25, -25, -25, -25, -25, -12, 101, -25, -25,
785 -7, 36, -25, -25, -25, -25, -25, -25, -25, -25,
786 28, 28, 28, -25, 101, -1, 40, 30, -25, -25,
787 -25, -25, -25, -25, -25, 80, -25, -25, 33, 28,
788 28, 28, -25, 0, 100, -25, -25, -25, -25, -25,
789 -25, -25
790 };
791
792 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
793 Performed when YYTABLE does not specify something else to do. Zero
794 means the default is an error. */
795 static const yytype_uint8 yydefact[] =
796 {
797 3, 0, 1, 10, 7, 17, 8, 2, 42, 41,
798 43, 44, 45, 0, 20, 0, 9, 21, 22, 0,
799 47, 46, 48, 49, 50, 20, 0, 16, 27, 28,
800 0, 0, 4, 20, 24, 25, 12, 13, 14, 15,
801 0, 0, 0, 5, 33, 11, 0, 0, 20, 30,
802 31, 40, 19, 23, 18, 0, 37, 38, 0, 0,
803 0, 0, 29, 0, 0, 26, 39, 36, 34, 35,
804 6, 32
805 };
806
807 /* YYPGOTO[NTERM-NUM]. */
808 static const yytype_int8 yypgoto[] =
809 {
810 -25, -25, -25, -25, -9, -25, -23, -25, 50, 4,
811 -3, 44, -24
812 };
813
814 /* YYDEFGOTO[NTERM-NUM]. */
815 static const yytype_int8 yydefgoto[] =
816 {
817 -1, 1, 7, 15, 43, 26, 31, 16, 44, 45,
818 28, 18, 29
819 };
820
821 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
822 positive, shift that token. If negative, reduce the rule whose
823 number is the opposite. If YYTABLE_NINF, syntax error. */
824 static const yytype_uint8 yytable[] =
825 {
826 17, 19, 46, 50, 20, 21, 22, 23, 24, 2,
827 55, 13, 3, 34, 36, 37, 38, 39, 4, 5,
828 50, 32, 25, 59, 49, 64, 6, 30, 54, 47,
829 51, 40, 20, 21, 22, 23, 24, 60, 61, 13,
830 41, 49, 42, 54, 56, 57, 58, 13, 63, 52,
831 25, 13, 54, 52, 70, 27, 0, 59, 53, 40,
832 35, 54, 62, 67, 68, 69, 0, 0, 41, 0,
833 42, 60, 61, 0, 0, 0, 66, 8, 9, 10,
834 11, 12, 0, 0, 13, 20, 21, 22, 23, 24,
835 0, 13, 13, 52, 0, 14, 0, 8, 9, 10,
836 11, 12, 65, 25, 13, 20, 21, 22, 23, 24,
837 0, 13, 13, 52, 0, 33, 0, 0, 0, 0,
838 0, 0, 71, 48
839 };
840
841 static const yytype_int8 yycheck[] =
842 {
843 3, 18, 25, 27, 4, 5, 6, 7, 8, 0,
844 33, 11, 3, 16, 14, 15, 16, 17, 9, 10,
845 44, 41, 22, 24, 27, 48, 17, 12, 31, 41,
846 37, 31, 4, 5, 6, 7, 8, 38, 39, 11,
847 40, 44, 42, 46, 40, 41, 42, 11, 18, 13,
848 22, 11, 55, 13, 63, 5, -1, 24, 22, 31,
849 16, 64, 22, 59, 60, 61, -1, -1, 40, -1,
850 42, 38, 39, -1, -1, -1, 43, 4, 5, 6,
851 7, 8, -1, -1, 11, 4, 5, 6, 7, 8,
852 -1, 11, 11, 13, -1, 22, -1, 4, 5, 6,
853 7, 8, 22, 22, 11, 4, 5, 6, 7, 8,
854 -1, 11, 11, 13, -1, 22, -1, -1, -1, -1,
855 -1, -1, 22, 22
856 };
857
858 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
859 symbol of state STATE-NUM. */
860 static const yytype_uint8 yystos[] =
861 {
862 0, 45, 0, 3, 9, 10, 17, 46, 4, 5,
863 6, 7, 8, 11, 22, 47, 51, 54, 55, 18,
864 4, 5, 6, 7, 8, 22, 49, 52, 54, 56,
865 12, 50, 41, 22, 54, 55, 14, 15, 16, 17,
866 31, 40, 42, 48, 52, 53, 50, 41, 22, 54,
867 56, 37, 13, 22, 54, 50, 53, 53, 53, 24,
868 38, 39, 22, 18, 50, 22, 43, 53, 53, 53,
869 48, 22
870 };
871
872 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
873 static const yytype_uint8 yyr1[] =
874 {
875 0, 44, 45, 45, 46, 46, 46, 46, 46, 47,
876 47, 48, 48, 48, 48, 48, 49, 49, 50, 50,
877 50, 51, 51, 51, 51, 51, 51, 52, 52, 52,
878 52, 52, 52, 53, 53, 53, 53, 53, 53, 53,
879 54, 55, 55, 55, 55, 55, 56, 56, 56, 56,
880 56
881 };
882
883 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
884 static const yytype_uint8 yyr2[] =
885 {
886 0, 2, 2, 0, 3, 3, 5, 1, 1, 1,
887 0, 1, 1, 1, 1, 1, 1, 0, 2, 2,
888 0, 1, 1, 3, 2, 2, 4, 1, 1, 3,
889 2, 2, 4, 1, 3, 3, 3, 2, 2, 3,
890 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
891 1
892 };
893
894
895 #define yyerrok (yyerrstatus = 0)
896 #define yyclearin (yychar = YYEMPTY)
897 #define YYEMPTY (-2)
898 #define YYEOF 0
899
900 #define YYACCEPT goto yyacceptlab
901 #define YYABORT goto yyabortlab
902 #define YYERROR goto yyerrorlab
903
904
905 #define YYRECOVERING() (!!yyerrstatus)
906
907 #define YYBACKUP(Token, Value) \
908 do \
909 if (yychar == YYEMPTY) \
910 { \
911 yychar = (Token); \
912 yylval = (Value); \
913 YYPOPSTACK (yylen); \
914 yystate = *yyssp; \
915 goto yybackup; \
916 } \
917 else \
918 { \
919 yyerror (YY_("syntax error: cannot back up")); \
920 YYERROR; \
921 } \
922 while (0)
923
924 /* Error token number */
925 #define YYTERROR 1
926 #define YYERRCODE 256
927
928
929
930 /* Enable debugging if requested. */
931 #if YYDEBUG
932
933 # ifndef YYFPRINTF
934 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
935 # define YYFPRINTF fprintf
936 # endif
937
938 # define YYDPRINTF(Args) \
939 do { \
940 if (yydebug) \
941 YYFPRINTF Args; \
942 } while (0)
943
944 /* This macro is provided for backward compatibility. */
945 #ifndef YY_LOCATION_PRINT
946 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
947 #endif
948
949
950 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
951 do { \
952 if (yydebug) \
953 { \
954 YYFPRINTF (stderr, "%s ", Title); \
955 yy_symbol_print (stderr, \
956 Type, Value); \
957 YYFPRINTF (stderr, "\n"); \
958 } \
959 } while (0)
960
961
962 /*----------------------------------------.
963 | Print this symbol's value on YYOUTPUT. |
964 `----------------------------------------*/
965
966 static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)967 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
968 {
969 FILE *yyo = yyoutput;
970 YYUSE (yyo);
971 if (!yyvaluep)
972 return;
973 # ifdef YYPRINT
974 if (yytype < YYNTOKENS)
975 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
976 # endif
977 YYUSE (yytype);
978 }
979
980
981 /*--------------------------------.
982 | Print this symbol on YYOUTPUT. |
983 `--------------------------------*/
984
985 static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)986 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
987 {
988 YYFPRINTF (yyoutput, "%s %s (",
989 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
990
991 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
992 YYFPRINTF (yyoutput, ")");
993 }
994
995 /*------------------------------------------------------------------.
996 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
997 | TOP (included). |
998 `------------------------------------------------------------------*/
999
1000 static void
yy_stack_print(yytype_int16 * yybottom,yytype_int16 * yytop)1001 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1002 {
1003 YYFPRINTF (stderr, "Stack now");
1004 for (; yybottom <= yytop; yybottom++)
1005 {
1006 int yybot = *yybottom;
1007 YYFPRINTF (stderr, " %d", yybot);
1008 }
1009 YYFPRINTF (stderr, "\n");
1010 }
1011
1012 # define YY_STACK_PRINT(Bottom, Top) \
1013 do { \
1014 if (yydebug) \
1015 yy_stack_print ((Bottom), (Top)); \
1016 } while (0)
1017
1018
1019 /*------------------------------------------------.
1020 | Report that the YYRULE is going to be reduced. |
1021 `------------------------------------------------*/
1022
1023 static void
yy_reduce_print(yytype_int16 * yyssp,YYSTYPE * yyvsp,int yyrule)1024 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1025 {
1026 unsigned long int yylno = yyrline[yyrule];
1027 int yynrhs = yyr2[yyrule];
1028 int yyi;
1029 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1030 yyrule - 1, yylno);
1031 /* The symbols being reduced. */
1032 for (yyi = 0; yyi < yynrhs; yyi++)
1033 {
1034 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1035 yy_symbol_print (stderr,
1036 yystos[yyssp[yyi + 1 - yynrhs]],
1037 &(yyvsp[(yyi + 1) - (yynrhs)])
1038 );
1039 YYFPRINTF (stderr, "\n");
1040 }
1041 }
1042
1043 # define YY_REDUCE_PRINT(Rule) \
1044 do { \
1045 if (yydebug) \
1046 yy_reduce_print (yyssp, yyvsp, Rule); \
1047 } while (0)
1048
1049 /* Nonzero means print parse trace. It is left uninitialized so that
1050 multiple parsers can coexist. */
1051 int yydebug;
1052 #else /* !YYDEBUG */
1053 # define YYDPRINTF(Args)
1054 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1055 # define YY_STACK_PRINT(Bottom, Top)
1056 # define YY_REDUCE_PRINT(Rule)
1057 #endif /* !YYDEBUG */
1058
1059
1060 /* YYINITDEPTH -- initial size of the parser's stacks. */
1061 #ifndef YYINITDEPTH
1062 # define YYINITDEPTH 200
1063 #endif
1064
1065 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1066 if the built-in stack extension method is used).
1067
1068 Do not make this value too large; the results are undefined if
1069 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1070 evaluated with infinite-precision integer arithmetic. */
1071
1072 #ifndef YYMAXDEPTH
1073 # define YYMAXDEPTH 10000
1074 #endif
1075
1076
1077 #if YYERROR_VERBOSE
1078
1079 # ifndef yystrlen
1080 # if defined __GLIBC__ && defined _STRING_H
1081 # define yystrlen strlen
1082 # else
1083 /* Return the length of YYSTR. */
1084 static YYSIZE_T
yystrlen(const char * yystr)1085 yystrlen (const char *yystr)
1086 {
1087 YYSIZE_T yylen;
1088 for (yylen = 0; yystr[yylen]; yylen++)
1089 continue;
1090 return yylen;
1091 }
1092 # endif
1093 # endif
1094
1095 # ifndef yystpcpy
1096 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1097 # define yystpcpy stpcpy
1098 # else
1099 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1100 YYDEST. */
1101 static char *
yystpcpy(char * yydest,const char * yysrc)1102 yystpcpy (char *yydest, const char *yysrc)
1103 {
1104 char *yyd = yydest;
1105 const char *yys = yysrc;
1106
1107 while ((*yyd++ = *yys++) != '\0')
1108 continue;
1109
1110 return yyd - 1;
1111 }
1112 # endif
1113 # endif
1114
1115 # ifndef yytnamerr
1116 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1117 quotes and backslashes, so that it's suitable for yyerror. The
1118 heuristic is that double-quoting is unnecessary unless the string
1119 contains an apostrophe, a comma, or backslash (other than
1120 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1121 null, do not copy; instead, return the length of what the result
1122 would have been. */
1123 static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)1124 yytnamerr (char *yyres, const char *yystr)
1125 {
1126 if (*yystr == '"')
1127 {
1128 YYSIZE_T yyn = 0;
1129 char const *yyp = yystr;
1130
1131 for (;;)
1132 switch (*++yyp)
1133 {
1134 case '\'':
1135 case ',':
1136 goto do_not_strip_quotes;
1137
1138 case '\\':
1139 if (*++yyp != '\\')
1140 goto do_not_strip_quotes;
1141 /* Fall through. */
1142 default:
1143 if (yyres)
1144 yyres[yyn] = *yyp;
1145 yyn++;
1146 break;
1147
1148 case '"':
1149 if (yyres)
1150 yyres[yyn] = '\0';
1151 return yyn;
1152 }
1153 do_not_strip_quotes: ;
1154 }
1155
1156 if (! yyres)
1157 return yystrlen (yystr);
1158
1159 return yystpcpy (yyres, yystr) - yyres;
1160 }
1161 # endif
1162
1163 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1164 about the unexpected token YYTOKEN for the state stack whose top is
1165 YYSSP.
1166
1167 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1168 not large enough to hold the message. In that case, also set
1169 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1170 required number of bytes is too large to store. */
1171 static int
yysyntax_error(YYSIZE_T * yymsg_alloc,char ** yymsg,yytype_int16 * yyssp,int yytoken)1172 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1173 yytype_int16 *yyssp, int yytoken)
1174 {
1175 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1176 YYSIZE_T yysize = yysize0;
1177 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1178 /* Internationalized format string. */
1179 const char *yyformat = YY_NULLPTR;
1180 /* Arguments of yyformat. */
1181 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1182 /* Number of reported tokens (one for the "unexpected", one per
1183 "expected"). */
1184 int yycount = 0;
1185
1186 /* There are many possibilities here to consider:
1187 - If this state is a consistent state with a default action, then
1188 the only way this function was invoked is if the default action
1189 is an error action. In that case, don't check for expected
1190 tokens because there are none.
1191 - The only way there can be no lookahead present (in yychar) is if
1192 this state is a consistent state with a default action. Thus,
1193 detecting the absence of a lookahead is sufficient to determine
1194 that there is no unexpected or expected token to report. In that
1195 case, just report a simple "syntax error".
1196 - Don't assume there isn't a lookahead just because this state is a
1197 consistent state with a default action. There might have been a
1198 previous inconsistent state, consistent state with a non-default
1199 action, or user semantic action that manipulated yychar.
1200 - Of course, the expected token list depends on states to have
1201 correct lookahead information, and it depends on the parser not
1202 to perform extra reductions after fetching a lookahead from the
1203 scanner and before detecting a syntax error. Thus, state merging
1204 (from LALR or IELR) and default reductions corrupt the expected
1205 token list. However, the list is correct for canonical LR with
1206 one exception: it will still contain any token that will not be
1207 accepted due to an error action in a later state.
1208 */
1209 if (yytoken != YYEMPTY)
1210 {
1211 int yyn = yypact[*yyssp];
1212 yyarg[yycount++] = yytname[yytoken];
1213 if (!yypact_value_is_default (yyn))
1214 {
1215 /* Start YYX at -YYN if negative to avoid negative indexes in
1216 YYCHECK. In other words, skip the first -YYN actions for
1217 this state because they are default actions. */
1218 int yyxbegin = yyn < 0 ? -yyn : 0;
1219 /* Stay within bounds of both yycheck and yytname. */
1220 int yychecklim = YYLAST - yyn + 1;
1221 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1222 int yyx;
1223
1224 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1225 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1226 && !yytable_value_is_error (yytable[yyx + yyn]))
1227 {
1228 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1229 {
1230 yycount = 1;
1231 yysize = yysize0;
1232 break;
1233 }
1234 yyarg[yycount++] = yytname[yyx];
1235 {
1236 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1237 if (! (yysize <= yysize1
1238 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1239 return 2;
1240 yysize = yysize1;
1241 }
1242 }
1243 }
1244 }
1245
1246 switch (yycount)
1247 {
1248 # define YYCASE_(N, S) \
1249 case N: \
1250 yyformat = S; \
1251 break
1252 YYCASE_(0, YY_("syntax error"));
1253 YYCASE_(1, YY_("syntax error, unexpected %s"));
1254 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1255 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1256 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1257 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1258 # undef YYCASE_
1259 }
1260
1261 {
1262 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1263 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1264 return 2;
1265 yysize = yysize1;
1266 }
1267
1268 if (*yymsg_alloc < yysize)
1269 {
1270 *yymsg_alloc = 2 * yysize;
1271 if (! (yysize <= *yymsg_alloc
1272 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1273 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1274 return 1;
1275 }
1276
1277 /* Avoid sprintf, as that infringes on the user's name space.
1278 Don't have undefined behavior even if the translation
1279 produced a string with the wrong number of "%s"s. */
1280 {
1281 char *yyp = *yymsg;
1282 int yyi = 0;
1283 while ((*yyp = *yyformat) != '\0')
1284 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1285 {
1286 yyp += yytnamerr (yyp, yyarg[yyi++]);
1287 yyformat += 2;
1288 }
1289 else
1290 {
1291 yyp++;
1292 yyformat++;
1293 }
1294 }
1295 return 0;
1296 }
1297 #endif /* YYERROR_VERBOSE */
1298
1299 /*-----------------------------------------------.
1300 | Release the memory associated to this symbol. |
1301 `-----------------------------------------------*/
1302
1303 static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep)1304 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1305 {
1306 YYUSE (yyvaluep);
1307 if (!yymsg)
1308 yymsg = "Deleting";
1309 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1310
1311 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1312 switch (yytype)
1313 {
1314 case 4: /* TC_RAW */
1315
1316 { zval_ini_dtor(&((*yyvaluep))); }
1317
1318 break;
1319
1320 case 5: /* TC_CONSTANT */
1321
1322 { zval_ini_dtor(&((*yyvaluep))); }
1323
1324 break;
1325
1326 case 6: /* TC_NUMBER */
1327
1328 { zval_ini_dtor(&((*yyvaluep))); }
1329
1330 break;
1331
1332 case 7: /* TC_STRING */
1333
1334 { zval_ini_dtor(&((*yyvaluep))); }
1335
1336 break;
1337
1338 case 8: /* TC_WHITESPACE */
1339
1340 { zval_ini_dtor(&((*yyvaluep))); }
1341
1342 break;
1343
1344 case 9: /* TC_LABEL */
1345
1346 { zval_ini_dtor(&((*yyvaluep))); }
1347
1348 break;
1349
1350 case 10: /* TC_OFFSET */
1351
1352 { zval_ini_dtor(&((*yyvaluep))); }
1353
1354 break;
1355
1356 case 12: /* TC_VARNAME */
1357
1358 { zval_ini_dtor(&((*yyvaluep))); }
1359
1360 break;
1361
1362 case 14: /* BOOL_TRUE */
1363
1364 { zval_ini_dtor(&((*yyvaluep))); }
1365
1366 break;
1367
1368 case 15: /* BOOL_FALSE */
1369
1370 { zval_ini_dtor(&((*yyvaluep))); }
1371
1372 break;
1373
1374 case 16: /* NULL_NULL */
1375
1376 { zval_ini_dtor(&((*yyvaluep))); }
1377
1378 break;
1379
1380 case 47: /* section_string_or_value */
1381
1382 { zval_ini_dtor(&((*yyvaluep))); }
1383
1384 break;
1385
1386 case 48: /* string_or_value */
1387
1388 { zval_ini_dtor(&((*yyvaluep))); }
1389
1390 break;
1391
1392 case 49: /* option_offset */
1393
1394 { zval_ini_dtor(&((*yyvaluep))); }
1395
1396 break;
1397
1398 case 50: /* encapsed_list */
1399
1400 { zval_ini_dtor(&((*yyvaluep))); }
1401
1402 break;
1403
1404 case 51: /* var_string_list_section */
1405
1406 { zval_ini_dtor(&((*yyvaluep))); }
1407
1408 break;
1409
1410 case 52: /* var_string_list */
1411
1412 { zval_ini_dtor(&((*yyvaluep))); }
1413
1414 break;
1415
1416 case 53: /* expr */
1417
1418 { zval_ini_dtor(&((*yyvaluep))); }
1419
1420 break;
1421
1422 case 54: /* cfg_var_ref */
1423
1424 { zval_ini_dtor(&((*yyvaluep))); }
1425
1426 break;
1427
1428 case 55: /* constant_literal */
1429
1430 { zval_ini_dtor(&((*yyvaluep))); }
1431
1432 break;
1433
1434 case 56: /* constant_string */
1435
1436 { zval_ini_dtor(&((*yyvaluep))); }
1437
1438 break;
1439
1440
1441 default:
1442 break;
1443 }
1444 YY_IGNORE_MAYBE_UNINITIALIZED_END
1445 }
1446
1447
1448
1449
1450 /*----------.
1451 | yyparse. |
1452 `----------*/
1453
1454 int
yyparse(void)1455 yyparse (void)
1456 {
1457 /* The lookahead symbol. */
1458 int yychar;
1459
1460
1461 /* The semantic value of the lookahead symbol. */
1462 /* Default value used for initialization, for pacifying older GCCs
1463 or non-GCC compilers. */
1464 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1465 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1466
1467 /* Number of syntax errors so far. */
1468 int yynerrs;
1469
1470 int yystate;
1471 /* Number of tokens to shift before error messages enabled. */
1472 int yyerrstatus;
1473
1474 /* The stacks and their tools:
1475 'yyss': related to states.
1476 'yyvs': related to semantic values.
1477
1478 Refer to the stacks through separate pointers, to allow yyoverflow
1479 to reallocate them elsewhere. */
1480
1481 /* The state stack. */
1482 yytype_int16 yyssa[YYINITDEPTH];
1483 yytype_int16 *yyss;
1484 yytype_int16 *yyssp;
1485
1486 /* The semantic value stack. */
1487 YYSTYPE yyvsa[YYINITDEPTH];
1488 YYSTYPE *yyvs;
1489 YYSTYPE *yyvsp;
1490
1491 YYSIZE_T yystacksize;
1492
1493 int yyn;
1494 int yyresult;
1495 /* Lookahead token as an internal (translated) token number. */
1496 int yytoken = 0;
1497 /* The variables used to return semantic value and location from the
1498 action routines. */
1499 YYSTYPE yyval;
1500
1501 #if YYERROR_VERBOSE
1502 /* Buffer for error messages, and its allocated size. */
1503 char yymsgbuf[128];
1504 char *yymsg = yymsgbuf;
1505 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1506 #endif
1507
1508 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1509
1510 /* The number of symbols on the RHS of the reduced rule.
1511 Keep to zero when no symbol should be popped. */
1512 int yylen = 0;
1513
1514 yyssp = yyss = yyssa;
1515 yyvsp = yyvs = yyvsa;
1516 yystacksize = YYINITDEPTH;
1517
1518 YYDPRINTF ((stderr, "Starting parse\n"));
1519
1520 yystate = 0;
1521 yyerrstatus = 0;
1522 yynerrs = 0;
1523 yychar = YYEMPTY; /* Cause a token to be read. */
1524 goto yysetstate;
1525
1526 /*------------------------------------------------------------.
1527 | yynewstate -- Push a new state, which is found in yystate. |
1528 `------------------------------------------------------------*/
1529 yynewstate:
1530 /* In all cases, when you get here, the value and location stacks
1531 have just been pushed. So pushing a state here evens the stacks. */
1532 yyssp++;
1533
1534 yysetstate:
1535 *yyssp = yystate;
1536
1537 if (yyss + yystacksize - 1 <= yyssp)
1538 {
1539 /* Get the current used size of the three stacks, in elements. */
1540 YYSIZE_T yysize = yyssp - yyss + 1;
1541
1542 #ifdef yyoverflow
1543 {
1544 /* Give user a chance to reallocate the stack. Use copies of
1545 these so that the &'s don't force the real ones into
1546 memory. */
1547 YYSTYPE *yyvs1 = yyvs;
1548 yytype_int16 *yyss1 = yyss;
1549
1550 /* Each stack pointer address is followed by the size of the
1551 data in use in that stack, in bytes. This used to be a
1552 conditional around just the two extra args, but that might
1553 be undefined if yyoverflow is a macro. */
1554 yyoverflow (YY_("memory exhausted"),
1555 &yyss1, yysize * sizeof (*yyssp),
1556 &yyvs1, yysize * sizeof (*yyvsp),
1557 &yystacksize);
1558
1559 yyss = yyss1;
1560 yyvs = yyvs1;
1561 }
1562 #else /* no yyoverflow */
1563 # ifndef YYSTACK_RELOCATE
1564 goto yyexhaustedlab;
1565 # else
1566 /* Extend the stack our own way. */
1567 if (YYMAXDEPTH <= yystacksize)
1568 goto yyexhaustedlab;
1569 yystacksize *= 2;
1570 if (YYMAXDEPTH < yystacksize)
1571 yystacksize = YYMAXDEPTH;
1572
1573 {
1574 yytype_int16 *yyss1 = yyss;
1575 union yyalloc *yyptr =
1576 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1577 if (! yyptr)
1578 goto yyexhaustedlab;
1579 YYSTACK_RELOCATE (yyss_alloc, yyss);
1580 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1581 # undef YYSTACK_RELOCATE
1582 if (yyss1 != yyssa)
1583 YYSTACK_FREE (yyss1);
1584 }
1585 # endif
1586 #endif /* no yyoverflow */
1587
1588 yyssp = yyss + yysize - 1;
1589 yyvsp = yyvs + yysize - 1;
1590
1591 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1592 (unsigned long int) yystacksize));
1593
1594 if (yyss + yystacksize - 1 <= yyssp)
1595 YYABORT;
1596 }
1597
1598 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1599
1600 if (yystate == YYFINAL)
1601 YYACCEPT;
1602
1603 goto yybackup;
1604
1605 /*-----------.
1606 | yybackup. |
1607 `-----------*/
1608 yybackup:
1609
1610 /* Do appropriate processing given the current state. Read a
1611 lookahead token if we need one and don't already have one. */
1612
1613 /* First try to decide what to do without reference to lookahead token. */
1614 yyn = yypact[yystate];
1615 if (yypact_value_is_default (yyn))
1616 goto yydefault;
1617
1618 /* Not known => get a lookahead token if don't already have one. */
1619
1620 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1621 if (yychar == YYEMPTY)
1622 {
1623 YYDPRINTF ((stderr, "Reading a token: "));
1624 yychar = yylex (&yylval);
1625 }
1626
1627 if (yychar <= YYEOF)
1628 {
1629 yychar = yytoken = YYEOF;
1630 YYDPRINTF ((stderr, "Now at end of input.\n"));
1631 }
1632 else
1633 {
1634 yytoken = YYTRANSLATE (yychar);
1635 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1636 }
1637
1638 /* If the proper action on seeing token YYTOKEN is to reduce or to
1639 detect an error, take that action. */
1640 yyn += yytoken;
1641 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1642 goto yydefault;
1643 yyn = yytable[yyn];
1644 if (yyn <= 0)
1645 {
1646 if (yytable_value_is_error (yyn))
1647 goto yyerrlab;
1648 yyn = -yyn;
1649 goto yyreduce;
1650 }
1651
1652 /* Count tokens shifted since error; after three, turn off error
1653 status. */
1654 if (yyerrstatus)
1655 yyerrstatus--;
1656
1657 /* Shift the lookahead token. */
1658 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1659
1660 /* Discard the shifted token. */
1661 yychar = YYEMPTY;
1662
1663 yystate = yyn;
1664 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1665 *++yyvsp = yylval;
1666 YY_IGNORE_MAYBE_UNINITIALIZED_END
1667
1668 goto yynewstate;
1669
1670
1671 /*-----------------------------------------------------------.
1672 | yydefault -- do the default action for the current state. |
1673 `-----------------------------------------------------------*/
1674 yydefault:
1675 yyn = yydefact[yystate];
1676 if (yyn == 0)
1677 goto yyerrlab;
1678 goto yyreduce;
1679
1680
1681 /*-----------------------------.
1682 | yyreduce -- Do a reduction. |
1683 `-----------------------------*/
1684 yyreduce:
1685 /* yyn is the number of a rule to reduce with. */
1686 yylen = yyr2[yyn];
1687
1688 /* If YYLEN is nonzero, implement the default value of the action:
1689 '$$ = $1'.
1690
1691 Otherwise, the following line sets YYVAL to garbage.
1692 This behavior is undocumented and Bison
1693 users should not rely upon it. Assigning to YYVAL
1694 unconditionally makes the parser a bit smaller, and it avoids a
1695 GCC warning that YYVAL may be used uninitialized. */
1696 yyval = yyvsp[1-yylen];
1697
1698
1699 YY_REDUCE_PRINT (yyn);
1700 switch (yyn)
1701 {
1702 case 4:
1703
1704 {
1705 #if DEBUG_CFG_PARSER
1706 printf("SECTION: [%s]\n", Z_STRVAL((yyvsp[-1])));
1707 #endif
1708 ZEND_INI_PARSER_CB(&(yyvsp[-1]), NULL, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG);
1709 zend_string_release(Z_STR((yyvsp[-1])));
1710 }
1711
1712 break;
1713
1714 case 5:
1715
1716 {
1717 #if DEBUG_CFG_PARSER
1718 printf("NORMAL: '%s' = '%s'\n", Z_STRVAL((yyvsp[-2])), Z_STRVAL((yyvsp[0])));
1719 #endif
1720 ZEND_INI_PARSER_CB(&(yyvsp[-2]), &(yyvsp[0]), NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG);
1721 zend_string_release(Z_STR((yyvsp[-2])));
1722 zval_ini_dtor(&(yyvsp[0]));
1723 }
1724
1725 break;
1726
1727 case 6:
1728
1729 {
1730 #if DEBUG_CFG_PARSER
1731 printf("OFFSET: '%s'[%s] = '%s'\n", Z_STRVAL((yyvsp[-4])), Z_STRVAL((yyvsp[-3])), Z_STRVAL((yyvsp[0])));
1732 #endif
1733 ZEND_INI_PARSER_CB(&(yyvsp[-4]), &(yyvsp[0]), &(yyvsp[-3]), ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG);
1734 zend_string_release(Z_STR((yyvsp[-4])));
1735 zval_ini_dtor(&(yyvsp[-3]));
1736 zval_ini_dtor(&(yyvsp[0]));
1737 }
1738
1739 break;
1740
1741 case 7:
1742
1743 { ZEND_INI_PARSER_CB(&(yyvsp[0]), NULL, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); zend_string_release(Z_STR((yyvsp[0]))); }
1744
1745 break;
1746
1747 case 9:
1748
1749 { (yyval) = (yyvsp[0]); }
1750
1751 break;
1752
1753 case 10:
1754
1755 { zend_ini_init_string(&(yyval)); }
1756
1757 break;
1758
1759 case 11:
1760
1761 { (yyval) = (yyvsp[0]); }
1762
1763 break;
1764
1765 case 12:
1766
1767 { (yyval) = (yyvsp[0]); }
1768
1769 break;
1770
1771 case 13:
1772
1773 { (yyval) = (yyvsp[0]); }
1774
1775 break;
1776
1777 case 14:
1778
1779 { (yyval) = (yyvsp[0]); }
1780
1781 break;
1782
1783 case 15:
1784
1785 { zend_ini_init_string(&(yyval)); }
1786
1787 break;
1788
1789 case 16:
1790
1791 { (yyval) = (yyvsp[0]); }
1792
1793 break;
1794
1795 case 17:
1796
1797 { zend_ini_init_string(&(yyval)); }
1798
1799 break;
1800
1801 case 18:
1802
1803 { zend_ini_add_string(&(yyval), &(yyvsp[-1]), &(yyvsp[0])); zend_string_free(Z_STR((yyvsp[0]))); }
1804
1805 break;
1806
1807 case 19:
1808
1809 { zend_ini_add_string(&(yyval), &(yyvsp[-1]), &(yyvsp[0])); zend_string_free(Z_STR((yyvsp[0]))); }
1810
1811 break;
1812
1813 case 20:
1814
1815 { zend_ini_init_string(&(yyval)); }
1816
1817 break;
1818
1819 case 21:
1820
1821 { (yyval) = (yyvsp[0]); }
1822
1823 break;
1824
1825 case 22:
1826
1827 { (yyval) = (yyvsp[0]); }
1828
1829 break;
1830
1831 case 23:
1832
1833 { (yyval) = (yyvsp[-1]); }
1834
1835 break;
1836
1837 case 24:
1838
1839 { zend_ini_add_string(&(yyval), &(yyvsp[-1]), &(yyvsp[0])); zend_string_free(Z_STR((yyvsp[0]))); }
1840
1841 break;
1842
1843 case 25:
1844
1845 { zend_ini_add_string(&(yyval), &(yyvsp[-1]), &(yyvsp[0])); zend_string_free(Z_STR((yyvsp[0]))); }
1846
1847 break;
1848
1849 case 26:
1850
1851 { zend_ini_add_string(&(yyval), &(yyvsp[-3]), &(yyvsp[-1])); zend_string_free(Z_STR((yyvsp[-1]))); }
1852
1853 break;
1854
1855 case 27:
1856
1857 { (yyval) = (yyvsp[0]); }
1858
1859 break;
1860
1861 case 28:
1862
1863 { (yyval) = (yyvsp[0]); }
1864
1865 break;
1866
1867 case 29:
1868
1869 { (yyval) = (yyvsp[-1]); }
1870
1871 break;
1872
1873 case 30:
1874
1875 { zend_ini_add_string(&(yyval), &(yyvsp[-1]), &(yyvsp[0])); zend_string_free(Z_STR((yyvsp[0]))); }
1876
1877 break;
1878
1879 case 31:
1880
1881 { zend_ini_add_string(&(yyval), &(yyvsp[-1]), &(yyvsp[0])); zend_string_free(Z_STR((yyvsp[0]))); }
1882
1883 break;
1884
1885 case 32:
1886
1887 { zend_ini_add_string(&(yyval), &(yyvsp[-3]), &(yyvsp[-1])); zend_string_free(Z_STR((yyvsp[-1]))); }
1888
1889 break;
1890
1891 case 33:
1892
1893 { (yyval) = (yyvsp[0]); }
1894
1895 break;
1896
1897 case 34:
1898
1899 { zend_ini_do_op('|', &(yyval), &(yyvsp[-2]), &(yyvsp[0])); }
1900
1901 break;
1902
1903 case 35:
1904
1905 { zend_ini_do_op('&', &(yyval), &(yyvsp[-2]), &(yyvsp[0])); }
1906
1907 break;
1908
1909 case 36:
1910
1911 { zend_ini_do_op('^', &(yyval), &(yyvsp[-2]), &(yyvsp[0])); }
1912
1913 break;
1914
1915 case 37:
1916
1917 { zend_ini_do_op('~', &(yyval), &(yyvsp[0]), NULL); }
1918
1919 break;
1920
1921 case 38:
1922
1923 { zend_ini_do_op('!', &(yyval), &(yyvsp[0]), NULL); }
1924
1925 break;
1926
1927 case 39:
1928
1929 { (yyval) = (yyvsp[-1]); }
1930
1931 break;
1932
1933 case 40:
1934
1935 { zend_ini_get_var(&(yyval), &(yyvsp[-1])); zend_string_free(Z_STR((yyvsp[-1]))); }
1936
1937 break;
1938
1939 case 41:
1940
1941 { (yyval) = (yyvsp[0]); }
1942
1943 break;
1944
1945 case 42:
1946
1947 { (yyval) = (yyvsp[0]); /*printf("TC_RAW: '%s'\n", Z_STRVAL($1));*/ }
1948
1949 break;
1950
1951 case 43:
1952
1953 { (yyval) = (yyvsp[0]); /*printf("TC_NUMBER: '%s'\n", Z_STRVAL($1));*/ }
1954
1955 break;
1956
1957 case 44:
1958
1959 { (yyval) = (yyvsp[0]); /*printf("TC_STRING: '%s'\n", Z_STRVAL($1));*/ }
1960
1961 break;
1962
1963 case 45:
1964
1965 { (yyval) = (yyvsp[0]); /*printf("TC_WHITESPACE: '%s'\n", Z_STRVAL($1));*/ }
1966
1967 break;
1968
1969 case 46:
1970
1971 { zend_ini_get_constant(&(yyval), &(yyvsp[0])); }
1972
1973 break;
1974
1975 case 47:
1976
1977 { (yyval) = (yyvsp[0]); /*printf("TC_RAW: '%s'\n", Z_STRVAL($1));*/ }
1978
1979 break;
1980
1981 case 48:
1982
1983 { (yyval) = (yyvsp[0]); /*printf("TC_NUMBER: '%s'\n", Z_STRVAL($1));*/ }
1984
1985 break;
1986
1987 case 49:
1988
1989 { (yyval) = (yyvsp[0]); /*printf("TC_STRING: '%s'\n", Z_STRVAL($1));*/ }
1990
1991 break;
1992
1993 case 50:
1994
1995 { (yyval) = (yyvsp[0]); /*printf("TC_WHITESPACE: '%s'\n", Z_STRVAL($1));*/ }
1996
1997 break;
1998
1999
2000
2001 default: break;
2002 }
2003 /* User semantic actions sometimes alter yychar, and that requires
2004 that yytoken be updated with the new translation. We take the
2005 approach of translating immediately before every use of yytoken.
2006 One alternative is translating here after every semantic action,
2007 but that translation would be missed if the semantic action invokes
2008 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2009 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2010 incorrect destructor might then be invoked immediately. In the
2011 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2012 to an incorrect destructor call or verbose syntax error message
2013 before the lookahead is translated. */
2014 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2015
2016 YYPOPSTACK (yylen);
2017 yylen = 0;
2018 YY_STACK_PRINT (yyss, yyssp);
2019
2020 *++yyvsp = yyval;
2021
2022 /* Now 'shift' the result of the reduction. Determine what state
2023 that goes to, based on the state we popped back to and the rule
2024 number reduced by. */
2025
2026 yyn = yyr1[yyn];
2027
2028 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2029 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2030 yystate = yytable[yystate];
2031 else
2032 yystate = yydefgoto[yyn - YYNTOKENS];
2033
2034 goto yynewstate;
2035
2036
2037 /*--------------------------------------.
2038 | yyerrlab -- here on detecting error. |
2039 `--------------------------------------*/
2040 yyerrlab:
2041 /* Make sure we have latest lookahead translation. See comments at
2042 user semantic actions for why this is necessary. */
2043 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2044
2045 /* If not already recovering from an error, report this error. */
2046 if (!yyerrstatus)
2047 {
2048 ++yynerrs;
2049 #if ! YYERROR_VERBOSE
2050 yyerror (YY_("syntax error"));
2051 #else
2052 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2053 yyssp, yytoken)
2054 {
2055 char const *yymsgp = YY_("syntax error");
2056 int yysyntax_error_status;
2057 yysyntax_error_status = YYSYNTAX_ERROR;
2058 if (yysyntax_error_status == 0)
2059 yymsgp = yymsg;
2060 else if (yysyntax_error_status == 1)
2061 {
2062 if (yymsg != yymsgbuf)
2063 YYSTACK_FREE (yymsg);
2064 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2065 if (!yymsg)
2066 {
2067 yymsg = yymsgbuf;
2068 yymsg_alloc = sizeof yymsgbuf;
2069 yysyntax_error_status = 2;
2070 }
2071 else
2072 {
2073 yysyntax_error_status = YYSYNTAX_ERROR;
2074 yymsgp = yymsg;
2075 }
2076 }
2077 yyerror (yymsgp);
2078 if (yysyntax_error_status == 2)
2079 goto yyexhaustedlab;
2080 }
2081 # undef YYSYNTAX_ERROR
2082 #endif
2083 }
2084
2085
2086
2087 if (yyerrstatus == 3)
2088 {
2089 /* If just tried and failed to reuse lookahead token after an
2090 error, discard it. */
2091
2092 if (yychar <= YYEOF)
2093 {
2094 /* Return failure if at end of input. */
2095 if (yychar == YYEOF)
2096 YYABORT;
2097 }
2098 else
2099 {
2100 yydestruct ("Error: discarding",
2101 yytoken, &yylval);
2102 yychar = YYEMPTY;
2103 }
2104 }
2105
2106 /* Else will try to reuse lookahead token after shifting the error
2107 token. */
2108 goto yyerrlab1;
2109
2110
2111 /*---------------------------------------------------.
2112 | yyerrorlab -- error raised explicitly by YYERROR. |
2113 `---------------------------------------------------*/
2114 yyerrorlab:
2115
2116 /* Pacify compilers like GCC when the user code never invokes
2117 YYERROR and the label yyerrorlab therefore never appears in user
2118 code. */
2119 if (/*CONSTCOND*/ 0)
2120 goto yyerrorlab;
2121
2122 /* Do not reclaim the symbols of the rule whose action triggered
2123 this YYERROR. */
2124 YYPOPSTACK (yylen);
2125 yylen = 0;
2126 YY_STACK_PRINT (yyss, yyssp);
2127 yystate = *yyssp;
2128 goto yyerrlab1;
2129
2130
2131 /*-------------------------------------------------------------.
2132 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2133 `-------------------------------------------------------------*/
2134 yyerrlab1:
2135 yyerrstatus = 3; /* Each real token shifted decrements this. */
2136
2137 for (;;)
2138 {
2139 yyn = yypact[yystate];
2140 if (!yypact_value_is_default (yyn))
2141 {
2142 yyn += YYTERROR;
2143 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2144 {
2145 yyn = yytable[yyn];
2146 if (0 < yyn)
2147 break;
2148 }
2149 }
2150
2151 /* Pop the current state because it cannot handle the error token. */
2152 if (yyssp == yyss)
2153 YYABORT;
2154
2155
2156 yydestruct ("Error: popping",
2157 yystos[yystate], yyvsp);
2158 YYPOPSTACK (1);
2159 yystate = *yyssp;
2160 YY_STACK_PRINT (yyss, yyssp);
2161 }
2162
2163 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2164 *++yyvsp = yylval;
2165 YY_IGNORE_MAYBE_UNINITIALIZED_END
2166
2167
2168 /* Shift the error token. */
2169 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2170
2171 yystate = yyn;
2172 goto yynewstate;
2173
2174
2175 /*-------------------------------------.
2176 | yyacceptlab -- YYACCEPT comes here. |
2177 `-------------------------------------*/
2178 yyacceptlab:
2179 yyresult = 0;
2180 goto yyreturn;
2181
2182 /*-----------------------------------.
2183 | yyabortlab -- YYABORT comes here. |
2184 `-----------------------------------*/
2185 yyabortlab:
2186 yyresult = 1;
2187 goto yyreturn;
2188
2189 #if !defined yyoverflow || YYERROR_VERBOSE
2190 /*-------------------------------------------------.
2191 | yyexhaustedlab -- memory exhaustion comes here. |
2192 `-------------------------------------------------*/
2193 yyexhaustedlab:
2194 yyerror (YY_("memory exhausted"));
2195 yyresult = 2;
2196 /* Fall through. */
2197 #endif
2198
2199 yyreturn:
2200 if (yychar != YYEMPTY)
2201 {
2202 /* Make sure we have latest lookahead translation. See comments at
2203 user semantic actions for why this is necessary. */
2204 yytoken = YYTRANSLATE (yychar);
2205 yydestruct ("Cleanup: discarding lookahead",
2206 yytoken, &yylval);
2207 }
2208 /* Do not reclaim the symbols of the rule whose action triggered
2209 this YYABORT or YYACCEPT. */
2210 YYPOPSTACK (yylen);
2211 YY_STACK_PRINT (yyss, yyssp);
2212 while (yyssp != yyss)
2213 {
2214 yydestruct ("Cleanup: popping",
2215 yystos[*yyssp], yyvsp);
2216 YYPOPSTACK (1);
2217 }
2218 #ifndef yyoverflow
2219 if (yyss != yyssa)
2220 YYSTACK_FREE (yyss);
2221 #endif
2222 #if YYERROR_VERBOSE
2223 if (yymsg != yymsgbuf)
2224 YYSTACK_FREE (yymsg);
2225 #endif
2226 return yyresult;
2227 }
2228