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