From a80f0b982ae0d13fc3cc2ad05b5a2fea632ac331 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Thu, 16 Oct 2014 12:27:26 +0200 Subject: [PATCH] Fix lexing of -r \d+ in raw-string commands --- phpdbg_help.c | 2 +- phpdbg_lexer.c | 493 +++++++++++++++++++++++++++++-------------------- phpdbg_lexer.l | 20 +- 3 files changed, 305 insertions(+), 210 deletions(-) diff --git a/phpdbg_help.c b/phpdbg_help.c index 2990edd16d..3fed04e745 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -62,7 +62,7 @@ void pretty_print(char *text TSRMLS_DC) unsigned int line_count = 0; /* number printable chars on current line */ if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { - phpdbg_xml("", text); + phpdbg_xml("", text); return; } diff --git a/phpdbg_lexer.c b/phpdbg_lexer.c index 68895b4e3d..90f3a449da 100644 --- a/phpdbg_lexer.c +++ b/phpdbg_lexer.c @@ -1,5 +1,5 @@ /* Generated by re2c 0.13.5 */ -#line 1 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 1 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" /* * phpdbg_lexer.l */ @@ -23,8 +23,9 @@ #define YYFILL(n) #define NORMAL 0 -#define RAW 1 -#define INITIAL 2 +#define PRE_RAW 1 +#define RAW 2 +#define INITIAL 3 ZEND_EXTERN_MODULE_GLOBALS(phpdbg); @@ -44,14 +45,18 @@ restart: LEX(text) = YYCURSOR; -#line 48 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 49 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" { YYCTYPE yych; unsigned int yyaccept = 0; - if (YYGETCONDITION() < 1) { - goto yyc_NORMAL; + if (YYGETCONDITION() < 2) { + if (YYGETCONDITION() < 1) { + goto yyc_NORMAL; + } else { + goto yyc_PRE_RAW; + } } else { - if (YYGETCONDITION() < 2) { + if (YYGETCONDITION() < 3) { goto yyc_RAW; } else { goto yyc_INITIAL; @@ -145,14 +150,14 @@ yy2: yy3: YYDEBUG(3, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 168 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 176 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { YYSETCONDITION(NORMAL); YYCURSOR = LEX(text); goto restart; } -#line 156 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 161 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy4: YYDEBUG(4, *YYCURSOR); ++YYCURSOR; @@ -167,11 +172,11 @@ yy4: yy6: YYDEBUG(6, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 68 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 69 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return 0; } -#line 175 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 180 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy7: YYDEBUG(7, *YYCURSOR); yych = *++YYCURSOR; @@ -238,13 +243,13 @@ yy16: } YYDEBUG(18, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 162 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 163 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { - YYSETCONDITION(RAW); + YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_RUN; } -#line 248 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 253 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy19: YYDEBUG(19, *YYCURSOR); yych = *++YYCURSOR; @@ -271,13 +276,13 @@ yy20: yy22: YYDEBUG(22, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 157 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 158 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { - YYSETCONDITION(RAW); + YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_SHELL; } -#line 281 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 286 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy23: YYDEBUG(23, *YYCURSOR); yych = *++YYCURSOR; @@ -304,13 +309,13 @@ yy24: yy26: YYDEBUG(26, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 152 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 153 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { - YYSETCONDITION(RAW); + YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_EVAL; } -#line 314 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 319 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy27: YYDEBUG(27, *YYCURSOR); yych = *++YYCURSOR; @@ -329,13 +334,13 @@ yy29: if (yych == '\n') goto yy4; YYDEBUG(30, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 146 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 147 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { /* ignore whitespace */ goto restart; } -#line 339 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 344 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" } /* *********************************** */ yyc_NORMAL: @@ -478,13 +483,13 @@ yy33: if (yych == '\n') goto yy36; YYDEBUG(35, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 146 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 147 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { /* ignore whitespace */ goto restart; } -#line 488 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 493 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy36: YYDEBUG(36, *YYCURSOR); ++YYCURSOR; @@ -499,11 +504,11 @@ yy36: yy38: YYDEBUG(38, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 68 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 69 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return 0; } -#line 507 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 512 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy39: YYDEBUG(39, *YYCURSOR); yych = *++YYCURSOR; @@ -520,14 +525,14 @@ yy40: yy41: YYDEBUG(41, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 132 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 133 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, STR_PARAM); yylval->str = zend_strndup(yytext, yyleng); yylval->len = yyleng; return T_ID; } -#line 531 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 536 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy42: YYDEBUG(42, *YYCURSOR); yyaccept = 0; @@ -577,13 +582,13 @@ yy45: yy47: YYDEBUG(47, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 113 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 114 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = atoi(yytext); return T_DIGITS; } -#line 587 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 592 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy48: YYDEBUG(48, *YYCURSOR); yyaccept = 1; @@ -686,32 +691,32 @@ yy58: ++YYCURSOR; YYDEBUG(59, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 91 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 92 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return T_POUND; } -#line 694 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 699 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy60: YYDEBUG(60, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == ':') goto yy62; YYDEBUG(61, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 97 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 98 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return T_COLON; } -#line 705 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 710 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy62: YYDEBUG(62, *YYCURSOR); ++YYCURSOR; YYDEBUG(63, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 94 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 95 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return T_DCOLON; } -#line 715 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 720 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy64: YYDEBUG(64, *YYCURSOR); yyaccept = 0; @@ -750,14 +755,14 @@ yy67: ++YYCURSOR; YYDEBUG(69, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 85 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 86 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, STR_PARAM); yylval->str = zend_strndup(yytext, yyleng); yylval->len = yyleng; return T_PROTO; } -#line 761 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 766 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy70: YYDEBUG(70, *YYCURSOR); yyaccept = 0; @@ -804,14 +809,14 @@ yy73: yy75: YYDEBUG(75, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 125 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 126 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, OP_PARAM); yylval->str = zend_strndup(yytext, yyleng); yylval->len = yyleng; return T_OPCODE; } -#line 815 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 820 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy76: YYDEBUG(76, *YYCURSOR); yyaccept = 0; @@ -851,13 +856,13 @@ yy81: } YYDEBUG(83, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 101 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 102 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = 1; return T_TRUTHY; } -#line 861 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 866 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy84: YYDEBUG(84, *YYCURSOR); yyaccept = 0; @@ -904,13 +909,13 @@ yy88: yy90: YYDEBUG(90, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 107 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 108 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = 0; return T_FALSY; } -#line 914 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 919 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy91: YYDEBUG(91, *YYCURSOR); yyaccept = 0; @@ -1035,13 +1040,13 @@ yy106: yy108: YYDEBUG(108, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 119 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 120 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, ADDR_PARAM); yylval->addr = strtoul(yytext, 0, 16); return T_ADDR; } -#line 1045 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 1050 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy109: YYDEBUG(109, *YYCURSOR); yyaccept = 0; @@ -1069,13 +1074,13 @@ yy110: yy112: YYDEBUG(112, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 79 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 80 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { YYSETCONDITION(RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_IF; } -#line 1079 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 1084 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy113: YYDEBUG(113, *YYCURSOR); yyaccept = 0; @@ -1163,14 +1168,14 @@ yy117: yy119: YYDEBUG(119, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 72 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 73 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { char *text = yytext + 2; while (*++text < '0'); yylval->num = atoi(text); return T_REQ_ID; } -#line 1174 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 1179 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy120: YYDEBUG(120, *YYCURSOR); yych = *++YYCURSOR; @@ -1189,244 +1194,326 @@ yy121: goto yy119; } /* *********************************** */ -yyc_RAW: +yyc_PRE_RAW: { static const unsigned char yybm[] = { - 0, 32, 32, 32, 32, 32, 32, 32, - 32, 104, 80, 32, 32, 104, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 104, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 160, 32, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 160, 48, 0, 0, 160, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 64, 0, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, }; YYDEBUG(123, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; - if (yybm[0+yych] & 8) { - goto yy125; + if (yybm[0+yych] & 16) { + goto yy127; } - if (yych <= '\n') { - if (yych <= 0x00) goto yy131; - if (yych <= '\t') goto yy133; - goto yy128; + if (yych <= '\r') { + if (yych <= 0x08) { + if (yych <= 0x00) goto yy130; + goto yy132; + } else { + if (yych <= '\t') goto yy125; + if (yych <= '\f') goto yy132; + } } else { - if (yych == '-') goto yy132; - goto yy133; + if (yych <= ' ') { + if (yych <= 0x1F) goto yy132; + } else { + if (yych == '-') goto yy131; + goto yy132; + } } yy125: YYDEBUG(125, *YYCURSOR); ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(126, *YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy125; + if ((yych = *YYCURSOR) <= '\f') { + if (yych <= 0x00) goto yy142; + if (yych <= 0x08) goto yy126; + if (yych <= '\n') goto yy142; + } else { + if (yych <= '\r') goto yy142; + if (yych == ' ') goto yy142; } - if (yych <= 0x00) goto yy131; - if (yych == '\n') goto yy128; - goto yy133; -yy127: - YYDEBUG(127, *YYCURSOR); +yy126: + YYDEBUG(126, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 139 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 169 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { - phpdbg_init_param(yylval, STR_PARAM); - yylval->str = zend_strndup(yytext, yyleng); - yylval->len = yyleng; - return T_INPUT; + YYSETCONDITION(RAW); + + YYCURSOR = LEX(text); + goto restart; } -#line 1265 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" -yy128: - YYDEBUG(128, *YYCURSOR); +#line 1277 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" +yy127: + YYDEBUG(127, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(129, *YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy128; - } - if (yych <= '\f') { - if (yych <= 0x00) goto yy131; - if (yych == '\t') goto yy147; - } else { - if (yych <= '\r') goto yy147; - if (yych == ' ') goto yy147; + YYDEBUG(128, *YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy141; } -yy130: - YYDEBUG(130, *YYCURSOR); + if (yych <= 0x00) goto yy140; + if (yych == '\n') goto yy127; +yy129: + YYDEBUG(129, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 68 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 69 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return 0; } -#line 1289 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 1296 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" +yy130: + YYDEBUG(130, *YYCURSOR); + yych = *++YYCURSOR; + goto yy126; yy131: YYDEBUG(131, *YYCURSOR); - yych = *++YYCURSOR; - goto yy130; + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == 'r') goto yy133; + goto yy126; yy132: YYDEBUG(132, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'r') goto yy135; - goto yy134; + goto yy126; yy133: YYDEBUG(133, *YYCURSOR); ++YYCURSOR; - YYFILL(1); + YYFILL(2); yych = *YYCURSOR; -yy134: YYDEBUG(134, *YYCURSOR); if (yybm[0+yych] & 32) { goto yy133; } - goto yy127; + if (yych <= '.') { + if (yych <= ',') goto yy135; + if (yych <= '-') goto yy136; + goto yy137; + } else { + if (yych <= '/') goto yy135; + if (yych <= '9') goto yy137; + } yy135: YYDEBUG(135, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; + YYCURSOR = YYMARKER; + goto yy126; +yy136: YYDEBUG(136, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy141; - } - if (yych <= '\f') { - if (yych <= 0x08) { - if (yych <= 0x00) goto yy127; - goto yy133; - } else { - if (yych <= '\t') goto yy135; - if (yych >= '\v') goto yy133; - } - } else { - if (yych <= ' ') { - if (yych <= '\r') goto yy135; - if (yych <= 0x1F) goto yy133; - goto yy135; - } else { - if (yych == '-') goto yy140; - goto yy133; - } + yych = *++YYCURSOR; + if (yybm[0+yych] & 64) { + goto yy137; } + goto yy135; yy137: YYDEBUG(137, *YYCURSOR); ++YYCURSOR; - YYFILL(2); + YYFILL(1); yych = *YYCURSOR; YYDEBUG(138, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy137; } - if (yych <= '.') { - if (yych <= ',') goto yy139; - if (yych <= '-') goto yy144; - goto yy145; - } else { - if (yych <= '/') goto yy139; - if (yych <= '9') goto yy145; - } -yy139: YYDEBUG(139, *YYCURSOR); - YYCURSOR = YYMARKER; - goto yy127; + yyleng = (size_t) YYCURSOR - (size_t) yytext; +#line 73 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" + { + char *text = yytext + 2; + while (*++text < '0'); + yylval->num = atoi(text); + return T_REQ_ID; +} +#line 1357 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy140: YYDEBUG(140, *YYCURSOR); yych = *++YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy141; - } - goto yy134; + goto yy129; yy141: YYDEBUG(141, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; +yy142: YYDEBUG(142, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy141; } - if (yych <= 0x00) goto yy143; - if (yych != '\n') goto yy133; -yy143: + if (yych <= 0x00) goto yy140; + if (yych == '\n') goto yy127; YYDEBUG(143, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 72 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 147 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { - char *text = yytext + 2; - while (*++text < '0'); - yylval->num = atoi(text); - return T_REQ_ID; + /* ignore whitespace */ + + goto restart; } -#line 1387 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" -yy144: +#line 1382 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" + } +/* *********************************** */ +yyc_RAW: + { + static const unsigned char yybm[] = { + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 160, 64, 128, 128, 160, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 160, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + }; YYDEBUG(144, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '.') goto yy145; - if (yych <= '/') goto yy139; - if (yych >= ':') goto yy139; -yy145: - YYDEBUG(145, *YYCURSOR); - ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; + if (yybm[0+yych] & 32) { + goto yy146; + } + if (yych <= 0x00) goto yy152; + if (yych == '\n') goto yy149; + goto yy153; +yy146: YYDEBUG(146, *YYCURSOR); - if (yych == '.') goto yy145; - if (yych <= '/') goto yy143; - if (yych <= '9') goto yy145; - goto yy143; -yy147: - YYDEBUG(147, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; + YYDEBUG(147, *YYCURSOR); + if (yybm[0+yych] & 32) { + goto yy146; + } + if (yych <= 0x00) goto yy152; + if (yych == '\n') goto yy149; + goto yy153; +yy148: YYDEBUG(148, *YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy128; + yyleng = (size_t) YYCURSOR - (size_t) yytext; +#line 140 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" + { + phpdbg_init_param(yylval, STR_PARAM); + yylval->str = zend_strndup(yytext, yyleng); + yylval->len = yyleng; + return T_INPUT; +} +#line 1452 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" +yy149: + YYDEBUG(149, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(150, *YYCURSOR); + if (yybm[0+yych] & 64) { + goto yy149; } if (yych <= '\f') { - if (yych <= 0x00) goto yy131; - if (yych == '\t') goto yy147; + if (yych <= 0x00) goto yy152; + if (yych == '\t') goto yy155; } else { - if (yych <= '\r') goto yy147; - if (yych == ' ') goto yy147; + if (yych <= '\r') goto yy155; + if (yych == ' ') goto yy155; } - YYDEBUG(149, *YYCURSOR); +yy151: + YYDEBUG(151, *YYCURSOR); + yyleng = (size_t) YYCURSOR - (size_t) yytext; +#line 69 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" + { + return 0; +} +#line 1476 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" +yy152: + YYDEBUG(152, *YYCURSOR); + yych = *++YYCURSOR; + goto yy151; +yy153: + YYDEBUG(153, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(154, *YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy153; + } + goto yy148; +yy155: + YYDEBUG(155, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(156, *YYCURSOR); + if (yybm[0+yych] & 64) { + goto yy149; + } + if (yych <= '\f') { + if (yych <= 0x00) goto yy152; + if (yych == '\t') goto yy155; + } else { + if (yych <= '\r') goto yy155; + if (yych == ' ') goto yy155; + } + YYDEBUG(157, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; -#line 146 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 147 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { /* ignore whitespace */ goto restart; } -#line 1428 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.c" +#line 1515 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" } } -#line 175 "/root/php-src-xml-data-phpdbg/sapi/phpdbg/phpdbg_lexer.l" +#line 183 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" } diff --git a/phpdbg_lexer.l b/phpdbg_lexer.l index 11fdc913c7..0c27fc22ac 100644 --- a/phpdbg_lexer.l +++ b/phpdbg_lexer.l @@ -21,8 +21,9 @@ #define YYFILL(n) #define NORMAL 0 -#define RAW 1 -#define INITIAL 2 +#define PRE_RAW 1 +#define RAW 2 +#define INITIAL 3 ZEND_EXTERN_MODULE_GLOBALS(phpdbg); @@ -69,7 +70,7 @@ INPUT [^\n\000]+ return 0; } -[-][r]{WS}?{DIGITS} { +[-][r]{WS}?{DIGITS} { char *text = yytext + 2; while (*++text < '0'); yylval->num = atoi(text); @@ -150,21 +151,28 @@ INPUT [^\n\000]+ } {T_EVAL}{WS} { - YYSETCONDITION(RAW); + YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_EVAL; } {T_SHELL}{WS} { - YYSETCONDITION(RAW); + YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_SHELL; } ({T_RUN}|{T_RUN_SHORT}){WS} { - YYSETCONDITION(RAW); + YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_RUN; } +. { + YYSETCONDITION(RAW); + + YYCURSOR = LEX(text); + goto restart; +} + . { YYSETCONDITION(NORMAL); -- 2.40.0