You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1950 lines
55 KiB

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