mirror of
https://github.com/php/php-src.git
synced 2025-08-17 22:48:57 +02:00
...
This commit is contained in:
parent
fde1e44d62
commit
b82ad53b29
8 changed files with 222 additions and 259 deletions
193
phpdbg_parser.c
193
phpdbg_parser.c
|
@ -153,17 +153,16 @@ typedef void* yyscan_t;
|
|||
T_TRUTHY = 261,
|
||||
T_FALSY = 262,
|
||||
T_STRING = 263,
|
||||
T_SQUIGGLE = 264,
|
||||
T_COLON = 265,
|
||||
T_DCOLON = 266,
|
||||
T_POUND = 267,
|
||||
T_DIGITS = 268,
|
||||
T_LITERAL = 269,
|
||||
T_ADDR = 270,
|
||||
T_OPCODE = 271,
|
||||
T_ID = 272,
|
||||
T_INPUT = 273,
|
||||
T_UNEXPECTED = 274
|
||||
T_COLON = 264,
|
||||
T_DCOLON = 265,
|
||||
T_POUND = 266,
|
||||
T_DIGITS = 267,
|
||||
T_LITERAL = 268,
|
||||
T_ADDR = 269,
|
||||
T_OPCODE = 270,
|
||||
T_ID = 271,
|
||||
T_INPUT = 272,
|
||||
T_UNEXPECTED = 273
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -181,7 +180,7 @@ typedef int YYSTYPE;
|
|||
|
||||
|
||||
/* Line 343 of yacc.c */
|
||||
#line 185 "sapi/phpdbg/phpdbg_parser.c"
|
||||
#line 184 "sapi/phpdbg/phpdbg_parser.c"
|
||||
|
||||
#ifdef short
|
||||
# undef short
|
||||
|
@ -398,22 +397,22 @@ union yyalloc
|
|||
#endif /* !YYCOPY_NEEDED */
|
||||
|
||||
/* YYFINAL -- State number of the termination state. */
|
||||
#define YYFINAL 22
|
||||
#define YYFINAL 20
|
||||
/* YYLAST -- Last index in YYTABLE. */
|
||||
#define YYLAST 25
|
||||
#define YYLAST 23
|
||||
|
||||
/* YYNTOKENS -- Number of terminals. */
|
||||
#define YYNTOKENS 20
|
||||
#define YYNTOKENS 19
|
||||
/* YYNNTS -- Number of nonterminals. */
|
||||
#define YYNNTS 4
|
||||
/* YYNRULES -- Number of rules. */
|
||||
#define YYNRULES 20
|
||||
#define YYNRULES 19
|
||||
/* YYNRULES -- Number of states. */
|
||||
#define YYNSTATES 29
|
||||
#define YYNSTATES 27
|
||||
|
||||
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
||||
#define YYUNDEFTOK 2
|
||||
#define YYMAXUTOK 274
|
||||
#define YYMAXUTOK 273
|
||||
|
||||
#define YYTRANSLATE(YYX) \
|
||||
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
||||
|
@ -448,7 +447,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
|
||||
15, 16, 17, 18
|
||||
};
|
||||
|
||||
#if YYDEBUG
|
||||
|
@ -456,28 +455,26 @@ static const yytype_uint8 yytranslate[] =
|
|||
YYRHS. */
|
||||
static const yytype_uint8 yyprhs[] =
|
||||
{
|
||||
0, 0, 3, 5, 6, 8, 11, 14, 18, 22,
|
||||
28, 32, 35, 38, 41, 43, 45, 47, 49, 51,
|
||||
53
|
||||
0, 0, 3, 5, 6, 8, 11, 15, 19, 25,
|
||||
29, 32, 35, 38, 40, 42, 44, 46, 48, 50
|
||||
};
|
||||
|
||||
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
||||
static const yytype_int8 yyrhs[] =
|
||||
{
|
||||
21, 0, -1, 22, -1, -1, 23, -1, 22, 23,
|
||||
-1, 9, 13, -1, 17, 10, 13, -1, 17, 11,
|
||||
17, -1, 17, 11, 17, 12, 13, -1, 17, 12,
|
||||
13, -1, 5, 18, -1, 3, 18, -1, 4, 18,
|
||||
-1, 16, -1, 15, -1, 14, -1, 6, -1, 7,
|
||||
-1, 13, -1, 17, -1
|
||||
20, 0, -1, 21, -1, -1, 22, -1, 21, 22,
|
||||
-1, 16, 9, 12, -1, 16, 10, 16, -1, 16,
|
||||
10, 16, 11, 12, -1, 16, 11, 12, -1, 5,
|
||||
17, -1, 3, 17, -1, 4, 17, -1, 15, -1,
|
||||
14, -1, 13, -1, 6, -1, 7, -1, 12, -1,
|
||||
16, -1
|
||||
};
|
||||
|
||||
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
||||
static const yytype_uint8 yyrline[] =
|
||||
{
|
||||
0, 75, 75, 76, 80, 81, 85, 89, 94, 99,
|
||||
105, 111, 116, 121, 126, 127, 128, 129, 130, 131,
|
||||
132
|
||||
0, 74, 74, 75, 79, 80, 84, 89, 94, 100,
|
||||
106, 111, 116, 121, 122, 123, 124, 125, 126, 127
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -489,7 +486,7 @@ static const char *const yytname[] =
|
|||
"$end", "error", "$undefined", "\"eval\"", "\"shell\"",
|
||||
"\"if (condition)\"", "\"truthy (true, on, yes or enabled)\"",
|
||||
"\"falsy (false, off, no or disabled)\"",
|
||||
"\"string (some input, perhaps)\"", "\"~ (squiggle)\"", "\": (colon)\"",
|
||||
"\"string (some input, perhaps)\"", "\": (colon)\"",
|
||||
"\":: (double colon)\"", "\"# (pound sign)\"", "\"digits (numbers)\"",
|
||||
"\"literal (string)\"", "\"address\"", "\"opcode\"",
|
||||
"\"identifier (command or function name)\"",
|
||||
|
@ -504,24 +501,22 @@ static const char *const yytname[] =
|
|||
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
|
||||
265, 266, 267, 268, 269, 270, 271, 272, 273
|
||||
};
|
||||
# endif
|
||||
|
||||
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
||||
static const yytype_uint8 yyr1[] =
|
||||
{
|
||||
0, 20, 21, 21, 22, 22, 23, 23, 23, 23,
|
||||
23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
|
||||
23
|
||||
0, 19, 20, 20, 21, 21, 22, 22, 22, 22,
|
||||
22, 22, 22, 22, 22, 22, 22, 22, 22, 22
|
||||
};
|
||||
|
||||
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
||||
static const yytype_uint8 yyr2[] =
|
||||
{
|
||||
0, 2, 1, 0, 1, 2, 2, 3, 3, 5,
|
||||
3, 2, 2, 2, 1, 1, 1, 1, 1, 1,
|
||||
1
|
||||
0, 2, 1, 0, 1, 2, 3, 3, 5, 3,
|
||||
2, 2, 2, 1, 1, 1, 1, 1, 1, 1
|
||||
};
|
||||
|
||||
/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
|
||||
|
@ -529,31 +524,31 @@ static const yytype_uint8 yyr2[] =
|
|||
means the default is an error. */
|
||||
static const yytype_uint8 yydefact[] =
|
||||
{
|
||||
3, 0, 0, 0, 17, 18, 0, 19, 16, 15,
|
||||
14, 20, 0, 2, 4, 12, 13, 11, 6, 0,
|
||||
0, 0, 1, 5, 7, 8, 10, 0, 9
|
||||
3, 0, 0, 0, 16, 17, 18, 15, 14, 13,
|
||||
19, 0, 2, 4, 11, 12, 10, 0, 0, 0,
|
||||
1, 5, 6, 7, 9, 0, 8
|
||||
};
|
||||
|
||||
/* YYDEFGOTO[NTERM-NUM]. */
|
||||
static const yytype_int8 yydefgoto[] =
|
||||
{
|
||||
-1, 12, 13, 14
|
||||
-1, 11, 12, 13
|
||||
};
|
||||
|
||||
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
||||
STATE-NUM. */
|
||||
#define YYPACT_NINF -14
|
||||
#define YYPACT_NINF -10
|
||||
static const yytype_int8 yypact[] =
|
||||
{
|
||||
-3, -13, -11, -10, -14, -14, -4, -14, -14, -14,
|
||||
-14, 5, 18, -3, -14, -14, -14, -14, -14, 6,
|
||||
3, 8, -14, -14, -14, 10, -14, 11, -14
|
||||
-3, -9, -2, -1, -10, -10, -10, -10, -10, -10,
|
||||
-4, 14, -3, -10, -10, -10, -10, 5, 2, 7,
|
||||
-10, -10, -10, 9, -10, 10, -10
|
||||
};
|
||||
|
||||
/* YYPGOTO[NTERM-NUM]. */
|
||||
static const yytype_int8 yypgoto[] =
|
||||
{
|
||||
-14, -14, -14, 12
|
||||
-10, -10, -10, 11
|
||||
};
|
||||
|
||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||
|
@ -562,31 +557,31 @@ static const yytype_int8 yypgoto[] =
|
|||
#define YYTABLE_NINF -1
|
||||
static const yytype_uint8 yytable[] =
|
||||
{
|
||||
1, 2, 3, 4, 5, 15, 6, 16, 17, 18,
|
||||
7, 8, 9, 10, 11, 19, 20, 21, 22, 24,
|
||||
25, 26, 27, 0, 28, 23
|
||||
1, 2, 3, 4, 5, 17, 18, 19, 14, 6,
|
||||
7, 8, 9, 10, 20, 15, 16, 22, 23, 24,
|
||||
25, 0, 26, 21
|
||||
};
|
||||
|
||||
#define yypact_value_is_default(yystate) \
|
||||
((yystate) == (-14))
|
||||
((yystate) == (-10))
|
||||
|
||||
#define yytable_value_is_error(yytable_value) \
|
||||
YYID (0)
|
||||
|
||||
static const yytype_int8 yycheck[] =
|
||||
{
|
||||
3, 4, 5, 6, 7, 18, 9, 18, 18, 13,
|
||||
13, 14, 15, 16, 17, 10, 11, 12, 0, 13,
|
||||
17, 13, 12, -1, 13, 13
|
||||
3, 4, 5, 6, 7, 9, 10, 11, 17, 12,
|
||||
13, 14, 15, 16, 0, 17, 17, 12, 16, 12,
|
||||
11, -1, 12, 12
|
||||
};
|
||||
|
||||
/* 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, 9, 13, 14, 15,
|
||||
16, 17, 21, 22, 23, 18, 18, 18, 13, 10,
|
||||
11, 12, 0, 23, 13, 17, 13, 12, 13
|
||||
0, 3, 4, 5, 6, 7, 12, 13, 14, 15,
|
||||
16, 20, 21, 22, 17, 17, 17, 9, 10, 11,
|
||||
0, 22, 12, 16, 12, 11, 12
|
||||
};
|
||||
|
||||
#define yyerrok (yyerrstatus = 0)
|
||||
|
@ -1435,24 +1430,25 @@ yyreduce:
|
|||
case 4:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 80 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
#line 79 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{ phpdbg_stack_push(stack, &(yyvsp[(1) - (1)])); }
|
||||
break;
|
||||
|
||||
case 5:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 81 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
#line 80 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{ phpdbg_stack_push(stack, &(yyvsp[(2) - (2)])); }
|
||||
break;
|
||||
|
||||
case 6:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 85 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{
|
||||
(yyval).type = OPLINE_PARAM;
|
||||
(yyval).num = (yyvsp[(2) - (2)]).num;
|
||||
#line 84 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{
|
||||
(yyval).type = FILE_PARAM;
|
||||
(yyval).file.name = (yyvsp[(1) - (3)]).str;
|
||||
(yyval).file.line = (yyvsp[(3) - (3)]).num;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1460,10 +1456,10 @@ yyreduce:
|
|||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 89 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{
|
||||
(yyval).type = FILE_PARAM;
|
||||
(yyval).file.name = (yyvsp[(1) - (3)]).str;
|
||||
(yyval).file.line = (yyvsp[(3) - (3)]).num;
|
||||
{
|
||||
(yyval).type = METHOD_PARAM;
|
||||
(yyval).method.class = (yyvsp[(1) - (3)]).str;
|
||||
(yyval).method.name = (yyvsp[(3) - (3)]).str;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1471,17 +1467,6 @@ yyreduce:
|
|||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 94 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{
|
||||
(yyval).type = METHOD_PARAM;
|
||||
(yyval).method.class = (yyvsp[(1) - (3)]).str;
|
||||
(yyval).method.name = (yyvsp[(3) - (3)]).str;
|
||||
}
|
||||
break;
|
||||
|
||||
case 9:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 99 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{
|
||||
(yyval).type = NUMERIC_METHOD_PARAM;
|
||||
(yyval).method.class = (yyvsp[(1) - (5)]).str;
|
||||
|
@ -1490,10 +1475,10 @@ yyreduce:
|
|||
}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 9:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 105 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
#line 100 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{
|
||||
(yyval).type = NUMERIC_FUNCTION_PARAM;
|
||||
(yyval).str = (yyvsp[(1) - (3)]).str;
|
||||
|
@ -1502,12 +1487,23 @@ yyreduce:
|
|||
}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 106 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{
|
||||
(yyval).type = COND_PARAM;
|
||||
(yyval).str = (yyvsp[(2) - (2)]).str;
|
||||
(yyval).len = (yyvsp[(2) - (2)]).len;
|
||||
}
|
||||
break;
|
||||
|
||||
case 11:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 111 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{
|
||||
(yyval).type = COND_PARAM;
|
||||
(yyval).type = EVAL_PARAM;
|
||||
(yyval).str = (yyvsp[(2) - (2)]).str;
|
||||
(yyval).len = (yyvsp[(2) - (2)]).len;
|
||||
}
|
||||
|
@ -1517,8 +1513,8 @@ yyreduce:
|
|||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 116 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{
|
||||
(yyval).type = EVAL_PARAM;
|
||||
{
|
||||
(yyval).type = SHELL_PARAM;
|
||||
(yyval).str = (yyvsp[(2) - (2)]).str;
|
||||
(yyval).len = (yyvsp[(2) - (2)]).len;
|
||||
}
|
||||
|
@ -1528,66 +1524,55 @@ yyreduce:
|
|||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 121 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{
|
||||
(yyval).type = SHELL_PARAM;
|
||||
(yyval).str = (yyvsp[(2) - (2)]).str;
|
||||
(yyval).len = (yyvsp[(2) - (2)]).len;
|
||||
}
|
||||
{ (yyval) = (yyvsp[(1) - (1)]); }
|
||||
break;
|
||||
|
||||
case 14:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 126 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
#line 122 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{ (yyval) = (yyvsp[(1) - (1)]); }
|
||||
break;
|
||||
|
||||
case 15:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 127 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
#line 123 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{ (yyval) = (yyvsp[(1) - (1)]); }
|
||||
break;
|
||||
|
||||
case 16:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 128 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
#line 124 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{ (yyval) = (yyvsp[(1) - (1)]); }
|
||||
break;
|
||||
|
||||
case 17:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 129 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
#line 125 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{ (yyval) = (yyvsp[(1) - (1)]); }
|
||||
break;
|
||||
|
||||
case 18:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 130 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
#line 126 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{ (yyval) = (yyvsp[(1) - (1)]); }
|
||||
break;
|
||||
|
||||
case 19:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 131 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{ (yyval) = (yyvsp[(1) - (1)]); }
|
||||
break;
|
||||
|
||||
case 20:
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 132 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
#line 127 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
{ (yyval) = (yyvsp[(1) - (1)]); }
|
||||
break;
|
||||
|
||||
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 1591 "sapi/phpdbg/phpdbg_parser.c"
|
||||
#line 1576 "sapi/phpdbg/phpdbg_parser.c"
|
||||
default: break;
|
||||
}
|
||||
/* User semantic actions sometimes alter yychar, and that requires
|
||||
|
@ -1818,6 +1803,6 @@ yyreturn:
|
|||
|
||||
|
||||
/* Line 2067 of yacc.c */
|
||||
#line 135 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
#line 130 "sapi/phpdbg/dev/phpdbg_parser.y"
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue