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