Coverage Report

Created: 2026-10-28 06:20

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