diff options
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/phpdbg/phpdbg_help.c | 7 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg_lexer.c | 1005 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg_lexer.l | 38 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg_list.c | 23 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg_parser.c | 80 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg_parser.y | 12 |
6 files changed, 662 insertions, 503 deletions
diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c index f2d074ded6..1e58dc69ca 100644 --- a/sapi/phpdbg/phpdbg_help.c +++ b/sapi/phpdbg/phpdbg_help.c @@ -318,8 +318,9 @@ phpdbg_help_text_t phpdbg_help_text[] = { "**Information**" CR " **list** list PHP source" CR " **info** displays information on the debug session" CR -" **print** show opcodes " CR +" **print** show opcodes" CR " **frame** select a stack frame and print a stack frame summary" CR +" **back** shows the current backtrace" CR " **help** provide help on a topic" CR CR "**Starting and Stopping Execution**" CR @@ -613,7 +614,7 @@ phpdbg_help_text_t phpdbg_help_text[] = { {"finish", "The **finish** command causes control to be passed back to the vm, continuing execution. Any " "breakpoints that are encountered within the current stack frame will be skipped. Execution " -"will then continue until the next breakpoint after leaving the stack frame or unitil " +"will then continue until the next breakpoint after leaving the stack frame or until " "completion of the script" CR CR "Note when **step**ping is enabled, any opcode steps within the current stack frame are also " @@ -629,7 +630,7 @@ phpdbg_help_text_t phpdbg_help_text[] = { "**Examples**" CR CR " $P frame 2" CR -" $P E $count" CR +" $P ev $count" CR " Go to frame 2 and print out variable **$count** in that frame" CR CR "Note that this frame scope is discarded when execution continues, with the execution frame " diff --git a/sapi/phpdbg/phpdbg_lexer.c b/sapi/phpdbg/phpdbg_lexer.c index 420dcac042..3092dc396d 100644 --- a/sapi/phpdbg/phpdbg_lexer.c +++ b/sapi/phpdbg/phpdbg_lexer.c @@ -96,33 +96,49 @@ yyc_INITIAL: }; YYDEBUG(0, *YYCURSOR); - YYFILL(3); + YYFILL(4); yych = *YYCURSOR; - if (yych <= 0x1F) { - if (yych <= '\t') { + if (yych <= 'D') { + if (yych <= '\n') { if (yych <= 0x00) goto yy6; if (yych <= 0x08) goto yy11; + if (yych >= '\n') goto yy4; } else { - if (yych <= '\n') goto yy4; - if (yych != '\r') goto yy11; + if (yych <= '\r') { + if (yych <= '\f') goto yy11; + } else { + if (yych != ' ') goto yy11; + } } } else { - if (yych <= 'e') { - if (yych <= ' ') goto yy2; - if (yych <= 'd') goto yy11; - goto yy7; + if (yych <= 'd') { + if (yych <= 'Q') { + if (yych <= 'E') goto yy7; + goto yy11; + } else { + if (yych <= 'R') goto yy10; + if (yych <= 'S') goto yy8; + goto yy11; + } } else { - if (yych <= 'q') goto yy11; - if (yych <= 'r') goto yy9; - if (yych <= 's') goto yy8; - goto yy11; + if (yych <= 'q') { + if (yych <= 'e') goto yy7; + goto yy11; + } else { + if (yych <= 'r') goto yy9; + if (yych <= 's') goto yy8; + goto yy11; + } } } -yy2: YYDEBUG(2, *YYCURSOR); ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 128) { - goto yy19; + if ((yych = *YYCURSOR) <= '\f') { + if (yych <= 0x08) goto yy3; + if (yych <= '\n') goto yy26; + } else { + if (yych <= '\r') goto yy26; + if (yych == ' ') goto yy26; } yy3: YYDEBUG(3, *YYCURSOR); @@ -134,49 +150,60 @@ yy3: YYCURSOR = LEX(text); goto restart; } -#line 138 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +#line 154 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" yy4: YYDEBUG(4, *YYCURSOR); ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 128) { - goto yy19; + if ((yych = *YYCURSOR) <= '\f') { + if (yych <= 0x08) goto yy5; + if (yych <= '\n') goto yy26; + } else { + if (yych <= '\r') goto yy26; + if (yych == ' ') goto yy26; } +yy5: YYDEBUG(5, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 68 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { return 0; } -#line 151 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +#line 172 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" yy6: YYDEBUG(6, *YYCURSOR); yych = *++YYCURSOR; goto yy3; yy7: YYDEBUG(7, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'v') goto yy17; + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == 'V') goto yy22; + if (yych == 'v') goto yy22; goto yy3; yy8: YYDEBUG(8, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'h') goto yy15; + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == 'H') goto yy18; + if (yych == 'h') goto yy18; goto yy3; yy9: YYDEBUG(9, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy15; + } + if (yych == 'U') goto yy12; if (yych == 'u') goto yy12; + goto yy3; yy10: YYDEBUG(10, *YYCURSOR); - yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 155 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" - { - YYSETCONDITION(RAW); - phpdbg_init_param(yylval, EMPTY_PARAM); - return T_RUN; -} -#line 180 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == 'U') goto yy12; + if (yych == 'u') goto yy12; + goto yy3; yy11: YYDEBUG(11, *YYCURSOR); yych = *++YYCURSOR; @@ -184,18 +211,62 @@ yy11: yy12: YYDEBUG(12, *YYCURSOR); yych = *++YYCURSOR; + if (yych == 'N') goto yy14; if (yych == 'n') goto yy14; +yy13: YYDEBUG(13, *YYCURSOR); YYCURSOR = YYMARKER; - goto yy10; + goto yy3; yy14: YYDEBUG(14, *YYCURSOR); yych = *++YYCURSOR; - goto yy10; + if (yybm[0+yych] & 128) { + goto yy15; + } + goto yy13; yy15: YYDEBUG(15, *YYCURSOR); ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; YYDEBUG(16, *YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy15; + } + YYDEBUG(17, *YYCURSOR); + yyleng = (size_t) YYCURSOR - (size_t) yytext; +#line 155 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" + { + YYSETCONDITION(RAW); + phpdbg_init_param(yylval, EMPTY_PARAM); + return T_RUN; +} +#line 245 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy18: + YYDEBUG(18, *YYCURSOR); + yych = *++YYCURSOR; + if (yych <= '\f') { + if (yych <= 0x08) goto yy13; + if (yych >= '\v') goto yy13; + } else { + if (yych <= '\r') goto yy19; + if (yych != ' ') goto yy13; + } +yy19: + YYDEBUG(19, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(20, *YYCURSOR); + if (yych <= '\f') { + if (yych <= 0x08) goto yy21; + if (yych <= '\n') goto yy19; + } else { + if (yych <= '\r') goto yy19; + if (yych == ' ') goto yy19; + } +yy21: + YYDEBUG(21, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 150 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -203,11 +274,32 @@ yy15: phpdbg_init_param(yylval, EMPTY_PARAM); return T_SHELL; } -#line 207 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy17: - YYDEBUG(17, *YYCURSOR); +#line 278 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy22: + YYDEBUG(22, *YYCURSOR); + yych = *++YYCURSOR; + if (yych <= '\f') { + if (yych <= 0x08) goto yy13; + if (yych >= '\v') goto yy13; + } else { + if (yych <= '\r') goto yy23; + if (yych != ' ') goto yy13; + } +yy23: + YYDEBUG(23, *YYCURSOR); ++YYCURSOR; - YYDEBUG(18, *YYCURSOR); + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(24, *YYCURSOR); + if (yych <= '\f') { + if (yych <= 0x08) goto yy25; + if (yych <= '\n') goto yy23; + } else { + if (yych <= '\r') goto yy23; + if (yych == ' ') goto yy23; + } +yy25: + YYDEBUG(25, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 145 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -215,17 +307,22 @@ yy17: phpdbg_init_param(yylval, EMPTY_PARAM); return T_EVAL; } -#line 219 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy19: - YYDEBUG(19, *YYCURSOR); +#line 311 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy26: + YYDEBUG(26, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(20, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy19; + YYDEBUG(27, *YYCURSOR); + if (yych <= '\f') { + if (yych <= 0x08) goto yy28; + if (yych <= '\n') goto yy26; + } else { + if (yych <= '\r') goto yy26; + if (yych == ' ') goto yy26; } - YYDEBUG(21, *YYCURSOR); +yy28: + YYDEBUG(28, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 139 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -233,7 +330,7 @@ yy19: goto restart; } -#line 237 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +#line 334 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" } /* *********************************** */ yyc_NORMAL: @@ -272,71 +369,60 @@ yyc_NORMAL: 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, }; - YYDEBUG(22, *YYCURSOR); + YYDEBUG(29, *YYCURSOR); YYFILL(11); yych = *YYCURSOR; - if (yych <= ':') { - if (yych <= ' ') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy29; - if (yych <= 0x08) goto yy32; - if (yych >= '\n') goto yy27; - } else { - if (yych == '\r') goto yy24; - if (yych <= 0x1F) goto yy32; - } - } else { - if (yych <= '.') { - if (yych == '#') goto yy47; - if (yych <= '-') goto yy32; - goto yy34; - } else { - if (yych <= '/') goto yy32; - if (yych <= '0') goto yy37; - if (yych <= '9') goto yy34; - goto yy49; - } - } - } else { - if (yych <= 'i') { - if (yych <= 'd') { - if (yych == 'Z') goto yy38; - if (yych <= 'c') goto yy32; - goto yy39; - } else { - if (yych <= 'e') goto yy40; - if (yych <= 'f') goto yy41; - if (yych <= 'h') goto yy32; - goto yy30; - } - } else { - if (yych <= 's') { - if (yych <= 'm') goto yy32; - if (yych <= 'n') goto yy42; - if (yych <= 'o') goto yy43; - goto yy32; - } else { - if (yych <= 'x') { - if (yych <= 't') goto yy44; - goto yy32; - } else { - if (yych <= 'y') goto yy45; - if (yych <= 'z') goto yy46; - goto yy32; - } - } - } + YYDEBUG(-1, yych); + switch (yych) { + case 0x00: goto yy36; + case '\t': + case '\r': + case ' ': goto yy31; + case '\n': goto yy34; + case '#': goto yy55; + case '-': goto yy41; + case '.': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy42; + case '0': goto yy45; + case ':': goto yy57; + case 'D': + case 'd': goto yy46; + case 'E': + case 'e': goto yy47; + case 'F': + case 'f': goto yy48; + case 'I': + case 'i': goto yy37; + case 'N': + case 'n': goto yy49; + case 'O': + case 'o': goto yy50; + case 'T': + case 't': goto yy51; + case 'Y': + case 'y': goto yy52; + case 'Z': goto yy53; + case 'z': goto yy54; + default: goto yy39; } -yy24: - YYDEBUG(24, *YYCURSOR); +yy31: + YYDEBUG(31, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(25, *YYCURSOR); + YYDEBUG(32, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy24; + goto yy31; } - YYDEBUG(26, *YYCURSOR); + YYDEBUG(33, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 139 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -344,33 +430,34 @@ yy24: goto restart; } -#line 348 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy27: - YYDEBUG(27, *YYCURSOR); +#line 434 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy34: + YYDEBUG(34, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 8) { - goto yy24; + goto yy31; } -yy28: - YYDEBUG(28, *YYCURSOR); +yy35: + YYDEBUG(35, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 68 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { return 0; } -#line 362 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy29: - YYDEBUG(29, *YYCURSOR); +#line 448 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy36: + YYDEBUG(36, *YYCURSOR); yych = *++YYCURSOR; - goto yy28; -yy30: - YYDEBUG(30, *YYCURSOR); + goto yy35; +yy37: + YYDEBUG(37, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'f') goto yy94; - goto yy33; -yy31: - YYDEBUG(31, *YYCURSOR); + if (yych == 'F') goto yy106; + if (yych == 'f') goto yy106; + goto yy40; +yy38: + YYDEBUG(38, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 125 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -379,48 +466,56 @@ yy31: yylval->len = yyleng; return T_ID; } -#line 383 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy32: - YYDEBUG(32, *YYCURSOR); +#line 470 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy39: + YYDEBUG(39, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; -yy33: - YYDEBUG(33, *YYCURSOR); +yy40: + YYDEBUG(40, *YYCURSOR); if (yybm[0+yych] & 16) { - goto yy32; + goto yy39; } - if (yych <= '9') goto yy31; - goto yy54; -yy34: - YYDEBUG(34, *YYCURSOR); + if (yych <= '9') goto yy38; + goto yy62; +yy41: + YYDEBUG(41, *YYCURSOR); + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 32) { + goto yy42; + } + goto yy40; +yy42: + YYDEBUG(42, *YYCURSOR); yyaccept = 1; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(35, *YYCURSOR); + YYDEBUG(43, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy34; + goto yy42; } if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x00) goto yy36; - if (yych <= 0x08) goto yy32; + if (yych <= 0x00) goto yy44; + if (yych <= 0x08) goto yy39; } else { - if (yych != '\r') goto yy32; + if (yych != '\r') goto yy39; } } else { if (yych <= '#') { - if (yych <= ' ') goto yy36; - if (yych <= '"') goto yy32; + if (yych <= ' ') goto yy44; + if (yych <= '"') goto yy39; } else { - if (yych == ':') goto yy54; - goto yy32; + if (yych == ':') goto yy62; + goto yy39; } } -yy36: - YYDEBUG(36, *YYCURSOR); +yy44: + YYDEBUG(44, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 106 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -428,164 +523,168 @@ yy36: yylval->num = atoi(yytext); return T_DIGITS; } -#line 432 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy37: - YYDEBUG(37, *YYCURSOR); +#line 527 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy45: + YYDEBUG(45, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { - goto yy34; + goto yy42; } if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x00) goto yy36; - if (yych <= 0x08) goto yy33; - goto yy36; + if (yych <= 0x00) goto yy44; + if (yych <= 0x08) goto yy40; + goto yy44; } else { - if (yych == '\r') goto yy36; - goto yy33; + if (yych == '\r') goto yy44; + goto yy40; } } else { if (yych <= '#') { - if (yych <= ' ') goto yy36; - if (yych <= '"') goto yy33; - goto yy36; + if (yych <= ' ') goto yy44; + if (yych <= '"') goto yy40; + goto yy44; } else { - if (yych == 'x') goto yy90; - goto yy33; + if (yych == 'x') goto yy102; + goto yy40; } } -yy38: - YYDEBUG(38, *YYCURSOR); +yy46: + YYDEBUG(46, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'E') goto yy87; - goto yy33; -yy39: - YYDEBUG(39, *YYCURSOR); + if (yych == 'I') goto yy96; + if (yych == 'i') goto yy96; + goto yy40; +yy47: + YYDEBUG(47, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'i') goto yy81; - goto yy33; -yy40: - YYDEBUG(40, *YYCURSOR); + if (yych == 'N') goto yy91; + if (yych == 'n') goto yy91; + goto yy40; +yy48: + YYDEBUG(48, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'n') goto yy76; - goto yy33; -yy41: - YYDEBUG(41, *YYCURSOR); + if (yych == 'A') goto yy88; + if (yych == 'a') goto yy88; + goto yy40; +yy49: + YYDEBUG(49, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy73; - goto yy33; -yy42: - YYDEBUG(42, *YYCURSOR); + if (yych == 'O') goto yy84; + if (yych == 'o') goto yy84; + goto yy40; +yy50: + YYDEBUG(50, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'o') goto yy71; - goto yy33; -yy43: - YYDEBUG(43, *YYCURSOR); + if (yych <= 'N') { + if (yych == 'F') goto yy83; + if (yych <= 'M') goto yy40; + goto yy77; + } else { + if (yych <= 'f') { + if (yych <= 'e') goto yy40; + goto yy83; + } else { + if (yych == 'n') goto yy77; + goto yy40; + } + } +yy51: + YYDEBUG(51, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'f') goto yy70; - if (yych == 'n') goto yy66; - goto yy33; -yy44: - YYDEBUG(44, *YYCURSOR); + if (yych == 'R') goto yy81; + if (yych == 'r') goto yy81; + goto yy40; +yy52: + YYDEBUG(52, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'r') goto yy68; - goto yy33; -yy45: - YYDEBUG(45, *YYCURSOR); + if (yych == 'E') goto yy76; + if (yych == 'e') goto yy76; + goto yy40; +yy53: + YYDEBUG(53, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy65; - goto yy33; -yy46: - YYDEBUG(46, *YYCURSOR); + if (yych == 'E') goto yy73; + goto yy40; +yy54: + YYDEBUG(54, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy53; - goto yy33; -yy47: - YYDEBUG(47, *YYCURSOR); + if (yych == 'e') goto yy61; + goto yy40; +yy55: + YYDEBUG(55, *YYCURSOR); ++YYCURSOR; - YYDEBUG(48, *YYCURSOR); + YYDEBUG(56, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 84 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { return T_POUND; } -#line 523 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy49: - YYDEBUG(49, *YYCURSOR); +#line 634 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy57: + YYDEBUG(57, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == ':') goto yy51; - YYDEBUG(50, *YYCURSOR); + if ((yych = *YYCURSOR) == ':') goto yy59; + YYDEBUG(58, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 90 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { return T_COLON; } -#line 534 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy51: - YYDEBUG(51, *YYCURSOR); +#line 645 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy59: + YYDEBUG(59, *YYCURSOR); ++YYCURSOR; - YYDEBUG(52, *YYCURSOR); + YYDEBUG(60, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 87 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { return T_DCOLON; } -#line 544 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy53: - YYDEBUG(53, *YYCURSOR); +#line 655 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy61: + YYDEBUG(61, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'n') goto yy59; - goto yy33; -yy54: - YYDEBUG(54, *YYCURSOR); + if (yych == 'n') goto yy67; + goto yy40; +yy62: + YYDEBUG(62, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '/') goto yy56; -yy55: - YYDEBUG(55, *YYCURSOR); + if (yych == '/') goto yy64; +yy63: + YYDEBUG(63, *YYCURSOR); YYCURSOR = YYMARKER; - if (yyaccept <= 3) { - if (yyaccept <= 1) { - if (yyaccept <= 0) { - goto yy31; - } else { - goto yy36; - } + if (yyaccept <= 1) { + if (yyaccept <= 0) { + goto yy38; } else { - if (yyaccept <= 2) { - goto yy64; - } else { - goto yy67; - } + goto yy44; } } else { - if (yyaccept <= 5) { - if (yyaccept <= 4) { - goto yy72; - } else { - goto yy93; - } + if (yyaccept <= 2) { + goto yy72; } else { - goto yy95; + goto yy105; } } -yy56: - YYDEBUG(56, *YYCURSOR); +yy64: + YYDEBUG(64, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '/') goto yy55; - YYDEBUG(57, *YYCURSOR); + if (yych != '/') goto yy63; + YYDEBUG(65, *YYCURSOR); ++YYCURSOR; - YYDEBUG(58, *YYCURSOR); + YYDEBUG(66, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 78 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -594,52 +693,52 @@ yy56: yylval->len = yyleng; return T_PROTO; } -#line 598 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy59: - YYDEBUG(59, *YYCURSOR); +#line 697 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy67: + YYDEBUG(67, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'd') goto yy33; - YYDEBUG(60, *YYCURSOR); + if (yych != 'd') goto yy40; + YYDEBUG(68, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != '_') goto yy33; -yy61: - YYDEBUG(61, *YYCURSOR); + if (yych != '_') goto yy40; +yy69: + YYDEBUG(69, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 64) { - goto yy62; + goto yy70; } - goto yy33; -yy62: - YYDEBUG(62, *YYCURSOR); + goto yy40; +yy70: + YYDEBUG(70, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(63, *YYCURSOR); + YYDEBUG(71, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy62; + goto yy70; } if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x00) goto yy64; - if (yych <= 0x08) goto yy32; + if (yych <= 0x00) goto yy72; + if (yych <= 0x08) goto yy39; } else { - if (yych != '\r') goto yy32; + if (yych != '\r') goto yy39; } } else { if (yych <= '#') { - if (yych <= ' ') goto yy64; - if (yych <= '"') goto yy32; + if (yych <= ' ') goto yy72; + if (yych <= '"') goto yy39; } else { - if (yych == ':') goto yy54; - goto yy32; + if (yych == ':') goto yy62; + goto yy39; } } -yy64: - YYDEBUG(64, *YYCURSOR); +yy72: + YYDEBUG(72, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 118 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -648,32 +747,53 @@ yy64: yylval->len = yyleng; return T_OPCODE; } -#line 652 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy65: - YYDEBUG(65, *YYCURSOR); +#line 751 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy73: + YYDEBUG(73, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 's') goto yy33; -yy66: - YYDEBUG(66, *YYCURSOR); - yyaccept = 3; + if (yych != 'N') goto yy40; + YYDEBUG(74, *YYCURSOR); + yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '\r') { - if (yych <= 0x08) { - if (yych >= 0x01) goto yy33; - } else { - if (yych <= '\n') goto yy67; - if (yych <= '\f') goto yy33; - } + if (yych != 'D') goto yy40; + YYDEBUG(75, *YYCURSOR); + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == '_') goto yy69; + goto yy40; +yy76: + YYDEBUG(76, *YYCURSOR); + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == 'S') goto yy77; + if (yych != 's') goto yy40; +yy77: + YYDEBUG(77, *YYCURSOR); + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych <= '\f') { + if (yych <= 0x08) goto yy40; + if (yych >= '\v') goto yy40; } else { - if (yych <= ' ') { - if (yych <= 0x1F) goto yy33; - } else { - if (yych != '#') goto yy33; - } + if (yych <= '\r') goto yy78; + if (yych != ' ') goto yy40; } -yy67: - YYDEBUG(67, *YYCURSOR); +yy78: + YYDEBUG(78, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(79, *YYCURSOR); + if (yych <= '\f') { + if (yych <= 0x08) goto yy80; + if (yych <= '\n') goto yy78; + } else { + if (yych <= '\r') goto yy78; + if (yych == ' ') goto yy78; + } +yy80: + YYDEBUG(80, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 94 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -681,42 +801,52 @@ yy67: yylval->num = 1; return T_TRUTHY; } -#line 685 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy68: - YYDEBUG(68, *YYCURSOR); +#line 805 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy81: + YYDEBUG(81, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'u') goto yy33; - YYDEBUG(69, *YYCURSOR); + if (yych == 'U') goto yy82; + if (yych != 'u') goto yy40; +yy82: + YYDEBUG(82, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy66; - goto yy33; -yy70: - YYDEBUG(70, *YYCURSOR); + if (yych == 'E') goto yy77; + if (yych == 'e') goto yy77; + goto yy40; +yy83: + YYDEBUG(83, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'f') goto yy33; -yy71: - YYDEBUG(71, *YYCURSOR); - yyaccept = 4; + if (yych == 'F') goto yy84; + if (yych != 'f') goto yy40; +yy84: + YYDEBUG(84, *YYCURSOR); + yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '\r') { - if (yych <= 0x08) { - if (yych >= 0x01) goto yy33; - } else { - if (yych <= '\n') goto yy72; - if (yych <= '\f') goto yy33; - } + if (yych <= '\f') { + if (yych <= 0x08) goto yy40; + if (yych >= '\v') goto yy40; } else { - if (yych <= ' ') { - if (yych <= 0x1F) goto yy33; - } else { - if (yych != '#') goto yy33; - } + if (yych <= '\r') goto yy85; + if (yych != ' ') goto yy40; } -yy72: - YYDEBUG(72, *YYCURSOR); +yy85: + YYDEBUG(85, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(86, *YYCURSOR); + if (yych <= '\f') { + if (yych <= 0x08) goto yy87; + if (yych <= '\n') goto yy85; + } else { + if (yych <= '\r') goto yy85; + if (yych == ' ') goto yy85; + } +yy87: + YYDEBUG(87, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 100 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -724,119 +854,130 @@ yy72: yylval->num = 0; return T_FALSY; } -#line 728 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy73: - YYDEBUG(73, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'l') goto yy33; - YYDEBUG(74, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych != 's') goto yy33; - YYDEBUG(75, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy71; - goto yy33; -yy76: - YYDEBUG(76, *YYCURSOR); +#line 858 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy88: + YYDEBUG(88, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'a') goto yy33; - YYDEBUG(77, *YYCURSOR); + if (yych == 'L') goto yy89; + if (yych != 'l') goto yy40; +yy89: + YYDEBUG(89, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'b') goto yy33; - YYDEBUG(78, *YYCURSOR); + if (yych == 'S') goto yy90; + if (yych != 's') goto yy40; +yy90: + YYDEBUG(90, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'l') goto yy33; - YYDEBUG(79, *YYCURSOR); + if (yych == 'E') goto yy84; + if (yych == 'e') goto yy84; + goto yy40; +yy91: + YYDEBUG(91, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'e') goto yy33; - YYDEBUG(80, *YYCURSOR); + if (yych == 'A') goto yy92; + if (yych != 'a') goto yy40; +yy92: + YYDEBUG(92, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'd') goto yy66; - goto yy33; -yy81: - YYDEBUG(81, *YYCURSOR); + if (yych == 'B') goto yy93; + if (yych != 'b') goto yy40; +yy93: + YYDEBUG(93, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 's') goto yy33; - YYDEBUG(82, *YYCURSOR); + if (yych == 'L') goto yy94; + if (yych != 'l') goto yy40; +yy94: + YYDEBUG(94, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'a') goto yy33; - YYDEBUG(83, *YYCURSOR); + if (yych == 'E') goto yy95; + if (yych != 'e') goto yy40; +yy95: + YYDEBUG(95, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'b') goto yy33; - YYDEBUG(84, *YYCURSOR); + if (yych == 'D') goto yy77; + if (yych == 'd') goto yy77; + goto yy40; +yy96: + YYDEBUG(96, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'l') goto yy33; - YYDEBUG(85, *YYCURSOR); + if (yych == 'S') goto yy97; + if (yych != 's') goto yy40; +yy97: + YYDEBUG(97, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'e') goto yy33; - YYDEBUG(86, *YYCURSOR); + if (yych == 'A') goto yy98; + if (yych != 'a') goto yy40; +yy98: + YYDEBUG(98, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'd') goto yy71; - goto yy33; -yy87: - YYDEBUG(87, *YYCURSOR); + if (yych == 'B') goto yy99; + if (yych != 'b') goto yy40; +yy99: + YYDEBUG(99, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'N') goto yy33; - YYDEBUG(88, *YYCURSOR); + if (yych == 'L') goto yy100; + if (yych != 'l') goto yy40; +yy100: + YYDEBUG(100, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych != 'D') goto yy33; - YYDEBUG(89, *YYCURSOR); + if (yych == 'E') goto yy101; + if (yych != 'e') goto yy40; +yy101: + YYDEBUG(101, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == '_') goto yy61; - goto yy33; -yy90: - YYDEBUG(90, *YYCURSOR); + if (yych == 'D') goto yy84; + if (yych == 'd') goto yy84; + goto yy40; +yy102: + YYDEBUG(102, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { - goto yy91; + goto yy103; } - goto yy33; -yy91: - YYDEBUG(91, *YYCURSOR); - yyaccept = 5; + goto yy40; +yy103: + YYDEBUG(103, *YYCURSOR); + yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(92, *YYCURSOR); + YYDEBUG(104, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy91; + goto yy103; } if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x00) goto yy93; - if (yych <= 0x08) goto yy32; + if (yych <= 0x00) goto yy105; + if (yych <= 0x08) goto yy39; } else { - if (yych != '\r') goto yy32; + if (yych != '\r') goto yy39; } } else { if (yych <= '#') { - if (yych <= ' ') goto yy93; - if (yych <= '"') goto yy32; + if (yych <= ' ') goto yy105; + if (yych <= '"') goto yy39; } else { - if (yych == ':') goto yy54; - goto yy32; + if (yych == ':') goto yy62; + goto yy39; } } -yy93: - YYDEBUG(93, *YYCURSOR); +yy105: + YYDEBUG(105, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 112 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -844,27 +985,33 @@ yy93: yylval->addr = strtoul(yytext, 0, 16); return T_ADDR; } -#line 848 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy94: - YYDEBUG(94, *YYCURSOR); - yyaccept = 6; +#line 989 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy106: + YYDEBUG(106, *YYCURSOR); + yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '\r') { - if (yych <= 0x08) { - if (yych >= 0x01) goto yy33; - } else { - if (yych <= '\n') goto yy95; - if (yych <= '\f') goto yy33; - } + if (yych <= '\f') { + if (yych <= 0x08) goto yy40; + if (yych >= '\v') goto yy40; } else { - if (yych <= ' ') { - if (yych <= 0x1F) goto yy33; - } else { - if (yych != '#') goto yy33; - } + if (yych <= '\r') goto yy107; + if (yych != ' ') goto yy40; } -yy95: - YYDEBUG(95, *YYCURSOR); +yy107: + YYDEBUG(107, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(108, *YYCURSOR); + if (yych <= '\f') { + if (yych <= 0x08) goto yy109; + if (yych <= '\n') goto yy107; + } else { + if (yych <= '\r') goto yy107; + if (yych == ' ') goto yy107; + } +yy109: + YYDEBUG(109, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 72 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -872,7 +1019,7 @@ yy95: phpdbg_init_param(yylval, EMPTY_PARAM); return T_IF; } -#line 876 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +#line 1023 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" } /* *********************************** */ yyc_RAW: @@ -911,29 +1058,29 @@ yyc_RAW: 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, }; - YYDEBUG(96, *YYCURSOR); + YYDEBUG(110, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yybm[0+yych] & 32) { - goto yy98; + goto yy112; } - if (yych <= 0x00) goto yy103; - if (yych == '\n') goto yy101; - goto yy104; -yy98: - YYDEBUG(98, *YYCURSOR); + if (yych <= 0x00) goto yy117; + if (yych == '\n') goto yy115; + goto yy118; +yy112: + YYDEBUG(112, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(99, *YYCURSOR); + YYDEBUG(113, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy98; + goto yy112; } - if (yych <= 0x00) goto yy100; - if (yych == '\n') goto yy106; - goto yy104; -yy100: - YYDEBUG(100, *YYCURSOR); + if (yych <= 0x00) goto yy114; + if (yych == '\n') goto yy120; + goto yy118; +yy114: + YYDEBUG(114, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 132 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -942,45 +1089,45 @@ yy100: yylval->len = yyleng; return T_INPUT; } -#line 946 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy101: - YYDEBUG(101, *YYCURSOR); +#line 1093 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy115: + YYDEBUG(115, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 128) { - goto yy106; + goto yy120; } -yy102: - YYDEBUG(102, *YYCURSOR); +yy116: + YYDEBUG(116, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 68 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { return 0; } -#line 960 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" -yy103: - YYDEBUG(103, *YYCURSOR); +#line 1107 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +yy117: + YYDEBUG(117, *YYCURSOR); yych = *++YYCURSOR; - goto yy102; -yy104: - YYDEBUG(104, *YYCURSOR); + goto yy116; +yy118: + YYDEBUG(118, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(105, *YYCURSOR); + YYDEBUG(119, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy104; + goto yy118; } - goto yy100; -yy106: - YYDEBUG(106, *YYCURSOR); + goto yy114; +yy120: + YYDEBUG(120, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(107, *YYCURSOR); + YYDEBUG(121, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy106; + goto yy120; } - YYDEBUG(108, *YYCURSOR); + YYDEBUG(122, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 139 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { @@ -988,7 +1135,7 @@ yy106: goto restart; } -#line 992 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" +#line 1139 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.c" } } #line 168 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l index 4d9c837f1e..7b3ce38c47 100644 --- a/sapi/phpdbg/phpdbg_lexer.l +++ b/sapi/phpdbg/phpdbg_lexer.l @@ -43,21 +43,21 @@ restart: /*!re2c re2c:yyfill:check = 0; -T_TRUE "true" -T_YES "yes" -T_ON "on" -T_ENABLED "enabled" -T_FALSE "false" -T_NO "no" -T_OFF "off" -T_DISABLED "disabled" -T_EVAL "ev" -T_SHELL "sh" -T_IF "if" -T_RUN "run" +T_TRUE 'true' +T_YES 'yes' +T_ON 'on' +T_ENABLED 'enabled' +T_FALSE 'false' +T_NO 'no' +T_OFF 'off' +T_DISABLED 'disabled' +T_EVAL 'ev' +T_SHELL 'sh' +T_IF 'if' +T_RUN 'run' T_RUN_SHORT "r" WS [ \r\n\t]+ -DIGITS [0-9\.]+ +DIGITS [-]?[0-9\.]+ ID [^ \r\n\t:#\000]+ ADDR [0][x][a-fA-F0-9]+ OPCODE (ZEND_|zend_)([A-Za-z])+ @@ -69,7 +69,7 @@ INPUT [^\n\000]+ return 0; } -<NORMAL>{T_IF} { +<NORMAL>{T_IF}{WS} { YYSETCONDITION(RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_IF; @@ -91,13 +91,13 @@ INPUT [^\n\000]+ return T_COLON; } -<NORMAL>{T_YES}|{T_ON}|{T_ENABLED}|{T_TRUE} { +<NORMAL>({T_YES}|{T_ON}|{T_ENABLED}|{T_TRUE}){WS} { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = 1; return T_TRUTHY; } -<NORMAL>{T_NO}|{T_OFF}|{T_DISABLED}|{T_FALSE} { +<NORMAL>({T_NO}|{T_OFF}|{T_DISABLED}|{T_FALSE}){WS} { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = 0; return T_FALSY; @@ -142,17 +142,17 @@ INPUT [^\n\000]+ goto restart; } -<INITIAL>{T_EVAL} { +<INITIAL>{T_EVAL}{WS} { YYSETCONDITION(RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_EVAL; } -<INITIAL>{T_SHELL} { +<INITIAL>{T_SHELL}{WS} { YYSETCONDITION(RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_SHELL; } -<INITIAL>{T_RUN}|{T_RUN_SHORT} { +<INITIAL>({T_RUN}|{T_RUN_SHORT}){WS} { YYSETCONDITION(RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_RUN; diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index 037c6c38b2..e8db4e605c 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -130,14 +130,14 @@ void phpdbg_list_file(const char *filename, long count, long offset, int highlig char *opened = NULL; char buffer[8096] = {0,}; long line = 0; - + php_stream *stream = NULL; if (VCWD_STAT(filename, &st) == FAILURE) { phpdbg_error("Failed to stat file %s", filename); return; } - + stream = php_stream_open_wrapper(filename, "rb", USE_PATH, &opened); if (!stream) { @@ -145,11 +145,17 @@ void phpdbg_list_file(const char *filename, long count, long offset, int highlig return; } + if (offset < 0) { + count += offset; + offset = 0; + } + while (php_stream_gets(stream, buffer, sizeof(buffer)) != NULL) { + long linelen = strlen(buffer); + ++line; - if (!offset || offset <= line) { - /* Without offset, or offset reached */ + if (offset <= line) { if (!highlight) { phpdbg_write("%05ld: %s", line, buffer); } else { @@ -159,10 +165,15 @@ void phpdbg_list_file(const char *filename, long count, long offset, int highlig phpdbg_write(">%05ld: %s", line, buffer); } } + + if (buffer[linelen - 1] != '\n') { + phpdbg_write("\n"); + } } - - if ((count + (offset-1)) == line) + + if (count > 0 && count + offset - 1 < line) { break; + } } php_stream_close(stream); diff --git a/sapi/phpdbg/phpdbg_parser.c b/sapi/phpdbg/phpdbg_parser.c index f9a3e4d299..e34c2f48ff 100644 --- a/sapi/phpdbg/phpdbg_parser.c +++ b/sapi/phpdbg/phpdbg_parser.c @@ -436,7 +436,7 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 25 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 41 +#define YYLAST 42 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 21 @@ -493,8 +493,8 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 7, 8, 10, 13, 17, 22, - 27, 33, 37, 43, 47, 49, 51, 53, 55, 57, - 59, 61, 64, 67, 70, 72 + 27, 33, 37, 43, 47, 50, 52, 54, 56, 58, + 60, 62, 64, 67, 70, 72 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -504,9 +504,9 @@ static const yytype_int8 yyrhs[] = 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, 17, -1, 16, - -1, 15, -1, 7, -1, 8, -1, 14, -1, 18, - -1, 6, 19, -1, 3, 19, -1, 5, 19, -1, + 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 }; @@ -514,8 +514,8 @@ static const yytype_int8 yyrhs[] = static const yytype_uint8 yyrline[] = { 0, 66, 66, 67, 68, 72, 73, 77, 82, 87, - 97, 107, 112, 118, 124, 125, 126, 127, 128, 129, - 130, 134, 139, 144, 149, 153 + 97, 107, 112, 118, 124, 129, 130, 131, 132, 133, + 134, 135, 139, 144, 149, 153 }; #endif @@ -552,15 +552,15 @@ 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, 25, 25, 25, 25, 25 + 24, 24, 25, 25, 25, 25 }; /* 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, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 1, 2 + 5, 3, 5, 3, 2, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 1, 2 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -568,9 +568,9 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 4, 0, 24, 0, 0, 17, 18, 0, 19, 16, - 15, 14, 20, 0, 2, 5, 3, 22, 25, 23, - 21, 0, 0, 0, 0, 1, 6, 0, 0, 7, + 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 }; @@ -585,16 +585,16 @@ static const yytype_int8 yydefgoto[] = #define YYPACT_NINF -11 static const yytype_int8 yypact[] = { - -3, -10, 10, 11, 12, -11, -11, 14, -11, -11, - -11, -11, -4, 28, 9, -11, -11, -11, -11, -11, - -11, 23, 6, 16, 21, -11, -11, 7, 22, -11, - 25, -11, 24, -11, -11, 26, -11, -11 + -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 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -11, -11, -11, 27, -11 + -11, -11, -11, 28, -11 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -604,10 +604,10 @@ static const yytype_int8 yypgoto[] = static const yytype_uint8 yytable[] = { 1, 2, 3, 4, 5, 6, 22, 23, 24, 17, - 7, 8, 9, 10, 11, 12, 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 + 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 }; #define yypact_value_is_default(yystate) \ @@ -619,10 +619,10 @@ static const yytype_uint8 yytable[] = static const yytype_int8 yycheck[] = { 3, 4, 5, 6, 7, 8, 10, 11, 12, 19, - 13, 14, 15, 16, 17, 18, 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 + 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 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1563,53 +1563,53 @@ yyreduce: case 14: /* Line 1802 of yacc.c */ #line 124 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } + { + (yyval).type = COND_PARAM; + (yyval).str = (yyvsp[(2) - (2)]).str; + (yyval).len = (yyvsp[(2) - (2)]).len; + } break; case 15: /* Line 1802 of yacc.c */ -#line 125 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" +#line 129 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 16: /* Line 1802 of yacc.c */ -#line 126 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" +#line 130 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 17: /* Line 1802 of yacc.c */ -#line 127 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" +#line 131 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 18: /* Line 1802 of yacc.c */ -#line 128 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" +#line 132 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 19: /* Line 1802 of yacc.c */ -#line 129 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" +#line 133 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 20: /* Line 1802 of yacc.c */ -#line 130 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" +#line 134 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 21: /* Line 1802 of yacc.c */ -#line 134 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" - { - (yyval).type = COND_PARAM; - (yyval).str = (yyvsp[(2) - (2)]).str; - (yyval).len = (yyvsp[(2) - (2)]).len; - } +#line 135 "/var/root/php-src/sapi/phpdbg/phpdbg_parser.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 22: diff --git a/sapi/phpdbg/phpdbg_parser.y b/sapi/phpdbg/phpdbg_parser.y index fd81edfc29..702bf78455 100644 --- a/sapi/phpdbg/phpdbg_parser.y +++ b/sapi/phpdbg/phpdbg_parser.y @@ -121,6 +121,11 @@ parameter $$.len = $1.len; $$.num = $3.num; } + | T_IF T_INPUT { + $$.type = COND_PARAM; + $$.str = $2.str; + $$.len = $2.len; + } | T_OPCODE { $$ = $1; } | T_ADDR { $$ = $1; } | T_LITERAL { $$ = $1; } @@ -131,12 +136,7 @@ parameter ; full_expression - : T_IF T_INPUT { - $$.type = COND_PARAM; - $$.str = $2.str; - $$.len = $2.len; - } - | T_EVAL T_INPUT { + : T_EVAL T_INPUT { $$.type = EVAL_PARAM; $$.str = $2.str; $$.len = $2.len; |