diff options
Diffstat (limited to 'sapi/phpdbg/phpdbg_parser.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_parser.c | 422 |
1 files changed, 234 insertions, 188 deletions
diff --git a/sapi/phpdbg/phpdbg_parser.c b/sapi/phpdbg/phpdbg_parser.c index 5537dfd330..c5222a0289 100644 --- a/sapi/phpdbg/phpdbg_parser.c +++ b/sapi/phpdbg/phpdbg_parser.c @@ -72,14 +72,14 @@ /* Line 371 of yacc.c */ #line 1 "sapi/phpdbg/phpdbg_parser.y" - + /* * phpdbg_parser.y * (from php-src root) * flex sapi/phpdbg/dev/phpdbg_lexer.l * bison sapi/phpdbg/dev/phpdbg_parser.y */ - + #include "phpdbg.h" #include "phpdbg_cmd.h" #include "phpdbg_utils.h" @@ -92,13 +92,18 @@ #include "phpdbg_lexer.h" #undef yyerror -static int yyerror(void ***tsrm_ls, const char *msg); +static int yyerror(const char *msg); + +ZEND_EXTERN_MODULE_GLOBALS(phpdbg) -ZEND_EXTERN_MODULE_GLOBALS(phpdbg); +#ifdef _MSC_VER +#define YYMALLOC malloc +#define YYFREE free +#endif /* Line 371 of yacc.c */ -#line 102 "sapi/phpdbg/phpdbg_parser.c" +#line 107 "sapi/phpdbg/phpdbg_parser.c" # ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus @@ -129,7 +134,7 @@ extern int phpdbg_debug; #endif /* "%code requires" blocks. */ /* Line 387 of yacc.c */ -#line 31 "sapi/phpdbg/phpdbg_parser.y" +#line 36 "sapi/phpdbg/phpdbg_parser.y" #include "phpdbg.h" #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -139,7 +144,7 @@ typedef void* yyscan_t; /* Line 387 of yacc.c */ -#line 143 "sapi/phpdbg/phpdbg_parser.c" +#line 148 "sapi/phpdbg/phpdbg_parser.c" /* Tokens. */ #ifndef YYTOKENTYPE @@ -157,14 +162,16 @@ typedef void* yyscan_t; T_COLON = 265, T_DCOLON = 266, T_POUND = 267, - T_PROTO = 268, - T_DIGITS = 269, - T_LITERAL = 270, - T_ADDR = 271, - T_OPCODE = 272, - T_ID = 273, - T_INPUT = 274, - T_UNEXPECTED = 275 + T_SEPARATOR = 268, + T_PROTO = 269, + T_DIGITS = 270, + T_LITERAL = 271, + T_ADDR = 272, + T_OPCODE = 273, + T_ID = 274, + T_INPUT = 275, + T_UNEXPECTED = 276, + T_REQ_ID = 277 }; #endif /* Tokens. */ @@ -178,14 +185,16 @@ typedef void* yyscan_t; #define T_COLON 265 #define T_DCOLON 266 #define T_POUND 267 -#define T_PROTO 268 -#define T_DIGITS 269 -#define T_LITERAL 270 -#define T_ADDR 271 -#define T_OPCODE 272 -#define T_ID 273 -#define T_INPUT 274 -#define T_UNEXPECTED 275 +#define T_SEPARATOR 268 +#define T_PROTO 269 +#define T_DIGITS 270 +#define T_LITERAL 271 +#define T_ADDR 272 +#define T_OPCODE 273 +#define T_ID 274 +#define T_INPUT 275 +#define T_UNEXPECTED 276 +#define T_REQ_ID 277 @@ -205,7 +214,7 @@ int phpdbg_parse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus -int phpdbg_parse (void *tsrm_ls); +int phpdbg_parse (void); #else int phpdbg_parse (); #endif @@ -216,7 +225,7 @@ int phpdbg_parse (); /* Copy the second part of user declarations. */ /* Line 390 of yacc.c */ -#line 220 "sapi/phpdbg/phpdbg_parser.c" +#line 229 "sapi/phpdbg/phpdbg_parser.c" #ifdef short # undef short @@ -443,22 +452,22 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 25 +#define YYFINAL 27 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 42 +#define YYLAST 50 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 21 +#define YYNTOKENS 23 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 5 +#define YYNNTS 7 /* YYNRULES -- Number of rules. */ -#define YYNRULES 25 +#define YYNRULES 30 /* YYNRULES -- Number of states. */ -#define YYNSTATES 38 +#define YYNSTATES 46 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 275 +#define YYMAXUTOK 277 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -493,7 +502,7 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20 + 15, 16, 17, 18, 19, 20, 21, 22 }; #if YYDEBUG @@ -501,30 +510,34 @@ static const yytype_uint8 yytranslate[] = YYRHS. */ static const yytype_uint8 yyprhs[] = { - 0, 0, 3, 5, 7, 8, 10, 13, 17, 22, - 27, 33, 37, 43, 47, 50, 52, 54, 56, 58, - 60, 62, 64, 67, 70, 72 + 0, 0, 3, 5, 9, 10, 12, 14, 16, 19, + 22, 26, 31, 36, 42, 46, 52, 56, 59, 61, + 63, 65, 67, 69, 71, 73, 75, 76, 80, 84, + 87 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 22, 0, -1, 23, -1, 25, -1, -1, 24, -1, - 23, 24, -1, 18, 10, 14, -1, 18, 10, 12, - 14, -1, 13, 18, 10, 14, -1, 13, 18, 10, - 12, 14, -1, 18, 11, 18, -1, 18, 11, 18, - 12, 14, -1, 18, 12, 14, -1, 6, 19, -1, - 17, -1, 16, -1, 15, -1, 7, -1, 8, -1, - 14, -1, 18, -1, 3, 19, -1, 5, 19, -1, - 4, -1, 4, 19, -1 + 24, 0, -1, 25, -1, 24, 13, 25, -1, -1, + 26, -1, 29, -1, 27, -1, 26, 27, -1, 26, + 28, -1, 19, 10, 15, -1, 19, 10, 12, 15, + -1, 14, 19, 10, 15, -1, 14, 19, 10, 12, + 15, -1, 19, 11, 19, -1, 19, 11, 19, 12, + 15, -1, 19, 12, 15, -1, 6, 20, -1, 18, + -1, 17, -1, 16, -1, 7, -1, 8, -1, 15, + -1, 19, -1, 22, -1, -1, 3, 28, 20, -1, + 5, 28, 20, -1, 4, 28, -1, 4, 28, 20, + -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 66, 66, 67, 68, 72, 73, 77, 82, 87, - 97, 107, 112, 118, 124, 129, 130, 131, 132, 133, - 134, 135, 139, 144, 149, 153 + 0, 71, 71, 72, 73, 77, 78, 82, 83, 84, + 88, 93, 98, 108, 118, 123, 129, 135, 140, 141, + 142, 143, 144, 145, 146, 150, 151, 155, 160, 165, + 169 }; #endif @@ -537,11 +550,13 @@ static const char *const yytname[] = "\"if (condition)\"", "\"truthy (true, on, yes or enabled)\"", "\"falsy (false, off, no or disabled)\"", "\"string (some input, perhaps)\"", "\": (colon)\"", - "\":: (double colon)\"", "\"# (pound sign)\"", "\"protocol (file://)\"", - "\"digits (numbers)\"", "\"literal (string)\"", "\"address\"", - "\"opcode\"", "\"identifier (command or function name)\"", - "\"input (input string or data)\"", "\"input\"", "$accept", "input", - "parameters", "parameter", "full_expression", YY_NULL + "\":: (double colon)\"", "\"# (pound sign followed by digits)\"", + "\"# (pound sign)\"", "\"protocol (file://)\"", "\"digits (numbers)\"", + "\"literal (string)\"", "\"address\"", "\"opcode\"", + "\"identifier (command or function name)\"", + "\"input (input string or data)\"", "\"input\"", + "\"request id (-r %d)\"", "$accept", "input", "command", "parameters", + "parameter", "req_id", "full_expression", YY_NULL }; #endif @@ -552,24 +567,26 @@ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275 + 275, 276, 277 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 21, 22, 22, 22, 23, 23, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 25, 25, 25, 25 + 0, 23, 24, 24, 24, 25, 25, 26, 26, 26, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 28, 28, 29, 29, 29, + 29 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 1, 1, 0, 1, 2, 3, 4, 4, - 5, 3, 5, 3, 2, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 1, 2 + 0, 2, 1, 3, 0, 1, 1, 1, 2, 2, + 3, 4, 4, 5, 3, 5, 3, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 3, 3, 2, + 3 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -577,33 +594,35 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 4, 0, 24, 0, 0, 18, 19, 0, 20, 17, - 16, 15, 21, 0, 2, 5, 3, 22, 25, 23, - 14, 0, 0, 0, 0, 1, 6, 0, 0, 7, - 11, 13, 0, 9, 8, 0, 10, 12 + 4, 26, 26, 26, 0, 21, 22, 0, 23, 20, + 19, 18, 24, 0, 2, 5, 7, 6, 25, 0, + 29, 0, 17, 0, 0, 0, 0, 1, 0, 8, + 9, 27, 30, 28, 0, 0, 10, 14, 16, 3, + 0, 12, 11, 0, 13, 15 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 13, 14, 15, 16 + -1, 13, 14, 15, 16, 19, 17 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -11 +#define YYPACT_NINF -17 static const yytype_int8 yypact[] = { - -3, -10, 11, 12, 13, -11, -11, 15, -11, -11, - -11, -11, -4, 29, 10, -11, -11, -11, -11, -11, - -11, 24, 7, 17, 22, -11, -11, 8, 23, -11, - 26, -11, 25, -11, -11, 27, -11, -11 + -3, -16, -16, -16, -10, -17, -17, 2, -17, -17, + -17, -17, 26, 9, -17, 11, -17, -17, -17, 3, + 4, 21, -17, 29, 19, 23, 25, -17, -3, -17, + -17, -17, -17, -17, 20, 28, -17, 32, -17, -17, + 30, -17, -17, 31, -17, -17 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -11, -11, -11, 28, -11 + -17, -17, 22, -17, 33, 5, -17 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -612,36 +631,39 @@ static const yytype_int8 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 1, 2, 3, 4, 5, 6, 22, 23, 24, 17, - 7, 8, 9, 10, 11, 12, 4, 5, 6, 28, - 32, 29, 33, 7, 8, 9, 10, 11, 12, 25, - 18, 19, 20, 21, 27, 30, 31, 34, 35, 36, - 0, 37, 26 + 1, 2, 3, 4, 5, 6, 18, 20, 21, 27, + 22, 7, 8, 9, 10, 11, 12, 4, 5, 6, + 30, 23, 28, 31, 32, 7, 8, 9, 10, 11, + 12, 35, 40, 18, 36, 41, 24, 25, 26, 34, + 38, 33, 37, 42, 43, 44, 45, 0, 29, 0, + 39 }; #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-11))) + (!!((Yystate) == (-17))) #define yytable_value_is_error(Yytable_value) \ YYID (0) static const yytype_int8 yycheck[] = { - 3, 4, 5, 6, 7, 8, 10, 11, 12, 19, - 13, 14, 15, 16, 17, 18, 6, 7, 8, 12, - 12, 14, 14, 13, 14, 15, 16, 17, 18, 0, - 19, 19, 19, 18, 10, 18, 14, 14, 12, 14, - -1, 14, 14 + 3, 4, 5, 6, 7, 8, 22, 2, 3, 0, + 20, 14, 15, 16, 17, 18, 19, 6, 7, 8, + 15, 19, 13, 20, 20, 14, 15, 16, 17, 18, + 19, 12, 12, 22, 15, 15, 10, 11, 12, 10, + 15, 20, 19, 15, 12, 15, 15, -1, 15, -1, + 28 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 3, 4, 5, 6, 7, 8, 13, 14, 15, - 16, 17, 18, 22, 23, 24, 25, 19, 19, 19, - 19, 18, 10, 11, 12, 0, 24, 10, 12, 14, - 18, 14, 12, 14, 14, 12, 14, 14 + 0, 3, 4, 5, 6, 7, 8, 14, 15, 16, + 17, 18, 19, 24, 25, 26, 27, 29, 22, 28, + 28, 28, 20, 19, 10, 11, 12, 0, 13, 27, + 28, 20, 20, 20, 10, 12, 15, 19, 15, 25, + 12, 15, 15, 12, 15, 15 }; #define yyerrok (yyerrstatus = 0) @@ -683,7 +705,7 @@ do \ } \ else \ { \ - yyerror (tsrm_ls, YY_("syntax error: cannot back up")); \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) @@ -726,7 +748,7 @@ do { \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value, tsrm_ls); \ + Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) @@ -740,21 +762,19 @@ do { \ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *tsrm_ls) +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, tsrm_ls) +yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; - void *tsrm_ls; #endif { FILE *yyo = yyoutput; YYUSE (yyo); if (!yyvaluep) return; - YYUSE (tsrm_ls); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); @@ -772,14 +792,13 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, tsrm_ls) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *tsrm_ls) +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void -yy_symbol_print (yyoutput, yytype, yyvaluep, tsrm_ls) +yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; - void *tsrm_ls; #endif { if (yytype < YYNTOKENS) @@ -787,7 +806,7 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, tsrm_ls) else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep, tsrm_ls); + yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } @@ -830,13 +849,12 @@ do { \ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *tsrm_ls) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyvsp, yyrule, tsrm_ls) +yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; - void *tsrm_ls; #endif { int yynrhs = yyr2[yyrule]; @@ -850,7 +868,7 @@ yy_reduce_print (yyvsp, yyrule, tsrm_ls) YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) - , tsrm_ls); + ); YYFPRINTF (stderr, "\n"); } } @@ -858,7 +876,7 @@ yy_reduce_print (yyvsp, yyrule, tsrm_ls) # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (yyvsp, Rule, tsrm_ls); \ + yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that @@ -1138,18 +1156,16 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *tsrm_ls) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yymsg, yytype, yyvaluep, tsrm_ls) +yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; - void *tsrm_ls; #endif { YYUSE (yyvaluep); - YYUSE (tsrm_ls); if (!yymsg) yymsg = "Deleting"; @@ -1179,11 +1195,11 @@ yyparse (YYPARSE_PARAM) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int -yyparse (void *tsrm_ls) +yyparse (void) #else int -yyparse (tsrm_ls) - void *tsrm_ls; +yyparse () + #endif #endif { @@ -1451,37 +1467,61 @@ yyreduce: YY_REDUCE_PRINT (yyn); switch (yyn) { - case 3: + case 2: +/* Line 1802 of yacc.c */ +#line 71 "sapi/phpdbg/phpdbg_parser.y" + { (yyval) = (yyvsp[(1) - (1)]); } + break; + + case 3: /* Line 1802 of yacc.c */ -#line 67 "sapi/phpdbg/phpdbg_parser.y" - { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); } +#line 72 "sapi/phpdbg/phpdbg_parser.y" + { phpdbg_stack_separate((yyvsp[(1) - (3)]).top); (yyval) = (yyvsp[(3) - (3)]); } break; case 5: /* Line 1802 of yacc.c */ -#line 72 "sapi/phpdbg/phpdbg_parser.y" - { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); } +#line 77 "sapi/phpdbg/phpdbg_parser.y" + { (yyval).top = PHPDBG_G(parser_stack)->top; } break; case 6: /* Line 1802 of yacc.c */ -#line 73 "sapi/phpdbg/phpdbg_parser.y" - { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); } +#line 78 "sapi/phpdbg/phpdbg_parser.y" + { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); (yyval).top = PHPDBG_G(parser_stack)->top; } break; case 7: /* Line 1802 of yacc.c */ -#line 77 "sapi/phpdbg/phpdbg_parser.y" - { +#line 82 "sapi/phpdbg/phpdbg_parser.y" + { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); (yyval).top = PHPDBG_G(parser_stack)->top; } + break; + + case 8: +/* Line 1802 of yacc.c */ +#line 83 "sapi/phpdbg/phpdbg_parser.y" + { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); (yyval).top = PHPDBG_G(parser_stack)->top; } + break; + + case 9: +/* Line 1802 of yacc.c */ +#line 84 "sapi/phpdbg/phpdbg_parser.y" + { (yyval) = (yyvsp[(1) - (2)]); } + break; + + case 10: +/* Line 1802 of yacc.c */ +#line 88 "sapi/phpdbg/phpdbg_parser.y" + { (yyval).type = FILE_PARAM; (yyval).file.name = (yyvsp[(2) - (3)]).str; (yyval).file.line = (yyvsp[(3) - (3)]).num; } break; - case 8: + case 11: /* Line 1802 of yacc.c */ -#line 82 "sapi/phpdbg/phpdbg_parser.y" +#line 93 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = NUMERIC_FILE_PARAM; (yyval).file.name = (yyvsp[(1) - (4)]).str; @@ -1489,9 +1529,9 @@ yyreduce: } break; - case 9: + case 12: /* Line 1802 of yacc.c */ -#line 87 "sapi/phpdbg/phpdbg_parser.y" +#line 98 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = FILE_PARAM; (yyval).file.name = malloc((yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len + 1); @@ -1504,9 +1544,9 @@ yyreduce: } break; - case 10: + case 13: /* Line 1802 of yacc.c */ -#line 97 "sapi/phpdbg/phpdbg_parser.y" +#line 108 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = NUMERIC_FILE_PARAM; (yyval).file.name = malloc((yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len + 1); @@ -1519,132 +1559,138 @@ yyreduce: } break; - case 11: + case 14: /* Line 1802 of yacc.c */ -#line 107 "sapi/phpdbg/phpdbg_parser.y" - { +#line 118 "sapi/phpdbg/phpdbg_parser.y" + { (yyval).type = METHOD_PARAM; (yyval).method.class = (yyvsp[(1) - (3)]).str; (yyval).method.name = (yyvsp[(3) - (3)]).str; } break; - case 12: + case 15: /* Line 1802 of yacc.c */ -#line 112 "sapi/phpdbg/phpdbg_parser.y" - { +#line 123 "sapi/phpdbg/phpdbg_parser.y" + { (yyval).type = NUMERIC_METHOD_PARAM; (yyval).method.class = (yyvsp[(1) - (5)]).str; (yyval).method.name = (yyvsp[(3) - (5)]).str; - (yyval).num = (yyvsp[(5) - (5)]).num; + (yyval).num = (yyvsp[(5) - (5)]).num; } break; - case 13: + case 16: /* Line 1802 of yacc.c */ -#line 118 "sapi/phpdbg/phpdbg_parser.y" +#line 129 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = NUMERIC_FUNCTION_PARAM; (yyval).str = (yyvsp[(1) - (3)]).str; (yyval).len = (yyvsp[(1) - (3)]).len; - (yyval).num = (yyvsp[(3) - (3)]).num; + (yyval).num = (yyvsp[(3) - (3)]).num; } break; - case 14: + case 17: /* Line 1802 of yacc.c */ -#line 124 "sapi/phpdbg/phpdbg_parser.y" +#line 135 "sapi/phpdbg/phpdbg_parser.y" { - (yyval).type = COND_PARAM; + (yyval).type = COND_PARAM; (yyval).str = (yyvsp[(2) - (2)]).str; (yyval).len = (yyvsp[(2) - (2)]).len; } break; - case 15: + case 18: /* Line 1802 of yacc.c */ -#line 129 "sapi/phpdbg/phpdbg_parser.y" +#line 140 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; - case 16: + case 19: /* Line 1802 of yacc.c */ -#line 130 "sapi/phpdbg/phpdbg_parser.y" +#line 141 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; - case 17: + case 20: /* Line 1802 of yacc.c */ -#line 131 "sapi/phpdbg/phpdbg_parser.y" +#line 142 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; - case 18: + case 21: /* Line 1802 of yacc.c */ -#line 132 "sapi/phpdbg/phpdbg_parser.y" +#line 143 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; - case 19: + case 22: /* Line 1802 of yacc.c */ -#line 133 "sapi/phpdbg/phpdbg_parser.y" +#line 144 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; - case 20: + case 23: /* Line 1802 of yacc.c */ -#line 134 "sapi/phpdbg/phpdbg_parser.y" +#line 145 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; - case 21: + case 24: /* Line 1802 of yacc.c */ -#line 135 "sapi/phpdbg/phpdbg_parser.y" +#line 146 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; - case 22: + case 25: /* Line 1802 of yacc.c */ -#line 139 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = EVAL_PARAM; - (yyval).str = (yyvsp[(2) - (2)]).str; - (yyval).len = (yyvsp[(2) - (2)]).len; +#line 150 "sapi/phpdbg/phpdbg_parser.y" + { PHPDBG_G(req_id) = (yyvsp[(1) - (1)]).num; } + break; + + case 27: +/* Line 1802 of yacc.c */ +#line 155 "sapi/phpdbg/phpdbg_parser.y" + { + (yyval).type = EVAL_PARAM; + (yyval).str = (yyvsp[(3) - (3)]).str; + (yyval).len = (yyvsp[(3) - (3)]).len; } break; - case 23: + case 28: /* Line 1802 of yacc.c */ -#line 144 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = SHELL_PARAM; - (yyval).str = (yyvsp[(2) - (2)]).str; - (yyval).len = (yyvsp[(2) - (2)]).len; +#line 160 "sapi/phpdbg/phpdbg_parser.y" + { + (yyval).type = SHELL_PARAM; + (yyval).str = (yyvsp[(3) - (3)]).str; + (yyval).len = (yyvsp[(3) - (3)]).len; } break; - case 24: + case 29: /* Line 1802 of yacc.c */ -#line 149 "sapi/phpdbg/phpdbg_parser.y" +#line 165 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = RUN_PARAM; (yyval).len = 0; } break; - case 25: + case 30: /* Line 1802 of yacc.c */ -#line 153 "sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = RUN_PARAM; - (yyval).str = (yyvsp[(2) - (2)]).str; - (yyval).len = (yyvsp[(2) - (2)]).len; +#line 169 "sapi/phpdbg/phpdbg_parser.y" + { + (yyval).type = RUN_PARAM; + (yyval).str = (yyvsp[(3) - (3)]).str; + (yyval).len = (yyvsp[(3) - (3)]).len; } break; /* Line 1802 of yacc.c */ -#line 1648 "sapi/phpdbg/phpdbg_parser.c" +#line 1694 "sapi/phpdbg/phpdbg_parser.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1694,7 +1740,7 @@ yyerrlab: { ++yynerrs; #if ! YYERROR_VERBOSE - yyerror (tsrm_ls, YY_("syntax error")); + yyerror (YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) @@ -1721,7 +1767,7 @@ yyerrlab: yymsgp = yymsg; } } - yyerror (tsrm_ls, yymsgp); + yyerror (yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } @@ -1745,7 +1791,7 @@ yyerrlab: else { yydestruct ("Error: discarding", - yytoken, &yylval, tsrm_ls); + yytoken, &yylval); yychar = YYEMPTY; } } @@ -1801,7 +1847,7 @@ yyerrlab1: yydestruct ("Error: popping", - yystos[yystate], yyvsp, tsrm_ls); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -1838,7 +1884,7 @@ yyabortlab: | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: - yyerror (tsrm_ls, YY_("memory exhausted")); + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif @@ -1850,7 +1896,7 @@ yyreturn: user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, tsrm_ls); + yytoken, &yylval); } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ @@ -1859,7 +1905,7 @@ yyreturn: while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, tsrm_ls); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -1876,15 +1922,15 @@ yyreturn: /* Line 2050 of yacc.c */ -#line 160 "sapi/phpdbg/phpdbg_parser.y" +#line 176 "sapi/phpdbg/phpdbg_parser.y" -static int yyerror(void ***tsrm_ls, const char *msg) { - phpdbg_error("Parse Error: %s", msg); +static int yyerror(const char *msg) { + phpdbg_error("command", "type=\"parseerror\" msg=\"%s\"", "Parse Error: %s", msg); { const phpdbg_param_t *top = PHPDBG_G(parser_stack); - + while (top) { phpdbg_param_debug(top, "--> "); top = top->next; @@ -1893,12 +1939,12 @@ static int yyerror(void ***tsrm_ls, const char *msg) { return 0; } -int phpdbg_do_parse(phpdbg_param_t *stack, char *input TSRMLS_DC) { - phpdbg_init_lexer(stack, input TSRMLS_CC); +int phpdbg_do_parse(phpdbg_param_t *stack, char *input) { + if (!*input) { + return 0; + } -#ifdef ZTS - return yyparse(TSRMLS_C); -#else - return yyparse(NULL); -#endif + phpdbg_init_lexer(stack, input); + + return yyparse(); } |