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.

1871 lines
49 KiB

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