From b1a22ae6dc2b9d530b385661d56d62ae584a1016 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Wed, 16 Apr 2014 13:56:26 +0200 Subject: [PATCH] Updated version number to 0.4.0 Made run accept any input and lexer re2c compatible --- .gitignore | 4 +- Makefile.frag | 9 + phpdbg.h | 2 +- phpdbg_cmd.c | 3 + phpdbg_cmd.h | 3 +- phpdbg_lexer.c | 318 ++-- phpdbg_lexer.h | 16 +- dev/phpdbg_lexer.l => phpdbg_lexer.l | 42 +- phpdbg_parser.c | 1843 ------------------------ phpdbg_parser.h | 105 -- dev/phpdbg_parser.y => phpdbg_parser.y | 6 + 11 files changed, 199 insertions(+), 2152 deletions(-) rename dev/phpdbg_lexer.l => phpdbg_lexer.l (75%) delete mode 100644 phpdbg_parser.c delete mode 100644 phpdbg_parser.h rename dev/phpdbg_parser.y => phpdbg_parser.y (97%) diff --git a/.gitignore b/.gitignore index 297efcbc42..af445861ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .libs/ -./phpdbg +phpdbg *.lo *.o build +phpdbg_parser.c +phpdbg_parser.h diff --git a/Makefile.frag b/Makefile.frag index 77f5788894..45768de2ef 100644 --- a/Makefile.frag +++ b/Makefile.frag @@ -8,6 +8,15 @@ $(BUILD_SHARED): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_PHPDBG_OBJS) $(BUILD_BINARY): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_PHPDBG_OBJS) $(BUILD_PHPDBG) +$(builddir)/sapi/phpdbg/phpdbg_lexer.lo: $(srcdir)/sapi/phpdbg/phpdbg_parser.h + +$(srcdir)/sapi/phpdbg/phpdbg_lexer.c: $(srcdir)/sapi/phpdbg/phpdbg_lexer.l + @(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date -cbdFo sapi/phpdbg/phpdbg_lexer.c sapi/phpdbg/phpdbg_lexer.l) + +$(srcdir)/sapi/phpdbg/phpdbg_parser.h: $(srcdir)/sapi/phpdbg/phpdbg_parser.c +$(srcdir)/sapi/phpdbg/phpdbg_parser.c: $(srcdir)/sapi/phpdbg/phpdbg_parser.y + @$(YACC) -p phpdbg_ -v -d $(srcdir)/sapi/phpdbg/phpdbg_parser.y -o $@ + install-phpdbg: $(BUILD_BINARY) @echo "Installing phpdbg binary: $(INSTALL_ROOT)$(bindir)/" @$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) diff --git a/phpdbg.h b/phpdbg.h index 42938d9e33..43f26ca323 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -156,7 +156,7 @@ #define PHPDBG_AUTHORS "Felipe Pena, Joe Watkins and Bob Weinand" /* Ordered by last name */ #define PHPDBG_URL "http://phpdbg.com" #define PHPDBG_ISSUES "http://github.com/krakjoe/phpdbg/issues" -#define PHPDBG_VERSION "0.3.2" +#define PHPDBG_VERSION "0.4.0" #define PHPDBG_INIT_FILENAME ".phpdbginit" /* }}} */ diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c index c6818fea3f..ce66ba39ec 100644 --- a/phpdbg_cmd.c +++ b/phpdbg_cmd.c @@ -762,6 +762,9 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, char **why TSRMLS_DC) switch (top->type) { case EVAL_PARAM: return PHPDBG_COMMAND_HANDLER(ev)(top TSRMLS_CC); + + case RUN_PARAM: + return PHPDBG_COMMAND_HANDLER(run)(top TSRMLS_CC); case SHELL_PARAM: return PHPDBG_COMMAND_HANDLER(sh)(top TSRMLS_CC); diff --git a/phpdbg_cmd.h b/phpdbg_cmd.h index af93ba54d4..571d065f59 100644 --- a/phpdbg_cmd.h +++ b/phpdbg_cmd.h @@ -45,7 +45,8 @@ typedef enum { SHELL_PARAM, COND_PARAM, OP_PARAM, - ORIG_PARAM + ORIG_PARAM, + RUN_PARAM } phpdbg_param_type; typedef struct _phpdbg_param phpdbg_param_t; diff --git a/phpdbg_lexer.c b/phpdbg_lexer.c index 14bc525b0b..fc8d846b73 100644 --- a/phpdbg_lexer.c +++ b/phpdbg_lexer.c @@ -9,7 +9,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -47,6 +47,7 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -54,6 +55,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,8 +86,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -326,7 +326,7 @@ void yyfree (void * ,yyscan_t yyscanner ); /* Begin user sect3 */ -#define yywrap(yyscanner) 1 +#define yywrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -345,13 +345,13 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (yy_size_t) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 16 -#define YY_END_OF_BUFFER 17 +#define YY_NUM_RULES 17 +#define YY_END_OF_BUFFER 18 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -359,15 +359,16 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[70] = +static yyconst flex_int16_t yy_accept[73] = { 0, - 0, 0, 0, 0, 17, 13, 15, 2, 10, 10, - 4, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 14, 14, 13, 0, 15, 10, 13, 3, 13, - 13, 5, 13, 7, 9, 13, 8, 6, 13, 13, - 13, 14, 14, 0, 11, 13, 13, 13, 9, 13, - 8, 13, 1, 13, 13, 13, 8, 13, 13, 13, - 9, 13, 13, 13, 12, 13, 8, 9, 0 + 0, 0, 0, 0, 18, 14, 16, 2, 11, 11, + 4, 14, 14, 14, 14, 14, 14, 14, 8, 14, + 14, 14, 14, 15, 15, 14, 0, 16, 11, 14, + 3, 14, 14, 14, 5, 14, 7, 10, 14, 9, + 14, 6, 14, 14, 14, 15, 15, 0, 12, 14, + 14, 14, 14, 8, 14, 14, 0, 14, 14, 14, + 14, 14, 0, 14, 14, 14, 1, 13, 14, 14, + 14, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -378,14 +379,14 @@ static yyconst flex_int32_t yy_ec[256] = 1, 2, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 1, 1, - 1, 1, 1, 1, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 16, 16, 19, 16, 20, 21, 16, - 16, 22, 23, 24, 25, 26, 16, 16, 27, 28, - 1, 1, 1, 1, 29, 1, 30, 31, 12, 32, - - 33, 34, 16, 35, 36, 16, 16, 37, 16, 38, - 39, 16, 16, 40, 41, 42, 43, 44, 16, 45, - 46, 47, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 10, 10, 10, 11, 12, 10, + 13, 13, 13, 13, 13, 13, 13, 14, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 15, + 1, 1, 1, 1, 16, 1, 17, 18, 10, 19, + + 20, 21, 13, 22, 23, 13, 13, 24, 13, 25, + 26, 13, 13, 27, 28, 29, 30, 31, 13, 32, + 33, 34, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -402,107 +403,96 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[48] = +static yyconst flex_int32_t yy_meta[35] = { 0, - 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, + 1, 2, 3, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[74] = +static yyconst flex_int16_t yy_base[78] = { 0, - 0, 0, 46, 48, 213, 198, 50, 238, 49, 54, - 197, 46, 51, 56, 58, 59, 63, 67, 65, 61, - 76, 0, 101, 187, 186, 104, 103, 106, 238, 118, - 113, 182, 115, 178, 176, 116, 171, 148, 117, 121, - 126, 0, 126, 142, 0, 123, 136, 140, 91, 142, - 87, 145, 238, 157, 146, 160, 84, 161, 152, 164, - 82, 193, 170, 163, 203, 173, 79, 72, 238, 232, - 78, 235, 68 + 0, 0, 33, 35, 163, 153, 37, 198, 36, 41, + 152, 42, 33, 38, 43, 44, 46, 49, 48, 53, + 50, 59, 62, 0, 64, 151, 142, 78, 78, 81, + 198, 94, 67, 87, 138, 85, 136, 135, 96, 133, + 88, 130, 97, 98, 103, 0, 108, 0, 0, 105, + 106, 111, 109, 113, 110, 112, 75, 116, 115, 125, + 126, 127, 58, 149, 129, 131, 198, 165, 132, 150, + 158, 198, 181, 185, 189, 60, 193 } ; -static yyconst flex_int16_t yy_def[74] = +static yyconst flex_int16_t yy_def[78] = { 0, - 69, 1, 70, 70, 69, 71, 69, 69, 71, 71, - 69, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 72, 72, 71, 69, 69, 71, 71, 69, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 72, 72, 69, 28, 71, 71, 71, 71, 71, - 71, 71, 69, 71, 71, 71, 71, 71, 71, 71, - 71, 73, 71, 71, 73, 71, 71, 71, 0, 69, - 69, 69, 69 + 72, 1, 73, 73, 72, 74, 72, 72, 74, 74, + 72, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 75, 75, 74, 72, 72, 74, 74, + 72, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 75, 75, 76, 30, 74, + 74, 74, 74, 74, 74, 74, 76, 74, 74, 74, + 74, 74, 72, 77, 74, 74, 72, 77, 74, 74, + 74, 0, 72, 72, 72, 72, 72 } ; -static yyconst flex_int16_t yy_nxt[286] = +static yyconst flex_int16_t yy_nxt[233] = { 0, 6, 7, 7, 8, 9, 6, 10, 9, 11, 6, - 6, 6, 12, 13, 14, 6, 6, 15, 6, 16, - 17, 6, 18, 19, 6, 6, 20, 21, 6, 6, - 6, 12, 13, 14, 6, 15, 6, 16, 17, 6, - 18, 19, 6, 6, 6, 20, 21, 23, 7, 23, - 7, 26, 26, 27, 25, 27, 27, 25, 27, 25, - 27, 27, 25, 30, 25, 33, 25, 25, 65, 25, - 31, 25, 34, 25, 40, 25, 32, 36, 24, 35, - 25, 30, 37, 38, 25, 33, 39, 25, 31, 41, - 25, 34, 25, 40, 32, 25, 36, 35, 28, 25, - - 37, 38, 43, 26, 39, 26, 26, 27, 41, 27, - 27, 25, 45, 45, 25, 45, 45, 45, 45, 45, - 45, 25, 47, 25, 25, 25, 25, 43, 26, 25, - 49, 25, 54, 48, 25, 45, 45, 45, 45, 45, - 46, 50, 47, 51, 25, 52, 55, 53, 25, 49, - 25, 48, 54, 25, 25, 57, 25, 58, 46, 50, - 25, 51, 56, 52, 60, 25, 55, 59, 25, 25, - 63, 25, 25, 61, 57, 67, 58, 64, 25, 25, - 56, 25, 60, 66, 25, 68, 25, 59, 63, 62, - 25, 44, 61, 24, 67, 25, 64, 24, 24, 24, - - 24, 25, 66, 24, 68, 29, 25, 24, 24, 24, - 24, 25, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 24, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 24, 22, 22, 22, 42, 42, 5, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69 + 6, 6, 6, 6, 12, 6, 6, 6, 13, 14, + 15, 6, 16, 6, 17, 18, 19, 20, 21, 6, + 6, 6, 22, 23, 25, 7, 25, 7, 28, 28, + 29, 27, 29, 29, 27, 29, 27, 29, 29, 27, + 27, 27, 27, 32, 27, 33, 27, 27, 27, 36, + 57, 27, 34, 67, 37, 47, 28, 27, 35, 39, + 27, 38, 30, 40, 42, 27, 43, 41, 44, 28, + 28, 45, 29, 63, 29, 29, 27, 49, 49, 27, + 49, 49, 49, 27, 51, 27, 27, 49, 49, 49, + + 49, 49, 27, 52, 27, 27, 27, 50, 53, 47, + 28, 27, 54, 27, 27, 58, 38, 27, 27, 27, + 27, 27, 59, 27, 27, 40, 55, 56, 60, 40, + 62, 64, 65, 27, 27, 27, 61, 27, 27, 27, + 27, 27, 64, 27, 27, 38, 27, 48, 66, 26, + 70, 71, 69, 26, 26, 26, 26, 27, 27, 27, + 31, 27, 72, 72, 26, 26, 27, 72, 40, 26, + 26, 26, 26, 27, 72, 72, 38, 72, 72, 72, + 26, 24, 24, 24, 24, 26, 72, 72, 26, 46, + 46, 72, 46, 68, 72, 72, 68, 5, 72, 72, + + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72 } ; -static yyconst flex_int16_t yy_chk[286] = +static yyconst flex_int16_t yy_chk[233] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, - 4, 7, 7, 9, 12, 9, 9, 9, 10, 13, - 10, 10, 10, 12, 14, 14, 15, 16, 73, 20, - 13, 17, 15, 19, 20, 18, 13, 17, 71, 16, - 68, 12, 17, 18, 21, 14, 19, 67, 13, 21, - 61, 15, 57, 20, 13, 51, 17, 16, 10, 49, - - 17, 18, 23, 23, 19, 26, 26, 27, 21, 27, - 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 31, 31, 33, 36, 39, 30, 43, 43, 40, - 36, 46, 46, 33, 41, 28, 28, 28, 28, 28, - 30, 39, 31, 40, 47, 41, 47, 44, 48, 36, - 50, 33, 46, 52, 55, 50, 38, 52, 30, 39, - 59, 40, 48, 41, 55, 54, 47, 54, 56, 58, - 59, 64, 60, 56, 50, 64, 52, 60, 63, 37, - 48, 66, 55, 63, 35, 66, 34, 54, 59, 58, - 32, 25, 56, 62, 64, 24, 60, 62, 62, 62, - - 62, 62, 63, 65, 66, 11, 6, 65, 65, 65, - 65, 65, 5, 0, 0, 0, 0, 0, 0, 0, - 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 65, 70, 70, 70, 72, 72, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69 + 1, 1, 1, 1, 3, 3, 4, 4, 7, 7, + 9, 13, 9, 9, 9, 10, 14, 10, 10, 10, + 12, 15, 16, 12, 17, 13, 19, 18, 21, 15, + 76, 20, 14, 63, 16, 25, 25, 22, 14, 18, + 23, 17, 10, 18, 20, 33, 21, 19, 22, 28, + 28, 23, 29, 57, 29, 29, 29, 30, 30, 30, + 30, 30, 30, 36, 33, 34, 41, 30, 30, 30, + + 30, 30, 32, 34, 39, 43, 44, 32, 36, 47, + 47, 45, 41, 50, 51, 50, 39, 53, 55, 52, + 56, 54, 51, 59, 58, 44, 43, 45, 52, 55, + 56, 58, 59, 60, 61, 62, 53, 65, 42, 66, + 69, 40, 62, 38, 37, 61, 35, 27, 60, 64, + 66, 69, 65, 64, 64, 64, 64, 64, 70, 26, + 11, 6, 5, 0, 64, 68, 71, 0, 70, 68, + 68, 68, 68, 68, 0, 0, 71, 0, 0, 0, + 68, 73, 73, 73, 73, 74, 0, 0, 74, 75, + 75, 0, 75, 77, 0, 0, 77, 72, 72, 72, + + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72 } ; /* The intent behind this definition is that it'll catch @@ -512,8 +502,8 @@ static yyconst flex_int16_t yy_chk[286] = #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -#line 1 "sapi/phpdbg/dev/phpdbg_lexer.l" -#line 2 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 1 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" +#line 2 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" /* * phpdbg_lexer.l @@ -524,21 +514,10 @@ static yyconst flex_int16_t yy_chk[286] = #define YYSTYPE phpdbg_param_t #include "phpdbg_parser.h" -#include -#include -static inline void phpdbg_append_string(phpdbg_param_t *param, const char *string, size_t length TSRMLS_DC) { - if (!param->str) { - param->str = malloc(length+1); - } else param->str = realloc(param->str, param->len + (length+1)); - - memcpy(¶m->str[param->len], string, length); - param->len += length; - param->str[param->len] = 0; -} #define YY_NO_UNISTD_H 1 -#line 542 "sapi/phpdbg/phpdbg_lexer.c" +#line 521 "sapi/phpdbg/phpdbg_lexer.c" #define INITIAL 0 #define RAW 1 @@ -630,10 +609,6 @@ int yyget_lineno (yyscan_t yyscanner ); void yyset_lineno (int line_number ,yyscan_t yyscanner ); -int yyget_column (yyscan_t yyscanner ); - -void yyset_column (int column_no ,yyscan_t yyscanner ); - YYSTYPE * yyget_lval (yyscan_t yyscanner ); void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); @@ -680,7 +655,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -691,7 +666,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -776,9 +751,9 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 52 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 43 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" -#line 782 "sapi/phpdbg/phpdbg_lexer.c" +#line 757 "sapi/phpdbg/phpdbg_lexer.c" yylval = yylval_param; @@ -833,13 +808,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 70 ) + if ( yy_current_state >= 73 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 69 ); + while ( yy_current_state != 72 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; @@ -861,7 +836,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 54 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 45 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, STR_PARAM); yylval->str = strndup(yytext, yyleng); @@ -871,22 +846,22 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 60 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 51 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { return T_POUND; } YY_BREAK case 3: YY_RULE_SETUP -#line 61 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 52 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { return T_DCOLON; } YY_BREAK case 4: YY_RULE_SETUP -#line 62 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 53 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { return T_COLON; } YY_BREAK case 5: YY_RULE_SETUP -#line 63 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 54 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { BEGIN(RAW); phpdbg_init_param(yylval, EMPTY_PARAM); @@ -895,7 +870,7 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 68 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 59 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { BEGIN(RAW); phpdbg_init_param(yylval, EMPTY_PARAM); @@ -904,7 +879,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 73 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 64 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { BEGIN(RAW); phpdbg_init_param(yylval, EMPTY_PARAM); @@ -913,43 +888,52 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 78 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 69 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" +{ + BEGIN(RAW); + phpdbg_init_param(yylval, EMPTY_PARAM); + return T_RUN; + } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 74 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = 1; return T_TRUTHY; } YY_BREAK -case 9: +case 10: YY_RULE_SETUP -#line 83 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 79 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = 0; return T_FALSY; } YY_BREAK -case 10: +case 11: YY_RULE_SETUP -#line 88 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 84 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = atoi(yytext); return T_DIGITS; } YY_BREAK -case 11: +case 12: YY_RULE_SETUP -#line 93 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 89 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, ADDR_PARAM); yylval->addr = strtoul(yytext, 0, 16); return T_ADDR; } YY_BREAK -case 12: +case 13: YY_RULE_SETUP -#line 98 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 94 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, OP_PARAM); yylval->str = strndup(yytext, yyleng); @@ -957,9 +941,9 @@ YY_RULE_SETUP return T_OPCODE; } YY_BREAK -case 13: +case 14: YY_RULE_SETUP -#line 104 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 100 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, STR_PARAM); yylval->str = strndup(yytext, yyleng); @@ -968,9 +952,9 @@ YY_RULE_SETUP } YY_BREAK -case 14: +case 15: YY_RULE_SETUP -#line 112 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 108 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, STR_PARAM); yylval->str = strndup(yytext, yyleng); @@ -979,18 +963,18 @@ YY_RULE_SETUP return T_INPUT; } YY_BREAK -case 15: -/* rule 15 can match eol */ +case 16: +/* rule 16 can match eol */ YY_RULE_SETUP -#line 120 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 116 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" { /* ignore whitespace */ } YY_BREAK -case 16: +case 17: YY_RULE_SETUP -#line 121 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 117 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 994 "sapi/phpdbg/phpdbg_lexer.c" +#line 978 "sapi/phpdbg/phpdbg_lexer.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(RAW): yyterminate(); @@ -1186,7 +1170,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); @@ -1286,7 +1270,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 70 ) + if ( yy_current_state >= 73 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1315,13 +1299,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 70 ) + if ( yy_current_state >= 73 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 69); + yy_is_jam = (yy_current_state == 72); - (void)yyg; return yy_is_jam ? 0 : yy_current_state; } @@ -1412,7 +1395,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) case EOB_ACT_END_OF_FILE: { if ( yywrap(yyscanner ) ) - return EOF; + return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -1761,8 +1744,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ @@ -1770,8 +1753,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len { YY_BUFFER_STATE b; char *buf; - yy_size_t n; - yy_size_t i; + yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -1917,7 +1899,7 @@ void yyset_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); yylineno = line_number; } @@ -1932,7 +1914,7 @@ void yyset_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "yyset_column called with no buffer" ); + yy_fatal_error( "yyset_column called with no buffer" , yyscanner); yycolumn = column_no; } @@ -2156,7 +2138,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 121 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 117 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" diff --git a/phpdbg_lexer.h b/phpdbg_lexer.h index 14dc12ef5a..19f490f6ef 100644 --- a/phpdbg_lexer.h +++ b/phpdbg_lexer.h @@ -13,7 +13,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -51,6 +51,7 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -58,6 +59,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -88,8 +90,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -214,7 +214,7 @@ void yyfree (void * ,yyscan_t yyscanner ); /* Begin user sect3 */ -#define yywrap(yyscanner) 1 +#define yywrap(n) 1 #define YY_SKIP_YYWRAP #define yytext_ptr yytext_r @@ -270,10 +270,6 @@ int yyget_lineno (yyscan_t yyscanner ); void yyset_lineno (int line_number ,yyscan_t yyscanner ); -int yyget_column (yyscan_t yyscanner ); - -void yyset_column (int column_no ,yyscan_t yyscanner ); - YYSTYPE * yyget_lval (yyscan_t yyscanner ); void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); @@ -339,9 +335,9 @@ extern int yylex \ #undef YY_DECL #endif -#line 121 "sapi/phpdbg/dev/phpdbg_lexer.l" +#line 117 "/var/root/php-src/sapi/phpdbg/phpdbg_lexer.l" -#line 346 "sapi/phpdbg/phpdbg_lexer.h" +#line 342 "sapi/phpdbg/phpdbg_lexer.h" #undef yyIN_HEADER #endif /* yyHEADER_H */ diff --git a/dev/phpdbg_lexer.l b/phpdbg_lexer.l similarity index 75% rename from dev/phpdbg_lexer.l rename to phpdbg_lexer.l index 577155c1c0..79dd35e7cd 100644 --- a/dev/phpdbg_lexer.l +++ b/phpdbg_lexer.l @@ -9,18 +9,7 @@ #define YYSTYPE phpdbg_param_t #include "phpdbg_parser.h" -#include -#include -static inline void phpdbg_append_string(phpdbg_param_t *param, const char *string, size_t length TSRMLS_DC) { - if (!param->str) { - param->str = malloc(length+1); - } else param->str = realloc(param->str, param->len + (length+1)); - - memcpy(¶m->str[param->len], string, length); - param->len += length; - param->str[param->len] = 0; -} %} %s RAW @@ -31,23 +20,25 @@ static inline void phpdbg_append_string(phpdbg_param_t *param, const char *strin %option reentrant noyywrap never-interactive nounistd %option bison-bridge -T_TRUE ?i:"true" -T_YES ?i:"yes" -T_ON ?i:"on" -T_ENABLED ?i:"enabled" -T_FALSE ?i:"false" -T_NO ?i:"no" -T_OFF ?i:"off" -T_DISABLED ?i:"disabled" -T_EVAL ?i:"ev" -T_SHELL ?i:"sh" -T_IF ?i:"if" +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\.]+ ID [^ \r\n\t:#]+ ADDR 0x[a-fA-F0-9]+ -OPCODE ?i:ZEND_([A-Za-z])+ +OPCODE (ZEND_|zend_)([A-Za-z])+ INPUT [^\n]+ %% { @@ -75,6 +66,11 @@ INPUT [^\n]+ phpdbg_init_param(yylval, EMPTY_PARAM); return T_IF; } + {T_RUN}|{T_RUN_SHORT} { + BEGIN(RAW); + phpdbg_init_param(yylval, EMPTY_PARAM); + return T_RUN; + } {T_YES}|{T_ON}|{T_ENABLED}|{T_TRUE} { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = 1; diff --git a/phpdbg_parser.c b/phpdbg_parser.c deleted file mode 100644 index eabe78e793..0000000000 --- a/phpdbg_parser.c +++ /dev/null @@ -1,1843 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.7" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - - - -/* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 2 "sapi/phpdbg/dev/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" -#include "phpdbg_cmd.h" -#include "phpdbg_prompt.h" - -#define YYSTYPE phpdbg_param_t - -#include "phpdbg_parser.h" -#include "phpdbg_lexer.h" - -ZEND_EXTERN_MODULE_GLOBALS(phpdbg); - -int yyerror(phpdbg_param_t *stack, yyscan_t scanner, const char *msg) { - TSRMLS_FETCH(); - phpdbg_error("Parse Error: %s", msg); - { - const phpdbg_param_t *top = stack; - - while (top) { - phpdbg_param_debug( - top, "--> "); - top = top->next; - } - } - return 0; -} - -/* Line 371 of yacc.c */ -#line 106 "sapi/phpdbg/phpdbg_parser.c" - -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "phpdbg_parser.h". */ -#ifndef YY_YY_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED -# define YY_YY_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif -/* "%code requires" blocks. */ -/* Line 387 of yacc.c */ -#line 40 "sapi/phpdbg/dev/phpdbg_parser.y" - -#include "phpdbg.h" -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - - -/* Line 387 of yacc.c */ -#line 147 "sapi/phpdbg/phpdbg_parser.c" - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - T_EVAL = 258, - T_SHELL = 259, - T_IF = 260, - T_TRUTHY = 261, - T_FALSY = 262, - T_STRING = 263, - T_COLON = 264, - T_DCOLON = 265, - T_POUND = 266, - T_PROTO = 267, - T_DIGITS = 268, - T_LITERAL = 269, - T_ADDR = 270, - T_OPCODE = 271, - T_ID = 272, - T_INPUT = 273, - T_UNEXPECTED = 274 - }; -#endif - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (phpdbg_param_t *stack, yyscan_t scanner); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - -#endif /* !YY_YY_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED */ - -/* Copy the second part of user declarations. */ - -/* Line 390 of yacc.c */ -#line 203 "sapi/phpdbg/phpdbg_parser.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 22 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 31 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 20 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 4 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 22 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 35 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 274 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 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 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 5, 6, 8, 11, 15, 20, 25, - 31, 35, 41, 45, 48, 51, 54, 56, 58, 60, - 62, 64, 66 -}; - -/* 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, 17, 9, 13, -1, 17, 9, 11, 13, -1, - 12, 17, 9, 13, -1, 12, 17, 9, 11, 13, - -1, 17, 10, 17, -1, 17, 10, 17, 11, 13, - -1, 17, 11, 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 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = -{ - 0, 75, 75, 76, 80, 81, 85, 90, 95, 106, - 117, 122, 128, 134, 139, 144, 149, 150, 151, 152, - 153, 154, 155 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 1 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -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)\"", "\": (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", YY_NULL -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -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 -}; -# 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, 23, 23 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 0, 1, 2, 3, 4, 4, 5, - 3, 5, 3, 2, 2, 2, 1, 1, 1, 1, - 1, 1, 1 -}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 3, 0, 0, 0, 19, 20, 0, 21, 18, 17, - 16, 22, 0, 2, 4, 14, 15, 13, 0, 0, - 0, 0, 1, 5, 0, 0, 6, 10, 12, 0, - 8, 7, 0, 9, 11 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 12, 13, 14 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -11 -static const yytype_int8 yypact[] = -{ - -3, -10, 1, 2, -11, -11, 6, -11, -11, -11, - -11, -4, 21, -3, -11, -11, -11, -11, 13, 4, - 7, 12, -11, -11, 5, 14, -11, 15, -11, 16, - -11, -11, 17, -11, -11 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -11, -11, -11, 18 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const yytype_uint8 yytable[] = -{ - 1, 2, 3, 4, 5, 19, 20, 21, 15, 6, - 7, 8, 9, 10, 11, 25, 29, 26, 30, 16, - 17, 22, 24, 18, 27, 28, 32, 31, 0, 33, - 34, 23 -}; - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-11))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - -static const yytype_int8 yycheck[] = -{ - 3, 4, 5, 6, 7, 9, 10, 11, 18, 12, - 13, 14, 15, 16, 17, 11, 11, 13, 13, 18, - 18, 0, 9, 17, 17, 13, 11, 13, -1, 13, - 13, 13 -}; - -/* 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, 12, 13, 14, 15, - 16, 17, 21, 22, 23, 18, 18, 18, 17, 9, - 10, 11, 0, 23, 9, 11, 13, 17, 13, 11, - 13, 13, 11, 13, 13 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (stack, scanner, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, scanner) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, stack, scanner); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#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, phpdbg_param_t *stack, yyscan_t scanner) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, stack, scanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - phpdbg_param_t *stack; - yyscan_t scanner; -#endif -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - if (!yyvaluep) - return; - YYUSE (stack); - YYUSE (scanner); -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, phpdbg_param_t *stack, yyscan_t scanner) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, stack, scanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - phpdbg_param_t *stack; - yyscan_t scanner; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep, stack, scanner); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule, phpdbg_param_t *stack, yyscan_t scanner) -#else -static void -yy_reduce_print (yyvsp, yyrule, stack, scanner) - YYSTYPE *yyvsp; - int yyrule; - phpdbg_param_t *stack; - yyscan_t scanner; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , stack, scanner); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule, stack, scanner); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, phpdbg_param_t *stack, yyscan_t scanner) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, stack, scanner) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - phpdbg_param_t *stack; - yyscan_t scanner; -#endif -{ - YYUSE (yyvaluep); - YYUSE (stack); - YYUSE (scanner); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (phpdbg_param_t *stack, yyscan_t scanner) -#else -int -yyparse (stack, scanner) - phpdbg_param_t *stack; - yyscan_t scanner; -#endif -#endif -{ -/* The lookahead symbol. */ -int yychar; - - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 4: -/* Line 1792 of yacc.c */ -#line 80 "sapi/phpdbg/dev/phpdbg_parser.y" - { phpdbg_stack_push(stack, &(yyvsp[(1) - (1)])); } - break; - - case 5: -/* Line 1792 of yacc.c */ -#line 81 "sapi/phpdbg/dev/phpdbg_parser.y" - { phpdbg_stack_push(stack, &(yyvsp[(2) - (2)])); } - break; - - case 6: -/* Line 1792 of yacc.c */ -#line 85 "sapi/phpdbg/dev/phpdbg_parser.y" - { - (yyval).type = FILE_PARAM; - (yyval).file.name = (yyvsp[(2) - (3)]).str; - (yyval).file.line = (yyvsp[(3) - (3)]).num; - } - break; - - case 7: -/* Line 1792 of yacc.c */ -#line 90 "sapi/phpdbg/dev/phpdbg_parser.y" - { - (yyval).type = NUMERIC_FILE_PARAM; - (yyval).file.name = (yyvsp[(1) - (4)]).str; - (yyval).file.line = (yyvsp[(4) - (4)]).num; - } - break; - - case 8: -/* Line 1792 of yacc.c */ -#line 95 "sapi/phpdbg/dev/phpdbg_parser.y" - { - (yyval).type = FILE_PARAM; - (yyval).file.name = malloc((yyvsp[(1) - (4)]).len + - (yyvsp[(2) - (4)]).len + 1); - if ((yyval).file.name) { - memcpy(&(yyval).file.name[0], (yyvsp[(1) - (4)]).str, (yyvsp[(1) - (4)]).len); - memcpy(&(yyval).file.name[(yyvsp[(1) - (4)]).len], (yyvsp[(2) - (4)]).str, (yyvsp[(2) - (4)]).len); - (yyval).file.name[(yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len] = '\0'; - } - (yyval).file.line = (yyvsp[(4) - (4)]).num; - } - break; - - case 9: -/* Line 1792 of yacc.c */ -#line 106 "sapi/phpdbg/dev/phpdbg_parser.y" - { - (yyval).type = NUMERIC_FILE_PARAM; - (yyval).file.name = malloc((yyvsp[(1) - (5)]).len + - (yyvsp[(2) - (5)]).len + 1); - if ((yyval).file.name) { - memcpy(&(yyval).file.name[0], (yyvsp[(1) - (5)]).str, (yyvsp[(1) - (5)]).len); - memcpy(&(yyval).file.name[(yyvsp[(1) - (5)]).len], (yyvsp[(2) - (5)]).str, (yyvsp[(2) - (5)]).len); - (yyval).file.name[(yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len] = '\0'; - } - (yyval).file.line = (yyvsp[(5) - (5)]).num; - } - break; - - case 10: -/* Line 1792 of yacc.c */ -#line 117 "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 11: -/* Line 1792 of yacc.c */ -#line 122 "sapi/phpdbg/dev/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; - } - break; - - case 12: -/* Line 1792 of yacc.c */ -#line 128 "sapi/phpdbg/dev/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; - } - break; - - case 13: -/* Line 1792 of yacc.c */ -#line 134 "sapi/phpdbg/dev/phpdbg_parser.y" - { - (yyval).type = COND_PARAM; - (yyval).str = (yyvsp[(2) - (2)]).str; - (yyval).len = (yyvsp[(2) - (2)]).len; - } - break; - - case 14: -/* Line 1792 of yacc.c */ -#line 139 "sapi/phpdbg/dev/phpdbg_parser.y" - { - (yyval).type = EVAL_PARAM; - (yyval).str = (yyvsp[(2) - (2)]).str; - (yyval).len = (yyvsp[(2) - (2)]).len; - } - break; - - case 15: -/* Line 1792 of yacc.c */ -#line 144 "sapi/phpdbg/dev/phpdbg_parser.y" - { - (yyval).type = SHELL_PARAM; - (yyval).str = (yyvsp[(2) - (2)]).str; - (yyval).len = (yyvsp[(2) - (2)]).len; - } - break; - - case 16: -/* Line 1792 of yacc.c */ -#line 149 "sapi/phpdbg/dev/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 17: -/* Line 1792 of yacc.c */ -#line 150 "sapi/phpdbg/dev/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 18: -/* Line 1792 of yacc.c */ -#line 151 "sapi/phpdbg/dev/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 19: -/* Line 1792 of yacc.c */ -#line 152 "sapi/phpdbg/dev/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 20: -/* Line 1792 of yacc.c */ -#line 153 "sapi/phpdbg/dev/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 21: -/* Line 1792 of yacc.c */ -#line 154 "sapi/phpdbg/dev/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - case 22: -/* Line 1792 of yacc.c */ -#line 155 "sapi/phpdbg/dev/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } - break; - - -/* Line 1792 of yacc.c */ -#line 1611 "sapi/phpdbg/phpdbg_parser.c" - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (stack, scanner, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (stack, scanner, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, stack, scanner); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp, stack, scanner); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (stack, scanner, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, stack, scanner); - } - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, stack, scanner); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -/* Line 2055 of yacc.c */ -#line 158 "sapi/phpdbg/dev/phpdbg_parser.y" - diff --git a/phpdbg_parser.h b/phpdbg_parser.h deleted file mode 100644 index 3a57a5e54f..0000000000 --- a/phpdbg_parser.h +++ /dev/null @@ -1,105 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -#ifndef YY_YY_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED -# define YY_YY_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif -/* "%code requires" blocks. */ -/* Line 2058 of yacc.c */ -#line 40 "sapi/phpdbg/dev/phpdbg_parser.y" - -#include "phpdbg.h" -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - - -/* Line 2058 of yacc.c */ -#line 55 "sapi/phpdbg/phpdbg_parser.h" - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - T_EVAL = 258, - T_SHELL = 259, - T_IF = 260, - T_TRUTHY = 261, - T_FALSY = 262, - T_STRING = 263, - T_COLON = 264, - T_DCOLON = 265, - T_POUND = 266, - T_PROTO = 267, - T_DIGITS = 268, - T_LITERAL = 269, - T_ADDR = 270, - T_OPCODE = 271, - T_ID = 272, - T_INPUT = 273, - T_UNEXPECTED = 274 - }; -#endif - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (phpdbg_param_t *stack, yyscan_t scanner); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - -#endif /* !YY_YY_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED */ diff --git a/dev/phpdbg_parser.y b/phpdbg_parser.y similarity index 97% rename from dev/phpdbg_parser.y rename to phpdbg_parser.y index 58306e07f9..b1b2423fb1 100644 --- a/dev/phpdbg_parser.y +++ b/phpdbg_parser.y @@ -53,6 +53,7 @@ typedef void* yyscan_t; %parse-param { yyscan_t scanner } %token T_EVAL "eval" +%token T_RUN "run" %token T_SHELL "shell" %token T_IF "if (condition)" %token T_TRUTHY "truthy (true, on, yes or enabled)" @@ -146,6 +147,11 @@ parameter $$.str = $2.str; $$.len = $2.len; } + | T_RUN T_INPUT { + $$.type = RUN_PARAM; + $$.str = $2.str; + $$.len = $2.len; + } | T_OPCODE { $$ = $1; } | T_ADDR { $$ = $1; } | T_LITERAL { $$ = $1; } -- 2.40.0