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