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