diff options
-rw-r--r-- | Zend/acconfig.h | 2 | ||||
-rw-r--r-- | Zend/zend-parser.y | 393 | ||||
-rw-r--r-- | Zend/zend-scanner.l | 216 | ||||
-rw-r--r-- | Zend/zend_compile.c | 22 | ||||
-rw-r--r-- | Zend/zend_compile.h | 40 | ||||
-rw-r--r-- | Zend/zend_execute.c | 40 | ||||
-rw-r--r-- | Zend/zend_globals.h | 6 | ||||
-rw-r--r-- | Zend/zend_highlight.c | 16 | ||||
-rw-r--r-- | Zend/zend_indent.c | 6 | ||||
-rw-r--r-- | Zend/zend_opcode.c | 28 |
10 files changed, 383 insertions, 386 deletions
diff --git a/Zend/acconfig.h b/Zend/acconfig.h index 6008a973e2..01c935374c 100644 --- a/Zend/acconfig.h +++ b/Zend/acconfig.h @@ -26,7 +26,7 @@ /* Undefine if you want stricter XML/SGML compliance by default */ /* (this disables "<?expression?>" by default) */ -#define DEFAULT_SHORT_OPEN_TAG 1 +#define T_DEFAULT_SHORT_OPEN_TAG 1 /* Define both of these if you want the bundled REGEX library */ #define REGEX 0 diff --git a/Zend/zend-parser.y b/Zend/zend-parser.y index 5ebe55d12b..199dd5c501 100644 --- a/Zend/zend-parser.y +++ b/Zend/zend-parser.y @@ -40,87 +40,84 @@ %pure_parser %expect 4 -%left INCLUDE EVAL +%left T_INCLUDE T_EVAL %left ',' -%left LOGICAL_OR -%left LOGICAL_XOR -%left LOGICAL_AND -%right ZEND_PRINT -%left '=' PLUS_EQUAL MINUS_EQUAL MUL_EQUAL DIV_EQUAL CONCAT_EQUAL MOD_EQUAL AND_EQUAL OR_EQUAL XOR_EQUAL SHIFT_LEFT_EQUAL SHIFT_RIGHT_EQUAL +%left T_LOGICAL_OR +%left T_LOGICAL_XOR +%left T_LOGICAL_AND +%right T_PRINT +%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL XT_OR_EQUAL T_SL_EQUAL T_SR_EQUAL %left '?' ':' -%left BOOLEAN_OR -%left BOOLEAN_AND +%left T_BOOLEAN_OR +%left T_BOOLEAN_AND %left '|' %left '^' %left '&' -%nonassoc IS_EQUAL IS_NOT_EQUAL -%nonassoc '<' IS_SMALLER_OR_EQUAL '>' IS_GREATER_OR_EQUAL -%left SHIFT_LEFT SHIFT_RIGHT +%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL +%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL +%left T_SL T_SR %left '+' '-' '.' %left '*' '/' '%' -%right '!' '~' INCREMENT DECREMENT INT_CAST DOUBLE_CAST STRING_CAST ARRAY_CAST OBJECT_CAST '@' +%right '!' '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST '@' %right '[' -%nonassoc NEW +%nonassoc T_NEW %token T_EXIT -%token IF -%left ELSEIF -%left ELSE -%left ENDIF -%token LNUMBER -%token DNUMBER -%token STRING -%token VARIABLE -%token NUM_STRING -%token INLINE_HTML -%token CHARACTER -%token BAD_CHARACTER -%token ENCAPSED_AND_WHITESPACE -%token CONSTANT_ENCAPSED_STRING -%token ZEND_ECHO -%token DO -%token WHILE -%token ENDWHILE -%token FOR -%token ENDFOR -%token ZEND_FOREACH +%token T_IF +%left T_ELSEIF +%left T_ELSE +%left T_ENDIF +%token T_LNUMBER +%token T_DNUMBER +%token T_STRING +%token T_VARIABLE +%token T_NUM_STRING +%token T_INLINE_HTML +%token T_CHARACTER +%token T_BAD_CHARACTER +%token T_ENCAPSED_AND_WHITESPACE +%token T_CONSTANT_ENCAPSED_STRING +%token T_ECHO +%token T_DO +%token T_WHILE +%token T_ENDWHILE +%token T_FOR +%token T_ENDFOR +%token T_FOREACH %token T_ENDFOREACH -%token ZEND_AS -%token SWITCH -%token ENDSWITCH -%token CASE -%token DEFAULT -%token BREAK -%token CONTINUE -%token CONTINUED_WHILE -%token CONTINUED_DOWHILE -%token CONTINUED_FOR -%token OLD_FUNCTION -%token FUNCTION -%token ZEND_CONST -%token RETURN -%token REQUIRE -%token ZEND_GLOBAL -%token ZEND_STATIC -%token ZEND_UNSET +%token T_AS +%token T_SWITCH +%token T_ENDSWITCH +%token T_CASE +%token T_DEFAULT +%token T_BREAK +%token T_CONTINUE +%token T_OLD_FUNCTION +%token T_FUNCTION +%token T_CONST +%token T_RETURN +%token T_REQUIRE +%token T_GLOBAL +%token T_STATIC +%token T_VAR +%token T_UNSET %token T_ISSET %token T_EMPTY -%token CLASS -%token EXTENDS -%token ZEND_OBJECT_OPERATOR -%token ZEND_DOUBLE_ARROW -%token ZEND_LIST -%token ZEND_ARRAY -%token VAR -%token ZEND_LINE -%token ZEND_FILE -%token ZEND_COMMENT -%token ZEND_ML_COMMENT -%token PHP_OPEN_TAG -%token PHP_OPEN_TAG_WITH_ECHO -%token PHP_CLOSE_TAG +%token T_CLASS +%token T_EXTENDS +%token T_OBJECT_OPERATOR +%token T_DOUBLE_ARROW +%token T_LIST +%token T_ARRAY +%token T_LINE +%token T_FILE +%token T_COMMENT +%token T_ML_COMMENT +%token T_OPEN_TAG +%token T_OPEN_TAG_WITH_ECHO +%token T_CLOSE_TAG %token T_WHITESPACE -%token ZEND_HEREDOC -%token DOLLAR_OPEN_CURLY_BRACES +%token T_HEREDOC +%token T_DOLLAR_OPEN_CURLY_BRACES %token T_CURLY_OPEN %token T_PAAMAYIM_NEKUDOTAYIM %token T_PHP_TRACK_VARS @@ -135,11 +132,11 @@ statement_list: statement: '{' statement_list '}' - | IF '(' expr ')' { do_if_cond(&$3, &$4 CLS_CC); } statement { do_if_after_statement(&$4, 1 CLS_CC); } elseif_list else_single { do_if_end(CLS_C); } - | IF '(' expr ')' ':' { do_if_cond(&$3, &$4 CLS_CC); } statement_list { do_if_after_statement(&$4, 1 CLS_CC); } new_elseif_list new_else_single ENDIF ';' { do_if_end(CLS_C); } - | WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { do_while_cond(&$4, &$5 CLS_CC); } while_statement { do_while_end(&$1, &$5 CLS_CC); } - | DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); do_do_while_begin(CLS_C); } statement WHILE '(' expr ')' ';' { do_do_while_end(&$1, &$6 CLS_CC); } - | FOR + | T_IF '(' expr ')' { do_if_cond(&$3, &$4 CLS_CC); } statement { do_if_after_statement(&$4, 1 CLS_CC); } elseif_list else_single { do_if_end(CLS_C); } + | T_IF '(' expr ')' ':' { do_if_cond(&$3, &$4 CLS_CC); } statement_list { do_if_after_statement(&$4, 1 CLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { do_if_end(CLS_C); } + | T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { do_while_cond(&$4, &$5 CLS_CC); } while_statement { do_while_end(&$1, &$5 CLS_CC); } + | T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); do_do_while_begin(CLS_C); } statement T_WHILE '(' expr ')' ';' { do_do_while_end(&$1, &$6 CLS_CC); } + | T_FOR '(' for_expr ';' { do_free(&$3 CLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); } @@ -148,41 +145,41 @@ statement: for_expr ')' { do_free(&$9 CLS_CC); do_for_before_statement(&$4, &$7 CLS_CC); } for_statement { do_for_end(&$7 CLS_CC); } - | SWITCH '(' expr ')' { do_switch_cond(&$3 CLS_CC); } switch_case_list { do_switch_end(&$6 CLS_CC); } - | BREAK ';' { do_brk_cont(ZEND_BRK, NULL CLS_CC); } - | BREAK expr ';' { do_brk_cont(ZEND_BRK, &$2 CLS_CC); } - | CONTINUE ';' { do_brk_cont(ZEND_CONT, NULL CLS_CC); } - | CONTINUE expr ';' { do_brk_cont(ZEND_CONT, &$2 CLS_CC); } - | FUNCTION { $1.u.opline_num = CG(zend_lineno); } STRING { do_begin_function_declaration(&$1, &$3, 0 CLS_CC); } + | T_SWITCH '(' expr ')' { do_switch_cond(&$3 CLS_CC); } switch_case_list { do_switch_end(&$6 CLS_CC); } + | T_BREAK ';' { do_brk_cont(ZEND_BRK, NULL CLS_CC); } + | T_BREAK expr ';' { do_brk_cont(ZEND_BRK, &$2 CLS_CC); } + | T_CONTINUE ';' { do_brk_cont(ZEND_CONT, NULL CLS_CC); } + | T_CONTINUE expr ';' { do_brk_cont(ZEND_CONT, &$2 CLS_CC); } + | T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } T_STRING { do_begin_function_declaration(&$1, &$3, 0 CLS_CC); } '(' parameter_list ')' '{' statement_list '}' { do_end_function_declaration(&$1 CLS_CC); } - | OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } STRING { do_begin_function_declaration(&$1, &$3, 0 CLS_CC); } + | T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } T_STRING { do_begin_function_declaration(&$1, &$3, 0 CLS_CC); } parameter_list '(' statement_list ')' ';' { do_end_function_declaration(&$1 CLS_CC); } - | RETURN ';' { do_return(NULL CLS_CC); } - | RETURN expr ';' { do_return(&$2 CLS_CC); } - | ZEND_GLOBAL global_var_list - | ZEND_STATIC static_var_list - | CLASS STRING { do_begin_class_declaration(&$2, NULL CLS_CC); } '{' class_statement_list '}' { do_end_class_declaration(CLS_C); } - | CLASS STRING EXTENDS STRING { do_begin_class_declaration(&$2, &$4 CLS_CC); } '{' class_statement_list '}' { do_end_class_declaration(CLS_C); } - | ZEND_ECHO echo_expr_list ';' - | INLINE_HTML { do_echo(&$1 CLS_CC); } + | T_RETURN ';' { do_return(NULL CLS_CC); } + | T_RETURN expr ';' { do_return(&$2 CLS_CC); } + | T_GLOBAL global_var_list + | T_STATIC static_var_list + | T_CLASS T_STRING { do_begin_class_declaration(&$2, NULL CLS_CC); } '{' class_statement_list '}' { do_end_class_declaration(CLS_C); } + | T_CLASS T_STRING T_EXTENDS T_STRING { do_begin_class_declaration(&$2, &$4 CLS_CC); } '{' class_statement_list '}' { do_end_class_declaration(CLS_C); } + | T_ECHO echo_expr_list ';' + | T_INLINE_HTML { do_echo(&$1 CLS_CC); } | expr ';' { do_free(&$1 CLS_CC); } - | REQUIRE CONSTANT_ENCAPSED_STRING ';' { require_filename($2.u.constant.value.str.val CLS_CC); zval_dtor(&$2.u.constant); } - | REQUIRE '(' CONSTANT_ENCAPSED_STRING ')' ';' { require_filename($3.u.constant.value.str.val CLS_CC); zval_dtor(&$3.u.constant); } - | ZEND_UNSET '(' r_cvar ')' ';' { do_unset(&$3 CLS_CC); } - | ZEND_FOREACH '(' expr ZEND_AS { do_foreach_begin(&$1, &$3, &$2, &$4 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); } + | T_REQUIRE T_CONSTANT_ENCAPSED_STRING ';' { require_filename($2.u.constant.value.str.val CLS_CC); zval_dtor(&$2.u.constant); } + | T_REQUIRE '(' T_CONSTANT_ENCAPSED_STRING ')' ';' { require_filename($3.u.constant.value.str.val CLS_CC); zval_dtor(&$3.u.constant); } + | T_UNSET '(' r_cvar ')' ';' { do_unset(&$3 CLS_CC); } + | T_FOREACH '(' expr T_AS { do_foreach_begin(&$1, &$3, &$2, &$4 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); } | ';' /* empty statement */ ; foreach_optional_arg: /* empty */ { $$.op_type = IS_UNUSED; } - | ZEND_DOUBLE_ARROW w_cvar { $$ = $2; } + | T_DOUBLE_ARROW w_cvar { $$ = $2; } ; for_statement: statement - | ':' statement_list ENDFOR ';' + | ':' statement_list T_ENDFOR ';' ; @@ -195,15 +192,15 @@ foreach_statement: switch_case_list: '{' case_list '}' { $$ = $2; } | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list ENDSWITCH ';' { $$ = $3; } + | ':' case_list T_ENDSWITCH ';' { $$ = $2; } + | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } ; case_list: /* empty */ { $$.u.opline_num = -1; } - | case_list CASE expr case_separator { do_case_before_statement(&$1, &$2, &$3 CLS_CC); } statement_list { do_case_after_statement(&$$, &$2 CLS_CC); } - | case_list DEFAULT case_separator { do_default_before_statement(&$1, &$2 CLS_CC); } statement_list { do_case_after_statement(&$$, &$2 CLS_CC); } + | case_list T_CASE expr case_separator { do_case_before_statement(&$1, &$2, &$3 CLS_CC); } statement_list { do_case_after_statement(&$$, &$2 CLS_CC); } + | case_list T_DEFAULT case_separator { do_default_before_statement(&$1, &$2 CLS_CC); } statement_list { do_case_after_statement(&$$, &$2 CLS_CC); } ; @@ -215,32 +212,32 @@ case_separator: while_statement: statement - | ':' statement_list ENDWHILE ';' + | ':' statement_list T_ENDWHILE ';' ; elseif_list: /* empty */ - | elseif_list ELSEIF '(' expr ')' { do_if_cond(&$4, &$5 CLS_CC); } statement { do_if_after_statement(&$5, 0 CLS_CC); } + | elseif_list T_ELSEIF '(' expr ')' { do_if_cond(&$4, &$5 CLS_CC); } statement { do_if_after_statement(&$5, 0 CLS_CC); } ; new_elseif_list: /* empty */ - | new_elseif_list ELSEIF '(' expr ')' ':' { do_if_cond(&$4, &$5 CLS_CC); } statement_list { do_if_after_statement(&$5, 0 CLS_CC); } + | new_elseif_list T_ELSEIF '(' expr ')' ':' { do_if_cond(&$4, &$5 CLS_CC); } statement_list { do_if_after_statement(&$5, 0 CLS_CC); } ; else_single: /* empty */ - | ELSE statement + | T_ELSE statement ; new_else_single: /* empty */ - | ELSE ':' statement_list + | T_ELSE ':' statement_list ; @@ -253,16 +250,16 @@ parameter_list: non_empty_parameter_list: - VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } - | '&' VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); } - | ZEND_CONST VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } - | VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); } - | VARIABLE '=' ZEND_UNSET { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } - | non_empty_parameter_list ',' VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } - | non_empty_parameter_list ',' '&' VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); } - | non_empty_parameter_list ',' ZEND_CONST VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } - | non_empty_parameter_list ',' VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, BYREF_NONE CLS_CC); } - | non_empty_parameter_list ',' VARIABLE '=' ZEND_UNSET { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } + T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } + | '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); } + | T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } + | T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); } + | T_VARIABLE '=' T_UNSET { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } + | non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } + | non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); } + | non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } + | non_empty_parameter_list ',' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, BYREF_NONE CLS_CC); } + | non_empty_parameter_list ',' T_VARIABLE '=' T_UNSET { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, NULL, BYREF_NONE CLS_CC); } ; @@ -288,17 +285,17 @@ global_var_list: global_var: - VARIABLE { $$ = $1; } + T_VARIABLE { $$ = $1; } | '$' r_cvar { $$ = $2; } | '$' '{' expr '}' { $$ = $3; } ; static_var_list: - static_var_list ',' VARIABLE { do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_STATIC CLS_CC); } - | static_var_list ',' VARIABLE '=' static_scalar { do_fetch_global_or_static_variable(&$3, &$5, ZEND_FETCH_STATIC CLS_CC); } - | VARIABLE { do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_STATIC CLS_CC); } - | VARIABLE '=' static_scalar { do_fetch_global_or_static_variable(&$1, &$3, ZEND_FETCH_STATIC CLS_CC); } + static_var_list ',' T_VARIABLE { do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_STATIC CLS_CC); } + | static_var_list ',' T_VARIABLE '=' static_scalar { do_fetch_global_or_static_variable(&$3, &$5, ZEND_FETCH_STATIC CLS_CC); } + | T_VARIABLE { do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_STATIC CLS_CC); } + | T_VARIABLE '=' static_scalar { do_fetch_global_or_static_variable(&$1, &$3, ZEND_FETCH_STATIC CLS_CC); } ; @@ -310,20 +307,20 @@ class_statement_list: class_statement: - VAR class_variable_decleration ';' - | FUNCTION { $1.u.opline_num = CG(zend_lineno); } STRING { do_begin_function_declaration(&$1, &$3, 1 CLS_CC); } '(' + T_VAR class_variable_decleration ';' + | T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } T_STRING { do_begin_function_declaration(&$1, &$3, 1 CLS_CC); } '(' parameter_list ')' '{' statement_list '}' { do_end_function_declaration(&$1 CLS_CC); } - | OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } STRING { do_begin_function_declaration(&$1, &$3, 1 CLS_CC); } + | T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } T_STRING { do_begin_function_declaration(&$1, &$3, 1 CLS_CC); } parameter_list '(' statement_list ')' ';' { do_end_function_declaration(&$1 CLS_CC); } ; class_variable_decleration: - class_variable_decleration ',' VARIABLE { do_declare_property(&$3, NULL CLS_CC); } - | class_variable_decleration ',' VARIABLE '=' static_scalar { do_declare_property(&$3, &$5 CLS_CC); } - | VARIABLE { do_declare_property(&$1, NULL CLS_CC); } - | VARIABLE '=' static_scalar { do_declare_property(&$1, &$3 CLS_CC); } + class_variable_decleration ',' T_VARIABLE { do_declare_property(&$3, NULL CLS_CC); } + | class_variable_decleration ',' T_VARIABLE '=' static_scalar { do_declare_property(&$3, &$5 CLS_CC); } + | T_VARIABLE { do_declare_property(&$1, NULL CLS_CC); } + | T_VARIABLE '=' static_scalar { do_declare_property(&$1, &$3 CLS_CC); } ; @@ -342,30 +339,30 @@ for_expr: expr_without_variable: - ZEND_LIST '(' { do_list_init(); } assignment_list ')' '=' expr { do_list_end(&$$, &$7 CLS_CC); } + T_LIST '(' { do_list_init(); } assignment_list ')' '=' expr { do_list_end(&$$, &$7 CLS_CC); } | w_cvar '=' expr { do_assign(&$$, &$1, &$3 CLS_CC); } | w_cvar '=' '&' w_cvar { do_assign_ref(&$$, &$1, &$4 CLS_CC); } - | w_cvar '=' NEW class_name { do_extended_fcall_begin(CLS_C); do_begin_new_object(&$2, &$1, &$3, &$4 CLS_CC); } ctor_arguments { do_end_new_object(&$4, &$3, &$6 CLS_CC); do_extended_fcall_end(CLS_C); $$ = $2;} - | rw_cvar PLUS_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 CLS_CC); } - | rw_cvar MINUS_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 CLS_CC); } - | rw_cvar MUL_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 CLS_CC); } - | rw_cvar DIV_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 CLS_CC); } - | rw_cvar CONCAT_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 CLS_CC); } - | rw_cvar MOD_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 CLS_CC); } - | rw_cvar AND_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 CLS_CC); } - | rw_cvar OR_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 CLS_CC); } - | rw_cvar XOR_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 CLS_CC); } - | rw_cvar SHIFT_LEFT_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 CLS_CC); } - | rw_cvar SHIFT_RIGHT_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 CLS_CC); } - | rw_cvar INCREMENT { do_post_incdec(&$$, &$1, ZEND_POST_INC CLS_CC); } - | INCREMENT rw_cvar { do_pre_incdec(&$$, &$2, ZEND_PRE_INC CLS_CC); } - | rw_cvar DECREMENT { do_post_incdec(&$$, &$1, ZEND_POST_DEC CLS_CC); } - | DECREMENT rw_cvar { do_pre_incdec(&$$, &$2, ZEND_PRE_DEC CLS_CC); } - | expr BOOLEAN_OR { do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); } - | expr BOOLEAN_AND { do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); } - | expr LOGICAL_OR { do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); } - | expr LOGICAL_AND { do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); } - | expr LOGICAL_XOR expr { do_binary_op(ZEND_BOOL_XOR, &$$, &$1, &$3 CLS_CC); } + | w_cvar '=' T_NEW class_name { do_extended_fcall_begin(CLS_C); do_begin_new_object(&$2, &$1, &$3, &$4 CLS_CC); } ctor_arguments { do_end_new_object(&$4, &$3, &$6 CLS_CC); do_extended_fcall_end(CLS_C); $$ = $2;} + | rw_cvar T_PLUS_EQUAL expr { do_binary_assign_op(T_ASSIGN_ADD, &$$, &$1, &$3 CLS_CC); } + | rw_cvar T_MINUS_EQUAL expr { do_binary_assign_op(T_ASSIGN_SUB, &$$, &$1, &$3 CLS_CC); } + | rw_cvar T_MUL_EQUAL expr { do_binary_assign_op(T_ASSIGN_MUL, &$$, &$1, &$3 CLS_CC); } + | rw_cvar T_DIV_EQUAL expr { do_binary_assign_op(T_ASSIGN_DIV, &$$, &$1, &$3 CLS_CC); } + | rw_cvar T_CONCAT_EQUAL expr { do_binary_assign_op(T_ASSIGN_CONCAT, &$$, &$1, &$3 CLS_CC); } + | rw_cvar T_MOD_EQUAL expr { do_binary_assign_op(T_ASSIGN_MOD, &$$, &$1, &$3 CLS_CC); } + | rw_cvar T_AND_EQUAL expr { do_binary_assign_op(T_ASSIGN_BW_AND, &$$, &$1, &$3 CLS_CC); } + | rw_cvar T_OR_EQUAL expr { do_binary_assign_op(T_ASSIGN_BW_OR, &$$, &$1, &$3 CLS_CC); } + | rw_cvar XT_OR_EQUAL expr { do_binary_assign_op(T_ASSIGN_BW_XOR, &$$, &$1, &$3 CLS_CC); } + | rw_cvar T_SL_EQUAL expr { do_binary_assign_op(T_ASSIGN_SL, &$$, &$1, &$3 CLS_CC); } + | rw_cvar T_SR_EQUAL expr { do_binary_assign_op(T_ASSIGN_SR, &$$, &$1, &$3 CLS_CC); } + | rw_cvar T_INC { do_post_incdec(&$$, &$1, ZEND_POST_INC CLS_CC); } + | T_INC rw_cvar { do_pre_incdec(&$$, &$2, ZEND_PRE_INC CLS_CC); } + | rw_cvar T_DEC { do_post_incdec(&$$, &$1, ZEND_POST_DEC CLS_CC); } + | T_DEC rw_cvar { do_pre_incdec(&$$, &$2, ZEND_PRE_DEC CLS_CC); } + | expr T_BOOLEAN_OR { do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); } + | expr T_BOOLEAN_AND { do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); } + | expr T_LOGICAL_OR { do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); } + | expr T_LOGICAL_AND { do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); } + | expr T_LOGICAL_XOR expr { do_binary_op(ZEND_BOOL_XOR, &$$, &$1, &$3 CLS_CC); } | expr '|' expr { do_binary_op(ZEND_BW_OR, &$$, &$1, &$3 CLS_CC); } | expr '&' expr { do_binary_op(ZEND_BW_AND, &$$, &$1, &$3 CLS_CC); } | expr '^' expr { do_binary_op(ZEND_BW_XOR, &$$, &$1, &$3 CLS_CC); } @@ -375,43 +372,43 @@ expr_without_variable: | expr '*' expr { do_binary_op(ZEND_MUL,&$$,&$1,&$3 CLS_CC); } | expr '/' expr { do_binary_op(ZEND_DIV,&$$,&$1,&$3 CLS_CC); } | expr '%' expr { do_binary_op(ZEND_MOD,&$$,&$1,&$3 CLS_CC); } - | expr SHIFT_LEFT expr { do_binary_op(ZEND_SL, &$$, &$1, &$3 CLS_CC); } - | expr SHIFT_RIGHT expr { do_binary_op(ZEND_SR, &$$, &$1, &$3 CLS_CC); } + | expr T_SL expr { do_binary_op(ZEND_SL, &$$, &$1, &$3 CLS_CC); } + | expr T_SR expr { do_binary_op(ZEND_SR, &$$, &$1, &$3 CLS_CC); } | '+' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; $1.u.constant.refcount=1; do_binary_op(ZEND_ADD, &$$, &$1, &$2 CLS_CC); } | '-' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; $1.u.constant.refcount=1; do_binary_op(ZEND_SUB, &$$, &$1, &$2 CLS_CC); } | '!' expr { do_unary_op(ZEND_BOOL_NOT, &$$, &$2 CLS_CC); } | '~' expr { do_unary_op(ZEND_BW_NOT, &$$, &$2 CLS_CC); } - | expr IS_EQUAL expr { do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 CLS_CC); } - | expr IS_NOT_EQUAL expr { do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 CLS_CC); } + | expr T_IS_EQUAL expr { do_binary_op(ZEND_T_IS_EQUAL, &$$, &$1, &$3 CLS_CC); } + | expr T_IS_NOT_EQUAL expr { do_binary_op(ZEND_T_IS_NOT_EQUAL, &$$, &$1, &$3 CLS_CC); } | expr '<' expr { do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 CLS_CC); } - | expr IS_SMALLER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 CLS_CC); } + | expr T_IS_SMALLER_OR_EQUAL expr { do_binary_op(ZEND_T_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 CLS_CC); } | expr '>' expr { do_binary_op(ZEND_IS_SMALLER, &$$, &$3, &$1 CLS_CC); } - | expr IS_GREATER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 CLS_CC); } + | expr T_IS_GREATER_OR_EQUAL expr { do_binary_op(ZEND_T_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 CLS_CC); } | '(' expr ')' { $$ = $2; } | expr '?' { do_begin_qm_op(&$1, &$2 CLS_CC); } expr ':' { do_qm_true(&$4, &$2, &$5 CLS_CC); } expr { do_qm_false(&$$, &$7, &$2, &$5 CLS_CC); } - | STRING '(' { do_extended_fcall_begin(CLS_C); do_begin_function_call(&$1 CLS_CC); } + | T_STRING '(' { do_extended_fcall_begin(CLS_C); do_begin_function_call(&$1 CLS_CC); } function_call_parameter_list ')' { do_end_function_call(&$1, &$$, &$4, 0 CLS_CC); do_extended_fcall_end(CLS_C); } | r_cvar '(' { do_extended_fcall_begin(CLS_C); do_begin_dynamic_function_call(&$1 CLS_CC); } function_call_parameter_list ')' { do_end_function_call(&$1, &$$, &$4, 0 CLS_CC); do_extended_fcall_end(CLS_C);} - | STRING T_PAAMAYIM_NEKUDOTAYIM STRING '(' { do_extended_fcall_begin(CLS_C); do_begin_class_member_function_call(&$1, &$3 CLS_CC); } + | T_STRING T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { do_extended_fcall_begin(CLS_C); do_begin_class_member_function_call(&$1, &$3 CLS_CC); } function_call_parameter_list ')' { do_end_function_call(&$3, &$$, &$6, 1 CLS_CC); do_extended_fcall_end(CLS_C);} | internal_functions_in_yacc { $$ = $1; } - | INT_CAST expr { do_cast(&$$, &$2, IS_LONG CLS_CC); } - | DOUBLE_CAST expr { do_cast(&$$, &$2, IS_DOUBLE CLS_CC); } - | STRING_CAST expr { do_cast(&$$, &$2, IS_STRING CLS_CC); } - | ARRAY_CAST expr { do_cast(&$$, &$2, IS_ARRAY CLS_CC); } - | OBJECT_CAST expr { do_cast(&$$, &$2, IS_OBJECT CLS_CC); } + | T_INT_CAST expr { do_cast(&$$, &$2, IS_LONG CLS_CC); } + | T_DOUBLE_CAST expr { do_cast(&$$, &$2, IS_DOUBLE CLS_CC); } + | T_STRING_CAST expr { do_cast(&$$, &$2, IS_STRING CLS_CC); } + | T_ARRAY_CAST expr { do_cast(&$$, &$2, IS_ARRAY CLS_CC); } + | T_OBJECT_CAST expr { do_cast(&$$, &$2, IS_OBJECT CLS_CC); } | T_EXIT exit_expr { do_exit(&$$, &$2 CLS_CC); } | '@' { do_begin_silence(&$1 CLS_CC); } expr { do_end_silence(&$1 CLS_CC); $$ = $3; } | scalar { $$ = $1; } - | ZEND_ARRAY '(' array_pair_list ')' { $$ = $3; } + | T_ARRAY '(' array_pair_list ')' { $$ = $3; } | '`' encaps_list '`' { do_shell_exec(&$$, &$2 CLS_CC); } - | ZEND_PRINT expr { do_print(&$$, &$2 CLS_CC); } + | T_PRINT expr { do_print(&$$, &$2 CLS_CC); } ; @@ -429,36 +426,36 @@ ctor_arguments: class_name: - STRING { $$ = $1; } + T_STRING { $$ = $1; } | r_cvar { $$ = $1; } ; common_scalar: - LNUMBER { $$=$1; } - | DNUMBER { $$=$1; } - | CONSTANT_ENCAPSED_STRING { $$ = $1; } - | ZEND_LINE { $$ = $1; } - | ZEND_FILE { $$ = $1; } + T_LNUMBER { $$=$1; } + | T_DNUMBER { $$=$1; } + | T_CONSTANT_ENCAPSED_STRING { $$ = $1; } + | T_LINE { $$ = $1; } + | T_FILE { $$ = $1; } ; static_scalar: /* compile-time evaluated scalars */ common_scalar { $$ = $1; } - | STRING { do_fetch_constant(&$$, &$1, ZEND_CT CLS_CC); } + | T_STRING { do_fetch_constant(&$$, &$1, ZEND_CT CLS_CC); } | '+' static_scalar { $$ = $1; } | '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one); $$ = $2; } - | ZEND_ARRAY '(' static_array_pair_list ')' { $$ = $3; } + | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; } ; scalar: - STRING { do_fetch_constant(&$$, &$1, ZEND_RT CLS_CC); } + T_STRING { do_fetch_constant(&$$, &$1, ZEND_RT CLS_CC); } | common_scalar { $$ = $1; } | '"' encaps_list '"' { $$ = $2; } | '\'' encaps_list '\'' { $$ = $2; } - | ZEND_HEREDOC encaps_list ZEND_HEREDOC { $$ = $2; do_end_heredoc(CLS_C); } + | T_HEREDOC encaps_list T_HEREDOC { $$ = $2; do_end_heredoc(CLS_C); } ; @@ -469,9 +466,9 @@ static_array_pair_list: non_empty_static_array_pair_list: - non_empty_static_array_pair_list ',' static_scalar ZEND_DOUBLE_ARROW static_scalar { do_add_static_array_element(&$$, &$3, &$5); } + non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { do_add_static_array_element(&$$, &$3, &$5); } | non_empty_static_array_pair_list ',' static_scalar { do_add_static_array_element(&$$, &$3, NULL); } - | static_scalar ZEND_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; array_init(&$$.u.constant); do_add_static_array_element(&$$, &$1, &$3); } + | static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; array_init(&$$.u.constant); do_add_static_array_element(&$$, &$1, &$3); } | static_scalar { $$.op_type = IS_CONST; $$.u.constant.refcount=1; $$.u.constant.is_ref=0; array_init(&$$.u.constant); do_add_static_array_element(&$$, &$1, NULL); } ; @@ -499,7 +496,7 @@ rw_cvar: cvar: cvar_without_objects { $$ = $1; } - | cvar_without_objects ZEND_OBJECT_OPERATOR { do_push_object(&$1 CLS_CC); } ref_list { $$ = $4; } + | cvar_without_objects T_OBJECT_OPERATOR { do_push_object(&$1 CLS_CC); } ref_list { $$ = $4; } ; @@ -516,7 +513,7 @@ reference_variable: compound_variable: - VARIABLE { $$ = $1; } + T_VARIABLE { $$ = $1; } | '$' '{' expr '}' { $$ = $3; } ; @@ -535,7 +532,7 @@ dim_offset: ref_list: object_property { $$ = $1; } - | ref_list ZEND_OBJECT_OPERATOR { do_push_object(&$1 CLS_CC); } object_property { $$ = $4; } + | ref_list T_OBJECT_OPERATOR { do_push_object(&$1 CLS_CC); } object_property { $$ = $4; } ; object_property: @@ -544,7 +541,7 @@ object_property: ; scalar_object_property: - STRING { $$ = $1; } + T_STRING { $$ = $1; } | '{' expr '}' { $$ = $2; } | cvar_without_objects { do_end_variable_parse(BP_VAR_R CLS_CC); $$ = $1; } ; @@ -552,7 +549,7 @@ scalar_object_property: object_dim_list: object_dim_list ']' '[' expr { fetch_array_dim(&$$, &$1, &$4 CLS_CC); } - | STRING { znode tmp_znode, res; do_pop_object(&tmp_znode CLS_CC); do_fetch_property(&res, &tmp_znode, &$1 CLS_CC); $1 = res; } '[' expr { fetch_array_dim(&$$, &$1, &$4 CLS_CC); } + | T_STRING { znode tmp_znode, res; do_pop_object(&tmp_znode CLS_CC); do_fetch_property(&res, &tmp_znode, &$1 CLS_CC); $1 = res; } '[' expr { fetch_array_dim(&$$, &$1, &$4 CLS_CC); } ; @@ -569,7 +566,7 @@ assignment_list: assignment_list_element: w_cvar { do_add_list_element(&$1 CLS_CC); } - | ZEND_LIST '(' { do_new_list_begin(CLS_C); } assignment_list ')' { do_new_list_end(CLS_C); } + | T_LIST '(' { do_new_list_begin(CLS_C); } assignment_list ')' { do_new_list_end(CLS_C); } | /* empty */ { do_add_list_element(NULL CLS_CC); } ; @@ -580,25 +577,25 @@ array_pair_list: ; non_empty_array_pair_list: - non_empty_array_pair_list ',' expr ZEND_DOUBLE_ARROW expr { do_add_array_element(&$$, &$5, &$3 CLS_CC); } + non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { do_add_array_element(&$$, &$5, &$3 CLS_CC); } | non_empty_array_pair_list ',' expr { do_add_array_element(&$$, &$3, NULL CLS_CC); } - | expr ZEND_DOUBLE_ARROW expr { do_init_array(&$$, &$3, &$1 CLS_CC); } + | expr T_DOUBLE_ARROW expr { do_init_array(&$$, &$3, &$1 CLS_CC); } | expr { do_init_array(&$$, &$1, NULL CLS_CC); } ; encaps_list: encaps_list encaps_var { do_end_variable_parse(BP_VAR_R CLS_CC); do_add_variable(&$$, &$1, &$2 CLS_CC); } - | encaps_list STRING { do_add_string(&$$, &$1, &$2 CLS_CC); } - | encaps_list NUM_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); } - | encaps_list ENCAPSED_AND_WHITESPACE { do_add_string(&$$, &$1, &$2 CLS_CC); } - | encaps_list CHARACTER { do_add_char(&$$, &$1, &$2 CLS_CC); } - | encaps_list BAD_CHARACTER { do_add_char(&$$, &$1, &$2 CLS_CC); } + | encaps_list T_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); } + | encaps_list T_NUM_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); } + | encaps_list T_ENCAPSED_AND_WHITESPACE { do_add_string(&$$, &$1, &$2 CLS_CC); } + | encaps_list T_CHARACTER { do_add_char(&$$, &$1, &$2 CLS_CC); } + | encaps_list T_BAD_CHARACTER { do_add_char(&$$, &$1, &$2 CLS_CC); } | encaps_list '[' { $2.u.constant.value.chval = '['; do_add_char(&$$, &$1, &$2 CLS_CC); } | encaps_list ']' { $2.u.constant.value.chval = ']'; do_add_char(&$$, &$1, &$2 CLS_CC); } | encaps_list '{' { $2.u.constant.value.chval = '{'; do_add_char(&$$, &$1, &$2 CLS_CC); } | encaps_list '}' { $2.u.constant.value.chval = '}'; do_add_char(&$$, &$1, &$2 CLS_CC); } - | encaps_list ZEND_OBJECT_OPERATOR { znode tmp; $2.u.constant.value.chval = '-'; do_add_char(&tmp, &$1, &$2 CLS_CC); $2.u.constant.value.chval = '>'; do_add_char(&$$, &tmp, &$2 CLS_CC); } + | encaps_list T_OBJECT_OPERATOR { znode tmp; $2.u.constant.value.chval = '-'; do_add_char(&tmp, &$1, &$2 CLS_CC); $2.u.constant.value.chval = '>'; do_add_char(&$$, &tmp, &$2 CLS_CC); } | /* empty */ { do_init_string(&$$ CLS_CC); } ; @@ -606,27 +603,27 @@ encaps_list: encaps_var: - VARIABLE { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); } - | VARIABLE '[' { do_begin_variable_parse(CLS_C); } encaps_var_offset ']' { do_fetch_globals(&$1 CLS_CC); fetch_array_begin(&$$, &$1, &$4 CLS_CC); } - | VARIABLE ZEND_OBJECT_OPERATOR STRING { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$2, &$1, 1 CLS_CC); do_fetch_property(&$$, &$2, &$3 CLS_CC); } - | DOLLAR_OPEN_CURLY_BRACES expr '}' { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$2, 1 CLS_CC); } - | DOLLAR_OPEN_CURLY_BRACES STRING '[' expr ']' '}' { do_begin_variable_parse(CLS_C); fetch_array_begin(&$$, &$2, &$4 CLS_CC); } + T_VARIABLE { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); } + | T_VARIABLE '[' { do_begin_variable_parse(CLS_C); } encaps_var_offset ']' { do_fetch_globals(&$1 CLS_CC); fetch_array_begin(&$$, &$1, &$4 CLS_CC); } + | T_VARIABLE T_OBJECT_OPERATOR T_STRING { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$2, &$1, 1 CLS_CC); do_fetch_property(&$$, &$2, &$3 CLS_CC); } + | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$2, 1 CLS_CC); } + | T_DOLLAR_OPEN_CURLY_BRACES T_STRING '[' expr ']' '}' { do_begin_variable_parse(CLS_C); fetch_array_begin(&$$, &$2, &$4 CLS_CC); } | T_CURLY_OPEN cvar '}' { $$ = $2; } ; encaps_var_offset: - STRING { $$ = $1; } - | NUM_STRING { $$ = $1; } - | VARIABLE { fetch_simple_variable(&$$, &$1, 1 CLS_CC); } + T_STRING { $$ = $1; } + | T_NUM_STRING { $$ = $1; } + | T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 CLS_CC); } ; internal_functions_in_yacc: T_ISSET '(' cvar ')' { do_isset_or_isempty(ZEND_ISSET, &$$, &$3 CLS_CC); } | T_EMPTY '(' cvar ')' { do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 CLS_CC); } - | INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); } - | EVAL '(' expr ')' { do_include_or_eval(ZEND_EVAL, &$$, &$3 CLS_CC); } + | T_INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); } + | T_EVAL '(' expr ')' { do_include_or_eval(ZEND_EVAL, &$$, &$3 CLS_CC); } ; diff --git a/Zend/zend-scanner.l b/Zend/zend-scanner.l index 563807f4b0..2c0ca69944 100644 --- a/Zend/zend-scanner.l +++ b/Zend/zend-scanner.l @@ -435,59 +435,59 @@ TLS_VARS; } <IN_SCRIPTING>"old_function" { - return OLD_FUNCTION; + return T_OLD_FUNCTION; } <IN_SCRIPTING>"function"|"cfunction" { - return FUNCTION; + return T_FUNCTION; } <IN_SCRIPTING>"const" { - return ZEND_CONST; + return T_CONST; } <IN_SCRIPTING>"return" { - return RETURN; + return T_RETURN; } <IN_SCRIPTING>"if" { - return IF; + return T_IF; } <IN_SCRIPTING>"elseif" { - return ELSEIF; + return T_ELSEIF; } <IN_SCRIPTING>"endif" { - return ENDIF; + return T_ENDIF; } <IN_SCRIPTING>"else" { - return ELSE; + return T_ELSE; } <IN_SCRIPTING>"while" { - return WHILE; + return T_WHILE; } <IN_SCRIPTING>"endwhile" { - return ENDWHILE; + return T_ENDWHILE; } <IN_SCRIPTING>"do" { - return DO; + return T_DO; } <IN_SCRIPTING>"for" { - return FOR; + return T_FOR; } <IN_SCRIPTING>"endfor" { - return ENDFOR; + return T_ENDFOR; } <IN_SCRIPTING>"foreach" { - return ZEND_FOREACH; + return T_FOREACH; } <IN_SCRIPTING>"endforeach" { @@ -495,52 +495,52 @@ TLS_VARS; } <IN_SCRIPTING>"as" { - return ZEND_AS; + return T_AS; } <IN_SCRIPTING>"switch" { - return SWITCH; + return T_SWITCH; } <IN_SCRIPTING>"endswitch" { - return ENDSWITCH; + return T_ENDSWITCH; } <IN_SCRIPTING>"case" { - return CASE; + return T_CASE; } <IN_SCRIPTING>"default" { - return DEFAULT; + return T_DEFAULT; } <IN_SCRIPTING>"break" { - return BREAK; + return T_BREAK; } <IN_SCRIPTING>"continue" { - return CONTINUE; + return T_CONTINUE; } <IN_SCRIPTING>"echo" { - return ZEND_ECHO; + return T_ECHO; } <IN_SCRIPTING>"print" { - return ZEND_PRINT; + return T_PRINT; } <IN_SCRIPTING>"class" { - return CLASS; + return T_CLASS; } <IN_SCRIPTING>"extends" { - return EXTENDS; + return T_EXTENDS; } <IN_SCRIPTING,DOUBLE_QUOTES,BACKQUOTE,HEREDOC>"->" { yy_push_state(LOOKING_FOR_PROPERTY); - return ZEND_OBJECT_OPERATOR; + return T_OBJECT_OPERATOR; } <LOOKING_FOR_PROPERTY>{LABEL} { @@ -548,7 +548,7 @@ TLS_VARS; zendlval->value.str.val = (char *)estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return STRING; + return T_STRING; } <LOOKING_FOR_PROPERTY>. { @@ -561,47 +561,47 @@ TLS_VARS; } <IN_SCRIPTING>"new" { - return NEW; + return T_NEW; } <IN_SCRIPTING>"var" { - return VAR; + return T_VAR; } <IN_SCRIPTING>"("{TABS_AND_SPACES}("int"|"integer"){TABS_AND_SPACES}")" { - return INT_CAST; + return T_INT_CAST; } <IN_SCRIPTING>"("{TABS_AND_SPACES}("real"|"double"|"float"){TABS_AND_SPACES}")" { - return DOUBLE_CAST; + return T_DOUBLE_CAST; } <IN_SCRIPTING>"("{TABS_AND_SPACES}"string"{TABS_AND_SPACES}")" { - return STRING_CAST; + return T_STRING_CAST; } <IN_SCRIPTING>"("{TABS_AND_SPACES}"array"{TABS_AND_SPACES}")" { - return ARRAY_CAST; + return T_ARRAY_CAST; } <IN_SCRIPTING>"("{TABS_AND_SPACES}"object"{TABS_AND_SPACES}")" { - return OBJECT_CAST; + return T_OBJECT_CAST; } <IN_SCRIPTING>"eval" { - return EVAL; + return T_EVAL; } <IN_SCRIPTING>"include" { - return INCLUDE; + return T_INCLUDE; } <IN_SCRIPTING>"require" { - return REQUIRE; + return T_REQUIRE; } <IN_SCRIPTING>"global" { - return ZEND_GLOBAL; + return T_GLOBAL; } <IN_SCRIPTING>"isset" { @@ -613,120 +613,120 @@ TLS_VARS; } <IN_SCRIPTING>"static" { - return ZEND_STATIC; + return T_STATIC; } <IN_SCRIPTING>"unset" { - return ZEND_UNSET; + return T_UNSET; } <IN_SCRIPTING>"=>" { - return ZEND_DOUBLE_ARROW; + return T_DOUBLE_ARROW; } <IN_SCRIPTING>"list" { - return ZEND_LIST; + return T_LIST; } <IN_SCRIPTING>"array" { - return ZEND_ARRAY; + return T_ARRAY; } <IN_SCRIPTING>"++" { - return INCREMENT; + return T_INC; } <IN_SCRIPTING>"--" { - return DECREMENT; + return T_DEC; } <IN_SCRIPTING>"==" { - return IS_EQUAL; + return T_IS_EQUAL; } <IN_SCRIPTING>"!="|"<>" { - return IS_NOT_EQUAL; + return T_IS_NOT_EQUAL; } <IN_SCRIPTING>"<=" { - return IS_SMALLER_OR_EQUAL; + return T_IS_SMALLER_OR_EQUAL; } <IN_SCRIPTING>">=" { - return IS_GREATER_OR_EQUAL; + return T_IS_GREATER_OR_EQUAL; } <IN_SCRIPTING>"+=" { - return PLUS_EQUAL; + return T_PLUS_EQUAL; } <IN_SCRIPTING>"-=" { - return MINUS_EQUAL; + return T_MINUS_EQUAL; } <IN_SCRIPTING>"*=" { - return MUL_EQUAL; + return T_MUL_EQUAL; } <IN_SCRIPTING>"/=" { - return DIV_EQUAL; + return T_DIV_EQUAL; } <IN_SCRIPTING>".=" { - return CONCAT_EQUAL; + return T_CONCAT_EQUAL; } <IN_SCRIPTING>"%=" { - return MOD_EQUAL; + return T_MOD_EQUAL; } <IN_SCRIPTING>"<<=" { - return SHIFT_LEFT_EQUAL; + return T_SL_EQUAL; } <IN_SCRIPTING>">>=" { - return SHIFT_RIGHT_EQUAL; + return T_SR_EQUAL; } <IN_SCRIPTING>"&=" { - return AND_EQUAL; + return T_AND_EQUAL; } <IN_SCRIPTING>"|=" { - return OR_EQUAL; + return T_OR_EQUAL; } <IN_SCRIPTING>"^=" { - return XOR_EQUAL; + return XT_OR_EQUAL; } <IN_SCRIPTING>"||" { - return BOOLEAN_OR; + return T_BOOLEAN_OR; } <IN_SCRIPTING>"&&" { - return BOOLEAN_AND; + return T_BOOLEAN_AND; } <IN_SCRIPTING>"OR" { - return LOGICAL_OR; + return T_LOGICAL_OR; } <IN_SCRIPTING>"AND" { - return LOGICAL_AND; + return T_LOGICAL_AND; } <IN_SCRIPTING>"XOR" { - return LOGICAL_XOR; + return T_LOGICAL_XOR; } <IN_SCRIPTING>"<<" { - return SHIFT_LEFT; + return T_SL; } <IN_SCRIPTING>">>" { - return SHIFT_RIGHT; + return T_SR; } <IN_SCRIPTING>{TOKENS} { @@ -742,7 +742,7 @@ TLS_VARS; <DOUBLE_QUOTES,BACKQUOTE,HEREDOC>"${" { yy_push_state(IN_SCRIPTING); - return DOLLAR_OPEN_CURLY_BRACES; + return T_DOLLAR_OPEN_CURLY_BRACES; } @@ -759,10 +759,10 @@ TLS_VARS; if (errno == ERANGE) { /* overflow */ zendlval->value.dval = strtod(yytext,NULL); zendlval->type = IS_DOUBLE; - return DNUMBER; + return T_DNUMBER; } else { zendlval->type = IS_LONG; - return LNUMBER; + return T_LNUMBER; } } @@ -770,19 +770,19 @@ TLS_VARS; zendlval->value.str.val = (char *)estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return NUM_STRING; + return T_NUM_STRING; } <IN_SCRIPTING>{DNUM}|{EXPONENT_DNUM} { zendlval->value.dval = strtod(yytext,NULL); zendlval->type = IS_DOUBLE; - return DNUMBER; + return T_DNUMBER; } <IN_SCRIPTING>"__LINE__" { zendlval->value.lval = CG(zend_lineno); zendlval->type = IS_LONG; - return ZEND_LINE; + return T_LINE; } <IN_SCRIPTING>"__FILE__" { @@ -791,7 +791,7 @@ TLS_VARS; zendlval->value.str.len = strlen(filename); zendlval->value.str.val = estrndup(filename,zendlval->value.str.len); zendlval->type = IS_STRING; - return ZEND_FILE; + return T_FILE; } @@ -800,7 +800,7 @@ TLS_VARS; zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; HANDLE_NEWLINES(yytext,yyleng); - return INLINE_HTML; + return T_INLINE_HTML; } <INITIAL>"<?"|"<script"{WHITESPACE}+"language"{WHITESPACE}*"="{WHITESPACE}*("php"|"\"php\""|"\'php\'"){WHITESPACE}*">" { @@ -810,12 +810,12 @@ TLS_VARS; zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; BEGIN(IN_SCRIPTING); - return PHP_OPEN_TAG; + return T_OPEN_TAG; } else { zendlval->value.str.val = (char *) estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return INLINE_HTML; + return T_INLINE_HTML; } } @@ -827,12 +827,12 @@ TLS_VARS; zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; BEGIN(IN_SCRIPTING); - return PHP_OPEN_TAG_WITH_ECHO; + return T_OPEN_TAG_WITH_ECHO; } else { zendlval->value.str.val = (char *) estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return INLINE_HTML; + return T_INLINE_HTML; } } @@ -848,7 +848,7 @@ TLS_VARS; zendlval->value.str.val = (char *) estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return INLINE_HTML; + return T_INLINE_HTML; } } @@ -859,7 +859,7 @@ TLS_VARS; zendlval->type = IS_STRING; HANDLE_NEWLINE(yytext[yyleng-1]); BEGIN(IN_SCRIPTING); - return PHP_OPEN_TAG; + return T_OPEN_TAG; } @@ -873,7 +873,7 @@ TLS_VARS; zendlval->value.str.val = (char *)estrndup(yytext+1, yyleng-1); zendlval->value.str.len = yyleng-1; zendlval->type = IS_STRING; - return VARIABLE; + return T_VARIABLE; } @@ -881,7 +881,7 @@ TLS_VARS; zendlval->value.str.val = (char *)estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return STRING; + return T_STRING; } @@ -889,7 +889,7 @@ TLS_VARS; zendlval->value.str.val = (char *)estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return STRING; + return T_STRING; } @@ -904,12 +904,12 @@ TLS_VARS; <IN_SCRIPTING>([#]|"//")([^\n\r?]|"?"[^>\n\r])*("?\n"|"?\r\n")? { /* eat one line comments */ HANDLE_NEWLINE(yytext[yyleng-1]); - return ZEND_COMMENT; + return T_COMMENT; } <IN_SCRIPTING>"/*"([^*]|"*"[^/])*(("*/")?) { HANDLE_NEWLINES(yytext, yyleng); - return ZEND_COMMENT; + return T_COMMENT; } @@ -919,7 +919,7 @@ TLS_VARS; zendlval->type = IS_STRING; HANDLE_NEWLINES(yytext, yyleng); BEGIN(INITIAL); - return PHP_CLOSE_TAG; /* implicit ';' at php-end tag */ + return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } @@ -930,9 +930,9 @@ TLS_VARS; HANDLE_NEWLINES(yytext,yyleng); if (CG(asp_tags)) { BEGIN(INITIAL); - return PHP_CLOSE_TAG; /* implicit ';' at php-end tag */ + return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } else { - return INLINE_HTML; + return T_INLINE_HTML; } } @@ -989,7 +989,7 @@ TLS_VARS; } *t = 0; - return CONSTANT_ENCAPSED_STRING; + return T_CONSTANT_ENCAPSED_STRING; } @@ -1009,7 +1009,7 @@ TLS_VARS; } CG(heredoc) = estrndup(s, CG(heredoc_len)); BEGIN(HEREDOC); - return ZEND_HEREDOC; + return T_HEREDOC; } @@ -1050,12 +1050,12 @@ TLS_VARS; CG(heredoc)=NULL; CG(heredoc_len)=0; BEGIN(IN_SCRIPTING); - return ZEND_HEREDOC; + return T_HEREDOC; } else { zendlval->value.str.val = (char *)estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return STRING; + return T_STRING; } } @@ -1065,7 +1065,7 @@ TLS_VARS; zendlval->value.str.val = (char *) estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return ENCAPSED_AND_WHITESPACE; + return T_ENCAPSED_AND_WHITESPACE; } <SINGLE_QUOTE>([^'\\]|\\[^'\\])+ { @@ -1073,7 +1073,7 @@ TLS_VARS; zendlval->value.str.val = (char *) estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return ENCAPSED_AND_WHITESPACE; + return T_ENCAPSED_AND_WHITESPACE; } @@ -1081,7 +1081,7 @@ TLS_VARS; zendlval->value.str.val = (char *) estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return ENCAPSED_AND_WHITESPACE; + return T_ENCAPSED_AND_WHITESPACE; } @@ -1089,7 +1089,7 @@ TLS_VARS; zendlval->value.str.val = (char *) estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return ENCAPSED_AND_WHITESPACE; + return T_ENCAPSED_AND_WHITESPACE; } @@ -1100,7 +1100,7 @@ TLS_VARS; yytext[1] = 0; yyleng--; } - return CHARACTER; + return T_CHARACTER; } @@ -1118,32 +1118,32 @@ TLS_VARS; <SINGLE_QUOTE>"\\'" { zendlval->value.chval='\''; - return CHARACTER; + return T_CHARACTER; } <SINGLE_QUOTE>"\\\\" { zendlval->value.chval='\\'; - return CHARACTER; + return T_CHARACTER; } <DOUBLE_QUOTES>"\\\"" { zendlval->value.chval='"'; - return CHARACTER; + return T_CHARACTER; } <BACKQUOTE>"\\`" { zendlval->value.chval='`'; - return CHARACTER; + return T_CHARACTER; } <DOUBLE_QUOTES,BACKQUOTE,HEREDOC>"\\"[0-7]{1,3} { zendlval->value.chval = (char) strtol (yytext+1, NULL, 8); - return CHARACTER; + return T_CHARACTER; } <DOUBLE_QUOTES,BACKQUOTE,HEREDOC>"\\x"[0-9A-Fa-f]{1,2} { zendlval->value.chval = (char) strtol (yytext+2, NULL, 16); - return CHARACTER; + return T_CHARACTER; } <DOUBLE_QUOTES,BACKQUOTE>"\\". { @@ -1170,16 +1170,16 @@ TLS_VARS; zendlval->value.str.val = estrndup(yytext,yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return BAD_CHARACTER; + return T_BAD_CHARACTER; break; } - return CHARACTER; + return T_CHARACTER; } <HEREDOC>"\\$"|"\\{" { zendlval->value.chval = yytext[1]; - return CHARACTER; + return T_CHARACTER; } @@ -1187,7 +1187,7 @@ TLS_VARS; zendlval->value.str.val = (char *) estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - return ENCAPSED_AND_WHITESPACE; + return T_ENCAPSED_AND_WHITESPACE; } diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 9aafb0c9a8..376254fea9 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -226,7 +226,7 @@ void do_print(znode *result, znode *arg CLS_DC) opline->result.op_type = IS_TMP_VAR; opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->opcode = ZEND_PRINT_OP; + opline->opcode = T_PRINT_OP; opline->op1 = *arg; SET_UNUSED(opline->op2); *result = opline->result; @@ -237,7 +237,7 @@ void do_echo(znode *arg CLS_DC) { zend_op *opline = get_next_op(CG(active_op_array) CLS_CC); - opline->opcode = ZEND_ECHO_OP; + opline->opcode = T_ECHO_OP; opline->op1 = *arg; SET_UNUSED(opline->op2); } @@ -247,7 +247,7 @@ void do_assign(znode *result, znode *variable, znode *value CLS_DC) { zend_op *opline = get_next_op(CG(active_op_array) CLS_CC); - opline->opcode = ZEND_ASSIGN; + opline->opcode = T_ASSIGN; opline->result.op_type = IS_VAR; opline->result.u.EA.type = 0; opline->result.u.var = get_temporary_variable(CG(active_op_array)); @@ -261,7 +261,7 @@ void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC) { zend_op *opline = get_next_op(CG(active_op_array) CLS_CC); - opline->opcode = ZEND_ASSIGN_REF; + opline->opcode = T_ASSIGN_REF; if (result) { opline->result.op_type = IS_VAR; opline->result.u.EA.type = 0; @@ -1537,11 +1537,11 @@ void do_unset(znode *variable CLS_DC) switch (last_op->opcode) { case ZEND_FETCH_R: - last_op->opcode = ZEND_UNSET_VAR; + last_op->opcode = T_UNSET_VAR; break; case ZEND_FETCH_DIM_R: case ZEND_FETCH_OBJ_R: - last_op->opcode = ZEND_UNSET_DIM_OBJ; + last_op->opcode = T_UNSET_DIM_OBJ; break; } @@ -1830,16 +1830,16 @@ int zendlex(znode *zendlval CLS_DC) zendlval->u.constant.type = IS_LONG; retval = lex_scan(&zendlval->u.constant CLS_CC); switch(retval) { - case ZEND_COMMENT: - case PHP_OPEN_TAG: + case T_COMMENT: + case T_OPEN_TAG: case T_WHITESPACE: retval = zendlex(zendlval CLS_CC); break; - case PHP_CLOSE_TAG: + case T_CLOSE_TAG: retval = ';'; /* implicit ; */ break; - case PHP_OPEN_TAG_WITH_ECHO: - retval = ZEND_ECHO; + case T_OPEN_TAG_WITH_ECHO: + retval = T_ECHO; break; } diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 1265a608a0..15539e7a68 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -361,35 +361,35 @@ int zendlex(znode *zendlval CLS_DC); #define ZEND_BW_NOT 12 #define ZEND_BOOL_NOT 13 #define ZEND_BOOL_XOR 14 -#define ZEND_IS_EQUAL 15 -#define ZEND_IS_NOT_EQUAL 16 +#define ZEND_T_IS_EQUAL 15 +#define ZEND_T_IS_NOT_EQUAL 16 #define ZEND_IS_SMALLER 17 -#define ZEND_IS_SMALLER_OR_EQUAL 18 +#define ZEND_T_IS_SMALLER_OR_EQUAL 18 #define ZEND_CAST 19 #define ZEND_QM_ASSIGN 20 -#define ZEND_ASSIGN_ADD 21 -#define ZEND_ASSIGN_SUB 22 -#define ZEND_ASSIGN_MUL 23 -#define ZEND_ASSIGN_DIV 24 -#define ZEND_ASSIGN_MOD 25 -#define ZEND_ASSIGN_SL 26 -#define ZEND_ASSIGN_SR 27 -#define ZEND_ASSIGN_CONCAT 28 -#define ZEND_ASSIGN_BW_OR 29 -#define ZEND_ASSIGN_BW_AND 30 -#define ZEND_ASSIGN_BW_XOR 31 +#define T_ASSIGN_ADD 21 +#define T_ASSIGN_SUB 22 +#define T_ASSIGN_MUL 23 +#define T_ASSIGN_DIV 24 +#define T_ASSIGN_MOD 25 +#define T_ASSIGN_SL 26 +#define T_ASSIGN_SR 27 +#define T_ASSIGN_CONCAT 28 +#define T_ASSIGN_BW_OR 29 +#define T_ASSIGN_BW_AND 30 +#define T_ASSIGN_BW_XOR 31 #define ZEND_PRE_INC 32 #define ZEND_PRE_DEC 33 #define ZEND_POST_INC 34 #define ZEND_POST_DEC 35 -#define ZEND_ASSIGN 36 -#define ZEND_ASSIGN_REF 37 +#define T_ASSIGN 36 +#define T_ASSIGN_REF 37 -#define ZEND_ECHO_OP 38 -#define ZEND_PRINT_OP 39 +#define T_ECHO_OP 38 +#define T_PRINT_OP 39 #define ZEND_JMP 40 #define ZEND_JMPZ 41 @@ -431,8 +431,8 @@ int zendlex(znode *zendlval CLS_DC); #define ZEND_INCLUDE_OR_EVAL 70 -#define ZEND_UNSET_VAR 71 -#define ZEND_UNSET_DIM_OBJ 72 +#define T_UNSET_VAR 71 +#define T_UNSET_DIM_OBJ 72 #define ZEND_ISSET_ISEMPTY 73 #define ZEND_FE_RESET 74 diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 165902b696..873fb9e45b 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -882,16 +882,16 @@ void execute(zend_op_array *op_array ELS_DC) case ZEND_CONCAT: binary_op = concat_function; goto binary_op_addr; - case ZEND_IS_EQUAL: + case ZEND_T_IS_EQUAL: binary_op = is_equal_function; goto binary_op_addr; - case ZEND_IS_NOT_EQUAL: + case ZEND_T_IS_NOT_EQUAL: binary_op = is_not_equal_function; goto binary_op_addr; case ZEND_IS_SMALLER: binary_op = is_smaller_function; goto binary_op_addr; - case ZEND_IS_SMALLER_OR_EQUAL: + case ZEND_T_IS_SMALLER_OR_EQUAL: binary_op = is_smaller_or_equal_function; goto binary_op_addr; case ZEND_BW_OR: @@ -921,37 +921,37 @@ binary_op_addr: FREE_OP(&opline->op1, free_op1); break; - case ZEND_ASSIGN_ADD: + case T_ASSIGN_ADD: binary_op = add_function; goto binary_assign_op_addr; - case ZEND_ASSIGN_SUB: + case T_ASSIGN_SUB: binary_op = sub_function; goto binary_assign_op_addr; - case ZEND_ASSIGN_MUL: + case T_ASSIGN_MUL: binary_op = mul_function; goto binary_assign_op_addr; - case ZEND_ASSIGN_DIV: + case T_ASSIGN_DIV: binary_op = div_function; goto binary_assign_op_addr; - case ZEND_ASSIGN_MOD: + case T_ASSIGN_MOD: binary_op = mod_function; goto binary_assign_op_addr; - case ZEND_ASSIGN_SL: + case T_ASSIGN_SL: binary_op = shift_left_function; goto binary_assign_op_addr; - case ZEND_ASSIGN_SR: + case T_ASSIGN_SR: binary_op = shift_right_function; goto binary_assign_op_addr; - case ZEND_ASSIGN_CONCAT: + case T_ASSIGN_CONCAT: binary_op = concat_function; goto binary_assign_op_addr; - case ZEND_ASSIGN_BW_OR: + case T_ASSIGN_BW_OR: binary_op = bitwise_or_function; goto binary_assign_op_addr; - case ZEND_ASSIGN_BW_AND: + case T_ASSIGN_BW_AND: binary_op = bitwise_and_function; goto binary_assign_op_addr; - case ZEND_ASSIGN_BW_XOR: + case T_ASSIGN_BW_XOR: binary_op = bitwise_xor_function; /* Fall through */ binary_assign_op_addr: { @@ -1030,13 +1030,13 @@ binary_assign_op_addr: { } } break; - case ZEND_PRINT_OP: + case T_PRINT_OP: zend_print_variable(get_zval_ptr(&opline->op1, Ts, &free_op1, BP_VAR_R)); Ts[opline->result.u.var].tmp_var.value.lval = 1; Ts[opline->result.u.var].tmp_var.type = IS_LONG; FREE_OP(&opline->op1, free_op1); break; - case ZEND_ECHO_OP: + case T_ECHO_OP: zend_print_variable(get_zval_ptr(&opline->op1, Ts, &free_op1, BP_VAR_R)); FREE_OP(&opline->op1, free_op1); break; @@ -1079,14 +1079,14 @@ binary_assign_op_addr: { case ZEND_FETCH_DIM_TMP_VAR: zend_fetch_dimension_address_from_tmp_var(&opline->result, &opline->op1, &opline->op2, Ts ELS_CC); break; - case ZEND_ASSIGN: { + case T_ASSIGN: { zval *value = get_zval_ptr(&opline->op2, Ts, &free_op2, BP_VAR_R); zend_assign_to_variable(&opline->result, &opline->op1, value, (free_op2?IS_TMP_VAR:opline->op2.op_type), Ts ELS_CC); /* zend_assign_to_variable() always takes care of op2, never free it! */ } break; - case ZEND_ASSIGN_REF: + case T_ASSIGN_REF: zend_assign_to_variable_reference(&opline->result, get_zval_ptr_ptr(&opline->op1, Ts, BP_VAR_W), get_zval_ptr_ptr(&opline->op2, Ts, BP_VAR_W), Ts ELS_CC); INC_AI_COUNT(&opline->result); break; @@ -1710,7 +1710,7 @@ send_by_ref: FREE_OP(&opline->op1, free_op1); } break; - case ZEND_UNSET_VAR: { + case T_UNSET_VAR: { zval tmp, *variable = get_zval_ptr(&opline->op1, Ts, &free_op1, BP_VAR_R); if (variable->type != IS_STRING) { @@ -1728,7 +1728,7 @@ send_by_ref: FREE_OP(&opline->op1, free_op1); } break; - case ZEND_UNSET_DIM_OBJ: { + case T_UNSET_DIM_OBJ: { zval **container = get_zval_ptr_ptr(&opline->op1, Ts, BP_VAR_R); zval *offset = get_zval_ptr(&opline->op2, Ts, &free_op2, BP_VAR_R); diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 765302e766..978341af15 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -14,8 +14,8 @@ +----------------------------------------------------------------------+ */ -#ifndef _ZEND_GLOBALS_H -#define _ZEND_GLOBALS_H +#ifndef _T_GLOBALS_H +#define _T_GLOBALS_H #include <setjmp.h> @@ -212,4 +212,4 @@ struct _zend_alloc_globals { }; -#endif /* _ZEND_GLOBALS_H */ +#endif /* _T_GLOBALS_H */ diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c index 542d1989f0..651c3a688e 100644 --- a/Zend/zend_highlight.c +++ b/Zend/zend_highlight.c @@ -78,19 +78,19 @@ void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini) token.type = 0; while ((token_type=lex_scan(&token CLS_CC))) { switch (token_type) { - case INLINE_HTML: + case T_INLINE_HTML: next_color = syntax_highlighter_ini->highlight_html; break; - case ZEND_COMMENT: + case T_COMMENT: next_color = syntax_highlighter_ini->highlight_comment; break; - case PHP_OPEN_TAG: + case T_OPEN_TAG: next_color = syntax_highlighter_ini->highlight_default; break; - case PHP_CLOSE_TAG: + case T_CLOSE_TAG: next_color = syntax_highlighter_ini->highlight_default; break; - case CONSTANT_ENCAPSED_STRING: + case T_CONSTANT_ENCAPSED_STRING: next_color = syntax_highlighter_ini->highlight_string; break; case '"': @@ -125,7 +125,7 @@ void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini) } } switch (token_type) { - case DOLLAR_OPEN_CURLY_BRACES: + case T_DOLLAR_OPEN_CURLY_BRACES: html_puts("{", 1); break; default: @@ -135,8 +135,8 @@ void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini) if (token.type == IS_STRING) { switch (token_type) { - case PHP_OPEN_TAG: - case PHP_CLOSE_TAG: + case T_OPEN_TAG: + case T_CLOSE_TAG: case T_WHITESPACE: break; default: diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c index 223cbea791..a532bac81a 100644 --- a/Zend/zend_indent.c +++ b/Zend/zend_indent.c @@ -56,7 +56,7 @@ void zend_indent() token.type = 0; while ((token_type=lex_scan(&token CLS_CC))) { switch (token_type) { - case INLINE_HTML: + case T_INLINE_HTML: zend_write(zendtext, zendleng); break; case T_WHITESPACE: { @@ -127,8 +127,8 @@ dflt_printout: } if (token.type == IS_STRING) { switch (token_type) { - case PHP_OPEN_TAG: - case PHP_CLOSE_TAG: + case T_OPEN_TAG: + case T_CLOSE_TAG: case T_WHITESPACE: break; default: diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 5cdc477796..68166ce928 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -321,59 +321,59 @@ ZEND_API void *get_binary_op(int opcode) { switch (opcode) { case ZEND_ADD: - case ZEND_ASSIGN_ADD: + case T_ASSIGN_ADD: return (void *) add_function; break; case ZEND_SUB: - case ZEND_ASSIGN_SUB: + case T_ASSIGN_SUB: return (void *) sub_function; break; case ZEND_MUL: - case ZEND_ASSIGN_MUL: + case T_ASSIGN_MUL: return (void *) mul_function; break; case ZEND_DIV: - case ZEND_ASSIGN_DIV: + case T_ASSIGN_DIV: return (void *) div_function; break; case ZEND_MOD: - case ZEND_ASSIGN_MOD: + case T_ASSIGN_MOD: return (void *) mod_function; break; case ZEND_SL: - case ZEND_ASSIGN_SL: + case T_ASSIGN_SL: return (void *) shift_left_function; break; case ZEND_SR: - case ZEND_ASSIGN_SR: + case T_ASSIGN_SR: return (void *) shift_right_function; break; case ZEND_CONCAT: - case ZEND_ASSIGN_CONCAT: + case T_ASSIGN_CONCAT: return (void *) concat_function; break; - case ZEND_IS_EQUAL: + case ZEND_T_IS_EQUAL: return (void *) is_equal_function; break; - case ZEND_IS_NOT_EQUAL: + case ZEND_T_IS_NOT_EQUAL: return (void *) is_not_equal_function; break; case ZEND_IS_SMALLER: return (void *) is_smaller_function; break; - case ZEND_IS_SMALLER_OR_EQUAL: + case ZEND_T_IS_SMALLER_OR_EQUAL: return (void *) is_smaller_or_equal_function; break; case ZEND_BW_OR: - case ZEND_ASSIGN_BW_OR: + case T_ASSIGN_BW_OR: return (void *) bitwise_or_function; break; case ZEND_BW_AND: - case ZEND_ASSIGN_BW_AND: + case T_ASSIGN_BW_AND: return (void *) bitwise_and_function; break; case ZEND_BW_XOR: - case ZEND_ASSIGN_BW_XOR: + case T_ASSIGN_BW_XOR: return (void *) bitwise_xor_function; break; default: |