summaryrefslogtreecommitdiff
path: root/phpdbg_prompt.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2014-06-08 20:34:30 +0000
committerBob Weinand <bobwei9@hotmail.com>2014-06-08 20:34:30 +0000
commit4c79fe6afa25c87f89b46d48968fdaf36b085f8c (patch)
tree33df9fedb4e0eb1cba0b566ecb594fb2ccd22b7a /phpdbg_prompt.c
parent7b9367971d9523bc53d44cbe71498a95bd5e523b (diff)
downloadphp-git-4c79fe6afa25c87f89b46d48968fdaf36b085f8c.tar.gz
Updated parser & leer to be usable with re2c
Fixes some weird temporary compilation errors too
Diffstat (limited to 'phpdbg_prompt.c')
-rw-r--r--phpdbg_prompt.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index 7a28a75129..3fbda219d1 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -248,20 +248,10 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_
char *why = NULL;
char *input = phpdbg_read_input(cmd TSRMLS_CC);
phpdbg_param_t stack;
- yyscan_t scanner;
- YY_BUFFER_STATE state;
phpdbg_init_param(&stack, STACK_PARAM);
-
- if (yylex_init(&scanner)) {
- phpdbg_error(
- "could not initialize scanner");
- break;
- }
- state = yy_scan_string(input, scanner);
-
- if (yyparse(&stack, scanner) <= 0) {
+ if (phpdbg_do_parse(&stack, input) <= 0) {
switch (phpdbg_stack_execute(&stack, &why TSRMLS_CC)) {
case FAILURE:
// if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
@@ -274,15 +264,12 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_
break;
}
}
-
+
if (why) {
free(why);
why = NULL;
}
-
- yy_delete_buffer(state, scanner);
- yylex_destroy(scanner);
-
+
phpdbg_stack_free(&stack);
phpdbg_destroy_input(&input TSRMLS_CC);
}
@@ -1014,20 +1001,9 @@ int phpdbg_interactive(TSRMLS_D) /* {{{ */
if (input) {
do {
- yyscan_t scanner;
- YY_BUFFER_STATE state;
-
phpdbg_init_param(&stack, STACK_PARAM);
- if (yylex_init(&scanner)) {
- phpdbg_error(
- "could not initialize scanner");
- return FAILURE;
- }
-
- state = yy_scan_string(input, scanner);
-
- if (yyparse(&stack, scanner) <= 0) {
+ if (phpdbg_do_parse(&stack, input) <= 0) {
switch (ret = phpdbg_stack_execute(&stack, &why TSRMLS_CC)) {
case FAILURE:
if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
@@ -1061,9 +1037,6 @@ int phpdbg_interactive(TSRMLS_D) /* {{{ */
why = NULL;
}
- yy_delete_buffer(state, scanner);
- yylex_destroy(scanner);
-
phpdbg_stack_free(&stack);
phpdbg_destroy_input(&input TSRMLS_CC);